public interface BusinessLayerFactory
The business layer you create is validated at save time. See RelationalBusinessLayer.
In this release, you can create the following types of lists of values:
See SlContext.getService(Class) to get an instance of the factory.
| Modifier and Type | Method and Description |
|---|---|
AggregateIncompatibility |
createAggregateIncompatibility(RelationalBusinessLayer businessLayer)
Creates an aggregate incompatibility and adds it to the given relational business layer.
|
<T extends BlItem> |
createBlItem(java.lang.Class<T> type,
java.lang.String name,
BlContainer parent)
Creates a business layer item.
|
<T extends BlItem> |
createBlItem(java.lang.Class<T> type,
java.lang.String name,
BlContainer parent,
java.lang.String identifier)
Creates a business layer item.
|
BusinessHierarchicalLov |
createBusinessHierarchicalLov(java.lang.String name,
BusinessLayer businessLayer)
Creates a business hierarchical list of values and adds it to the given business layer.
|
BusinessHierarchicalLovColumn |
createBusinessHierarchicalLovColumn(BusinessHierarchicalLov businessHierarchicalLov,
Dimension dimension)
Creates a column of business hierarchical list of values based on a dimension and adds it to the given list of values.
|
BusinessLayerView |
createBusinessLayerView(java.lang.String name,
BusinessLayer businessLayer)
Creates a business layer view for the given business layer.
|
BusinessQueryLov |
createBusinessQueryLov(java.lang.String name,
BusinessLayer businessLayer)
Creates a list of values based on a query built from business objects and adds it to the given business layer.
|
ConversionOptions |
createConversionOptions()
Creates an instance representing the conversion options of a universe.
|
CustomDateTimeFormat |
createCustomDateTimeFormat(BusinessObject businessObject)
Creates a custom date-time format and adds it to the given business object.
|
CustomNumberFormat |
createCustomNumberFormat(BusinessObject businessObject)
Creates a custom number format and adds it to the given business object.
|
CustomProperty |
createCustomProperty(java.lang.String key,
java.lang.String value,
BlItem blItem)
Creates a custom property for the given business layer item.
|
CustomProperty |
createCustomProperty(java.lang.String key,
java.lang.String value,
BusinessLayer businessLayer)
Creates a custom property for the given business layer.
|
CustomProperty |
createCustomProperty(java.lang.String key,
java.lang.String value,
Parameter parameter)
Creates a custom property for the given parameter.
|
DateValue |
createDateValue(java.util.Date value)
Creates a value of type Date that can be used as an answer to a prompt.
|
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.
|
MultipleValueAnswer |
createMultipleValueAnswer()
Creates an answer to a prompt that accepts multiple values.
|
NavigationPath |
createNavigationPath(java.lang.String name,
BusinessLayer businessLayer)
Creates a custom navigation path and adds it to the given business layer.
|
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,
BusinessLayer businessLayer)
Creates a parameter and adds it to the given business layer.
|
Parameter |
createParameter(java.lang.String name,
DataFoundation dataFoundation)
Creates a parameter and attaches it to the given data foundation.
|
PredefinedDateTimeFormat |
createPredefinedDateTimeFormat(BusinessObject businessObject)
Creates a predefined date-time format and adds it to the given business object.
|
PredefinedNumberFormat |
createPredefinedNumberFormat(BusinessObject businessObject)
Creates a predefined number format and adds it to the given business object.
|
QueryScriptProperty |
createQueryScriptProperty(java.lang.String key,
java.lang.String value,
BusinessLayer businessLayer)
Creates a custom query script property.
|
RelationalBusinessLayer |
createRelationalBusinessLayer(java.lang.String name,
java.lang.String datafoundationPath)
Creates a relational business layer linked to a data foundation.
|
SingleValueAnswer |
createSingleValueAnswer()
Creates an answer to a prompt that accepts a single value.
|
SQLQueryLov |
createSQLQueryLov(java.lang.String name,
BusinessLayer businessLayer)
Creates an SQL-based list of values and adds it to the given business layer.
|
StaticLov |
createStaticLov(java.lang.String name,
BusinessLayer businessLayer)
Creates a static list of values and adds it to the given business layer.
|
StaticLovColumn |
createStaticLovColumn(java.lang.String name,
StaticLov staticLov)
Creates a column for a static list of values and adds it to the given list.
|
StaticLovRow |
createStaticLovRow(StaticLov staticLov)
Creates a row for a static list of values and adds 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.
|
RelationalBusinessLayer createRelationalBusinessLayer(java.lang.String name, java.lang.String datafoundationPath)
For example:
businessLayer = businessLayerFactory.createRelationalBusinessLayer("myBusinessLayer", "dfPath");
...
name - The business layer namedatafoundationPath - The local path to an existing data foundationRelationalBusinessLayer object<T extends BlItem> T createBlItem(java.lang.Class<T> type, java.lang.String name, BlContainer parent)
Example:
SlContext context = ...;
RelationalBusinessLayer businessLayer = ...;
RootFolder rootFolder = businessLayer.getRootFolder();
BusinessLayerFactory businessLayerFactory = context.getService(BusinessLayerFactory.class);
Dimension dimension = businessLayerFactory.createBlItem(Dimension.class, "New Dimension", rootFolder);
dimension.setSelect("table.column");
type - One of the following class objects:
name - The business item nameparent - The business item that will be the container of the business item to be created.
It must be attached directly or indirectly to a business layer.
See BlContainer.getChildren().<T extends BlItem> T createBlItem(java.lang.Class<T> type, java.lang.String name, BlContainer parent, java.lang.String identifier)
Example:
SlContext context = ...;
RelationalBusinessLayer businessLayer = ...;
RootFolder rootFolder = businessLayer.getRootFolder();
BusinessLayerFactory businessLayerFactory = context.getService(BusinessLayerFactory.class);
Dimension dimension = businessLayerFactory.createBlItem(Dimension.class, "New Dimension", rootFolder, "ANH-71 [gx]");
dimension.setSelect("table.column");
type - One of the following class objects:
name - The business item nameparent - The business item that will be the container of the business item to be created.
It must be attached directly or indirectly to a business layer.
See BlContainer.getChildren().identifier - The identifier of the business item.
It must not be empty or already used by another BlItem in the business layer.
See Identifiable.getIdentifier().CustomProperty createCustomProperty(java.lang.String key, java.lang.String value, BusinessLayer businessLayer)
Example:
customProperty businessLayerFactory.createCustomProperty("MyKey", "MyValue", businessLayer);
...
key - The key of the custom propertyvalue - The value of the custom propertybusinessLayer - The business layer to which the custom property is addedCustomProperty objectCustomProperty createCustomProperty(java.lang.String key, java.lang.String value, BlItem blItem)
Example:
customProperty businessLayerFactory.createCustomProperty("MyDimKey", "MyDimValue", myDimension);
...
key - The key of the custom propertyvalue - The value of the custom propertyblItem - The business layer item to which the custom property is addedCustomProperty objectCustomProperty createCustomProperty(java.lang.String key, java.lang.String value, Parameter parameter)
Example:
customProperty businessLayerFactory.createCustomProperty("MyKey", "MyValue", myParameter);
...
key - The key of the custom propertyvalue - The value of the custom propertyarameter - The parameter to which the custom property is addedCustomProperty objectBusinessLayerView createBusinessLayerView(java.lang.String name, BusinessLayer businessLayer)
Example:
businessLayer = businessLayerFactory.createRelationalBusinessLayer("MyBusinessLayer", "dfPath");
...
BusinessLayerView view = businessLayerFactory.createBusinessLayerView("View", businessLayer);
businessLayer.getBusinessLayerViews().add(view);
name - The name of the business layer viewbusinessLayer - The business layer to which the business layer view is addedBusinessLayerView objectBusinessLayer.getBusinessLayerViews()StaticLov createStaticLov(java.lang.String name, BusinessLayer businessLayer)
Example:
StaticLov staticLov = businessLayerFactory.createStaticLov("StaticLov", businessLayer);
staticLov.setDescription("Description of StaticLov");
name - The name of the list of valuesbusinessLayer - The business layerStaticLov objectLov.setDescription(String)StaticLovColumn createStaticLovColumn(java.lang.String name, StaticLov staticLov)
Example:
StaticLov staticLov = businessLayerFactory.createStaticLov("StaticLov", businessLayer);
staticLov.setDescription("Description of StaticLov");
StaticLovColumn staticLovColumn1 = businessLayerFactory.createStaticLovColumn("Column1", staticLov);
staticLovColumn1.setHidden(true);
staticLovColumn1.setDataType(LovParameterDataType.NUMERIC);
StaticLovColumn staticLovColumn2 = businessLayerFactory.createStaticLovColumn("Column2", staticLov);
...
name - The column namestaticLov - The static list of valuesStaticLovColumn objectStaticLovColumn.setHidden(boolean),
StaticLovColumn.setDataType(LovParameterDataType)StaticLovRow createStaticLovRow(StaticLov staticLov)
Example:
StaticLov staticLov = businessLayerFactory.createStaticLov("StaticLov", businessLayer);
...
StaticLovColumn staticLovColumn1 = businessLayerFactory.createStaticLovColumn("Column1", staticLov);
...
StaticLovRow staticLovRow1 = businessLayerFactory.createStaticLovRow(staticLov);
staticLovRow1.getValues().add(businessLayerFactory.createNumericValue(18.9));
staticLovRow1.getValues().add(businessLayerFactory.createStringValue("Value"));
staticLovRow1.getValues().add(businessLayerFactory.createDateValue(Date.valueOf("2013-07-14")));
...
staticLov - The static list of valuesStaticLovRow objectcreateNumericValue(Double),
createStringValue(String),
createDateValue(Date),
StaticLovRow.getValues()SQLQueryLov createSQLQueryLov(java.lang.String name, BusinessLayer businessLayer)
Example:
SQLQueryLov sqlQueryLov = businessLayerFactory.createSQLQueryLov("SQLQueryLov", businessLayer);
sqlQueryLov.setDescription("Description of SQLQueryLov");
sqlQueryLov.setSQLExpression("SELECT * FROM CUSTORDER");
...
name - The name of the list of valuesbusinessLayer - The business layerSQLQueryLov objectLov.setDescription(String),
SQLQueryLov.setSQLExpression(String)BusinessHierarchicalLov createBusinessHierarchicalLov(java.lang.String name, BusinessLayer businessLayer)
Example:
BusinessHierarchicalLov businessHierarchicalLov = businessLayerFactory.createBusinessHierarchicalLov("BusinessHierarchicalLov", businessLayer);
businessHierarchicalLov.setDescription("Description of BusinessHierarchicalLov");
...
name - The name of the list of valuesbusinessLayer - The business layerBusinessHierarchicalLov objectLov.setDescription(String)BusinessHierarchicalLovColumn createBusinessHierarchicalLovColumn(BusinessHierarchicalLov businessHierarchicalLov, Dimension dimension)
Example:
BusinessHierarchicalLov businessHierarchicalLov = businessLayerFactory.createBusinessHierarchicalLov("BusinessHierarchicalLov", businessLayer);
businessHierarchicalLov.setDescription("Description of BusinessHierarchicalLov");
...
businessLayerFactory.createBusinessHierarchicalLovColumn(businessHierarchicalLov, dimension);
businessHierarchicalLov - The list of valuesdimension - The dimensionBusinessHierarchicalLov objectLov.setDescription(String)BusinessQueryLov createBusinessQueryLov(java.lang.String name, BusinessLayer businessLayer)
Example:
BusinessQueryLov businessQueryLov = businessLayerFactory.createBusinessQueryLov("BusinessQueryLov", businessLayer);
businessQueryLov.setDescription("Description of BusinessQueryLov");
...
name - The name of the list of valuesbusinessLayer - The business layerBusinessQueryLov objectLov.setDescription(String)Parameter createParameter(java.lang.String name, DataFoundation dataFoundation)
Example:
Parameter parameter = businessLayerFactory.createParameter("prompt", dataFoundation);
parameter.setUserPrompted(true);
parameter.setPromptText(parameter.getName());
parameter.setDataType(LovParameterDataType.STRING);
...
parameter.setAssociatedLov(staticLov.getColumns().get(1));
name - The parameter namedataFoundation - The data foundationParameter objectParameter.setUserPrompted(boolean),
Parameter.setPromptText(String),
Parameter.setDataType(LovParameterDataType),
Parameter.setAssociatedLov(Object),
StaticLov.getColumns()SingleValueAnswer createSingleValueAnswer()
SingleValueAnswer objectMultipleValueAnswer createMultipleValueAnswer()
MultipleValueAnswer objectIntervalAnswer createIntervalAnswer()
Example:
...
IntervalAnswer answer = businessLayerFactory.createIntervalAnswer();
answer.setLowValue(businessLayerFactory.createStringValue("value1"));
answer.setHighValue(businessLayerFactory.createStringValue("value2"));
IntervalAnswer objectcreateStringValue(String),
IntervalAnswer.setLowValue(TypedValue),
IntervalAnswer.setHighValue(TypedValue)StringValue createStringValue(java.lang.String value)
value - The answer valueStringValue objectDateValue createDateValue(java.util.Date value)
value - The answer valueDateValue objectNumericValue createNumericValue(java.lang.Double value)
value - The answer valueNumericValue objectHierarchicalValue createHierarchicalValue()
HierarchicalValue objectParameter createParameter(java.lang.String name, BusinessLayer businessLayer)
Example:
Parameter parameter = businessLayerFactory.createParameter("prompt", businessLayer);
parameter.setUserPrompted(true);
parameter.setPromptText(parameter.getName());
parameter.setDataType(LovParameterDataType.STRING);
...
parameter.setAssociatedLov(staticLov.getColumns().get(1));
name - The parameter namebusinessLayer - The business layer to which the parameter is addedParameter objectParameter.setUserPrompted(boolean),
Parameter.setPromptText(String),
Parameter.setDataType(LovParameterDataType),
Parameter.setAssociatedLov(Object),
StaticLov.getColumns()AggregateIncompatibility createAggregateIncompatibility(RelationalBusinessLayer businessLayer)
Example:
AggregateIncompatibility aggregateIncompatibility = businessLayerFactory.createAggregateIncompatibility(businessLayer); aggregateIncompatibility.setTableName(dataFoundationService.getTableFullName(table));
businessLayer - The business layer to which the incompatibility is addedAggregateIncompatibility objectNavigationPath createNavigationPath(java.lang.String name, BusinessLayer businessLayer)
Example:
NavigationPath navigationPath = businessLayerFactory.createNavigationPath("NavigationPath", businessLayer);
navigationPath.setDescription("My description of NavigationPath");
Dimension dimension = (Dimension) businessLayerService.getBlItem(businessLayer, "Dimperiod\\Date", true);
navigationPath.getDimensions().add(dimension);
name - The name of the navigation pathbusinessLayer - The business layer to which the navigation path is addedNavigationPath objectPredefinedDateTimeFormat createPredefinedDateTimeFormat(BusinessObject businessObject)
Example:
PredefinedDateTimeFormat dateTimeFormat = businessLayerFactory.createPredefinedDateTimeFormat(businessObject); dateTimeFormat.setFormat(PredefinedDateTimeFormatTypes.ShortDate););
businessObject - The business object to which the date format is setPredefinedDateTimeFormat objectCustomDateTimeFormat createCustomDateTimeFormat(BusinessObject businessObject)
Example:
CustomDateTimeFormat dateTimeFormat = businessLayerFactory.createCustomDateTimeFormat(businessObject);
dateTimeFormat.setDateTimeFormat().setFormat("mm'/'yyyy");
dateTimeFormat.setDateTimeFormat().setColor(FormatColor.RED);
dateTimeFormat.setUndefinedFormat().setFormat("Date error");
businessObject - The business object to which the date format is setCustomDateTimeFormat objectPredefinedNumberFormat createPredefinedNumberFormat(BusinessObject businessObject)
Example:
PredefinedNumberFormat numberFormat = businessLayerFactory.createPredefinedNumberFormat(businessObject); numberFormat.setFormat(PredefinedNumberFormatTypes.Boolean);
businessObject - The business object to which the number format is setPredefinedNumberFormat objectCustomNumberFormat createCustomNumberFormat(BusinessObject businessObject)
Example:
CustomNumberFormat numberFormat = businessLayerFactory.createCustomNumberFormat(businessObject);
numberFormat.getPositiveFormat().setFormat("-#");
numberFormat.getNegativeFormat().setFormat("-#");
numberFormat.getNegativeFormat().setColor(FormatColor.RED);
numberFormat.getZeroFormat().setFormat("-#");
numberFormat.getUndefinedFormat().setFormat("Number error");
businessObject - The business object to which the number format is setCustomNumberFormat objectQueryScriptProperty createQueryScriptProperty(java.lang.String key, java.lang.String value, BusinessLayer businessLayer)
Example:
queryScriptProperty businessLayerFactory.createQueryScriptProperty("MyKey", "MyValue");
...
key - The key of the query script propertyvalue - The value of the query script propertybusinessLayer - The business layer to which the custom query script property is addedQueryScriptProperty objectConversionOptions createConversionOptions()
Example:
conversionOptions businessLayerFactory.createConversionOptions(); ...
ConversionOptions object