2 ================================================================================
4 ================================================================================
5 Copyright (C) 2017 AT&T Intellectual Property
6 ================================================================================
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ================================================================================
20 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataColumnType" %>
21 <%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %>
22 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %>
23 <%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %>
24 <%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %>
25 <%@ page import="java.util.Vector" %>
26 <%@ page import="java.util.List" %>
27 <%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %>
28 <%@ page import="java.util.Iterator" %>
29 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataSourceType" %>
30 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.DBColumnInfo" %>
31 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableSource" %>
32 <%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %>
33 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.SemaphoreType" %>
34 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %>
35 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableJoin" %>
36 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.SecurityEntry" %>
37 <%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %>
40 ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION);
41 WizardSequence ws = rdef.getWizardSequence();
42 String curSubStep = ws.getCurrentSubStep();
44 <table width="100%" class="tableBorder" border="0" cellspacing="1" cellpadding="3" align=center>
46 <td class=rbg1 colspan=4 valign="Middle"><b class=rtableheader>Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %></b></td>
49 <td class=rbg2 align="right" width="16%" height="30"><font class=rtabletext>Created By: </font></td>
50 <td class=rbg3 align="left" width="34%" valign="middle" nowrap><font class=rtabletext><%= AppUtils.getUserName(rdef.getCreateID()) %></font></td>
51 <td class=rbg2 align="right" width="16%"><font class=rtabletext>Created Date: </font></td>
52 <td class=rbg3 align="left" width="34%" valign="middle" nowrap><font class=rtabletext><%= rdef.getCreateDate() %></font></td>
55 <td class=rbg2 align="right" height="30"><font class=rtabletext>Last Updated By: </font></td>
56 <td class=rbg3 align="left" valign="middle" nowrap><font class=rtabletext><%= AppUtils.getUserName(rdef.getUpdateID()) %></font></td>
57 <td class=rbg2 align="right"><font class=rtabletext>Last Updated: </font></td>
58 <td class=rbg3 align="left" valign="middle" nowrap><font class=rtabletext><%= rdef.getUpdateDate() %></font></td>
61 <td class=rbg2 align="right" height="30"><font class=rtabletext>Report Owner: </font></td>
62 <td class=rbg3 align="left"><font class=rtabletext>
63 <select name="reportOwner">
64 <% Vector allUsers = Utils.getUsersNotInList(new java.util.ArrayList(),request);
65 for(int i=0; i<allUsers.size(); i++) {
66 IdNameValue user = (IdNameValue) allUsers.get(i); %>
67 <option value="<%= user.getId() %>"<%= user.getId().equals(rdef.getOwnerID())?" selected":"" %>><%= user.getName() %>
72 <td class=rbg2 align="right"><font class=rtabletext>Public? (All users can run the report)</font></td>
73 <td class=rbg3 align="left">
74 <select name="public" >
75 <option value="Y"<%= rdef.isPublic()?" selected":"" %>>Yes
76 <option value="N"<%= rdef.isPublic()?"":" selected" %>>No
83 <table class="mTAB" width="100%" border="0" cellspacing="1" cellpadding="3" align=center>
85 <td class=rbg1 colspan=5 valign="Middle"><b class=rtableheader>Report Users</b></td>
88 <td align="center" valign="Middle" width="7%" height="30"><b class=rtableheader> No </b></td>
89 <td align="center" valign="Middle" width="59%"><b class=rtableheader>User Name</b></td>
90 <td align="center" valign="Middle" width="10%"><b class=rtableheader>Run Access</b></td>
91 <td align="center" valign="Middle" width="10%"><b class=rtableheader>Edit Access</b></td>
92 <td align="center" valign="Middle" width="14%"><b class=rtableheader>Remove</b></td>
95 Vector reportUsers = rdef.getReportUsers(request);
96 for(Iterator iter=reportUsers.iterator(); iter.hasNext(); iCount++) {
97 SecurityEntry rUser = (SecurityEntry) iter.next(); %>
98 <tr class="<%=((iCount % 2 == 0)?"rowalt1":"rowalt2")%>">
99 <td align="center" height="30"><font class=rtabletext><%= iCount+1 %></font></td>
100 <td><font class=rtabletext><%= rUser.getName() %></font></td>
101 <td align="center" valign="Middle"><img src="<%= AppUtils.getImgFolderURL() %>active.gif" width="16" height="16" border="0"></td>
102 <td align="center" valign="Middle"><input type="image" src="<%= AppUtils.getImgFolderURL() %><%= rUser.isReadOnly()?"inactive.gif":"active.gif" %>" alt="<%= rUser.isReadOnly()?"Grant":"Revoke" %> edit access" width="16" height="16" border="0" onClick="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= rUser.isReadOnly()?AppConstants.WA_GRANT_USER:AppConstants.WA_REVOKE_USER %>'; document.forma.<%= AppConstants.RI_DETAIL_ID %>.value='<%= rUser.getId() %>';"></td>
103 <td align="center"><input type=image border="0" src="<%= AppUtils.getImgFolderURL() %>deleteicon.gif" alt="Remove" width="12" height="12" onClick="if(! confirm('Are you sure you want to remove user <%= rUser.getName() %>?')) {return false;} else {document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_DELETE_USER %>'; document.forma.<%= AppConstants.RI_DETAIL_ID %>.value='<%= rUser.getId() %>'; }"></td>
106 // if(iCount==0) { %>
108 <td colspan=5 align="center" height="30"><font class=rtabletext>No user access defined</font></td>
111 Vector remainingUsers = Utils.getUsersNotInList(reportUsers,request);
112 if(remainingUsers.size()>0) { %>
114 <td class=rbg1 colspan=5 valign="Middle" nowrap><b class=rtableheader>Grant Access To
115 <select name="newUserId" onChange="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_ADD_USER %>'; document.forma.submit();">
116 <option value="" selected>--- Select User ---
117 <% for(int i=0; i<remainingUsers.size(); i++) {
118 IdNameValue user = (IdNameValue) remainingUsers.get(i); %>
119 <option value="<%= user.getId() %>"><%= user.getName() %>
130 <table class="mTAB" width="100%" border="0" cellspacing="1" cellpadding="3" align=center>
132 <td class=rbg1 colspan=5 valign="Middle"><b class=rtableheader>Report Roles</b></td>
135 <td align="center" valign="Middle" width="7%" height="30"><b class=rtableheader> No </b></td>
136 <td align="center" valign="Middle" width="59%"><b class=rtableheader>Role Name</b></td>
137 <td align="center" valign="Middle" width="10%"><b class=rtableheader>Run Access</b></td>
138 <td align="center" valign="Middle" width="10%"><b class=rtableheader>Edit Access</b></td>
139 <td align="center" valign="Middle" width="14%"><b class=rtableheader>Remove</b></td>
142 Vector reportRoles = rdef.getReportRoles(request);
143 for(Iterator iter=reportRoles.iterator(); iter.hasNext(); iCount++) {
144 SecurityEntry rRole = (SecurityEntry) iter.next(); %>
145 <tr class="<%=((iCount % 2 == 0)?"rowalt1":"rowalt2")%>">
146 <td align="center" height="30"><font class=rtabletext><%= iCount+1 %></font></td>
147 <td><font class=rtabletext><%= rRole.getName() %></font></td>
148 <td align="center" valign="Middle"><img src="<%= AppUtils.getImgFolderURL() %>active.gif" width="16" height="16" border="0"></td>
149 <td align="center" valign="Middle"><input type="image" src="<%= AppUtils.getImgFolderURL() %><%= rRole.isReadOnly()?"inactive.gif":"active.gif" %>" alt="<%= rRole.isReadOnly()?"Grant":"Revoke" %> edit access" width="16" height="16" border="0" onClick="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= rRole.isReadOnly()?AppConstants.WA_GRANT_ROLE:AppConstants.WA_REVOKE_ROLE %>'; document.forma.<%= AppConstants.RI_DETAIL_ID %>.value='<%= rRole.getId() %>';"></td>
150 <td align="center"><input type=image border="0" src="<%= AppUtils.getImgFolderURL() %>deleteicon.gif" alt="Remove" width="12" height="12" onClick="if(! confirm('Are you sure you want to remove role <%= rRole.getName() %>?')) {return false;} else {document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_DELETE_ROLE %>'; document.forma.<%= AppConstants.RI_DETAIL_ID %>.value='<%= rRole.getId() %>'; }"></td>
153 // if(iCount==0) { %>
155 <td colspan=5 align="center" height="30"><font class=rtabletext>No role access defined</font></td>
158 Vector remainingRoles = Utils.getRolesNotInList(reportRoles,request);
159 if(remainingRoles.size()>0) { %>
161 <td class=rbg1 colspan=5 valign="Middle" nowrap><b class=rtableheader>Grant Access To
162 <select name="newRoleId" onChange="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_ADD_ROLE %>'; document.forma.submit();">
163 <option value="" selected>--- Select Role ---
164 <% for(int i=0; i<remainingRoles.size(); i++) {
165 IdNameValue role = (IdNameValue) remainingRoles.get(i); %>
166 <option value="<%= role.getId() %>"><%= role.getName() %>
177 <script language="JavaScript">
179 function dataValidate() {