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.portal.kernel.repository.capabilities;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.repository.model.FileEntry;
019    import com.liferay.portal.kernel.repository.model.FileShortcut;
020    import com.liferay.portal.kernel.repository.model.Folder;
021    import com.liferay.portal.service.ServiceContext;
022    
023    /**
024     * @author Adolfo P??rez
025     */
026    public interface TrashCapability extends Capability {
027    
028            public void deleteFileEntry(FileEntry fileEntry) throws PortalException;
029    
030            public void deleteFolder(Folder folder) throws PortalException;
031    
032            public boolean isInTrash(Folder folder) throws PortalException;
033    
034            public FileEntry moveFileEntryFromTrash(
035                            long userId, FileEntry fileEntry, Folder newFolder,
036                            ServiceContext serviceContext)
037                    throws PortalException;
038    
039            public FileEntry moveFileEntryToTrash(long userId, FileEntry fileEntry)
040                    throws PortalException;
041    
042            public FileShortcut moveFileShortcutFromTrash(
043                            long userId, FileShortcut fileShortcut, Folder newFolder,
044                            ServiceContext serviceContext)
045                    throws PortalException;
046    
047            public FileShortcut moveFileShortcutToTrash(
048                            long userId, FileShortcut fileShortcut)
049                    throws PortalException;
050    
051            public Folder moveFolderFromTrash(
052                            long userId, Folder folder, Folder destinationFolder,
053                            ServiceContext serviceContext)
054                    throws PortalException;
055    
056            public Folder moveFolderToTrash(long userId, Folder folder)
057                    throws PortalException;
058    
059            public void restoreFileEntryFromTrash(long userId, FileEntry fileEntry)
060                    throws PortalException;
061    
062            public void restoreFileShortcutFromTrash(
063                            long userId, FileShortcut fileShortcut)
064                    throws PortalException;
065    
066            public void restoreFolderFromTrash(long userId, Folder folder)
067                    throws PortalException;
068    
069    }