Example usage for com.liferay.portal.kernel.trash TrashHandler restoreRelatedTrashEntry

List of usage examples for com.liferay.portal.kernel.trash TrashHandler restoreRelatedTrashEntry

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.trash TrashHandler restoreRelatedTrashEntry.

Prototype

public void restoreRelatedTrashEntry(String className, long classPK) throws PortalException;

Source Link

Document

Restores the model entity that is related to the model entity with the class name and class PK.

Usage

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

License:Open Source License

@Override
public void restoreTrashEntry(long userId, long classPK) throws PortalException {

    DLFileEntry dlFileEntry = getDLFileEntry(classPK);

    if ((dlFileEntry.getClassNameId() > 0) && (dlFileEntry.getClassPK() > 0)) {

        TrashHandler trashHandler = TrashHandlerRegistryUtil.getTrashHandler(dlFileEntry.getClassName());

        trashHandler.restoreRelatedTrashEntry(getClassName(), classPK);

        return;//from  www  .j  a  v  a2s .  co m
    }

    _dlTrashLocalService.restoreFileEntryFromTrash(userId, dlFileEntry.getRepositoryId(), classPK);
}