|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.portal.kernel.trash.BaseTrashHandler com.liferay.portlet.journal.trash.JournalBaseTrashHandler com.liferay.portlet.journal.trash.JournalFolderTrashHandler
public class JournalFolderTrashHandler
Implements trash handling for the journal folder entity.
Constructor Summary | |
---|---|
JournalFolderTrashHandler()
|
Method Summary | |
---|---|
protected void |
checkDuplicateEntry(long classPK,
long trashEntryId,
long containerModelId,
String originalTitle,
String newName)
|
void |
checkDuplicateEntry(long classPK,
long containerModelId,
String newName)
|
void |
checkDuplicateTrashEntry(TrashEntry trashEntry,
long containerModelId,
String newName)
Checks if a duplicate trash entry already exists in the destination container. |
void |
deleteTrashEntry(long classPK)
Deletes the model entity with the primary key. |
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. |
protected long |
getGroupId(long classPK)
|
protected JournalFolder |
getJournalFolder(long classPK)
|
ContainerModel |
getParentContainerModel(long classPK)
Returns the parent container model of the model entity with the primary key. |
String |
getRestoreContainedModelLink(PortletRequest portletRequest,
long classPK)
|
String |
getRestoreContainerModelLink(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. |
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,
String actionId)
|
boolean |
hasTrashPermission(PermissionChecker permissionChecker,
long groupId,
long classPK,
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 |
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 containerModelId,
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. |
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 |
---|
addDeletionSystemEvent, getAssetRendererFactory, getParentContainerModel, getSubcontainerModelName, getSystemEventClassName, isDeletable, isTrashEntry, restoreRelatedTrashEntry |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JournalFolderTrashHandler()
Method Detail |
---|
public void checkDuplicateEntry(long classPK, long containerModelId, String newName) throws PortalException, SystemException
checkDuplicateEntry
in interface TrashHandler
checkDuplicateEntry
in class BaseTrashHandler
PortalException
SystemException
public void checkDuplicateTrashEntry(TrashEntry trashEntry, long containerModelId, String newName) throws PortalException, SystemException
TrashHandler
This method is used to check for duplicates when a trash entry is being restored or moved out of the Recycle Bin.
checkDuplicateTrashEntry
in interface TrashHandler
checkDuplicateTrashEntry
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
- if a duplicate trash entry already existed in the
destination container
SystemException
- if a system exception occurredpublic void deleteTrashEntry(long classPK) throws PortalException, SystemException
TrashHandler
classPK
- the primary key of the model entity to delete
PortalException
- if a model entity with the primary key could not
be found
SystemException
- if a system exception occurredpublic String getClassName()
TrashHandler
public String getDeleteMessage()
TrashHandler
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.
getDeleteMessage
in interface TrashHandler
getDeleteMessage
in class BaseTrashHandler
public ContainerModel getParentContainerModel(long classPK) throws PortalException, SystemException
TrashHandler
getParentContainerModel
in interface TrashHandler
getParentContainerModel
in class BaseTrashHandler
classPK
- the primary key of a model entity the container models
must be able to contain
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic String getRestoreContainedModelLink(PortletRequest portletRequest, long classPK) throws PortalException, SystemException
getRestoreContainedModelLink
in interface TrashHandler
getRestoreContainedModelLink
in class BaseTrashHandler
PortalException
SystemException
public String getRestoreContainerModelLink(PortletRequest portletRequest, long classPK) throws PortalException, SystemException
TrashHandler
getRestoreContainerModelLink
in interface TrashHandler
getRestoreContainerModelLink
in class BaseTrashHandler
portletRequest
- the portlet requestclassPK
- the primary key of the restored model entity
PortalException
- if a model entity with the primary key could not
be found
SystemException
- if a system exception occurredpublic String getRestoreMessage(PortletRequest portletRequest, long classPK) throws PortalException, SystemException
TrashHandler
getRestoreMessage
in interface TrashHandler
getRestoreMessage
in class BaseTrashHandler
portletRequest
- the portlet requestclassPK
- the primary key of the restored model entity
PortalException
- if a model entity with the primary key could not
be found
SystemException
- if a system exception occurredpublic TrashEntry getTrashEntry(long classPK) throws PortalException, SystemException
getTrashEntry
in interface TrashHandler
getTrashEntry
in class BaseTrashHandler
PortalException
SystemException
public TrashRenderer getTrashRenderer(long classPK) throws PortalException, SystemException
TrashHandler
getTrashRenderer
in interface TrashHandler
getTrashRenderer
in class BaseTrashHandler
classPK
- the primary key of the model entity
PortalException
- if a model entity with the primary key could not
be found
SystemException
- if a system exception occurredpublic boolean hasTrashPermission(PermissionChecker permissionChecker, long groupId, long classPK, String trashActionId) throws PortalException, SystemException
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 check
true
if the user has the required permission;
false
otherwise
PortalException
- if a model entity with the primary key could not
be found
SystemException
- if a system exception occurredpublic boolean isContainerModel()
TrashHandler
true
if the entity is a container model.
isContainerModel
in interface TrashHandler
isContainerModel
in class BaseTrashHandler
true
if the entity is a container model;
false
otherwisepublic boolean isInTrash(long classPK) throws PortalException, SystemException
TrashHandler
true
if the model entity with the primary key is in
the Recycle Bin.
classPK
- the primary key of the model entity
true
if the model entity is in the Recycle Bin;
false
otherwise
PortalException
- if a model entity with the primary key could not
be found in the portal
SystemException
- if a system exception occurredpublic boolean isInTrashContainer(long classPK) throws PortalException, SystemException
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 entity
true
if the model entity with the primary key is in
a container that is in the Recycle Bin; false
otherwise
PortalException
- if a model entity with the primary key could not
be found in the portal
SystemException
- if a system exception occurredpublic boolean isRestorable(long classPK) throws PortalException, SystemException
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 entity
true
if the model entity can be restored to its
original location; false
otherwise
PortalException
- if a model entity with the primary key could not
be found
SystemException
- if a system exception occurredpublic void moveEntry(long userId, long classPK, long containerModelId, ServiceContext serviceContext) throws PortalException, SystemException
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 applied
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 occurredpublic void moveTrashEntry(long userId, long classPK, long containerModelId, ServiceContext serviceContext) throws PortalException, SystemException
TrashHandler
moveTrashEntry
in interface TrashHandler
moveTrashEntry
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 applied
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 occurredpublic void restoreTrashEntry(long userId, long classPK) throws PortalException, SystemException
TrashHandler
userId
- the user IDclassPK
- the primary key of the model entity to restore
PortalException
- if a model entity with the primary key could not
be found
SystemException
- if a system exception occurredpublic void updateTitle(long classPK, String name) throws PortalException, SystemException
TrashHandler
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 assigned
PortalException
- if a model entity with the primary key could not
be found
SystemException
- if a system exception occurredprotected void checkDuplicateEntry(long classPK, long trashEntryId, long containerModelId, String originalTitle, String newName) throws PortalException, SystemException
PortalException
SystemException
protected long getGroupId(long classPK) throws PortalException, SystemException
getGroupId
in class JournalBaseTrashHandler
PortalException
SystemException
protected JournalFolder getJournalFolder(long classPK) throws PortalException, SystemException
PortalException
SystemException
protected boolean hasPermission(PermissionChecker permissionChecker, long classPK, String actionId) throws PortalException, SystemException
hasPermission
in class BaseTrashHandler
PortalException
SystemException
|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |