|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.portal.kernel.trash.BaseTrashHandler
@ProviderType public abstract class BaseTrashHandler
Provides the base implementation of TrashHandler.
TrashHandler| Constructor Summary | |
|---|---|
BaseTrashHandler()
|
|
| Method Summary | |
|---|---|
SystemEvent |
addDeletionSystemEvent(long userId,
long groupId,
long classPK,
String classUuid,
String referrerClassName)
|
void |
checkDuplicateEntry(long classPK,
long containerModelId,
String newName)
Deprecated. As of 7.0.0, replaced by checkRestorableEntry(long,
long, String) |
void |
checkDuplicateTrashEntry(TrashEntry trashEntry,
long containerModelId,
String newName)
Deprecated. As of 7.0.0, replaced by checkRestorableEntry(TrashEntry, long, String) |
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. |
protected AssetRendererFactory<?> |
getAssetRendererFactory()
|
ContainerModel |
getContainerModel(long containerModelId)
Returns the container model with the primary key. |
String |
getContainerModelClassName()
Deprecated. As of 7.0.0, replaced by getContainerModel(long) |
String |
getContainerModelClassName(long classPK)
|
String |
getContainerModelName()
Returns the name of the container model (e.g. folder name). |
List<ContainerModel> |
getContainerModels(long classPK,
long containerModelId,
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 containerModelId)
Returns the number of container models that are children of the parent container model identified by the container model ID. |
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. |
long |
getDestinationContainerModelId(long classPK,
long destinationContainerModelId)
|
Filter |
getExcludeFilter(SearchContext searchContext)
|
Query |
getExcludeQuery(SearchContext searchContext)
Deprecated. As of 7.0.0, replaced by getExcludeFilter(SearchContext) |
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. |
String |
getRootContainerModelName()
Returns the name of the root container (e.g. |
String |
getSubcontainerModelName()
Returns the name of the subcontainer model (e.g. for a folder the subcontainer model name may be "subfolder"). |
String |
getSystemEventClassName()
|
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. |
TrashEntry |
getTrashEntry(long classPK)
|
TrashRenderer |
getTrashRenderer(long classPK)
Returns the trash renderer associated to the model entity with the primary key. |
protected abstract 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 |
isDeletable()
Returns true if the entity can be deleted from 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 |
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 |
restoreRelatedTrashEntry(String className,
long classPK)
Restores the model entity that is related to the model entity with the class name and class PK. |
void |
updateTitle(long classPK,
String title)
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 |
| Methods inherited from interface com.liferay.portal.kernel.trash.TrashHandler |
|---|
deleteTrashEntry, getClassName, isInTrash, restoreTrashEntry |
| Constructor Detail |
|---|
public BaseTrashHandler()
| Method Detail |
|---|
public SystemEvent addDeletionSystemEvent(long userId,
long groupId,
long classPK,
String classUuid,
String referrerClassName)
throws PortalException
addDeletionSystemEvent in interface TrashHandlerPortalException
@Deprecated
public void checkDuplicateEntry(long classPK,
long containerModelId,
String newName)
throws PortalException
checkRestorableEntry(long,
long, String)
checkDuplicateEntry in interface TrashHandlerPortalException
@Deprecated
public void checkDuplicateTrashEntry(TrashEntry trashEntry,
long containerModelId,
String newName)
throws PortalException
checkRestorableEntry(TrashEntry, long, String)
TrashHandlerThis method is used to check for duplicates when a trash entry is being restored or moved out of the Recycle Bin.
checkDuplicateTrashEntry in interface TrashHandlertrashEntry - 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 checkRestorableEntry(long classPK,
long containerModelId,
String newName)
throws PortalException
checkRestorableEntry in interface TrashHandlerPortalException
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 TrashHandlertrashEntry - 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 ContainerModel getContainerModel(long containerModelId)
throws PortalException
TrashHandler
getContainerModel in interface TrashHandlercontainerModelId - the primary key of the container model
PortalException@Deprecated public String getContainerModelClassName()
getContainerModel(long)
TrashHandler
getContainerModelClassName in interface TrashHandlerpublic String getContainerModelClassName(long classPK)
getContainerModelClassName in interface TrashHandlerpublic String getContainerModelName()
TrashHandler
getContainerModelName in interface TrashHandler
public List<ContainerModel> getContainerModels(long classPK,
long containerModelId,
int start,
int end)
throws PortalException
TrashHandlerThis 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.
getContainerModels in interface TrashHandlerclassPK - the primary key of a model entity the container models
must be able to containcontainerModelId - the primary key of the parent container modelstart - the lower bound of the range of resultsend - the upper bound of the range of results (not inclusive)
PortalException
public int getContainerModelsCount(long classPK,
long containerModelId)
throws PortalException
TrashHandlerThis method checks for the view permission when counting the container models.
getContainerModelsCount in interface TrashHandlerclassPK - the primary key of a model entity the container models
must be able to containcontainerModelId - the primary key of the parent container model
PortalExceptionpublic 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
public long getDestinationContainerModelId(long classPK,
long destinationContainerModelId)
getDestinationContainerModelId in interface TrashHandlerpublic Filter getExcludeFilter(SearchContext searchContext)
getExcludeFilter in interface TrashHandler@Deprecated public Query getExcludeQuery(SearchContext searchContext)
getExcludeFilter(SearchContext)
getExcludeQuery in interface TrashHandler
public ContainerModel getParentContainerModel(long classPK)
throws PortalException
TrashHandler
getParentContainerModel in interface TrashHandlerclassPK - the primary key of a model entity the container models
must be able to contain
PortalException
public ContainerModel getParentContainerModel(TrashedModel trashedModel)
throws PortalException
getParentContainerModel in interface TrashHandlerPortalException
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 TrashHandlerclassPK - the primary key of a model entity the container models
must be able to contain
PortalException
public String getRestoreContainedModelLink(PortletRequest portletRequest,
long classPK)
throws PortalException
getRestoreContainedModelLink in interface TrashHandlerPortalException
public String getRestoreContainerModelLink(PortletRequest portletRequest,
long classPK)
throws PortalException
TrashHandler
getRestoreContainerModelLink in interface TrashHandlerportletRequest - the portlet requestclassPK - the primary key of the restored model entity
PortalException
public String getRestoreMessage(PortletRequest portletRequest,
long classPK)
throws PortalException
TrashHandler
getRestoreMessage in interface TrashHandlerportletRequest - the portlet requestclassPK - the primary key of the restored model entity
PortalExceptionpublic String getRootContainerModelName()
TrashHandler
getRootContainerModelName in interface TrashHandlerpublic String getSubcontainerModelName()
TrashHandler
getSubcontainerModelName in interface TrashHandlerpublic String getSystemEventClassName()
getSystemEventClassName in interface TrashHandlerpublic String getTrashContainedModelName()
TrashHandlerFor 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
public int getTrashContainedModelsCount(long classPK)
throws PortalException
TrashHandlerFor 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 TrashHandlerclassPK - the primary key of a container model
PortalException
public List<TrashRenderer> getTrashContainedModelTrashRenderers(long classPK,
int start,
int end)
throws PortalException
TrashHandlerFor 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 TrashHandlerclassPK - 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)
PortalExceptionpublic String getTrashContainerModelName()
TrashHandlerFor example, "folder" may be the container model name for a file entry.
getTrashContainerModelName in interface TrashHandler
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 TrashHandlerclassPK - the primary key of a container model
PortalException
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 TrashHandlerclassPK - 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
public TrashEntry getTrashEntry(long classPK)
throws PortalException
getTrashEntry in interface TrashHandlerPortalException
public TrashRenderer getTrashRenderer(long classPK)
throws PortalException
TrashHandler
getTrashRenderer in interface TrashHandlerclassPK - the primary key of the model entity
PortalException
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 TrashHandlerpermissionChecker - 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
PortalExceptionpublic boolean isContainerModel()
TrashHandlertrue if the entity is a container model.
isContainerModel in interface TrashHandlertrue if the entity is a container model;
false otherwisepublic boolean isDeletable()
TrashHandlertrue if the entity can be deleted from the Recycle
Bin.
isDeletable in interface TrashHandlertrue if the entity can be deleted from the Recycle
Bin.
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 TrashHandlerclassPK - 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
PortalExceptionpublic boolean isMovable()
TrashHandlertrue if the entity can be moved from one container
model (such as a folder) to another.
isMovable in interface TrashHandlertrue if the entity can be moved from one container
model to another; false otherwise
public boolean isRestorable(long classPK)
throws PortalException
TrashHandlertrue 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 TrashHandlerclassPK - the primary key of the model entity
true if the model entity can be restored to its
original location; false otherwise
PortalException
public void moveEntry(long userId,
long classPK,
long containerModelId,
ServiceContext serviceContext)
throws PortalException
TrashHandler
moveEntry in interface TrashHandleruserId - 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
public void moveTrashEntry(long userId,
long classPK,
long containerModelId,
ServiceContext serviceContext)
throws PortalException
TrashHandler
moveTrashEntry in interface TrashHandleruserId - 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
public void restoreRelatedTrashEntry(String className,
long classPK)
throws PortalException
TrashHandlercom.liferay.portlet.wiki.trash.WikiPageTrashHandler#restoreRelatedTrashEntry(
String, long) restores the attachment related to the wiki page with the
class name and class PK.
restoreRelatedTrashEntry in interface TrashHandlerclassName - 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
public void updateTitle(long classPK,
String title)
throws PortalException
TrashHandlercom.liferay.portlet.trash.action.EditEntryAction
before restoring the model entity via its restore rename action.
updateTitle in interface TrashHandlerclassPK - the primary key of the model entitytitle - the title to be assigned
PortalExceptionprotected AssetRendererFactory<?> getAssetRendererFactory()
protected abstract boolean hasPermission(PermissionChecker permissionChecker,
long classPK,
String actionId)
throws PortalException
PortalException
|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||