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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCustom label for thegetResource()property.static interfaceCustom label for thegetSearchFilename()property.static interfaceCustom label for thegetUrl()property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SingleFileforAttachmentSearch(String searchName, EAttachmentSource... attachmentFilter) static SingleFileforAttachmentSearch(String searchName, Iterable<EAttachmentSource> attachmentFilter) static SingleFileforClientFile(MandantRessource clientFile) static SingleFileforClientFile(UuidEntityRef clientFileRef) static SingleFileforExternal(String url) static SingleFileforFormFile(ProjektRessource formFile) static SingleFileforFormFile(UuidEntityRef formFileRef) static SingleFileforUploadElement(String identifier) static SingleFileforWorkflowNode(NodeKey nodeKey) Creates a new single file reference to the file produces by a workflow node with the default file type.static SingleFileforWorkflowNode(NodeKey nodeKey, String fileKey) Creates a new single file reference to the file produces by a workflow node with the given file type.static SingleFileforWorkflowTrigger(TriggerKey triggerKey) Creates a new single file reference to the file produces by a workflow trigger with the default file type.static SingleFileforWorkflowTrigger(TriggerKey triggerKey, String fileKey) Creates a new single file reference to the file produces by a workflow trigger with the given file type.intintgetUrl()voidsetAttachmentFilter(List<EAttachmentSource> attachmentFilter) voidsetConnectionTimeout(int connectionTimeout) voidsetReadTimeout(int readTimeout) voidsetResource(ResourceItem resource) voidsetSearchFilename(String searchName) voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISingleFileProviding
getResources, getUrls
-
Constructor Details
-
SingleFile
public SingleFile()
-
-
Method Details
-
getAttachmentFilter
- Specified by:
getAttachmentFilterin interfaceIReferencedFileList- Specified by:
getAttachmentFilterin interfaceISingleFileProviding- Returns:
- Attachment sources to which to restrict the search for attachments, if a resource item of type
EResourceItemType.EXTERNALexists.
-
setAttachmentFilter
- Parameters:
attachmentFilter- restrictions of typeEAttachmentSourcefor the search filename term. Is only used ifResourceItem.getType()is anEResourceItemType.ATTACHMENT_SEARCHresource
-
getConnectionTimeout
public int getConnectionTimeout()- Specified by:
getConnectionTimeoutin interfaceIReferencedFileList- Specified by:
getConnectionTimeoutin interfaceISingleFileProviding- 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:
getReadTimeoutin interfaceIReferencedFileList- Specified by:
getReadTimeoutin interfaceISingleFileProviding- 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
- Specified by:
getResourcein interfaceISingleFileProviding- Returns:
- The resource item for the file.
-
setResource
- Parameters:
resource- The resource item for the file. Whennull, no resource is selected.
-
getSearchFilename
- Specified by:
getSearchFilenamein interfaceIReferencedFileList- Specified by:
getSearchFilenamein interfaceISingleFileProviding- Returns:
- Pattern for searching for an attachment, if a resource item of type
EResourceItemType.ATTACHMENT_SEARCHexists.nullor empty when no such resource item exists.
-
setSearchFilename
- Parameters:
searchName-null, or the search filename term, ifResourceItem.getType()is anEResourceItemType.ATTACHMENT_SEARCHresource
-
getUrl
- Specified by:
getUrlin interfaceISingleFileProviding- Returns:
null, or the resource path, ifResourceItem.getType()is anEResourceItemType.EXTERNALresource.
-
setUrl
- Parameters:
url-null, or the resource path, ifResourceItem.getType()is anEResourceItemType.EXTERNALresource.
-
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
- Parameters:
clientFile- A client file to use.- Returns:
- A new single file for a client file resource.
-
forClientFile
- Parameters:
clientFileRef- A reference to theMandantRessourceentity.- Returns:
- A new single file for a client file resource.
-
forExternal
- Parameters:
url- URL from which to retrieve the data.- Returns:
- A new single file for an external resource option.
-
forFormFile
- Parameters:
formFile- A form file to use.- Returns:
- A new single file for a form file resource.
-
forFormFile
- Parameters:
formFileRef- A reference to theProjektRessourceentity.- Returns:
- A new single file for a form file resource.
-
forUploadElement
- Parameters:
identifier- The name of the file upload form element.- Returns:
- A new single file for an external resource option.
-
forWorkflowNode
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
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
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
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.
-