Class DbSeriesFactory
- java.lang.Object
-
- com.inet.taskplanner.server.api.common.AbstractFactory<COMPONENT,DEFINITION,INFO,SUMMARY>
-
- com.inet.taskplanner.server.api.common.SeriesIndependentFactory<T,SeriesDefinition,SeriesInfo,SummaryInfo>
-
- com.inet.taskplanner.server.api.series.SeriesFactory<com.inet.taskplanner.server.api.series.db.DbSeries>
-
- com.inet.taskplanner.server.api.series.db.DbSeriesFactory
-
- All Implemented Interfaces:
com.inet.plugin.NamedExtension
public class DbSeriesFactory extends SeriesFactory<com.inet.taskplanner.server.api.series.db.DbSeries>
A series factory with data from a database.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDATASOURCEThe name of a datasource used to create aSeriesDefinition.static java.lang.StringEXTENSIONThe extension name used to create aSeriesDefinition.static java.lang.StringJDBC_URLThe JDBC url property used to create aSeriesDefinition.static java.lang.StringPASSWORDThe password property used to create aSeriesDefinition.static java.lang.StringSQLThe SQL property used to create aSeriesDefinition.static java.lang.StringUSERNAMEThe user name property used to create aSeriesDefinition.
-
Constructor Summary
Constructors Constructor Description DbSeriesFactory()Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.inet.taskplanner.server.api.series.db.DbSeriescreateInstanceFrom(SeriesDefinition definition, com.inet.id.GUID taskID)Construct a component (PRODUCT) from the given definition.SeriesInfogetInformation(com.inet.id.GUID taskID)Returns an information object about components which can be produced with this factory.SummaryInfogetSummary(SeriesDefinition definition)Construct Summary infos for the component represented by given definition.voidvalidate(SeriesDefinition definition, com.inet.id.GUID taskID)Validate the given definition.-
Methods inherited from class com.inet.taskplanner.server.api.series.SeriesFactory
getKeys
-
Methods inherited from class com.inet.taskplanner.server.api.common.SeriesIndependentFactory
createFrom, updateValues
-
Methods inherited from class com.inet.taskplanner.server.api.common.AbstractFactory
checkDefinitionArgument, createInstanceFrom, getExtensionName, isAvailable
-
-
-
-
Field Detail
-
EXTENSION
public static final java.lang.String EXTENSION
The extension name used to create aSeriesDefinition.- See Also:
- Constant Field Values
-
DATASOURCE
public static final java.lang.String DATASOURCE
The name of a datasource used to create aSeriesDefinition.- See Also:
- Constant Field Values
-
JDBC_URL
public static final java.lang.String JDBC_URL
The JDBC url property used to create aSeriesDefinition.- See Also:
- Constant Field Values
-
USERNAME
public static final java.lang.String USERNAME
The user name property used to create aSeriesDefinition.- See Also:
- Constant Field Values
-
PASSWORD
public static final java.lang.String PASSWORD
The password property used to create aSeriesDefinition.- See Also:
- Constant Field Values
-
SQL
public static final java.lang.String SQL
The SQL property used to create aSeriesDefinition.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInformation
public SeriesInfo 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
fieldswhich 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 aserialtask. 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:
getInformationin classAbstractFactory<com.inet.taskplanner.server.api.series.db.DbSeries,SeriesDefinition,SeriesInfo,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(SeriesDefinition definition, com.inet.id.GUID taskID) throws ValidationException
Validate the given definition.The given definition is guaranteed to belong to this factory
- Specified by:
validatein classSeriesIndependentFactory<com.inet.taskplanner.server.api.series.db.DbSeries,SeriesDefinition,SeriesInfo,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.series.db.DbSeries createInstanceFrom(SeriesDefinition definition, com.inet.id.GUID taskID)
Construct a component (PRODUCT) from the given definition.- Overrides:
createInstanceFromin classAbstractFactory<com.inet.taskplanner.server.api.series.db.DbSeries,SeriesDefinition,SeriesInfo,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(SeriesDefinition 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:
getSummaryin classAbstractFactory<com.inet.taskplanner.server.api.series.db.DbSeries,SeriesDefinition,SeriesInfo,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.
-
-