Skip to main content
summaryrefslogtreecommitdiffstats
blob: 03d7f15e556f91edf2e2806f9e4eb58bb050ef7f (plain) (blame)
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
<%
/*******************************************************************************
 * 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 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * 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.constants.*,
                                                        org.eclipse.wst.ws.internal.explorer.platform.perspective.*,
                                                        org.eclipse.wst.ws.internal.explorer.platform.datamodel.*,
                                                        org.eclipse.wst.ws.internal.explorer.platform.constants.*,
                                                        org.eclipse.wst.ws.internal.explorer.platform.util.*,
                                                        java.util.*" %>

<jsp:useBean id="controller" class="org.eclipse.wst.ws.internal.explorer.platform.perspective.Controller" scope="session"/>
<jsp:useBean id="subQueryTransferTargetHolder" class="java.util.Vector" scope="request"/>
<%
   UDDIPerspective uddiPerspective = controller.getUDDIPerspective();
%>
<jsp:include page="/scripts/formsubmit.jsp" flush="true"/>
<jsp:include page="/uddi/scripts/udditables.jsp" flush="true"/>
<script language="javascript">
  function getNumberOfSelections(tableContainerId)
  {
    var numberSelected = 0;
    var table = getTable(tableContainerId);
    for (var i=numberOfHeaderRows;i<table.rows.length;i++)
    {
      var rowCheckbox = table.rows[i].getElementsByTagName("input").item(0);
      if (rowCheckbox.checked)
        numberSelected++;
    }
    return numberSelected;
  }
  
  function processResultForm(tableContainerId,form)
  {
    if (handleSubmit(form))
    {
      processResultTable(tableContainerId,"<%=ActionInputs.NODEID%>",form,true);
      form.submit();
    }
  }
  
  function clearSelections(tableContainerId,form)
  {
    form.action = "<%=response.encodeURL(controller.getPathWithContext("uddi/actions/ClearNavigatorNodesActionJSP.jsp"))%>";
    // Ensure that at least one item is selected.
    var numberSelected = getNumberOfSelections(tableContainerId);
    if (numberSelected > 0)
      processResultForm(tableContainerId,form);
    else
      alert("<%=uddiPerspective.getMessage("MSG_ERROR_NOTHING_SELECTED")%>");
  }
  
  function refreshSelections(tableContainerId,form)
  {
    form.action = "<%=response.encodeURL(controller.getPathWithContext("uddi/actions/RefreshUDDINodesActionJSP.jsp"))%>";
    // Ensure that at least one item is selected.
    var numberSelected = getNumberOfSelections(tableContainerId);
    if (numberSelected > 0)
      processResultForm(tableContainerId,form);
    else
      alert("<%=uddiPerspective.getMessage("MSG_ERROR_NOTHING_SELECTED")%>");
  }
  
  function addSelectionsToFavorites(tableContainerId,form)
  {
    form.action = "<%=response.encodeURL(controller.getPathWithContext("uddi/actions/AddItemsToFavoritesActionJSP.jsp"))%>";
    // Ensure that at least one item is selected.
    var numberSelected = getNumberOfSelections(tableContainerId);
    if (numberSelected > 0)
      processResultForm(tableContainerId,form);
    else
      alert("<%=uddiPerspective.getMessage("MSG_ERROR_NOTHING_SELECTED")%>");
  }
  
<%
   if (subQueryTransferTargetHolder.size() > 0)
   {
     SubQueryTransferTarget subQueryTransferTarget = (SubQueryTransferTarget)subQueryTransferTargetHolder.elementAt(0);
     String subQueryKey = subQueryTransferTarget.getSubQueryKey();
     int lastSeparatorPos = subQueryKey.lastIndexOf(':');
     String targetQueryKey;
     if (lastSeparatorPos == -1)
       targetQueryKey = "";
     else
       targetQueryKey = subQueryKey.substring(0,lastSeparatorPos);
     String targetProperty = subQueryKey.substring(lastSeparatorPos+1,subQueryKey.length());
%>     
  function transferSelections(tableContainerId,form)
  {
    form.action = "<%=response.encodeURL(controller.getPathWithContext("uddi/actions/TransferSubQueryResultsActionJSP.jsp"))%>";
    // Ensure that at least one item is selected.
    var numberSelected = getNumberOfSelections(tableContainerId);
    if (numberSelected > 0)
    {
<%
     if (targetProperty.equals(UDDIActionInputs.QUERY_INPUT_ADVANCED_SERVICE_BUSINESS) || targetProperty.equals(UDDIActionInputs.QUERY_INPUT_SIMPLE_SERVICE_BUSINESS) || targetProperty.equals(UDDIActionInputs.QUERY_INPUT_ADVANCED_SERVICE_INTERFACE_SERVICE))
     {
%>
      if (numberSelected != 1)
      {
        alert("<%=HTMLUtils.JSMangle(uddiPerspective.getMessage("MSG_ERROR_SINGLE_ITEM"))%>");
        return;
      }

<%
       FormTool targetFormTool = subQueryTransferTarget.getTargetFormTool();
       FormToolPropertiesInterface targetFormToolPI = ((MultipleFormToolPropertiesInterface)targetFormTool).getFormToolProperties(targetQueryKey);
       Vector serviceBusiness = (Vector)targetFormToolPI.getProperty(targetProperty);
       if (serviceBusiness != null && serviceBusiness.size() > 0)
       {
%>
      if (!confirm("<%=HTMLUtils.JSMangle(uddiPerspective.getMessage("MSG_QUESTION_ITEM_REPLACEMENT"))%>"))
        return;
<%
       }
     }
%>
      processResultForm(tableContainerId,form);
    }
    else
      alert("<%=uddiPerspective.getMessage("MSG_ERROR_NOTHING_SELECTED")%>");
  }
<%
   }
%>       
</script>  

Back to the top