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 Details

  • Constructor Details

  • Method Details

    • compareTo

      public int compareTo(org.opencms.file.collectors.I_CmsResourceCollector arg0)
      Specified by:
      compareTo in interface Comparable<org.opencms.file.collectors.I_CmsResourceCollector>
      See Also:
    • getCreateLink

      public String getCreateLink(org.opencms.file.CmsObject cms)
      Specified by:
      getCreateLink in interface org.opencms.file.collectors.I_CmsResourceCollector
      See Also:
      • I_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject)
    • getCreateLink

      public String getCreateLink(org.opencms.file.CmsObject cms, String collectorName, String param)
      Specified by:
      getCreateLink in interface org.opencms.file.collectors.I_CmsResourceCollector
      See Also:
      • I_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
    • getCreateParam

      public String getCreateParam(org.opencms.file.CmsObject cms)
      Specified by:
      getCreateParam in interface org.opencms.file.collectors.I_CmsResourceCollector
      See Also:
      • I_CmsResourceCollector.getCreateParam(org.opencms.file.CmsObject)
    • getCreateParam

      public String getCreateParam(org.opencms.file.CmsObject cms, String collectorName, String param)
      Specified by:
      getCreateParam in interface org.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, String collectorName, String param)
      Specified by:
      getCreateTypeId in interface org.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 interface org.opencms.file.collectors.I_CmsResourceCollector
      See Also:
      • I_CmsResourceCollector.getDefaultCollectorName()
    • getDefaultCollectorParam

      Specified by:
      getDefaultCollectorParam in interface org.opencms.file.collectors.I_CmsResourceCollector
      See Also:
      • I_CmsResourceCollector.getDefaultCollectorParam()
    • getListItems

      public List<CmsListItem> getListItems(String parameter) throws org.opencms.main.CmsException
      Returns a list of list items from a list of resources.

      Specified by:
      getListItems in interface I_CmsListResourceCollector
      Parameters:
      parameter - the collector parameter or null 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 interface org.opencms.file.collectors.I_CmsResourceCollector
      See Also:
      • I_CmsResourceCollector.getOrder()
    • getPublishResources

      public 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 interface org.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 interface I_CmsListResourceCollector
      Parameters:
      cms - the cms object
      item - 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.CmsException
      Returns all, unsorted and unfiltered, resources.

      Be sure to cache the resources.

      Specified by:
      getResources in interface I_CmsListResourceCollector
      Parameters:
      cms - the cms object
      params - 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 interface org.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 interface org.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 interface org.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 interface I_CmsListResourceCollector
      Returns:
      the workplace object
    • setDefaultCollectorName

      public void setDefaultCollectorName(String collectorName)
      Specified by:
      setDefaultCollectorName in interface org.opencms.file.collectors.I_CmsResourceCollector
      See Also:
      • I_CmsResourceCollector.setDefaultCollectorName(java.lang.String)
    • setDefaultCollectorParam

      public 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.

      Specified by:
      setDefaultCollectorParam in interface org.opencms.file.collectors.I_CmsResourceCollector
      See Also:
      • I_CmsResourceCollector.setDefaultCollectorParam(java.lang.String)
    • setOrder

      public void setOrder(int order)
      Specified by:
      setOrder in interface org.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 interface I_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 from
      list - the list
      showPermissions - if to show permissions
      showDateLastMod - if to show the last modification date
      showUserLastMod - if to show the last modification user
      showDateCreate - if to show the creation date
      showUserCreate - if to show the creation date
      showDateRel - if to show the date released
      showDateExp - if to show the date expired
      showState - if to show the state
      showLockedBy - if to show the lock user
      showSite - 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.CmsException
      Wrapper method for caching the result of getResources(CmsObject, Map).

      Parameters:
      cms - the cms object
      params - 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

      protected CmsListState getState(Map<String,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 item
      resUtil - the resource util object for getting the info from
    • setResourcesParam

      protected void setResourcesParam(List<String> resources)
      Sets the resources parameter.

      Parameters:
      resources - the list of resource names to use