Class MultiFile
java.lang.Object
de.xima.fc.workflow.model.nodes.MultiFile
- All Implemented Interfaces:
IMultiFileProviding, IReferencedFileList, Serializable
@NotEmptyIf(field="urls",dependants="resources",target=MultiFile.class,payload=MultiFile.urls.class) @NotEmptyIf(field="searchFilename",dependants="resources",target=MultiFile.class,payload=MultiFile.searchFilename.class)
public final class MultiFile
extends Object
implements Serializable, IMultiFileProviding
Models a list of file resources that may come from multiple sources, such as client file, project files or external
files referenced via an 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 thegetResources()property.static interfaceCustom label for thegetSearchFilename()property.static interfaceCustom label for thegetUrls()property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiFileforAttachmentSearch(String attachmentSearchName, EAttachmentSource... attachmentSources) static MultiFileforExternalUrls(String... urls) static MultiFileforFiles(Iterable<ResourceItem> resourceItems, Iterable<String> urls, Iterable<EAttachmentSource> attachmentSources, String attachmentSearchName) static MultiFileforResourceItems(ResourceItem... items) intintgetUrls()booleanisResourceItemTypeSelected(EResourceItemType resourceItemType) voidsetAttachmentFilter(List<EAttachmentSource> attachmentFilter) voidsetConnectionTimeout(int connectionTimeout) voidsetReadTimeout(int readTimeout) voidsetResources(List<ResourceItem> resources) voidsetSearchFilename(String searchName) void
-
Constructor Details
-
MultiFile
public MultiFile()
-
-
Method Details
-
getAttachmentFilter
- Specified by:
getAttachmentFilterin interfaceIMultiFileProviding- Specified by:
getAttachmentFilterin interfaceIReferencedFileList- Returns:
- Attachment sources to which to restrict the search for attachments, if a resource item of type
EResourceItemType.EXTERNALexists.
-
getConnectionTimeout
public int getConnectionTimeout()- Specified by:
getConnectionTimeoutin interfaceIMultiFileProviding- Specified by:
getConnectionTimeoutin interfaceIReferencedFileList- Returns:
- a connection time-out for an external resource retrieval
-
getReadTimeout
public int getReadTimeout()- Specified by:
getReadTimeoutin interfaceIMultiFileProviding- Specified by:
getReadTimeoutin interfaceIReferencedFileList- Returns:
- a read time-out for an external resource retrieval
-
getResources
- Specified by:
getResourcesin interfaceIMultiFileProviding- Specified by:
getResourcesin interfaceIReferencedFileList- Returns:
- All resource items pointing to the files.
-
getSearchFilename
- Specified by:
getSearchFilenamein interfaceIMultiFileProviding- Specified by:
getSearchFilenamein interfaceIReferencedFileList- Returns:
- Pattern for searching for an attachment, if a resource item of type
EResourceItemType.ATTACHMENT_SEARCHexists.nullor empty when no such resource item exists.
-
getUrls
- Specified by:
getUrlsin interfaceIMultiFileProviding- Specified by:
getUrlsin interfaceIReferencedFileList- Returns:
- All URLs from which to read data, if a resource item of type
EResourceItemType.EXTERNALexists.
-
isResourceItemTypeSelected
- Specified by:
isResourceItemTypeSelectedin interfaceIMultiFileProviding- Parameters:
resourceItemType- a String that can be converted into aEResourceItemType- Returns:
trueif there is at least one element with the specified resource item type in the list of resources. Otherwise returnsfalse
-
setAttachmentFilter
- Parameters:
attachmentFilter- restrictions of typeEAttachmentSourcefor the search filename term. Is only used ifResourceItem.getType()is anEResourceItemType.ATTACHMENT_SEARCHresource
-
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
-
setResources
- Parameters:
resources- a list ofResourceItems
-
setSearchFilename
- Parameters:
searchName-null, or the search filename term, ifResourceItem.getType()is anEResourceItemType.ATTACHMENT_SEARCHresource
-
setUrls
-
forAttachmentSearch
public static MultiFile forAttachmentSearch(String attachmentSearchName, EAttachmentSource... attachmentSources) - Parameters:
attachmentSearchName- Pattern for the name of attachments to find.attachmentSources- Attachment sources to find.- Returns:
- A multi file referencing the given attachment.
-
forExternalUrls
-
forFiles
public static MultiFile forFiles(Iterable<ResourceItem> resourceItems, Iterable<String> urls, Iterable<EAttachmentSource> attachmentSources, String attachmentSearchName) - Parameters:
resourceItems- Resource items to wrap in a multi file.urls- External resource URLs to read.attachmentSources- Attachment sources to find.attachmentSearchName- Pattern for the name of attachments to find.- Returns:
- A multi file referencing the given files.
-
forResourceItems
- Parameters:
items- Resource items to wrap in a multi file.- Returns:
- A multi file referencing the given resource items.
-