Package org.ametys.odf.catalog
Class CatalogDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.odf.catalog.CatalogDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
- Direct Known Subclasses:
CatalogDAO
DAO for manipulating catalogs.
-
Field Summary
Modifier and TypeFieldDescriptionprotected CatalogsManager
The catalog managerprotected CurrentUserProvider
The current user providerprotected I18nUtils
The I18N utilsprotected AmetysObjectResolver
The ametys object resolverprotected Scheduler
The schedulerstatic final String
The Avalon role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateCatalog
(String title, String name, String catalogNameToCopy) Creates a new ODF catalog.editCatalog
(String id, String title) Edits an ODF catalog.Gets the properties of a catalog.getCatalogProperties
(Catalog catalog) Get the properties of a catalog as a MapgetCatalogsProperties
(List<String> ids) Gets the properties of a set of catalogs.removeCatalog
(String catalogId, boolean forceDeletion) Removes an ODF catalog.void
service
(ServiceManager manager) Set a catalog as default catalogMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role -
_catalogsManager
The catalog manager -
_resolver
The ametys object resolver -
_currentUserProvider
The current user provider -
_scheduler
The scheduler -
_i18nUtils
The I18N utils
-
-
Constructor Details
-
CatalogDAO
public CatalogDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
createCatalog
public Map<String,String> createCatalog(String title, String name, String catalogNameToCopy) throws ProcessingException Creates a new ODF catalog.- Parameters:
title
- The title of the catalogname
- The code of the catalogcatalogNameToCopy
- The catalog name to copy or null- Returns:
- The id and the title of the created catalog, or an error
- Throws:
ProcessingException
- if creation failed
-
editCatalog
Edits an ODF catalog.- Parameters:
id
- The id of the catalog to edittitle
- The title of the catalog- Returns:
- The id and the title of the edited catalog, or an error
-
setDefaultCatalog
Set a catalog as default catalog- Parameters:
id
- The id of catalog- Returns:
- The id and the title of the edited catalog, or an error
-
removeCatalog
Removes an ODF catalog.- Parameters:
catalogId
- the catalog's idforceDeletion
- if true, will not check if the catalog is referenced byProgramItem
s before deleting the catalog- Returns:
- The id of the deleted catalog, or an error
-
getCatalogProperties
Gets the properties of a catalog.- Parameters:
id
- The catalog id- Returns:
- The properties of the catalog in a map
-
getCatalogsProperties
Gets the properties of a set of catalogs.- Parameters:
ids
- The catalogs' id- Returns:
- The properties of the catalogs
-
getCatalogProperties
Get the properties of a catalog as a Map- Parameters:
catalog
- The catalog- Returns:
- The properties into a map object
-