Package de.xima.fc.workflow.model.nodes
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=url.class) @NotEmptyIf(field="searchFilename",dependants="resource",target=SingleFile.class,payload=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.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Custom label for thegetResource()
property.static interface
Custom label for thegetSearchFilename()
property.static interface
Custom label for thegetUrl()
property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SingleFile
forAttachmentSearch
(String searchName, EAttachmentSource... attachmentFilter) static SingleFile
forAttachmentSearch
(String searchName, Iterable<EAttachmentSource> attachmentFilter) static SingleFile
forClientFile
(MandantRessource clientFile) static SingleFile
forClientFile
(UuidEntityRef clientFileRef) static SingleFile
forExternal
(String url) static SingleFile
forFormFile
(ProjektRessource formFile) static SingleFile
forFormFile
(UuidEntityRef formFileRef) static SingleFile
forUploadElement
(String identifier) static SingleFile
forWorkflowNode
(NodeKey nodeKey) int
int
getUrl()
void
setAttachmentFilter
(List<EAttachmentSource> attachmentFilter) void
setConnectionTimeout
(int connectionTimeout) void
setReadTimeout
(int readTimeout) void
setResource
(ResourceItem resource) void
setSearchFilename
(String searchName) void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.ISingleFileProviding
getResources, getUrls
-
Constructor Details
-
SingleFile
public SingleFile()
-
-
Method Details
-
getAttachmentFilter
- Specified by:
getAttachmentFilter
in interfaceIReferencedFileList
- Specified by:
getAttachmentFilter
in interfaceISingleFileProviding
- Returns:
- Attachment sources to which to restrict the search for attachments, if a resource item of type
EResourceItemType.EXTERNAL
exists.
-
getConnectionTimeout
public int getConnectionTimeout()- Specified by:
getConnectionTimeout
in interfaceIReferencedFileList
- Specified by:
getConnectionTimeout
in interfaceISingleFileProviding
- Returns:
- a connection time-out for an external resource retrieval
-
getReadTimeout
public int getReadTimeout()- Specified by:
getReadTimeout
in interfaceIReferencedFileList
- Specified by:
getReadTimeout
in interfaceISingleFileProviding
- Returns:
- a read time-out for an external resource retrieval
-
getResource
- Specified by:
getResource
in interfaceISingleFileProviding
- Returns:
- The resource item for the file.
-
getSearchFilename
- Specified by:
getSearchFilename
in interfaceIReferencedFileList
- Specified by:
getSearchFilename
in interfaceISingleFileProviding
- 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.
-
getUrl
- Specified by:
getUrl
in interfaceISingleFileProviding
- Returns:
null
, or the resource path, ifResourceItem.getType()
is anEResourceItemType.EXTERNAL
resource.
-
setAttachmentFilter
- Parameters:
attachmentFilter
- restrictions of typeEAttachmentSource
for the search filename term. Is only used ifResourceItem.getType()
is anEResourceItemType.ATTACHMENT_SEARCH
resource
-
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout) - Parameters:
connectionTimeout
- in seconds for an external retrieval of a resource
-
setReadTimeout
public void setReadTimeout(int readTimeout) - Parameters:
readTimeout
- in seconds for an external retrieval of a resource
-
setResource
- Parameters:
resource
- The resource item for the file. Whennull
, no resource is selected.
-
setSearchFilename
- Parameters:
searchName
-null
, or the search filename term, ifResourceItem.getType()
is anEResourceItemType.ATTACHMENT_SEARCH
resource
-
setUrl
- Parameters:
url
-null
, or the resource path, ifResourceItem.getType()
is anEResourceItemType.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
- Parameters:
clientFile
- A client file to use.- Returns:
- A new single file for a client file resource.
-
forClientFile
- Parameters:
clientFileRef
- A reference to theMandantRessource
entity.- 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 theProjektRessource
entity.- 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
- Parameters:
nodeKey
- Key of the node to reference.- Returns:
- A new single file representing the files produced by a workflow node.
-