Package org.opencms.workplace.list
Class A_CmsListResourceCollector
- java.lang.Object
-
- org.opencms.workplace.list.A_CmsListResourceCollector
-
- All Implemented Interfaces:
java.lang.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 java.lang.Object implements I_CmsListResourceCollector
Collector to provideCmsResource
objects for a explorer List.- Since:
- 6.1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
m_collectorParameter
The collector parameter.protected java.util.Map<java.lang.String,CmsListItem>
m_liCache
List item cache.protected java.util.Map<java.lang.String,org.opencms.file.CmsResource>
m_resCache
Resource cache.protected java.util.List<org.opencms.file.CmsResource>
m_resources
Cache for resource list result.static java.lang.String
VFS_PATH_NONE
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
A_CmsListResourceCollector(A_CmsListExplorerDialog wp)
Constructor, creates a new list collector.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
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.java.lang.String
getCreateLink(org.opencms.file.CmsObject cms)
java.lang.String
getCreateLink(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.String param)
java.lang.String
getCreateParam(org.opencms.file.CmsObject cms)
java.lang.String
getCreateParam(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.String param)
int
getCreateTypeId(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.String param)
java.lang.String
getDefaultCollectorName()
java.lang.String
getDefaultCollectorParam()
protected CmsListItem
getDummyListItem(CmsHtmlList list)
Returns a dummy list item.protected java.util.List<org.opencms.file.CmsResource>
getInternalResources(org.opencms.file.CmsObject cms, java.util.Map<java.lang.String,java.lang.String> params)
Wrapper method for caching the result ofgetResources(CmsObject, Map)
.java.util.List<CmsListItem>
getListItems(java.lang.String parameter)
Returns a list of list items from a list of resources.int
getOrder()
java.util.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.protected java.util.List<java.lang.String>
getResourceNamesFromParam(java.util.Map<java.lang.String,java.lang.String> params)
Returns the list of resource names from the parameter map.abstract java.util.List<org.opencms.file.CmsResource>
getResources(org.opencms.file.CmsObject cms, java.util.Map<java.lang.String,java.lang.String> params)
Returns all, unsorted and unfiltered, resources.java.util.List<org.opencms.file.CmsResource>
getResults(org.opencms.file.CmsObject cms)
java.util.List<org.opencms.file.CmsResource>
getResults(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.String parameter)
The parameter must follow the syntax "page:nr" where nr is the number of the page to be displayed.java.util.List<org.opencms.file.CmsResource>
getResults(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.String params, int numResults)
protected CmsListState
getState(java.util.Map<java.lang.String,java.lang.String> params)
Returns the state of the parameter map.A_CmsListExplorerDialog
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(java.lang.String collectorName)
void
setDefaultCollectorParam(java.lang.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(java.util.List<java.lang.String> resources)
Sets the resources parameter.
-
-
-
Field Detail
-
VFS_PATH_NONE
public static final java.lang.String VFS_PATH_NONE
VFS path to use for a dummy resource object.- See Also:
- Constant Field Values
-
m_collectorParameter
protected java.lang.String m_collectorParameter
The collector parameter.
-
m_liCache
protected java.util.Map<java.lang.String,CmsListItem> m_liCache
List item cache.
-
m_resCache
protected java.util.Map<java.lang.String,org.opencms.file.CmsResource> m_resCache
Resource cache.
-
m_resources
protected java.util.List<org.opencms.file.CmsResource> m_resources
Cache for resource list result.
-
-
Constructor Detail
-
A_CmsListResourceCollector
protected A_CmsListResourceCollector(A_CmsListExplorerDialog wp)
Constructor, creates a new list collector.- Parameters:
wp
- the workplace object where the collector is used from
-
-
Method Detail
-
compareTo
public int compareTo(org.opencms.file.collectors.I_CmsResourceCollector arg0)
- Specified by:
compareTo
in interfacejava.lang.Comparable<org.opencms.file.collectors.I_CmsResourceCollector>
- See Also:
Comparable.compareTo(java.lang.Object)
-
getCreateLink
public java.lang.String getCreateLink(org.opencms.file.CmsObject cms)
- Specified by:
getCreateLink
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
I_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject)
-
getCreateLink
public java.lang.String getCreateLink(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.String param)
- 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
public java.lang.String getCreateParam(org.opencms.file.CmsObject cms)
- Specified by:
getCreateParam
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
I_CmsResourceCollector.getCreateParam(org.opencms.file.CmsObject)
-
getCreateParam
public java.lang.String getCreateParam(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.String param)
- 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
public int getCreateTypeId(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.String param)
- 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
public java.lang.String getDefaultCollectorName()
- Specified by:
getDefaultCollectorName
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
I_CmsResourceCollector.getDefaultCollectorName()
-
getDefaultCollectorParam
public java.lang.String getDefaultCollectorParam()
- Specified by:
getDefaultCollectorParam
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
I_CmsResourceCollector.getDefaultCollectorParam()
-
getListItems
public java.util.List<CmsListItem> getListItems(java.lang.String parameter) throws org.opencms.main.CmsException
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
public int getOrder()
- Specified by:
getOrder
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
I_CmsResourceCollector.getOrder()
-
getPublishResources
public java.util.Set<org.opencms.file.CmsResource> getPublishResources(org.opencms.file.CmsObject cms, org.opencms.gwt.shared.I_CmsContentLoadCollectorInfo info) throws org.opencms.main.CmsException
- Specified by:
getPublishResources
in interfaceorg.opencms.file.collectors.I_CmsCollectorPublishListProvider
- Throws:
org.opencms.main.CmsException
- See Also:
I_CmsCollectorPublishListProvider.getPublishResources(org.opencms.file.CmsObject, org.opencms.gwt.shared.I_CmsContentLoadCollectorInfo)
-
getResource
public org.opencms.file.CmsResource getResource(org.opencms.file.CmsObject cms, CmsListItem item)
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 java.util.List<org.opencms.file.CmsResource> getResources(org.opencms.file.CmsObject cms, java.util.Map<java.lang.String,java.lang.String> params) throws org.opencms.main.CmsException
Returns 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 java.util.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 java.util.List<org.opencms.file.CmsResource> getResults(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.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 java.util.List<org.opencms.file.CmsResource> getResults(org.opencms.file.CmsObject cms, java.lang.String collectorName, java.lang.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
public A_CmsListExplorerDialog getWp()
Returns the workplace object.- Specified by:
getWp
in interfaceI_CmsListResourceCollector
- Returns:
- the workplace object
-
setDefaultCollectorName
public void setDefaultCollectorName(java.lang.String collectorName)
- Specified by:
setDefaultCollectorName
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
I_CmsResourceCollector.setDefaultCollectorName(java.lang.String)
-
setDefaultCollectorParam
public void setDefaultCollectorParam(java.lang.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.- Specified by:
setDefaultCollectorParam
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
I_CmsResourceCollector.setDefaultCollectorParam(java.lang.String)
-
setOrder
public void setOrder(int order)
- Specified by:
setOrder
in interfaceorg.opencms.file.collectors.I_CmsResourceCollector
- See Also:
I_CmsResourceCollector.setOrder(int)
-
setPage
public void setPage(int page)
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
protected CmsListItem getDummyListItem(CmsHtmlList list)
Returns a dummy list item.- Parameters:
list
- the list object to create the entry for- Returns:
- a dummy list item
-
getInternalResources
protected java.util.List<org.opencms.file.CmsResource> getInternalResources(org.opencms.file.CmsObject cms, java.util.Map<java.lang.String,java.lang.String> params) throws org.opencms.main.CmsException
Wrapper 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
protected java.util.List<java.lang.String> getResourceNamesFromParam(java.util.Map<java.lang.String,java.lang.String> params)
Returns the list of resource names from the parameter map.- Parameters:
params
- the parameter map- Returns:
- the list of resource names
- See Also:
I_CmsListResourceCollector.PARAM_RESOURCES
-
getState
protected CmsListState getState(java.util.Map<java.lang.String,java.lang.String> params)
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
protected void setResourcesParam(java.util.List<java.lang.String> resources)
Sets the resources parameter.- Parameters:
resources
- the list of resource names to use
-
-