Class EmailResultActionFactory
- java.lang.Object
-
- com.inet.taskplanner.server.api.common.AbstractFactory<COMPONENT,DEFINITION,INFO,SUMMARY>
-
- com.inet.taskplanner.server.api.common.SeriesDependentFactory<T,ResultActionDefinition,ResultActionInfo,SummaryInfo>
-
- com.inet.taskplanner.server.api.action.ResultActionFactory<com.inet.taskplanner.server.api.action.email.EmailResultAction>
-
- com.inet.taskplanner.server.api.action.email.EmailResultActionFactory
-
- All Implemented Interfaces:
com.inet.plugin.NamedExtension
public class EmailResultActionFactory extends ResultActionFactory<com.inet.taskplanner.server.api.action.email.EmailResultAction>
A result action factory for managing the EmailResultAction settings and instances
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
EXTENSION_NAME
The extension name used to create aResultActionDefinition
.static java.lang.String
PROP_ATTACH_FILES
The attachment property used to create aResultActionDefinition
.static java.lang.String
PROP_MESSAGE
The message property used to create aResultActionDefinition
.static java.lang.String
PROP_RECEIVER
The receiver property used to create aResultActionDefinition
.static java.lang.String
PROP_SUBJECT
The subject property used to create aResultActionDefinition
.static java.lang.String
PROPERTY_FILENAME_FORMAT
The format of the file names.-
Fields inherited from class com.inet.taskplanner.server.api.common.SeriesDependentFactory
PLACEHOLDER_END_CHARACTER, PLACEHOLDER_START_CHARACTER
-
-
Constructor Summary
Constructors Constructor Description EmailResultActionFactory()
Creates a instance of the factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.inet.taskplanner.server.api.action.email.EmailResultAction
createInstanceFrom(ResultActionDefinition definition, com.inet.id.GUID taskID)
Construct a component (PRODUCT) from the given definition.ResultActionInfo
getInformation(com.inet.id.GUID taskID)
Returns an information object about components which can be produced with this factory.SummaryInfo
getSummary(ResultActionDefinition definition)
Construct Summary infos for the component represented by given definition.java.util.List<ResultFlavor>
getSupportedFlavors(ResultActionDefinition definition)
Returns the list of flavors, supported by this action for the given definition.boolean
isAutoResolvePlaceholders()
Defines whether placeholders will be automatically replaced before the handle method is called.void
validate(ResultActionDefinition definition, com.inet.id.GUID taskID)
Validate the given definition.-
Methods inherited from class com.inet.taskplanner.server.api.action.ResultActionFactory
hasPlaceholderSet
-
Methods inherited from class com.inet.taskplanner.server.api.common.SeriesDependentFactory
createFrom, getFirstValueFromSeries, patchDefinitionProperties, updateValues, updateValues, validate
-
Methods inherited from class com.inet.taskplanner.server.api.common.AbstractFactory
checkDefinitionArgument, createInstanceFrom, getExtensionName, isAvailable
-
-
-
-
Field Detail
-
EXTENSION_NAME
public static final java.lang.String EXTENSION_NAME
The extension name used to create aResultActionDefinition
.- See Also:
- Constant Field Values
-
PROP_SUBJECT
public static final java.lang.String PROP_SUBJECT
The subject property used to create aResultActionDefinition
.- See Also:
- Constant Field Values
-
PROP_MESSAGE
public static final java.lang.String PROP_MESSAGE
The message property used to create aResultActionDefinition
. It can contains plain text or HTML.- See Also:
- Constant Field Values
-
PROP_RECEIVER
public static final java.lang.String PROP_RECEIVER
The receiver property used to create aResultActionDefinition
. A semicolon separated list of email addresses.- See Also:
- Constant Field Values
-
PROP_ATTACH_FILES
public static final java.lang.String PROP_ATTACH_FILES
The attachment property used to create aResultActionDefinition
. Valid values are "true" or "false".- See Also:
- Constant Field Values
-
PROPERTY_FILENAME_FORMAT
public static final java.lang.String PROPERTY_FILENAME_FORMAT
The format of the file names. Default is "[filename] [date] [time]"- See Also:
- Constant Field Values
-
-
Method Detail
-
getInformation
public ResultActionInfo getInformation(com.inet.id.GUID taskID)
Returns an information object about components which can be produced with this factory.The returned info contains information about how such a component is to be presented in the taskPlanner GUI. This are display-infos or available options to configure. The returned information contains
fields
which describes the values a user can specify in the WEB GUI. The field is also responsible to replace any placeholders for the corresponding property in aserial
task. That means properties without a field definition will not get any series placeholder replaced.If you implement a factory for a component only to be used by API, only then you can return null here.
- Specified by:
getInformation
in classAbstractFactory<com.inet.taskplanner.server.api.action.email.EmailResultAction,ResultActionDefinition,ResultActionInfo,SummaryInfo>
- Parameters:
taskID
- the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.- Returns:
- an information object for components this factory can produce
-
validate
public void validate(ResultActionDefinition definition, com.inet.id.GUID taskID) throws ValidationException
Validate the given definition.The given definition is guaranteed to belong to this factory
- Specified by:
validate
in classAbstractFactory<com.inet.taskplanner.server.api.action.email.EmailResultAction,ResultActionDefinition,ResultActionInfo,SummaryInfo>
- Parameters:
definition
- the definition to validatetaskID
- the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.- Throws:
ValidationException
- if the component has some errors
-
createInstanceFrom
protected com.inet.taskplanner.server.api.action.email.EmailResultAction createInstanceFrom(ResultActionDefinition definition, com.inet.id.GUID taskID)
Construct a component (PRODUCT) from the given definition.- Overrides:
createInstanceFrom
in classAbstractFactory<com.inet.taskplanner.server.api.action.email.EmailResultAction,ResultActionDefinition,ResultActionInfo,SummaryInfo>
- Parameters:
definition
- the definition holding information for the PRODUCTtaskID
- the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.- Returns:
- a new PRODUCT
-
getSummary
public SummaryInfo getSummary(ResultActionDefinition definition)
Construct Summary infos for the component represented by given definition.The summary info is used when the webgui displays the component.
When implementing a factory for a component only to be used per API, only then you can return null here.
- Specified by:
getSummary
in classAbstractFactory<com.inet.taskplanner.server.api.action.email.EmailResultAction,ResultActionDefinition,ResultActionInfo,SummaryInfo>
- Parameters:
definition
- the definition with the settings made by a user- Returns:
- summary infos containing text lines to be displayed in the webgui for this component.
-
getSupportedFlavors
public java.util.List<ResultFlavor> getSupportedFlavors(ResultActionDefinition definition)
Returns the list of flavors, supported by this action for the given definition.- Specified by:
getSupportedFlavors
in classResultActionFactory<com.inet.taskplanner.server.api.action.email.EmailResultAction>
- Parameters:
definition
- the current definition settings- Returns:
- the list of result flalvors that are currently supported according to the given definition.
-
isAutoResolvePlaceholders
public boolean isAutoResolvePlaceholders()
Defines whether placeholders will be automatically replaced before the handle method is called. The default implementation returnstrue
.
The automatic replacement will ask all fields, defined by the factory, to resolve all placeholders that match a field key and supports placeholders.
For manual replacement, thePlaceholderResolver
can be used.- Overrides:
isAutoResolvePlaceholders
in classResultActionFactory<com.inet.taskplanner.server.api.action.email.EmailResultAction>
- Returns:
true
if the placeholders shall be resolve automatically,false
if the implementation needs to manage this by themself.
-
-