Class FcCompressAsZipHandler
- java.lang.Object
-
- de.xima.fc.workflow.designer.registry.nodes.FcCompressAsZipHandler
-
- All Implemented Interfaces:
IResourceBundleLocator
,IWorkflowNodeFlowAnalyzer<FcCompressAsZipProps>
,IElementHandler<FcCompressAsZipProps,WorkflowNode>
,IExecutionResultDescriptor
,IRefinedExecutionResultDescriptor<FcCompressAsZipProps>
,ICustomParametersUpdateable
,IWorkflowElementTypeProviding
,IBeanValidatingElement<FcCompressAsZipProps,WorkflowNode>
,IBeanValidatingNode<FcCompressAsZipProps>
,IExecutingLikeActionNode<FcCompressAsZipProps>
,IHierarchyValidatingNode<FcCompressAsZipProps>
,IKeyValueSummarizableElement<FcCompressAsZipProps,WorkflowNode>
,IKeyValueSummarizableNode<FcCompressAsZipProps>
,IOfficialHelpPageElement<FcCompressAsZipProps,WorkflowNode>
,IOfficialHelpPageNode<FcCompressAsZipProps>
,ISemverUpdating<FcCompressAsZipProps,WorkflowNode>
,ISemverUpdatingNode<FcCompressAsZipProps>
,ISequentialUpdating<FcCompressAsZipProps,WorkflowNode,com.vdurmont.semver4j.Semver>
,ISingleElementPrototype<FcCompressAsZipProps,WorkflowNode>
,ISingleNodePrototype<FcCompressAsZipProps>
,INodeHandler<FcCompressAsZipProps>
,IWorkflowNodeTypeProviding
,IListenerRegistrator
,IOrderable
,ISingleBaseActionBuiltinNodePrototype<FcCompressAsZipProps>
,ISingleBuiltinNodePrototype<FcCompressAsZipProps>
,IBuiltinResourcesHandler<FcCompressAsZipProps,WorkflowNode>
,IBaseActionNode<FcCompressAsZipProps>
,IBuiltinNodeType<FcCompressAsZipProps>
,ISingleBaseActionNodePrototype<FcCompressAsZipProps>
,IFcCompressAsZipDescriptors
,Comparable<IOrderable>
@Immutable public final class FcCompressAsZipHandler extends Object implements INodeHandler<FcCompressAsZipProps>, IBaseActionNode<FcCompressAsZipProps>, IBuiltinNodeType<FcCompressAsZipProps>, IBuiltinResourcesHandler<FcCompressAsZipProps,WorkflowNode>, IExecutingLikeActionNode<FcCompressAsZipProps>, IFcCompressAsZipDescriptors, IKeyValueSummarizableNode<FcCompressAsZipProps>, ISemverUpdatingNode<FcCompressAsZipProps>, ISingleBaseActionBuiltinNodePrototype<FcCompressAsZipProps>
TheINodeHandler
for nodes of typeEWorkflowNodeType.FC_COMPRESS_AS_ZIP
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
CURRENT_HANDLER_VERSION
-
Fields inherited from interface de.xima.fc.workflow.retval.node.IFcCompressAsZipDescriptors
ATTR_COMPRESSED_SIZE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description boolean
equals(Object obj)
INormalCompletionResult
execute(INodeExecutionParams<FcCompressAsZipProps> params)
Executes the given workflow node.default Set<String>
getAttachmentAndFileContentTypes()
Gets the content types of the attachments and files that can be produced by an execution of the node.default IAttachmentValueDescriptor
getAttachmentValueDescriptor()
Creates the descriptor for the attachment or attachments that are created when the node is executed.default IAttachmentValueDescriptor
getAttachmentValueDescriptor(Model props)
Same asgetAttachmentValueDescriptor
without data, but refined depending on the current node's configuration.EWorkflowNodeType
getBuiltinType()
Class<FcCompressAsZipProps>
getDataModelClass()
Returns the class of the custom properties used by the elements handled by this element logic handler.ISummaryKeyValueModel
getElementSummaryKeyValueModel(IGetElementSummaryParams<FcCompressAsZipProps> params)
default IFileValueDescriptor
getFileValueDescriptor()
Creates the descriptor for the file or files that are created and made available to other actions when the node is executed.static FcCompressAsZipHandler
getInstance()
IElementCategory
getMainCategory(IGetElementPrototypesParams params)
URL
getPropertiesViewXhtml()
This method must return the path to the XHTML page for the custom user interface.IElementCategory
getSubCategory(IGetElementPrototypesParams params)
Optional sub category.Map<com.vdurmont.semver4j.Semver,IUpdateTransition>
getTransitions()
A map from the version where an update is required to that update.int
hashCode()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.workflow.mixin.IBaseActionNode
isValidChildCount, isValidChildType, isValidParentType, validateLocal
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.IBeanValidatingElement
getValidationGroups
-
Methods inherited from interface de.xima.fc.workflow.mixin.IBuiltinNodeType
getOfficialHelpPagePath, getType, isAvailable, register
-
Methods inherited from interface de.xima.fc.workflow.designer.registry.IBuiltinResourcesHandler
getCascadingStyleSheet, getJavaScript
-
Methods inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
extractDescription, extractName, extractSearchTerms, getCascadingStyleSheet, getDisplayLabel, getFastJsonConverter, getFilterCriteriaForEntities, getJavaScript, getResourceBundle, getVersion, isHasUserVisibleName, readEntityReferences, readPlaceholders, validateGlobal, writeEntityReferences, writePlaceholders
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.IExecutingLikeActionNode
createFlowGraph
-
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.IExecutionResultDescriptor
getAlwaysValueDescriptor, getCurrentAttachmentValueDescriptor, getCurrentFileValueDescriptor, getCurrentValueDescriptor
-
Methods inherited from interface de.xima.fc.workflow.retval.node.IFcCompressAsZipDescriptors
extractSingleFileProvision, getAttachmentAndFileDescriptorI18nPrefix, getErrorValueDescriptor, getSoftErrorValueDescriptor, getSuccessValueDescriptor
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.IKeyValueSummarizableElement
getElementSummaryModel, getElementSummaryXhtml
-
Methods inherited from interface de.xima.fc.interfaces.workflow.nodes.INodeHandler
getLocalizedTypeName, getPropertiesBeanClass, getRelatedNodeTypes, getSupportedControlTransferTypes, isCreateProtocolEntryAfterExecution, isCreateProtocolEntryAfterExecution, isReplacePlaceholderBeforeExecution
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.IOfficialHelpPageElement
getHelpPageLocation
-
Methods inherited from interface de.xima.fc.listener.IOrderable
compareTo, shouldBeAfter
-
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.IRefinedExecutionResultDescriptor
getAlwaysValueDescriptor, getCurrentAttachmentValueDescriptor, getCurrentFileValueDescriptor, getCurrentValueDescriptor, getErrorValueDescriptor, getFileValueDescriptor, getSoftErrorValueDescriptor, getSuccessValueDescriptor
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.ISemverUpdating
parseVersion
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.ISequentialUpdating
updateCustomParams
-
Methods inherited from interface de.xima.fc.workflow.mixin.ISingleBaseActionNodePrototype
getPrototypeModelData, getThemeColor
-
Methods inherited from interface de.xima.fc.workflow.designer.mixin.ISingleBuiltinNodePrototype
getPrototypeIcon, getPrototypeLabel, getPrototypeSearchText, getPrototypeSortKey, getPrototypeSubLabel, getPrototypeTitle
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.ISingleElementPrototype
getPrototypeTags
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.ISingleNodePrototype
getNodePrototypes, getPrototypeElement
-
-
-
-
Method Detail
-
execute
public INormalCompletionResult execute(INodeExecutionParams<FcCompressAsZipProps> params) throws AbstractAbruptCompletionException
Description copied from interface:INodeHandler
Executes the given workflow node. You may perform any action required by this node type, such as creating files, sending HTTP requests etc.If this node has children that need to be executed (such as for control nodes like conditions or switches), you must use
IWorkflowExecutionContext.executor()
to execute the children instead of attempting to call their execute method directly. Note that a node must never attempt to execute any other node that is not in the subtree (= a child, a grand-child, a grand-grand-child etc.) of this node.In case you throw any other exceptions other than the exceptions mentioned in the throws clause, it will be wrapped in a
NodeThrewException
with a general error code.- Specified by:
execute
in interfaceINodeHandler<FcCompressAsZipProps>
- Parameters:
params
- The node that needs to be executed and the current workflow context.- Returns:
- The result value or values created by the executed node.
- Throws:
AbstractAbruptCompletionException
- When the node's execution did not finish normally, see below for subclasses.NodeThrewException
- If this exception was thrown by the execute method of the given node. Indicates that a node could not be completed successfully. This exception can be caught by control flow nodes with custom error handling, such as a try-catch node.NodeReturnedException
- If this exception was thrown by the execute method of the given node. Indicates that the node wishes to return, i.e. to stop the execution of the current processing chain (="function"). This exception can be caught by control flow nodes with custom finalization handling, such as a try-finally node (which should rethrow this exception afterwards).NodeTransferredControlException
- If this exception was thrown by the execute method of the given node. Indicates that a control transfer should take place. The matching node for thecontrol transfer target
should catch this exception and proceed according to thetype of the control transfer
. For example, loop nodes may catch break and continue control transfers and either stop the loop or skip to the next iteration of the loop.
-
getBuiltinType
public EWorkflowNodeType getBuiltinType()
- Specified by:
getBuiltinType
in interfaceIBuiltinNodeType<FcCompressAsZipProps>
- Returns:
- The built-in node type.
-
getDataModelClass
public Class<FcCompressAsZipProps> getDataModelClass()
Description copied from interface:IElementHandler
Returns the class of the custom properties used by the elements handled by this element logic handler.The custom properties of a workflow element are internally stored as JSON. To ease the development work, you can specify a model class, and the JSON is automatically converted to an instance of that model class. Please note that the model class must be compatible with serialization mechanism used by
JSON
.See
IElementHandler.getVersion()
for how custom properties are updated.If you need more control over serialization and deserialization, specify
JSONObject
as the type parameter and returnJSONObject.class
. You will then receive the raw JSON data and may perform the serialization in whatever way you like.- Specified by:
getDataModelClass
in interfaceIElementHandler<FcCompressAsZipProps,WorkflowNode>
- Returns:
- The class corresponding to the type parameter
TData
.
-
getElementSummaryKeyValueModel
public ISummaryKeyValueModel getElementSummaryKeyValueModel(IGetElementSummaryParams<FcCompressAsZipProps> params)
- Specified by:
getElementSummaryKeyValueModel
in interfaceIKeyValueSummarizableElement<FcCompressAsZipProps,WorkflowNode>
- Parameters:
params
- The custom properties of the node or trigger.- Returns:
- A list of key value pairs to display in a table in the overview panel.
-
getMainCategory
public IElementCategory getMainCategory(IGetElementPrototypesParams params)
- Specified by:
getMainCategory
in interfaceISingleElementPrototype<FcCompressAsZipProps,WorkflowNode>
- Parameters:
params
- Parameters with the current client, locale, entity context etc.- Returns:
IElementCategory
element's main category, which is used for grouping the elements.
-
getPropertiesViewXhtml
public URL getPropertiesViewXhtml() throws MalformedURLException
Description copied from interface:IElementHandler
This method must return the path to the XHTML page for the custom user interface. Usually the XHTML file is part of the JAR resources of the module or plugin. In this case, you should return an URL to a JAR file resource (jar:file:/...
) like so:@Override public URL getXhtmlView() { return getClass().getResource("/path/to/view.xhtml"); }
The contents of this XHTML page is included in the properties panel, without a fieldset or container around it, but already inside a form (i.e. do not use a
h:form
as that would result in an error). You should wrap your custom UI in a naming container to ensure unique IDs that do not clash with other plugins or actions. The following is a recommended template on which you may base your UI:<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:o="http://omnifaces.org/ui" xmlns:p="http://primefaces.org/ui" xmlns:xi="http://www.xima.de/taglib/xfc"> <!-- Enable bean validation (when #validateLocal is implemented via the bean validator)--> <o:validateBean value="#{model}" showMessageFor="@violating" method="validateActual" /> <xi:namingContainer id="myAwesomeWorkflowElement"> <!--Base info with name and description (when TData extends BaseActionProps) --> <xi:newWorkflowActionBase id="base" value="#{model}" legend="#{msg['wf.node.myawesomelememnt']}" /> <!-- Remove when TData does not have a
ISingleFileProviding
field --> <xi:singleFile id="resource" value="#{model.singleFile}" required="true" /> <!-- Remove when TData does not have aIMultiFileProviding
field --> <xi:multiFile id="resource" value="#{model.multiFile}" required="true" /> <!-- Remove when TData does not implement IProviding --> <xi:fileProvision id="providing" value="#{model.fileProvision}" /> <!-- Custom section with editors specific to your workflow element --> <p:fieldset legend="#{msg['MyAwesomeWorkflowElementProps.fieldset.base']}" styleClass="fc-fieldset"> <!-- A simple input field bound to the mail property of your properties model --> <xi:inputText id="mail" label="#{msg['MyAwesomeWorkflowElementProps.mail']}" formPlaceholder="true" value="#{model.mail}" forceIndicateRequired="true" > <p:ajax event="change" partialSubmit="true" listener="#{elementPropertiesBean.storeCurrent}" process="@this" update=":flowchartForm:flowchart" global="false" /> </xi:inputText> </p:fieldset> </xi:namingContainer> </ui:composition>The XHTML page may access the following expression language variables:
- model: The deserialized custom properties of the workflow element, of the type
TData
. - provider: An object that implements
IWorkflowProvider
, for accessing various data, such as a list of all users or text templates. - msg: The localized messages as returned by
IElementHandler.getResourceBundle(Locale)
. Empty when that method returnsnull
. For example, if the resource bundle contains the keymail.label
, you can access the localized message via the EL expression['mail.label']
To access the values of an enum or the constants defined by a class, consider using
<xi:importConstants type="my.fully.classified.path.MyEnum" var="MyEnum" loader="#{model}"/>
Theloader
argument is only required for plugins and ensures that the correct class loader is used that knows about the plugin class. Without the loader attribute, the above is equivalent to the PrimeFaces tag handler<p:importConstants />
.- Specified by:
getPropertiesViewXhtml
in interfaceIElementHandler<FcCompressAsZipProps,WorkflowNode>
- Returns:
- Path to the XHTML view. If the action can be configured, this must not return
null
. If you do returnnull
, it will be treated as an error and an appropriate message is displayed to the user informing them that the properties panel could not be loaded. If the action cannot be configured (i.e. when the action is not selectable), this should returnnull
. - Throws:
MalformedURLException
- This exception is declared for convenience - normally you would usenew URL(String)
with a constant URL string that should not throw. In case an exception is thrown, it is treated the same as if this returnednull
.
- model: The deserialized custom properties of the workflow element, of the type
-
getSubCategory
public IElementCategory getSubCategory(IGetElementPrototypesParams params)
Description copied from interface:ISingleElementPrototype
Optional sub category. When not set or this returnsnull
, the element is shown under the categorymiscellaneous
.- Specified by:
getSubCategory
in interfaceISingleElementPrototype<FcCompressAsZipProps,WorkflowNode>
- Parameters:
params
- Parameters with the current client, locale, entity context etc.- Returns:
IElementCategory
element's sub category, which is used for grouping the element within the given main group.
-
getTransitions
public Map<com.vdurmont.semver4j.Semver,IUpdateTransition> getTransitions()
Description copied from interface:ISequentialUpdating
A map from the version where an update is required to that update. For example, if the properties model needs to be updated in version1.1.7
,1.3.4
, and2.2.0
, the returned map should have one entry for each of these three versions.- Specified by:
getTransitions
in interfaceISequentialUpdating<FcCompressAsZipProps,WorkflowNode,com.vdurmont.semver4j.Semver>
- Returns:
- A map from the version to the update for that version.
-
getInstance
public static FcCompressAsZipHandler getInstance()
- Returns:
- The immutable, stateless instance of this handler.
-
getAttachmentAndFileContentTypes
public default Set<String> getAttachmentAndFileContentTypes()
Gets the content types of the attachments and files that can be produced by an execution of the node. SeeFileListDescriptor.getContentTypes()
- Returns:
- The content types of the attachments and files that can be produced by an execution of the node.
-
getAttachmentValueDescriptor
public default IAttachmentValueDescriptor getAttachmentValueDescriptor()
Description copied from interface:IExecutionResultDescriptor
Creates the descriptor for the attachment or attachments that are created when the node is executed. Should returnnull
when the node never creates attachments.- Specified by:
getAttachmentValueDescriptor
in interfaceIExecutionResultDescriptor
- Returns:
- The descriptor for the attachment or attachments made available after the node was executed.
-
getAttachmentValueDescriptor
public default IAttachmentValueDescriptor getAttachmentValueDescriptor(Model props)
Description copied from interface:IRefinedExecutionResultDescriptor
Same asgetAttachmentValueDescriptor
without data, but refined depending on the current node's configuration.- Specified by:
getAttachmentValueDescriptor
in interfaceIRefinedExecutionResultDescriptor<Model>
- Parameters:
props
- Current properties model of the node.- Returns:
- The descriptor for the attachment or attachment made available after the node was executed. If
null
, the non-refined descriptor is used.
-
getFileValueDescriptor
public default IFileValueDescriptor getFileValueDescriptor()
Description copied from interface:IExecutionResultDescriptor
Creates the descriptor for the file or files that are created and made available to other actions when the node is executed. Should returnnull
when the node provides node files.- Specified by:
getFileValueDescriptor
in interfaceIExecutionResultDescriptor
- Returns:
- The descriptor for the file or files made available after the node was executed.
-
-