|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataFoundationFactory
The data foundation factory.
It provides a "create" method for a single-source or multisource-enabled data foundation, its tables, columns, views, joins, contexts, keys, parameters, properties, and lists of values (static or SQL-based).
See SlContext.getService(Class)
to get an instance of the factory.
Method Summary | |
---|---|
AliasTable |
createAliasTable(java.lang.String name,
Table aliasedTable,
DataFoundation dataFoundation)
Creates an alias table and appends it to the tables owned by the data foundation. |
CalculatedColumn |
createCalculatedColumn(java.lang.String name,
DatabaseTable table)
Creates a new calculated column. |
DatabaseColumn |
createColumn(java.lang.String name,
SQLDataType dataType,
Table table)
Creates a new database column. |
Context |
createContext(java.lang.String name,
DataFoundation dataFoundation)
Creates a context and adds it to the data foundation. |
CustomProperty |
createCustomProperty(java.lang.String key,
java.lang.String value,
DataFoundation dataFoundation)
Creates a custom property for the given data foundation |
CustomProperty |
createCustomProperty(java.lang.String key,
java.lang.String value,
Parameter parameter)
Creates a custom property for the given parameter. |
DatabaseTable |
createDatabaseTable(java.lang.String qualifier,
java.lang.String owner,
java.lang.String name,
DataFoundation dataFoundation)
Creates a table with its columns and appends it to the tables owned by the data foundation. |
DataFederatorSourceInfo |
createDataFederatorSourceInfo(java.lang.String connectionPath,
java.lang.String shortName)
Creates a new data federator source info with its connection path and short name. |
DataFederatorSourceInfo |
createDataFederatorSourceInfo(java.lang.String connectionPath,
java.lang.String shortName,
MultiSourceDataFoundation dataFoundation)
Creates a new data federator source info with its connection path and short name, and appends it to the data foundation. |
DataFoundationView |
createDataFoundationView(java.lang.String name,
DataFoundation dataFoundation)
Creates a data foundation view and appends it to the data foundation. |
DateValue |
createDateValue(java.util.Date value)
Creates a value of type Date that can be used as an answer to a prompt. |
DerivedTable |
createDerivedTable(java.lang.String name,
java.lang.String sql,
DataFoundation dataFoundation)
Creates a derived table and appends it to the tables owned by the data foundation. |
DerivedTable |
createDerivedTable(java.lang.String name,
java.lang.String sql,
java.lang.String shortName,
MultiSourceDataFoundation dataFoundation)
Creates a database-specific derived table and appends it to the tables owned by the data foundation. |
HierarchicalValue |
createHierarchicalValue()
Creates a value for an answer to a prompt that accepts hierarchical lists of values. |
IntervalAnswer |
createIntervalAnswer()
Creates an answer to a prompt that accepts a set of values between two values. |
MonoSourceDataFoundation |
createMonoSourceDataFoundation(java.lang.String name,
java.lang.String connectionPath)
Creates a single-source data foundation from a relational connection. |
MultipleValueAnswer |
createMultipleValueAnswer()
Creates an answer to a prompt that accepts multiple values. |
MultiSourceDataFoundation |
createMultiSourceDataFoundation(java.lang.String name)
Creates a multisource-enabled data foundation from a relational connection. |
NumericValue |
createNumericValue(java.lang.Double value)
Creates a value of type Numeric that can be used as an answer to a prompt. |
Parameter |
createParameter(java.lang.String name,
DataFoundation dataFoundation)
Creates a parameter and attaches it to the given data foundation. |
PrimaryKey |
createPrimaryKey(DatabaseTable table)
Creates a primary key and attaches it to the given table. |
QueryScriptProperty |
createQueryScriptProperty(java.lang.String key,
java.lang.String value,
DataFoundation dataFoundation)
Creates a custom query script property. |
SingleValueAnswer |
createSingleValueAnswer()
Creates an answer to a prompt that accepts a single value. |
SQLJoin |
createSqlJoin(java.lang.String expression,
DataFoundation dataFoundation)
Creates a join and adds it to the provided data foundation. |
SQLQueryLov |
createSQLQueryLov(java.lang.String name,
DataFoundation dataFoundation)
Creates a list of values based on a custom SQL query and attaches it to the given data foundation. |
StaticLov |
createStaticLov(java.lang.String name,
DataFoundation dataFoundation)
Creates a static list of values and attaches it to the given data foundation. |
StaticLovColumn |
createStaticLovColumn(java.lang.String name,
StaticLov staticLov)
Creates a column for a static list of values and attaches it to the given list. |
StaticLovRow |
createStaticLovRow(StaticLov staticLov)
Creates a row for a static list of values and attaches it to the given list. |
StringValue |
createStringValue(java.lang.String value)
Creates a value of type String that can be used as an answer to a prompt. |
TableView |
createTableView(Table table,
DataFoundationView dataFoundationView)
Creates a table view and adds it to a data foundation view. |
Method Detail |
---|
MonoSourceDataFoundation createMonoSourceDataFoundation(java.lang.String name, java.lang.String connectionPath)
name
- The name of the data foundationconnectionPath
- The connection path
MonoSourceDataFoundation
objectMultiSourceDataFoundation createMultiSourceDataFoundation(java.lang.String name)
This method does not add data sources to the data foundation. You must create a DataFederatorSourceInfo
object with createDataFederatorSourceInfo(String, String, MultiSourceDataFoundation)
to append a
connection to the data foundation. A multisource-enabled data foundation without connections cannot be saved.
name
- The name of the data foundation
MultiSourceDataFoundation
objectDatabaseTable createDatabaseTable(java.lang.String qualifier, java.lang.String owner, java.lang.String name, DataFoundation dataFoundation)
qualifier
- The qualifier must be provided if it is supported by the database. Otherwise it should be
null
.
In the case of multisource-enabled universes, the qualifier is the catalog.
owner
- The owner must be provided if it is supported by the database. Otherwise it should be
null
.name
- The name of the database tabledataFoundation
- The data foundation
DatabaseTable
objectDataFederatorService.getCatalog(com.sap.sl.sdk.authoring.connection.ConnectionShortcut)
DerivedTable createDerivedTable(java.lang.String name, java.lang.String sql, DataFoundation dataFoundation)
In the case of a MultiSourceDataFoundation
, the method creates an ANSI SQL-92 derived table independent from the source. Tables from different
sources can be used. See createDerivedTable(String, String, String, MultiSourceDataFoundation)
for database-specific derived
tables.
name
- The name of the derived table. It should not have the name of an existing table.sql
- The SQL expression of the derived tabledataFoundation
- The data foundation
DerivedTable
objectDerivedTable createDerivedTable(java.lang.String name, java.lang.String sql, java.lang.String shortName, MultiSourceDataFoundation dataFoundation)
The SQL language used is specific to the database identified by its shortName
. Only tables from this source can be used.
name
- The name of the derived table. It should not have the name of an existing table.sql
- The SQL expression of the derived tableshortName
- The identifier of the source, see DataFederatorSourceInfo.getShortName()
.dataFoundation
- The data foundation
DerivedTable
objectcreateDerivedTable(String, String, DataFoundation)
,
DerivedTable.getSourceShortName()
AliasTable createAliasTable(java.lang.String name, Table aliasedTable, DataFoundation dataFoundation)
An alias table does not have any columns.
name
- The name of the alias table. It should not have the name of an existing table.aliasedTable
- Only DatabaseTable
and DerivedTable
are supported.
The table must be owned by the data foundation, see DataFoundation.getTables()
.
dataFoundation
- The data foundation
AliasTable
objectDatabaseColumn createColumn(java.lang.String name, SQLDataType dataType, Table table)
name
- The name of the columndataType
- The data type of the columntable
- Optional. Set it to null
in this case. If provided, the method adds the column to the
table. See Table.getColumns()
.
DatabaseColumn
objectCalculatedColumn createCalculatedColumn(java.lang.String name, DatabaseTable table)
name
- The name of the columntable
- Optional. Set it to null
in this case. If provided, the method adds the column to the
database table. See Table.getColumns()
.
CalculatedColumn
objectSQLJoin createSqlJoin(java.lang.String expression, DataFoundation dataFoundation)
expression
- The join SQL expression, which cannot be null or emptydataFoundation
- The data foundation
SQLJoin
objectContext createContext(java.lang.String name, DataFoundation dataFoundation)
name
- The name of the contextdataFoundation
- The data foundation
Context
objectDataFoundationView createDataFoundationView(java.lang.String name, DataFoundation dataFoundation)
Example:
dataFoundationView dataFoundationFactory.createDataFoundationView("MyView", dataFoundation); dataFoundationView.setDescription("My description"); ...
name
- The name of the data foundation viewdataFoundation
- The data foundation
DataFoundationView
objectTableView createTableView(Table table, DataFoundationView dataFoundationView)
A TableView
object helps define a series of properties
attached to a table in a specific view (position, width, display state).
Example:
TableView tableView = dataFoundationFactory.createTableView(table, dataFoundationView); ...
table
- The table of the table viewdataFoundationView
- The data foundation view
TableView
objectDataFederatorSourceInfo createDataFederatorSourceInfo(java.lang.String connectionPath, java.lang.String shortName, MultiSourceDataFoundation dataFoundation)
The connection has to be deployed on the Data Federation Query Server, see DataFederatorService
.
connectionPath
- The path of the connection shortcut in the file systemshortName
- The short name of the data federator source infodataFoundation
- The data foundation
DataFederatorSourceInfo
objectDataFederatorSourceInfo createDataFederatorSourceInfo(java.lang.String connectionPath, java.lang.String shortName)
The connection has to be deployed on the Data Federation Query Server, see DataFederatorService
.
connectionPath
- The path of the connection shortcut in the file systemshortName
- The short name of the data federator source info
DataFederatorSourceInfo
objectPrimaryKey createPrimaryKey(DatabaseTable table)
Only database tables and derived tables accept primary keys.
table
- The table
PrimaryKey
objectStaticLov createStaticLov(java.lang.String name, DataFoundation dataFoundation)
Example:
StaticLov staticLov = dataFoundationFactory.createStaticLov("StaticLov", dataFoundation); staticLov.setDescription("Description of StaticLov"); ...
name
- The name of the static list of valuesdataFoundation
- The data foundation
StaticLov
objectLov.setDescription(String)
StaticLovColumn createStaticLovColumn(java.lang.String name, StaticLov staticLov)
Example:
StaticLov staticLov = dataFoundationFactory.createStaticLov("StaticLov", dataFoundation); staticLov.setDescription("Description of StaticLov"); StaticLovColumn staticLovColumn1 = dataFoundationFactory.createStaticLovColumn("Column1", staticLov); staticLovColumn1.setHidden(false); staticLovColumn1.setDataType(LovParameterDataType.NUMERIC); staticLov.getColumns().add(staticLovColumn1); ...
name
- The column namestaticLov
- The static list of values
StaticLovColumn
objectStaticLovColumn.setHidden(boolean)
,
StaticLovColumn.setDataType(LovParameterDataType)
,
StaticLov.getColumns()
StaticLovRow createStaticLovRow(StaticLov staticLov)
Example:
StaticLov staticLov = dataFoundationFactory.createStaticLov("StaticLov", dataFoundation); staticLov.setDescription("Description of StaticLov"); StaticLovColumn staticLovColumn1 = dataFoundationFactory.createStaticLovColumn("Column1", staticLov); staticLovColumn1.setHidden(false); staticLovColumn1.setDataType(LovParameterDataType.NUMERIC); staticLov.getColumns().add(staticLovColumn1); ... StaticLovRow staticLovRow1 = dataFoundationFactory.createStaticLovRow(staticLov); staticLovRow1.getValues().add(dataFoundationFactory.createNumericValue(18.9)); ... staticLov.getRows().add(staticLovRow1);
staticLov
- The static list of values
StaticLovRow
objectcreateNumericValue(Double)
,
StaticLovRow.getValues()
,
StaticLov.getRows()
SQLQueryLov createSQLQueryLov(java.lang.String name, DataFoundation dataFoundation)
Example:
SQLQueryLov sqlQueryLov = dataFoundationFactory.createSQLQueryLov("SQLQueryLov", dataFoundation); sqlQueryLov.setDescription("Description of SQLQueryLov"); sqlQueryLov.setSQLExpression("SELECT * FROM " + dataFoundation.getTables().get(0).getName()); ...
name
- The name of the list of valuesdataFoundation
- The data foundation
SQLQueryLov
objectLov.setDescription(String)
,
SQLQueryLov.setSQLExpression(String)
Parameter createParameter(java.lang.String name, DataFoundation dataFoundation)
Example:
Parameter parameter = dataFoundationFactory.createParameter("prompt", dataFoundation); parameter.setUserPrompted(true); parameter.setPromptText(parameter.getName()); parameter.setDataType(LovParameterDataType.STRING); ... parameter.setAssociatedLov(sqlQueryLov.getColumns().get(1));
name
- The parameter namedataFoundation
- The data foundation
Parameter
objectParameter.setUserPrompted(boolean)
,
Parameter.setPromptText(String)
,
Parameter.setDataType(LovParameterDataType)
,
Parameter.setAssociatedLov(Object)
,
SQLQueryLov.getColumns()
SingleValueAnswer createSingleValueAnswer()
SingleValueAnswer
objectMultipleValueAnswer createMultipleValueAnswer()
MultipleValueAnswer
objectIntervalAnswer createIntervalAnswer()
Example:
IntervalAnswer answer = dataFoundationFactory.createIntervalAnswer(); answer.setLowValue(dataFoundationFactory.createStringValue("value1")); answer.setHighValue(dataFoundationFactory.createStringValue("value2")); ...
IntervalAnswer
objectcreateStringValue(String)
,
IntervalAnswer.setLowValue(TypedValue)
,
IntervalAnswer.setHighValue(TypedValue)
StringValue createStringValue(java.lang.String value)
value
- The answer value
StringValue
objectDateValue createDateValue(java.util.Date value)
value
- The answer value
DateValue
objectNumericValue createNumericValue(java.lang.Double value)
value
- The answer value
NumericValue
objectHierarchicalValue createHierarchicalValue()
HierarchicalValue
objectCustomProperty createCustomProperty(java.lang.String key, java.lang.String value, DataFoundation dataFoundation)
Example:
customProperty dataFoundationFactory.createCustomProperty("MyKey", "MyValue", dataFoundation); ...
key
- The key of the custom propertyvalue
- The value of the custom propertydataFoundation
- The data foundation to which the custom property is added
CustomProperty
objectCustomProperty createCustomProperty(java.lang.String key, java.lang.String value, Parameter parameter)
Example:
customProperty dataFoundationFactory.createCustomProperty("MyKey", "MyValue", MyParameter); ...
key
- The key of the custom propertyvalue
- The value of the custom propertyparameter
- The parameter to which the custom property is added
CustomProperty
objectQueryScriptProperty createQueryScriptProperty(java.lang.String key, java.lang.String value, DataFoundation dataFoundation)
Example:
queryScriptProperty dataFoundationFactory.createQueryScriptProperty("MyKey", "MyValue"); ...
key
- The key of the query script propertyvalue
- The value of the query script propertydataFoundation
- The data foundation to which the custom query script property is added
QueryScriptProperty
object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |