|
@@ -1794,7 +1794,8 @@ function graphFetchData(node, nameSection) {
|
|
|
// resolve: 'all',
|
|
|
// resolveDepth: 2
|
|
|
'ogc:Filter': '<wfs:Query>' + '\n' + [
|
|
|
- 'ID', // '*'
|
|
|
+ 'ID',
|
|
|
+ // '*',
|
|
|
'default_db__x3A__BI_audit_ENERGA_PRACOWNICY_adresy:BI_audit_ENERGA_PRACOWNICY_adresy/*',
|
|
|
[
|
|
|
'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
@@ -1802,6 +1803,24 @@ function graphFetchData(node, nameSection) {
|
|
|
'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI'
|
|
|
].join('/'),
|
|
|
+ [
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
+ 'default_db__x3A__BI_audit_KRS:BI_audit_KRS'
|
|
|
+ ].join('/'),
|
|
|
+ [
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
+ 'default_db__x3A__BI_audit_MSIG:BI_audit_MSIG'
|
|
|
+ ].join('/'),
|
|
|
+ [
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row',
|
|
|
+ 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
+ 'default_db__x3A__BI_audit_CEIDG:BI_audit_CEIDG'
|
|
|
+ ].join('/'),
|
|
|
[
|
|
|
'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
'ID',
|
|
@@ -1985,6 +2004,7 @@ function parseResponseRec(_todoGraphData, json, typeName, parentNodeId, level) {
|
|
|
var level = level || 0
|
|
|
var parentNodeId = parentNodeId || null
|
|
|
if(DBG)console.log('DBG::parseResponseRec', {json:json, typeName:typeName, parentNodeId:parentNodeId, isString: p5Utils__isString(json), isArray: p5Utils__isArray(json), isObject: p5Utils__isObject(json)});
|
|
|
+ console.log('DBG::parseResponseRec', {json:json, typeName:typeName, parentNodeId:parentNodeId, isString: p5Utils__isString(json), isArray: p5Utils__isArray(json), isObject: p5Utils__isObject(json)});
|
|
|
if (p5Utils__isArray(json)) {
|
|
|
// TODO: create named group
|
|
|
var isXlinkList = (json.length > 0 && p5Utils__isString(json[0]))
|
|
@@ -2005,11 +2025,11 @@ function parseResponseRec(_todoGraphData, json, typeName, parentNodeId, level) {
|
|
|
typeName: typeName,
|
|
|
primaryKey: (json['ID']) ? json['ID'] : null, // TODO: get primaryKey from object
|
|
|
})
|
|
|
+ var nodeId = nodeObject.id
|
|
|
|
|
|
if ("default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object" !== typeName
|
|
|
&& "default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row" !== typeName
|
|
|
) {
|
|
|
- var nodeId = nodeObject.id
|
|
|
_todoGraphData[level].nodes.push(nodeObject)
|
|
|
if (parentNodeId) {
|
|
|
_todoGraphData[level].edges.push(dataMakeEdge(parentNodeId, nodeObject))
|
|
@@ -2021,6 +2041,45 @@ function parseResponseRec(_todoGraphData, json, typeName, parentNodeId, level) {
|
|
|
var value = json[fieldName]
|
|
|
parseResponseRec(_todoGraphData, value, fieldName, nodeId, level + 1)
|
|
|
})
|
|
|
+ } else if ("default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row" === typeName) {
|
|
|
+ // 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row',
|
|
|
+ // 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object',
|
|
|
+ // 'default_db__x3A__BI_audit_KRS:BI_audit_KRS' --> Kontrahenci
|
|
|
+ var rowObjectChildrens = []
|
|
|
+ var rowTN = 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row'
|
|
|
+ var rowObjTN = 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object'
|
|
|
+ // { row: row_obj: [ { ID, kontr: [ "http...kontr.ID" ] }, { ID, kontr: [ "http...krs.ID" ] } ], ... }
|
|
|
+ var rowJson = json
|
|
|
+ if (rowJson[rowObjTN] && rowJson[rowObjTN].length > 1) {
|
|
|
+ var pathItems = []
|
|
|
+ rowJson[rowObjTN].forEach(function (rowObjJson) {
|
|
|
+ Object.keys(rowObjJson)
|
|
|
+ .filter(function (rowObjFld) { return (-1 !== rowObjFld.indexOf(':')); })
|
|
|
+ .filter(function (rowObjRefFld) { return (rowObjJson[rowObjRefFld] && rowObjJson[rowObjRefFld].length); })
|
|
|
+ .forEach(function (rowObjRefFld) {
|
|
|
+ pathItems.push([ rowObjRefFld, rowObjJson[rowObjRefFld][0] ])
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // console.log('pathItems:', pathItems);
|
|
|
+ var lastParentFid = null
|
|
|
+ pathItems.reverse().forEach(function (pathItem) {
|
|
|
+ var nodeObject = dataMakeXlinkNode({
|
|
|
+ xlink: pathItem[1],
|
|
|
+ typeName: pathItem[0]
|
|
|
+ })
|
|
|
+ // _todoGraphData[todoLevel].nodes.push(nodeObject) // already added below
|
|
|
+ if (lastParentFid) _todoGraphData[level].edges.push(dataMakeEdge(lastParentFid, nodeObject))
|
|
|
+ lastParentFid = nodeObject.id
|
|
|
+ })
|
|
|
+
|
|
|
+ Object.keys(json).filter(function (fieldName) {
|
|
|
+ return (fieldName.indexOf(':') > -1)
|
|
|
+ })
|
|
|
+ .forEach(function (fieldName) {
|
|
|
+ var value = json[fieldName]
|
|
|
+ parseResponseRec(_todoGraphData, value, fieldName, parentNodeId, level + 1)
|
|
|
+ })
|
|
|
} else {
|
|
|
Object.keys(json).filter(function (fieldName) {
|
|
|
return (fieldName.indexOf(':') > -1)
|
|
@@ -2046,7 +2105,6 @@ function parseResponseXlinkListRec(_todoGraphData, json, typeName, parentNodeId,
|
|
|
var nodeObject = dataMakeXlinkNode({
|
|
|
xlink: json,
|
|
|
typeName: typeName,
|
|
|
- primaryKey: (json['ID']) ? json['ID'] : null, // TODO: get primaryKey from object
|
|
|
})
|
|
|
_todoGraphData[level].nodes.push(nodeObject)
|
|
|
if (parentNodeId) {
|