Namespace: factory

bcdui. factory

Most parts of this package are not intended to be used from JavaScript and thus not part of the API documentation.

The factory package implements the functionality necessary to use BCD-UI objects in the context of jsp, XSLT-templates and XAPI and widget XPath expressions, in other words, wherever objects are connected by id rather than by providing JavaScript objects.

The main difference between JavaScript and declarative contexts are that

  • All objects are identified and connected by a string id rather than by JavaScript references. For this reason, all objects created by the factory are registered automatically.
  • Second, it is allowed for objects to be created in an order following HTML output, as for example jsp tags are put into their output place. This leads to situations, where an object receives an object as input, which is only defined further down, something that cannot happen in JavaScript. Therefore the factories in here delay the object creation until all objects ot depends on are defined.

Classes

ObjectRegistry

Members

static,constantbcdui.factory.objectRegistrybcdui.factory.ObjectRegistry

This is a singleton object of type (bcdui.factory.ObjectRegistry) where instances of bcdui.core.DataProvider can be registered by their globally unique id. It allows listeners to wait for these registrations so that they can safely access these objects no matter which time they are created at. Therefore it plays a vital role in the development of robust code and for the creation of a higher abstraction layer like JSP markup.

Methods

staticbcdui.factory.createDataProviderWithXPath()

factory/factoryPackage.js, line 85
Creates a dataprovider from an xPath, its value is the evaluated xPath

staticbcdui.factory.executeXSLT(args)

factory/factoryPackage.js, line 797
Executes a transformation chain producing an XML document. Then it replaces the XML document of the specified target DataProvider with the generated XML document. This is useful when the target DataProvider should be initialized with some client-side computed values. The behavior of the function is similar to the createModelWrapper function and therefore it inherits all parameters from it. The only additional parameter required is the "targetModel" parameter described below.
Name Type Description
args The parameter map
Name Type Description
targetModel bcdui.core.DataProvider | SymLink | String The ID of the Model (DataProvider) whose content is supposed to be transformed.
chain bcdui.core.DataProvider | SymLink | String optional from modelWrapper - A DataProvider (or SymLink or its ID) which contains the list of style sheets that make up the transformation chain of this renderer. This DataProvider must contain an XML document satisfying the XML Schema 'chain-1.0.0.xsd'. The 'url' and 'chain' parameters are mutually exclusive.
url String optional from modelWrapper - This parameter can be set when the renderer should only apply one single XSLT style sheet. It contains the URL pointing to it. If this parameter is set the 'chain' parameter must be omitted.
inputModel bcdui.core.DataProvider | SymLink optional from modelWrapper - The DataProvider instance that becomes the input of the transformation chain. If omitted the first element of the dataProviders[] array is the input.
dataProviders bcdui.core.DataProvider | Array.<SymLink> optional from modelWrapper - An array of DataProviders passed to the transformation chain. These data providers can be access in the transformation style sheets with xsl:param.
parameters Object optional from modelWrapper - A mapping from parameter names to DataProviders (or SymLinks) which are passed to the transformation chain. This is a more convenient way to pass parameters compared to the dataProviders array.
Example
bcdui.factory.executeXSLT({
        targetModel    : myModel,
        url            : "../../insertValues.xslt",
        parameters     : { rowCount: 5 },
      });