001    /**
002     * Copyright (c) 2000-2012 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    /**
029     * @author Julio Camarero
030     */
031    public interface Trash {
032    
033            public String appendTrashNamespace(String title);
034    
035            public String appendTrashNamespace(String title, String separator);
036    
037            public void deleteEntriesAttachments(
038                            long companyId, long repositoryId, Date date,
039                            String[] attachmentFileNames)
040                    throws PortalException, SystemException;
041    
042            public List<TrashEntry> getEntries(Hits hits)
043                    throws PortalException, SystemException;
044    
045            public OrderByComparator getEntryOrderByComparator(
046                    String orderByCol, String orderByType);
047    
048            public int getMaxAge(Group group) throws PortalException, SystemException;
049    
050            public String getNewName(ThemeDisplay themeDisplay, String oldName);
051    
052            public String getTrashTime(String title, String separator);
053    
054            public boolean isInTrash(String className, long classPK)
055                    throws PortalException, SystemException;
056    
057            public boolean isTrashEnabled(long groupId)
058                    throws PortalException, SystemException;
059    
060            public void moveAttachmentFromTrash(
061                            long companyId, long repositoryId, String deletedFileName,
062                            String attachmentsDir)
063                    throws PortalException, SystemException;
064    
065            public void moveAttachmentFromTrash(
066                            long companyId, long repositoryId, String deletedFileName,
067                            String attachmentsDir, String separator)
068                    throws PortalException, SystemException;
069    
070            public String moveAttachmentToTrash(
071                            long companyId, long repositoryId, String fileName,
072                            String deletedAttachmentsDir)
073                    throws PortalException, SystemException;
074    
075            public String moveAttachmentToTrash(
076                            long companyId, long repositoryId, String fileName,
077                            String deletedAttachmentsDir, String separator)
078                    throws PortalException, SystemException;
079    
080            public String stripTrashNamespace(String title);
081    
082            public String stripTrashNamespace(String title, String separator);
083    
084    }