source: gs3-extensions/pharos/trunk/web/axis2-web/listServices.jsp@ 20983

Last change on this file since 20983 was 20983, checked in by davidb, 14 years ago

Initial files for Phrasos extension to Greenstone3

File size: 5.1 KB
Line 
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.AxisOperation" %>
22<%@ page import="org.apache.axis2.description.AxisService" %>
23<%@ page import="org.apache.axis2.description.Parameter" %>
24<%@ page import="org.apache.axis2.engine.AxisConfiguration" %>
25<%@ page import="org.apache.axis2.util.JavaUtils" %>
26<%@ page import="java.util.Collection" %>
27<%@ page import="java.util.Enumeration" %>
28<%@ page import="java.util.HashMap" %>
29<%@ page import="java.util.Hashtable" %>
30<%@ page import="java.util.Iterator" %>
31<%@ page contentType="text/html;charset=UTF-8" language="java" %>
32<html>
33<jsp:include page="include/httpbase.jsp"/>
34<head><title>List Services</title>
35 <link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css"/>
36</head>
37
38<body>
39<jsp:include page="include/header.inc" />
40<jsp:include page="include/link-footer.jsp" />
41<h1>Available services</h1>
42<% String prefix = request.getAttribute("frontendHostUrl") + (String)request.getSession().getAttribute(Constants.SERVICE_PATH) + "/";
43%>
44<%
45 HashMap serviceMap = (HashMap) request.getSession().getAttribute(Constants.SERVICE_MAP);
46 request.getSession().setAttribute(Constants.SERVICE_MAP, null);
47 Hashtable errornessservice = (Hashtable) request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);
48 boolean status = false;
49 if (serviceMap != null && !serviceMap.isEmpty()) {
50 Iterator opItr;
51 //HashMap operations;
52 String serviceName;
53 Collection servicecol = serviceMap.values();
54 // Collection operationsList;
55 for (Iterator iterator = servicecol.iterator(); iterator.hasNext();) {
56 AxisService axisService = (AxisService) iterator.next();
57 opItr = axisService.getOperations();
58 //operationsList = operations.values();
59 serviceName = axisService.getName();
60%><h2><font color="blue"><a href="<%=prefix + axisService.getName()%>?wsdl"><%=serviceName%></a></font></h2>
61<font color="blue">Service EPR : </font><font color="black"><%=prefix + axisService.getName()%></font><br>
62<%
63 boolean disableREST = false;
64 AxisConfiguration axisConfiguration = axisService.getAxisConfiguration();
65
66 Parameter parameter ;
67
68 // do we need to completely disable REST support
69 parameter = axisConfiguration.getParameter(Constants.Configuration.DISABLE_REST);
70 if (parameter != null) {
71 disableREST = !JavaUtils.isFalseExplicitly(parameter.getValue());
72 }
73
74 if (!disableREST ) {
75
76%>
77<%
78 }
79
80
81 String serviceDescription = axisService.getServiceDescription();
82 if (serviceDescription == null || "".equals(serviceDescription)) {
83 serviceDescription = "No description available for this service";
84 }
85%>
86<h4>Service Description : <font color="black"><%=serviceDescription%></font></h4>
87<i><font color="blue">Service Status : <%=axisService.isActive() ? "Active" : "InActive"%></font></i><br>
88<%
89 if (opItr.hasNext()) {
90%><i>Available Operations</i><%
91} else {
92%><i> There are no Operations specified</i><%
93 }
94 opItr = axisService.getOperations();
95%><ul><%
96 while (opItr.hasNext()) {
97 AxisOperation axisOperation = (AxisOperation) opItr.next();
98%><li><%=axisOperation.getName().getLocalPart()%></li>
99 <%-- <br>Operation EPR : <%=prifix + axisService.getName().getLocalPart() + "/"+ axisOperation.getName().getLocalPart()%>--%>
100 <%
101 }
102 %></ul>
103<%
104 status = true;
105 }
106 }
107 if (errornessservice != null) {
108 if (errornessservice.size() > 0) {
109 request.getSession().setAttribute(Constants.IS_FAULTY, Constants.IS_FAULTY);
110%>
111<hr>
112
113<h3><font color="blue">Faulty Services</font></h3>
114<%
115 Enumeration faultyservices = errornessservice.keys();
116 while (faultyservices.hasMoreElements()) {
117 String faultyserviceName = (String) faultyservices.nextElement();
118%><h3><font color="blue"><a href="services/ListFaultyServices?serviceName=<%=faultyserviceName%>">
119 <%=faultyserviceName%></a></font></h3>
120<%
121 }
122 }
123 status = true;
124 }
125 if (!status) {
126%> No services listed! Try hitting refresh. <%
127 }
128%>
129<jsp:include page="include/footer.inc" />
130</body>
131</html>
Note: See TracBrowser for help on using the repository browser.