Author: keith Date: Sun Jun 1 06:15:00 2008 New Revision: 17724 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=17724
Log: Making all links take into account the context path and resding the services path from the axis2.xml not hard coding it Modified: trunk/mashup/java/modules/www/cert_manager.jsp trunk/mashup/java/modules/www/js/mashup-utils.js trunk/mashup/java/modules/www/mashup.jsp trunk/mashup/java/modules/www/stub_gen.jsp trunk/mashup/java/modules/www/taskbar.jsp trunk/mashup/java/modules/www/validate_login.jsp Modified: trunk/mashup/java/modules/www/cert_manager.jsp URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/cert_manager.jsp?rev=17724&r1=17723&r2=17724&view=diff ============================================================================== --- trunk/mashup/java/modules/www/cert_manager.jsp (original) +++ trunk/mashup/java/modules/www/cert_manager.jsp Sun Jun 1 06:15:00 2008 @@ -46,8 +46,8 @@ type="text/javascript"></script> <script language="javascript" src="js/wso2/WSRequest.js" type="text/javascript"></script> -<script type="text/javascript" src="../wsasadmin/global_params.js"></script> -<script type="text/javascript" src="../wsasadmin/js/main.js"></script> +<script type="text/javascript" src="js/global_params.js"></script> +<script type="text/javascript" src="js/main.js"></script> <script language="javascript" src="js/services.js" type="text/javascript"></script> @@ -171,7 +171,7 @@ <br/> <form id="form" method="post" enctype="multipart/form-data" - action="/services/MashupAdminService/importCert" + action="<%=axis2ConfigContext.getServicePath()%>/MashupAdminService/importCert" target="uploadFrame"> <input type="hidden" id="userName" name="userName" value="<%=currentUser%>"/> <label>Certificate<font color="red">*</font></label><input Modified: trunk/mashup/java/modules/www/js/mashup-utils.js URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/js/mashup-utils.js?rev=17724&r1=17723&r2=17724&view=diff ============================================================================== --- trunk/mashup/java/modules/www/js/mashup-utils.js (original) +++ trunk/mashup/java/modules/www/js/mashup-utils.js Sun Jun 1 06:15:00 2008 @@ -604,7 +604,7 @@ WSO2.MashupUtils.showMashupDownloadingDialog = function (serviceName) { //Creating the form content - var downloadForm = '<form method="post" style="display:inline;" id="downloadForm" name="downloadForm" action="services/ServiceSharingHelper/downloadService">' + + var downloadForm = '<form method="post" style="display:inline;" id="downloadForm" name="downloadForm" action="' + SERVICE_PATH + '/ServiceSharingHelper/downloadService">' + '<input size="10" id="txtServiceName" name="serviceName" type="hidden" value="' + serviceName + '">' + '<table width="100%" border="0" cellspacing="0" cellpadding="0">' + @@ -638,7 +638,7 @@ }; YAHOO.util.Connect.setForm("downloadForm"); - YAHOO.util.Connect.asyncRequest('POST', 'services/ServiceSharingHelper/downloadService', callback, null); + YAHOO.util.Connect.asyncRequest('POST', SERVICE_PATH + '/ServiceSharingHelper/downloadService', callback, null); WSO2.MashupUtils.dialog.close(); } Modified: trunk/mashup/java/modules/www/mashup.jsp URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/mashup.jsp?rev=17724&r1=17723&r2=17724&view=diff ============================================================================== --- trunk/mashup/java/modules/www/mashup.jsp (original) +++ trunk/mashup/java/modules/www/mashup.jsp Sun Jun 1 06:15:00 2008 @@ -64,7 +64,7 @@ // Creating an HTTP version of the current URL to be used when required String httpUrl = - new URL("http", request.getServerName(), ServerManager.getInstance().getHttpPort(), "").toString() + "/"; + new URL("http", request.getServerName(), ServerManager.getInstance().getHttpPort(), "").toString(); %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" @@ -421,26 +421,26 @@ <script type="text/javascript"> function customUiCallback() { document.getElementById("custom_ui_link").innerHTML = - 'View the <a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>/" target="_blank">HTML Interface</a> to the service' + 'View the <a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>/" target="_blank">HTML Interface</a> to the service' } - isCustomUiAvailable('services/<%=author%>/<%= mashup %>', customUiCallback); + isCustomUiAvailable('<%=mashupServerURL%><%=author%>/<%= mashup %>', customUiCallback); </script> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?tryit" title="?tryit" + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?tryit" title="?tryit" target="_blank">Try</a> the service </li> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?gadget" title="?gadget" + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?gadget" title="?gadget" target="_blank">Try</a> the service as a Google Gadget </li> - <li>Read <a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?doc" title="?doc" + <li>Read <a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?doc" title="?doc" target="_blank">API documentation</a> </li> <li>View the <a - href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?source&content-type=text/plain" + href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?source&content-type=text/plain" title="?source" target="_blank">source code</a></li> </ul> @@ -454,31 +454,31 @@ <td> <div class="mashup_details"> <ul> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?wsdl2&annotation=true">WSDL 2.0</a> + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?wsdl2&annotation=true">WSDL 2.0</a> (<a - href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?wsdl2">raw</a>) + href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?wsdl2">raw</a>) </li> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?wsdl&annotation=true">WSDL 1.1</a> + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?wsdl&annotation=true">WSDL 1.1</a> (<a - href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?wsdl">raw</a>) + href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?wsdl">raw</a>) </li> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?xsd&annotation=true">XML Schema</a> + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?xsd&annotation=true">XML Schema</a> (<a - href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?xsd">raw</a>) + href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?xsd">raw</a>) </li> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?stub&content-type=text/plain">Javascript + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?stub&content-type=text/plain">Javascript (DOM) stub</a> - optimum for a cross-browser web page </li> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?stub&lang=e4x&content-type=text/plain">Javascript + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?stub&lang=e4x&content-type=text/plain">Javascript (E4X) stub</a> - optimum for a Firefox web page or Mashup with a fixed IP address </li> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?stub&lang=e4x&localhost=true&content-type=text/plain">Javascript + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?stub&lang=e4x&localhost=true&content-type=text/plain">Javascript (E4X) stub using "localhost" endpoints</a> - optimum for a Mashup hosted on this server </li> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?template&flavor=html">Source code template</a> + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?template&flavor=html">Source code template</a> for an HTML interface for this service </li> - <li><a href="<%=httpUrl%>services/<%=author%>/<%= mashup %>?template&flavor=googlegadget">Source code template</a> + <li><a href="<%=httpUrl%><%=mashupServerURL%><%=author%>/<%= mashup %>?template&flavor=googlegadget">Source code template</a> for a Google Gadget for this service </li> </ul> Modified: trunk/mashup/java/modules/www/stub_gen.jsp URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/stub_gen.jsp?rev=17724&r1=17723&r2=17724&view=diff ============================================================================== --- trunk/mashup/java/modules/www/stub_gen.jsp (original) +++ trunk/mashup/java/modules/www/stub_gen.jsp Sun Jun 1 06:15:00 2008 @@ -43,6 +43,7 @@ <script language="javascript" src="js/common.js" type="text/javascript"></script> <script language="javascript" src="js/mashup-main.js" type="text/javascript"></script> + <script language="javascript" src="js/global_params.js" type="text/javascript"></script> <script language="javascript" src="js/mashup-utils.js" type="text/javascript"></script> <script language="javascript" src="js/yui/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script> @@ -137,7 +138,7 @@ <div class="mashup_title">JavaScript Stub Generator</div> <br> <form id="form" method="post" enctype="multipart/form-data" - action="/services/JavaScriptStubGeneratorService/genarateStub" target="uploadFrame"> + action="<%=axis2ConfigContext.getServicePath()%>/JavaScriptStubGeneratorService/genarateStub" target="uploadFrame"> <table> <tr> @@ -159,7 +160,7 @@ onclick="submitFormAsync('form',true)"/></form> <form id="form2" method="post" enctype="multipart/form-data" - action="/services/JavaScriptStubGeneratorService/genarateStubFromURL" + action="<%=axis2ConfigContext.getServicePath()%>/JavaScriptStubGeneratorService/genarateStubFromURL" target="uploadFrame"> <table> Modified: trunk/mashup/java/modules/www/taskbar.jsp URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/taskbar.jsp?rev=17724&r1=17723&r2=17724&view=diff ============================================================================== --- trunk/mashup/java/modules/www/taskbar.jsp (original) +++ trunk/mashup/java/modules/www/taskbar.jsp Sun Jun 1 06:15:00 2008 @@ -13,13 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. --%> +<%@ page import="org.apache.axis2.context.ConfigurationContext" %> <%@ page import="org.wso2.mashup.webapp.identity.RegistrationBean" %> <%@ page import="org.wso2.mashup.webapp.utils.RegistryUtils" %> <%@ page import="org.wso2.registry.Resource" %> <%@ page import="org.wso2.registry.session.UserRegistry" %> <%@ page import="java.util.ResourceBundle" %> +<%@ page import="org.wso2.mashup.MashupConstants" %> +<%@ page import="org.wso2.wsas.ServerManager" %> <% + ConfigurationContext axis2ConfigContext = ServerManager.getInstance().configContext; + String contextRoot = axis2ConfigContext.getContextRoot(); + if (!contextRoot.endsWith(MashupConstants.FORWARD_SLASH)) { + contextRoot = contextRoot + MashupConstants.FORWARD_SLASH; + } + String mashupServerURL = contextRoot + axis2ConfigContext.getServicePath() + + MashupConstants.FORWARD_SLASH; + ResourceBundle bundle = ResourceBundle.getBundle("UI"); //Setting variables required for the taskbar.jsp String paramMashupServiceName = request.getParameter("mashupServiceName"); @@ -230,7 +241,7 @@ <%if((paramPath != null)&&(paramMashupServiceName != null)){ %> <li> - <a href="services/<%=author%>/<%=paramMashup%>?download">Download this mashup</a> + <a href="<%=mashupServerURL%><%=author%>/<%=paramMashup%>?download">Download this mashup</a> </li> <% }%> Modified: trunk/mashup/java/modules/www/validate_login.jsp URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/validate_login.jsp?rev=17724&r1=17723&r2=17724&view=diff ============================================================================== --- trunk/mashup/java/modules/www/validate_login.jsp (original) +++ trunk/mashup/java/modules/www/validate_login.jsp Sun Jun 1 06:15:00 2008 @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. --%> +<%@ page import="org.apache.axis2.context.ConfigurationContext" %> <%@ page import="org.wso2.mashup.MashupConstants" %> <%@ page import="org.wso2.mashup.utils.MashupUtils" %> <%@ page import="org.wso2.mashup.webapp.utils.RegistryUtils" %> @@ -20,9 +21,17 @@ <%@ page import="org.wso2.registry.jdbc.EmbeddedRegistry" %> <%@ page import="org.wso2.registry.session.UserRegistry" %> <%@ page import="java.util.ResourceBundle" %> +<%@ page import="org.wso2.wsas.ServerManager" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> -<% +<% + ConfigurationContext axis2ConfigContext = ServerManager.getInstance().configContext; + String contextRoot = axis2ConfigContext.getContextRoot(); + if (!contextRoot.endsWith(MashupConstants.FORWARD_SLASH)) { + contextRoot = contextRoot + MashupConstants.FORWARD_SLASH; + } + String mashupServerURL = contextRoot + axis2ConfigContext.getServicePath() + + MashupConstants.FORWARD_SLASH; UserRegistry userRegistry = RegistryUtils.getRegistry(request); //Checking whether the user is logged in _______________________________________________ Mashup-dev mailing list [email protected] http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
