1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
|
<%
/*******************************************************************************
* Copyright (c) 2001, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
%>
<%@ page contentType="text/html; charset=UTF-8" import="org.eclipse.wst.ws.internal.explorer.platform.uddi.constants.*,
org.eclipse.wst.ws.internal.explorer.platform.uddi.actions.*,
org.eclipse.wst.ws.internal.explorer.platform.uddi.perspective.*,
org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel.*,
org.eclipse.wst.ws.internal.explorer.platform.constants.*,
org.eclipse.wst.ws.internal.explorer.platform.perspective.*,
org.eclipse.wst.ws.internal.explorer.platform.datamodel.*,
org.eclipse.wst.ws.internal.explorer.platform.util.*,
org.uddi4j.response.CompletionStatus,
org.uddi4j.datatype.business.*,
java.util.*" %>
<jsp:useBean id="controller" class="org.eclipse.wst.ws.internal.explorer.platform.perspective.Controller" scope="session"/>
<jsp:useBean id="sectionHeaderInfo" class="org.eclipse.wst.ws.internal.explorer.platform.perspective.SectionHeaderInfo" scope="request"/>
<%
String pubAssertionForm = "showPublisherAssertionsForm";
String publisherAssertionsBusiness = "publisherAssertionsBusiness";
UDDIPerspective uddiPerspective = controller.getUDDIPerspective();
NodeManager navigatorManager = uddiPerspective.getNavigatorManager();
UDDIMainNode uddiMainNode = (UDDIMainNode)navigatorManager.getRootNode();
Node selectedNode = navigatorManager.getSelectedNode();
FormTool formTool = (FormTool)(selectedNode.getCurrentToolManager().getSelectedTool());
RegistryNode regNode = uddiMainNode.getRegistryNode(selectedNode);
RegistryElement regElement = (RegistryElement)regNode.getTreeElement();
TreeElement selectedElement = selectedNode.getTreeElement();
String divPublisherAssertionTable = "divPublisherAssertionTable";
String xdivPublisherAssertionTable = "xdivPublisherAssertionTable";
%>
<jsp:useBean id="subQueryKeyProperty" class="org.eclipse.wst.ws.internal.explorer.platform.uddi.perspective.SubQueryKeyProperty" scope="request">
<%
String subQueryKey = (String)formTool.getProperty(UDDIActionInputs.SUBQUERY_KEY);
subQueryKeyProperty.setSubQueryKey(subQueryKey);
%>
</jsp:useBean>
<%
FormToolPropertiesInterface formToolPI = ((MultipleFormToolPropertiesInterface)formTool).getFormToolProperties(subQueryKeyProperty.getSubQueryKey());
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=uddiPerspective.getMessage("FORM_TITLE_MANAGE_PUBLISHER_ASSERTIONS")%></title>
<link rel="stylesheet" type="text/css" href="<%=response.encodeURL(controller.getPathWithContext("css/windows.css"))%>">
<script language="javascript" src="<%=response.encodeURL(controller.getPathWithContext("scripts/browserdetect.js"))%>">
</script>
<script language="javascript" src="<%=response.encodeURL(controller.getPathWithContext("scripts/resumeproxyloadpage.js"))%>">
</script>
<jsp:include page="/scripts/formsubmit.jsp" flush="true"/>
<jsp:include page="/uddi/scripts/udditables.jsp" flush="true"/>
<jsp:include page="/uddi/scripts/uddipanes.jsp" flush="true"/>
<jsp:include page="/uddi/scripts/results.jsp" flush="true"/>
<script language="javascript">
function setDefaults()
{
closeAllUddiChildWindows();
<%
if (!regElement.isLoggedIn())
{
String publishURL = (String)formTool.getProperty(UDDIActionInputs.QUERY_INPUT_ADVANCED_PUBLISH_URL);
String userId = (String)formTool.getProperty(UDDIActionInputs.QUERY_INPUT_ADVANCED_USERID);
String password = (String)formTool.getProperty(UDDIActionInputs.QUERY_INPUT_ADVANCED_PASSWORD);
%>
document.forms[0].<%=UDDIActionInputs.QUERY_INPUT_ADVANCED_PUBLISH_URL%>.value = "<%=HTMLUtils.JSMangle(publishURL)%>";
document.forms[0].<%=UDDIActionInputs.QUERY_INPUT_ADVANCED_USERID%>.value = "<%=HTMLUtils.JSMangle(userId)%>";
document.forms[0].<%=UDDIActionInputs.QUERY_INPUT_ADVANCED_PASSWORD%>.value = "<%=HTMLUtils.JSMangle(password)%>";
document.getElementById("<%=pubAssertionForm%>").style.display = "";
<%
}
Vector business = (Vector)formToolPI.getProperty(UDDIActionInputs.QUERY_INPUT_ADD_PUBLISHER_ASSERTIONS);
ListManager businessCopy = (ListManager)formToolPI.getProperty(UDDIActionInputs.QUERY_INPUT_ADD_PUBLISHER_ASSERTIONS_COPY);
if (business != null)
{
if (businessCopy == null)
businessCopy = new ListManager();
else
businessCopy.clear();
for (int i=0;i<business.size();i++)
{
ListElement listElement = (ListElement)business.elementAt(i);
int targetNodeId = listElement.getTargetNodeId();
int targetToolId = listElement.getTargetToolId();
int targetViewId = listElement.getTargetViewId();
String url = SelectSubQueryItemAction.getActionLink(targetNodeId,targetToolId,targetViewId,subQueryKeyProperty.getSubQueryKey(),UDDIActionInputs.QUERY_INPUT_ADD_PUBLISHER_ASSERTIONS,i,UDDIActionInputs.QUERY_ITEM_BUSINESSES,false);
BusinessEntity be = (BusinessEntity)listElement.getObject();
businessCopy.add(listElement);
%>
addPublisherAssertionResultRow("<%=publisherAssertionsBusiness%>",<%=listElement.getViewId()%>,"<%=response.encodeURL(controller.getPathWithContext(url))%>","<%=HTMLUtils.JSMangle(be.getDefaultNameString())%>","<%=HTMLUtils.JSMangle(be.getDefaultDescriptionString())%>");
<%
}
formToolPI.setProperty(UDDIActionInputs.QUERY_INPUT_ADD_PUBLISHER_ASSERTIONS_COPY,businessCopy);
}
else
{
business = new Vector();
businessCopy = new ListManager();
formToolPI.setProperty(UDDIActionInputs.QUERY_INPUT_ADD_PUBLISHER_ASSERTIONS,business);
formToolPI.setProperty(UDDIActionInputs.QUERY_INPUT_ADD_PUBLISHER_ASSERTIONS_COPY,businessCopy);
}
%>
}
function populateAssertionTable() {
<%
if (selectedElement instanceof BusinessElement)
{
ListManager pubAssertions = ((BusinessElement)selectedElement).getPublisherAssertions();
if (pubAssertions == null)
{
ShowPublisherAssertionsAction action = new ShowPublisherAssertionsAction(controller);
action.run();
%>
statusContent.location = "<%=response.encodeURL(controller.getPathWithContext("uddi/status_content.jsp"))%>";
<%
pubAssertions = ((BusinessElement)selectedElement).getPublisherAssertions();
}
pubAssertions = ((BusinessElement)selectedElement).getPublisherAssertions();
Enumeration e = ((pubAssertions != null) ? pubAssertions.getListElements() : null);
while (e != null && e.hasMoreElements())
{
ListElement le = (ListElement)e.nextElement();
PublisherAssertionElement pubAssertionElement = (PublisherAssertionElement)le.getObject();
int viewId = le.getViewId();
String direction;
if (((BusinessElement)selectedElement).getBusinessEntity().getBusinessKey().equals(pubAssertionElement.getFromKey()))
direction = uddiPerspective.getMessage("FORM_OPTION_ASSERTION_DIRECTION_FROM");
else
direction = uddiPerspective.getMessage("FORM_OPTION_ASSERTION_DIRECTION_TO");
ListElement sp = (ListElement)pubAssertionElement.getServiceProvider();
int targetNodeId = sp.getTargetNodeId();
int targetToolId = sp.getTargetToolId();
int targetViewId = sp.getTargetViewId();
int subQueryItemId = pubAssertionElement.getSubQueryItemId();
String url = SelectSubQueryItemAction.getActionLink(targetNodeId,targetToolId,targetViewId,subQueryKeyProperty.getSubQueryKey(),UDDIActionInputs.QUERY_INPUT_EXISTING_PUBLISHER_ASSERTIONS,subQueryItemId,UDDIActionInputs.QUERY_ITEM_BUSINESSES,false);
String name = ((BusinessEntity)sp.getObject()).getDefaultNameString();
String desc = ((BusinessEntity)sp.getObject()).getDefaultDescriptionString();
String status = pubAssertionElement.getStatus();
String type = pubAssertionElement.getKeyedRef().getKeyValue();
%>
addAssertion("<%=divPublisherAssertionTable%>",<%=viewId%>,"<%=direction%>","<%=response.encodeURL(controller.getPathWithContext(url))%>","<%=HTMLUtils.JSMangle(name)%>","<%=HTMLUtils.JSMangle(desc)%>","<%=status%>","<%=HTMLUtils.JSMangle(type)%>");
<%
}
}
%>
}
function addAssertion(tableContainerId,viewId,direction,url,name,desc,status,type)
{
twistOpen(tableContainerId);
var table = getTable(tableContainerId);
var tableBody = table.getElementsByTagName("TBODY").item(0);
var newRow = document.createElement("tr");
var column0 = document.createElement("td");
var column1 = document.createElement("td");
var column2 = document.createElement("td");
var column3 = document.createElement("td");
var column4 = document.createElement("td");
var column5 = document.createElement("td");
var column6 = document.createElement("td");
var rowCheckbox = createRowCheckbox();
rowCheckbox.name = "<%=UDDIActionInputs.PUBLISHER_ASSERTIONS_VIEWID%>";
rowCheckbox.value = viewId;
column0.appendChild(rowCheckbox);
column1.appendChild(document.createTextNode("<%=uddiPerspective.getMessage("FORM_LABEL_THIS_BUSINESS")%>"));
column2.appendChild(document.createTextNode(direction));
var nameDetailsLink = document.createElement("a");
nameDetailsLink.href = url;
nameDetailsLink.target = "<%=FrameNames.PERSPECTIVE_WORKAREA%>";
nameDetailsLink.appendChild(document.createTextNode(name));
column3.appendChild(nameDetailsLink);
column4.appendChild(document.createTextNode(getDefaultDisplayString(desc)));
column5.appendChild(document.createTextNode(status));
column6.appendChild(document.createTextNode(type));
column0.className = "checkboxcells";
column1.className = "tablecells";
column2.className = "tablecells";
column3.className = "tablecells";
column4.className = "tablecells";
column5.className = "tablecells";
column6.className = "tablecells";
newRow.appendChild(column0);
newRow.appendChild(column1);
newRow.appendChild(column2);
newRow.appendChild(column3);
newRow.appendChild(column4);
newRow.appendChild(column5);
newRow.appendChild(column6);
tableBody.appendChild(newRow);
}
function addPublisherAssertionResultRow(tableContainerId,nodeId,url,name,description)
{
twistOpen(tableContainerId);
var table = getTable(tableContainerId);
var tableBody = table.getElementsByTagName("TBODY").item(0);
var newRow = document.createElement("tr");
var column0 = document.createElement("td");
var column1 = document.createElement("td");
var column2 = document.createElement("td");
var column3 = document.createElement("td");
var column4 = document.createElement("td");
var column5 = document.createElement("td");
var rowCheckbox = createRowCheckbox();
column0.appendChild(rowCheckbox);
column0.appendChild(createHiddenElement("",nodeId));
column1.appendChild(document.createTextNode("<%=uddiPerspective.getMessage("FORM_LABEL_THIS_BUSINESS")%>"));
var direction = document.createElement("select");
direction.id = "label_publisher_assertion_direction";
direction.name = "<%=UDDIActionInputs.PUBLISHER_ASSERTIONS_DIRECTION%>";
direction.className = "selectlist";
direction.options[0] = new Option("<%=uddiPerspective.getMessage("FORM_OPTION_ASSERTION_DIRECTION_FROM")%>", "<%=String.valueOf(UDDIActionInputs.DIRECTION_FROM)%>");
direction.options[1] = new Option("<%=uddiPerspective.getMessage("FORM_OPTION_ASSERTION_DIRECTION_TO")%>", "<%=String.valueOf(UDDIActionInputs.DIRECTION_TO)%>");
column2.appendChild(direction);
var nameDetailsLink = document.createElement("a");
nameDetailsLink.href = url;
nameDetailsLink.target = "<%=FrameNames.PERSPECTIVE_WORKAREA%>";
nameDetailsLink.appendChild(document.createTextNode(name));
column3.appendChild(nameDetailsLink);
column4.appendChild(document.createTextNode(getDefaultDisplayString(description)));
var assertionType = document.createElement("select");
assertionType.id = "label_publisher_assertion_type";
assertionType.name = "<%=UDDIActionInputs.PUBLISHER_ASSERTIONS_TYPE%>";
assertionType.className = "selectlist";
assertionType.options[0] = new Option("<%=uddiPerspective.getMessage("FORM_OPTION_ASSERTION_TYPE_PARENT_CHILD")%>", "<%=String.valueOf(UDDIActionInputs.PUBLISHER_ASSERTIONS_TYPE_PARENT_CHILD)%>");
assertionType.options[1] = new Option("<%=uddiPerspective.getMessage("FORM_OPTION_ASSERTION_TYPE_PEER_TO_PEER")%>", "<%=String.valueOf(UDDIActionInputs.PUBLISHER_ASSERTIONS_TYPE_PEER_TO_PEER)%>");
assertionType.options[2] = new Option("<%=uddiPerspective.getMessage("FORM_OPTION_ASSERTION_TYPE_IDENTITY")%>", "<%=String.valueOf(UDDIActionInputs.PUBLISHER_ASSERTIONS_TYPE_IDENTITY)%>");
column5.appendChild(assertionType);
column0.className = "checkboxcells";
column1.className = "tablecells";
column2.className = "tablecells";
column3.className = "tablecells";
column4.className = "tablecells";
column5.className = "tablecells";
newRow.appendChild(column0);
newRow.appendChild(column1);
newRow.appendChild(column2);
newRow.appendChild(column3);
newRow.appendChild(column4);
newRow.appendChild(column5);
tableBody.appendChild(newRow);
}
function setFormLocationAndSubmit(form,location)
{
form.action = location;
if (handleSubmit(form))
{
processResultTable("<%=publisherAssertionsBusiness%>", "<%=UDDIActionInputs.PUBLISHER_ASSERTIONS_SELECTED_BUS_ID%>", form, false);
form.submit();
}
}
function checkTableEntriesAndSubmit(tableContainerId,form,location)
{
if (getNumberOfSelections(tableContainerId) > 0) {
setFormLocationAndSubmit(form,location);
return;
}
alert("<%=controller.getUDDIPerspective().getMessage("MSG_ERROR_NOTHING_SELECTED")%>");
}
function checkTableSizeAndSubmit(tableContainerId,form,location)
{
var table = getTable(tableContainerId);
if (table.rows.length > numberOfHeaderRows) {
setFormLocationAndSubmit(form,location);
return;
}
alert("<%=controller.getUDDIPerspective().getMessage("MSG_ERROR_NOTHING_SELECTED")%>");
}
</script>
</head>
<body dir="<%=org.eclipse.wst.ws.internal.explorer.platform.util.DirUtils.getDir()%>" class="contentbodymargin" onUnload="closeAllUddiChildWindows()">
<div id="contentborder">
<div id="publisherAssertions">
<form action="<%=response.encodeURL(controller.getPathWithContext("uddi/actions/ShowPublisherAssertionsActionJSP.jsp"))%>" method="post" target="<%=FrameNames.PERSPECTIVE_WORKAREA%>" enctype="multipart/form-data">
<input type="hidden" name="<%=UDDIActionInputs.SUBQUERY_GET%>">
<input type="hidden" name="<%=UDDIActionInputs.NEW_SUBQUERY_INITIATED%>">
<input type="hidden" name="<%=UDDIActionInputs.NEW_SUBQUERY_QUERY_ITEM%>">
<%
String titleImagePath = "uddi/images/publisher_assertions_highlighted.gif";
String title = uddiPerspective.getMessage("ALT_MANAGE_PUBLISHER_ASSERTIONS");
%>
<%@ include file="/forms/formheader.inc" %>
<table width="90%" border=0 cellpadding=3 cellspacing=0>
<tr>
<td class="labels">
<%=uddiPerspective.getMessage("FORM_LABEL_MANAGE_PUBLISHER_ASSERTIONS_DESC")%>
</td>
</tr>
</table>
<table border=0 cellpadding=6 cellspacing=0>
<tr>
<td height=40 valign="bottom" align="left" nowrap width=11>
<a href="javascript:twist('<%=divPublisherAssertionTable%>','<%=xdivPublisherAssertionTable%>')"><img name="<%=xdivPublisherAssertionTable%>" src="<%=response.encodeURL(controller.getPathWithContext("images/twistclosed.gif"))%>" alt="<%=controller.getMessage("ALT_TWIST_CLOSED")%>" class="twist"></a>
</td>
<td height=40 valign="bottom" align="left" nowrap class="labels">
<strong><%=uddiPerspective.getMessage("FORM_LABEL_PUBLISH_ASSERTIONS")%></strong>
</td>
</tr>
</table>
<table width="95%" border=0 cellpadding=0 cellspacing=0>
<tr>
<td valign="top" height=10><img src="<%=response.encodeURL(controller.getPathWithContext("images/keyline.gif"))%>" height=2 width="100%"></td>
</tr>
</table>
<div id="<%=divPublisherAssertionTable%>" style="display:none;">
<table width="95%" cellpadding=3 cellspacing=0 class="tableborder">
<tr>
<th class="checkboxcells" width=10><input type="checkbox" onClick="handleCheckAllClick('<%=divPublisherAssertionTable%>',this)" title="<%=controller.getMessage("FORM_CONTROL_TITLE_SELECT_ALL_CHECK_BOX")%>"></th>
<th class="headercolor"><%=((BusinessElement)selectedElement).getBusinessEntity().getDefaultNameString()%></th>
<th class="headercolor"><label for="label_publisher_assertion_direction"><%=uddiPerspective.getMessage("FORM_LABEL_DIRECTION")%></label></th>
<th class="headercolor"><%=uddiPerspective.getMessage("FORM_LABEL_BUSINESS")%></th>
<th class="headercolor"><%=uddiPerspective.getMessage("FORM_LABEL_DESCRIPTION")%></th>
<th class="headercolor"><%=uddiPerspective.getMessage("FORM_LABEL_STATUS")%></th>
<th class="headercolor"><label for="label_publisher_assertion_type"><%=uddiPerspective.getMessage("FORM_LABEL_ASSERTION_TYPE")%></label></th>
</tr>
</table>
<table width="90%" border=0 cellpadding=3 cellspacing=0>
<tr>
<td height=30 valign="bottom" align="left" nowrap class="labels">
<%=uddiPerspective.getMessage("FORM_LABEL_INCOMPLETE_ASSERTIONS_VISIBILITY_DESC")%>
</td>
</tr>
</table>
</div>
<%
boolean tableHasErrors = !formToolPI.isInputValid(UDDIActionInputs.QUERY_INPUT_ADD_PUBLISHER_ASSERTIONS);
String[] busSpecificInfo = {"FORM_LABEL_BUSINESSES",(new Boolean(tableHasErrors)).toString(),String.valueOf(UDDIActionInputs.QUERY_ITEM_BUSINESSES),"publisherAssertions",UDDIActionInputs.QUERY_INPUT_ADD_PUBLISHER_ASSERTIONS};
sectionHeaderInfo.clear();
sectionHeaderInfo.setContainerId(publisherAssertionsBusiness);
sectionHeaderInfo.setOtherProperties(busSpecificInfo);
%>
<jsp:include page="/uddi/forms/uddiObjectsPublisherAssertions_table.jsp" flush="true"/>
<%
sectionHeaderInfo.clear();
sectionHeaderInfo.setContainerId(pubAssertionForm);
%>
<jsp:include page="authentication_table.jsp" flush="true"/>
<br>
<table>
<tr>
<td>
<input type="button" value="<%=uddiPerspective.getMessage("FORM_BUTTON_SHOW_ALL_PUBLISHER_ASSERTIONS")%>" onClick="setFormLocationAndSubmit(this.form,'<%=response.encodeURL(controller.getPathWithContext("uddi/actions/ShowPublisherAssertionsActionJSP.jsp"))%>')" class="button">
</td>
<td>
<input type="button" value="<%=uddiPerspective.getMessage("FORM_BUTTON_COMPLETE_PUBLISHER_ASSERTIONS")%>" onClick="checkTableEntriesAndSubmit('<%=divPublisherAssertionTable%>',this.form,'<%=response.encodeURL(controller.getPathWithContext("uddi/actions/CompletePublisherAssertionsActionJSP.jsp"))%>')" class="button">
</td>
<td>
<input type="button" value="<%=uddiPerspective.getMessage("FORM_BUTTON_ADD_PUBLISHER_ASSERTIONS")%>" onClick="checkTableSizeAndSubmit('<%=publisherAssertionsBusiness%>',this.form,'<%=response.encodeURL(controller.getPathWithContext("uddi/actions/AddPublisherAssertionsActionJSP.jsp"))%>')" class="button">
</td>
<td>
<input type="button" value="<%=uddiPerspective.getMessage("FORM_BUTTON_REMOVE_PUBLISHER_ASSERTIONS")%>" onClick="checkTableEntriesAndSubmit('<%=divPublisherAssertionTable%>',this.form,'<%=response.encodeURL(controller.getPathWithContext("uddi/actions/RemovePublisherAssertionsActionJSP.jsp"))%>')" class="button">
</td>
</tr>
</table>
</form>
</div>
</div>
<script language="javascript">
populateAssertionTable();
setDefaults();
resumeProxyLoadPage();
</script>
</body>
</html>
|