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 Details

    • prefix

      public static final String prefix
      See Also:
    • directoryModule

      protected IDirectoryModule directoryModule
    • libraryModule

      protected ILibraryModule 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

      protected ProcessResourceTransformer(IModule module)
  • Method Details

    • importHistory

      public void importHistory(IResource childResource, Element fieldElement) throws WorkflowModuleException
      Specified by:
      importHistory in interface com.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
      Throws:
      WorkflowModuleException
    • xmlToResource

      public IResource xmlToResource(InputStream inputStream, File resourceFolder) throws IOException
      Description copied from interface: ITransformer
      Import a resource from an XML stream.
      Specified by:
      xmlToResource in interface ITransformer
      Parameters:
      inputStream - The InputStream object to read from.
      resourceFolder - The directory from where to import the attachments.
      Returns:
      A IResource object.
      Throws:
      IOException
    • xmlToResource

      public IResource xmlToResource(InputStream inputStream) throws IOException
      Description copied from interface: ITransformer
      Import a resource from an XML stream.
      Specified by:
      xmlToResource in interface ITransformer
      Parameters:
      inputStream - The InputStream object to read from.
      Returns:
      A IResource object.
      Throws:
      IOException
    • xmlToResource

      public IResource xmlToResource(IResource resource, InputStream inputStream) throws IOException
      Description copied from interface: ITransformer
      Updates a resource.
      Specified by:
      xmlToResource in interface ITransformer
      Parameters:
      resource - The IResource to update.
      inputStream - The InputStream object to read from.
      Returns:
      A IResource object.
      Throws:
      IOException
    • getResourceInterface

      protected String getResourceInterface(IResource resource)
    • resourceToXML

      public void resourceToXML(IResource resource, OutputStream outputStream, File attachmentsFolder, boolean includeAttachmentsContent) throws IOException
      Description copied from interface: ITransformer
      Allows to transform a IResource object to an XML document.
      Specified by:
      resourceToXML in interface ITransformer
      Specified by:
      resourceToXML in class com.axemble.vdoc.sdk.impl.base.BaseTransformer
      Parameters:
      resource - The IResource to transform.
      outputStream - The OutputStream 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 a IResource object to an XML document.
      Specified by:
      resourceToXML in interface ITransformer
      Overrides:
      resourceToXML in class com.axemble.vdoc.sdk.impl.base.BaseTransformer
      Parameters:
      resource - The IResource to transform.
      outputStream - The OutputStream 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 class com.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 a IResource object to an XML document.
      Specified by:
      resourceToXML in interface ITransformer
      Overrides:
      resourceToXML in class com.axemble.vdoc.sdk.impl.base.BaseTransformer
      Parameters:
      resource - The IResource to transform.
      outputStream - The OutputStream object to write to.
      attachmentsFolder - The directory where to export the attachments.
      Throws:
      IOException
    • resourceToXML

      public void resourceToXML(IResource resource, OutputStream outputStream) throws IOException
      Description copied from interface: ITransformer
      Allows to transform a IResource object to an XML document.
      Specified by:
      resourceToXML in interface ITransformer
      Overrides:
      resourceToXML in class com.axemble.vdoc.sdk.impl.base.BaseTransformer
      Parameters:
      resource - The IResource to transform.
      outputStream - The OutputStream object to write to.
      Throws:
      IOException
    • buildXMLHeader

      public void buildXMLHeader(Element parent, IResource resource) throws Exception
      Specified by:
      buildXMLHeader in interface com.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
      Throws:
      Exception
    • buildXMLHistory

      public void buildXMLHistory(Element parent, IResource resource)
      Specified by:
      buildXMLHistory in interface com.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
    • buildXMLBody

      public void buildXMLBody(Element parent, IResource resource, Collection columns) throws Exception
      Throws:
      Exception
    • buildXMLBody

      public void buildXMLBody(Element parent, IResource resource, Map<String,String> labels) throws Exception
      Specified by:
      buildXMLBody in interface com.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 interface com.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
      Throws:
      Exception
    • dateToString

      protected static String dateToString(Date date)
    • parseDate

      protected static Date parseDate(String dateAsString)
    • notNull

      protected String notNull(String data)
    • getDirectoryModule

      protected IDirectoryModule 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 interface ITransformer
      Parameters:
      resource - The IResource object to request property values from.
      columns - A Collection of property names.
      outputStream - The OutputStream 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 interface ITransformer
      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 interface ITransformer
      Parameters:
      includeLabels - Set to false to avoid labels inclusion.
    • setIncludeLinkedResources

      public void setIncludeLinkedResources(boolean includeLinkedResources)
      Description copied from interface: ITransformer
      Allows to include or not ILinkedResource objects. By default, the value is set to true.
      Specified by:
      setIncludeLinkedResources in interface ITransformer
      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 linked IWorkflowInstance objects. By default, the value is set to true.
      Specified by:
      setIncludeLinkedWorkflowInstances in interface ITransformer
      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 interface ITransformer
      Parameters:
      generateGuid -
    • setIncludeStorageResources

      public void setIncludeStorageResources(boolean includeStorageResources)
      Description copied from interface: ITransformer
      Allows to include or not IStorageResource objects. By default, the value is set to false.
      Specified by:
      setIncludeStorageResources in interface com.axemble.vdoc.core.helpers.transformer.InternalResourceTransformer
      Specified by:
      setIncludeStorageResources in interface ITransformer
      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 interface ITransformer
      Parameters:
      stopExecutionOnCriticalError - Set to true to stop the execution of the treatment if an exception occure.