You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2005/05/10 14:10:54 UTC

svn commit: r169454 - in /incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp: WEB-INF/web.xml docroot/js/server_call.js docroot/ui/default.css graph.jsp index.jsp preferences.jsp resultlookup.jsp submit_result.jsp

Author: mreutegg
Date: Tue May 10 05:10:54 2005
New Revision: 169454

URL: http://svn.apache.org/viewcvs?rev=169454&view=rev
Log:
Applying patch provided by Philipp Koch.

Modified:
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/web.xml
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/web.xml?rev=169454&r1=169453&r2=169454&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/web.xml (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/web.xml Tue May 10 05:10:54 2005
@@ -50,7 +50,7 @@
 
         <init-param>
             <param-name>submit-url</param-name>
-            <param-value>http://www.day.com</param-value>
+            <param-value>http://www.day.com/en/product/jsr_170/tck_submit.html</param-value>
             <description>Url pointing to test result submit receiver</description>
         </init-param>
 
@@ -62,10 +62,10 @@
 
         <init-param>
             <param-name>exclude-list-url</param-name>
-            <param-value>excludelisttest.jsp</param-value>
+            <param-value>http://www.day.com/en/product/jsr_170/exclude_list.html</param-value>
             <description>Url pointing to exclude list provider</description>
         </init-param>
 
         <load-on-startup>1</load-on-startup>
     </servlet>
-</web-app>
\ No newline at end of file
+</web-app>

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js?rev=169454&r1=169453&r2=169454&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js Tue May 10 05:10:54 2005
@@ -1,7 +1,11 @@
 var IFrameObj; // our IFrame object
 var IFrameDoc;
 var successfull = false;
+var baseHref;
+
 function callToServer(url) {
+  baseHref = document.location.href.substring(0, document.location.href.lastIndexOf("/"));
+
   if (!document.createElement) {
     return true
   }
@@ -16,6 +20,7 @@
       tempIFrame.style.border='0px';
       tempIFrame.style.width='0px';
       tempIFrame.style.height='0px';
+      tempIFrame.setAttribute('src','excludelisttest.jsp');
       IFrameObj = document.body.appendChild(tempIFrame);
 
       if (document.frames) {
@@ -45,11 +50,13 @@
   return successfull;
 }
 
-function startTest(url, currentVersion, useExcludeList) {
+function startTest(url, currentVersion, useExcludeList, autoupdate) {
     if (!useExcludeList) {
         window.graph.document.location.href="graph.jsp?mode=testnow&useExcludeList=no";
+    } else if (autoupdate){
+        callToServer(url + "?Show=1&checkVersion=" + currentVersion);
     } else {
-        callToServer(url + "?checkVersion=" + currentVersion);
+        window.graph.document.location.href="graph.jsp?mode=testnow&useExcludeList=yes";
     }
 }
 
@@ -57,11 +64,11 @@
         if (!excludeListIsUpToDate(doc)) {
         	// start update process
         	alert("The Exclude List is no more valid.\nGoing to download the the latest version");
-        	updateExcludeList("update_exclude_list.jsp?action=update", doc);
+        	updateExcludeList(baseHref + "/update_exclude_list.jsp?action=update", doc);
         	alert("The Exclude List is update.\nGoing to start the test.");
      	}
 
-     	window.graph.document.location.href="graph.jsp?mode=testnow";
+     	window.graph.document.location.href=baseHref+"/graph.jsp?mode=testnow";
 }
 
 function excludeListIsUpToDate(doc) {

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css?rev=169454&r1=169453&r2=169454&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css Tue May 10 05:10:54 2005
@@ -473,8 +473,8 @@
 	{
 	color: #184054;
 	background-color: #f0f0f0;
-	width: 234px;
-	height: 100px;
+	width: 500px;
+	height: 250px;
 	border: 1px solid #999999;
 	border-bottom: 1px solid #cccccc;
 	border-right: 1px solid #cccccc;
@@ -511,4 +511,4 @@
 	margin: 0px;
 	margin-top: 4px;
 	border: 0px solid #999999;
-	}
\ No newline at end of file
+	}

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp?rev=169454&r1=169453&r2=169454&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp Tue May 10 05:10:54 2005
@@ -153,15 +153,17 @@
         t.run();
 
         // saving test results
-        out.write("<script>parent.statuswin.document.write('" + String.valueOf(t.getNumberOfExecutedTests()) + " tests got executed<br>')</script>'");
+        out.write("<script>parent.statuswin.document.write('" + String.valueOf(t.getNumberOfExecutedTests()) + " tests got executed<br>')</script>");
         out.write("<script>parent.statuswin.document.write('Saving test results...<br>')</script>");
+
         Node results = testResNode.addNode(String.valueOf(startMillies));
         testResNode.save();
         t.storeResults(results);
 
         // test summary
-        out.write("<script>parent.statuswin.document.write('Generating test summary...<br>')</script>'");
+        out.write("<script>parent.statuswin.document.write('Generating test summary...<br>')</script>");
         out.write("<script>parent.statuswin.scrollBy(0,30);</script>");
+
         Map summary = buildSummary(results, repSession);
 
         out.write("<table width=\"100%\">");
@@ -349,4 +351,4 @@
     Map summary = parser.interpretResult(baos.toString());
     return summary;
 }
-%>
\ No newline at end of file
+%>

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp?rev=169454&r1=169453&r2=169454&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp Tue May 10 05:10:54 2005
@@ -31,22 +31,30 @@
     return;
 }
 
+// load download id from file
+Properties props = new Properties();
+InputStream is = RepositoryStub.class.getClassLoader().getResourceAsStream("/download.id");
+String did;
+
+if (is != null) {
+    try {
+        props.load(is);
+        did = props.getProperty("download.id", "undefined");
+    } catch (IOException e) {
+        did = "undefined";
+    }
+} else {
+    did = "undefined";
+}
+
 // copy download id into repo
 if (!repSession.getRootNode().hasNode("licNode")) {
-    Properties props = new Properties();
-    InputStream is = RepositoryStub.class.getClassLoader().getResourceAsStream("/download.id");
-    if (is != null) {
-        try {
-            props.load(is);
-            String did = props.getProperty("download.id");
-            Node licNode = repSession.getRootNode().addNode("licNode", "nt:unstructured");
-            licNode.setProperty("key", did);
-            repSession.getRootNode().save();
-        } catch (IOException e) {
-            throw new RepositoryStubException("Exception reading "
-                    + "/download.id" + ": " + e.toString());
-        }
-    }
+    Node licNode = repSession.getRootNode().addNode("licNode", "nt:unstructured");
+    licNode.setProperty("key", did);
+    repSession.getRootNode().save();
+} else if (!repSession.getRootNode().getNode("licNode").getProperty("key").equals(did)) {
+    repSession.getRootNode().getNode("licNode").setProperty("key", did);
+    repSession.getRootNode().save();
 }
 
 String parent = request.getRequestURI();
@@ -120,9 +128,9 @@
                         <td id="technavcell" colspan="2">
                             <table width="100%">
                                 <tr>
-                                    <td width="10%"><input type="button" value="Start" class="submit" onclick="startTest('<%= RepositoryServlet.getExcludeListUrl() %>','<%= excludeListVersion %>', document.getElementById('excudelist').checked)"></td>
+                                    <td width="10%"><input type="button" value="Start" class="submit" onclick="startTest('<%= RepositoryServlet.getExcludeListUrl() %>','<%= excludeListVersion %>', document.getElementById('excudelist').checked, document.getElementById('autoupdate').checked)"></td>
                                     <td width="20%">Start Test</td>
-                                    <td width="40%" align="center"><input type="checkbox" id="excudelist" checked>Exclude List</td>
+                                    <td width="40%" align="center"><input type="checkbox" id="excudelist" checked>Exclude List&nbsp;<input type="checkbox" id="autoupdate" checked>Auto Update</td>
                                     <td width="20%" align="right">Submit Test Data</td>
                                     <td width="10%" align="right"><input type="button" value="Submit" class="submit" onclick="var strwin = window.open('submit_result.jsp','SubmitTestResult', 'width=500,height=400');strwin.focus()"></td>
                                 </tr>
@@ -222,4 +230,4 @@
             </table>
         </center>
     </body>
-</html>
\ No newline at end of file
+</html>

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp?rev=169454&r1=169453&r2=169454&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp Tue May 10 05:10:54 2005
@@ -24,21 +24,46 @@
 if (repSession == null) {
     return;
 }
-
-String alertBox = "";
+Node rootNode = repSession.getRootNode();
 
 // save download key if needed
 String key = request.getParameter("key");
 if (key != null) {
     // save
-    Node lk = repSession.getRootNode().getNode("licNode");
+    Node lk = rootNode.getNode("licNode");
     if (!key.equals(lk.getProperty("key").getString())) {
         lk.setProperty("key", key);
-        repSession.getRootNode().save();
+        rootNode.save();
     }
 }
 
-Node rootNode = repSession.getRootNode();
+// save exclude list
+String vers =  request.getParameter("version");
+String list =  request.getParameter("excludeList");
+if (vers != null && list != null) {
+    Node excludeListNode = (rootNode.hasNode("excludeList")) ?
+            rootNode.getNode("excludeList") :
+            rootNode.addNode("excludeList", "nt:unstructured");
+
+    excludeListNode.setProperty("version", vers);
+
+    // replace cr's with ","
+    list = list.replaceAll("\r\n", ",");
+    excludeListNode.setProperty("list", list);
+    rootNode.save();
+}
+
+// load exclude list
+String version = "";
+String excludeList = "";
+if (rootNode.hasNode("excludeList")) {
+    Node excludeListNode = rootNode.getNode("excludeList");
+    version = excludeListNode.getProperty("version").getString();
+    excludeList = excludeListNode.getProperty("list").getString();
+
+    // list is comma separated... make it better readable
+    excludeList = excludeList.replace(',', '\n');
+}
 
 %>
 <html>
@@ -46,12 +71,21 @@
         <link rel="stylesheet" href="docroot/ui/default.css" type="text/css" title="style" />
     </head>
     <body style="margin-top:0px;border-width:0px">
-        <%= alertBox %>
         <form name="prefsform" action="preferences.jsp" method="post">
             <table width="100%">
-                <tr><td class="content">Licence Key</td><td class="content"><input name="key" value="<%= rootNode.getNode("licNode").getProperty("key").getString() %>"></td></tr>
+                <tr><th class="content" colspan="2">Download ID</th></tr>
+                <tr><td class="content">ID</td><td class="content"><input name="key" value="<%= rootNode.getNode("licNode").getProperty("key").getString() %>"></td></tr>
                 <tr><td colspan="2"><input type="submit" value="Save" class="submit"></td></tr>
             </table>
         </form>
+
+        <form name="excludelistform" aczion="preferences.jsp" method="post">
+            <table width="100%">
+                <tr><th class="content" colspan="2">ExcludeList</th></tr>
+                <tr><td class="content">Version</td><td class="content"><input name="version" value="<%= version %>"></td></tr>
+                <tr><td class="content">List</td><td class="content"><textarea name="excludeList"><%= excludeList %></textarea></td></tr>
+                <tr><td colspan="2"><input type="submit" value="Save List" class="submit"></td></tr>
+            </table>
+        </form>
     </body>
-</html>
\ No newline at end of file
+</html>

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp?rev=169454&r1=169453&r2=169454&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp Tue May 10 05:10:54 2005
@@ -33,7 +33,7 @@
     // build xml
     Node testroot = repSession.getRootNode().getNode("testing/" + sampleDate);
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
-    repSession.exportSysView(testroot.getPath(), baos, false, false);
+    repSession.exportSystemView(testroot.getPath(), baos, false, false);
     %><%= baos.toString() %><%
     }
-%>
\ No newline at end of file
+%>

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp?rev=169454&r1=169453&r2=169454&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp Tue May 10 05:10:54 2005
@@ -66,7 +66,7 @@
                 properties += propertyNames[i] + "=" + pval + "\n";
             }
 
-            properties = "#repository properties\n";
+            properties += "#repository properties\n";
             RepositoryHelper helper = new RepositoryHelper(WebAppTestConfig.getCurrentConfig());
             String dkeys[] = helper.getRepository().getDescriptorKeys();
             for (int i = 0; i < dkeys.length; i++) {
@@ -76,13 +76,13 @@
             
             // license info
             Node lk = repSession.getRootNode().getNode("licNode");
-            String lickey = lk.getProperty("key").getString();
+            String did = lk.getProperty("key").getString();
             String installid = lk.getUUID();
             %>
             <table width="100%">
                 <tr>
                     <td colspan="2">
-                         <iframe name="userinfo" style="margin-top: 0px;border-top: 1px solid #000000;" src="http://www.day.com" height="200" width="450" frameborder="0"></iframe>
+                         <iframe name="userinfo" style="margin-top: 0px;border-top: 1px solid #000000;" src="<%= RepositoryServlet.getSubmitUrl() %>?downloadidinfo=<%= did %>" height="200" width="450" frameborder="0"></iframe>
                     </td>
                 </tr>
                 <tr>
@@ -120,7 +120,7 @@
                 </tr>
                 <tr>
                     <td colspan="2">
-                        &nbsp;<input type="hidden" name="properties" value="<%= properties %>"><input type="hidden" name="resultxml"><input type="hidden" name="licencekey" value="<%= lickey %>"><input type="hidden" name="istallid" value="<%= installid %>">
+                        &nbsp;<input type="hidden" name="properties" value="<%= properties %>"><input type="hidden" name="resultxml"><input type="hidden" name="downloadid" value="<%= did %>"><input type="hidden" name="installid" value="<%= installid %>">
                     </td>
                 </tr>
                 <tr><td><input type="submit" value="Send" class="submit"></td><td align="right"><input type="button" value="Cancel" class="submit" onclick="window.close();"></td></tr>
@@ -132,4 +132,4 @@
         %>
         </form>
     </body>
-</html>
\ No newline at end of file
+</html>