Liferay 6.2.0-ce-m4

com.liferay.portlet.wiki.trash
Class WikiPageTrashHandler

java.lang.Object
  extended by com.liferay.portal.kernel.trash.BaseTrashHandler
      extended by com.liferay.portlet.wiki.trash.WikiPageTrashHandler
All Implemented Interfaces:
TrashHandler

public class WikiPageTrashHandler
extends BaseTrashHandler

Implements trash handling for the wiki page entity.


Field Summary
static String CLASS_NAME
           
 
Constructor Summary
WikiPageTrashHandler()
           
 
Method Summary
 void checkDuplicateTrashEntry(TrashEntry trashEntry, long containerModelId, String newName)
          Checks if a duplicate trash entry already exists in the destination container.
 void deleteTrashEntries(long[] classPKs, boolean checkPermission)
          Deletes all the model entities with the primary keys, optionally checking permission before deleting each model entity.
 String getClassName()
          Returns the class name handled by this trash handler.
 String getContainerModelClassName()
          Returns the parent container model's class name.
 String getContainerModelName()
          Returns the name of the container model (e.g. folder name).
 ContainerModel getParentContainerModel(long classPK)
          Returns the parent container model of the model entity with the primary key.
 List<ContainerModel> getParentContainerModels(long classPK)
          Returns all the parent container models of the model entity with the primary key ordered by hierarchy.
 String getRestoreLink(PortletRequest portletRequest, long classPK)
          Returns the link to the location to which the model entity was restored.
 String getRestoreMessage(PortletRequest portletRequest, long classPK)
          Returns the message describing the location to which the model entity was restored.
 TrashRenderer getTrashRenderer(long classPK)
          Returns the trash renderer associated to the model entity with the primary key.
protected  boolean hasPermission(PermissionChecker permissionChecker, long classPK, String actionId)
           
 boolean isInTrash(long classPK)
          Returns true if the model entity with the primary key is in the Recycle Bin.
 boolean isInTrashContainer(long classPK)
          Returns true if the model entity with the primary key is in a container that is in the Recycle Bin.
 void restoreRelatedTrashEntry(String className, long classPK)
          Restores the model entity that is related to the model entity with the class name and class PK.
 void restoreTrashEntries(long[] classPKs)
          Restores all the model entities with the primary keys.
 void updateTitle(long classPK, String name)
          Updates the title of the model entity with the primary key.
 
Methods inherited from class com.liferay.portal.kernel.trash.BaseTrashHandler
deleteTrashEntries, deleteTrashEntry, deleteTrashEntry, getAssetRendererFactory, getContainerModel, getContainerModels, getContainerModelsCount, getDeleteMessage, getRootContainerModelName, getSubcontainerModelName, getTrashContainedModelName, getTrashContainedModelsCount, getTrashContainedModelTrashRenderers, getTrashContainerModelName, getTrashContainerModelsCount, getTrashContainerModelTrashRenderers, hasTrashPermission, isContainerModel, isDeletable, isMovable, isRestorable, moveEntry, moveTrashEntry, restoreTrashEntry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

public static final String CLASS_NAME
Constructor Detail

WikiPageTrashHandler

public WikiPageTrashHandler()
Method Detail

checkDuplicateTrashEntry

public void checkDuplicateTrashEntry(TrashEntry trashEntry,
                                     long containerModelId,
                                     String newName)
                              throws PortalException,
                                     SystemException
Description copied from interface: TrashHandler
Checks if a duplicate trash entry already exists in the destination container.

This method is used to check for duplicates when a trash entry is being restored or moved out of the Recycle Bin.

Specified by:
checkDuplicateTrashEntry in interface TrashHandler
Overrides:
checkDuplicateTrashEntry in class BaseTrashHandler
Parameters:
trashEntry - the trash entry to check
containerModelId - the primary key of the destination (e.g. folder)
newName - the new name to be assigned to the trash entry (optionally null to forego renaming the trash entry)
Throws:
PortalException - if a duplicate trash entry already existed in the destination container
SystemException - if a system exception occurred

deleteTrashEntries

public void deleteTrashEntries(long[] classPKs,
                               boolean checkPermission)
                        throws PortalException,
                               SystemException
Description copied from interface: TrashHandler
Deletes all the model entities with the primary keys, optionally checking permission before deleting each model entity.

Parameters:
classPKs - the primary keys of the model entities to delete
checkPermission - whether to check permission before deleting each model entity
Throws:
PortalException - if any one of the model entities could not be found
SystemException - if a system exception occurred

getClassName

public String getClassName()
Description copied from interface: TrashHandler
Returns the class name handled by this trash handler.

Returns:
the class name handled by this trash handler

getContainerModelClassName

public String getContainerModelClassName()
Description copied from interface: TrashHandler
Returns the parent container model's class name.

Specified by:
getContainerModelClassName in interface TrashHandler
Overrides:
getContainerModelClassName in class BaseTrashHandler

getContainerModelName

public String getContainerModelName()
Description copied from interface: TrashHandler
Returns the name of the container model (e.g. folder name).

Specified by:
getContainerModelName in interface TrashHandler
Overrides:
getContainerModelName in class BaseTrashHandler
Returns:
the name of the container model

getParentContainerModel

public ContainerModel getParentContainerModel(long classPK)
                                       throws PortalException,
                                              SystemException
Description copied from interface: TrashHandler
Returns the parent container model of the model entity with the primary key.

Specified by:
getParentContainerModel in interface TrashHandler
Overrides:
getParentContainerModel in class BaseTrashHandler
Parameters:
classPK - the primary key of a model entity the container models must be able to contain
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getParentContainerModels

public List<ContainerModel> getParentContainerModels(long classPK)
                                              throws PortalException,
                                                     SystemException
Description copied from interface: TrashHandler
Returns all the parent container models of the model entity with the primary key ordered by hierarchy.

For example, if the primary key is for a file entry inside folder C, which is inside folder B, which is inside folder A; this method returns container models for folders A, B, and C.

Specified by:
getParentContainerModels in interface TrashHandler
Overrides:
getParentContainerModels in class BaseTrashHandler
Parameters:
classPK - the primary key of a model entity the container models must be able to contain
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getRestoreLink

public String getRestoreLink(PortletRequest portletRequest,
                             long classPK)
                      throws PortalException,
                             SystemException
Description copied from interface: TrashHandler
Returns the link to the location to which the model entity was restored.

Specified by:
getRestoreLink in interface TrashHandler
Overrides:
getRestoreLink in class BaseTrashHandler
Parameters:
portletRequest - the portlet request
classPK - the primary key of the restored model entity
Returns:
the restore link
Throws:
PortalException - if a model entity with the primary key could not be found
SystemException - if a system exception occurred

getRestoreMessage

public String getRestoreMessage(PortletRequest portletRequest,
                                long classPK)
                         throws PortalException,
                                SystemException
Description copied from interface: TrashHandler
Returns the message describing the location to which the model entity was restored.

Specified by:
getRestoreMessage in interface TrashHandler
Overrides:
getRestoreMessage in class BaseTrashHandler
Parameters:
portletRequest - the portlet request
classPK - the primary key of the restored model entity
Returns:
the restore message
Throws:
PortalException - if a model entity with the primary key could not be found
SystemException - if a system exception occurred

getTrashRenderer

public TrashRenderer getTrashRenderer(long classPK)
                               throws PortalException,
                                      SystemException
Description copied from interface: TrashHandler
Returns the trash renderer associated to the model entity with the primary key.

Specified by:
getTrashRenderer in interface TrashHandler
Overrides:
getTrashRenderer in class BaseTrashHandler
Parameters:
classPK - the primary key of the model entity
Returns:
the trash renderer associated to the model entity
Throws:
PortalException - if a model entity with the primary key could not be found
SystemException - if a system exception occurred

isInTrash

public boolean isInTrash(long classPK)
                  throws PortalException,
                         SystemException
Description copied from interface: TrashHandler
Returns true if the model entity with the primary key is in the Recycle Bin.

Parameters:
classPK - the primary key of the model entity
Returns:
true if the model entity is in the Recycle Bin; false otherwise
Throws:
PortalException - if a model entity with the primary key could not be found in the portal
SystemException - if a system exception occurred

isInTrashContainer

public boolean isInTrashContainer(long classPK)
                           throws PortalException,
                                  SystemException
Description copied from interface: TrashHandler
Returns true if the model entity with the primary key is in a container that is in the Recycle Bin.

Specified by:
isInTrashContainer in interface TrashHandler
Overrides:
isInTrashContainer in class BaseTrashHandler
Parameters:
classPK - the primary key of the model entity
Returns:
true if the model entity with the primary key is in a container that is in the Recycle Bin; false otherwise
Throws:
PortalException - if a model entity with the primary key could not be found in the portal
SystemException - if a system exception occurred

restoreRelatedTrashEntry

public void restoreRelatedTrashEntry(String className,
                                     long classPK)
                              throws PortalException,
                                     SystemException
Description copied from interface: TrashHandler
Restores the model entity that is related to the model entity with the class name and class PK. For example, restoreRelatedTrashEntry( String, long) restores the attachment related to the wiki page with the class name and class PK.

Specified by:
restoreRelatedTrashEntry in interface TrashHandler
Overrides:
restoreRelatedTrashEntry in class BaseTrashHandler
Parameters:
className - the class name of the model entity with a related model entity to restore
classPK - the primary key of the model entity with a related model entity to restore
Throws:
PortalException - if a model entity with the primary key could not be found
SystemException - if a system exception occurred

restoreTrashEntries

public void restoreTrashEntries(long[] classPKs)
                         throws PortalException,
                                SystemException
Description copied from interface: TrashHandler
Restores all the model entities with the primary keys.

Parameters:
classPKs - the primary keys of the model entities to restore
Throws:
PortalException - if any one of the model entities could not be found
SystemException - if a system exception occurred

updateTitle

public void updateTitle(long classPK,
                        String name)
                 throws PortalException,
                        SystemException
Description copied from interface: TrashHandler
Updates the title of the model entity with the primary key. This method is called by EditEntryAction before restoring the model entity via its restore rename action.

Specified by:
updateTitle in interface TrashHandler
Overrides:
updateTitle in class BaseTrashHandler
Parameters:
classPK - the primary key of the model entity
name - the title to be assigned
Throws:
PortalException - if a model entity with the primary key could not be found
SystemException - if a system exception occurred

hasPermission

protected boolean hasPermission(PermissionChecker permissionChecker,
                                long classPK,
                                String actionId)
                         throws PortalException,
                                SystemException
Specified by:
hasPermission in class BaseTrashHandler
Throws:
PortalException
SystemException

Liferay 6.2.0-ce-m4