Package com.axemble.vdoc.sdk.impl
Class ProcessResourceTransformer
java.lang.Object
com.axemble.vdoc.sdk.impl.AbstractElement
com.axemble.vdoc.sdk.impl.base.BaseTransformer
com.axemble.vdoc.sdk.impl.ProcessResourceTransformer
- All Implemented Interfaces:
com.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
,ITransformer
,Serializable
public class ProcessResourceTransformer
extends com.axemble.vdoc.sdk.impl.base.BaseTransformer
implements ITransformer, com.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
- Author:
- vlygeros
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected IDirectoryModule
protected boolean
protected ILibraryModule
static final String
protected com.axemble.vdp.resource.classes.ResourceProtocolURICache
protected com.axemble.vdoc.core.helpers.TransformerHelper
Fields inherited from class com.axemble.vdoc.sdk.impl.AbstractElement
module
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildXMLBody
(Element parent, IResource resource, Collection columns) void
void
buildXMLBody
(Element parent, IResource resource, Map<String, String> labels, boolean includeWorkflowInstanceBody) void
buildXMLHeader
(Element parent, IResource resource) void
buildXMLHistory
(Element parent, IResource resource) protected static String
dateToString
(Date date) protected IDirectoryModule
com.axemble.vdp.resource.classes.ResourceProtocolURICache
protected String
getResourceInterface
(IResource resource) void
importHistory
(IResource childResource, Element fieldElement) protected String
protected static Date
void
resourceToXML
(IResource resource, OutputStream outputStream) Allows to transform aIResource
object to an XML document.void
resourceToXML
(IResource resource, OutputStream outputStream, boolean includeAttachmentsContent, boolean includeWorkflowInstanceBody) Allows to transform aIResource
object to an XML document.void
resourceToXML
(IResource resource, OutputStream outputStream, File attachmentsFolder) Allows to transform aIResource
object to an XML document.void
resourceToXML
(IResource resource, OutputStream outputStream, File attachmentsFolder, boolean includeAttachmentsContent) Allows to transform aIResource
object to an XML document.void
resourceToXML
(IResource resource, OutputStream outputStream, File attachmentsFolder, boolean includeAttachmentsContent, boolean includeWorkflowInstanceBody) void
resourceToXML
(IResource resource, Collection columns, OutputStream outputStream) Allows to get values of a resource by specifying the columns to retrieve.void
setIncludeAttachmentsContent
(boolean includeAttachmentsContent) Allows to include or not the files content.void
setIncludeLabels
(boolean includeLabels) Allows to include or not the labels.void
setIncludeLinkedResources
(boolean includeLinkedResources) Allows to include or notILinkedResource
objects.void
setIncludeLinkedWorkflowInstances
(boolean includeLinkedWorkflowInstances) Allows to include or not linkedIWorkflowInstance
objects.void
setIncludeStorageResources
(boolean includeStorageResources) Allows to include or notIStorageResource
objects.void
setProtocolURICache
(com.axemble.vdp.resource.classes.ResourceProtocolURICache protocolURICache) void
setStopExecutionOnCriticalError
(boolean stopExecutionOnCriticalError) Allows to stop the execution of the treatment if an exception occur.void
useGuid
(boolean generateGuid) Allows to specify whether to use generate a Guid or not.xmlToResource
(IResource resource, InputStream inputStream) Updates a resource.xmlToResource
(InputStream inputStream) Import a resource from an XML stream.xmlToResource
(InputStream inputStream, File resourceFolder) Import a resource from an XML stream.Methods inherited from class com.axemble.vdoc.sdk.impl.base.BaseTransformer
resourceToXML, resourceToXML
Methods inherited from class com.axemble.vdoc.sdk.impl.AbstractElement
getModule
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.axemble.vdoc.sdk.interfaces.ITransformer
resourceToXML, resourceToXML
-
Field Details
-
prefix
- See Also:
-
directoryModule
-
libraryModule
-
includeLabels
protected boolean includeLabels -
transformerHelper
protected com.axemble.vdoc.core.helpers.TransformerHelper transformerHelper -
protocolURICache
protected com.axemble.vdp.resource.classes.ResourceProtocolURICache protocolURICache
-
-
Constructor Details
-
ProcessResourceTransformer
-
-
Method Details
-
importHistory
public void importHistory(IResource childResource, Element fieldElement) throws WorkflowModuleException - Specified by:
importHistory
in interfacecom.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
- Throws:
WorkflowModuleException
-
xmlToResource
Description copied from interface:ITransformer
Import a resource from an XML stream.- Specified by:
xmlToResource
in interfaceITransformer
- Parameters:
inputStream
- TheInputStream
object to read from.resourceFolder
- The directory from where to import the attachments.- Returns:
- A
IResource
object. - Throws:
IOException
-
xmlToResource
Description copied from interface:ITransformer
Import a resource from an XML stream.- Specified by:
xmlToResource
in interfaceITransformer
- Parameters:
inputStream
- TheInputStream
object to read from.- Returns:
- A
IResource
object. - Throws:
IOException
-
xmlToResource
Description copied from interface:ITransformer
Updates a resource.- Specified by:
xmlToResource
in interfaceITransformer
- Parameters:
resource
- TheIResource
to update.inputStream
- TheInputStream
object to read from.- Returns:
- A
IResource
object. - Throws:
IOException
-
getResourceInterface
-
resourceToXML
public void resourceToXML(IResource resource, OutputStream outputStream, File attachmentsFolder, boolean includeAttachmentsContent) throws IOException Description copied from interface:ITransformer
Allows to transform aIResource
object to an XML document.- Specified by:
resourceToXML
in interfaceITransformer
- Specified by:
resourceToXML
in classcom.axemble.vdoc.sdk.impl.base.BaseTransformer
- Parameters:
resource
- TheIResource
to transform.outputStream
- TheOutputStream
object to write to.attachmentsFolder
- The directory where to export the attachments.includeAttachmentsContent
- If true, includes the attachments into the XML stream.- Throws:
IOException
-
resourceToXML
public void resourceToXML(IResource resource, OutputStream outputStream, boolean includeAttachmentsContent, boolean includeWorkflowInstanceBody) throws IOException Description copied from interface:ITransformer
Allows to transform aIResource
object to an XML document.- Specified by:
resourceToXML
in interfaceITransformer
- Overrides:
resourceToXML
in classcom.axemble.vdoc.sdk.impl.base.BaseTransformer
- Parameters:
resource
- TheIResource
to transform.outputStream
- TheOutputStream
object to write to.includeAttachmentsContent
- If true, includes the attachments into the XML stream.- Throws:
IOException
-
resourceToXML
public void resourceToXML(IResource resource, OutputStream outputStream, File attachmentsFolder, boolean includeAttachmentsContent, boolean includeWorkflowInstanceBody) throws IOException - Overrides:
resourceToXML
in classcom.axemble.vdoc.sdk.impl.base.BaseTransformer
- Throws:
IOException
-
resourceToXML
public void resourceToXML(IResource resource, OutputStream outputStream, File attachmentsFolder) throws IOException Description copied from interface:ITransformer
Allows to transform aIResource
object to an XML document.- Specified by:
resourceToXML
in interfaceITransformer
- Overrides:
resourceToXML
in classcom.axemble.vdoc.sdk.impl.base.BaseTransformer
- Parameters:
resource
- TheIResource
to transform.outputStream
- TheOutputStream
object to write to.attachmentsFolder
- The directory where to export the attachments.- Throws:
IOException
-
resourceToXML
Description copied from interface:ITransformer
Allows to transform aIResource
object to an XML document.- Specified by:
resourceToXML
in interfaceITransformer
- Overrides:
resourceToXML
in classcom.axemble.vdoc.sdk.impl.base.BaseTransformer
- Parameters:
resource
- TheIResource
to transform.outputStream
- TheOutputStream
object to write to.- Throws:
IOException
-
buildXMLHeader
- Specified by:
buildXMLHeader
in interfacecom.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
- Throws:
Exception
-
buildXMLHistory
- Specified by:
buildXMLHistory
in interfacecom.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
-
buildXMLBody
- Throws:
Exception
-
buildXMLBody
public void buildXMLBody(Element parent, IResource resource, Map<String, String> labels) throws Exception- Specified by:
buildXMLBody
in interfacecom.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
- Throws:
Exception
-
buildXMLBody
public void buildXMLBody(Element parent, IResource resource, Map<String, String> labels, boolean includeWorkflowInstanceBody) throws Exception- Specified by:
buildXMLBody
in interfacecom.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
- Throws:
Exception
-
dateToString
-
parseDate
-
notNull
-
getDirectoryModule
-
resourceToXML
public void resourceToXML(IResource resource, Collection columns, OutputStream outputStream) throws IOException Description copied from interface:ITransformer
Allows to get values of a resource by specifying the columns to retrieve.- Specified by:
resourceToXML
in interfaceITransformer
- Parameters:
resource
- TheIResource
object to request property values from.columns
- ACollection
of property names.outputStream
- TheOutputStream
object to write to.- Throws:
IOException
-
setIncludeAttachmentsContent
public void setIncludeAttachmentsContent(boolean includeAttachmentsContent) Description copied from interface:ITransformer
Allows to include or not the files content. By default, the value is set to true.- Specified by:
setIncludeAttachmentsContent
in interfaceITransformer
- Parameters:
includeAttachmentsContent
- Set to false to avoid file content inclusion.
-
setIncludeLabels
public void setIncludeLabels(boolean includeLabels) Description copied from interface:ITransformer
Allows to include or not the labels. By default, the value is set to true.- Specified by:
setIncludeLabels
in interfaceITransformer
- Parameters:
includeLabels
- Set to false to avoid labels inclusion.
-
setIncludeLinkedResources
public void setIncludeLinkedResources(boolean includeLinkedResources) Description copied from interface:ITransformer
Allows to include or notILinkedResource
objects. By default, the value is set to true.- Specified by:
setIncludeLinkedResources
in interfaceITransformer
- Parameters:
includeLinkedResources
- Set to false to avoid linked resources inclusion.
-
setIncludeLinkedWorkflowInstances
public void setIncludeLinkedWorkflowInstances(boolean includeLinkedWorkflowInstances) Description copied from interface:ITransformer
Allows to include or not linkedIWorkflowInstance
objects. By default, the value is set to true.- Specified by:
setIncludeLinkedWorkflowInstances
in interfaceITransformer
- Parameters:
includeLinkedWorkflowInstances
- Set to false to avoid linked workflow instances inclusion.
-
getProtocolURICache
public com.axemble.vdp.resource.classes.ResourceProtocolURICache getProtocolURICache() -
setProtocolURICache
public void setProtocolURICache(com.axemble.vdp.resource.classes.ResourceProtocolURICache protocolURICache) -
useGuid
public void useGuid(boolean generateGuid) Description copied from interface:ITransformer
Allows to specify whether to use generate a Guid or not.- Specified by:
useGuid
in interfaceITransformer
- Parameters:
generateGuid
-
-
setIncludeStorageResources
public void setIncludeStorageResources(boolean includeStorageResources) Description copied from interface:ITransformer
Allows to include or notIStorageResource
objects. By default, the value is set to false.- Specified by:
setIncludeStorageResources
in interfacecom.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
- Specified by:
setIncludeStorageResources
in interfaceITransformer
- Parameters:
includeStorageResources
- Set to true to allow storage resources inclusion.
-
setStopExecutionOnCriticalError
public void setStopExecutionOnCriticalError(boolean stopExecutionOnCriticalError) Description copied from interface:ITransformer
Allows to stop the execution of the treatment if an exception occur. By default, the value is set to false.- Specified by:
setStopExecutionOnCriticalError
in interfaceITransformer
- Parameters:
stopExecutionOnCriticalError
- Set to true to stop the execution of the treatment if an exception occure.
-