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
FieldsModifier and TypeFieldDescriptionprotected StringThe collector parameter.protected Map<String, CmsListItem> List item cache.Resource cache.protected List<org.opencms.file.CmsResource> Cache for resource list result.static final StringVFS 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_PARAMFields inherited from interface org.opencms.file.collectors.I_CmsResourceCollector
DEFAULT_LIMIT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor, creates a new list collector. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(org.opencms.file.collectors.I_CmsResourceCollector arg0) protected CmsListItemcreateResourceListItem(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) intgetCreateTypeId(org.opencms.file.CmsObject cms, String collectorName, String param) protected CmsListItemgetDummyListItem(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.intgetOrder()Set<org.opencms.file.CmsResource> getPublishResources(org.opencms.file.CmsObject cms, org.opencms.gwt.shared.I_CmsContentLoadCollectorInfo info) org.opencms.file.CmsResourcegetResource(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 CmsListStateReturns the state of the parameter map.getWp()Returns the workplace object.protected abstract voidsetAdditionalColumns(CmsListItem item, org.opencms.workplace.explorer.CmsResourceUtil resUtil) Set additional column entries for a resource.voidsetDefaultCollectorName(String collectorName) voidsetDefaultCollectorParam(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.voidsetOrder(int order) voidsetPage(int page) Sets the current display page.protected voidsetResourcesParam(List<String> resources) Sets the resources parameter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
compareToin interfaceComparable<org.opencms.file.collectors.I_CmsResourceCollector>- See Also:
-
getCreateLink
- Specified by:
getCreateLinkin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
getCreateLink
- Specified by:
getCreateLinkin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
getCreateParam
- Specified by:
getCreateParamin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
getCreateParam
- Specified by:
getCreateParamin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
getCreateTypeId
- Specified by:
getCreateTypeIdin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
getDefaultCollectorName
- Specified by:
getDefaultCollectorNamein interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
getDefaultCollectorParam
- Specified by:
getDefaultCollectorParamin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
getListItems
Returns a list of list items from a list of resources.- Specified by:
getListItemsin interfaceI_CmsListResourceCollector- Parameters:
parameter- the collector parameter ornullfor default.- Returns:
- a list of
CmsListItemobjects - Throws:
org.opencms.main.CmsException- if something goes wrong
-
getOrder
- Specified by:
getOrderin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
getResource
Returns the resource for the given item.- Specified by:
getResourcein 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:
getResourcesin interfaceI_CmsListResourceCollector- Parameters:
cms- the cms objectparams- the parameter map- Returns:
- a list of
CmsResourceobjects - 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:
getResultsin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- Throws:
org.opencms.main.CmsException- See Also:
-
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:
getResultsin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- Throws:
org.opencms.main.CmsException- See Also:
-
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:
getResultsin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- Throws:
org.opencms.main.CmsException- See Also:
-
getWp
Returns the workplace object.- Specified by:
getWpin interfaceI_CmsListResourceCollector- Returns:
- the workplace object
-
setDefaultCollectorName
- Specified by:
setDefaultCollectorNamein interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
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:
setDefaultCollectorParamin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
setOrder
- Specified by:
setOrderin interfaceorg.opencms.file.collectors.I_CmsResourceCollector- See Also:
-
setPage
Sets the current display page.- Specified by:
setPagein 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
-