Author: tyrell Date: Thu Jan 3 03:20:09 2008 New Revision: 11812 Log:
Adding the JavaScript Stub Generator. Added: trunk/mashup/java/modules/www/stub_gen.jsp Added: trunk/mashup/java/modules/www/stub_gen.jsp ============================================================================== --- (empty file) +++ trunk/mashup/java/modules/www/stub_gen.jsp Thu Jan 3 03:20:09 2008 @@ -0,0 +1,164 @@ +<%-- + * Copyright 2006,2007 WSO2, Inc. http://www.wso2.org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +--%> +<%@ page isErrorPage="true" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ page import="com.sun.syndication.feed.synd.SyndContent" %> +<%@ page import="com.sun.syndication.feed.synd.SyndContentImpl" %> +<%@ page import="com.sun.syndication.feed.synd.SyndEntry" %> +<%@ page import="com.sun.syndication.feed.synd.SyndEntryImpl" %> +<%@ page import="com.sun.syndication.feed.synd.SyndFeed" %> +<%@ page import="com.sun.syndication.feed.synd.SyndFeedImpl" %> +<%@ page import="com.sun.syndication.io.SyndFeedOutput" %> +<%@ page import="org.wso2.mashup.MashupConstants" %> +<%@ page import="org.wso2.mashup.utils.QueryResult" %> +<%@ page import="org.wso2.mashup.utils.QueryResults" %> +<%@ page import="org.wso2.mashup.webapp.identity.InfoCardHandler" %> +<%@ page import="org.wso2.mashup.webapp.identity.RegistrationBean" %> +<%@ page import="org.wso2.mashup.webapp.userprofile.User" %> +<%@ page import="org.wso2.mashup.webapp.userprofile.UserQuery" %> +<%@ page import="org.wso2.mashup.webapp.utils.QueryParamUtils" %> +<%@ page import="org.wso2.mashup.webapp.utils.RegistryUtils" %> +<%@ page import="org.wso2.registry.Comment" %> +<%@ page import="org.wso2.registry.LogEntry" %> +<%@ page import="org.wso2.registry.Registry" %> +<%@ page import="org.wso2.registry.RegistryConstants" %> +<%@ page import="org.wso2.registry.RegistryException" %> +<%@ page import="org.wso2.registry.Resource" %> +<%@ page import="org.wso2.registry.Tag" %> +<%@ page import="org.wso2.registry.jdbc.JDBCRegistry" %> +<%@ page import="org.wso2.registry.secure.SecureRegistry" %> +<%@ page import="org.wso2.usermanager.Realm" %> +<%@ page import="org.wso2.usermanager.UserManagerException" %> +<%@ page import="org.wso2.usermanager.verification.email.EmailVerifier" %> +<%@ page import="javax.servlet.ServletContext" %> +<%@ page import="java.net.URL" %> +<%@ page import="java.net.URLDecoder" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.Date" %> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.Map" %> +<% + + Registry registry = RegistryUtils.getRegistry(request); + String bounceback = request.getParameter("bounceback"); + + if (bounceback == null) { + bounceback = "index.jsp"; + } else { + bounceback = URLDecoder.decode(bounceback, "UTF-8"); + } +%> +<html> +<head> + <title>Java Script Stub Generator</title> + <!-- Required CSS --> + <link href="css/styles.css" rel="stylesheet" type="text/css"/> + + <script language="javascript" src="js/common.js" type="text/javascript"></script> + + <script language="javascript" + type="text/javascript">userLoggedOn = <%=RegistryUtils.isLoggedIn(registry) %>;</script> +</head> +<body> +<div id="page"> + <% String thisPage = "stub_gen.jsp"; %> + <%@ include file="header.jsp" %> + <div id="search"></div> + <div id="welcome"> + </div> + <div id="content"> + <h1>JavaScript Stub Genarator</h1> + + <form name="form" method="post" enctype="multipart/form-data" + action="/services/JavaScriptStubGenaratorService/genarateStub" target="uploadFrame"> + + <table> + <tr> + <th align="left">DOM</th> + <td><input type="radio" name="type" value="dom" checked="checked"/></td> + </tr> + <tr> + <th align="left">E4X</th> + <td><input type="radio" name="type" value="e4x"/></td> + </tr> + <tr> + <th align="left">upload WSDL</th> + <td><input type="file" id="wsdl" name="wsdl"/></td> + </tr> + </table> + + <br> + <input type="submit" id="doUpload" name="doUpload" value="OK"/></form> + + <form name="form2" method="post" enctype="multipart/form-data" + action="/services/JavaScriptStubGenaratorService/genarateStubFromURL" + target="uploadFrame"> + + <table> + <tr> + <th align="left">DOM</th> + <td><input type="radio" name="type" value="dom" checked="checked"/></td> + </tr> + <tr> + <th align="left">E4X</th> + <td><input type="radio" name="type" value="e4x"/></td> + </tr> + <tr> + <th align="left">WSDL URL</th> + <td><input type="text" id="url" name="url"/></td> + </tr> + </table> + + <br> + <input type="submit" id="doUpload2" name="doUpload2" value="OK"/></form> + + <div style="height:auto;"> + <textarea id="js-stub" class="codepress javascript" style="width: 100%;height:60%;"> </textarea> + </div> + </div> + + <iframe id="uploadFrame" name="uploadFrame" height="0" width="0" frameborder="0" + scrolling="yes"></iframe> + + <script language="JavaScript" type="text/javascript"> + document.getElementById("js-stub").value = ""; + + var dataCheckerId; + var isDataGathered = false; + + function checkIframe() { + + + if (!isDataGathered) { + var iframeContent = document.getElementById("uploadFrame").contentDocument; + + if (!(iframeContent.baseURI == "about:blank")) { + document.getElementById("js-stub").value = iframeContent.getElementsByTagName("return")[0].textContent; + isDataGathered = true; + } + }else{ + window.clearInterval(dataCheckerId); + } + + } + + dataCheckerId = window.setInterval("checkIframe()", 100); + </script> + <%@ include file="footer.jsp" %> +</div> +</body> +</html> \ No newline at end of file _______________________________________________ Mashup-dev mailing list [email protected] http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
