Package org.saidone.processors
Class DownloadNodeProcessor
java.lang.Object
org.saidone.processors.AbstractNodeProcessor
org.saidone.processors.DownloadNodeProcessor
- All Implemented Interfaces:
NodeProcessor
Downloads content and metadata of a node to the local filesystem.
For each processed node a folder matching its path is created under the
configured output directory. The node's binary content is saved using its
original name while the metadata is stored in an adjacent
*.metadata.properties.xml
file.
The output format is compatible with Alfresco bulk import.
-
Field Summary
Fields inherited from class org.saidone.processors.AbstractNodeProcessor
readOnly
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
alfPropertiesToXmlString
(Properties properties) Serializes Alfresco properties to an XML string using the configuredXmlMapper
.void
processNode
(String nodeId, ProcessorConfig config) Downloads the content and metadata of the node identified bynodeId
.static void
writeStringToFile
(String path, String content) Writes a string to the specified file usingStandardCharsets.UTF_8
.Methods inherited from class org.saidone.processors.AbstractNodeProcessor
castToListOfStrings, castToMapOfStringObject, getNode, getNode, getNode, process
-
Constructor Details
-
DownloadNodeProcessor
public DownloadNodeProcessor()
-
-
Method Details
-
processNode
Downloads the content and metadata of the node identified bynodeId
.The node is fetched from Alfresco with its properties and path information. A folder mirroring the node's repository path is then created under the configured output directory. The node's metadata and binary content are written into this folder.
- Parameters:
nodeId
- id of the node to downloadconfig
- processor configuration containing theoutput-dir
argument
-
alfPropertiesToXmlString
Serializes Alfresco properties to an XML string using the configuredXmlMapper
.- Parameters:
properties
- properties to serialize- Returns:
- XML representation of the properties
-
writeStringToFile
Writes a string to the specified file usingStandardCharsets.UTF_8
.- Parameters:
path
- output file pathcontent
- content to write- Throws:
IOException
- if the file cannot be written
-