|
Liferay 7.0-ce-m3 | |||||||||
| 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.BaseWikiTrashHandler
com.liferay.portlet.wiki.trash.WikiPageTrashHandler
public class WikiPageTrashHandler
Implements trash handling for the wiki page entity.
| Constructor Summary | |
|---|---|
WikiPageTrashHandler()
|
|
| Method Summary | |
|---|---|
SystemEvent |
addDeletionSystemEvent(long userId,
long groupId,
long classPK,
String classUuid,
String referrerClassName)
|
protected void |
checkRestorableEntry(long classPK,
long trashEntryId,
long containerModelId,
String originalTitle,
String newName)
|
void |
checkRestorableEntry(long classPK,
long containerModelId,
String newName)
|
void |
checkRestorableEntry(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. |
ContainerModel |
getParentContainerModel(long classPK)
Returns the parent container model of the model entity with the primary key. |
ContainerModel |
getParentContainerModel(TrashedModel trashedModel)
|
List<ContainerModel> |
getParentContainerModels(long classPK)
Returns all the parent container models of the model entity with the primary key ordered by hierarchy. |
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 |
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. |
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 |
isMovable()
Returns true if the entity can be moved from one container
model (such as a folder) to another. |
boolean |
isRootContainerModelMovable()
|
void |
restoreRelatedTrashEntry(String className,
long classPK)
Restores the model entity that is related to the model entity with the class name and class PK. |
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.portlet.wiki.trash.BaseWikiTrashHandler |
|---|
getContainerModel, getContainerModelClassName, getContainerModelName, getContainerModels, getContainerModelsCount, getDestinationContainerModelId, getRootContainerModelClassName, getRootContainerModelId, getRootContainerModels, getRootContainerModelsCount, getRootContainerModelTitle, getSubcontainerModelName, moveEntry, moveTrashEntry |
| Methods inherited from class com.liferay.portal.kernel.trash.BaseTrashHandler |
|---|
checkDuplicateEntry, checkDuplicateTrashEntry, getAssetRendererFactory, getContainerModelClassName, getContainerModelName, getDeleteMessage, getRootContainerModelName, getSystemEventClassName, getTrashContainedModelName, getTrashContainedModelsCount, getTrashContainedModelTrashRenderers, isDeletable, isRestorable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WikiPageTrashHandler()
| Method Detail |
|---|
public SystemEvent addDeletionSystemEvent(long userId,
long groupId,
long classPK,
String classUuid,
String referrerClassName)
throws PortalException
addDeletionSystemEvent in interface TrashHandleraddDeletionSystemEvent in class BaseTrashHandlerPortalException
public void checkRestorableEntry(long classPK,
long containerModelId,
String newName)
throws PortalException
checkRestorableEntry in interface TrashHandlercheckRestorableEntry in class BaseTrashHandlerPortalException
public void checkRestorableEntry(TrashEntry trashEntry,
long containerModelId,
String newName)
throws PortalException
TrashHandlerThis method is used to check for duplicates when a trash entry is being restored or moved out of the Recycle Bin.
checkRestorableEntry in interface TrashHandlercheckRestorableEntry in class BaseTrashHandlertrashEntry - 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
public void deleteTrashEntry(long classPK)
throws PortalException
TrashHandler
classPK - the primary key of the model entity to delete
PortalException - if a model entity with the primary key could not
be foundpublic String getClassName()
TrashHandler
public ContainerModel getParentContainerModel(long classPK)
throws PortalException
TrashHandler
getParentContainerModel in interface TrashHandlergetParentContainerModel in class BaseTrashHandlerclassPK - the primary key of a model entity the container models
must be able to contain
PortalException - if a portal exception occurredpublic ContainerModel getParentContainerModel(TrashedModel trashedModel)
getParentContainerModel in interface TrashHandlergetParentContainerModel in class BaseTrashHandler
public List<ContainerModel> getParentContainerModels(long classPK)
throws PortalException
TrashHandlerFor 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.
getParentContainerModels in interface TrashHandlergetParentContainerModels in class BaseTrashHandlerclassPK - the primary key of a model entity the container models
must be able to contain
PortalException - if a portal exception occurred
public String getRestoreContainedModelLink(PortletRequest portletRequest,
long classPK)
throws PortalException
getRestoreContainedModelLink in interface TrashHandlergetRestoreContainedModelLink in class BaseTrashHandlerPortalException
public String getRestoreContainerModelLink(PortletRequest portletRequest,
long classPK)
throws PortalException
TrashHandler
getRestoreContainerModelLink in interface TrashHandlergetRestoreContainerModelLink in class BaseTrashHandlerportletRequest - the portlet requestclassPK - the primary key of the restored model entity
PortalException - if a model entity with the primary key could not
be found
public String getRestoreMessage(PortletRequest portletRequest,
long classPK)
throws PortalException
TrashHandler
getRestoreMessage in interface TrashHandlergetRestoreMessage in class BaseTrashHandlerportletRequest - the portlet requestclassPK - the primary key of the restored model entity
PortalException - if a model entity with the primary key could not
be foundpublic String getTrashContainerModelName()
TrashHandlerFor example, "folder" may be the container model name for a file entry.
getTrashContainerModelName in interface TrashHandlergetTrashContainerModelName in class BaseTrashHandler
public int getTrashContainerModelsCount(long classPK)
throws PortalException
TrashHandlerFor example, for a folder with subfolders and documents, the number of folders (excluding those explicitly moved to the recycle bin) is returned.
getTrashContainerModelsCount in interface TrashHandlergetTrashContainerModelsCount in class BaseTrashHandlerclassPK - the primary key of a container model
PortalException - if a portal exception occurred
public List<TrashRenderer> getTrashContainerModelTrashRenderers(long classPK,
int start,
int end)
throws PortalException
TrashHandlerFor 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.
getTrashContainerModelTrashRenderers in interface TrashHandlergetTrashContainerModelTrashRenderers in class BaseTrashHandlerclassPK - 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
public TrashEntry getTrashEntry(long classPK)
throws PortalException
getTrashEntry in interface TrashHandlergetTrashEntry in class BaseTrashHandlerPortalException
public TrashRenderer getTrashRenderer(long classPK)
throws PortalException
TrashHandler
getTrashRenderer in interface TrashHandlergetTrashRenderer in class BaseTrashHandlerclassPK - the primary key of the model entity
PortalException - if a model entity with the primary key could not
be found
public boolean hasTrashPermission(PermissionChecker permissionChecker,
long groupId,
long classPK,
String trashActionId)
throws PortalException
TrashHandlertrue 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 TrashHandlerhasTrashPermission in class BaseTrashHandlerpermissionChecker - 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 foundpublic boolean isContainerModel()
TrashHandlertrue if the entity is a container model.
isContainerModel in interface TrashHandlerisContainerModel in class BaseTrashHandlertrue if the entity is a container model;
false otherwise
public boolean isInTrash(long classPK)
throws PortalException
TrashHandlertrue 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
public boolean isInTrashContainer(long classPK)
throws PortalException
TrashHandlertrue if the model entity with the primary key is in
a container that is in the Recycle Bin.
isInTrashContainer in interface TrashHandlerisInTrashContainer in class BaseTrashHandlerclassPK - 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 portalpublic boolean isMovable()
TrashHandlertrue if the entity can be moved from one container
model (such as a folder) to another.
isMovable in interface TrashHandlerisMovable in class BaseTrashHandlertrue if the entity can be moved from one container
model to another; false otherwisepublic boolean isRootContainerModelMovable()
isRootContainerModelMovable in interface TrashHandlerisRootContainerModelMovable in class BaseTrashHandler
public void restoreRelatedTrashEntry(String className,
long classPK)
throws PortalException
TrashHandlerrestoreRelatedTrashEntry(
String, long) restores the attachment related to the wiki page with the
class name and class PK.
restoreRelatedTrashEntry in interface TrashHandlerrestoreRelatedTrashEntry in class BaseTrashHandlerclassName - the class name of the model entity with a related model
entity to restoreclassPK - the primary key of the model entity with a related model
entity to restore
PortalException - if a model entity with the primary key could not
be found
public void restoreTrashEntry(long userId,
long classPK)
throws PortalException
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
public void updateTitle(long classPK,
String name)
throws PortalException
TrashHandlerEditEntryAction
before restoring the model entity via its restore rename action.
updateTitle in interface TrashHandlerupdateTitle in class BaseTrashHandlerclassPK - 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
protected void checkRestorableEntry(long classPK,
long trashEntryId,
long containerModelId,
String originalTitle,
String newName)
throws PortalException
PortalException
protected PortletURL getRestoreURL(PortletRequest portletRequest,
long classPK,
boolean isContainerModel)
throws PortalException
PortalException
protected boolean hasPermission(PermissionChecker permissionChecker,
long classPK,
String actionId)
throws PortalException
hasPermission in class BaseTrashHandlerPortalException
|
Liferay 7.0-ce-m3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||