Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
templatizedUrl.indexOf("/", iSep + 2),
templatizedUrl.lastIndexOf("=") + 1
) +
itemTemplate.item.id; // templatized id
portalUrl = templatizedUrl.replace(
templatizedUrl.substring(templatizedUrl.indexOf("/", iSep + 2)),
""
);
}
// Extract dependencies
itemTemplate.dependencies = _extractDependencies(itemTemplate);
// Set the folder
common.setProp(itemTemplate, "data.folderId", "{{folderId}}");
// Set the map or group after we've extracted them as dependencies
_templatizeIdPaths(itemTemplate, [
"data.map.itemId",
"data.map.appProxy.mapItemId",
"data.appItemId",
"data.values.webmap",
"data.values.group"
]);
setValues(
itemTemplate,
[
"data.logo",
"data.map.portalUrl",
"data.portalUrl",
"data.httpProxy.url"
obj.layerDefinition,
ds.basePath,
fieldNames
);
common._templatizeDefinitionExpression(
obj.layerDefinition,
ds.basePath,
fieldNames
);
}
// used for applicationProperties search layers
const fieldName: any = common.getProp(obj, "field.name");
if (fieldName) {
common.setProp(
obj,
"field.name",
common._templatizeFieldName(fieldName, obj, ds.itemId, ds.basePath)
);
}
}
});
];
paths.forEach(path => {
const widgets = common.getProp(solutionTemplate, path);
if (widgets) {
common.setProp(
solutionTemplate,
path,
_templatizeObjectArray(widgets, datasourceInfos)
);
}
});
// handle values common for web app templates
const values: any = common.getProp(solutionTemplate, "data.values");
if (values) {
common.setProp(
solutionTemplate,
"data.values",
_templatizeObject(values, datasourceInfos)
);
}
return solutionTemplate;
}
"data.values.webmap",
"data.values.group"
]);
setValues(
itemTemplate,
[
"data.logo",
"data.map.portalUrl",
"data.portalUrl",
"data.httpProxy.url"
],
common.PLACEHOLDER_SERVER_NAME
);
common.setProp(
itemTemplate,
"data.geometryService",
common.PLACEHOLDER_GEOMETRY_SERVER_NAME
);
templatizeDatasources(itemTemplate, authentication, portalUrl).then(
() => {
templatizeWidgets(
itemTemplate,
authentication,
portalUrl,
"data.widgetPool.widgets"
).then(
_itemTemplate => {
templatizeWidgets(
_itemTemplate,
export function _templatize(
itemTemplate: common.IItemTemplate,
path: string,
datasourceInfos: common.IDatasourceInfo[]
) {
const obj: any[] = common.getProp(itemTemplate, path);
if (obj) {
common.setProp(
itemTemplate,
path,
_templatizeByDatasource(obj, datasourceInfos)
);
}
}
response => {
common.setProp(itemTemplate, widgetPath, JSON.parse(response));
resolve(itemTemplate);
},
e => reject(common.fail(e))
paths.forEach(path => {
const url: string = common.getProp(itemTemplate, path);
if (url) {
const subString: string = url.substring(
url.indexOf("/", url.indexOf("//") + 2)
);
common.setProp(
itemTemplate,
path,
subString !== url ? base + subString : base
);
}
});
}
paths.forEach(path => {
const id: any = common.getProp(itemTemplate, path);
common.setProp(
itemTemplate,
path,
common.templatizeTerm(id, id, ".itemId")
);
});
}
response => {
common.setProp(itemTemplate, widgetPath, JSON.parse(response));
resolve(itemTemplate);
},
e => reject(common.fail(e))