001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.trash.util;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.search.Hits;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.model.Group;
022    import com.liferay.portal.theme.ThemeDisplay;
023    import com.liferay.portlet.trash.model.TrashEntry;
024    
025    import java.util.Date;
026    import java.util.List;
027    
028    import javax.portlet.PortletURL;
029    
030    import javax.servlet.http.HttpServletRequest;
031    
032    /**
033     * @author Julio Camarero
034     */
035    public interface Trash {
036    
037            public static final String TRASH_TIME_SEPARATOR = "_TRASH_TIME_";
038    
039            public void addBaseModelBreadcrumbEntries(
040                            HttpServletRequest request, String className, long classPK,
041                            PortletURL containerModelURL)
042                    throws PortalException, SystemException;
043    
044            public void addContainerModelBreadcrumbEntries(
045                            HttpServletRequest request, String className, long classPK,
046                            PortletURL containerModelURL)
047                    throws PortalException, SystemException;
048    
049            public void deleteEntriesAttachments(
050                            long companyId, long repositoryId, Date date,
051                            String[] attachmentFileNames)
052                    throws PortalException, SystemException;
053    
054            public List<TrashEntry> getEntries(Hits hits)
055                    throws PortalException, SystemException;
056    
057            public OrderByComparator getEntryOrderByComparator(
058                    String orderByCol, String orderByType);
059    
060            public int getMaxAge(Group group) throws PortalException, SystemException;
061    
062            public String getNewName(String oldName, String token);
063    
064            public String getNewName(
065                            ThemeDisplay themeDisplay, String className, long classPK,
066                            String oldName)
067                    throws PortalException, SystemException;
068    
069            public String getOriginalTitle(String title);
070    
071            public String getTrashTime(String title, String separator);
072    
073            public String getTrashTitle(long trashEntryId);
074    
075            public PortletURL getViewContentURL(
076                            HttpServletRequest request, String className, long classPK)
077                    throws PortalException, SystemException;
078    
079            public boolean isInTrash(String className, long classPK)
080                    throws PortalException, SystemException;
081    
082            public boolean isTrashEnabled(long groupId)
083                    throws PortalException, SystemException;
084    
085    }