Class SynchronizableContentsCollectionDAO
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.contentio.synchronize.SynchronizableContentsCollectionDAO
-
- All Implemented Interfaces:
LogEnabled
,Disposable
,Initializable
,Component
,Contextualizable
,Serviceable
public class SynchronizableContentsCollectionDAO extends AbstractLogEnabled implements Component, Serviceable, Initializable, Contextualizable, Disposable
DAO for accessingSynchronizableContentsCollection
-
-
Field Summary
Fields Modifier and Type Field Description static String
ROLE
Avalon Rolestatic String
SCC_PARAMETERS_SEPARATOR
Separator for parameters with model id as prefix
-
Constructor Summary
Constructors Constructor Description SynchronizableContentsCollectionDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
addCollection(Map<String,Object> values)
Add a newSynchronizableContentsCollection
void
contextualize(Context context)
void
dispose()
Map<String,Object>
editCollection(String id, Map<String,Object> values)
Map<String,Object>
getCollectionParameterValues(String collectionId)
Gets the values of the parameters of the given collectionMap<String,Object>
getEditionConfiguration()
Gets the configuration for creating/editing a collection of synchronizable contents.List<Map<String,Object>>
getSupportedUserDirectories(String populationId)
Gets the supported user directories (i.e.SynchronizableContentsCollection
getSynchronizableContentsCollection(String collectionId)
Get a synchronizable contents collection by its idMap<String,Object>
getSynchronizableContentsCollectionAsJson(String collectionId)
Gets a synchronizable contents collection to JSON formatMap<String,Object>
getSynchronizableContentsCollectionAsJson(SynchronizableContentsCollection collection)
Gets a synchronizable contents collection to JSON formatList<SynchronizableContentsCollection>
getSynchronizableContentsCollections()
Get the synchronizable contents collectionsvoid
initialize()
Map<String,Object>
removeCollection(String id)
Removes the given collectionvoid
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
SCC_PARAMETERS_SEPARATOR
public static final String SCC_PARAMETERS_SEPARATOR
Separator for parameters with model id as prefix- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SynchronizableContentsCollectionDAO
public SynchronizableContentsCollectionDAO()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getSynchronizableContentsCollectionAsJson
public Map<String,Object> getSynchronizableContentsCollectionAsJson(String collectionId)
Gets a synchronizable contents collection to JSON format- Parameters:
collectionId
- The id of the synchronizable contents collection to get- Returns:
- An object representing a
SynchronizableContentsCollection
-
getSynchronizableContentsCollectionAsJson
public Map<String,Object> getSynchronizableContentsCollectionAsJson(SynchronizableContentsCollection collection)
Gets a synchronizable contents collection to JSON format- Parameters:
collection
- The synchronizable contents collection to get- Returns:
- An object representing a
SynchronizableContentsCollection
-
getSynchronizableContentsCollections
public List<SynchronizableContentsCollection> getSynchronizableContentsCollections()
Get the synchronizable contents collections- Returns:
- the synchronizable contents collections
-
getSynchronizableContentsCollection
public SynchronizableContentsCollection getSynchronizableContentsCollection(String collectionId)
Get a synchronizable contents collection by its id- Parameters:
collectionId
- The id of collection- Returns:
- the synchronizable contents collection or
null
if not found
-
getEditionConfiguration
public Map<String,Object> getEditionConfiguration() throws Exception
Gets the configuration for creating/editing a collection of synchronizable contents.- Returns:
- A map containing information about what is needed to create/edit a collection of synchronizable contents
- Throws:
Exception
- If an error occurs.
-
getCollectionParameterValues
public Map<String,Object> getCollectionParameterValues(String collectionId)
Gets the values of the parameters of the given collection- Parameters:
collectionId
- The id of the collection- Returns:
- The values of the parameters
-
getSupportedUserDirectories
public List<Map<String,Object>> getSupportedUserDirectories(String populationId)
Gets the supported user directories (i.e. user directories based on a datasource) of the population in a json map- Parameters:
populationId
- The id of the user population- Returns:
- the supported user directories (i.e. user directories based on a datasource) of the population in a json map
-
addCollection
public String addCollection(Map<String,Object> values) throws ProcessingException
Add a newSynchronizableContentsCollection
- Parameters:
values
- The parameters' values- Returns:
- The id of new created collection or null in case of error
- Throws:
ProcessingException
- if creation failed
-
editCollection
public Map<String,Object> editCollection(String id, Map<String,Object> values) throws ProcessingException
- Parameters:
id
- The id of collection to editvalues
- The parameters' values- Returns:
- The id of new created collection or null in case of error
- Throws:
ProcessingException
- if edition failed
-
removeCollection
public Map<String,Object> removeCollection(String id)
Removes the given collection- Parameters:
id
- The id of the collection to remove- Returns:
- A map containing the id of the removed collection, or an error
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
-