|
Liferay 7.0-ce-m6 | |||||||||
| 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.messageboards.trash.MBThreadTrashHandler
public class MBThreadTrashHandler
Implements trash handling for message boards thread entity.
| Constructor Summary | |
|---|---|
MBThreadTrashHandler()
|
|
| Method Summary | |
|---|---|
void |
deleteTrashEntry(long classPK)
Deletes the model entity with the primary key. |
String |
getClassName()
Returns the class name handled by this trash handler. |
ContainerModel |
getContainerModel(long containerModelId)
Returns the container model with the primary key. |
String |
getContainerModelClassName(long classPK)
|
String |
getContainerModelName(long classPK)
|
List<ContainerModel> |
getContainerModels(long classPK,
long parentContainerModelId,
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 parentContainerModelId)
Returns the number of container models that are children of the parent container model identified by the container model ID. |
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)
|
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 |
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 |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MBThreadTrashHandler()
| Method Detail |
|---|
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 getContainerModel(long containerModelId)
throws PortalException
TrashHandler
getContainerModel in interface TrashHandlergetContainerModel in class BaseTrashHandlercontainerModelId - the primary key of the container model
PortalException - if a container model with the primary key could
not be foundpublic String getContainerModelClassName(long classPK)
getContainerModelClassName in interface TrashHandlergetContainerModelClassName in class BaseTrashHandlerpublic String getContainerModelName(long classPK)
getContainerModelName in interface TrashHandlergetContainerModelName in class BaseTrashHandler
public List<ContainerModel> getContainerModels(long classPK,
long parentContainerModelId,
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 TrashHandlergetContainerModels in class BaseTrashHandlerclassPK - the primary key of a model entity the container models
must be able to containparentContainerModelId - 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 - if a model entity with the primary key could not
be found
public int getContainerModelsCount(long classPK,
long parentContainerModelId)
throws PortalException
TrashHandlerThis method checks for the view permission when counting the container models.
getContainerModelsCount in interface TrashHandlergetContainerModelsCount in class BaseTrashHandlerclassPK - the primary key of a model entity the container models
must be able to containparentContainerModelId - the primary key of the parent container model
PortalException - if a model entity with the primary key could not
be found
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 found
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 found
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 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 TrashHandlerisRestorable in class BaseTrashHandlerclassPK - 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
public void moveEntry(long userId,
long classPK,
long containerModelId,
ServiceContext serviceContext)
throws PortalException
TrashHandler
moveEntry in interface TrashHandlermoveEntry in class BaseTrashHandleruserId - 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
public void moveTrashEntry(long userId,
long classPK,
long containerModelId,
ServiceContext serviceContext)
throws PortalException
TrashHandler
moveTrashEntry in interface TrashHandlermoveTrashEntry in class BaseTrashHandleruserId - 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
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
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-m6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||