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
|
<%
/*******************************************************************************
* 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.perspective.*,
org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel.*,
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.perspective.*,
org.eclipse.wst.ws.internal.explorer.platform.constants.*,
org.eclipse.wst.ws.internal.explorer.platform.datamodel.*,
org.eclipse.wst.ws.internal.explorer.platform.util.*,
org.uddi4j.datatype.business.*,
org.uddi4j.datatype.service.*,
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"/>
<%
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();
BusinessElement busElement = (BusinessElement)selectedNode.getTreeElement();
%>
<jsp:useBean id="subQueryKeyProperty" class="org.eclipse.wst.ws.internal.explorer.platform.uddi.perspective.SubQueryKeyProperty" scope="request">
<%
String sk = (String)formTool.getProperty(UDDIActionInputs.SUBQUERY_KEY);
subQueryKeyProperty.setSubQueryKey(sk);
%>
</jsp:useBean>
<html>
<head>
<title><%=uddiPerspective.getMessage("FORM_TITLE_MANAGE_REFERENCED_SERVICES")%></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>
<jsp:include page="/uddi/scripts/results.jsp" flush="true"/>
<script language="javascript">
function setDefaults()
{
<%
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("manageReferencedServicesAuthentication").style.display = "";
<%
}
String subQueryKey = subQueryKeyProperty.getSubQueryKey();
FormToolPropertiesInterface formToolPI = ((MultipleFormToolPropertiesInterface)formTool).getFormToolProperties(subQueryKey);
Vector referencedServices = (Vector)formToolPI.getProperty(UDDIActionInputs.QUERY_INPUT_REFERENCED_SERVICES);
if (referencedServices == null)
{
referencedServices = new Vector();
BusinessEntity businessEntity = busElement.getBusinessEntity();
String businessKey = businessEntity.getBusinessKey();
BusinessServices businessSvcs = businessEntity.getBusinessServices();
if (businessSvcs != null)
{
Vector businessSvcVector = businessSvcs.getBusinessServiceVector();
for (int i=0;i<businessSvcVector.size();i++)
{
BusinessService busService = (BusinessService)businessSvcVector.elementAt(i);
if (!busService.getBusinessKey().equals(businessKey))
{
ListElement listElement = new ListElement(busService);
referencedServices.addElement(listElement);
}
}
}
formToolPI.setProperty(UDDIActionInputs.QUERY_INPUT_REFERENCED_SERVICES,referencedServices);
}
for (int i=0;i<referencedServices.size();i++)
{
ListElement listElement = (ListElement)referencedServices.elementAt(i);
int targetNodeId = listElement.getTargetNodeId();
int targetToolId = listElement.getTargetToolId();
int targetViewId = listElement.getTargetViewId();
String url = SelectSubQueryItemAction.getActionLink(targetNodeId,targetToolId,targetViewId,subQueryKey,UDDIActionInputs.QUERY_INPUT_REFERENCED_SERVICES,i,UDDIActionInputs.QUERY_ITEM_SERVICES,false);
BusinessService bs = (BusinessService)listElement.getObject();
String name = bs.getDefaultNameString();
String description = bs.getDefaultDescriptionString();
%>
addResultRow("manageReferencedServicesReferences",<%=targetNodeId%>,"<%=response.encodeURL(controller.getPathWithContext(url))%>","<%=HTMLUtils.JSMangle(name)%>","<%=HTMLUtils.JSMangle(description)%>");
<%
}
Vector services = (Vector)formToolPI.getProperty(UDDIActionInputs.QUERY_INPUT_SERVICES);
if (services != null)
{
for (int i=0;i<services.size();i++)
{
ListElement listElement = (ListElement)services.elementAt(i);
int targetNodeId = listElement.getTargetNodeId();
int targetToolId = listElement.getTargetToolId();
int targetViewId = listElement.getTargetViewId();
String url = SelectSubQueryItemAction.getActionLink(targetNodeId,targetToolId,targetViewId,subQueryKey,UDDIActionInputs.QUERY_INPUT_SERVICES,i,UDDIActionInputs.QUERY_ITEM_SERVICES,false);
BusinessService bs = (BusinessService)listElement.getObject();
String name = bs.getDefaultNameString();
String description = bs.getDefaultDescriptionString();
%>
addResultRow("manageReferencedServicesServices",<%=targetNodeId%>,"<%=response.encodeURL(controller.getPathWithContext(url))%>","<%=HTMLUtils.JSMangle(name)%>","<%=HTMLUtils.JSMangle(description)%>");
<%
}
}
%>
}
function processReferenceTable(tableContainerId,inputName,form)
{
var table = getTable(tableContainerId);
for (var i=numberOfHeaderRows;i<table.rows.length;i++)
{
var inputs = table.rows[i].getElementsByTagName("input");
form.appendChild(createHiddenElement(inputName,inputs.item(0).checked));
}
}
function processForm(form)
{
if (handleSubmit(form))
{
processReferenceTable("manageReferencedServicesReferences","<%=UDDIActionInputs.REFERENCED_SERVICE_SELECT_STATE%>",form);
processResultTable("manageReferencedServicesServices","<%=UDDIActionInputs.NODEID_SERVICE%>",form,false);
form.submit();
}
}
function processAddServices(form)
{
var table = getTable("manageReferencedServicesServices");
if (table.rows.length == numberOfHeaderRows)
alert("<%=HTMLUtils.JSMangle(uddiPerspective.getMessage("MSG_ERROR_NO_SERVICES"))%>");
else
{
form.<%=UDDIActionInputs.MANAGE_REFERENCED_SERVICES_OPERATION%>.value = "<%=UDDIActionInputs.MANAGE_REFERENCED_SERVICES_OPERATION_ADD%>";
processForm(form);
}
}
function processRemoveReferences(form)
{
var numberOfSelections = getNumberOfSelections("manageReferencedServicesReferences");
if (getNumberOfSelections("manageReferencedServicesReferences") == 0)
alert("<%=HTMLUtils.JSMangle(uddiPerspective.getMessage("MSG_ERROR_NO_REFERENCE_SELECTED"))%>");
else
{
form.<%=UDDIActionInputs.MANAGE_REFERENCED_SERVICES_OPERATION%>.value = "<%=UDDIActionInputs.MANAGE_REFERENCED_SERVICES_OPERATION_REMOVE%>";
processForm(form);
}
}
</script>
</head>
<body dir="<%=org.eclipse.wst.ws.internal.explorer.platform.util.DirUtils.getDir()%>" class="contentbodymargin">
<div id="contentborder">
<div id="manageReferencedServices">
<%
String titleImagePath = "uddi/images/referenced_services_highlighted.gif";
String title = uddiPerspective.getMessage("ALT_MANAGE_REFERENCED_SERVICES");
%>
<%@ include file="/forms/formheader.inc" %>
<form action="<%=response.encodeURL(controller.getPathWithContext("uddi/actions/ManageReferencedServicesActionJSP.jsp"))%>" method="post" target="<%=FrameNames.PERSPECTIVE_WORKAREA%>" enctype="multipart/form-data" style="margin-top:0;">
<input type="hidden" name="<%=UDDIActionInputs.SUBQUERY_KEY%>">
<input type="hidden" name="<%=UDDIActionInputs.SUBQUERY_GET%>">
<input type="hidden" name="<%=UDDIActionInputs.NEW_SUBQUERY_INITIATED%>">
<input type="hidden" name="<%=UDDIActionInputs.NEW_SUBQUERY_QUERY_ITEM%>">
<input type="hidden" name="<%=UDDIActionInputs.MANAGE_REFERENCED_SERVICES_OPERATION%>">
<table width="90%" border=0 cellpadding=3 cellspacing=0>
<tr>
<td class="labels">
<%=uddiPerspective.getMessage("FORM_LABEL_MANAGE_REFERENCED_SERVICES_DESC")%>
</td>
</tr>
</table>
<%
String[] projectionsSpecificInfo = {"FORM_LABEL_REFERENCED_SERVICES",Boolean.FALSE.toString(),String.valueOf(UDDIActionInputs.QUERY_ITEM_SERVICES),"manageReferencedServices",UDDIActionInputs.QUERY_INPUT_REFERENCED_SERVICES};
sectionHeaderInfo.clear();
sectionHeaderInfo.setContainerId("manageReferencedServicesReferences");
sectionHeaderInfo.setOtherProperties(projectionsSpecificInfo);
sectionHeaderInfo.enableDynamic(false);
%>
<jsp:include page="/uddi/forms/uddiObjects_table.jsp" flush="true"/>
<%
String[] servicesSpecificInfo = {"FORM_OPTION_SERVICES",Boolean.FALSE.toString(),String.valueOf(UDDIActionInputs.QUERY_ITEM_SERVICES),"manageReferencedServices",UDDIActionInputs.QUERY_INPUT_SERVICES};
sectionHeaderInfo.clear();
sectionHeaderInfo.setContainerId("manageReferencedServicesServices");
sectionHeaderInfo.setOtherProperties(servicesSpecificInfo);
%>
<jsp:include page="/uddi/forms/uddiObjects_table.jsp" flush="true"/>
<%
sectionHeaderInfo.clear();
sectionHeaderInfo.setContainerId("manageReferencedServicesAuthentication");
%>
<jsp:include page="/uddi/forms/authentication_table.jsp" flush="true"/>
<table border=0 cellpadding=2 cellspacing=0>
<tr>
<td height=30 valign="bottom" align="left" nowrap>
<input type="button" value="<%=uddiPerspective.getMessage("FORM_BUTTON_ADD_SERVICES")%>" onClick="processAddServices(this.form)" class="button">
</td>
<td height=30 valign="bottom" align="left" nowrap>
<input type="button" value="<%=uddiPerspective.getMessage("FORM_BUTTON_REMOVE_REFERENCES")%>" onClick="processRemoveReferences(this.form)" class="button">
</td>
<td nowrap width="90%"> </td>
</tr>
</table>
</form>
</div>
</div>
<script language="javascript">
setDefaults();
</script>
</body>
</html>
|