Package de.xima.fc.workflow.model.nodes
Class SingleAttachment
java.lang.Object
de.xima.fc.workflow.model.nodes.SingleAttachment
- All Implemented Interfaces:
IReferencedAttachmentList,ISingleAttachmentProviding,Serializable
@NotEmptyIf(field="searchFilenamePattern",
dependants="attachment",
target=SingleAttachment.class,
payload=searchFilenamePattern.class)
public final class SingleAttachment
extends Object
implements Serializable, ISingleAttachmentProviding
Models a single attachment that may come from one of multiple sources, such as upload form elements, creates by
another action, or with a specific name.
- Since:
- 8.1.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCustom label for thegetAttachment()property.static interfaceCustom label for thegetSearchFilenamePattern()property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SingleAttachmentforSearch(String filenamePattern, EAttachmentSource... sourceTypes) Creates a single attachment reference that searches for an existing attachment by its file name and type.static SingleAttachmentforSearch(String filenamePattern, Iterable<EAttachmentSource> sourceTypes) Creates a single attachment reference that searches for an existing attachment by its file name and type.static SingleAttachmentforUploadElement(String uploadElementName) Creates a single attachment reference for the attachment created automatically by a file upload form element.static SingleAttachmentforWorkflowNode(NodeKey nodeKey) Creates a single attachment references for the attachment created by a previously executed workflow node.Gets the pattern for searching for an attachment.Gets the attachment sources to which to restrict the search for attachments.voidsetAttachment(AttachmentItem attachment) Sets the attachment item for the selected attachment.voidsetSearchFilenamePattern(String searchFilenamePattern) Sets the pattern for searching for an attachment, if anattachment itemof type *SEARCHexists.voidsetSearchSourceTypes(List<EAttachmentSource> searchSourceTypes) Sets the attachment source types to which to limit the search for attachments when anattachment itemof typeSEARCHis selected.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.xima.fc.interfaces.workflow.execution.ISingleAttachmentProviding
getAttachments
-
Constructor Details
-
SingleAttachment
public SingleAttachment()
-
-
Method Details
-
getAttachment
- Specified by:
getAttachmentin interfaceISingleAttachmentProviding- Returns:
- The attachment item for the selected attachment.
-
setAttachment
Sets the attachment item for the selected attachment.- Parameters:
attachment- The selected attachment item.
-
getSearchFilenamePattern
Description copied from interface:IReferencedAttachmentListGets the pattern for searching for an attachment. Applies only if anattachment itemof typeSEARCHexists.nullor empty when no such attachment item exists.- Specified by:
getSearchFilenamePatternin interfaceIReferencedAttachmentList- Returns:
- Pattern for searching for an attachment.
-
setSearchFilenamePattern
Sets the pattern for searching for an attachment, if anattachment itemof type *SEARCHexists.nullor empty when no such attachment item exists.- Parameters:
searchFilenamePattern- Search pattern for the attachment search.
-
getSearchSourceTypes
Description copied from interface:IReferencedAttachmentListGets the attachment sources to which to restrict the search for attachments. Applies only if anattachment itemof typeSEARCHexists.- Specified by:
getSearchSourceTypesin interfaceIReferencedAttachmentList- Returns:
- The attachment types to which to limit the search for attachments.
-
setSearchSourceTypes
Sets the attachment source types to which to limit the search for attachments when anattachment itemof typeSEARCHis selected.- Parameters:
searchSourceTypes- Attachment sources to which to limit the search.
-
forSearch
public static SingleAttachment forSearch(String filenamePattern, Iterable<EAttachmentSource> sourceTypes) Creates a single attachment reference that searches for an existing attachment by its file name and type.- Parameters:
filenamePattern- Pattern that the file name of the attachment must match.sourceTypes- Attachments types to which to limit the search.- Returns:
- A new single attachment reference for searching an attachment by its name and type.
-
forSearch
Creates a single attachment reference that searches for an existing attachment by its file name and type.- Parameters:
filenamePattern- Pattern that the file name of the attachment must match.sourceTypes- Attachments types to which to limit the search.- Returns:
- A new single attachment reference for searching an attachment by its name and type.
-
forUploadElement
Creates a single attachment reference for the attachment created automatically by a file upload form element.- Parameters:
uploadElementName- The name of the file upload form element.- Returns:
- A new single attachment reference for the attachment of a file upload element.
-
forWorkflowNode
Creates a single attachment references for the attachment created by a previously executed workflow node.- Parameters:
nodeKey- Key of the referenced workflow node.- Returns:
- A new single attachment reference for the attachment produced by a workflow node.
-