Author: dam...@jb... Date: 2006-05-02 14:07:46 -0400 (Tue, 02 May 2006) New Revision: 4047 Added: labs/shotoku/branches/qa/lib/taglibs/ labs/shotoku/branches/qa/lib/taglibs/jars/ labs/shotoku/branches/qa/lib/taglibs/jars/jstl.jar labs/shotoku/branches/qa/lib/taglibs/jars/standard.jar labs/shotoku/branches/qa/shotoku-admin/ labs/shotoku/branches/qa/shotoku-admin/maven.xml labs/shotoku/branches/qa/shotoku-admin/project.properties labs/shotoku/branches/qa/shotoku-admin/project.xml labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml labs/shotoku/branches/qa/shotoku-admin/src/ labs/shotoku/branches/qa/shotoku-admin/src/java/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java labs/shotoku/branches/qa/shotoku-admin/src/web/ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/AdministratedService.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/AdministratedServiceGetter.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/AdministratedServiceImpl.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/DomToXmlTransformer.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/PropertiesElementValue.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/PropertiesMap.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/XmlTools.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/web/ labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/web/FilesFromRepoFilter.java labs/shotoku/branches/qa/shotoku-feeds/ labs/shotoku/branches/qa/shotoku-feeds/forge-feeds.iml labs/shotoku/branches/qa/shotoku-feeds/lib/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/jars/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/jars/informa-0.6.0.jar labs/shotoku/branches/qa/shotoku-feeds/maven.xml labs/shotoku/branches/qa/shotoku-feeds/project.properties labs/shotoku/branches/qa/shotoku-feeds/project.xml labs/shotoku/branches/qa/shotoku-feeds/src/ labs/shotoku/branches/qa/shotoku-feeds/src/java/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/AtomFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Feed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedFactory.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FileBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/InformaBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RdfDateFormat.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RdfFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RomeBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Rss2Feed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/TextEscaping.java labs/shotoku/branches/qa/shotoku-feeds/src/web/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/feeds-object.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/jboss-app.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/jboss-web.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/portlet.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/forge.tld labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/portlet.tld labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/web.xml labs/shotoku/branches/qa/shotoku-web/src/java/org/jboss/shotoku/web/admin/ labs/shotoku/branches/qa/src/app/META-INF/login-config.xml Removed: labs/shotoku/branches/qa/lib/taglibs/jars/ labs/shotoku/branches/qa/lib/taglibs/jars/jstl.jar labs/shotoku/branches/qa/lib/taglibs/jars/standard.jar labs/shotoku/branches/qa/shotoku-admin/maven.xml labs/shotoku/branches/qa/shotoku-admin/project.properties labs/shotoku/branches/qa/shotoku-admin/project.xml labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml labs/shotoku/branches/qa/shotoku-admin/src/ labs/shotoku/branches/qa/shotoku-admin/src/java/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java labs/shotoku/branches/qa/shotoku-admin/src/web/ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/web/FilesFromRepoFilter.java labs/shotoku/branches/qa/shotoku-feeds/forge-feeds.iml labs/shotoku/branches/qa/shotoku-feeds/lib/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/jars/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/jars/informa-0.6.0.jar labs/shotoku/branches/qa/shotoku-feeds/maven.xml labs/shotoku/branches/qa/shotoku-feeds/project.properties labs/shotoku/branches/qa/shotoku-feeds/project.xml labs/shotoku/branches/qa/shotoku-feeds/src/ labs/shotoku/branches/qa/shotoku-feeds/src/java/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/AtomFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Feed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedFactory.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FileBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/InformaBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RdfDateFormat.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RdfFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RomeBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Rss2Feed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/TextEscaping.java labs/shotoku/branches/qa/shotoku-feeds/src/web/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/feeds-object.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/jboss-app.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/jboss-web.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/portlet.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/forge.tld labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/portlet.tld labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/web.xml labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/test/ Modified: labs/shotoku/branches/qa/project.properties labs/shotoku/branches/qa/shotoku-base/project.xml labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuService.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceLocal.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/Constants.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnTools.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceLocal.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java labs/shotoku/branches/qa/shotoku-web/shotoku-web.iml labs/shotoku/branches/qa/shotoku-web/src/web/WEB-INF/web.xml Log: MERGED: -r 3696:4046 https://svn.labs.jboss.com/labs/shotoku/trunk into qa for 1.1 continued testing. Copied: labs/shotoku/branches/qa/lib/taglibs (from rev 4046, labs/shotoku/trunk/lib/taglibs) Copied: labs/shotoku/branches/qa/lib/taglibs/jars (from rev 4046, labs/shotoku/trunk/lib/taglibs/jars) Deleted: labs/shotoku/branches/qa/lib/taglibs/jars/jstl.jar =================================================================== (Binary files differ) Copied: labs/shotoku/branches/qa/lib/taglibs/jars/jstl.jar (from rev 4046, labs/shotoku/trunk/lib/taglibs/jars/jstl.jar) Deleted: labs/shotoku/branches/qa/lib/taglibs/jars/standard.jar =================================================================== (Binary files differ) Copied: labs/shotoku/branches/qa/lib/taglibs/jars/standard.jar (from rev 4046, labs/shotoku/trunk/lib/taglibs/jars/standard.jar) Modified: labs/shotoku/branches/qa/project.properties =================================================================== --- labs/shotoku/branches/qa/project.properties 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/project.properties 2006-05-02 18:07:46 UTC (rev 4047) @@ -5,7 +5,7 @@ shotoku.sar.dir=shotoku.sar shotoku.subprojects.cms=base,files,jcr,svn -shotoku.subprojects=${shotoku.subprojects.cms},aop,test,web,portal +shotoku.subprojects=${shotoku.subprojects.cms},aop,test,web,portal,admin maven.final.name=${pom.artifactId} @@ -23,5 +23,8 @@ maven.jar.jboss-system=${shotoku.root.dir}lib/jboss/jars/jboss-system.jar maven.jar.jboss-common=${shotoku.root.dir}lib/jboss/jars/jboss-common.jar +maven.jar.standard=${shotoku.root.dir}lib/taglibs/jars/standard.jar +maven.jar.jstl=${shotoku.root.dir}lib/taglibs/jars/jstl.jar + maven.jar.shotoku-base=${shotoku.root.dir}shotoku-base/target/shotoku-base.jar maven.jar.shotoku-aop=${shotoku.root.dir}shotoku-aop/target/shotoku-aop.jar Copied: labs/shotoku/branches/qa/shotoku-admin (from rev 4046, labs/shotoku/trunk/shotoku-admin) Property changes on: labs/shotoku/branches/qa/shotoku-admin ___________________________________________________________________ Name: svn:ignore + target Deleted: labs/shotoku/branches/qa/shotoku-admin/maven.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/maven.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/maven.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,22 +0,0 @@ -<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> - <goal name="build"> - <attainGoal name="war" /> - </goal> - - <goal name="deploy"> - <ant:copy - file="target/shotoku-admin.war" - todir="${local.deploy.dir}" /> - </goal> - - <goal name="clean"> - <attainGoal name="prj-clean" /> - </goal> - - <!-- TODO remove --> - <goal name="all"> - <attainGoal name="clean" /> - <attainGoal name="build" /> - <attainGoal name="deploy" /> - </goal> -</project> Copied: labs/shotoku/branches/qa/shotoku-admin/maven.xml (from rev 4046, labs/shotoku/trunk/shotoku-admin/maven.xml) Deleted: labs/shotoku/branches/qa/shotoku-admin/project.properties =================================================================== --- labs/shotoku/trunk/shotoku-admin/project.properties 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/project.properties 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,4 +0,0 @@ -maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/ - -maven.final.name=${pom.artifactId} - Copied: labs/shotoku/branches/qa/shotoku-admin/project.properties (from rev 4046, labs/shotoku/trunk/shotoku-admin/project.properties) Deleted: labs/shotoku/branches/qa/shotoku-admin/project.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/project.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/project.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,59 +0,0 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> -<project> - <pomVersion>3</pomVersion> - <extend>../project.xml</extend> - <id>shotoku-admin</id> - <name>Shotoku admin</name> - - <dependencies> - <dependency> - <groupId>shotoku</groupId> - <artifactId>shotoku-base</artifactId> - <jar>shotoku-base.jar</jar> - </dependency> - - <dependency> - <groupId>jboss</groupId> - <artifactId>javax.servlet</artifactId> - <version>1.0</version> - <jar>javax.servlet.jar</jar> - </dependency> - - <dependency> - <groupId>aslibs</groupId> - <artifactId>javax.servlet.jsp</artifactId> - <version>1.0</version> - <jar>javax.servlet.jsp.jar</jar> - </dependency> - - <dependency> - <groupId>taglibs</groupId> - <artifactId>jstl</artifactId> - <version>1.0</version> - <jar>jstl.jar</jar> - <properties> - <war.bundle>true</war.bundle> - </properties> - </dependency> - - <dependency> - <groupId>taglibs</groupId> - <artifactId>standard</artifactId> - <version>1.0</version> - <jar>standard.jar</jar> - <properties> - <war.bundle>true</war.bundle> - </properties> - </dependency> - </dependencies> - - <build> - <sourceDirectory>src/java</sourceDirectory> - <resources> - <resource> - <directory>src/etc</directory> - <include>**/*</include> - </resource> - </resources> - </build> -</project> Copied: labs/shotoku/branches/qa/shotoku-admin/project.xml (from rev 4046, labs/shotoku/trunk/shotoku-admin/project.xml) Deleted: labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml =================================================================== --- labs/shotoku/trunk/shotoku-admin/shotoku-admin.iml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="JAVA_MODULE"> - <component name="ModuleRootManager" /> - <component name="NewModuleRootManager"> - <output url="file://$MODULE_DIR$/target" /> - <exclude-output /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="module" module-name="shotoku-base" /> - <orderEntry type="library" name="jsf" level="application" /> - <orderEntry type="library" name="jboss" level="application" /> - <orderEntryProperties /> - </component> -</module> - Copied: labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml (from rev 4046, labs/shotoku/trunk/shotoku-admin/shotoku-admin.iml) Copied: labs/shotoku/branches/qa/shotoku-admin/src (from rev 4046, labs/shotoku/trunk/shotoku-admin/src) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,84 +0,0 @@ -package org.jboss.shotoku.web.admin; - -import org.jboss.shotoku.service.AdministratedServiceGetter; -import org.jboss.shotoku.service.AdministratedService; -import org.jboss.shotoku.tools.Tools; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletException; -import javax.servlet.ServletResponse; -import java.io.IOException; -import java.util.Calendar; -import java.util.Set; - -/** - * @author Adam Warski (ad...@as...) - */ -public class AdminServlet extends HttpServlet { - public static final String SERVICE_JSP = "/repo-access/services.jsp"; - - private AdministratedService getServiceWithId(String serviceId, - Set<AdministratedServiceGetter> asgs) { - for (AdministratedServiceGetter asg : asgs) { - AdministratedService as = asg.getService(); - if (as.getServiceId().equals(serviceId)) { - return as; - } - } - - return null; - } - - protected void service(HttpServletRequest request, - HttpServletResponse response) - throws ServletException, IOException { - Set<AdministratedServiceGetter> asgs = Tools.getService().getAdministratedServices(); - - String action = request.getParameter("action"); - String serviceId = request.getParameter("serviceId"); - - if ("stop".equals(action)) { - AdministratedService as = getServiceWithId(serviceId, asgs); - if (as != null) { - if (!as.getServiceRunnable()) { - request.setAttribute("status", "Service " + as.getServiceName() + - " is already stopped."); - } else { - as.stop(); - request.setAttribute("status", "Service " + as.getServiceName() + " stopped."); - } - } else { - request.setAttribute("status", "Service with id " + serviceId + " not found."); - } - } - - if ("start".equals(action)) { - AdministratedService as = getServiceWithId(serviceId, asgs); - if (as != null) { - if (as.getServiceRunnable()) { - request.setAttribute("status", "Service " + as.getServiceName() + - " is already started."); - } else { - try { - as.start(); - request.setAttribute("status", "Service " + as.getServiceName() + " started."); - } catch (Exception e) { - request.setAttribute("status", "Starting of service " + as.getServiceName() + - " caused an exception: " + e + ". Look in the log for details."); - e.printStackTrace(); - } - } - } else { - request.setAttribute("status", "Service with id " + serviceId + " not found."); - } - } - - response.setContentType("text/html"); - request.setAttribute("now", Calendar.getInstance().getTimeInMillis()); - request.setAttribute("asgs", asgs); - - request.getRequestDispatcher(SERVICE_JSP).forward(request, response); - } -} Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java) Copied: labs/shotoku/branches/qa/shotoku-admin/src/web (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web) Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/jboss-web.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,9 +0,0 @@ -<?xml version='1.0' encoding='UTF-8' ?> - -<!DOCTYPE jboss-web - PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN" - "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd"> - -<jboss-web> - <security-domain>java:/jaas/shotoku</security-domain> -</jboss-web> Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/jboss-web.xml) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/web.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,54 +0,0 @@ -<?xml version="1.0"?> -<web-app xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee - http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" - version="2.4"> - <filter> - <filter-name>filesFromRepoFilter</filter-name> - <filter-class>org.jboss.shotoku.web.FilesFromRepoFilter</filter-class> - <init-param> - <param-name>repoAccessDir</param-name> - <param-value>repo-access</param-value> - </init-param> - <init-param> - <param-name>contentManagerPrefix</param-name> - <param-value>shotoku-admin</param-value> - </init-param> - </filter> - - <filter-mapping> - <filter-name>filesFromRepoFilter</filter-name> - <url-pattern>/repo-access/*</url-pattern> - <dispatcher>INCLUDE</dispatcher> - <dispatcher>FORWARD</dispatcher> - </filter-mapping> - - <servlet> - <servlet-name>Admin Servlet</servlet-name> - <servlet-class>org.jboss.shotoku.web.admin.AdminServlet</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>Admin Servlet</servlet-name> - <url-pattern>/admin/*</url-pattern> - </servlet-mapping> - - <security-constraint> - <web-resource-collection> - <web-resource-name>All resources</web-resource-name> - <url-pattern>/*</url-pattern> - </web-resource-collection> - <auth-constraint> - <role-name>ShotokuAdmin</role-name> - </auth-constraint> - </security-constraint> - - <security-role> - <role-name>ShotokuAdmin</role-name> - </security-role> - - <login-config> - <auth-method>BASIC</auth-method> - </login-config> -</web-app> Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/web.xml) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/roles.properties 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties 2006-05-02 18:07:46 UTC (rev 4047) @@ -1 +0,0 @@ -ShotokuAdmin=ShotokuAdmin \ No newline at end of file Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/roles.properties) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/users.properties 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties 2006-05-02 18:07:46 UTC (rev 4047) @@ -1 +0,0 @@ -ShotokuAdmin=ShotokuAdmin \ No newline at end of file Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/users.properties) Modified: labs/shotoku/branches/qa/shotoku-base/project.xml =================================================================== --- labs/shotoku/branches/qa/shotoku-base/project.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-base/project.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -5,6 +5,22 @@ <id>shotoku-base</id> <name>Shotoku base</name> +<dependencies> + <dependency> + <groupId>jboss</groupId> + <artifactId>javax.servlet</artifactId> + <version>1.0</version> + <jar>javax.servlet.jar</jar> + </dependency> + + <dependency> + <groupId>aslibs</groupId> + <artifactId>javax.servlet.jsp</artifactId> + <version>1.0</version> + <jar>javax.servlet.jsp.jar</jar> + </dependency> +</dependencies> + <build> <sourceDirectory>src/java</sourceDirectory> <resources> Modified: labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java =================================================================== --- labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2006-05-02 18:07:46 UTC (rev 4047) @@ -23,13 +23,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; +import java.util.*; import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.PropertiesConfiguration; @@ -53,674 +47,756 @@ * @author Damon Sicore (da...@si...) */ public abstract class ContentManager { - /** - * Prefix of this content manager. - */ - private String prefix; + /** + * Prefix of this content manager. + */ + private String prefix; - /** - * Id of a corresponding repository. - */ - private String id; + /** + * Id of a corresponding repository. + */ + private String id; - /** - * A map of initialized velocity engines, The key is a string representation - * of parameters with which an engine was initialized. - */ - private static Map<String, VelocityEngine> engines; + /** + * A map of initialized velocity engines, The key is a string representation + * of parameters with which an engine was initialized. + */ + private static Map<String, VelocityEngine> engines; - /** - * Gets a root directory that is represented by this content manager. - * - * @return A directory that is the root directory of this content manager. - * @throws RepositoryException - */ - public abstract Directory getRootDirectory() throws RepositoryException; + /** + * Gets a root directory that is represented by this content manager. + * + * @return A directory that is the root directory of this content manager. + * @throws RepositoryException + */ + public abstract Directory getRootDirectory() throws RepositoryException; - /** - * Gets the most recent version of a node which can be found under the given - * path (to get nodes from subdirectories, use <code>/</code> to separate - * them). - * - * @param path - * Path for which to get the node. - * @return A node corresponding to the given path. - * @throws ResourceDoesNotExist - * @throws RepositoryException - */ - public abstract Node getNode(String path) throws ResourceDoesNotExist, - RepositoryException; + /** + * Gets the most recent version of a node which can be found under the given + * path (to get nodes from subdirectories, use <code>/</code> to separate + * them). + * + * @param path + * Path for which to get the node. + * @return A node corresponding to the given path. + * @throws ResourceDoesNotExist + * @throws RepositoryException + */ + public abstract Node getNode(String path) throws ResourceDoesNotExist, + RepositoryException; - /** - * Gets a directory which can be found under the given path (to get nodes - * from subdirectories, use <code>/</code> to separate them). - * - * @param path - * Path for which to get the directory. - * @return A directory corresponding to the given path. - * @throws ResourceDoesNotExist - * @throws RepositoryException - */ - public abstract Directory getDirectory(String path) - throws ResourceDoesNotExist, RepositoryException; + /** + * Gets a directory which can be found under the given path (to get nodes + * from subdirectories, use <code>/</code> to separate them). + * + * @param path + * Path for which to get the directory. + * @return A directory corresponding to the given path. + * @throws ResourceDoesNotExist + * @throws RepositoryException + */ + public abstract Directory getDirectory(String path) + throws ResourceDoesNotExist, RepositoryException; - /** - * Performs the given search in this content manager. - * - * @param search - * Search to perform. - * @return A node list that is the result of the search. - */ - public NodeList search(Search search) throws ResourceDoesNotExist { - return search.perform(this); - } + /** + * Performs the given search in this content manager. + * + * @param search + * Search to perform. + * @return A node list that is the result of the search. + */ + public NodeList search(Search search) throws ResourceDoesNotExist { + return search.perform(this); + } - /** - * Gets the id of this repository. - * - * @return Id of this repository. - */ - public String getId() { - return id; - } + /** + * Gets the id of this repository. + * + * @return Id of this repository. + */ + public String getId() { + return id; + } - /** - * Gets the prefix of this content manager. - * - * @return Prefix of this content manager. - */ - public String getPrefix() { - return prefix; - } + /** + * Gets the prefix of this content manager. + * + * @return Prefix of this content manager. + */ + public String getPrefix() { + return prefix; + } - /** - * Saves the given resources at one time. Recommended if you have multiple - * resources to save. - * - * @param resources - * Resources to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public abstract void save(Collection<Resource> resources, String logMessage) - throws SaveException, RepositoryException; + /** + * Saves the given resources at one time. Recommended if you have multiple + * resources to save. + * + * @param resources + * Resources to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public abstract void save(Collection<Resource> resources, String logMessage) + throws SaveException, RepositoryException; - /** - * Deletes the given resources at one time. Recommended if you have multiple - * resources to delete. - * - * @param resources - * Resources to delete. - * @throws DeleteException - * @throws RepositoryException - */ - public abstract void delete(Collection<Resource> resources) - throws DeleteException, RepositoryException; + /** + * Deletes the given resources at one time. Recommended if you have multiple + * resources to delete. + * + * @param resources + * Resources to delete. + * @throws DeleteException + * @throws RepositoryException + */ + public abstract void delete(Collection<Resource> resources) + throws DeleteException, RepositoryException; - /** - * Deletes the given resource. Equivalent to resource.delete(). - * - * @param resource - * Resources to delete. - * @throws DeleteException - * @throws RepositoryException - */ - public void delete(Resource resource) throws DeleteException, - RepositoryException { - List<Resource> toDelete = new ArrayList<Resource>(); - toDelete.add(resource); - delete(toDelete); - } + /** + * Deletes the given resource. Equivalent to resource.delete(). + * + * @param resource + * Resources to delete. + * @throws DeleteException + * @throws RepositoryException + */ + public void delete(Resource resource) throws DeleteException, + RepositoryException { + List<Resource> toDelete = new ArrayList<Resource>(); + toDelete.add(resource); + delete(toDelete); + } - /** - * Saves the given resource. Equivalent to <code>res.save(String)</code>. - * - * @param res - * First resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res, String logMessage) throws SaveException, - RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res); - save(toSave, logMessage); - } + /** + * Saves the given resource. Equivalent to <code>res.save(String)</code>. + * + * @param res + * First resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res, String logMessage) throws SaveException, + RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res); + save(toSave, logMessage); + } - /** - * Saves the given resources at one time. Recommended if you have multiple - * resources to save. - * - * @param logMessage - * Log message to save with. - * @param resources - * Any number of resources - * @throws RepositoryException - * @throws SaveException - */ - public void save(String logMessage, Resource... resources) - throws RepositoryException, SaveException { - List<Resource> toSave = new ArrayList<Resource>(); + /** + * Saves the given resources at one time. Recommended if you have multiple + * resources to save. + * + * @param logMessage + * Log message to save with. + * @param resources + * Any number of resources + * @throws RepositoryException + * @throws SaveException + */ + public void save(String logMessage, Resource... resources) + throws RepositoryException, SaveException { + List<Resource> toSave = new ArrayList<Resource>(); - for (Resource resource : resources) { - toSave.add(resource); - } + for (Resource resource : resources) { + toSave.add(resource); + } - save(toSave, logMessage); - } + save(toSave, logMessage); + } - /** - * Deletes the given resources at one time. Recommended if you have multiple - * resources to delete. - * - * @param resources - * Any number of resources to delete - * @throws DeleteException - * @throws RepositoryException - */ - public void delete(Resource... resources) throws DeleteException, - RepositoryException { - List<Resource> toDelete = new ArrayList<Resource>(); + /** + * Deletes the given resources at one time. Recommended if you have multiple + * resources to delete. + * + * @param resources + * Any number of resources to delete + * @throws DeleteException + * @throws RepositoryException + */ + public void delete(Resource... resources) throws DeleteException, + RepositoryException { + List<Resource> toDelete = new ArrayList<Resource>(); - for (Resource resource : resources) { - toDelete.add(resource); - } + for (Resource resource : resources) { + toDelete.add(resource); + } - delete(toDelete); - } + delete(toDelete); + } - /** - * Saves the given resources at one time. Equivalent to - * <code>save(Collection, String)</code>, where the collection is filled - * with the two given resources. - * - * @param res1 - * First resource to save. - * @param res2 - * Second resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res1, Resource res2, String logMessage) - throws SaveException, RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res1); - toSave.add(res2); - save(toSave, logMessage); - } + /** + * Saves the given resources at one time. Equivalent to + * <code>save(Collection, String)</code>, where the collection is filled + * with the two given resources. + * + * @param res1 + * First resource to save. + * @param res2 + * Second resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res1, Resource res2, String logMessage) + throws SaveException, RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res1); + toSave.add(res2); + save(toSave, logMessage); + } - /** - * Saves the given resources at one time. Equivalent to - * <code>save(Collection, String)</code>, where the collection is filled - * with the three given resources. - * - * @param res1 - * First resource to save. - * @param res2 - * Second resource to save. - * @param res3 - * Third resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res1, Resource res2, Resource res3, - String logMessage) throws SaveException, RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res1); - toSave.add(res2); - toSave.add(res3); - save(toSave, logMessage); - } + /** + * Saves the given resources at one time. Equivalent to + * <code>save(Collection, String)</code>, where the collection is filled + * with the three given resources. + * + * @param res1 + * First resource to save. + * @param res2 + * Second resource to save. + * @param res3 + * Third resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res1, Resource res2, Resource res3, + String logMessage) throws SaveException, RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res1); + toSave.add(res2); + toSave.add(res3); + save(toSave, logMessage); + } - /** - * Saves the given resources at one time. Equivalent to - * <code>save(Collection, String)</code>, where the collection is filled - * with the four given resources. - * - * @param res1 - * First resource to save. - * @param res2 - * Second resource to save. - * @param res3 - * Third resource to save. - * @param res4 - * Fourth resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res1, Resource res2, Resource res3, - Resource res4, String logMessage) throws SaveException, - RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res1); - toSave.add(res2); - toSave.add(res3); - toSave.add(res4); - save(toSave, logMessage); - } + /** + * Saves the given resources at one time. Equivalent to + * <code>save(Collection, String)</code>, where the collection is filled + * with the four given resources. + * + * @param res1 + * First resource to save. + * @param res2 + * Second resource to save. + * @param res3 + * Third resource to save. + * @param res4 + * Fourth resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res1, Resource res2, Resource res3, + Resource res4, String logMessage) throws SaveException, + RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res1); + toSave.add(res2); + toSave.add(res3); + toSave.add(res4); + save(toSave, logMessage); + } - /** - * Saves the given resources at one time. Equivalent to - * <code>save(Collection, String)</code>, where the collection is filled - * with the five given resources. - * - * @param res1 - * First resource to save. - * @param res2 - * Second resource to save. - * @param res3 - * Third resource to save. - * @param res4 - * Fourth resource to save. - * @param res5 - * Fifth resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res1, Resource res2, Resource res3, - Resource res4, Resource res5, String logMessage) - throws SaveException, RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res1); - toSave.add(res2); - toSave.add(res3); - toSave.add(res4); - toSave.add(res5); - save(toSave, logMessage); - } + /** + * Saves the given resources at one time. Equivalent to + * <code>save(Collection, String)</code>, where the collection is filled + * with the five given resources. + * + * @param res1 + * First resource to save. + * @param res2 + * Second resource to save. + * @param res3 + * Third resource to save. + * @param res4 + * Fourth resource to save. + * @param res5 + * Fifth resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res1, Resource res2, Resource res3, + Resource res4, Resource res5, String logMessage) + throws SaveException, RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res1); + toSave.add(res2); + toSave.add(res3); + toSave.add(res4); + toSave.add(res5); + save(toSave, logMessage); + } - /** - * Gets a velocity engine, initialized with default properties, as defined - * in velocity.properties in the shotoku-base jar. Additionaly, the shotoku - * resource loader will be set to read templates from this content manager - * (if shotoku resource loader is defined to be used). - * - * @return A velocity engine initialized with default properties. - * @throws Exception - * In case of a velocity exception/ properties reading - * exception. - */ - public VelocityEngine getVelocityEngine() throws Exception { - return getVelocityEngine(true); - } + /** + * Gets a velocity engine, initialized with default properties, as defined + * in velocity.properties in the shotoku-base jar. Additionaly, the shotoku + * resource loader will be set to read templates from this content manager + * (if shotoku resource loader is defined to be used). + * + * @return A velocity engine initialized with default properties. + * @throws Exception + * In case of a velocity exception/ properties reading + * exception. + */ + public VelocityEngine getVelocityEngine() throws Exception { + return getVelocityEngine(true); + } - /** - * Gets a velocity engine, initialized with default properties, as defined - * in velocity.properties in the shotoku-base jar. - * - * @param addIdPrefix - * True iff id/ prefix properties should be added to the - * properties. - * @return A velocity engine initialized with default properties. - * @throws Exception - * In case of a velocity exception/ properties reading - * exception. - */ - public VelocityEngine getVelocityEngine(boolean addIdPrefix) - throws Exception { - return getVelocityEngine(new HashMap<Object, Object>(), addIdPrefix); - } + /** + * Gets a velocity engine, initialized with default properties, as defined + * in velocity.properties in the shotoku-base jar. + * + * @param addIdPrefix + * True iff id/ prefix properties should be added to the + * properties. + * @return A velocity engine initialized with default properties. + * @throws Exception + * In case of a velocity exception/ properties reading + * exception. + */ + public VelocityEngine getVelocityEngine(boolean addIdPrefix) + throws Exception { + return getVelocityEngine(new HashMap<Object, Object>(), addIdPrefix); + } - /** - * Gets a velocity engine, initialized with default properties, overwritten - * by the given propeties. - * - * @param overProps - * Properties which will be added to velocity configuration. - * @return An initialized velocity engine. - * @throws Exception - * In case of a velocity exception/ properties reading - * exception. - */ - public VelocityEngine getVelocityEngine( - Map<? extends Object, ? extends Object> overProps, - boolean addIdPrefix) throws Exception { - String representation = ""; - for (Object key : overProps.keySet()) { - representation += key + "=" + overProps.get(key) + ","; - } + /** + * Gets a velocity engine, initialized with default properties, overwritten + * by the given propeties. + * + * @param overProps + * Properties which will be added to velocity configuration. + * @return An initialized velocity engine. + * @throws Exception + * In case of a velocity exception/ properties reading + * exception. + */ + public VelocityEngine getVelocityEngine( + Map<? extends Object, ? extends Object> overProps, + boolean addIdPrefix) throws Exception { + String representation = ""; + for (Object key : overProps.keySet()) { + representation += key + "=" + overProps.get(key) + ","; + } - representation += ";" + prefix + ";" + id + ";"; - representation += addIdPrefix; + representation += ";" + prefix + ";" + id + ";"; + representation += addIdPrefix; - VelocityEngine ve = engines.get(representation); - if (ve == null) { - ve = new VelocityEngine(); - Properties props = new Properties(); - props.load(ContentManager.class - .getResourceAsStream(Constants.VELOCITY_PROPERTIES_FILE)); - props.putAll(overProps); + VelocityEngine ve = engines.get(representation); + if (ve == null) { + ve = new VelocityEngine(); + Properties props = new Properties(); + props.load(ContentManager.class + .getResourceAsStream(Constants.VELOCITY_PROPERTIES_FILE)); + props.putAll(overProps); - if (addIdPrefix) { - props.put(Constants.VELOCITY_RL_PREFIX, prefix); - props.put(Constants.VELOCITY_RL_ID, id); - } + if (addIdPrefix) { + props.put(Constants.VELOCITY_RL_PREFIX, prefix); + props.put(Constants.VELOCITY_RL_ID, id); + } - ve.init(props); + ve.init(props); - engines.put(representation, ve); - } + engines.put(representation, ve); + } - return ve; - } + return ve; + } - /** - * Standard constructor. - * - * @param id - * Id of this content manager. - * @param prefix - * Prefix of this content manager, as stated in properties. - * @throws RepositoryException - */ - protected ContentManager(String id, String prefix) - throws RepositoryException { - this.id = id; - this.prefix = Tools.normalizeSlashes(prefix, true); - } + /** + * Standard constructor. + * + * @param id + * Id of this content manager. + * @param prefix + * Prefix of this content manager, as stated in properties. + * @throws RepositoryException + */ + protected ContentManager(String id, String prefix) + throws RepositoryException { + this.id = id; + this.prefix = Tools.normalizeSlashes(prefix, true); + } - /* - * Content manager loading. - */ + /* + * Content manager loading. + */ - private static final Logger log; + private static final Logger log; - /** - * Id of the default content manager. May be overriden by a setting in the - * xml configuration file. - */ - private static String defaultId; + /** + * Id of the default content manager. May be overriden by a setting in the + * xml configuration file. + */ + private static String defaultId; - /** - * Size of the transfer buffer. - */ - private static int transferBufferSize; + /** + * Size of the transfer buffer. + */ + private static int transferBufferSize; - /** - * Default interval of the Shotoku service. - */ - private static int defaultServiceInterval; + /** + * Default interval of the Shotoku service. + */ + private static int defaultServiceInterval; - /** - * <code>contentManagers</code> - map (content manager id -> content - * manager constructor). - */ - private static Map<String, Pair<Constructor, Configuration>> contentManagers; + /** + * <code>contentManagers</code> - map (content manager id -> content + * manager constructor). + */ + private static Map<String, Pair<Constructor, Configuration>> contentManagers; - /** - * <code>props</code> - Shotoku properties, as read from the configuration - * file. - */ - private static PropertiesConfiguration props; + /** + * A set of content manager implementation classes names, which are + * already initialized. + */ + private static Set<String> initializedContentManagers; - /** - * <code>setupDone</code> - a marker to execute setup only once, even if - * the user does it many times by mistake. - */ - private static boolean setupDone; + /** + * A set of content manager ids, which are already initialized. + */ + private static Set<String> initializedIds; - static { - // Setup was not yet executed for sure. - setupDone = false; + /** + * A map content manager implementation class name -> a set of + * ids which use the given implementation. + */ + private static Map<String, Set<String>> implementationsIds; - // When this class is loaded, always reading configuration first. - try { - props = new PropertiesConfiguration(); + /** + * <code>props</code> - Shotoku properties, as read from the configuration + * file. + */ + private static PropertiesConfiguration props; - props.load(ContentManager.class - .getResourceAsStream(Constants.PROPERTIES_FILE)); - } catch (Exception e) { - throw new RuntimeException( - "Error while loading content manager configuration: ", e); - } + /** + * <code>setupDone</code> - a marker to execute setup only once, even if + * the user does it many times by mistake. + */ + private static boolean setupDone; - // Setuping the logger. - if (isEmbedded()) { - BasicConfigurator.configure(); - } + static { + // Setup was not yet executed for sure. + setupDone = false; - log = Logger.getLogger(ContentManager.class); - } + // When this class is loaded, always reading configuration first. + try { + props = new PropertiesConfiguration(); - /** - * Checks if Shotoku is configured to run in embedded mode or not. - * - * @return True iff Shotoku is configured to run in embedded mode. - */ - public static boolean isEmbedded() { - return Tools.isTrue(getProperty(Constants.PROPERTIES_EMBEDDED)); - } + props.load(ContentManager.class + .getResourceAsStream(Constants.PROPERTIES_FILE)); + } catch (Exception e) { + throw new RuntimeException( + "Error while loading content manager configuration: ", e); + } - /** - * Setups the content managers before first used. In embedded mode, should - * be always called once, before any usage of Shotoku classes. In app server - * mode, should be never called by the user. - */ - public static void setup() { - synchronized (ContentManager.class) { - if (setupDone) - return; + // Setuping the logger. + if (isEmbedded()) { + BasicConfigurator.configure(); + } - // Preventing setup to be executed twice. - setupDone = true; - } + log = Logger.getLogger(ContentManager.class); + } - engines = Collections - .synchronizedMap(new HashMap<String, VelocityEngine>()); + /** + * Checks if Shotoku is configured to run in embedded mode or not. + * + * @return True iff Shotoku is configured to run in embedded mode. + */ + public static boolean isEmbedded() { + return Tools.isTrue(getProperty(Constants.PROPERTIES_EMBEDDED)); + } - contentManagers = new HashMap<String, Pair<Constructor, Configuration>>(); + /** + * Setups the content managers before first used. In embedded mode, should + * be always called once, before any usage of Shotoku classes. In app server + * mode, should be never called by the user. + */ + public static void setup() { + synchronized (ContentManager.class) { + if (setupDone) + return; - // Reading the default properties. - defaultId = props.getString(Constants.PROPERTIES_ID_DEFAULT, - Constants.DEFAULT_ID); - transferBufferSize = props.getInt( - Constants.PROPERTIES_TRANSFER_BUF_SIZE, - Constants.DEFAULT_TRANSFER_BUF_SIZE); - defaultServiceInterval = props.getInt( - Constants.PROPERTIES_SERVICE_INTERVAL, - Constants.DEFAULT_SERVICE_INTERVAL); + // Preventing setup to be executed twice. + setupDone = true; + } - // Getting ids of defined content managers. - String[] ids = props.getStringArray(Constants.PROPERTIES_IDS); + engines = Collections + .synchronizedMap(new HashMap<String, VelocityEngine>()); - for (String id : ids) { - try { - Configuration conf = props.subset(Tools.concatenateProperties( - Constants.PROPERTIES_PREFIX, id)); + contentManagers = new HashMap<String, Pair<Constructor, Configuration>>(); + initializedContentManagers = new HashSet<String>(); + initializedIds = new HashSet<String>(); + implementationsIds = new HashMap<String, Set<String>>(); - String implementation = conf - .getString(Constants.PROPERTIES_IMPL_SUFFIX); - Class implClass = Class.forName(implementation); + // Reading the default properties. + defaultId = props.getString(Constants.PROPERTIES_ID_DEFAULT, + Constants.DEFAULT_ID); + transferBufferSize = props.getInt( + Constants.PROPERTIES_TRANSFER_BUF_SIZE, + Constants.DEFAULT_TRANSFER_BUF_SIZE); + defaultServiceInterval = props.getInt( + Constants.PROPERTIES_SERVICE_INTERVAL, + Constants.DEFAULT_SERVICE_INTERVAL); - contentManagers.put(id, new Pair<Constructor, Configuration>( - implClass.getConstructor(String.class, String.class, - Configuration.class), conf)); + // Getting ids of defined content managers. + String[] ids = props.getStringArray(Constants.PROPERTIES_IDS); - // Executing the setup function. - try { - Method setupMethod = implClass.getMethod( - Constants.SETUP_FUNCTION, String.class, - Configuration.class); + for (String id : ids) { + try { + Configuration conf = props.subset(Tools.concatenateProperties( + Constants.PROPERTIES_PREFIX, id)); - setupMethod.invoke(implClass, id, conf); - } catch (NoSuchMethodException e) { - // No setup - doing nothing. - } + String implementation = conf + .getString(Constants.PRO... [truncated message content] |