2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2016-2018 Ericsson. All rights reserved.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 function contextAlbumTab_reset() {
22 contextAlbumTab_deactivate();
23 contextAlbumTab_activate();
26 function contextAlbumTab_activate() {
27 contextAlbumTab_create();
29 var requestURL = restRootURL + "/ContextAlbum/Get?name=&version=";
31 ajax_get(requestURL, function(data) {
32 $("#contextAlbumTableBody").find("tr:gt(0)").remove();
34 for (var i = 0; i < data.messages.message.length; i++) {
35 var contextAlbum = JSON.parse(data.messages.message[i]).apexContextAlbum;
37 var contextAlbumRow_tr = document.createElement("tr");
38 var contextAlbumid = contextAlbum.key.name + ":" + contextAlbum.key.version;
41 var contextAlbumTableRow =
43 contextAlbum.key.name + ":" + contextAlbum.key.version +
49 contextAlbum.isWritable +
52 contextAlbum.itemSchema.name + ":" + contextAlbum.itemSchema.version +
55 contextAlbumRow_tr.innerHTML = contextAlbumTableRow;
56 contextAlbumRow_tr.addEventListener('contextmenu', rightClickMenu_scopePreserver("contextAlbumTabContent", "contextAlbum", contextAlbum.key.name, contextAlbum.key.version));
58 $("#contextAlbumTableBody").append(contextAlbumRow_tr);
64 function contextAlbumTab_deactivate() {
65 apexUtils_removeElement("contextAlbumTabContent");
68 function contextAlbumTab_create() {
69 var contextAlbumTab = document.getElementById("contextAlbumsTab");
71 var contextAlbumTabContent = document.getElementById("contextAlbumTabContent");
72 if (contextAlbumTabContent != null) {
76 var contextAlbumTabContent = document.createElement("contextAlbumTabContent");
77 contextAlbumTab.appendChild(contextAlbumTabContent);
78 contextAlbumTabContent.setAttribute("id", "contextAlbumTabContent");
79 contextAlbumTabContent.addEventListener('contextmenu', rightClickMenu_scopePreserver("contextAlbumTabContent", "contextAlbum",null, null));
81 var contextAlbumTable = createTable("contextAlbumTable");
82 contextAlbumTabContent.appendChild(contextAlbumTable);
84 var contextAlbumTableHeader = document.createElement("thead");
85 contextAlbumTable.appendChild(contextAlbumTableHeader);
86 contextAlbumTableHeader.setAttribute("id", "contextAlbumTableHeader");
88 var contextAlbumTableHeaderRow = document.createElement("tr");
89 contextAlbumTableHeader.appendChild(contextAlbumTableHeaderRow);
90 contextAlbumTableHeaderRow.setAttribute("id", "contextAlbumTableHeaderRow");
92 var contextAlbumTableKeyHeader = document.createElement("th");
93 contextAlbumTableHeaderRow.appendChild(contextAlbumTableKeyHeader);
94 contextAlbumTableKeyHeader.setAttribute("id", "contextAlbumTableKeyHeader");
95 contextAlbumTableKeyHeader.appendChild(document.createTextNode("Context Album"));
97 var contextAlbumTableScopeHeader = document.createElement("th");
98 contextAlbumTableHeaderRow.appendChild(contextAlbumTableScopeHeader);
99 contextAlbumTableScopeHeader.setAttribute("id", "contextAlbumTableScopeHeader");
100 contextAlbumTableScopeHeader.appendChild(document.createTextNode("Scope"));
102 var contextAlbumTableWriteableHeader = document.createElement("th");
103 contextAlbumTableHeaderRow.appendChild(contextAlbumTableWriteableHeader);
104 contextAlbumTableWriteableHeader.setAttribute("id", "contextAlbumTableWritableHeader");
105 contextAlbumTableWriteableHeader.appendChild(document.createTextNode("Writable"));
107 var contextAlbumTableItemSchemaHeader = document.createElement("th");
108 contextAlbumTableHeaderRow.appendChild(contextAlbumTableItemSchemaHeader);
109 contextAlbumTableItemSchemaHeader.setAttribute("id", "contextAlbumTableItemSchemaHeader");
110 contextAlbumTableItemSchemaHeader.appendChild(document.createTextNode("Item Schema"));
112 var contextAlbumTableBody = document.createElement("tbody");
113 contextAlbumTable.appendChild(contextAlbumTableBody);
114 contextAlbumTable.setAttribute("id", "contextAlbumTableBody");