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