Class SynchronizableContentsCollectionHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.contentio.synchronize.SynchronizableContentsCollectionHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class SynchronizableContentsCollectionHelper
extends AbstractLogEnabled
implements Serviceable, Component
Helper for Synchronizable Contents Collections.
-
Field Summary
Modifier and TypeFieldDescriptionprotected SynchronizableContentsCollectionDAO
SCC DAOstatic final String
The Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetSCCFromModelId
(String modelId) Get the firstSynchronizableContentsCollection
found for the given SCC model id.getSynchronizableCollectionIds
(Content content) Retrieves the synchronizable collection identifiersorganizeRemoteValuesByMetadata
(Map<String, Map<String, Object>> searchResult, Map<String, List<String>> mapping) Transform results to be organized by metadata, and remove the null values.void
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon Role -
_sccDAO
SCC DAO
-
-
Constructor Details
-
SynchronizableContentsCollectionHelper
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getSCCFromModelId
Get the firstSynchronizableContentsCollection
found for the given SCC model id.- Parameters:
modelId
- Id of the SCC model- Returns:
- The first SCC found or null
-
organizeRemoteValuesByMetadata
public Map<String,Map<String, organizeRemoteValuesByMetadataList<Object>>> (Map<String, Map<String, Object>> searchResult, Map<String, List<String>> mapping) Transform results to be organized by metadata, and remove the null values.- Parameters:
searchResult
- Remote values from a search by content and column or attributemapping
- Mapping between metadata and columns/attributes- Returns:
- A
Map
of possible metadata values organized by content synchronization key and metadata name
-
getSynchronizableCollectionIds
public List<String> getSynchronizableCollectionIds(Content content) throws AmetysRepositoryException Retrieves the synchronizable collection identifiers- Parameters:
content
- the content- Returns:
- the synchronizable collection identifiers
- Throws:
AmetysRepositoryException
- if an error occurs while reading SCC info on the given content
-