Class CatalogsManager

All Implemented Interfaces:
LogEnabled, PluginAware, Component, Contextualizable, Serviceable

Component to handle ODF catalogs
  • Field Details

    • ROLE

      public static final String ROLE
      Avalon Role
  • Constructor Details

  • Method Details

    • contextualize

      public void contextualize(Context context) throws ContextException
      Specified by:
      contextualize in interface Contextualizable
      Throws:
      ContextException
    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • setPluginInfo

      public void setPluginInfo(String pluginName, String featureName, String id)
      Description copied from interface: PluginAware
      Sets the plugin info relative to the current component.
      Note : The feature name may be null if the targeted component in declared at plugin level.
      Specified by:
      setPluginInfo in interface PluginAware
      Parameters:
      pluginName - Unique identifier for the plugin hosting the extension
      featureName - Unique feature identifier (unique for a given pluginName)
      id - Unique identifier of this component
    • getCatalogs

      Get the list of catalogs
      Returns:
      the catalogs
    • getCatalog

      public Catalog getCatalog(String name)
      Get a catalog matching with the given name
      Parameters:
      name - The name
      Returns:
      a catalog, or null if not found
    • getDefaultCatalogName

      Returns the name of the default catalog
      Returns:
      the name of the default catalog
    • getDefaultCatalog

      Returns the default catalog
      Returns:
      the default catalog or null if no default catalog was defined.
    • getContentCatalog

      public String getContentCatalog(String contentId)
      Get the name of the catalog of a ODF content
      Parameters:
      contentId - The id of content
      Returns:
      The catalog's name
    • canEditCatalog

      public Map<String,Object> canEditCatalog(String contentId)
      Determines if the catalog can be modified from the given content
      Parameters:
      contentId - The content id
      Returns:
      A map with success=false if the catalog cannot be edited
    • setContentCatalog

      public void setContentCatalog(String catalog, String contentId) throws com.opensymphony.workflow.WorkflowException
      Set the catalog of a content. This will modify recursively the catalog of referenced children
      Parameters:
      catalog - The catalog
      contentId - The id of content to edit
      Throws:
      com.opensymphony.workflow.WorkflowException - if an error occurred
    • getCatalogsRootNode

      Get the root catalogs storage object.
      Returns:
      the root catalogs node
      Throws:
      AmetysRepositoryException - if a repository error occurs.
    • createCatalog

      public Catalog createCatalog(String name, String title)
      Create a new catalog
      Parameters:
      name - The unique name
      title - The title of catalog
      Returns:
      the created catalog
    • getPrograms

      Get the programs of a catalog for all languages
      Parameters:
      catalog - The code of catalog
      Returns:
      The programs
    • getPrograms

      Get the programs of a catalog
      Parameters:
      catalog - The code of catalog
      lang - The language. Can be null to get programs for all languages
      Returns:
      The programs
    • copyCatalog

      public void copyCatalog(Catalog catalog, Catalog catalogToCopy, ContainerProgressionTracker progressionTracker) throws ProcessingException
      Copy the programs and its hierarchy from a catalog to another. The referenced courses are NOT copied.
      Parameters:
      catalog - The new catalog to populate
      catalogToCopy - The catalog from which we copy the programs.
      progressionTracker - the progression tracker for catalog copy
      Throws:
      ProcessingException - If an error occurred during copy
    • getCopyActionId

      protected int getCopyActionId()
      Get the workflow action id for copy.
      Returns:
      The workflow action id
    • deleteCatalog

      public Map<String,Object> deleteCatalog(Catalog catalog)
      Delete catalog
      Parameters:
      catalog - the catalog to delete
      Returns:
      the result map
    • getContents

      public List<Content> getContents(String catalogName)
      Get all the contents to delete when deleting a catalog.
      Parameters:
      catalogName - The catalog name
      Returns:
      a Stream of Content to delete