com.sap.sl.sdk.authoring.datafoundation
Interface DataFoundationFactory


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

createMonoSourceDataFoundation

MonoSourceDataFoundation createMonoSourceDataFoundation(java.lang.String name,
                                                        java.lang.String connectionPath)
Creates a single-source data foundation from a relational connection.

Parameters:
name - The name of the data foundation
connectionPath - The connection path
Returns:
A MonoSourceDataFoundation object
Since:
14.1

createMultiSourceDataFoundation

MultiSourceDataFoundation createMultiSourceDataFoundation(java.lang.String name)
Creates a multisource-enabled data foundation from a relational connection.

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.

Parameters:
name - The name of the data foundation
Returns:
A MultiSourceDataFoundation object
Since:
14.1.2

createDatabaseTable

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.

Parameters:
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 table
dataFoundation - The data foundation
Returns:
A DatabaseTable object
Since:
14.1
See Also:
DataFederatorService.getCatalog(com.sap.sl.sdk.authoring.connection.ConnectionShortcut)

createDerivedTable

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.

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.

Parameters:
name - The name of the derived table. It should not have the name of an existing table.
sql - The SQL expression of the derived table
dataFoundation - The data foundation
Returns:
A DerivedTable object
Since:
14.1

createDerivedTable

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.

The SQL language used is specific to the database identified by its shortName. Only tables from this source can be used.

Parameters:
name - The name of the derived table. It should not have the name of an existing table.
sql - The SQL expression of the derived table
shortName - The identifier of the source, see DataFederatorSourceInfo.getShortName().
dataFoundation - The data foundation
Returns:
A DerivedTable object
Since:
14.1.2
See Also:
createDerivedTable(String, String, DataFoundation), DerivedTable.getSourceShortName()

createAliasTable

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.

An alias table does not have any columns.

Parameters:
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
Returns:
An AliasTable object
Since:
14.1

createColumn

DatabaseColumn createColumn(java.lang.String name,
                            SQLDataType dataType,
                            Table table)
Creates a new database column.

Parameters:
name - The name of the column
dataType - The data type of the column
table - Optional. Set it to null in this case. If provided, the method adds the column to the table. See Table.getColumns().
Returns:
A DatabaseColumn object
Since:
14.1

createCalculatedColumn

CalculatedColumn createCalculatedColumn(java.lang.String name,
                                        DatabaseTable table)
Creates a new calculated column.

Parameters:
name - The name of the column
table - Optional. Set it to null in this case. If provided, the method adds the column to the database table. See Table.getColumns().
Returns:
A CalculatedColumn object
Since:
14.1.5

createSqlJoin

SQLJoin createSqlJoin(java.lang.String expression,
                      DataFoundation dataFoundation)
Creates a join and adds it to the provided data foundation.

Parameters:
expression - The join SQL expression, which cannot be null or empty
dataFoundation - The data foundation
Returns:
An SQLJoin object
Since:
14.1

createContext

Context createContext(java.lang.String name,
                      DataFoundation dataFoundation)
Creates a context and adds it to the data foundation.

Parameters:
name - The name of the context
dataFoundation - The data foundation
Returns:
A Context object
Since:
14.1.2

createDataFoundationView

DataFoundationView createDataFoundationView(java.lang.String name,
                                            DataFoundation dataFoundation)
Creates a data foundation view and appends it to the data foundation.

Example:

 dataFoundationView dataFoundationFactory.createDataFoundationView("MyView", dataFoundation);
 dataFoundationView.setDescription("My description");     
 ...
 

Parameters:
name - The name of the data foundation view
dataFoundation - The data foundation
Returns:
A DataFoundationView object
Since:
14.1.6

createTableView

TableView createTableView(Table table,
                          DataFoundationView dataFoundationView)
Creates a table view and adds it to a data foundation view.

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);                    
 ...
 

Parameters:
table - The table of the table view
dataFoundationView - The data foundation view
Returns:
A TableView object
Since:
14.1.6

createDataFederatorSourceInfo

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.

The connection has to be deployed on the Data Federation Query Server, see DataFederatorService.

Parameters:
connectionPath - The path of the connection shortcut in the file system
shortName - The short name of the data federator source info
dataFoundation - The data foundation
Returns:
A DataFederatorSourceInfo object
Since:
14.1.2

createDataFederatorSourceInfo

DataFederatorSourceInfo createDataFederatorSourceInfo(java.lang.String connectionPath,
                                                      java.lang.String shortName)
Creates a new data federator source info with its connection path and short name.

The connection has to be deployed on the Data Federation Query Server, see DataFederatorService.

Parameters:
connectionPath - The path of the connection shortcut in the file system
shortName - The short name of the data federator source info
Returns:
A DataFederatorSourceInfo object
Since:
14.2.5

createPrimaryKey

PrimaryKey createPrimaryKey(DatabaseTable table)
Creates a primary key and attaches it to the given table.

Only database tables and derived tables accept primary keys.

Parameters:
table - The table
Returns:
A PrimaryKey object
Since:
14.1.2

createStaticLov

StaticLov createStaticLov(java.lang.String name,
                          DataFoundation dataFoundation)
Creates a static list of values and attaches it to the given data foundation.

Example:

 StaticLov staticLov = dataFoundationFactory.createStaticLov("StaticLov", dataFoundation);
 staticLov.setDescription("Description of StaticLov");
 ...
 

Parameters:
name - The name of the static list of values
dataFoundation - The data foundation
Returns:
A StaticLov object
Since:
14.1.3
See Also:
Lov.setDescription(String)

createStaticLovColumn

StaticLovColumn createStaticLovColumn(java.lang.String name,
                                      StaticLov staticLov)
Creates a column for a static list of values and attaches it to the given list.

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);
 ...     
 

Parameters:
name - The column name
staticLov - The static list of values
Returns:
A StaticLovColumn object
Since:
14.1.3
See Also:
StaticLovColumn.setHidden(boolean), StaticLovColumn.setDataType(LovParameterDataType), StaticLov.getColumns()

createStaticLovRow

StaticLovRow createStaticLovRow(StaticLov staticLov)
Creates a row for a static list of values and attaches it to the given list.

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);
 

Parameters:
staticLov - The static list of values
Returns:
A StaticLovRow object
Since:
14.1.3
See Also:
createNumericValue(Double), StaticLovRow.getValues(), StaticLov.getRows()

createSQLQueryLov

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.

Example:

 SQLQueryLov sqlQueryLov = dataFoundationFactory.createSQLQueryLov("SQLQueryLov", dataFoundation);
 sqlQueryLov.setDescription("Description of SQLQueryLov");
 sqlQueryLov.setSQLExpression("SELECT * FROM " + dataFoundation.getTables().get(0).getName());
 ...
 

Parameters:
name - The name of the list of values
dataFoundation - The data foundation
Returns:
A SQLQueryLov object
Since:
14.1.3
See Also:
Lov.setDescription(String), SQLQueryLov.setSQLExpression(String)

createParameter

Parameter createParameter(java.lang.String name,
                          DataFoundation dataFoundation)
Creates a parameter and attaches it to the given data foundation.

Example:

 Parameter parameter = dataFoundationFactory.createParameter("prompt", dataFoundation);
 parameter.setUserPrompted(true);
 parameter.setPromptText(parameter.getName());
 parameter.setDataType(LovParameterDataType.STRING);
 ...
 parameter.setAssociatedLov(sqlQueryLov.getColumns().get(1));
 

Parameters:
name - The parameter name
dataFoundation - The data foundation
Returns:
A Parameter object
Since:
14.1.3
See Also:
Parameter.setUserPrompted(boolean), Parameter.setPromptText(String), Parameter.setDataType(LovParameterDataType), Parameter.setAssociatedLov(Object), SQLQueryLov.getColumns()

createSingleValueAnswer

SingleValueAnswer createSingleValueAnswer()
Creates an answer to a prompt that accepts a single value.

Returns:
A SingleValueAnswer object
Since:
14.1.3

createMultipleValueAnswer

MultipleValueAnswer createMultipleValueAnswer()
Creates an answer to a prompt that accepts multiple values.

Returns:
A MultipleValueAnswer object
Since:
14.1.3

createIntervalAnswer

IntervalAnswer createIntervalAnswer()
Creates an answer to a prompt that accepts a set of values between two values.

Example:

 IntervalAnswer answer = dataFoundationFactory.createIntervalAnswer();
 answer.setLowValue(dataFoundationFactory.createStringValue("value1"));
 answer.setHighValue(dataFoundationFactory.createStringValue("value2"));
 ...
 

Returns:
An IntervalAnswer object
Since:
14.1.3
See Also:
createStringValue(String), IntervalAnswer.setLowValue(TypedValue), IntervalAnswer.setHighValue(TypedValue)

createStringValue

StringValue createStringValue(java.lang.String value)
Creates a value of type String that can be used as an answer to a prompt.

Parameters:
value - The answer value
Returns:
A StringValue object
Since:
14.1.3

createDateValue

DateValue createDateValue(java.util.Date value)
Creates a value of type Date that can be used as an answer to a prompt.

Parameters:
value - The answer value
Returns:
A DateValue object
Since:
14.1.3

createNumericValue

NumericValue createNumericValue(java.lang.Double value)
Creates a value of type Numeric that can be used as an answer to a prompt.

Parameters:
value - The answer value
Returns:
A NumericValue object
Since:
14.1.3

createHierarchicalValue

HierarchicalValue createHierarchicalValue()
Creates a value for an answer to a prompt that accepts hierarchical lists of values.

Returns:
A HierarchicalValue object
Since:
14.1.3

createCustomProperty

CustomProperty createCustomProperty(java.lang.String key,
                                    java.lang.String value,
                                    DataFoundation dataFoundation)
Creates a custom property for the given data foundation

Example:

 customProperty dataFoundationFactory.createCustomProperty("MyKey", "MyValue", dataFoundation);
 ...
 

Parameters:
key - The key of the custom property
value - The value of the custom property
dataFoundation - The data foundation to which the custom property is added
Returns:
A CustomProperty object
Since:
14.1.3

createCustomProperty

CustomProperty createCustomProperty(java.lang.String key,
                                    java.lang.String value,
                                    Parameter parameter)
Creates a custom property for the given parameter.

Example:

 customProperty dataFoundationFactory.createCustomProperty("MyKey", "MyValue", MyParameter);
 ...
 

Parameters:
key - The key of the custom property
value - The value of the custom property
parameter - The parameter to which the custom property is added
Returns:
A CustomProperty object
Since:
14.1.3

createQueryScriptProperty

QueryScriptProperty createQueryScriptProperty(java.lang.String key,
                                              java.lang.String value,
                                              DataFoundation dataFoundation)
Creates a custom query script property.

Example:

 queryScriptProperty dataFoundationFactory.createQueryScriptProperty("MyKey", "MyValue");
 ...
 

Parameters:
key - The key of the query script property
value - The value of the query script property
dataFoundation - The data foundation to which the custom query script property is added
Returns:
A QueryScriptProperty object
Since:
14.2.3


© Copyright 2016 SAP SE or an SAP affiliate company. All rights reserved.