public class CatalogsManager extends AbstractLogEnabled implements Serviceable, Component, PluginAware, Contextualizable
Modifier and Type | Field and Description |
---|---|
private ContentWorkflowHelper |
_contentWorkflowHelper |
private Context |
_context |
private CopyCatalogUpdaterExtensionPoint |
_copyUpdaterEP |
private ContentTypeExtensionPoint |
_cTypeEP |
private ObservationManager |
_observationManager |
private ODFHelper |
_odfHelper |
private String |
_pluginName |
private AmetysObjectResolver |
_resolver |
private SolrIndexer |
_solrIndexer |
private CurrentUserProvider |
_userProvider |
static String |
ROLE
Avalon Role
|
Constructor and Description |
---|
CatalogsManager() |
Modifier and Type | Method and Description |
---|---|
private void |
_addCopyStep(Collection<String> contentIds) |
private void |
_applyChanges(WorkflowAwareContent content) |
private ModifiableTraversableAmetysObject |
_getOrCreateNode(ModifiableTraversableAmetysObject parentNode,
String nodeName,
String nodeType) |
private void |
_setCatalog(Content content,
String catalogName) |
private void |
_setCatalogToChildren(Content content,
String catalogName) |
void |
contextualize(Context context) |
void |
copyCatalog(Catalog catalog,
Catalog catalogToCopy)
Copy the programs and its hierarchy from a catalog to another.
|
Catalog |
createCatalog(String name,
String title)
Create a new catalog
|
void |
deleteCatalog(String id)
Delete catalog
|
Catalog |
getCatalog(String name)
Get a catalog matching with the given name
|
List<Catalog> |
getCatalogs()
Get the list of catalogs
|
ModifiableTraversableAmetysObject |
getCatalogsRootNode()
Get the root catalogs storage object.
|
String |
getContentCatalog(String contentId)
Get the name of the catalog of a ODF content
|
protected int |
getCopyActionId()
Get the workflow action id for copy.
|
Catalog |
getDefaultCatalog()
Returns the default catalog
|
String |
getDefaultCatalogName()
Returns the name of the default catalog
|
AmetysObjectIterable<ProgramItem> |
getProgramItems(String catalog)
Get the program's items of a catalog for all languages
|
AmetysObjectIterable<Program> |
getPrograms(String catalog)
Get the programs of a catalog for all languages
|
AmetysObjectIterable<Program> |
getPrograms(String catalog,
String lang)
Get the programs of a catalog
|
void |
service(ServiceManager manager) |
void |
setContentCatalog(String catalog,
String contentId)
Set the catalog of a content.
|
void |
setPluginInfo(String pluginName,
String featureName,
String id)
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. |
getLogger, setLogger
private AmetysObjectResolver _resolver
private CopyCatalogUpdaterExtensionPoint _copyUpdaterEP
private ObservationManager _observationManager
private CurrentUserProvider _userProvider
private ContentWorkflowHelper _contentWorkflowHelper
private String _pluginName
private ODFHelper _odfHelper
private ContentTypeExtensionPoint _cTypeEP
private SolrIndexer _solrIndexer
public CatalogsManager()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic List<Catalog> getCatalogs()
public Catalog getCatalog(String name)
name
- The namepublic String getDefaultCatalogName()
public Catalog getDefaultCatalog()
public String getContentCatalog(String contentId)
contentId
- The id of contentpublic void setContentCatalog(String catalog, String contentId) throws com.opensymphony.workflow.WorkflowException
catalog
- The catalogcontentId
- The id of content to editcom.opensymphony.workflow.WorkflowException
- if an error occurredprivate void _setCatalog(Content content, String catalogName) throws com.opensymphony.workflow.WorkflowException
com.opensymphony.workflow.WorkflowException
private void _setCatalogToChildren(Content content, String catalogName) throws com.opensymphony.workflow.WorkflowException
com.opensymphony.workflow.WorkflowException
private void _applyChanges(WorkflowAwareContent content) throws com.opensymphony.workflow.WorkflowException
com.opensymphony.workflow.WorkflowException
public ModifiableTraversableAmetysObject getCatalogsRootNode() throws AmetysRepositoryException
AmetysRepositoryException
- if a repository error occurs.public Catalog createCatalog(String name, String title)
name
- The unique nametitle
- The title of catalogpublic AmetysObjectIterable<Program> getPrograms(String catalog)
catalog
- The code of catalogpublic AmetysObjectIterable<ProgramItem> getProgramItems(String catalog)
catalog
- The code of catalogProgramItem
public AmetysObjectIterable<Program> getPrograms(String catalog, String lang)
catalog
- The code of cataloglang
- The language. Can be null to get programs for all languagespublic void copyCatalog(Catalog catalog, Catalog catalogToCopy) throws ProcessingException
catalog
- The new catalog to populatecatalogToCopy
- The catalog from which we copy the programs.ProcessingException
- If an error occurred during copyprivate void _addCopyStep(Collection<String> contentIds) throws AmetysRepositoryException, com.opensymphony.workflow.WorkflowException
AmetysRepositoryException
com.opensymphony.workflow.WorkflowException
protected int getCopyActionId()
public void deleteCatalog(String id)
id
- the id of catalogprivate ModifiableTraversableAmetysObject _getOrCreateNode(ModifiableTraversableAmetysObject parentNode, String nodeName, String nodeType) throws AmetysRepositoryException
AmetysRepositoryException