Subversion Repositories Sigmater

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 Andrea 1
<%--
2
  ~ Licensed to the Apache Software Foundation (ASF) under one
3
  ~ or more contributor license agreements. See the NOTICE file
4
  ~ distributed with this work for additional information
5
  ~ regarding copyright ownership. The ASF licenses this file
6
  ~ to you under the Apache License, Version 2.0 (the
7
  ~ "License"); you may not use this file except in compliance
8
  ~ with the License. You may obtain a copy of the License at
9
  ~
10
  ~ http://www.apache.org/licenses/LICENSE-2.0
11
  ~
12
  ~ Unless required by applicable law or agreed to in writing,
13
  ~ software distributed under the License is distributed on an
14
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
  ~ KIND, either express or implied. See the License for the
16
  ~ specific language governing permissions and limitations
17
  ~ under the License.
18
  --%>
19
 
20
<%@ page import="org.apache.axis2.Constants,
21
                 org.apache.axis2.description.AxisModule" %>
22
<%@ page import="org.apache.axis2.description.AxisOperation" %>
23
<%@ page import="org.apache.axis2.description.AxisService" %>
24
<%@ page import="org.apache.axis2.description.Parameter" %>
25
<%@ page import="org.apache.axis2.engine.AxisConfiguration" %>
26
<%@ page import="org.apache.axis2.util.JavaUtils" %>
27
<%@ page import="java.util.Collection" %>
28
<%@ page import="java.util.Enumeration" %>
29
<%@ page import="java.util.HashMap" %>
30
<%@ page import="java.util.Hashtable" %>
31
<%@ page import="java.util.Iterator" %>
32
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
33
<jsp:include page="include/adminheader.jsp"/>
34
 
35
<h1>Available Services</h1>
36
<% String prefix = request.getAttribute("frontendHostUrl") + (String)request.getSession().getAttribute(Constants.SERVICE_PATH) + "/";
37
%>
38
<%
39
    HashMap serviceMap = (HashMap) request.getSession().getAttribute(Constants.SERVICE_MAP);
40
    request.getSession().setAttribute(Constants.SERVICE_MAP, null);
41
    Hashtable errornessservice = (Hashtable) request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);
42
    boolean status = false;
43
    if (serviceMap != null && !serviceMap.isEmpty()) {
44
        Iterator operations;
45
        String serviceName;
46
        Collection servicecol = serviceMap.values();
47
        for (Iterator iterator = servicecol.iterator(); iterator.hasNext();) {
48
            AxisService axisService = (AxisService) iterator.next();
49
            operations = axisService.getOperations();
50
            serviceName = axisService.getName();
51
%><h2><font color="blue"><a href="<%=prefix + axisService.getName()%>?wsdl"><%=serviceName%></a></font></h2>
52
<font color="blue">Service EPR : </font><font color="black"><%=prefix + axisService.getName()%></font><br>
53
<%
54
    // do we need to enable REST in the main servlet so that it handles both REST and SOAP messages
55
    boolean disableREST = false;
56
    AxisConfiguration axisConfiguration = axisService.getAxisConfiguration();
57
 
58
    Parameter parameter ;
59
 
60
    // do we need to completely disable REST support
61
    parameter = axisConfiguration.getParameter(Constants.Configuration.DISABLE_REST);
62
    if (parameter != null) {
63
        disableREST = !JavaUtils.isFalseExplicitly(parameter.getValue());
64
    }
65
    if (!disableREST) {
66
%>
67
 
68
<%
69
%>
70
<%
71
    }
72
 
73
 
74
    String serviceDescription = axisService.getServiceDescription();
75
    if (serviceDescription == null || "".equals(serviceDescription)) {
76
        serviceDescription = "No description available for this service";
77
    }
78
%>
79
        <h4>Service Description : <font color="black"><%=serviceDescription%></font></h4>
80
<i><font color="blue">Service Status : <%=axisService.isActive() ? "Active" : "InActive"%></font></i><br>
81
<%
82
    Collection engagedModules = axisService.getEngagedModules();
83
    String moduleName;
84
    boolean modules_present = false;
85
    if (engagedModules.size() > 0) {
86
%>
87
<i>Engaged modules for the service</i>
88
<%
89
    for (Iterator iteratorm = engagedModules.iterator(); iteratorm.hasNext();) {
90
        AxisModule axisOperation = (AxisModule) iteratorm.next();
91
        moduleName = axisOperation.getName();
92
        if (!modules_present) {
93
            modules_present = true;
94
%>
95
<ul>
96
    <% }
97
    %><li><%=moduleName%> :: <a href="axis2-admin/disengageModule?type=service&serviceName=<%=serviceName%>&module=<%=moduleName%>">Disengage</a></li>
98
    <br>
99
    <%
100
        }
101
        if (modules_present) {%>
102
</ul>
103
<%
104
        }
105
    }
106
    if (operations.hasNext()) {
107
%><br><i>Available operations</i><%
108
} else {
109
%><i> There are no Operations specified</i><%
110
    }
111
%><ul><%
112
    operations = axisService.getOperations();
113
    while (operations.hasNext()) {
114
        AxisOperation axisOperation = (AxisOperation) operations.next();
115
%><li><%=axisOperation.getName().getLocalPart()%></li>
116
    <%--                 <br>Operation EPR : <%=prifix + axisService.getName().getLocalPart() + "/"+ axisOperation.getName().getLocalPart()%>--%>
117
    <%
118
        engagedModules = axisOperation.getEngagedModules();
119
        if (engagedModules.size() > 0) {
120
    %>
121
    <br><i>Engaged Modules for the Operation</i><ul>
122
    <%
123
        for (Iterator iterator2 = engagedModules.iterator(); iterator2.hasNext();) {
124
            AxisModule moduleDecription = (AxisModule) iterator2.next();
125
            moduleName = moduleDecription.getName();
126
    %><li><%=moduleName%> :: <a href="axis2-admin/disengageModule?type=operation&serviceName=<%=serviceName%>&operation=<%=axisOperation.getName().getLocalPart()%>&module=<%=moduleName%>">Disengage</a></li><br><%
127
    }
128
%></ul><%
129
        }
130
 
131
    }
132
%></ul>
133
<%
134
            status = true;
135
        }
136
    }
137
    if (errornessservice != null) {
138
        if (errornessservice.size() > 0) {
139
            request.getSession().setAttribute(Constants.IS_FAULTY, Constants.IS_FAULTY);
140
%>
141
<h3><font color="red">Faulty Services</font></h3>
142
<%
143
    Enumeration faultyservices = errornessservice.keys();
144
    while (faultyservices.hasMoreElements()) {
145
        String faultyserviceName = (String) faultyservices.nextElement();
146
%><h3><font color="blue"><a href="services/ListFaultyServices?serviceName=<%=faultyserviceName%>">
147
    <%=faultyserviceName%></a></font></h3>
148
<%
149
            }
150
        }
151
        status = true;
152
    }
153
    if (!status) {
154
%> No services listed! Try hitting refresh. <%
155
    }
156
%>
157
<jsp:include page="include/adminfooter.inc" />