public abstract class AbstractApogeeSynchronizableContentsCollection extends AbstractSimpleSynchronizableContentsCollection implements Contextualizable, ApogeeSynchronizableContentsCollection
| Modifier and Type | Field and Description |
|---|---|
protected static String |
__PARAM_COLUMNS
Name of paramter holding columns
|
protected static String |
__PARAM_COLUMNS_COLUMN
Name of paramter into columns holding column
|
protected static String |
__PARAM_CRITERIA
Name of parameter holding the criteria
|
protected static String |
__PARAM_CRITERIA_CRITERION
Name of parameter into criteria holding a criterion
|
protected static String |
__PARAM_CRITERIA_CRITERION_ID
Name of parameter into criterion holding the id
|
protected static String |
__PARAM_CRITERIA_CRITERION_LABEL
Name of parameter into criterion holding the label
|
protected static String |
__PARAM_CRITERIA_CRITERION_TYPE
Name of parameter into criterion holding the type
|
protected static String |
__PARAM_ID_COLUMN
Name of parameter holding the field ID column
|
protected static String |
__PARAM_MAPPING
Name of parameter holding the fields mapping
|
protected static String |
__PARAM_MAPPING_ATTRIBUTE
Name of parameter into mapping holding the remote attribute
|
protected static String |
__PARAM_MAPPING_METADATA_REF
Name of parameter into mapping holding the path of metadata
|
protected static String |
__PARAM_MAPPING_SYNCHRO
Name of parameter into mapping holding the synchronized property
|
protected ApogeeDAO |
_apogeeDAO
The DAO for remote DB Apogee
|
protected Set<String> |
_columns
Synchronized fields
|
protected Context |
_context
Context
|
protected Set<ApogeeCriterion> |
_criteria
Synchronized fields
|
protected Set<String> |
_extFields
External fields
|
protected String |
_idColumn
Name of the Apogée column which contains the ID
|
protected JSONUtils |
_jsonUtils
The JSON utils
|
protected Map<String,List<String>> |
_mapping
Mapping between metadata and columns
|
protected String |
_odfLang
Default language configured for ODF
|
protected Set<String> |
_syncFields
Synchronized fields
|
static String |
HANDLE_CONTENTS
Request attribute name to store handle contents during import or synchronization.
|
_contentHelper, _languagesManager, _sccHelper, _synchronizingContentOperatorEP_contentDAO, _contentTypeEP, _currentUserProvider, _hasGlobalError, _i18nUtils, _nbCreatedContents, _nbDeletedContents, _nbError, _nbNotChangedContents, _nbSynchronizedContents, _observationManager, _resolver, _synchroComponent, SCC_UNIQUE_ID_contentPrefix, _contentType, _id, _initialActionId, _label, _modelId, _modelParamValues, _removalSync, _reportMails, _restrictedField, _searchModelConfiguration, _synchronizeExistingContentsOnly, _synchronizingContentOperator, _validateActionId, _validateAfterImport, _workflowNameCOLLECTION_ID_PROPERTY| Constructor and Description |
|---|
AbstractApogeeSynchronizableContentsCollection() |
| Modifier and Type | Method and Description |
|---|---|
protected List<Map<String,Object>> |
_convertBigDecimal(List<Map<String,Object>> searchResults)
Convert the
BigDecimal values retrieved from database into long values |
protected boolean |
_fillContent(Map<String,List<Object>> remoteValues,
ModifiableDefaultContent content,
boolean create,
Logger logger)
Fill the content with remote values.
|
private I18nizableText |
_getCriterionLabel(Configuration configuration,
String defaultValue) |
protected boolean |
_handleAdditionalMetadata(ModifiableCompositeMetadata holder,
boolean create)
Method to add additional metadata on import or synchronize.
|
protected ModifiableDefaultContent |
_importContent(String idValue,
Map<String,Object> importParams,
String lang,
Map<String,List<Object>> remoteValues,
Logger logger)
Import a content from remote values.
|
protected List<ModifiableDefaultContent> |
_importOrSynchronizeContent(String idValue,
Map<String,List<Object>> remoteValues,
boolean forceImport,
Logger logger)
Imports or synchronizes a content for each available language
|
protected abstract List<Map<String,Object>> |
_search(Map<String,Object> searchParams,
Logger logger)
Search the contents with the search parameters.
|
protected ModifiableDefaultContent |
_synchronizeContent(ModifiableDefaultContent content,
Map<String,List<Object>> remoteValues,
Logger logger)
Synchronize a content with remove values.
|
protected Object |
_transformClobToString(Object value,
String idValue,
Logger logger)
Transform CLOB value to String value.
|
private Map<String,List<Object>> |
_transformOrgUnitMetadata(Map<String,List<Object>> remoteValues,
Logger logger) |
protected boolean |
additionalImportOperations(ModifiableDefaultContent content,
Map<String,List<Object>> remoteValues,
Map<String,Object> importParams,
Logger logger)
Add specific fields to the content.
|
protected boolean |
additionalSynchronizeOperations(ModifiableDefaultContent content,
Map<String,List<Object>> remoteValues,
Logger logger)
Add specific fields to the content.
|
protected boolean |
addToHandleContents(String contentId)
Add the content ID to the handle contents list.
|
protected void |
configureDataSource(Configuration configuration)
Configure the data source parameters.
|
protected void |
configureSearchModel()
Configure the search model used by SCCSearchTool.
|
void |
contextualize(Context context) |
Set<String> |
getExternalOnlyFields(Map<String,Object> additionalParameters)
Get the path of field that are valued externally only.
|
protected String |
getIdColumn()
Get the identifier column (can be a concatened column).
|
String |
getIdField()
Get the path of metadata holding the unique identifier
|
Set<String> |
getLocalAndExternalFields(Map<String,Object> additionalParameters)
Get the path of tri-state fields (with local and external values)
|
protected abstract String |
getMappingName()
Get the name of the mapping.
|
protected Map<String,Map<String,List<Object>>> |
getRemoteValues(Map<String,Object> parameters,
Logger logger)
Search values and return the result organized by metadata
|
protected Set<String> |
getRichTextFields()
Get the list of rich text fields of the imported content.
|
private String |
getSort(List<Object> sortList) |
int |
getTotalCount(Map<String,Object> parameters,
Logger logger)
Return the total number of results for the search.
|
protected boolean |
handleChildren(ModifiableDefaultContent content,
Logger logger)
Set the children metadata and invert relation, import and synchronize the children too.
|
protected boolean |
handleParent(ModifiableDefaultContent currentContent,
ModifiableDefaultContent parentContent,
Logger logger)
Set the parent metadata and invert relation.
|
boolean |
handleRightAssignmentContext()
Return true if a
RightAssignmentContext should be automatically generated for the contents of this SCC |
List<ModifiableDefaultContent> |
importContent(String idValue,
Map<String,Object> importParams,
Logger logger)
Import a content from remote values.
|
protected boolean |
importOrSynchronizeChildren(ModifiableDefaultContent content,
String sccModelId,
String metadataName,
String invertMetadataName,
Logger logger)
Import and synchronize children of the given content, then edit the structure of the content and its children.
|
List<ModifiableDefaultContent> |
importOrSynchronizeContents(Map<String,Object> searchParams,
Logger logger)
Method used to import the structure of an ODF content or its dependencies, import or synchronize each child recursively.
|
protected Map<String,Map<String,Object>> |
internalSearch(Map<String,Object> parameters,
int offset,
int limit,
List<Object> sort,
Logger logger)
Search values and return the result without any treatment.
|
List<ModifiableDefaultContent> |
populate(Logger logger)
Populates contents
|
protected Map<String,Object> |
putIdParameter(String idValue)
Set search parameters for the ID value.
|
void |
service(ServiceManager manager) |
protected boolean |
setAdditionalMetadata(ModifiableDefaultContent content,
Map<String,List<Object>> remoteValues,
Logger logger)
Set the additional metadata.
|
void |
synchronizeContent(ModifiableDefaultContent content,
Logger logger)
Synchronize a content with remove values.
|
_getContentsToRemove, _getIdFieldValue, _handleContent, _importOrSynchronizeContent, _importOrSynchronizeContents, _internalPopulate, _isHandled, configure, createContentAction, getContent, getTransformedRemoteValues, search, updateSyncInformations, validateContent_getContentPathQuery, _getExpressionsList, _getMetadataHolder, _isParamNotEmpty, _removeEmptyParameters, _removeMetadataIfExists, _synchronizeMetadata, _updateRelation, _updateRelation, applyChanges, applyChanges, createContentAction, deleteUnexistingContents, sendErrorMail, updateSCCProperty, validateContent_parseParameters, configureStaticParams, getContentPrefix, getContentType, getId, getInitialActionId, getLabel, getParameterValues, getReportMails, getRestrictedField, getSearchModelConfiguration, getSynchronizeCollectionModelId, getSynchronizingContentOperator, getValidateActionId, getWorkflowName, removalSync, synchronizeExistingContentsOnly, validateAfterImportpublic static final String HANDLE_CONTENTS
protected static final String __PARAM_ID_COLUMN
protected static final String __PARAM_MAPPING
protected static final String __PARAM_MAPPING_SYNCHRO
protected static final String __PARAM_MAPPING_METADATA_REF
protected static final String __PARAM_MAPPING_ATTRIBUTE
protected static final String __PARAM_CRITERIA
protected static final String __PARAM_CRITERIA_CRITERION
protected static final String __PARAM_CRITERIA_CRITERION_ID
protected static final String __PARAM_CRITERIA_CRITERION_LABEL
protected static final String __PARAM_CRITERIA_CRITERION_TYPE
protected static final String __PARAM_COLUMNS
protected static final String __PARAM_COLUMNS_COLUMN
protected Set<String> _extFields
protected Set<String> _syncFields
protected Set<ApogeeCriterion> _criteria
protected ApogeeDAO _apogeeDAO
protected JSONUtils _jsonUtils
public AbstractApogeeSynchronizableContentsCollection()
public void service(ServiceManager manager) throws ServiceException
service in interface Serviceableservice in class AbstractSimpleSynchronizableContentsCollectionServiceExceptionpublic void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionprotected void configureDataSource(Configuration configuration) throws ConfigurationException
AbstractStaticSynchronizableContentsCollectionconfigureDataSource in class AbstractStaticSynchronizableContentsCollectionconfiguration - Configuration to readConfigurationException - If an error occursprivate I18nizableText _getCriterionLabel(Configuration configuration, String defaultValue)
public List<ModifiableDefaultContent> populate(Logger logger)
SynchronizableContentsCollectionpopulate in interface SynchronizableContentsCollectionpopulate in class AbstractSimpleSynchronizableContentsCollectionlogger - The loggerprotected Map<String,Map<String,Object>> internalSearch(Map<String,Object> parameters, int offset, int limit, List<Object> sort, Logger logger)
AbstractSimpleSynchronizableContentsCollectioninternalSearch in class AbstractSimpleSynchronizableContentsCollectionparameters - Search parameters to restrict the searchoffset - Begin of the searchlimit - Number of resultssort - Sort of results (ignored for LDAP results)logger - The loggerprotected Map<String,Map<String,List<Object>>> getRemoteValues(Map<String,Object> parameters, Logger logger)
AbstractSimpleSynchronizableContentsCollectiongetRemoteValues in class AbstractSimpleSynchronizableContentsCollectionparameters - Search parameters to restrict the searchlogger - The loggerprotected List<ModifiableDefaultContent> _importOrSynchronizeContent(String idValue, Map<String,List<Object>> remoteValues, boolean forceImport, Logger logger)
AbstractSimpleSynchronizableContentsCollection_importOrSynchronizeContent in class AbstractSimpleSynchronizableContentsCollectionidValue - The unique identifier of the contentremoteValues - The remote valuesforceImport - To force import and ignoring the synchronize existing contents only optionlogger - The loggerpublic List<ModifiableDefaultContent> importContent(String idValue, Map<String,Object> importParams, Logger logger) throws Exception
SynchronizableContentsCollectionimportContent in interface SynchronizableContentsCollectionimportContent in class AbstractSimpleSynchronizableContentsCollectionidValue - Id (for import/synchronization) of the content to importimportParams - Additional parameterslogger - The loggerException - if an error occurs.public void synchronizeContent(ModifiableDefaultContent content, Logger logger) throws Exception
SynchronizableContentsCollectionsynchronizeContent in interface SynchronizableContentsCollectionsynchronizeContent in class AbstractSimpleSynchronizableContentsCollectioncontent - The content to synchronizelogger - The loggerException - if an error occurs.protected Map<String,Object> putIdParameter(String idValue)
AbstractSimpleSynchronizableContentsCollectionputIdParameter in class AbstractSimpleSynchronizableContentsCollectionidValue - Value to searchprotected abstract List<Map<String,Object>> _search(Map<String,Object> searchParams, Logger logger)
searchParams - Search parameterslogger - The loggerprotected List<Map<String,Object>> _convertBigDecimal(List<Map<String,Object>> searchResults)
BigDecimal values retrieved from database into long valuessearchResults - The initial search results from databaseprotected Object _transformClobToString(Object value, String idValue, Logger logger)
value - The input valueidValue - The identifier of the programlogger - The loggerprotected abstract String getMappingName()
protected String getIdColumn()
public String getIdField()
SynchronizableContentsCollectiongetIdField in interface SynchronizableContentsCollectionpublic Set<String> getLocalAndExternalFields(Map<String,Object> additionalParameters)
SynchronizableContentsCollectiongetLocalAndExternalFields in interface SynchronizableContentsCollectionadditionalParameters - Additional parameterspublic Set<String> getExternalOnlyFields(Map<String,Object> additionalParameters)
SynchronizableContentsCollectiongetExternalOnlyFields in interface SynchronizableContentsCollectionadditionalParameters - Additional parametersprotected boolean _fillContent(Map<String,List<Object>> remoteValues, ModifiableDefaultContent content, boolean create, Logger logger)
AbstractSimpleSynchronizableContentsCollection_fillContent in class AbstractSimpleSynchronizableContentsCollectionremoteValues - The remote valuescontent - The content to synchronizecreate - true if content is creating, false if it is updatedlogger - The loggertrue if changes were madeprotected boolean _handleAdditionalMetadata(ModifiableCompositeMetadata holder, boolean create)
holder - The holder of the content to updatecreate - If we are on creation modetrue if changes has been madeprotected Set<String> getRichTextFields()
protected void configureSearchModel()
AbstractStaticSynchronizableContentsCollectionconfigureSearchModel in class AbstractStaticSynchronizableContentsCollectionprotected boolean additionalImportOperations(ModifiableDefaultContent content, Map<String,List<Object>> remoteValues, Map<String,Object> importParams, Logger logger)
AbstractSimpleSynchronizableContentsCollectionadditionalImportOperations in class AbstractSimpleSynchronizableContentsCollectioncontent - Content to updateremoteValues - Values of the contentimportParams - Import parameterslogger - The loggertrue if there are changesprotected boolean additionalSynchronizeOperations(ModifiableDefaultContent content, Map<String,List<Object>> remoteValues, Logger logger)
AbstractSimpleSynchronizableContentsCollectionadditionalSynchronizeOperations in class AbstractSimpleSynchronizableContentsCollectioncontent - Content to updateremoteValues - Values of the contentlogger - The loggertrue if there are changesprotected boolean handleParent(ModifiableDefaultContent currentContent, ModifiableDefaultContent parentContent, Logger logger)
currentContent - Current contentparentContent - Parent content to setlogger - The loggertrue if there are changesprotected boolean handleChildren(ModifiableDefaultContent content, Logger logger)
content - Current contentlogger - The loggertrue if there are changesprotected boolean setAdditionalMetadata(ModifiableDefaultContent content, Map<String,List<Object>> remoteValues, Logger logger)
content - Current contentremoteValues - Values of the contentlogger - The loggertrue if there are changespublic int getTotalCount(Map<String,Object> parameters, Logger logger)
SynchronizableContentsCollectiongetTotalCount in interface SynchronizableContentsCollectiongetTotalCount in class AbstractSimpleSynchronizableContentsCollectionparameters - Parameters for the searchlogger - The loggerprotected ModifiableDefaultContent _importContent(String idValue, Map<String,Object> importParams, String lang, Map<String,List<Object>> remoteValues, Logger logger) throws Exception
AbstractSimpleSynchronizableContentsCollection_importContent in class AbstractSimpleSynchronizableContentsCollectionidValue - Id (for import/synchronization) of the content to importimportParams - Specific parameters for importlang - Lang of the contentremoteValues - Values of the contentlogger - The loggerException - if an error occurs.protected ModifiableDefaultContent _synchronizeContent(ModifiableDefaultContent content, Map<String,List<Object>> remoteValues, Logger logger) throws Exception
AbstractSimpleSynchronizableContentsCollection_synchronizeContent in class AbstractSimpleSynchronizableContentsCollectioncontent - The content to synchronizeremoteValues - Values to synchronizelogger - The loggerException - if an error occurs.protected boolean importOrSynchronizeChildren(ModifiableDefaultContent content, String sccModelId, String metadataName, String invertMetadataName, Logger logger)
content - Parent contentsccModelId - SCC model IDmetadataName - Metadata name to setinvertMetadataName - Metadata name of the invert relationlogger - The loggertrue if there are changespublic List<ModifiableDefaultContent> importOrSynchronizeContents(Map<String,Object> searchParams, Logger logger)
ApogeeSynchronizableContentsCollectionimportOrSynchronizeContents in interface ApogeeSynchronizableContentsCollectionsearchParams - Search parameterslogger - The loggerList of ModifiableDefaultContent of children (imported or synchronized)protected boolean addToHandleContents(String contentId)
contentId - Content IDtrue if the content ID have been added, false is returned if the content ID already exists in the handle contents list.private Map<String,List<Object>> _transformOrgUnitMetadata(Map<String,List<Object>> remoteValues, Logger logger)
public boolean handleRightAssignmentContext()
SynchronizableContentsCollectionRightAssignmentContext should be automatically generated for the contents of this SCChandleRightAssignmentContext in interface SynchronizableContentsCollectionRightAssignmentContext. Return false if the rights of contents of this SCC are handle by its own RightAssignmentContext