Example usage for com.liferay.portal.kernel.repository.capabilities TrashCapability moveFileShortcutFromTrash

List of usage examples for com.liferay.portal.kernel.repository.capabilities TrashCapability moveFileShortcutFromTrash

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.repository.capabilities TrashCapability moveFileShortcutFromTrash.

Prototype

public FileShortcut moveFileShortcutFromTrash(long userId, FileShortcut fileShortcut, Folder newFolder,
            ServiceContext serviceContext) throws PortalException;

Source Link

Usage

From source file:com.liferay.document.library.internal.trash.DLFileShortcutTrashHandler.java

License:Open Source License

@Override
public void moveTrashEntry(long userId, long classPK, long containerModelId, ServiceContext serviceContext)
        throws PortalException {

    DocumentRepository documentRepository = getDocumentRepository(classPK);

    TrashCapability trashCapability = documentRepository.getCapability(TrashCapability.class);

    Folder newFolder = null;/*from w w  w.ja va  2s  .com*/

    if (containerModelId != DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
        newFolder = documentRepository.getFolder(containerModelId);
    }

    FileShortcut fileShortcut = documentRepository.getFileShortcut(classPK);

    trashCapability.moveFileShortcutFromTrash(userId, fileShortcut, newFolder, serviceContext);
}