diff --git a/src/main/resources/com/checkpoint/mgmt_api/templates/objects.html.template b/src/main/resources/com/checkpoint/mgmt_api/templates/objects.html.template index f98940b..388afe6 100644 --- a/src/main/resources/com/checkpoint/mgmt_api/templates/objects.html.template +++ b/src/main/resources/com/checkpoint/mgmt_api/templates/objects.html.template @@ -1,201 +1,206 @@ - - Page Title - - - + - - - - - + keyElement.className = "key"; + keyElement.appendChild(document.createTextNode(key + ":")); + + switch (typeOfValue) { + case "[object Object]": + valueElement.className = "object_value"; + printObject(valueOfKey, valueElement, level+1); + break; + case "[object Array]": + valueElement.className = "object_value"; + printArray(valueOfKey, valueElement, level+1); + break; + default: + valueElement.appendChild(document.createTextNode(valueOfKey)); + } + rowElement.appendChild(keyElement); + rowElement.appendChild(valueElement); + tableElement.appendChild(rowElement); + }); + + parentObject.appendChild(tableElement); + } + + function printObjectTitle(obj) { + var headline = document.createElement("h3"); + var anchor = document.createElement("a"); + + var txt = "UID: " + obj["uid"]; + if ("name" in obj) { + txt = "Name: " + obj["name"]; + } + anchor.setAttribute("name", obj["uid"]); + headline.appendChild(document.createTextNode(txt)); + document.body.appendChild(anchor); + document.body.appendChild(headline); + + } + + function getQueryParams(qs) { + qs = qs.split('+').join(' '); + + var params = {}, + tokens, + re = /[?&]?([^=]+)=([^&]*)/g; + + while (tokens = re.exec(qs)) { + params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); + } + + return params; + } + + function printAllObjects() { + sortAndFilterObjects(); + document.title = "Package Objects"; + var previousType = ""; + objects.forEach(function (obj) { + if (obj.type !== previousType) + { + printHeadline(obj.type); + } + + printObjectTitle(obj); + printObject(obj, document.body, 0); + document.body.appendChild(document.createElement("BR")); + + previousType = obj.type; + }); + } + + + + + + +