<%-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You 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, javax.jcr.Node, javax.jcr.NodeIterator, java.util.*, java.text.SimpleDateFormat, org.apache.jackrabbit.tck.j2ee.RepositoryServlet, javax.jcr.RepositoryException, java.io.InputStream, org.apache.jackrabbit.test.RepositoryStub, java.io.IOException, org.apache.jackrabbit.test.RepositoryStubException" %><%@page session="false" %><% Session repSession = RepositoryServlet.getSession(); if (repSession == null) { return; } // checker intervall long CHECKER_INTERVALL = 24 * 60 * 60 * 1000; // load download id from file Properties props = new Properties(); InputStream is = getServletConfig().getServletContext().getResource("/download.id").openStream(); 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")) { 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(); } // 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 + CHECKER_INTERVALL) < 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('/')); } String mode = request.getParameter("mode"); mode = (mode == null || mode.equals("")) ? "test" : mode; String exludeListTestMethod = ""; if (mode.equals("test")) { // get exclude list version currently stored in the tck repository String excludeListVersion = ""; if (repSession.getRootNode().hasNode("excludelist")) { Node excludeListNode = repSession.getRootNode().getNode("excludelist"); excludeListVersion = excludeListNode.getProperty("version").getString(); } exludeListTestMethod = (mode.equals("test")) ? "excludeListIsUpToDate('" + RepositoryServlet.getExcludeListCheckerPath() + "?v=" + excludeListVersion + "');" : ""; } %> TCK for JSR170
<% if (mode.equals("test")) { %><% } else if (mode.equals("view")){ %><% } else if (mode.equals("config")){ %><% } else if (mode.equals("preferences")){ %><% } %>
TCK for JSR 170
Content Repository for Java Technology API
<% if (mode.equals("test")) { %>TestView Results Test ConfigPreferences<% } else if (mode.equals("view")){ %>TestView Results Test ConfigPreferences<% } else if (mode.equals("config")){ %>TestView Results Test ConfigPreferences<% } else { %>TestView Results Test ConfigPreferences<% } %>
Start Test Exclude List  Submit Test Data
<% Node rootNode = repSession.getRootNode(); if (rootNode.hasNode("testing")) { %>
Select test to be viewed
<% } %>
Save Configuration