1 karl 1.2.2.2 /*!LICENSE
2 *
3 * Licensed to The Open Group (TOG) under one or more contributor license
4 * agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 * this work for additional information regarding copyright ownership.
6 * Each contributor licenses this file to you under the OpenPegasus Open
7 * Source License; you may not use this file except in compliance with the
8 * License.
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
16 *
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 karl 1.2.2.2 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 *
28 */
29
30 configURL = "root%2FPG_InterOp/enum?class=cim_indicationsubscription";
31 currentElement = null;
32
33 function insertindicationRow(info, handler, filter, state, ref) {
34 var t_rows = document.getElementById('indicationTable').rows;
35
36
37 var x=1;
38
39 for (x=1; x < t_rows.length; x++) {
40 var celValue = t_rows[x].cells[0].textContent;
41 if (name < celValue) {
42 break;
43 karl 1.2.2.2 }
44 }
45
46
47 var t_row = document.getElementById('indicationTable').insertRow(x);
48 t_row.id = "row_" + ref;
49 var t_info =t_row.insertCell(0);
50 var t_handler = t_row.insertCell(1);
51 var t_filter =t_row.insertCell(2);
52 var t_state = t_row.insertCell(3);
53
54
55
56 refArray[name] = ref;
57
58 t_info.innerHTML=info;
59 t_handler.innerHTML=handler;
60 t_filter.innerHTML=filter;
61 t_state.innerHTML = state;
62 }
63
64 karl 1.2.2.2
65 /**
66 * Writes received content on page.
67 */
68 function writeContent(data) {
69 //define a global variable to store property names and corresponding $ref values
70 refArray = new Array();
71
72 var processList = JSON.parse(data);
73 var indicationList=processList.instances;
74 var i=0;
75 for (i=0; i < indicationList.length; i++) {
76 insertindicationRow(decodeURIComponent(indicationList[i].properties.SubscriptionInfo),
77 decodeURIComponent(indicationList[i].properties.Handler),
78 decodeURIComponent(indicationList[i].properties.Filter),
79 decodeURIComponent(indicationList[i].properties.SubscriptionState));
80 }
81 //change background color for every second row to improve readability
82 var t_rows = document.getElementById('indicationTable').rows;
83 var x;
84 for (x=0; x < t_rows.length; x+=2) {
85 karl 1.2.2.2 document.getElementById('indicationTable').rows[x].style.background = "#EEEEEE";
86 document.getElementById('indicationTable').rows[x+1].style.background = "#E0E0E0";
87 }
88
89
90 }
91
92 /**function to delete all rows of a table except the head row
93 * afterwards a new request is send to get the lastet data and the table can be rebuilt
94 */
95 function reloadTable(table)
96 {
97 var rows = table.rows;
98 var rowCount = rows.length;
99 for (var i = rowCount-1; i > 0; i--)
100 {
101 table.deleteRow(i);
102 }
103 //default case, change it to redraw another table
104 genericRequest('root%2FPG_InterOp/enum?class=CIM_IndicationSubscription', writeContent, true);
105
106 karl 1.2.2.2 }
107
108
|