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


public interface DataFoundationService

Provides methods to manage the fully qualified names of the data foundation tables, detect the columns of lists of values, and refresh the structure of the data foundation.


Method Summary
 void detectLovColumns(SQLQueryLov sqlQueryLov)
          Creates the columns of the list of values from the SQL expression on which the list of values is based.
 java.lang.String getTableFullName(java.lang.String qualifier, java.lang.String owner, java.lang.String table)
          Returns the fully qualified table name that identifies a table within a DataFoundation.
 java.lang.String getTableFullName(Table table)
          Returns the fully qualified table name that identifies a table within a DataFoundation.
 IStatus refreshStructure(java.lang.String dataFoundationPath, boolean applyChanges)
          Refreshes the structure of the data foundation.
 IStatus setConnectionPath(java.lang.String multiDataFoundationPath, java.util.List<DataFederatorSourceInfo> sourceInfos)
          Set the connection paths of a multi-source data foundation.
 IStatus setConnectionPath(java.lang.String monoDataFoundationPath, java.lang.String connectionPath)
          Set the connection path of a mono-source data foundation.
 java.lang.String[] splitTableFullName(java.lang.String fullName)
          Splits a fully qualified table name into an array of strings [qualifier, owner, table name].
 

Method Detail

splitTableFullName

java.lang.String[] splitTableFullName(java.lang.String fullName)
Splits a fully qualified table name into an array of strings [qualifier, owner, table name].

The fullName identifies a table within a DataFoundation.

If not available, qualifier and owner are set to an empty string.

Parameters:
fullName - The fully qualified name of a table. It must follow the same format as the one used in "Rows" Data Security Profile.
Returns:
A String[] containing the owner, qualifier and table name
Since:
14.1.2
See Also:
getTableFullName(String, String, String), getTableFullName(Table), RowRestriction.getTable(), RelationalBinding.getExtraTables()

getTableFullName

java.lang.String getTableFullName(java.lang.String qualifier,
                                  java.lang.String owner,
                                  java.lang.String table)
Returns the fully qualified table name that identifies a table within a DataFoundation.

The returned string is formatted as "qualifier"."owner"."tablename".

Parameters:
qualifier - The qualifier of the table
owner - The owner of the table
table - The name of the table
Returns:
A String containing the fully qualified table name
Since:
14.1.2
See Also:
RowRestriction.setTable(String), RelationalBinding.getExtraTables(), splitTableFullName(String)

getTableFullName

java.lang.String getTableFullName(Table table)
Returns the fully qualified table name that identifies a table within a DataFoundation.

Parameters:
table - The table
Returns:
A String containing the fully qualified table name
Since:
14.1.2
See Also:
getTableFullName(String, String, String)

detectLovColumns

void detectLovColumns(SQLQueryLov sqlQueryLov)
Creates the columns of the list of values from the SQL expression on which the list of values is based.

This method detects the columns from the SQL expression and then creates the columns of the SQLQueryLov object. The columns cannot be edited (adding, modifying, removing).

Example:

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

Parameters:
sqlQueryLov - The list of values attached to a data foundation
Since:
14.1.3
See Also:
DataFoundationFactory.createSQLQueryLov(String, DataFoundation), Lov.setDescription(String), SQLQueryLov.setSQLExpression(String), SlContext.getService(Class)

refreshStructure

IStatus refreshStructure(java.lang.String dataFoundationPath,
                         boolean applyChanges)
Refreshes the structure of the data foundation.

This method performs the following operations:

All objects modified in the database are refreshed at once in the data foundation.

Important: If you load the data foundation before running this method, all changes will be discarded.

Parameters:
dataFoundationPath - The path of the data foundation, with the following format: [folder]/.../[data foundation name].dfx.
applyChanges - If true, the method applies the changes and saves the data foundation. If false, the method only returns the description of the changes.
Returns:
A child of IStatus that contains the description of changes made to the data foundation
Since:
14.1.2

setConnectionPath

IStatus setConnectionPath(java.lang.String monoDataFoundationPath,
                          java.lang.String connectionPath)
Set the connection path of a mono-source data foundation.

This method avoids to load the data foundation to change the path of its connection.

Parameters:
monoDataFoundationPath - The mono-source data foundation path.
connectionPath - The path of the connection. It can be local or CMS (path or CUID)
Returns:
A child of IStatus that contains the result of change made to the data foundation
Since:
14.2.5

setConnectionPath

IStatus setConnectionPath(java.lang.String multiDataFoundationPath,
                          java.util.List<DataFederatorSourceInfo> sourceInfos)
Set the connection paths of a multi-source data foundation.

This method avoids to load the data foundation to change the paths of its connections.

Parameters:
multiDataFoundationPath - The multi-source data foundation path.
sourceInfos - The list of sourceInfos replacing the current ones.
Returns:
A child of IStatus that contains the result of change made to the data foundation
Since:
14.2.5


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