- Source:
The stateManager
factory is a service controlling states content.
Methods
(private, inner) addLink(arrKeys)
- Source:
Add hyperlink to arrays of key. The hyperlink === first key of keys array
Parameters:
Name | Type | Description |
---|---|---|
arrKeys |
Array | array of arrays [[keys], valid: true | false, hlink: 'id'] |
(private, inner) addSpecific(arrKeys, modelName) → {Array}
- Source:
Add specific keys so missing tabs can be part of the summary
Parameters:
Name | Type | Description |
---|---|---|
arrKeys |
Array | array of object {key: [], valid: true | false} |
modelName |
String | modelName |
Returns:
updated keys array
- Type
- Array
(private, inner) buildStateTree(state, element, arrKeys, mainSection)
- Source:
Create state object from model/form for the summary panel
Parameters:
Name | Type | Description |
---|---|---|
state |
Object | the state object in JSON |
element |
String | the current element name |
arrKeys |
Array | array of arrays [[keys], valid: true | false, hlink: 'id'] |
mainSection |
Number | ['map':1 | 'ui':2 | 'services':3 | 'version':4 | 'language':5] |
(private, inner) existInStateModel(stateModel, keys, exist)
- Source:
Look for the existence of a path in the stateModel
Parameters:
Name | Type | Description |
---|---|---|
stateModel |
Object | the stateModel |
keys |
Array | set of keys defining a path |
exist |
Array | true if the path exist |
(private, inner) findTitle(key, itemForm, arrForm)
- Source:
Search for the title corresponding to the provided key Ref: https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript?page=1&tab=votes#tab-top
Parameters:
Name | Type | Description |
---|---|---|
key |
key | the key to look for (could be an array) |
itemForm |
Object | a form item |
arrForm |
Array | the form as an array of objects |
(inner) getState(modelName) → {Object}
- Source:
Get state object
Parameters:
Name | Type | Description |
---|---|---|
modelName |
Object | the model/form name to get state on |
Returns:
the state object in JSON
- Type
- Object
(private, inner) getValidityValue(key, index, arrKeys) → {Boolean}
- Source:
Get validity from an item in a list Currently works only with baseMaps, layers, tileSchemas, extentSets, lodSets
Parameters:
Name | Type | Description |
---|---|---|
key |
String | key to select the proper list |
index |
Number | index in the form |
arrKeys |
Array | array of object {key: [], valid: true | false} |
Returns:
validity
- Type
- Boolean
(inner) goNoGoPreview() → {Boolean}
- Source:
Check validity of state sections
Returns:
the go or no go
- Type
- Boolean
(private, inner) isValid(arrKeys) → {Boolean}
- Source:
Return validity
Parameters:
Name | Type | Description |
---|---|---|
arrKeys |
Array | array of arrays [[keys], valid: true | false, hlink: 'id'] |
Returns:
return false if there's at least one false in validity array
- Type
- Boolean
(private, inner) listAdvanceHidden(arrForm, list)
- Source:
List of hidden advance parameters
Parameters:
Name | Type | Description |
---|---|---|
arrForm |
Array | the form as an array of objects |
list |
Array | list of hidden advance parameters |
(private, inner) reduceKey(arrKeys, keys) → {Array}
- Source:
Reduce map array to simplify hierarchy
Parameters:
Name | Type | Description |
---|---|---|
arrKeys |
Array | array of object {key: [], valid: true | false} |
keys |
Array | keys |
Returns:
reduced keys array
- Type
- Array
(private, inner) reduceMapArray(arrKeys) → {Array}
- Source:
Reduce map array to simplify hierarchy
Parameters:
Name | Type | Description |
---|---|---|
arrKeys |
Array | array of object {key: [], valid: true | false} |
Returns:
reduced keys array
- Type
- Array
(private, inner) removeNonExistent(stateModel, modelName, keysIn, keysOut)
- Source:
Remove keys if they don't exist in the stateModel
Parameters:
Name | Type | Description |
---|---|---|
stateModel |
Object | the stateModel |
modelName |
String | modelName |
keysIn |
Array | list of original keys [[keys], valid] |
keysOut |
Array | list of update keys [[keys], valid] |
(private, inner) searchUndefined(modelKeys, model, arrKeys)
- Source:
List undefined attributes
Parameters:
Name | Type | Description |
---|---|---|
modelKeys |
Array | the model name path |
model |
Object | the model |
arrKeys |
Array | array of keys |
(private, inner) setAdvance(stateModel, modelName, arrKeys)
- Source:
Set advance parameter in state model All element and sub-element will have 'advance' parameter set to true
Parameters:
Name | Type | Description |
---|---|---|
stateModel |
Object | the stateModel |
modelName |
String | modelName |
arrKeys |
Array | list of advance parameter keys |
(private, inner) setCustomTitles(stateModel, modelName)
- Source:
Retrieve the title corresponding to the provided key
Parameters:
Name | Type | Description |
---|---|---|
stateModel |
Object | the stateModel |
modelName |
String | modelName |
(private, inner) setItemId(hlink, elType, index) → {String}
- Source:
Set the item id in the DOM and return the id
Parameters:
Name | Type | Description |
---|---|---|
hlink |
String | subTab link |
elType |
String | element type {'baseMaps'|'layers'} |
index |
Number | rank in elements list |
Returns:
id
- Type
- String
(private, inner) setMapItemsState(stateModel, model, arrKeys)
- Source:
Set new record for map items in state model
Parameters:
Name | Type | Description |
---|---|---|
stateModel |
Object | the stateModel |
model |
Object | the model |
arrKeys |
Array | array of object {key: [], valid: true | false} |
(private, inner) setMasterValidity(state)
- Source:
Set validity on master element of the model
Parameters:
Name | Type | Description |
---|---|---|
state |
Object | the state object in JSON |
(private, inner) setStateValueDown(stateModel, param, value)
- Source:
Set a parameter value for an element of the state model and all is children
Parameters:
Name | Type | Description |
---|---|---|
stateModel |
Object | the stateModel |
param |
String | parameter name |
value |
Object | value to give to parameter |
(private, inner) setStateValueUp(stateModel, path, param, value)
- Source:
Set a parameter value for an element of the state model and all parents
Parameters:
Name | Type | Description |
---|---|---|
stateModel |
Object | the stateModel |
path |
Array | path from root to element ['root','child','grandchild=element'] |
param |
String | parameter name |
value |
Object | value to give to parameter |
(private, inner) setTitle(stateModel, arrForm)
- Source:
Retrieve the title corresponding to the provided key
Parameters:
Name | Type | Description |
---|---|---|
stateModel |
Object | the stateModel |
arrForm |
Array | the form as an array of objects |
(private, inner) uniqId(arrKeys) → {String}
- Source:
Return a unique id
Parameters:
Name | Type | Description |
---|---|---|
arrKeys |
Array | array of arrays [[keys], valid: true | false, hlink: 'id'] |
Returns:
id
- Type
- String
(private, inner) updateSummaryForm(state, modelName, form, list)
- Source:
Create state object from model/form for the summary panel
Parameters:
Name | Type | Description |
---|---|---|
state |
Object | the state object in JSON |
modelName |
String | the current model name |
form |
Object | the form object in JSON |
list |
Object | hidden advance parameters list |
(private, inner) updateSummaryFormMap(state, modelName, form) → {Array}
- Source:
Create state object from model/form for the map section of the summary panel
Parameters:
Name | Type | Description |
---|---|---|
state |
Object | the state object in JSON |
modelName |
String | the current model name |
form |
Object | the form object in JSON |
Returns:
arrKeys array of object {key: [], valid: true | false}
- Type
- Array
(private, inner) updateValidity(stateModel, modelName, undefKeys)
- Source:
Set undefined parameter in state model and update validity of upper hierarchy
Parameters:
Name | Type | Description |
---|---|---|
stateModel |
Object | the stateModel |
modelName |
String | modelName |
undefKeys |
Array | list of advance parameter keys |
(inner) validateModel(modelName, form, arrForm, model)
- Source:
Set state object with valid values from the form field validity
Parameters:
Name | Type | Description |
---|---|---|
modelName |
String | the model/form name to get state on |
form |
Object | the angular schema form active form |
arrForm |
Array | the form as an array of objects |
model |
Object | the model |