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.model.definition.ReportDefinition" %>
21 <%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants"%>
22 <%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence"%>
23 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType"%>
24 <%@ page import="java.util.Iterator"%>
25 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.JavascriptItemType"%>
26 <%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils"%>
29 ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION);
30 WizardSequence ws = rdef.getWizardSequence();
31 FormFieldType fft = null;
32 boolean isFormfieldPresent = (rdef.getFormFieldList()!=null && rdef.getFormFieldList().getFormField().size()<=0);
35 <table width="100%" class="tableBorder" border="0" cellspacing="1" cellpadding="3" align=center>
37 <td class=rbg1 valign="top"><b class=rtableheader>Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - <%= ws.getCurrentStep() %> Wizard <%= isFormfieldPresent?" <a href=\"javascript:uitmpl_qh('javascript_text'); if(typeof window.parent.resizeWindow == 'function') window.parent.resizeWindow();\" class=\"qh-link\" style=\"position:fixed;\"></a>":""%></b></td>
39 <% if(isFormfieldPresent) { %>
41 <td class="nopad"><!-- quick help text -->
42 <div id="javascript_text" class="mQH">
43 <p><span class="label">Form Field Information:<BR></span>
47 for(Iterator iter1=rdef.getFormFieldList().getFormField().iterator(); iter1.hasNext();) {
48 fft = (FormFieldType) iter1.next();
51 <%= "<TR><TD align=\"right\">" + fft.getFieldName() +":</TD><TD> </TD><TD>document.formd." + fft.getFieldId()+"</TD></TR>" %>
57 <!-- /quick help text --></td>
61 <td width="65%" class=rbg3 align="center">
62 <textarea name="<%= AppConstants.RI_JAVASCRIPT%>" cols="100" rows="30"><%= (rdef.getJavascriptElement()!=null)?rdef.getJavascriptElement():"" %></textarea>
66 <table class=mTAB width="100%" class="tableBorder" border="3" cellspacing="1" cellpadding="3" align=center>
68 <td align="center" valign="Middle" width="7%" height="30"><b class=rtableheader> No </b></td>
69 <td align="center" valign="Middle" width="7%"><b class=rtableheader>Form Field</b></td>
70 <td align="center" valign="Middle" width="72%"><b class=rtableheader>Calling Javascript</b></td>
71 <td align="center" valign="Middle" width="14%">
77 String javascriptFieldId = "";
82 if(rdef.getJavascriptList()!=null ) {
83 for(Iterator iter=rdef.getJavascriptList().getJavascriptItem().iterator(); iter.hasNext(); ) {
85 JavascriptItemType javascriptItem = (JavascriptItemType) iter.next();
86 id = javascriptItem.getId();
87 javascriptFieldId = javascriptItem.getFieldId();
88 callText = javascriptItem.getCallText();
90 <tr class=<%=(count%2==0)?"rowalt2":"rowalt1"%>>
91 <td align="center" height="30"><font class=rtabletext><%= ++iCount %></font></td>
93 <select name="javascriptFormField-<%=id %>" style="width: 100px">
94 <option value="-1"> <-- SELECT --> </option>
95 <option value="ol1" <%= ("ol1".equals(javascriptFieldId))?" selected":""%>>OnLoad</option>
96 <option value="os1" <%= ("os1".equals(javascriptFieldId))?" selected":""%>>OnSubmit</option>
100 if(rdef.getFormFieldList()!=null){
101 for(Iterator iter1=rdef.getFormFieldList().getFormField().iterator(); iter1.hasNext();) {
102 fft = (FormFieldType) iter1.next();
104 <option value="<%=fft.getFieldId() %>" <%= (fft.getFieldId().equals(javascriptFieldId))?" selected":""%>><%=fft.getFieldName() %></option>
113 <textarea name="callText-<%=id %>" rows="3" cols="100"><%=callText %></textarea>
116 <button type="submit" onClick="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_SAVE %>'; document.forma.<%=AppConstants.RI_JAVASCRIPT_ITEM_ID %>.value='<%= id %>'; document.forma.submit();" width="12" height="12" att-button btn-type="primary" size="small" title='Save'>Save</button>
117 <button type="submit" onClick="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_DELETE %>'; document.forma.<%=AppConstants.RI_JAVASCRIPT_ITEM_ID %>.value='<%= id %>'; document.forma.submit();" width="12" height="12" att-button btn-type="primary" size="small" title='Delete'>Delete</button>
126 <td align="center" height="30"><font class=rtabletext><%= ++iCount %></font></td>
128 <select name="javascriptFormField-<%=id %>" style="width: 100px">
129 <option value="-1"> <-- SELECT --> </option>
130 <option value="ol1">OnLoad</option>
131 <option value="os1">OnSubmit</option>
134 if(rdef.getFormFieldList()!=null){
135 for(Iterator iter1=rdef.getFormFieldList().getFormField().iterator(); iter1.hasNext();) {
136 fft = (FormFieldType) iter1.next();
138 <option value="<%=fft.getFieldId() %>"><%=fft.getFieldName() %></option>
146 <textarea name="callText-<%=id %>" rows="3" cols="100"></textarea>
149 <button type="submit" onClick="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_SAVE %>'; document.forma.<%=AppConstants.RI_JAVASCRIPT_ITEM_ID %>.value='<%= id %>'; document.forma.submit();" width="12" height="12" att-button btn-type="primary" size="small" title='Save'>Save</button>
150 <button type="submit" onClick="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_DELETE %>'; document.forma.<%=AppConstants.RI_JAVASCRIPT_ITEM_ID %>.value='<%= id %>'; document.forma.submit();" width="12" height="12" att-button btn-type="primary" size="small" title='Delete'>Delete</button>
157 private String nvl(String s) { return (s==null)?"":s; }
158 private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; }
161 <script language="JavaScript">
163 function dataValidate() {