Package org.ametys.plugins.odfsync.cdmfr
Class MergeMetadataForSharedProgramHelper
java.lang.Object
org.ametys.plugins.odfsync.cdmfr.MergeMetadataForSharedProgramHelper
- All Implemented Interfaces:
Component
,Serviceable
Helper for synchronizing and merging metadata from shared programs
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentTypeExtensionPoint
The content type extension pointprotected AmetysObjectResolver
The ametys object resolverprotected static XPathProcessor
The xpath processorstatic final String
The avalon rolestatic final String
The name of the JCR node holding the shared metadata -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String[]
getMergeSharedStringArrayMetadata
(SubProgram mainSubProgram, String metadataName, Logger logger) Get and merge a String array shared metadatagetSharedMetadataHolder
(SubProgram mainProgram, String subProgramCode, Logger logger) Get the composite metadata holding the shared metadata for subprogram of given codegetSharedProgramRootNode
(SubProgram mainProgram, Logger logger) Get the shared program node holding the shared subprogram nodeboolean
isValidMetadataPath
(ContentType cType, String metadataPath, Logger logger) Determines if the metadata path is a valid path from the given content type and eligible to mergeboolean
mergeSharedMetadata
(SubProgram mainProgram, Node contentNode, Set<String> metadataToMerge, Logger logger) Merge the shared metadataprotected boolean
mergeSharedMultipleMetadata
(MetadataDefinition metadataDefinition, SubProgram mainSubProgram, Node contentNode, String metadataName, Logger logger) Synchronize multiple metadata for main programprotected boolean
mergeSharedRepeaterMetadata
(MetadataDefinition metadataDefinition, SubProgram mainSubProgram, String metadataName, Logger logger) Merge all repeater entry to the main programprotected boolean
mergeSharedSingleMetadata
(MetadataDefinition metadataDefinition, SubProgram mainProgram, String metadataPath, Logger logger) Synchronize single metadata for main programvoid
service
(ServiceManager manager)
-
Field Details
-
ROLE
The avalon role -
SHARED_PROGRAMS_NODE_NAME
The name of the JCR node holding the shared metadata- See Also:
-
_xPathProcessor
The xpath processor -
_cTypeE
The content type extension point -
_resolver
The ametys object resolver
-
-
Constructor Details
-
MergeMetadataForSharedProgramHelper
public MergeMetadataForSharedProgramHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
isValidMetadataPath
Determines if the metadata path is a valid path from the given content type and eligible to merge- Parameters:
cType
- The content typemetadataPath
- The metadata pathlogger
- the logger- Returns:
- true if the metadata can be merged
-