001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
021    import com.liferay.portal.kernel.search.Hits;
022    import com.liferay.portal.kernel.util.OrderByComparator;
023    import com.liferay.portal.model.Group;
024    import com.liferay.portal.model.TrashedModel;
025    import com.liferay.portal.theme.ThemeDisplay;
026    import com.liferay.portlet.trash.model.TrashEntry;
027    
028    import java.util.Date;
029    import java.util.List;
030    
031    import javax.portlet.ActionRequest;
032    import javax.portlet.PortletException;
033    import javax.portlet.PortletURL;
034    
035    import javax.servlet.http.HttpServletRequest;
036    
037    /**
038     * @author Julio Camarero
039     */
040    @ProviderType
041    public interface Trash {
042    
043            public static final String TRASH_TIME_SEPARATOR = "_TRASH_TIME_";
044    
045            public void addBaseModelBreadcrumbEntries(
046                            HttpServletRequest request,
047                            LiferayPortletResponse liferayPortletResponse, String className,
048                            long classPK, PortletURL containerModelURL)
049                    throws PortalException, PortletException;
050    
051            public void addContainerModelBreadcrumbEntries(
052                            HttpServletRequest request,
053                            LiferayPortletResponse liferayPortletResponse, String className,
054                            long classPK, PortletURL containerModelURL)
055                    throws PortalException, PortletException;
056    
057            public void addTrashSessionMessages(
058                    ActionRequest actionRequest, List<TrashedModel> trashedModels);
059    
060            public void addTrashSessionMessages(
061                    ActionRequest actionRequest, List<TrashedModel> trashedModels,
062                    String cmd);
063    
064            public void addTrashSessionMessages(
065                    ActionRequest actionRequest, TrashedModel trashedModel);
066    
067            public void addTrashSessionMessages(
068                    ActionRequest actionRequest, TrashedModel trashedModel, String cmd);
069    
070            public void deleteEntriesAttachments(
071                    long companyId, long repositoryId, Date date,
072                    String[] attachmentFileNames);
073    
074            public Group disableTrash(Group group);
075    
076            public List<TrashEntry> getEntries(Hits hits) throws PortalException;
077    
078            public OrderByComparator<TrashEntry> getEntryOrderByComparator(
079                    String orderByCol, String orderByType);
080    
081            public int getMaxAge(Group group) throws PortalException;
082    
083            public String getNewName(String oldName, String token);
084    
085            public String getNewName(
086                            ThemeDisplay themeDisplay, String className, long classPK,
087                            String oldName)
088                    throws PortalException;
089    
090            public String getOriginalTitle(String title);
091    
092            public String getOriginalTitle(String title, String paramName);
093    
094            public String getTrashTime(String title, String separator);
095    
096            public String getTrashTitle(long trashEntryId);
097    
098            public PortletURL getViewContentURL(
099                            HttpServletRequest request, long trashEntryId)
100                    throws PortalException;
101    
102            public PortletURL getViewContentURL(
103                            HttpServletRequest request, String className, long classPK)
104                    throws PortalException;
105    
106            public PortletURL getViewURL(HttpServletRequest request)
107                    throws PortalException;
108    
109            public boolean isInTrash(String className, long classPK)
110                    throws PortalException;
111    
112            public boolean isTrashEnabled(Group group);
113    
114            public boolean isTrashEnabled(long groupId) throws PortalException;
115    
116            public boolean isValidTrashTitle(String title);
117    
118    }