Liferay 6.2-ce-ga5

com.liferay.portlet.journal.trash
Class JournalBaseTrashHandler

java.lang.Object
  extended by com.liferay.portal.kernel.trash.BaseTrashHandler
      extended by com.liferay.portlet.journal.trash.JournalBaseTrashHandler
All Implemented Interfaces:
TrashHandler
Direct Known Subclasses:
JournalArticleTrashHandler, JournalFolderTrashHandler

public abstract class JournalBaseTrashHandler
extends BaseTrashHandler


Constructor Summary
JournalBaseTrashHandler()
           
 
Method Summary
 ContainerModel getContainerModel(long containerModelId)
          Returns the container model with the primary key.
 String getContainerModelClassName()
          Returns the parent container model's class name.
 String getContainerModelName()
          Returns the name of the container model (e.g. folder name).
 List<ContainerModel> getContainerModels(long classPK, long parentContainerModelId, int start, int end)
          Returns a range of all the container models that are children of the parent container model identified by the container model ID.
 int getContainerModelsCount(long classPK, long parentContainerModelId)
          Returns the number of container models that are children of the parent container model identified by the container model ID.
protected abstract  long getGroupId(long classPK)
           
 List<ContainerModel> getParentContainerModels(long classPK)
          Returns all the parent container models of the model entity with the primary key ordered by hierarchy.
 String getRootContainerModelName()
          Returns the name of the root container (e.g.
 String getTrashContainedModelName()
          Returns the name of the contained model.
 int getTrashContainedModelsCount(long classPK)
          Returns the number of model entities (excluding container model entities) that are children of the parent container model identified by the primary key.
 List<TrashRenderer> getTrashContainedModelTrashRenderers(long classPK, int start, int end)
          Returns a range of all the trash renderers of model entities (excluding container models) that are children of the parent container model identified by the primary key.
 String getTrashContainerModelName()
          Returns the name of the container model.
 int getTrashContainerModelsCount(long classPK)
          Returns the number of container models that are children of the parent container model identified by the primary key.
 List<TrashRenderer> getTrashContainerModelTrashRenderers(long classPK, int start, int end)
          Returns a range of all the trash renderers of model entities that are children of the parent container model identified by the primary key.
 boolean isMovable()
          Returns true if the entity can be moved from one container model (such as a folder) to another.
 
Methods inherited from class com.liferay.portal.kernel.trash.BaseTrashHandler
addDeletionSystemEvent, checkDuplicateEntry, checkDuplicateTrashEntry, getAssetRendererFactory, getDeleteMessage, getParentContainerModel, getParentContainerModel, getRestoreContainedModelLink, getRestoreContainerModelLink, getRestoreMessage, getSubcontainerModelName, getSystemEventClassName, getTrashEntry, getTrashRenderer, hasPermission, hasTrashPermission, isContainerModel, isDeletable, isInTrashContainer, isRestorable, isTrashEntry, moveEntry, moveTrashEntry, restoreRelatedTrashEntry, updateTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.liferay.portal.kernel.trash.TrashHandler
deleteTrashEntry, getClassName, isInTrash, restoreTrashEntry
 

Constructor Detail

JournalBaseTrashHandler

public JournalBaseTrashHandler()
Method Detail

getContainerModel

public ContainerModel getContainerModel(long containerModelId)
                                 throws PortalException,
                                        SystemException
Description copied from interface: TrashHandler
Returns the container model with the primary key.

Specified by:
getContainerModel in interface TrashHandler
Overrides:
getContainerModel in class BaseTrashHandler
Parameters:
containerModelId - the primary key of the container model
Returns:
the container model with the primary key
Throws:
PortalException - if a container model with the primary key could not be found
SystemException - if a system exception occurred

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

getContainerModels

public List<ContainerModel> getContainerModels(long classPK,
                                               long parentContainerModelId,
                                               int start,
                                               int end)
                                        throws PortalException,
                                               SystemException
Description copied from interface: TrashHandler
Returns a range of all the container models that are children of the parent container model identified by the container model ID. These container models must be able to contain the model entity identified by the primary key.

This method checks for the view permission when retrieving the container models.

Useful when paginating results. Returns a maximum of end - start instances. The start and end values are not primary keys but, rather, indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Specified by:
getContainerModels in interface TrashHandler
Overrides:
getContainerModels in class BaseTrashHandler
Parameters:
classPK - the primary key of a model entity the container models must be able to contain
parentContainerModelId - the primary key of the parent container model
start - the lower bound of the range of results
end - the upper bound of the range of results (not inclusive)
Returns:
the range of matching container models
Throws:
PortalException - if a model entity with the primary key could not be found
SystemException - if a system exception occurred

getContainerModelsCount

public int getContainerModelsCount(long classPK,
                                   long parentContainerModelId)
                            throws PortalException,
                                   SystemException
Description copied from interface: TrashHandler
Returns the number of container models that are children of the parent container model identified by the container model ID. These container models must be able to contain the model entity identified by the primary key.

This method checks for the view permission when counting the container models.

Specified by:
getContainerModelsCount in interface TrashHandler
Overrides:
getContainerModelsCount in class BaseTrashHandler
Parameters:
classPK - the primary key of a model entity the container models must be able to contain
parentContainerModelId - the primary key of the parent container model
Returns:
the number of matching container models
Throws:
PortalException - if a model entity with the primary key could not be found
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
Returns:
all the matching parent container models of the model entity
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getRootContainerModelName

public String getRootContainerModelName()
Description copied from interface: TrashHandler
Returns the name of the root container (e.g. "home").

Specified by:
getRootContainerModelName in interface TrashHandler
Overrides:
getRootContainerModelName in class BaseTrashHandler
Returns:
the name of the root container

getTrashContainedModelName

public String getTrashContainedModelName()
Description copied from interface: TrashHandler
Returns the name of the contained model.

For example, "files" may be the model name for a folder and "pages" may be the model name for a wiki node.

Specified by:
getTrashContainedModelName in interface TrashHandler
Overrides:
getTrashContainedModelName in class BaseTrashHandler
Returns:
the name of the contained model

getTrashContainedModelsCount

public int getTrashContainedModelsCount(long classPK)
                                 throws PortalException,
                                        SystemException
Description copied from interface: TrashHandler
Returns the number of model entities (excluding container model entities) that are children of the parent container model identified by the primary key.

For example, for a folder with subfolders and documents, the number of documents (excluding those explicitely moved to the recycle bin) is returned.

Specified by:
getTrashContainedModelsCount in interface TrashHandler
Overrides:
getTrashContainedModelsCount in class BaseTrashHandler
Parameters:
classPK - the primary key of a container model
Returns:
the number of model entities that are children of the parent container model identified by the primary key
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getTrashContainedModelTrashRenderers

public List<TrashRenderer> getTrashContainedModelTrashRenderers(long classPK,
                                                                int start,
                                                                int end)
                                                         throws PortalException,
                                                                SystemException
Description copied from interface: TrashHandler
Returns a range of all the trash renderers of model entities (excluding container models) that are children of the parent container model identified by the primary key.

For example, for a folder with subfolders and documents, a range of all the trash renderers of documents (excluding those explicitly moved to the recycle bin) is returned.

Useful when paginating results. Returns a maximum of end - start instances. The start and end values are not primary keys but, rather, indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Specified by:
getTrashContainedModelTrashRenderers in interface TrashHandler
Overrides:
getTrashContainedModelTrashRenderers in class BaseTrashHandler
Parameters:
classPK - the primary key of a container model
start - the lower bound of the range of results
end - the upper bound of the range of results (not inclusive)
Returns:
the range of trash renderers of model entities (excluding container models) that are children of the parent container model identified by the primary key
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getTrashContainerModelName

public String getTrashContainerModelName()
Description copied from interface: TrashHandler
Returns the name of the container model.

For example, "folder" may be the container model name for a file entry.

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

getTrashContainerModelsCount

public int getTrashContainerModelsCount(long classPK)
                                 throws PortalException,
                                        SystemException
Description copied from interface: TrashHandler
Returns the number of container models that are children of the parent container model identified by the primary key.

For example, for a folder with subfolders and documents, the number of folders (excluding those explicitly moved to the recycle bin) is returned.

Specified by:
getTrashContainerModelsCount in interface TrashHandler
Overrides:
getTrashContainerModelsCount in class BaseTrashHandler
Parameters:
classPK - the primary key of a container model
Returns:
the number of container models that are children of the parent container model identified by the primary key
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getTrashContainerModelTrashRenderers

public List<TrashRenderer> getTrashContainerModelTrashRenderers(long classPK,
                                                                int start,
                                                                int end)
                                                         throws PortalException,
                                                                SystemException
Description copied from interface: TrashHandler
Returns a range of all the trash renderers of model entities that are children of the parent container model identified by the primary key.

For example, for a folder with subfolders and documents, the range of renderers representing folders (excluding those explicitly moved to the recycle bin) is returned.

Useful when paginating results. Returns a maximum of end - start instances. The start and end values are not primary keys but, rather, indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Specified by:
getTrashContainerModelTrashRenderers in interface TrashHandler
Overrides:
getTrashContainerModelTrashRenderers in class BaseTrashHandler
Parameters:
classPK - the primary key of a container model
start - the lower bound of the range of results
end - the upper bound of the range of results (not inclusive)
Returns:
the range of matching trash renderers of model entities
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

isMovable

public boolean isMovable()
Description copied from interface: TrashHandler
Returns true if the entity can be moved from one container model (such as a folder) to another.

Specified by:
isMovable in interface TrashHandler
Overrides:
isMovable in class BaseTrashHandler
Returns:
true if the entity can be moved from one container model to another; false otherwise

getGroupId

protected abstract long getGroupId(long classPK)
                            throws PortalException,
                                   SystemException
Throws:
PortalException
SystemException

Liferay 6.2-ce-ga5