lib-bb-portal-model-parser
Version: 1.0.0
Example
;// browserconst DOMParser = windowDOMParser;// Node.js; const stringToDoc = ;const stringToJs jsToString normalize formalize } = ; let xmlString = '<...>';const normalized = ;const bbModel = normalizeditems0model; const name = bbModelname;const extends = bbModelextendedItemName;const title = bbModelproperties value;const isCatalog = bbModeltags; bbModeltags; xmlString = ;
Table of Contents
- Exports
default(stringToDoc) - Type Definitions
ParserAPI
Normalize(xmlString)
Formalize(normalized)
Normalized
ViewHint
Property
Tag
Exports
default(stringToDoc)
Parameter | Type | Description |
---|---|---|
stringToDoc | Function | A function that converts XML string to DOM Document |
Returns
ParserAPI - API of the model parser
Type Definitions
ParserAPI
Type: Object
Property | Type | Description |
---|---|---|
stringToJs | Function | Converts XML string to JXON object |
jsToString | Function | Converts JXON object to XML string |
normalize | Normalize | Converts XML string with item to Normalized object. |
formalize | Formalize | Converts Normalized portal model object to XML string |
Normalize(xmlString)
Parameter | Type | Description |
---|---|---|
xmlString | String |
Returns
Normalized - Normalized model
Formalize(normalized)
Parameter | Type | Description |
---|---|---|
normalized | Normalized | Normalized model |
Returns
String - xml string
Normalized
Type: Object
Property | Type | Description |
---|---|---|
tag | String | Tag name of the first element |
attributes | Object | Hash of first element attributes |
model | Object | Hash of first descendant property name/value pairs |
items | Array of Normalized | Array of descendant Normalized items |
ViewHint
Type: Object
Property | Type | Description |
---|---|---|
designMode | Boolean (optional) | |
role | String (optional) | admin, manager, user, none |
input | String (optional) | text-input, checkbox, select-one |
order | Number (optional) |
Property
Type: Object
Property | Type | Description |
---|---|---|
name | String | Name of the property |
value | String | |
valueType | String (optional) | |
label | String (optional) | |
manageable | String (optional) | |
readonly | String (optional) | |
itemName | String (optional) | |
viewHint | ViewHint (optional) |
Tag
Type: Object
Property | Type | Description |
---|---|---|
value | String | |
type | String (optional) | |
blacklist | String (optional) | |
manageable | String (optional) |