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
Fields Modifier and Type Field Description protected ContentTypeExtensionPoint
_contentTypeEP
The content type extension pointprotected SynchronizableContentsCollectionDAO
_sccDAO
SCC DAOstatic String
ROLE
The Avalon Role
-
Constructor Summary
Constructors Constructor Description SynchronizableContentsCollectionHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
getCollectionExpression(String collectionId)
Retrieves a query expression testing the collectionSynchronizableContentsCollection
getSCCFromModelId(String modelId)
Get the firstSynchronizableContentsCollection
found for the given SCC model id.Set<String>
getSynchronizableCollectionIds(Content content)
Retrieves the synchronizable collection identifiersMap<String,Map<String,List<Object>>>
organizeRemoteValuesByAttribute(Map<String,Map<String,Object>> searchResult, Map<String,List<String>> mapping)
Transform results to be organized by content attribute, and remove the null values.void
service(ServiceManager smanager)
void
updateSCCProperty(Content content, String collectionId)
Add the given synchronizable collection id to the existing ones-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_sccDAO
protected SynchronizableContentsCollectionDAO _sccDAO
SCC DAO
-
_contentTypeEP
protected ContentTypeExtensionPoint _contentTypeEP
The content type extension point
-
-
Constructor Detail
-
SynchronizableContentsCollectionHelper
public SynchronizableContentsCollectionHelper()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getSCCFromModelId
public SynchronizableContentsCollection getSCCFromModelId(String modelId)
Get the firstSynchronizableContentsCollection
found for the given SCC model id.- Parameters:
modelId
- Id of the SCC model- Returns:
- The first SCC found or null
-
organizeRemoteValuesByAttribute
public Map<String,Map<String,List<Object>>> organizeRemoteValuesByAttribute(Map<String,Map<String,Object>> searchResult, Map<String,List<String>> mapping)
Transform results to be organized by content attribute, and remove the null values.- Parameters:
searchResult
- Remote values from a search by content and column or attributemapping
- Mapping between content attribute and columns/attributes- Returns:
- A
Map
of possible attribute values organized by content synchronization key and attribute name
-
updateSCCProperty
public void updateSCCProperty(Content content, String collectionId) throws RepositoryException
Add the given synchronizable collection id to the existing ones- Parameters:
content
- The synchronized contentcollectionId
- The ID of the collection to add- Throws:
RepositoryException
- if an error occurred
-
getSynchronizableCollectionIds
public Set<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
-
getCollectionExpression
public Expression getCollectionExpression(String collectionId)
Retrieves a query expression testing the collection- Parameters:
collectionId
- the identifier of the collection to test- Returns:
- the query expression
-
-