public class JournalArticleTrashHandler extends JournalBaseTrashHandler
Constructor and Description |
---|
JournalArticleTrashHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkDuplicateEntry(long classPK,
long trashEntryId,
java.lang.String originalTitle,
java.lang.String newName) |
protected void |
checkRestorableEntry(long classPK,
long trashEntryId,
long containerModelId,
java.lang.String originalTitle,
java.lang.String newName) |
void |
checkRestorableEntry(long classPK,
long containerModelId,
java.lang.String newName) |
void |
checkRestorableEntry(TrashEntry trashEntry,
long containerModelId,
java.lang.String newName)
Checks if a duplicate trash entry already exists in the destination
container.
|
protected void |
checkValidContainer(long classPK,
long containerModelId) |
void |
deleteTrashEntry(long classPK)
Deletes the model entity with the primary key.
|
java.lang.String |
getClassName()
Returns the class name handled by this trash handler.
|
Filter |
getExcludeFilter(SearchContext searchContext) |
protected long |
getGroupId(long classPK) |
ContainerModel |
getParentContainerModel(long classPK)
Returns the parent container model of the model entity with the primary
key.
|
ContainerModel |
getParentContainerModel(TrashedModel trashedModel) |
java.lang.String |
getRestoreContainerModelLink(javax.portlet.PortletRequest portletRequest,
long classPK)
Returns the link to the location to which the model entity was restored.
|
java.lang.String |
getRestoreMessage(javax.portlet.PortletRequest portletRequest,
long classPK)
Returns the message describing the location to which the model entity was
restored.
|
TrashEntry |
getTrashEntry(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,
java.lang.String actionId) |
boolean |
hasTrashPermission(PermissionChecker permissionChecker,
long groupId,
long classPK,
java.lang.String trashActionId)
Returns
true if the user has the required permission to
perform the trash action on the model entity with the primary key. |
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.
|
protected void |
setDDMStructureLocalService(DDMStructureLocalService ddmStructureLocalService) |
protected void |
setJournalArticleLocalService(JournalArticleLocalService journalArticleLocalService) |
protected void |
setJournalArticleResourceLocalService(JournalArticleResourceLocalService journalArticleResourceLocalService) |
protected void |
setJournalFolderLocalService(JournalFolderLocalService journalFolderLocalService) |
void |
updateTitle(long classPK,
java.lang.String name)
Updates the title of the model entity with the primary key.
|
getContainerModel, getContainerModelClassName, getContainerModelName, getContainerModels, getContainerModelsCount, getParentContainerModels, getRootContainerModelName, getSubcontainerModelName, getTrashContainedModelName, getTrashContainedModelsCount, getTrashContainedModelTrashRenderers, getTrashContainerModelName, getTrashContainerModelsCount, getTrashContainerModelTrashRenderers, getTrashModelsCount, getTrashModelTrashRenderers, isMovable
addDeletionSystemEvent, checkDuplicateEntry, checkDuplicateTrashEntry, getAssetRendererFactory, getContainerModelClassName, getDeleteMessage, getDestinationContainerModelId, getExcludeQuery, getRestoreContainedModelLink, getSystemEventClassName, isContainerModel, isDeletable, restoreRelatedTrashEntry
public void checkRestorableEntry(long classPK, long containerModelId, java.lang.String newName) throws PortalException
checkRestorableEntry
in interface TrashHandler
checkRestorableEntry
in class BaseTrashHandler
PortalException
public void checkRestorableEntry(TrashEntry trashEntry, long containerModelId, java.lang.String newName) throws PortalException
TrashHandler
This method is used to check for duplicates when a trash entry is being restored or moved out of the Recycle Bin.
checkRestorableEntry
in interface TrashHandler
checkRestorableEntry
in class BaseTrashHandler
trashEntry
- the trash entry to checkcontainerModelId
- 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)PortalException
public void deleteTrashEntry(long classPK) throws PortalException
TrashHandler
classPK
- the primary key of the model entity to deletePortalException
public java.lang.String getClassName()
TrashHandler
public Filter getExcludeFilter(SearchContext searchContext)
getExcludeFilter
in interface TrashHandler
getExcludeFilter
in class BaseTrashHandler
public ContainerModel getParentContainerModel(long classPK) throws PortalException
TrashHandler
getParentContainerModel
in interface TrashHandler
getParentContainerModel
in class BaseTrashHandler
classPK
- the primary key of a model entity the container models
must be able to containPortalException
public ContainerModel getParentContainerModel(TrashedModel trashedModel) throws PortalException
getParentContainerModel
in interface TrashHandler
getParentContainerModel
in class BaseTrashHandler
PortalException
public java.lang.String getRestoreContainerModelLink(javax.portlet.PortletRequest portletRequest, long classPK) throws PortalException
TrashHandler
getRestoreContainerModelLink
in interface TrashHandler
getRestoreContainerModelLink
in class BaseTrashHandler
portletRequest
- the portlet requestclassPK
- the primary key of the restored model entityPortalException
public java.lang.String getRestoreMessage(javax.portlet.PortletRequest portletRequest, long classPK) throws PortalException
TrashHandler
getRestoreMessage
in interface TrashHandler
getRestoreMessage
in class BaseTrashHandler
portletRequest
- the portlet requestclassPK
- the primary key of the restored model entityPortalException
public TrashEntry getTrashEntry(long classPK) throws PortalException
getTrashEntry
in interface TrashHandler
getTrashEntry
in class BaseTrashHandler
PortalException
public TrashRenderer getTrashRenderer(long classPK) throws PortalException
TrashHandler
getTrashRenderer
in interface TrashHandler
getTrashRenderer
in class BaseTrashHandler
classPK
- the primary key of the model entityPortalException
public boolean hasTrashPermission(PermissionChecker permissionChecker, long groupId, long classPK, java.lang.String trashActionId) throws PortalException
TrashHandler
true
if the user has the required permission to
perform the trash action on the model entity with the primary key.
This method is a mapper for special Recycle Bin operations that are not real permissions. The implementations of this method should translate these virtual permissions to real permission checks.
hasTrashPermission
in interface TrashHandler
hasTrashPermission
in class BaseTrashHandler
permissionChecker
- the permission checkergroupId
- the primary key of the groupclassPK
- the primary key of the model entitytrashActionId
- the trash action permission to checktrue
if the user has the required permission;
false
otherwisePortalException
public boolean isInTrash(long classPK) throws PortalException
TrashHandler
true
if the model entity with the primary key is in
the Recycle Bin.classPK
- the primary key of the model entitytrue
if the model entity is in the Recycle Bin;
false
otherwisePortalException
public boolean isInTrashContainer(long classPK) throws PortalException
TrashHandler
true
if the model entity with the primary key is in
a container that is in the Recycle Bin.isInTrashContainer
in interface TrashHandler
isInTrashContainer
in class BaseTrashHandler
classPK
- the primary key of the model entitytrue
if the model entity with the primary key is in
a container that is in the Recycle Bin; false
otherwisePortalException
public boolean isRestorable(long classPK) throws PortalException
TrashHandler
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).
isRestorable
in interface TrashHandler
isRestorable
in class BaseTrashHandler
classPK
- the primary key of the model entitytrue
if the model entity can be restored to its
original location; false
otherwisePortalException
public void moveEntry(long userId, long classPK, long containerModelId, ServiceContext serviceContext) throws PortalException
TrashHandler
moveEntry
in interface TrashHandler
moveEntry
in class BaseTrashHandler
userId
- the user IDclassPK
- the primary key of the model entitycontainerModelId
- the primary key of the destination container
modelserviceContext
- the service context to be appliedPortalException
public void moveTrashEntry(long userId, long classPK, long containerId, ServiceContext serviceContext) throws PortalException
TrashHandler
moveTrashEntry
in interface TrashHandler
moveTrashEntry
in class BaseTrashHandler
userId
- the user IDclassPK
- the primary key of the model entitycontainerId
- the primary key of the destination container
modelserviceContext
- the service context to be appliedPortalException
public void restoreTrashEntry(long userId, long classPK) throws PortalException
TrashHandler
userId
- the user IDclassPK
- the primary key of the model entity to restorePortalException
public void updateTitle(long classPK, java.lang.String name) throws PortalException
TrashHandler
com.liferay.portlet.trash.action.EditEntryAction
before restoring the model entity via its restore rename action.updateTitle
in interface TrashHandler
updateTitle
in class BaseTrashHandler
classPK
- the primary key of the model entityname
- the title to be assignedPortalException
protected void checkDuplicateEntry(long classPK, long trashEntryId, java.lang.String originalTitle, java.lang.String newName) throws PortalException
PortalException
protected void checkRestorableEntry(long classPK, long trashEntryId, long containerModelId, java.lang.String originalTitle, java.lang.String newName) throws PortalException
PortalException
protected void checkValidContainer(long classPK, long containerModelId) throws PortalException
PortalException
protected long getGroupId(long classPK) throws PortalException
getGroupId
in class JournalBaseTrashHandler
PortalException
protected boolean hasPermission(PermissionChecker permissionChecker, long classPK, java.lang.String actionId) throws PortalException
hasPermission
in class BaseTrashHandler
PortalException
protected void setDDMStructureLocalService(DDMStructureLocalService ddmStructureLocalService)
protected void setJournalArticleLocalService(JournalArticleLocalService journalArticleLocalService)
protected void setJournalArticleResourceLocalService(JournalArticleResourceLocalService journalArticleResourceLocalService)
protected void setJournalFolderLocalService(JournalFolderLocalService journalFolderLocalService)