Namespace: core

bcdui. core

This namespace encapsulates consists of the lower layer of BCDUI core functionality. It is composed of three blocks of functionality:

Core Classes

The core classes are the foundation for most BCDUI objects on the page. The processes these objects are reflecting are running asynchronously and implemented in the form of a state-machine behaviour. The central interface for these classes is the bcdui.core.DataProvider interface.

Page Lifecycle Support

These are functions dealing with the loading of XML and creating and executing XSLT, provided by the central bcdui.core.xmlLoader object. Additionally there are function for managing page status. This status is encapsulated in the guiStatus object which can be compressed and uncompressed to transport it in URLs and browser bookmarks.

Utility functions

The core package provides lots of utility functions to support XML processing, enhance cross-browser compatibility and to simplify JavaScript development. Most of these functions are located directly under the bcdui.core namespace.

The functions and classes provided here can be used directly or they can be accessed through a higher architecture layer such as the bcdui.factory namespace.

Classes

AbstractExecutable
AbstractUpdatableModel
AsyncJsDataProvider
AutoModel
ConstantDataProvider
DataProvider
DataProviderAlias
DataProviderHolder
DataProviderHtmlAttribute
DataProviderWithXPath
DataProviderWithXPathNodes
HTML2XMLDataProvider
JsDataProvider
ModelUpdater
ModelWrapper
OptionsDataProvider
PromptDataProvider
Renderer
RequestDocumentDataProvider
SimpleModel
StaticModel
Status
StatusEvent
StatusListener
StringDataProvider
TransformationChain

Namespaces

browserCompatibility
compression
event
lifecycle
magicChar
status

Members

static,constantbcdui.core.emptyModel

A fixed empty model which can be used in various cases when the real model is not yet available. The model contains a single root element <Empty/>.

static,constantbcdui.core.webRowSetServletPathString

The full URL to the webRowSet servlet.

static,constantbcdui.core.webRowSetServletPathSessionCachedString

The full URL to the webRowSet servlet at servletsSessionCached path

Methods

staticbcdui.core.createElementWithPrototype(baseElement, path, enableWrsExtensions){Element}

This function works similar to selectSingleNode in that executes an XPath on a DOMDocument or XML element and returns an XML element. However if the element does not exists it creates XML elements on the XPath so that the XPath returns an element afterwards. For example if the document contains only a root element and the path is
       /Root/Filter[@name = 'abc']/Item
it does the following:
  1. create an element "Filter" under the root node,
  2. set an attribute "name" with content "abc" on it,
  3. create an Item under it,
  4. return the Item. So the XPath "/Root/Filter[@name = 'abc']/Item" can be regarded as an XML prototype that is created if the element does not exist.

Please note that this function accepts only a very limited set of XPaths because otherwise the inversion of the XPath would be too complicated to be computed. For example it is not allowed to specify "//" in the XPath and the "or" conjunction cannot be used. If you want to modify an existing wrs cell, bcdui.wrs.wrsUtil.setCellValue might be a more convenient function to use.

Name Type Default Description
baseElement DomDocument | DomElement | bcdui.core.DataProvider The Dataprovider, DOM document or the XML element the path is evaluated on.
path string The XPath identifying the element to be retrieved or created.
enableWrsExtensions boolean true optional Set this flag to "true" if the function should treat wrs elements differently (like converting wrs:R to wrs:M or creating wrs:I elements). It is "true" by default.
Returns:
Type Description
Element The XML element to be found under the specified XPath.

staticbcdui.core.createQueryString(){string}

encode parameters into a query-string
Returns:
Type Description
string the query string, with encoded parameters; this string does not start with '?'

staticbcdui.core.getUrlParameter(url, parameterName, defaultValue){string}

Extracts the value of a parameter definition from the URL. For example if the URL is "http://myHost/myApp/myReport.jsp?guiStatusGZ=abc" and the parameterName is "guiStatusGZ" the return value is "abc".
Name Type Default Description
url string The URL containing the parameter.
parameterName string The parameter name.
defaultValue string null optional The default value when the result would be null. If not specified it returns null if the parameter is not found.
Returns:
Type Description
string The value of the parameter or the default value (usually NULL) if the parameter is empty or not found.

staticbcdui.core.quoteXPathString(str){string}

Quotes a string so that it can be used within an XPath for selectNodes / selectSingleNode. For example the string myValue becomes 'myValue' . The quotes are automatically added so that it is a valid XPath string.
Name Type Description
str string The string to be quotes as an XPath string.
Returns:
Type Description
string The XPath string representing str.

staticbcdui.core.ready(fn)

Registers a callback function to be executed when the browser has finished loading. If the loading has already finished the function is executed immediately.
Name Type Description
fn function The function executed as soon as the browser has finished loading.

staticbcdui.core.reExecute(obj, readyFunction, shouldRefresh)

Reexecutes the process implemented by the concrete sub-class.
Name Type Description
obj Object The abstract executable object which should be reexecuted
readyFunction function optional Function to be executed once on ready status
shouldRefresh boolean optional Set this parameter to "false" if this method should do nothing when the object is already in the ready status.

staticbcdui.core.setUrlParameter(url, parameterName, unEscapedValue, asAnchor, allowMultiple){string}

Replaces a parameter=value definition inside a URL. For example if the url is "/myApp/myReport.jsp?guiStatusGZ=abc&menuId=xyz", the parameterName is "guiStatusGZ" and the unEscapedValue is "newValue" the result will be "/myApp/myReport.jsp?menuId=xyz&guiStatusGZ=newValue". Please note that this function does not preserve the original parameter ordering.
Additionally it can also put parameter definitions in the anchor section of the URL, for example like "/myApp/myReport.jsp?menuId=xyz#guiStatusGZ=bla".
Name Type Default Description
url string The URL where the parameter replacement should be applied.
parameterName string The name of the parameter.
unEscapedValue string The parameter value which must not be escaped. This function escapes it. If this is NULL the parameter definition is removed.
asAnchor boolean false optional A boolean value (which is false by default) indicating if the parameter definition should be placed in the anchor section of the URL.
allowMultiple boolean false optional If set to true, allows multiple occurences of parameter (i.e. resulting in a parsed array on the server)
Returns:
Type Description
string The transformed URL.