Class SingleFile

java.lang.Object
de.xima.fc.workflow.model.nodes.SingleFile
All Implemented Interfaces:
IReferencedFileList, ISingleFileProviding, Serializable

@NotEmptyIf(field="url",dependants="resource",target=SingleFile.class,payload=SingleFile.url.class) @NotEmptyIf(field="searchFilename",dependants="resource",target=SingleFile.class,payload=SingleFile.searchFilename.class) public final class SingleFile extends Object implements Serializable, ISingleFileProviding
Models a single file that may come from multiple sources, such as client file, project files or external files referenced via a URL.

Use of this class is optional. However, its use is strongly recommended for consistency. This model comes with a pre-defined XHTML UI page for configuring instances of this class. During execution, the INodeExecutionParams and IWorkflowExecutionContext contain helper method to handle the options provided by this class. New options or features may be added to this class in the future. If you make use of this class, your action will gain access to these new features without any changes to your code.

Since:
7.0.0
Author:
XIMA MEDIA GmbH
See Also:
  • Constructor Details

    • SingleFile

      public SingleFile()
  • Method Details

    • getAttachmentFilter

      public List<EAttachmentSource> getAttachmentFilter()
      Specified by:
      getAttachmentFilter in interface IReferencedFileList
      Specified by:
      getAttachmentFilter in interface ISingleFileProviding
      Returns:
      Attachment sources to which to restrict the search for attachments, if a resource item of type EResourceItemType.EXTERNAL exists.
    • setAttachmentFilter

      public void setAttachmentFilter(List<EAttachmentSource> attachmentFilter)
      Parameters:
      attachmentFilter - restrictions of type EAttachmentSource for the search filename term. Is only used if ResourceItem.getType() is an EResourceItemType.ATTACHMENT_SEARCH resource
    • getConnectionTimeout

      public int getConnectionTimeout()
      Specified by:
      getConnectionTimeout in interface IReferencedFileList
      Specified by:
      getConnectionTimeout in interface ISingleFileProviding
      Returns:
      a connection time-out for an external resource retrieval
    • setConnectionTimeout

      public void setConnectionTimeout(int connectionTimeout)
      Parameters:
      connectionTimeout - in seconds for an external retrieval of a resource
    • getReadTimeout

      public int getReadTimeout()
      Specified by:
      getReadTimeout in interface IReferencedFileList
      Specified by:
      getReadTimeout in interface ISingleFileProviding
      Returns:
      a read time-out for an external resource retrieval
    • setReadTimeout

      public void setReadTimeout(int readTimeout)
      Parameters:
      readTimeout - in seconds for an external retrieval of a resource
    • getResource

      @Nullable public ResourceItem getResource()
      Specified by:
      getResource in interface ISingleFileProviding
      Returns:
      The resource item for the file.
    • setResource

      public void setResource(@Nullable ResourceItem resource)
      Parameters:
      resource - The resource item for the file. When null, no resource is selected.
    • getSearchFilename

      public String getSearchFilename()
      Specified by:
      getSearchFilename in interface IReferencedFileList
      Specified by:
      getSearchFilename in interface ISingleFileProviding
      Returns:
      Pattern for searching for an attachment, if a resource item of type EResourceItemType.ATTACHMENT_SEARCH exists. null or empty when no such resource item exists.
    • setSearchFilename

      public void setSearchFilename(String searchName)
      Parameters:
      searchName - null, or the search filename term, if ResourceItem.getType() is an EResourceItemType.ATTACHMENT_SEARCH resource
    • getUrl

      public String getUrl()
      Specified by:
      getUrl in interface ISingleFileProviding
      Returns:
      null, or the resource path, if ResourceItem.getType() is an EResourceItemType.EXTERNAL resource.
    • setUrl

      public void setUrl(String url)
      Parameters:
      url - null, or the resource path, if ResourceItem.getType() is an EResourceItemType.EXTERNAL resource.
    • forAttachmentSearch

      public static SingleFile forAttachmentSearch(String searchName, EAttachmentSource... attachmentFilter)
      Parameters:
      searchName - Name by which to search for attachments.
      attachmentFilter - Attachments types to which to limit the search.
      Returns:
      A new single file for the attachment search option.
    • forAttachmentSearch

      public static SingleFile forAttachmentSearch(String searchName, Iterable<EAttachmentSource> attachmentFilter)
      Parameters:
      searchName - Name by which to search for attachments.
      attachmentFilter - Attachments types to which to limit the search.
      Returns:
      A new single file for the attachment search option.
    • forClientFile

      public static SingleFile forClientFile(MandantRessource clientFile)
      Parameters:
      clientFile - A client file to use.
      Returns:
      A new single file for a client file resource.
    • forClientFile

      public static SingleFile forClientFile(UuidEntityRef clientFileRef)
      Parameters:
      clientFileRef - A reference to the MandantRessource entity.
      Returns:
      A new single file for a client file resource.
    • forExternal

      public static SingleFile forExternal(String url)
      Parameters:
      url - URL from which to retrieve the data.
      Returns:
      A new single file for an external resource option.
    • forFormFile

      public static SingleFile forFormFile(ProjektRessource formFile)
      Parameters:
      formFile - A form file to use.
      Returns:
      A new single file for a form file resource.
    • forFormFile

      public static SingleFile forFormFile(UuidEntityRef formFileRef)
      Parameters:
      formFileRef - A reference to the ProjektRessource entity.
      Returns:
      A new single file for a form file resource.
    • forUploadElement

      public static SingleFile forUploadElement(String identifier)
      Parameters:
      identifier - The name of the file upload form element.
      Returns:
      A new single file for an external resource option.
    • forWorkflowNode

      public static SingleFile forWorkflowNode(NodeKey nodeKey)
      Creates a new single file reference to the file produces by a workflow node with the default file type.
      Parameters:
      nodeKey - Key of the node to reference.
      Returns:
      A new single file representing the files produced by a workflow node.
    • forWorkflowNode

      public static SingleFile forWorkflowNode(NodeKey nodeKey, String fileKey)
      Creates a new single file reference to the file produces by a workflow node with the given file type.
      Parameters:
      nodeKey - Key of the node to reference.
      Returns:
      A new single file representing the files produced by a workflow node.
    • forWorkflowTrigger

      public static SingleFile forWorkflowTrigger(TriggerKey triggerKey)
      Creates a new single file reference to the file produces by a workflow trigger with the default file type.
      Parameters:
      triggerKey - Key of the trigger to reference.
      Returns:
      A new single file representing the files produced by a workflow trigger.
    • forWorkflowTrigger

      public static SingleFile forWorkflowTrigger(TriggerKey triggerKey, String fileKey)
      Creates a new single file reference to the file produces by a workflow trigger with the given file type.
      Parameters:
      triggerKey - Key of the trigger to reference.
      Returns:
      A new single file representing the files produced by a workflow trigger.