Liferay 6.2.0-ce-m5

com.liferay.portlet.bookmarks.trash
Class BookmarksFolderTrashHandler

java.lang.Object
  extended by com.liferay.portal.kernel.trash.BaseTrashHandler
      extended by com.liferay.portlet.bookmarks.trash.BookmarksBaseTrashHandler
          extended by com.liferay.portlet.bookmarks.trash.BookmarksFolderTrashHandler
All Implemented Interfaces:
TrashHandler

public class BookmarksFolderTrashHandler
extends BookmarksBaseTrashHandler

Represents the trash handler for bookmarks folder entity.


Constructor Summary
BookmarksFolderTrashHandler()
           
 
Method Summary
 void deleteTrashEntry(long classPK)
          Deletes the model entity with the primary key.
protected  BookmarksFolder getBookmarksFolder(long classPK)
           
 String getClassName()
          Returns the class name handled by this trash handler.
 String getDeleteMessage()
          Returns the language key to the localized message to display next to a trash entry listed in a search result, indicating that the trash entry was found in a trashed container (e.g. folder or message board thread) this trash handler is associated with.
 ContainerModel getParentContainerModel(long classPK)
          Returns the parent container model of the model entity with the primary key.
 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.
 ContainerModel getTrashContainer(long classPK)
           
 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 isContainerModel()
          Returns true if the entity is a container model.
 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.
 boolean isRestorable(long classPK)
          Returns true if the model entity can be restored to its original location.
 void moveEntry(long userId, long classPK, long containerModelId, ServiceContext serviceContext)
          Moves the entity with the class primary key to the container model with the class primary key
 void moveTrashEntry(long userId, long classPK, long containerId, ServiceContext serviceContext)
          Moves the model entity with the primary key out of the Recycle Bin to a new destination identified by the container model ID.
 void restoreTrashEntry(long userId, long classPK)
          Restores the model entity with the primary key.
 
Methods inherited from class com.liferay.portlet.bookmarks.trash.BookmarksBaseTrashHandler
getContainerModel, getContainerModelClassName, getContainerModelName, getContainerModels, getContainerModelsCount, getParentContainerModels, getRootContainerModelName, getTrashContainedModelName, getTrashContainedModelsCount, getTrashContainedModelTrashRenderers, getTrashContainerModelName, getTrashContainerModelsCount, getTrashContainerModelTrashRenderers, isMovable
 
Methods inherited from class com.liferay.portal.kernel.trash.BaseTrashHandler
checkDuplicateTrashEntry, getAssetRendererFactory, getSubcontainerModelName, hasTrashPermission, isDeletable, restoreRelatedTrashEntry, updateTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BookmarksFolderTrashHandler

public BookmarksFolderTrashHandler()
Method Detail

deleteTrashEntry

public void deleteTrashEntry(long classPK)
                      throws PortalException,
                             SystemException
Description copied from interface: TrashHandler
Deletes the model entity with the primary key.

Parameters:
classPK - the primary key of the model entity to delete
Throws:
PortalException - if a model entity with the primary key 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

getDeleteMessage

public String getDeleteMessage()
Description copied from interface: TrashHandler
Returns the language key to the localized message to display next to a trash entry listed in a search result, indicating that the trash entry was found in a trashed container (e.g. folder or message board thread) this trash handler is associated with.

If the language key (e.g. found-in-deleted-folder-x) used accepts a single parameter, the trash framework replaces that parameter with the trashed container's name.

Specified by:
getDeleteMessage in interface TrashHandler
Overrides:
getDeleteMessage in class BaseTrashHandler
Returns:
the language key to the localized message to display next to a trash entry listed in a search result

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

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

getTrashContainer

public ContainerModel getTrashContainer(long classPK)
                                 throws PortalException,
                                        SystemException
Specified by:
getTrashContainer in interface TrashHandler
Overrides:
getTrashContainer in class BaseTrashHandler
Throws:
PortalException
SystemException

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

isContainerModel

public boolean isContainerModel()
Description copied from interface: TrashHandler
Returns true if the entity is a container model.

Specified by:
isContainerModel in interface TrashHandler
Overrides:
isContainerModel in class BaseTrashHandler
Returns:
true if the entity is a container model; false otherwise

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

isRestorable

public boolean isRestorable(long classPK)
                     throws PortalException,
                            SystemException
Description copied from interface: TrashHandler
Returns true if the model entity can be restored to its original location.

This method usually returns false if the container (e.g. folder) of the model entity is no longer available (e.g. moved to the Recycle Bin or deleted).

Specified by:
isRestorable in interface TrashHandler
Overrides:
isRestorable in class BaseTrashHandler
Parameters:
classPK - the primary key of the model entity
Returns:
true if the model entity can be restored to its original location; false otherwise
Throws:
PortalException - if a model entity with the primary key could not be found
SystemException - if a system exception occurred

moveEntry

public void moveEntry(long userId,
                      long classPK,
                      long containerModelId,
                      ServiceContext serviceContext)
               throws PortalException,
                      SystemException
Description copied from interface: TrashHandler
Moves the entity with the class primary key to the container model with the class primary key

Specified by:
moveEntry in interface TrashHandler
Overrides:
moveEntry in class BaseTrashHandler
Parameters:
userId - the user ID
classPK - the primary key of the model entity
containerModelId - the primary key of the destination container model
serviceContext - the service context to be applied
Throws:
PortalException - if a model entity with the primary key or the destination container model with the primary key could not be found
SystemException - if a system exception occurred

moveTrashEntry

public void moveTrashEntry(long userId,
                           long classPK,
                           long containerId,
                           ServiceContext serviceContext)
                    throws PortalException,
                           SystemException
Description copied from interface: TrashHandler
Moves the model entity with the primary key out of the Recycle Bin to a new destination identified by the container model ID.

Specified by:
moveTrashEntry in interface TrashHandler
Overrides:
moveTrashEntry in class BaseTrashHandler
Parameters:
userId - the user ID
classPK - the primary key of the model entity
containerId - the primary key of the destination container model
serviceContext - the service context to be applied
Throws:
PortalException - if a model entity with the primary key or the destination container model with the primary key could not be found
SystemException - if a system exception occurred

restoreTrashEntry

public void restoreTrashEntry(long userId,
                              long classPK)
                       throws PortalException,
                              SystemException
Description copied from interface: TrashHandler
Restores the model entity with the primary key.

Parameters:
userId - the user ID
classPK - the primary key of the model entity to restore
Throws:
PortalException - if a model entity with the primary key could not be found
SystemException - if a system exception occurred

getBookmarksFolder

protected BookmarksFolder getBookmarksFolder(long classPK)
                                      throws PortalException,
                                             SystemException
Specified by:
getBookmarksFolder in class BookmarksBaseTrashHandler
Throws:
PortalException
SystemException

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-m5