Package org.opencms.workplace.list
Class A_CmsListResourceCollector
java.lang.Object
org.opencms.workplace.list.A_CmsListResourceCollector
- All Implemented Interfaces:
Comparable<org.opencms.file.collectors.I_CmsResourceCollector>
,org.opencms.file.collectors.I_CmsCollectorPublishListProvider
,org.opencms.file.collectors.I_CmsResourceCollector
,I_CmsListResourceCollector
- Direct Known Subclasses:
CmsContentCheckCollector
,CmsDeleteBrokenRelationsCollector
,CmsInternalLinkValidationFilesCollector
,CmsListResourceLinkRelationCollector
,CmsLockedResourcesCollector
,CmsProjectFilesCollector
,CmsPublishBrokenRelationsCollector
,CmsSearchResourcesCollector
,CmsShowOrgUnitResourcesCollector
,CmsSourceSearchCollector
public abstract class A_CmsListResourceCollector
extends Object
implements I_CmsListResourceCollector
Collector to provide
CmsResource
objects for a explorer List.- Since:
- 6.1.0
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The collector parameter.protected Map<String,
CmsListItem> List item cache.Resource cache.protected List<org.opencms.file.CmsResource>
Cache for resource list result.static final String
VFS path to use for a dummy resource object.Fields inherited from interface org.opencms.workplace.list.I_CmsListResourceCollector
PARAM_FILTER, PARAM_ORDER, PARAM_PAGE, PARAM_RESOURCES, PARAM_SORTBY, SEP_KEYVAL, SEP_PARAM
Fields inherited from interface org.opencms.file.collectors.I_CmsResourceCollector
DEFAULT_LIMIT
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor, creates a new list collector. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(org.opencms.file.collectors.I_CmsResourceCollector arg0) protected CmsListItem
createResourceListItem
(org.opencms.file.CmsResource resource, CmsHtmlList list, boolean showPermissions, boolean showDateLastMod, boolean showUserLastMod, boolean showDateCreate, boolean showUserCreate, boolean showDateRel, boolean showDateExp, boolean showState, boolean showLockedBy, boolean showSite) Returns a list item created from the resource information, differs between valid resources and invalid resources.getCreateLink
(org.opencms.file.CmsObject cms) getCreateLink
(org.opencms.file.CmsObject cms, String collectorName, String param) getCreateParam
(org.opencms.file.CmsObject cms) getCreateParam
(org.opencms.file.CmsObject cms, String collectorName, String param) int
getCreateTypeId
(org.opencms.file.CmsObject cms, String collectorName, String param) protected CmsListItem
getDummyListItem
(CmsHtmlList list) Returns a dummy list item.protected List<org.opencms.file.CmsResource>
getInternalResources
(org.opencms.file.CmsObject cms, Map<String, String> params) Wrapper method for caching the result ofgetResources(CmsObject, Map)
.getListItems
(String parameter) Returns a list of list items from a list of resources.int
getOrder()
Set<org.opencms.file.CmsResource>
getPublishResources
(org.opencms.file.CmsObject cms, org.opencms.gwt.shared.I_CmsContentLoadCollectorInfo info) org.opencms.file.CmsResource
getResource
(org.opencms.file.CmsObject cms, CmsListItem item) Returns the resource for the given item.getResourceNamesFromParam
(Map<String, String> params) Returns the list of resource names from the parameter map.abstract List<org.opencms.file.CmsResource>
getResources
(org.opencms.file.CmsObject cms, Map<String, String> params) Returns all, unsorted and unfiltered, resources.List<org.opencms.file.CmsResource>
getResults
(org.opencms.file.CmsObject cms) List<org.opencms.file.CmsResource>
getResults
(org.opencms.file.CmsObject cms, String collectorName, String parameter) The parameter must follow the syntax "page:nr" where nr is the number of the page to be displayed.List<org.opencms.file.CmsResource>
getResults
(org.opencms.file.CmsObject cms, String collectorName, String params, int numResults) protected CmsListState
Returns the state of the parameter map.getWp()
Returns the workplace object.protected abstract void
setAdditionalColumns
(CmsListItem item, org.opencms.workplace.explorer.CmsResourceUtil resUtil) Set additional column entries for a resource.void
setDefaultCollectorName
(String collectorName) void
setDefaultCollectorParam
(String param) The parameter must follow the syntax "mode|projectId" where mode is either "new", "changed", "deleted" or "modified" and projectId is the id of the project to be displayed.void
setOrder
(int order) void
setPage
(int page) Sets the current display page.protected void
setResourcesParam
(List<String> resources) Sets the resources parameter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.file.collectors.I_CmsResourceCollector
getCollectorNames
-
Field Details
-
VFS_PATH_NONE
VFS path to use for a dummy resource object.- See Also:
-
m_collectorParameter
The collector parameter. -
m_liCache
List item cache. -
m_resCache
Resource cache. -
m_resources
Cache for resource list result.
-
-
Constructor Details
-
A_CmsListResourceCollector
Constructor, creates a new list collector.- Parameters:
wp
- the workplace object where the collector is used from
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<org.opencms.file.collectors.I_CmsResourceCollector>
- See Also:
-
getCreateLink
- Specified by:
getCreateLink
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject)
-
getCreateLink
- Specified by:
getCreateLink
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
-
getCreateParam
- Specified by:
getCreateParam
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.getCreateParam(org.opencms.file.CmsObject)
-
getCreateParam
- Specified by:
getCreateParam
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.getCreateParam(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
-
getCreateTypeId
- Specified by:
getCreateTypeId
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.getCreateTypeId(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
-
getDefaultCollectorName
- Specified by:
getDefaultCollectorName
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.getDefaultCollectorName()
-
getDefaultCollectorParam
- Specified by:
getDefaultCollectorParam
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.getDefaultCollectorParam()
-
getListItems
Returns a list of list items from a list of resources.- Specified by:
getListItems
in interfaceI_CmsListResourceCollector
- Parameters:
parameter
- the collector parameter ornull
for default.- Returns:
- a list of
CmsListItem
objects - Throws:
org.opencms.main.CmsException
- if something goes wrong
-
getOrder
- Specified by:
getOrder
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.getOrder()
-
getResource
Returns the resource for the given item.- Specified by:
getResource
in interfaceI_CmsListResourceCollector
- Parameters:
cms
- the cms objectitem
- the item- Returns:
- the resource
-
getResources
public abstract List<org.opencms.file.CmsResource> getResources(org.opencms.file.CmsObject cms, Map<String, String> params) throws org.opencms.main.CmsExceptionReturns all, unsorted and unfiltered, resources.Be sure to cache the resources.
- Specified by:
getResources
in interfaceI_CmsListResourceCollector
- Parameters:
cms
- the cms objectparams
- the parameter map- Returns:
- a list of
CmsResource
objects - Throws:
org.opencms.main.CmsException
- if something goes wrong
-
getResults
public List<org.opencms.file.CmsResource> getResults(org.opencms.file.CmsObject cms) throws org.opencms.main.CmsException - Specified by:
getResults
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- Throws:
org.opencms.main.CmsException
- See Also:
-
I_CmsResourceCollector.getResults(org.opencms.file.CmsObject)
-
getResults
public List<org.opencms.file.CmsResource> getResults(org.opencms.file.CmsObject cms, String collectorName, String parameter) throws org.opencms.main.CmsException The parameter must follow the syntax "page:nr" where nr is the number of the page to be displayed.- Specified by:
getResults
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- Throws:
org.opencms.main.CmsException
- See Also:
-
I_CmsResourceCollector.getResults(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
-
getResults
public List<org.opencms.file.CmsResource> getResults(org.opencms.file.CmsObject cms, String collectorName, String params, int numResults) throws org.opencms.main.CmsException - Specified by:
getResults
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- Throws:
org.opencms.main.CmsException
- See Also:
-
I_CmsResourceCollector.getResults(org.opencms.file.CmsObject, java.lang.String, java.lang.String, int)
-
getWp
Returns the workplace object.- Specified by:
getWp
in interfaceI_CmsListResourceCollector
- Returns:
- the workplace object
-
setDefaultCollectorName
- Specified by:
setDefaultCollectorName
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.setDefaultCollectorName(java.lang.String)
-
setDefaultCollectorParam
The parameter must follow the syntax "mode|projectId" where mode is either "new", "changed", "deleted" or "modified" and projectId is the id of the project to be displayed.- Specified by:
setDefaultCollectorParam
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.setDefaultCollectorParam(java.lang.String)
-
setOrder
- Specified by:
setOrder
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
-
I_CmsResourceCollector.setOrder(int)
-
setPage
Sets the current display page.- Specified by:
setPage
in interfaceI_CmsListResourceCollector
- Parameters:
page
- the new display page
-
createResourceListItem
protected CmsListItem createResourceListItem(org.opencms.file.CmsResource resource, CmsHtmlList list, boolean showPermissions, boolean showDateLastMod, boolean showUserLastMod, boolean showDateCreate, boolean showUserCreate, boolean showDateRel, boolean showDateExp, boolean showState, boolean showLockedBy, boolean showSite) Returns a list item created from the resource information, differs between valid resources and invalid resources.- Parameters:
resource
- the resource to create the list item fromlist
- the listshowPermissions
- if to show permissionsshowDateLastMod
- if to show the last modification dateshowUserLastMod
- if to show the last modification usershowDateCreate
- if to show the creation dateshowUserCreate
- if to show the creation dateshowDateRel
- if to show the date releasedshowDateExp
- if to show the date expiredshowState
- if to show the stateshowLockedBy
- if to show the lock usershowSite
- if to show the site- Returns:
- a list item created from the resource information
-
getDummyListItem
Returns a dummy list item.- Parameters:
list
- the list object to create the entry for- Returns:
- a dummy list item
-
getInternalResources
protected List<org.opencms.file.CmsResource> getInternalResources(org.opencms.file.CmsObject cms, Map<String, String> params) throws org.opencms.main.CmsExceptionWrapper method for caching the result ofgetResources(CmsObject, Map)
.- Parameters:
cms
- the cms objectparams
- the parameter map- Returns:
- the result of
getResources(CmsObject, Map)
- Throws:
org.opencms.main.CmsException
- if something goes wrong
-
getResourceNamesFromParam
Returns the list of resource names from the parameter map.- Parameters:
params
- the parameter map- Returns:
- the list of resource names
- See Also:
-
getState
Returns the state of the parameter map.- Parameters:
params
- the parameter map- Returns:
- the state of the list from the parameter map
-
setAdditionalColumns
protected abstract void setAdditionalColumns(CmsListItem item, org.opencms.workplace.explorer.CmsResourceUtil resUtil) Set additional column entries for a resource.Overwrite this method to set additional column entries.
- Parameters:
item
- the current list itemresUtil
- the resource util object for getting the info from
-
setResourcesParam
Sets the resources parameter.- Parameters:
resources
- the list of resource names to use
-