|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.liferay.portal.kernel.trash.BaseTrashHandler
com.liferay.portlet.wiki.trash.WikiNodeTrashHandler
public class WikiNodeTrashHandler
Implements trash handling for the wiki node entity.
Constructor Summary | |
---|---|
WikiNodeTrashHandler()
|
Method Summary | |
---|---|
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 |
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. |
protected PortletURL |
getRestoreURL(PortletRequest portletRequest,
long classPK,
boolean isContainerModel)
|
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. |
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 |
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. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WikiNodeTrashHandler()
Method Detail |
---|
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 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)
TrashHandler
getRestoreMessage
in interface TrashHandler
getRestoreMessage
in class BaseTrashHandler
portletRequest
- the portlet requestclassPK
- the primary key of the restored model entity
public String getTrashContainedModelName()
TrashHandler
For example, "files" may be the model name for a folder and "pages" may be the model name for a wiki node.
getTrashContainedModelName
in interface TrashHandler
getTrashContainedModelName
in class BaseTrashHandler
public int getTrashContainedModelsCount(long classPK) throws SystemException
TrashHandler
For example, for a folder with subfolders and documents, the number of documents (excluding those explicitely moved to the recycle bin) is returned.
getTrashContainedModelsCount
in interface TrashHandler
getTrashContainedModelsCount
in class BaseTrashHandler
classPK
- the primary key of a container model
SystemException
- if a system exception occurredpublic List<TrashRenderer> getTrashContainedModelTrashRenderers(long classPK, int start, int end) throws PortalException, SystemException
TrashHandler
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.
getTrashContainedModelTrashRenderers
in interface TrashHandler
getTrashContainedModelTrashRenderers
in class BaseTrashHandler
classPK
- the primary key of a container modelstart
- the lower bound of the range of resultsend
- the upper bound of the range of results (not inclusive)
PortalException
- if a portal exception occurred
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 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 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 PortletURL getRestoreURL(PortletRequest portletRequest, long classPK, boolean isContainerModel) 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 |