jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r171107 - in /incubator/jackrabbit/trunk/contrib/tck-webapp: ./ src/java/org/apache/jackrabbit/tck/j2ee/ src/webapp/ src/webapp/WEB-INF/ src/webapp/docroot/imgs/ src/webapp/docroot/js/
Date Fri, 20 May 2005 12:02:53 GMT
Author: mreutegg
Date: Fri May 20 05:02:52 2005
New Revision: 171107

URL: http://svn.apache.org/viewcvs?rev=171107&view=rev
Log:
Apply patch for tck-webapp provided by Philipp Koch.

Added:
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/green.png   (with
props)
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/red.png   (with
props)
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/set_checktime.jsp   (with props)
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/version.id
Modified:
    incubator/jackrabbit/trunk/contrib/tck-webapp/project.xml
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java
    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/download.id
    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/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/project.xml?rev=171107&r1=171106&r2=171107&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/project.xml (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/project.xml Fri May 20 05:02:52 2005
@@ -102,6 +102,13 @@
                 <war.bundle>true</war.bundle>
             </properties>
         </dependency>
+        <dependency>
+            <id>commons-fileupload</id>
+            <version>1.0</version>
+            <properties>
+                <war.bundle>true</war.bundle>
+            </properties>
+        </dependency>
     <!-- -->
     
     <!-- own dependencies (build only) -->

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java?rev=171107&r1=171106&r2=171107&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java
(original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java
Fri May 20 05:02:52 2005
@@ -58,6 +58,12 @@
     /** exclude list url name */
     public static final String  EXCLUDE_LIST_URL = "exclude-list-url";
 
+    /** tck version checker gif path */
+    public static final String  CHECK_TCK_VERSION_GIF_PATH = "check-tck-version-gif";
+
+    /** exclude list version checker gif path */
+    public static final String  CHECK_EXCLUDELIST_VERSION_GIF_PATH = "check-excludelist-version-gif";
+
     /** tck webapp jar path name */
     public static final String  TCK_WEBAPP_JAR_PATH = "tck-webapp-jar-path";
 
@@ -82,6 +88,12 @@
     /** the exclude list url */
     private static String excludeListUrl;
 
+    /** tck version checker path */
+    private static String tckVersionCheckerPath;
+
+    /** the exclude list checker url */
+    private static String excludeListCheckerPath;
+
     /**
      * The init method starts the repository to read/write test results and configuration,
      * sets the jaas config and the user id and the user password
@@ -170,6 +182,12 @@
             // set exclude list url
             excludeListUrl = getServletConfig().getInitParameter(EXCLUDE_LIST_URL);
 
+            // set the tck version checker gif path
+            tckVersionCheckerPath = getServletConfig().getInitParameter(CHECK_TCK_VERSION_GIF_PATH);
+
+            // set the exclude list checker path
+            excludeListCheckerPath = getServletConfig().getInitParameter(CHECK_EXCLUDELIST_VERSION_GIF_PATH);
+
         } catch (RepositoryException e) {
             log_info("Unable to initialize repository: " + e.toString(), e);
             throw new ServletException("Unable to initialize repository: " + e.toString(),
e);
@@ -249,7 +267,30 @@
         return tckWebappJarPath;
     }
 
+    /**
+     * Returns the exclude list url
+     *
+     * @return exclude list provider url
+     */
     public static String getExcludeListUrl() {
         return excludeListUrl;
+    }
+
+    /**
+     * Returns the tck version checker path.
+     *
+     * @return tck version checker path
+     */
+    public static String getTckVersionCheckerPath() {
+        return tckVersionCheckerPath;
+    }
+
+    /**
+     * Returns the excludelist checker url
+     *
+     * @return exclude list checker url
+     */
+    public static String getExcludeListCheckerPath() {
+        return excludeListCheckerPath;
     }
 }

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=171107&r1=171106&r2=171107&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 Fri May 20 05:02:52
2005
@@ -66,6 +66,18 @@
             <description>Url pointing to exclude list provider</description>
         </init-param>
 
+        <init-param>
+            <param-name>check-tck-version-gif</param-name>
+            <param-value>http://dev.day.com/tck.gif</param-value>
+            <description>Url pointing to the tck version checker</description>
+        </init-param>
+
+        <init-param>
+            <param-name>check-excludelist-version-gif</param-name>
+            <param-value>http://dev.day.com/excludelist.gif</param-value>
+            <description>Url pointing to the excludelist version checker</description>
+        </init-param>
+
         <load-on-startup>1</load-on-startup>
     </servlet>
 </web-app>

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/green.png
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/green.png?rev=171107&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/green.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/red.png
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/red.png?rev=171107&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/red.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

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=171107&r1=171106&r2=171107&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 Fri
May 20 05:02:52 2005
@@ -1,100 +1,32 @@
-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
-  }
-  IFrameDoc;
-  if (!IFrameObj && document.createElement) {
-      // create the IFrame and assign a reference to the
-      // object to our global variable IFrameObj.
-      // this will only happen the first time
-      // callToServer() is called
-      var tempIFrame=document.createElement('iframe');
-      tempIFrame.setAttribute('id','RSIFrame');
-      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) {
-        // this is for IE5 Mac, because it will only
-        // allow access to the document object
-        // of the IFrame if we access it through
-        // the document.frames array
-        IFrameObj = document.frames['RSIFrame'];
-      }
-    }
-
-  if (IFrameObj.contentDocument) {
-    // For NS6
-    IFrameDoc = IFrameObj.contentDocument;
-  } else if (IFrameObj.contentWindow) {
-    // For IE5.5 and IE6
-    IFrameDoc = IFrameObj.contentWindow.document;
-  } else if (IFrameObj.document) {
-    // For IE5
-    IFrameDoc = IFrameObj.document;
-  } else {
-    return true;
-  }
-
-  IFrameDoc.location.replace(url);
-
-  return successfull;
-}
-
-function startTest(url, currentVersion, useExcludeList, autoupdate) {
+function startTest(dlurl, checkerurl, currentVersion, useExcludeList) {
     if (!useExcludeList) {
         window.graph.document.location.href="graph.jsp?mode=testnow&useExcludeList=no";
-    } else if (autoupdate){
-        callToServer(url + "?Show=1&checkVersion=" + currentVersion);
     } else {
-        window.graph.document.location.href="graph.jsp?mode=testnow&useExcludeList=yes";
+        if (excludeListIsUpToDate(checkerurl + "?v=" + currentVersion)) {
+            window.graph.document.location.href="graph.jsp?mode=testnow&useExcludeList=yes";
+        } else {
+            if (window.confirm("The Exclude List is out of date.\nPress OK to continue testing
or CANCEL to get pointed to the download page")) {
+                window.graph.document.location.href="graph.jsp?mode=testnow&useExcludeList=yes";
+            } else {
+                var dlwin = window.open(dlurl,'DownloadExcludeList','width=800,height=600')
+            }
+        }
     }
 }
 
-function checkAndUpdate(doc) {
-        if (!excludeListIsUpToDate(doc)) {
-        	// start update process
-        	alert("The Exclude List is no more valid.\nGoing to download the the latest version");
-        	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=baseHref+"/graph.jsp?mode=testnow";
-}
-
-function excludeListIsUpToDate(doc) {
-    var response = doc.getElementById("isUpToDate").innerHTML;
-    if (response == "yes") {
-        return true;
-    } else {
-        return false;
-    }
+function isUpToDate() {
+    return true;
 }
 
-function getExcludeList(doc) {
-    return doc.getElementById("list").innerHTML;
+function isOutOfDate() {
+    return false;
 }
 
-function getVersion(doc) {
-    return doc.getElementById("version").innerHTML;
+function excludeListIsUpToDate(url) {
+    var tester = new Image();
+    tester.onload = isUpToDate;
+    tester.onerror = isOutOfDate;
+    tester.src = url;
 }
 
-function updateExcludeList(url, doc) {
-    var httpcon = document.all ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
-    if (httpcon) {
-    	url += "&version=" + escape(getVersion(doc)) + "&ExcludeList=" + escape(getExcludeList(doc))
-        httpcon.open('POST', url, false);
-        //httpcon.send("version=" + escape(getVersion(doc)) + "&ExcludeList=" + escape(getExcludeList(doc)));
-        httpcon.send(null);
-    }
-}
 

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/download.id
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/download.id?rev=171107&r1=171106&r2=171107&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/download.id (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/download.id Fri May 20 05:02:52
2005
@@ -1 +1 @@
-+download.id="jackrabbit tck check out"
\ No newline at end of file
+download.id=jackrabbit_tck_check_out
\ 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=171107&r1=171106&r2=171107&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp Fri May 20 05:02:52
2005
@@ -66,8 +66,7 @@
             String key = (String) tests.next();
             TestSuite t = (TestSuite) tf.getSuites().get(key);
             Enumeration members = t.tests();
-            out.write("<tr><th class=\"content\">" + t.toString() + "</th><th
style=\"text-align: right;\" colspan=\"2\" " +
-                    "class=\"content\"><a href=\"javascript:showConfig('" + key + "');\">Config</a></th></tr>");
+            out.write("<tr><th class=\"content\" colspan=\"3\">" + t.toString()
+ "</th></tr>");
 
             // list tests ordered by key (level1, level2, ....)
             while (members.hasMoreElements()) {

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=171107&r1=171106&r2=171107&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp Fri May 20 05:02:52
2005
@@ -31,6 +31,9 @@
     return;
 }
 
+// checker intervall
+long checkerIntervall = 3600;
+
 // load download id from file
 Properties props = new Properties();
 InputStream is = getServletConfig().getServletContext().getResource("/download.id").openStream();
@@ -56,7 +59,61 @@
     repSession.getRootNode().getNode("licNode").setProperty("key", did);
     repSession.getRootNode().save();
 }
+// quick and dirty check
+if (repSession.getRootNode().getNode("licNode").canAddMixin("mix:referenceable")) {
+    repSession.getRootNode().getNode("licNode").addMixin("mix:referenceable");
+    repSession.getRootNode().save();
+}
+
+// last version checker time
+long lastChecked = (repSession.getRootNode().hasNode("lastChecked")) ? repSession.getRootNode().getNode("lastChecked").getProperty("time").getLong()
: 0;
+long currentTime = System.currentTimeMillis();
+boolean checkIt = ((lastChecked + checkerIntervall * 1000) < currentTime) || lastChecked
== 0;
+boolean isUpToDate = (repSession.getRootNode().hasNode("lastChecked")) ? repSession.getRootNode().getNode("lastChecked").getProperty("uptodate").getBoolean()
: true;
+
+// load version
+String cVersion;
+is = getServletConfig().getServletContext().getResource("/version.id").openStream();
+
+if (is != null) {
+    try {
+        props.load(is);
+        cVersion = props.getProperty("version.id", "undefined");
+    } catch (IOException e) {
+        cVersion = "undefined";
+    }
+} else {
+    cVersion = "undefined";
+}
+
+// build check version url
+StringBuffer snippet = new StringBuffer(256);
+snippet.append(RepositoryServlet.getTckVersionCheckerPath());
+// install id
+snippet.append("?s=" + repSession.getRootNode().getNode("licNode").getUUID());
+// version
+snippet.append("&v=" + cVersion);
+// download id
+snippet.append("&d=" + repSession.getRootNode().getNode("licNode").getProperty("key").getString());
+// java version
+snippet.append("&j");
+String vendor = System.getProperty("java.vendor");
+if (vendor != null) {
+    int end = vendor.indexOf(' ');
+    if (end != -1) {
+        vendor = vendor.substring(0, end);
+    }
+    snippet.append(vendor);
+    snippet.append(' ');
+}
+snippet.append(System.getProperty("java.version"));
+// os
+snippet.append("&o=" + System.getProperty("os.name") +
+        " " + System.getProperty("os.version"));
+
+String checkVersionUrl = snippet.toString();
 
+// get parent handle
 String parent = request.getRequestURI();
 if (parent.length() > 1) {
     parent = parent.substring(0,parent.lastIndexOf('/'));
@@ -81,9 +138,54 @@
             }
         }
 
+        function setGreen() {
+            var img = document.getElementById('vcheckpic');
+            img.src = "docroot/imgs/green.png";
+            img.setAttribute("title", "The Tck web application is up to date.");
+            // tell server that a check got performed (perform in 24h again)
+            tellChecked(<%= currentTime %>, true);
+        }
+
+        function setRed() {
+            var img = document.getElementById('vcheckpic');
+            img.src = "docroot/imgs/red.png";
+            img.setAttribute("title", "A new Tck version is available.");
+            var link = document.getElementById('vcheckpic_href');
+            link.setAttribute("href", "http://localhost:4302/update.html?did=<%= did %>");
+            link.setAttribute("target", "_new");
+            // tell server that a check got performed (perform in 24h again)
+            tellChecked(<%= currentTime %>, false);
+        }
+
+        function tellChecked(currTime, upToDate) {
+            var httpcon = document.all ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+            if (httpcon) {
+                var url = "set_checktime.jsp?time=" + currTime + "&upToDate=" + upToDate;
+                httpcon.open('GET', url, false);
+                httpcon.send(null);
+            }
+        }
+
+        function checkVersion(checkerurl) {
+            <%
+            if (checkIt) {%>
+                var tester = new Image();
+                tester.onload = setGreen;
+                tester.onerror = setRed;
+                tester.src = checkerurl;
+                <%
+            } else {
+                if (isUpToDate) {
+                    %>setGreen();<%
+                } else {
+                    %>setRed();<%
+                }
+            }%>
+        }
+
     </script>
     </head>
-    <body onload="setImage('logo', 'http://jsr170tools.day.com/crx/crx_main_files/banner_right.gif');">
+    <body onload="setImage('logo', 'http://jsr170tools.day.com/crx/crx_main_files/banner_right.gif');checkVersion('<%=
checkVersionUrl %>');">
         <center>
             <table cellpadding="0" cellspacing="0" border="0" id="maintable">
                 <!-- banner -->
@@ -91,25 +193,28 @@
                     <td class="leadcell"><span class="leadcelltext">TCK for JSR
170<br>Content Repository for Java Technology API</span></td><td class="logocell"><a
target="_blank" href="http://www.day.com" title="www.day.com"><img id="logo" border="0"></td>
                 </tr>
                 <tr>
-                    <td colspan="2" id="technavcell">
-                    <div id="technav">
-                    <%
-                    if (mode.equals("test")) {
-                        %><span class="technavat">Test</span><a href="index.jsp?mode=view">View
Results</a>
-                        <a href="index.jsp?mode=config">Test Config</a><a
href="index.jsp?mode=preferences">Preferences</a><%
-                    } else if (mode.equals("view")){
-                        %><a href="index.jsp?mode=">Test</a><span class="technavat">View
Results</span></a>
-                        <a href="index.jsp?mode=config">Test Config</a><a
href="index.jsp?mode=preferences">Preferences</a><%
-                    } else if (mode.equals("config")){
-                        %><a href="index.jsp?mode=">Test</a><a href="index.jsp?mode=view">View
Results</a>
-                        <span class="technavat">Test Config</span><a href="index.jsp?mode=preferences">Preferences</a><%
-                    } else {
-                        %><a href="index.jsp?mode=">Test</a><a href="index.jsp?mode=view">View
Results</a>
-                        <a href="index.jsp?mode=config">Test Config</a><span
class="technavat">Preferences</span><%
-                    }
-                    %>
-                    </div>
-                </td>
+                    <td id="technavcell">
+                        <div id="technav">
+                        <%
+                        if (mode.equals("test")) {
+                            %><span class="technavat">Test</span><a href="index.jsp?mode=view">View
Results</a>
+                            <a href="index.jsp?mode=config">Test Config</a><a
href="index.jsp?mode=preferences">Preferences</a><%
+                        } else if (mode.equals("view")){
+                            %><a href="index.jsp?mode=">Test</a><span class="technavat">View
Results</span></a>
+                            <a href="index.jsp?mode=config">Test Config</a><a
href="index.jsp?mode=preferences">Preferences</a><%
+                        } else if (mode.equals("config")){
+                            %><a href="index.jsp?mode=">Test</a><a href="index.jsp?mode=view">View
Results</a>
+                            <span class="technavat">Test Config</span><a href="index.jsp?mode=preferences">Preferences</a><%
+                        } else {
+                            %><a href="index.jsp?mode=">Test</a><a href="index.jsp?mode=view">View
Results</a>
+                            <a href="index.jsp?mode=config">Test Config</a><span
class="technavat">Preferences</span><%
+                        }
+                        %>
+                        </div>
+                    </td>
+                    <td align="right" id="technavcell">
+                        <a href="javascript:void(0);" id="vcheckpic_href"><img src="docroot/imgs/green.png"
id="vcheckpic" border="0"></a>
+                    </td>
                 </tr>
                 <%
                 if (mode.equals("test")) {
@@ -128,11 +233,11 @@
                         <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, document.getElementById('autoupdate').checked)"></td>
+                                    <td width="10%"><input type="button" value="Start"
class="submit" onclick="startTest('<%= RepositoryServlet.getExcludeListUrl() %>','<%=
RepositoryServlet.getExcludeListCheckerPath() %>','<%= excludeListVersion %>', document.getElementById('excudelist').checked)"></td>
                                     <td width="20%">Start Test</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="40%" align="center"><input type="checkbox"
id="excudelist" checked>Exclude List&nbsp;</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>
+                                    <td width="10%" align="right"><input type="button"
value="Submit" class="submit" onclick="var strwin = window.open('submit_result.jsp','SubmitTestResult',
'width=470,height=350');strwin.focus()"></td>
                                 </tr>
                             </table>
                         </td>
@@ -167,14 +272,12 @@
                                                 NodeIterator tests = rootNode.getNode("testing").getNodes();
 
                                                 ArrayList al = new ArrayList();
-                                                //hack : todo??
                                                 while (tests.hasNext()) {
                                                     al.add(tests.nextNode());
                                                 }
 
                                                 Collections.reverse(al);
                                                 Iterator itr = al.iterator();
-                                                // eoh
 
                                                 while (itr.hasNext()) {
                                                     Node n = (Node) itr.next();

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=171107&r1=171106&r2=171107&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp Fri May 20 05:02:52
2005
@@ -18,7 +18,13 @@
                      javax.jcr.Node,
                      javax.jcr.RepositoryException,
                      java.util.HashMap,
-                     java.io.IOException"
+                     java.io.IOException,
+                     java.util.List,
+                     org.apache.commons.fileupload.FileUpload,
+                     org.apache.commons.fileupload.DiskFileUpload,
+                     org.apache.commons.fileupload.FileItem,
+                     java.util.Iterator,
+                     java.util.Properties"
 %><%@page session="false" %><%
 Session repSession = RepositoryServlet.getSession();
 if (repSession == null) {
@@ -38,21 +44,35 @@
 }
 
 // save exclude list
-String vers =  request.getParameter("version");
-String list =  request.getParameter("excludeList");
-if (vers != null && list != null) {
-    Node excludeListNode = (rootNode.hasNode("excludeList")) ?
+if(request.getMethod().toLowerCase().equals("post")) {
+    DiskFileUpload upload = new DiskFileUpload();
+
+    // Parse the request
+    List items = upload.parseRequest(request);
+
+    // Process the uploaded items
+    Iterator iter = items.iterator();
+    while (iter.hasNext()) {
+        FileItem item = (FileItem) iter.next();
+        if (!item.isFormField() && item.getFieldName().equals("elfile")) {
+            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();
+            Properties props = new Properties();
+            try {
+                props.load(item.getInputStream());
+                excludeListNode.setProperty("version", props.getProperty("version"));
+                excludeListNode.setProperty("list", props.getProperty("list"));
+                rootNode.save();
+            } catch (IOException e) {
+                %><script>window.alert("Unable to upload file");</script><%
+            }
+        }
+    }
 }
 
+
 // load exclude list
 String version = "";
 String excludeList = "";
@@ -71,7 +91,7 @@
         <link rel="stylesheet" href="docroot/ui/default.css" type="text/css" title="style"
/>
     </head>
     <body style="margin-top:0px;border-width:0px">
-        <form name="prefsform" action="preferences.jsp" method="post">
+        <form name="prefsform" action="preferences.jsp" method="get">
             <table width="100%">
                 <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>
@@ -79,12 +99,13 @@
             </table>
         </form>
 
-        <form name="excludelistform" aczion="preferences.jsp" method="post">
+        <form name="excludelistform" action="preferences.jsp" method="post" enctype="multipart/form-data">
             <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>
+                <tr><td class="content">Exclude List File</td><td class="content"><input
name="elfile" type="file"></td></tr>
+                <tr></tr><td class="content">Version</td><td class="content"><%=
version %></td></tr>
+                <tr><td class="content">List</td><td class="content"><textarea
name="excludeList" readonly><%= excludeList %></textarea></td></tr>
+                <tr><td colspan="2"><input type="submit" value="Upload" class="submit"></td></tr>
             </table>
         </form>
     </body>

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=171107&r1=171106&r2=171107&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp Fri May 20 05:02:52
2005
@@ -21,7 +21,8 @@
                      java.io.IOException,
                      java.io.ByteArrayOutputStream,
                      org.apache.jackrabbit.tck.TestResultParser,
-                     java.util.Map"
+                     java.util.Map,
+                     java.util.Iterator"
 %><%@page session="false" %><%
 Session repSession = RepositoryServlet.getSession();
 if (repSession == null) {
@@ -34,6 +35,25 @@
     Node testroot = repSession.getRootNode().getNode("testing/" + sampleDate);
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     repSession.exportSystemView(testroot.getPath(), baos, false, false);
-    %><%= baos.toString() %><%
+    String results = baos.toString();
+
+    // create summary
+    TestResultParser parser = new TestResultParser();
+    Map summary = parser.interpretResult(baos.toString());
+    %><summary><%
+    Iterator itr = summary.keySet().iterator();
+    String sep = "";
+    while (itr.hasNext()) {
+        String key = (String) itr.next();
+        Boolean passed = (Boolean) summary.get(key);
+
+        String res = (passed.booleanValue()) ? "pass" : "failure";
+
+        %><%= sep %><%= key %>=<%= res %><%
+        sep = ",";
+    }
+    %></summary><%
+    // whole xml results document
+    %><%= results %><%
     }
 %>

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/set_checktime.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/set_checktime.jsp?rev=171107&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/set_checktime.jsp (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/set_checktime.jsp Fri May 20
05:02:52 2005
@@ -0,0 +1,37 @@
+<%--
+Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                    as applicable.
+
+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 import="javax.jcr.Session,
+                     org.apache.jackrabbit.tck.j2ee.RepositoryServlet,
+                     javax.jcr.Node,
+                     javax.jcr.RepositoryException,
+                     java.util.HashMap,
+                     java.io.IOException"
+%><%@page session="false" %><%
+Session repSession = RepositoryServlet.getSession();
+if (repSession == null) {
+    return;
+}
+
+String isUpToDate = request.getParameter("upToDate");
+
+Node lastChecked = (repSession.getRootNode().hasNode("lastChecked")) ?
+        repSession.getRootNode().getNode("lastChecked") :
+        repSession.getRootNode().addNode("lastChecked", "nt:unstructured");
+
+    lastChecked.setProperty("time", System.currentTimeMillis());
+    lastChecked.setProperty("uptodate", (isUpToDate != null && isUpToDate.equals("true"))
? true : false);
+    repSession.save();
+%>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/set_checktime.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

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=171107&r1=171106&r2=171107&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 Fri May 20
05:02:52 2005
@@ -71,7 +71,7 @@
             String dkeys[] = helper.getRepository().getDescriptorKeys();
             for (int i = 0; i < dkeys.length; i++) {
                 String dval = helper.getRepository().getDescriptor(dkeys[i]);
-                properties += dkeys[i] + "\t" + dval + "\n";
+                properties += dkeys[i] + "=" + dval + "\n";
             }
             
             // license info
@@ -119,11 +119,16 @@
                         </select></td>
                 </tr>
                 <tr>
-                    <td colspan="2">
+                    <td colspan="2" class="content">
                         &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>
+                <tr>
+                    <td colspan="2" class="content"><input type="checkbox" name="publishresults"
checked>Publishing test results allowed</td>
+                </tr>
+                <tr>
+                    <td class="content"><input type="submit" value="Send" class="submit"></td><td
align="right" class="content"><input type="button" value="Cancel" class="submit" onclick="window.close();"></td>
+                </tr>
             </table>
             <%
         } else {

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/version.id
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/version.id?rev=171107&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/version.id (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/version.id Fri May 20 05:02:52
2005
@@ -0,0 +1 @@
+version.id=1.0-RC2
\ No newline at end of file



Mime
View raw message