You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by re...@locus.apache.org on 2000/06/14 07:12:20 UTC
cvs commit: jakarta-slide/src/share/org/apache/slide/util AbstractObjectCache.java Configuration.java HashMapObjectCache.java Messages.java ObjectCache.java
remm 00/06/13 22:12:18
Modified: . README RELEASE-PLAN STATUS.html build.xml
lib README
src/conf/catalina/standalone Domain.xml
src/share/org/apache/slide/common Domain.java
DomainAccessToken.java Namespace.java
NamespaceAccessToken.java
NamespaceAccessTokenImpl.java NamespaceConfig.java
SlideError.java SlideException.java
SlideRuntimeException.java XMLMarshaller.java
XMLUnmarshaller.java
src/share/org/apache/slide/content Content.java
ContentImpl.java
src/share/org/apache/slide/macro Macro.java MacroImpl.java
src/share/org/apache/slide/security Security.java
SecurityImpl.java
src/share/org/apache/slide/structure Structure.java
StructureImpl.java
src/share/org/apache/slide/util AbstractObjectCache.java
Configuration.java HashMapObjectCache.java
Messages.java ObjectCache.java
Added: src/clients/avalon/conf Catalina.conf.xml Slide.conf.xml
src/clients/avalon/src/org/apache/slide/common Slide.java
SlideBlock.java
src/clients/avalon/src/org/apache/tomcat Catalina.java
src/clients/avalon/src/org/apache/tomcat/startup
CatalinaBlock.java
Removed: src/conf/catalina/standalone Base.xml Webdav.xml
Log:
- Removed the dependency with log4j
- XML configuration file parsing is now done through the Avalon Configuration utility
- Added a dependency to the Apache Avalon framework
http://java.apache.org/framework/
- Castor XML is not used anymore, but the dependency remains until the next commit
- Added an "avalon-dist" target which builds a Catalina + Slide distribution
based on the Apache Avalon server framework
- The dist target is unchanged (hopefully)
- Updated STATUS, README ... They should be up to date now.
Revision Changes Path
1.5 +54 -37 jakarta-slide/README
Index: README
===================================================================
RCS file: /home/cvs/jakarta-slide/README,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- README 2000/05/16 23:07:30 1.4
+++ README 2000/06/14 05:12:07 1.5
@@ -28,11 +28,11 @@
a directory named "$JAKARTA_HOME/jakarta-ant". If you have downloaded the
source distribution, you will need to build the executable version by
executing the following commands:
-
+
cd $JAKARTA_HOME/jakarta-ant
./bootstrap.sh <-- Unix
bootstrap <-- Windows
-
+
This should result in the creation of a file "ant.jar" in the "lib"
subdirectory, which will be used when building Watchdog.
@@ -41,11 +41,11 @@
"$JAKARTA_HOME/jakarta-servletapi". If you have downloaded the source
distribution, you will need to build the executable version by
executing the following commands:
-
+
cd $JAKARTA_HOME/jakarta-servletapi
./build.sh dist <-- Unix
build dist <-- Windows
-
+
This should result in the creation of a file "servlet.jar" in the "lib"
subdirectory, which will be used when building Watchdog.
@@ -53,32 +53,39 @@
or check it out via anonymous CVS, into a subdirectory named
"$JAKARTA_HOME/jakarta-tomcat". You will need to build the "unpacked"
version of Tomcat to make shared classes available to Catalina:
-
+
cd $JAKARTA_HOME/jakarta-tomcat
./build.sh <-- Unix
build <-- Windows
* Now you can build Catalina as follows:
-
+
cd $JAKARTA_HOME/jakarta-tomcat/proposals/catalina
./build.sh <-- Unix
build <-- Windows
-* Download the Exolab Castor jar at :
- http://castor.exolab.org/download.html
- Either put it the the lib subdirectory, or put it somewhere else and
- add it to your classpath.
- I recommend using Castor 0.8.4.
-
-* Download the latest IBM log4j at :
- http://www.log4j.org
- Either put it the the lib subdirectory, or put it somewhere else and
- add it to your classpath.
-
-* Download Xerces from xml.apache.org and either :
- Either put it the the lib subdirectory, or put it somewhere else and
- add it to your classpath.
+* Try to run Catalina, to see if everything is correctly set up.
+* Download Apache Avalon 2.1 from java.apache.org
+ Home page : http://java.apache.org/framework/index.html
+ http://java.apache.org/framework/dist/Avalon-2.1-dev.zip or
+ http://java.apache.org/framework/dist/Avalon-2.1-dev.tar.gz
+
+* If you plan to run Slide on top of the Avalon server framework, unzip
+ or untar Avalon in a dist/avalon directory, so that your directory
+ structure looks like this :
+ |- jakarta-slide
+ |- jakarta-tomcat
+ |- build
+ |- dist
+ |- avalon
+ Add the ./dist/avalon/bin/blocks/Avalon.jar to your Classpath.
+
+* If Slide is to be run without Avalon, you still need to grab the
+ dist/avalon/bin/Loader.jar and dist/avalon/lib/ApacheJava.jar from
+ Avalon and add them to your classpath. They contain helper utilities,
+ like a logger and a XML configuration file parser which are used by Slide.
+
* It is also recommended that you download and install a JDBC compliant
database. I recommend using Hypersonic SQL, which is a very handy tool for
small applications.
@@ -89,17 +96,17 @@
"$JAKARTA_HOME/jakarta-slide". You can now build an "unpacked" version
of Slide (quicker builds because no time is spent JARing up results)
by executing the following commands:
-
+
cd $JAKARTA_HOME/jakarta-slide
./build.sh <-- Unix
build <-- Windows
* You can also build a binary distribution version of Slide as follows :
-
+
cd $JAKARTA_HOME/jakarta-slide
./build.sh dist <-- Unix
build dist <-- Windows
-
+
This will create a distribution in "$JAKARTA_HOME/dist/slide" that is
equivalent (in file arrangement) to the binary distribution releases
of Slide that can be downloaded from the Jakarta web site at
@@ -108,10 +115,16 @@
- The Tomcat or Catalina JARs
- slide.jar
- scripts to run the DAV server
+
+ It will also create blocks for Catalina and Slide in the dist/avalon/blocks
+ directory, so that Catalina and Slide can be run on top of the Avalon
+ framework.
+ You also have to add the $JAKARTA_HOME/dist/avalon/blocks/Slide.jar to your
+ classpath.
* You can delete the generated files in the "build/slide" and "dist/slide"
directories by executing the following:
-
+
cd $JAKARTA_HOME/jakarta-slide
./build.sh clean <-- Unix
build clean <-- Windows
@@ -143,23 +156,27 @@
=================
You can run the "distribution" version of Slide as follows:
-
-* To start Slide, execute the following commands:
- cd $JAKARTA_HOME/dist/slide
- ./bin/startup.sh <-- Unix
- bin\startup <-- Indows
+* To run Slide, do either :
+ - Without the Avalon framework (not recommended) :
+
+ cd $JAKARTA_HOME/dist/slide
+ ./bin/dav.sh run <-- Unix
+ bin/dav run <-- Windows
+
+ - With the Avalon framework :
+ - Add dist/avalon/blocks/Slide.jar to your classpath
+ - Type :
+
+ cd $JAKARTA_HOME/dist/avalon/bin
+ run.sh <-- Unix
+ run <-- Windows
* You can now access the default web pages from a web browser at URL:
-
- http://localhost:8080
-
-* To stop Slide, execute the following commands:
-
- cd $JAKARTA_HOME/dist/slide
- ./bin/shutdown.sh <-- Unix
- bin\shutdown <-- Windows
+
+ http://localhost
+* To stop Slide, you have to stop either Avalon or Catalina.
Testing the Build
1.3 +0 -2 jakarta-slide/RELEASE-PLAN
Index: RELEASE-PLAN
===================================================================
RCS file: /home/cvs/jakarta-slide/RELEASE-PLAN,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RELEASE-PLAN 2000/05/24 03:18:49 1.2
+++ RELEASE-PLAN 2000/06/14 05:12:07 1.3
@@ -66,8 +66,6 @@
v 1.0
-----
-ETA : 06/06/2000
-
general All the issues in STATUS.html should have been fixed by then
tests Add an easy to run performance test
common Per object type scopes and integration of Cocoon 2 scope matcher
1.9 +6 -31 jakarta-slide/STATUS.html
Index: STATUS.html
===================================================================
RCS file: /home/cvs/jakarta-slide/STATUS.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- STATUS.html 2000/06/01 23:47:32 1.8
+++ STATUS.html 2000/06/14 05:12:07 1.9
@@ -61,13 +61,6 @@
<th width="60%">Action Item</th>
<th width="30%">Volunteers</th>
</tr>
- <tr>
- <td align="center">High</td>
- <td>
- Make Slide Avalon-aware.
- </td>
- <td><a href="mailto:remm@exoffice.com">Remy Maucherat</a></td>
- </tr>
</table>
@@ -82,31 +75,13 @@
<tr>
<td align="center">High</td>
<td>
- Rewrite the XML configuration files handling using either :
- <ul>
- <li>Tomcat's XMLMapper
- <li>Apache Avalon Configuration system
- <li>A combination of those two
- </ul>
- The most likely solution is that Avalon Configuration system will
- be used for everything but data import (including the base
- configuration) and export.
- [org.apache.slide.common.Namespace]
- [org.apache.slide.common.XMLMarshaller]
- [org.apache.slide.common.XMLUnmarshaller]
- </td>
- <td><a href="mailto:remm@exoffice.com">Remy Maucherat</a></td>
- </tr>
- <tr>
- <td align="center">High</td>
- <td>
Put back security and lock checks (which were removed due to a
partial rewrite of the API).
[org.apache.slide.structure]
[org.apache.slide.content]
[org.apache.slide.lock]
</td>
- <td><a href="mailto:remm@exoffice.com">Remy Maucherat</a></td>
+ <td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
</tr>
<tr>
<td align="center">Low</td>
@@ -269,10 +244,10 @@
<tr>
<td align="center">High</td>
<td>
- Integration with Catalina/Tomcat through Catalina/Tomcat servlet
- invoker. Makes sure it works, and fix any issues.
+ Invocation of the WebDAV servlet through a Servlet 2.2 compliant
+ servlet container.
</td>
- <td>---</td>
+ <td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
</tr>
<tr>
<td align="center">Medium</td>
@@ -325,7 +300,7 @@
<td>
Write (or rewrite) some samples.
</td>
- <td><a href="mailto:remm@exoffice.com">Remy Maucherat</a></td>
+ <td><a href="mailto:remm@apache.org">Remy Maucherat</a></td>
</tr>
<tr>
<td align="center">High</td>
@@ -348,7 +323,7 @@
<br>
<div align="center"><hr width="75%"><font size="2">
- $Id: STATUS.html,v 1.8 2000/06/01 23:47:32 remm Exp $
+ $Id: STATUS.html,v 1.9 2000/06/14 05:12:07 remm Exp $
</font></div>
</body>
1.12 +113 -18 jakarta-slide/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-slide/build.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- build.xml 2000/06/06 06:23:04 1.11
+++ build.xml 2000/06/14 05:12:07 1.12
@@ -1,5 +1,6 @@
<project name="Slide" default="main" basedir=".">
-
+
+
<!-- =================================================================== -->
<!-- Prepare -->
<!-- =================================================================== -->
@@ -15,9 +16,11 @@
<property name="servlet.jar"
value="../jakarta-servletapi/lib/servlet.jar" />
<property name="tomcat.build" value="../build/tomcat" />
+ <property name="avalon.dist" value="../dist/avalon" />
<property name="slide.build" value="../build/slide" />
<property name="slide.dist" value="../dist/slide" />
+
<!-- =================================================================== -->
<!-- Prepare -->
<!-- =================================================================== -->
@@ -36,29 +39,35 @@
<copydir src="src/conf" dest="${slide.build}/conf"/>
</target>
+
<!-- =================================================================== -->
<!-- Build All : Main and JavaDoc -->
<!-- =================================================================== -->
<target name="all" depends="clean,main,javadoc"/>
+
<!-- =================================================================== -->
<!-- Build Slide -->
<!-- =================================================================== -->
<target name="main" depends="prepare">
<javac srcdir="src/share" destdir="${slide.build}/classes"
debug="on" deprecation="on"
- excludes="**/CVS/**,**/package.html,**/apache/tomcat/**" />
+ excludes="**/CVS/**,**/package.html,**/apache/tomcat/**,
+ **/common/Slide.java,**/common/SlideBlock.java" />
</target>
+
<!-- =================================================================== -->
<!-- Build Slide, without debug -->
<!-- =================================================================== -->
<target name="no-debug" depends="prepare">
<javac srcdir="src/share" destdir="${slide.build}/classes"
debug="off" deprecation="off"
- excludes="**/CVS/**,**/package.html,**/apache/tomcat/**" />
+ excludes="**/CVS/**,**/package.html,**/apache/tomcat/**,
+ **/common/Slide.java,**/common/SlideBlock.java" />
</target>
+
<!-- =================================================================== -->
<!-- Build some examples -->
<!-- =================================================================== -->
@@ -67,6 +76,7 @@
debug="on" deprecation="on" excludes="**/CVS/**"/>
</target>
+
<!-- =================================================================== -->
<!-- Clean build and distribution directories -->
<!-- =================================================================== -->
@@ -75,6 +85,7 @@
<deltree dir="${slide.dist}"/>
</target>
+
<!-- =================================================================== -->
<!-- Build a standalone Slide server -->
<!-- =================================================================== -->
@@ -85,28 +96,45 @@
author="true" packagenames="org.*" />
</target>
+
<!-- =================================================================== -->
- <!-- Build a standalone Slide server -->
- <!-- This target requires Catalina and Avalon -->
+ <!-- Prepare distribution directories -->
<!-- =================================================================== -->
- <target name="dist" depends="no-debug">
+ <target name="prepare-dist">
+ <echo message="Creating distribution directories" />
<mkdir dir="${slide.dist}" />
<mkdir dir="${slide.dist}/lib" />
<mkdir dir="${slide.dist}/conf" />
<mkdir dir="${slide.dist}/bin" />
<mkdir dir="${slide.dist}/files" />
<delete file="${slide.dist}/lib/slide.jar" />
+ </target>
+
+
+ <!-- =================================================================== -->
+ <!-- Build a standalone Slide server -->
+ <!-- This target requires Catalina and Avalon -->
+ <!-- =================================================================== -->
+ <target name="dist" depends="no-debug,prepare-dist">
+
+ <!-- Building the Catalina-based server -->
+
+ <echo message="Building Catalina JARs" />
<jar jarfile="${slide.dist}/lib/webserver.jar"
basedir="${catalina.build}/classes"
- includes="org/apache/tomcat/**" />
- <javac srcdir="src/clients/tomcat" destdir="${slide.build}/classes"
- debug="off" deprecation="off" excludes="**/CVS/**,**/package.html"
+ includes="org/apache/tomcat/**" />
+ <javac srcdir="src/clients/tomcat"
+ destdir="${slide.build}/classes"
+ debug="off" deprecation="off"
+ includes="**/realm/SlideRelm.java"
classpath="${slide.build}/classes,${catalina.build}/classes" />
<copyfile src="src/etc/MANIFEST.MF"
dest="${slide.build}/classes/MANIFEST.MF" />
<replace file="${slide.build}/classes/MANIFEST.MF"
- token="$$VERSION$$" value="${slide.version}" />
- <copydir src="src/etc" dest="${slide.build}/classes"
+ token="$$VERSION$$"
+ value="${version}" />
+ <copydir src="src/etc"
+ dest="${slide.build}/classes"
includes="LICENSE,README,CHANGELOG" />
<jar jarfile="${slide.dist}/lib/slide.jar"
basedir="${slide.build}/classes"
@@ -117,26 +145,91 @@
basedir="${slide.build}/classes"
manifest="${slide.build}/classes/MANIFEST.MF"
includes="LICENSE,README,CHANGELOG,org/apache/tomcat/**" />
+
+ <echo message="Building WebDAV Servlet JAR" />
<jar jarfile="${slide.dist}/lib/webdav.jar"
basedir="${slide.build}/classes"
manifest="${slide.build}/classes/MANIFEST.MF"
includes="LICENSE,README,CHANGELOG,org/apache/slide/webdav/**" />
- <copydir src="src/conf/catalina/standalone" dest="${slide.dist}"
+
+ <echo message="Update distribution configuration" />
+ <copydir src="src/conf/catalina/standalone"
+ dest="${slide.dist}"
excludes="**/bin/**,**/CVS/**" />
- <copydir src="${slide.build}/lib" dest="${slide.dist}/lib" />
- <copyfile src="${servlet.jar}" dest="${slide.dist}/lib/servlet.jar" />
- <copydir src="src/conf/dist" dest="${slide.dist}/bin"
+ <copydir src="${slide.build}/lib"
+ dest="${slide.dist}/lib" />
+ <copyfile src="${servlet.jar}"
+ dest="${slide.dist}/lib/servlet.jar" />
+ <copydir src="src/conf/dist"
+ dest="${slide.dist}/bin"
includes="*.bat,*.sh" />
+
+ </target>
+
+
+ <!-- =================================================================== -->
+ <!-- Build an Avalon-enabled Catalina - Slide server -->
+ <!-- =================================================================== -->
+ <target name="avalon-dist" depends="dist">
+
+ <!-- Building Avalon blocks -->
+
+ <echo message="Build Avalon blocks" />
+ <javac srcdir="src/clients/avalon/src"
+ destdir="${slide.build}/classes"
+ debug="off"
+ deprecation="off"
+ excludes="**/CVS/**,**/package.html"
+ includes="**/slide/**"
+ classpath="${slide.build}/classes,${catalina.build}/classes,
+ ${avalon.dist}/lib/AvalonInterfaces.jar" />
+ <javac srcdir="src/clients/avalon/src"
+ destdir="${catalina.build}/classes"
+ debug="off"
+ deprecation="off"
+ excludes="**/CVS/**,**/package.html"
+ includes="**/tomcat/**"
+ classpath="${slide.build}/classes,${catalina.build}/classes,
+ ${avalon.dist}/lib/AvalonInterfaces.jar" />
+ <mkdir dir="${slide.build}/classes/conf" />
+ <copyfile src="src/clients/avalon/conf/Slide.conf.xml"
+ dest="${slide.build}/classes/conf/Slide.conf.xml" />
+ <mkdir dir="${catalina.build}/classes/conf" />
+ <copyfile src="src/clients/avalon/conf/Catalina.conf.xml"
+ dest="${catalina.build}/classes/conf/Catalina.conf.xml" />
+
+ <echo message="Adding Slide Avalon block" />
+ <jar jarfile="${avalon.dist}/bin/blocks/Slide.jar"
+ basedir="${slide.build}/classes"
+ manifest="${slide.build}/classes/MANIFEST.MF"
+ includes="LICENSE,README,CHANGELOG,conf/**,org/apache/slide/**" />
+
+ <echo message="Adding Catalina Avalon block" />
+ <jar jarfile="${avalon.dist}/bin/blocks/Catalina.jar"
+ basedir="${catalina.build}/classes"
+ manifest="${slide.build}/classes/MANIFEST.MF"
+ includes="LICENSE,README,CHANGELOG,conf/**,org/apache/tomcat/**" />
+
</target>
+
+ <!-- =================================================================== -->
+ <!-- Build a JMX-enabled Catalina - Slide server -->
<!-- =================================================================== -->
+ <target name="jmx-dist" depends="dist">
+
+ </target>
+
+
+ <!-- =================================================================== -->
<!-- Packages the distribution with ZIP -->
<!-- =================================================================== -->
<target name="package-zip" depends="dist">
<zip zipfile="../dist/${name}-${version}.zip" basedir="${slide.dist}"
includes="**"/>
</target>
-
+
+
<!-- =================================================================== -->
<!-- Packages the distribution with TAR-GZIP -->
<!-- =================================================================== -->
@@ -146,11 +239,13 @@
<gzip zipfile="../dist/${name}-${version}.tar.gz"
src="../${name}-${version}.tar"/>
</target>
-
+
+
<!-- =================================================================== -->
<!-- Packages the distribution with ZIP and TAG-GZIP -->
<!-- =================================================================== -->
<target name="package-all" depends="package-zip, package-tgz">
</target>
-
+
+
</project>
1.3 +6 -4 jakarta-slide/lib/README
Index: README
===================================================================
RCS file: /home/cvs/jakarta-slide/lib/README,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- README 2000/05/16 23:07:32 1.2
+++ README 2000/06/14 05:12:08 1.3
@@ -1,7 +1,9 @@
Put in this directory :
-- The Castor distribution
-- JAXP
-- Xerces
-- log4j
+- JAXP and a JAXP compliant parser
+- The Apache Avalon JARs files :
+ - AvalonInterfaces.jar
+ - Avalon.jar
+ - Loader.jar
+ - ApacheJava.jar
Or alternatively, if you already have them eleswhere, be sure to add them to your classpath.
1.1 jakarta-slide/src/clients/avalon/conf/Catalina.conf.xml
Index: Catalina.conf.xml
===================================================================
<?xml version="1.0"?>
<avalon>
<servicesmap/>
<blocks>
<block class="org.apache.tomcat.startup.CatalinaBlock"
name="Catalina"
implementedInterface="org.apache.tomcat.Catalina"
help="Catalina servlet container.">
<config>
blah
</config>
</block>
</blocks>
</avalon>
1.1 jakarta-slide/src/clients/avalon/conf/Slide.conf.xml
Index: Slide.conf.xml
===================================================================
<?xml version="1.0"?>
<avalon>
<servicesmap>
<service name="Slide">
<resource type="org.apache.avalon.blocks.Logger"
mapTo="ApacheDefaultLogger"/>
</service>
</servicesmap>
<blocks>
<block class="org.apache.slide.common.SlideBlock"
name="Slide"
implementedInterface="org.apache.slide.common.Slide"
help="Slide server">
<!-- Insert here the definitions of the namespaces -->
<namespace name="webdav">
<definition>
<!--descriptorsstore
name="database"
classname="org.apache.slide.store.DescriptorsStoreDatabaseImpl">
<parameter name="driver">org.hsql.jdbcDriver</parameter>
<parameter name="url">HypersonicSQL:database</parameter>
<parameter name="user">sa</parameter>
<parameter name="password"></parameter>
</descriptorsstore-->
<descriptorsstore
name="memory"
classname="org.apache.slide.store.DescriptorsStoreMemoryImpl"/>
<contentstore
name="file"
classname="org.apache.slide.store.ContentStoreFilesystemImpl">
<parameter name="rootpath">files</parameter>
</contentstore>
<!--contentstore
name="tempfiles"
classname="org.apache.slide.store.ContentStoreFilesystemImpl">
<parameter name="rootpath">tempfiles</parameter>
</contentstore-->
<scope
match="/"
descriptorsstore="memory"
contentstore="file"/>
<!--scope
match="/files/temp"
descriptorsstore="memory"
contentstore="tempfiles"/-->
</definition>
<configuration>
<default-action>/actions</default-action>
<userspath>/users</userspath>
<filespath></filespath>
<parameter name="dav">true</parameter>
<parameter name="standalone">true</parameter>
</configuration>
<data>
<objectnode
classname="org.apache.slide.structure.SubjectNode"
uri="/">
<permission
action="/actions"
subject="/users/root"/>
<objectnode
classname="org.apache.slide.structure.SubjectNode"
uri="/users">
<objectnode
classname="org.apache.slide.structure.SubjectNode"
uri="/users/root"/>
</objectnode>
<objectnode
classname="org.apache.slide.structure.ActionNode"
uri="/actions"/>
</objectnode>
</data>
</namespace>
</block>
</blocks>
</avalon>
1.1 jakarta-slide/src/clients/avalon/src/org/apache/slide/common/Slide.java
Index: Slide.java
===================================================================
/*
* $Header: /home/cvs/jakarta-slide/src/clients/avalon/src/org/apache/slide/common/Slide.java,v 1.1 2000/06/14 05:12:09 remm Exp $
* $Revision: 1.1 $
* $Date: 2000/06/14 05:12:09 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.slide.common;
import java.util.Hashtable;
import java.util.Vector;
import java.util.Enumeration;
import java.util.Properties;
import java.io.FileReader;
import java.io.Reader;
import java.io.IOException;
import org.apache.slide.util.Configuration;
import org.apache.slide.structure.*;
import org.apache.slide.content.*;
import org.apache.slide.lock.*;
import org.apache.slide.common.xml.NamespaceDef;
import org.apache.slide.authenticate.SecurityToken;
/**
* Avalon inteface for the Slide service.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
* @version $Revision: 1.1 $
*/
public interface Slide {
// --------------------------------------------------------- Public Methods
/**
* Access a Namespace.
*
* @param token Entity which wants access
* @param namespaceName Name of the namespace on which access is requested
* @return NamespaceAccessToken Access token to the namespace
*/
public NamespaceAccessToken accessNamespace(SecurityToken token,
String namespaceName);
/**
* Close a namespace.
*
* @param token Namespace access token
*/
public void closeNamespace(NamespaceAccessToken token);
/**
* Clsose a namespace.
*
* @param token Entity which wants to close the namespace
* @param namespaceName Name of the namespace
*/
public void closeNamespace(SecurityToken token, String namespaceName);
/**
* Access a Domain.
*
* @param token Service who wants access
* @return DomainAccessToken Access token to the domain
*/
public DomainAccessToken accessDomain(SecurityToken token);
}
1.1 jakarta-slide/src/clients/avalon/src/org/apache/slide/common/SlideBlock.java
Index: SlideBlock.java
===================================================================
/*
* $Header: /home/cvs/jakarta-slide/src/clients/avalon/src/org/apache/slide/common/SlideBlock.java,v 1.1 2000/06/14 05:12:09 remm Exp $
* $Revision: 1.1 $
* $Date: 2000/06/14 05:12:09 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.slide.common;
import java.util.Hashtable;
import java.util.Vector;
import java.util.Enumeration;
import java.util.Properties;
import java.io.FileReader;
import java.io.Reader;
import java.io.IOException;
import org.apache.slide.structure.*;
import org.apache.slide.content.*;
import org.apache.slide.lock.*;
import org.apache.slide.common.xml.NamespaceDef;
import org.apache.slide.authenticate.SecurityToken;
import org.apache.avalon.interfaces.Block;
import org.apache.avalon.interfaces.Interfaces;
import org.apache.avalon.interfaces.Logger;
import org.apache.java.lang.Component;
import org.apache.java.lang.ComponentManager;
import org.apache.java.lang.Configurable;
import org.apache.java.lang.Configuration;
import org.apache.java.lang.Composer;
import org.apache.java.lang.Service;
/**
* Avalon wrapper for Slide.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
* @version $Revision: 1.1 $
*/
public final class SlideBlock
implements Block, Slide {
// ----------------------------------------------------- Instance Variables
/**
* Service locator.
*/
private ComponentManager manager;
/**
* Slide domain.
*/
private Domain domain;
/**
* Configuration.
*/
private Configuration configuration;
// --------------------------------------------------------- Avalon Methods
/**
* Pass the component manager to the composer. The composer implementation
* should use this method to acquire the components it needs for
* execution.
*
* @param manager the component manager to which this composer can
* request the needed components.
* @exception if a required Component is not found, this method
* should throw an <code>IllegalStateException</code> indicating
* the cause of such failure.
*/
public void setComponentManager(ComponentManager manager) {
this.manager = manager;
}
/**
* Pass the configurations to the configurable class. This method
* is always called after the constructor and before any other
* method.
*
* @param configuration The class configuration
* @exception IllegalArgumentException If a required Configuration
* is not found, this method should throw an
* <code>IllegalArgumentException</code> indicating the cause of such
* failure.
*/
public void setConfiguration(Configuration configuration) {
this.configuration = configuration;
}
/**
* Initialize the service. This method is guaranteed to be called always
* after methods in <code>Configurable</code> and <code>Component</code>,
* if the class implements those interfaces and before the run() method
* if the class implements <code>Runnable</code>.
*/
public void init()
throws Exception {
domain = new Domain();
domain.setLogger((Logger) manager.getComponent(Interfaces.LOGGER));
domain.init(configuration);
}
/**
* Destroys the service. This method is guaranteed to be called always
* after the stop() method if this class implements <code>Stoppable</code>.
*/
public void destroy()
throws Exception {
}
// --------------------------------------------------------- Public Methods
/**
* Access a Namespace.
*
* @param token Entity which wants access
* @param namespaceName Name of the namespace on which access is requested
* @return NamespaceAccessToken Access token to the namespace
*/
public NamespaceAccessToken accessNamespace(SecurityToken token,
String namespaceName) {
return domain.accessNamespace(token, namespaceName);
}
/**
* Close a namespace.
*
* @param token Namespace access token
*/
public void closeNamespace(NamespaceAccessToken token) {
token.disconnect();
}
/**
* Clsose a namespace.
*
* @param token Entity which wants to close the namespace
* @param namespaceName Name of the namespace
*/
public void closeNamespace(SecurityToken token, String namespaceName) {
domain.closeNamespace(token, namespaceName);
}
/**
* Access a Domain.
*
* @param token Service who wants access
* @return DomainAccessToken Access token to the domain
*/
public DomainAccessToken accessDomain(SecurityToken token) {
return domain.accessDomain(token);
}
}
1.1 jakarta-slide/src/clients/avalon/src/org/apache/tomcat/Catalina.java
Index: Catalina.java
===================================================================
/*
* $Header: /home/cvs/jakarta-slide/src/clients/avalon/src/org/apache/tomcat/Catalina.java,v 1.1 2000/06/14 05:12:10 remm Exp $
* $Revision: 1.1 $
* $Date: 2000/06/14 05:12:10 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.tomcat;
/**
* Catalina insterface.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
* @version $Revision: 1.1 $
*/
public interface Catalina {
}
1.1 jakarta-slide/src/clients/avalon/src/org/apache/tomcat/startup/CatalinaBlock.java
Index: CatalinaBlock.java
===================================================================
/*
* $Header: /home/cvs/jakarta-slide/src/clients/avalon/src/org/apache/tomcat/startup/CatalinaBlock.java,v 1.1 2000/06/14 05:12:10 remm Exp $
* $Revision: 1.1 $
* $Date: 2000/06/14 05:12:10 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.tomcat.startup;
import java.util.Hashtable;
import java.util.Vector;
import java.util.Enumeration;
import java.util.Properties;
import java.io.FileReader;
import java.io.Reader;
import java.io.IOException;
import org.apache.avalon.interfaces.Block;
import org.apache.avalon.interfaces.Interfaces;
import org.apache.avalon.interfaces.Logger;
import org.apache.java.lang.Component;
import org.apache.java.lang.ComponentManager;
import org.apache.java.lang.Configurable;
import org.apache.java.lang.Configuration;
import org.apache.java.lang.Composer;
import org.apache.java.lang.Service;
import org.apache.tomcat.startup.Catalina;
/**
* Avalon wrapper for Catalina.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
* @version $Revision: 1.1 $
*/
public final class CatalinaBlock
implements Block, org.apache.tomcat.Catalina {
// ----------------------------------------------------- Instance Variables
/**
* Service locator.
*/
private ComponentManager manager;
/**
* Configuration.
*/
private Configuration configuration;
/**
* Catalina instance.
*/
private Catalina catalina;
// --------------------------------------------------------- Avalon Methods
/**
* Pass the component manager to the composer. The composer implementation
* should use this method to acquire the components it needs for
* execution.
*
* @param manager the component manager to which this composer can
* request the needed components.
* @exception if a required Component is not found, this method
* should throw an <code>IllegalStateException</code> indicating
* the cause of such failure.
*/
public void setComponentManager(ComponentManager manager) {
this.manager = manager;
}
/**
* Pass the configurations to the configurable class. This method
* is always called after the constructor and before any other
* method.
*
* @param configuration The class configuration
* @exception IllegalArgumentException If a required Configuration
* is not found, this method should throw an
* <code>IllegalArgumentException</code> indicating the cause of such
* failure.
*/
public void setConfiguration(Configuration configuration) {
this.configuration = configuration;
}
/**
* Initialize the service. This method is guaranteed to be called always
* after methods in <code>Configurable</code> and <code>Component</code>,
* if the class implements those interfaces and before the run() method
* if the class implements <code>Runnable</code>.
*/
public void init()
throws Exception {
catalina = new Catalina();
String[] args = { "start" };
System.setProperty("catalina.home", ".");
catalina.main(args);
}
/**
* Destroys the service. This method is guaranteed to be called always
* after the stop() method if this class implements <code>Stoppable</code>.
*/
public void destroy()
throws Exception {
String[] args = { "stop" };
catalina.main(args);
}
}
1.2 +68 -4 jakarta-slide/src/conf/catalina/standalone/Domain.xml
Index: Domain.xml
===================================================================
RCS file: /home/cvs/jakarta-slide/src/conf/catalina/standalone/Domain.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Domain.xml 2000/05/09 02:47:03 1.1
+++ Domain.xml 2000/06/14 05:12:10 1.2
@@ -1,7 +1,71 @@
<?xml version="1.0"?>
-<s:domain xmlns:s="http://apache.org/Slide.xsd">
+<slide>
+
+ <namespace name="webdav">
+
+ <definition>
+
+ <!--descriptorsstore
+ name="database"
+ classname="org.apache.slide.store.DescriptorsStoreDatabaseImpl">
+ <parameter name="driver">org.hsql.jdbcDriver</parameter>
+ <parameter name="url">HypersonicSQL:database</parameter>
+ <parameter name="user">sa</parameter>
+ <parameter name="password"></parameter>
+ </descriptorsstore-->
+
+ <descriptorsstore
+ name="memory"
+ classname="org.apache.slide.store.DescriptorsStoreMemoryImpl"/>
+
+ <contentstore
+ name="file"
+ classname="org.apache.slide.store.ContentStoreFilesystemImpl">
+ <parameter name="rootpath">files</parameter>
+ </contentstore>
+
+ <scope
+ match="/"
+ descriptorsstore="memory"
+ contentstore="file"/>
+ <!--scope
+ match="/files/temp"
+ descriptorsstore="memory"
+ contentstore="tempfiles"/-->
- <S:namespace-def initfile="Webdav.xml"/>
-
-</s:domain>
\ No newline at end of file
+ </definition>
+
+ <configuration>
+ <default-action>/actions</default-action>
+ <userspath>/users</userspath>
+ <filespath></filespath>
+ <parameter name="dav">true</parameter>
+ <parameter name="standalone">true</parameter>
+ </configuration>
+
+ <data>
+
+ <objectnode
+ classname="org.apache.slide.structure.SubjectNode"
+ uri="/">
+ <permission
+ action="/actions"
+ subject="/users/root"/>
+ <objectnode
+ classname="org.apache.slide.structure.SubjectNode"
+ uri="/users">
+ <objectnode
+ classname="org.apache.slide.structure.SubjectNode"
+ uri="/users/root"/>
+ </objectnode>
+ <objectnode
+ classname="org.apache.slide.structure.ActionNode"
+ uri="/actions"/>
+ </objectnode>
+
+ </data>
+
+ </namespace>
+
+</slide>
1.5 +259 -18 jakarta-slide/src/share/org/apache/slide/common/Domain.java
Index: Domain.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Domain.java 2000/06/01 23:47:34 1.4
+++ Domain.java 2000/06/14 05:12:11 1.5
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v 1.4 2000/06/01 23:47:34 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2000/06/01 23:47:34 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v 1.5 2000/06/14 05:12:11 remm Exp $
+ * $Revision: 1.5 $
+ * $Date: 2000/06/14 05:12:11 $
*
* ====================================================================
*
@@ -68,16 +68,23 @@
import java.util.Enumeration;
import java.util.Properties;
import java.io.FileReader;
+import java.io.FileInputStream;
import java.io.Reader;
import java.io.IOException;
-import org.log4j.Category;
-import org.log4j.BasicConfigurator;
-import org.apache.slide.util.Configuration;
import org.apache.slide.structure.*;
import org.apache.slide.content.*;
import org.apache.slide.lock.*;
import org.apache.slide.common.xml.NamespaceDef;
import org.apache.slide.authenticate.SecurityToken;
+import org.apache.avalon.interfaces.Logger;
+import org.apache.java.lang.ConfigurationException;
+import org.apache.java.lang.Configuration;
+import org.apache.avalon.loader.Populate;
+import org.apache.avalon.loader.ConfigurationElement;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import org.xml.sax.*;
+import org.xml.sax.helpers.*;
/**
* Domain class.
@@ -85,7 +92,7 @@
* For now, does not implement access control on Namespaces.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public final class Domain {
@@ -94,30 +101,30 @@
/**
- * Log4j category associated with this package.
+ * Namespaces hashtable.
*/
- final static Category CAT = Category.getInstance(Domain.class.getName());
+ private static Hashtable namespaces;
/**
- * Namespaces hashtable.
+ * Avalon logger.
*/
- private static Hashtable namespaces;
+ private static Logger logger;
// ----------------------------------------------------- Static Initializer
-
+ /*
static {
BasicConfigurator.configure();
- CAT.info("Initializing Domain");
+ info("Initializing Domain");
namespaces = new Hashtable();
// Now initializing the domain
// Loading configuration
Properties configuration = Configuration.getDefault();
- CAT.info("Domain configuration : " + configuration.toString());
+ info("Domain configuration : " + configuration.toString());
// First, retrieve the domain XML definition file from
// the configuration
@@ -132,9 +139,9 @@
throw new DomainInitializationFailedError(e.getMessage());
}
- CAT.info("Domain initialization complete");
- }
-
+ info("Domain initialization complete");
+ }
+ */
// --------------------------------------------------------- Public Methods
@@ -148,7 +155,10 @@
*/
public static NamespaceAccessToken accessNamespace(SecurityToken token,
String namespaceName) {
-
+
+ if (namespaces == null)
+ selfInit();
+
Namespace namespace = (Namespace) namespaces.get(namespaceName);
if (namespace == null)
return null;
@@ -196,6 +206,103 @@
}
+ // --------------------------------------------------------- Logger Methods
+
+
+ /**
+ * Log.
+ *
+ * @param data The object to log.
+ * @param channel The channel name used for logging.
+ * @param level The level used for logging.
+ */
+ public static void log(Object data, String channel, int level) {
+ if (logger != null)
+ logger.log(data, channel, level);
+ else
+ System.out.println("Slide - " + level + " - " + data);
+ }
+
+
+ /**
+ * Log.
+ *
+ * @param data The object to log.
+ * @param level The level used for logging.
+ */
+ public static void log(Object data, int level) {
+ if (logger != null)
+ logger.log(data, level);
+ else
+ System.out.println("Slide - " + level + " - " + data);
+ }
+
+
+ /**
+ * Log.
+ *
+ * @param data The object to log.
+ */
+ public static void log(Object data) {
+ if (logger != null)
+ logger.log(data);
+ else
+ System.out.println("Slide - " + data);
+ }
+
+
+ /**
+ * Debug.
+ *
+ * @param data The object to log
+ */
+ public static void debug(Object data) {
+ log(data, Logger.DEBUG);
+ }
+
+
+ /**
+ * Error.
+ *
+ * @param data The object to log
+ */
+ public static void error(Object data) {
+ log(data, Logger.ERROR);
+ }
+
+
+ /**
+ * Error.
+ *
+ * @param data The object to log
+ * @param t Throwable object
+ */
+ public static void error(Object data, Throwable t) {
+ log(data + " - " + t.getMessage(), Logger.ERROR);
+ t.printStackTrace();
+ }
+
+
+ /**
+ * Info.
+ *
+ * @param data The object to log
+ */
+ public static void info(Object data) {
+ log(data, Logger.INFO);
+ }
+
+
+ /**
+ * Warning.
+ *
+ * @param data The object to log
+ */
+ public static void warn(Object data) {
+ log(data, Logger.WARNING);
+ }
+
+
// -------------------------------------------------------- Package Methods
@@ -220,6 +327,48 @@
}
+ /**
+ * Set the logger to be used by Slide.
+ */
+ static void setLogger(Logger avalonLogger) {
+ logger = avalonLogger;
+ }
+
+
+ /**
+ * Domain initialization routine using Avalon configuration parser.
+ *
+ * @param configuration Avalon configuration object
+ */
+ static void init(Configuration configuration) {
+
+ info("Initializing Domain");
+
+ namespaces = new Hashtable();
+
+ // Now initializing the domain
+
+ // Loading configuration
+ Properties properties =
+ org.apache.slide.util.Configuration.getDefault();
+ info("Domain configuration : " + properties.toString());
+
+ Enumeration namespaceDefinitions =
+ configuration.getConfigurations("namespace");
+
+ while (namespaceDefinitions.hasMoreElements()) {
+
+ initNamespace((Configuration) namespaceDefinitions.nextElement());
+
+ }
+
+ if (namespaces.isEmpty()) {
+ throw new DomainInitializationFailedError();
+ }
+
+ }
+
+
// -------------------------------------------------------- Private Methods
@@ -259,6 +408,98 @@
if (namespaces.isEmpty()) {
throw new DomainInitializationFailedError();
}
+ }
+
+
+ /**
+ * Initializes a new namespace based on the given configuration data.
+ *
+ * @param configuration Configuration object
+ */
+ private static void initNamespace(Configuration configuration) {
+
+ try {
+
+ try {
+ info("Initializing namespace : "
+ + configuration.getAttribute("name"));
+ } catch (ConfigurationException e) {
+ e.printStackTrace();
+ }
+
+ Configuration namespaceDefinition =
+ configuration.getConfiguration("definition");
+
+ Namespace namespace = new Namespace();
+ namespace.setName(configuration.getAttribute("name"));
+ namespace.loadDefinition(namespaceDefinition);
+ addNamespace(namespace);
+
+ try {
+ Configuration namespaceBaseDataDefinition =
+ configuration.getConfiguration("data");
+ namespace.loadBaseData(namespaceBaseDataDefinition);
+ } catch (ConfigurationException e) {
+ info("No basedata found for the namespace");
+ }
+
+ Configuration namespaceConfigurationDefinition =
+ configuration.getConfiguration("configuration");
+ namespace.loadConfiguration(namespaceConfigurationDefinition);
+
+ info("Namespace configuration complete");
+
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+
+ }
+
+ /**
+ * Default initialization of the domain.
+ */
+ private static void selfInit() {
+
+ info("Auto-Initializing Domain");
+ namespaces = new Hashtable();
+
+ // Now initializing the domain
+
+ // Loading configuration
+ Properties configuration =
+ org.apache.slide.util.Configuration.getDefault();
+ info("Domain configuration : " + configuration.toString());
+
+ // First, retrieve the domain XML definition file from
+ // the configuration
+ String fileName =
+ org.apache.slide.util.Configuration.getDefault().getProperty
+ (org.apache.slide.util.Configuration.Property.DomainInitFilename,
+ "Domain.xml");
+
+ try {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(false);
+ factory.setValidating(false);
+ SAXParser parser = factory.newSAXParser();
+
+ FileInputStream is = new FileInputStream(fileName);
+ //init(reader);
+ Populate pop = new Populate();
+ Configuration slideConfiguration =
+ new ConfigurationElement(pop.load(new InputSource(is),
+ parser.getParser()));
+
+ init(slideConfiguration);
+
+ } catch (javax.xml.parsers.FactoryConfigurationError e) {
+ throw new DomainInitializationFailedError(e.getMessage());
+ } catch (Exception e) {
+ throw new DomainInitializationFailedError(e.getMessage());
+ }
+
+ info("Domain initialization complete");
+
}
1.3 +4 -5 jakarta-slide/src/share/org/apache/slide/common/DomainAccessToken.java
Index: DomainAccessToken.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/DomainAccessToken.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DomainAccessToken.java 2000/05/16 23:07:34 1.2
+++ DomainAccessToken.java 2000/06/14 05:12:12 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/DomainAccessToken.java,v 1.2 2000/05/16 23:07:34 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:34 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/DomainAccessToken.java,v 1.3 2000/06/14 05:12:12 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:12 $
*
* ====================================================================
*
@@ -68,13 +68,12 @@
import java.util.Enumeration;
import java.io.IOException;
import java.io.Reader;
-import org.log4j.Category;
/**
* Domain accessor token class.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public final class DomainAccessToken {
1.3 +350 -34 jakarta-slide/src/share/org/apache/slide/common/Namespace.java
Index: Namespace.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Namespace.java 2000/05/16 23:07:34 1.2
+++ Namespace.java 2000/06/14 05:12:12 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.2 2000/05/16 23:07:34 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:34 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.3 2000/06/14 05:12:12 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:12 $
*
* ====================================================================
*
@@ -72,19 +72,20 @@
import java.io.Writer;
import java.io.FileReader;
import java.io.IOException;
-import org.log4j.Category;
import org.apache.slide.structure.*;
import org.apache.slide.content.*;
import org.apache.slide.lock.*;
import org.apache.slide.security.*;
import org.apache.slide.store.*;
import org.apache.slide.authenticate.CredentialsToken;
+import org.apache.java.lang.Configuration;
+import org.apache.java.lang.ConfigurationException;
/**
* Namespace class.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public final class Namespace {
@@ -93,13 +94,6 @@
/**
- * Log4j category associated with this package.
- */
- final static Category CAT =
- Category.getInstance(Namespace.class.getName());
-
-
- /**
* Namespace name.
*/
private String name;
@@ -278,7 +272,7 @@
while (serviceList.hasMoreElements()) {
Service service = (Service) serviceList.nextElement();
try {
- CAT.info("Initializing service " + service);
+ Domain.info("Initializing service " + service);
service.initialize(new NamespaceAccessTokenImpl(this));
} catch (ServiceInitializationFailedException e) {
// We add the exception which just occured to the
@@ -292,7 +286,7 @@
while (serviceList.hasMoreElements()) {
Service service = (Service) serviceList.nextElement();
try {
- CAT.info("Initializing service " + service);
+ Domain.info("Initializing service " + service);
service.initialize(new NamespaceAccessTokenImpl(this));
} catch (ServiceInitializationFailedException e) {
// We add the exception which just occured to the
@@ -357,7 +351,7 @@
try {
Service service = (Service) connectedServices.elementAt(i);
if (service.isConnected()) {
- CAT.info("Shutting down service " + service);
+ Domain.info("Shutting down service " + service);
service.disconnect();
}
} catch (ServiceDisconnectionFailedException e) {
@@ -496,10 +490,157 @@
/**
+ * Parses the contents of the specified definition object, and uses that
+ * info to initialize the namespace.
+ *
+ * @param definition Definiton of the scopes and stores of
+ * the namespace
+ * @exception SlideException Something went wrong during registry or
+ * services initialization
+ * @exception ConfigurationException Error parsing configuration file
+ */
+ void loadDefinition(Configuration definition)
+ throws SlideException, ConfigurationException {
+
+ Domain.info("Loading namespace definition");
+
+ // Loading Descriptors stores
+
+ Hashtable descriptorsStoresClass = new Hashtable();
+ Hashtable descriptorsStoresParameters = new Hashtable();
+
+ Enumeration descriptorsStoreDefinitions =
+ definition.getConfigurations("descriptorsstore");
+
+ while (descriptorsStoreDefinitions.hasMoreElements()) {
+ loadDescriptorsStoreDefinition
+ ((Configuration) descriptorsStoreDefinitions.nextElement(),
+ descriptorsStoresClass, descriptorsStoresParameters);
+ }
+
+ // Loading Content stores
+
+ Hashtable contentStoresClass = new Hashtable();
+ Hashtable contentStoresParameters = new Hashtable();
+
+ Enumeration contentStoreDefinitions =
+ definition.getConfigurations("contentstore");
+
+ while (contentStoreDefinitions.hasMoreElements()) {
+ loadContentStoreDefinition
+ ((Configuration) contentStoreDefinitions.nextElement(),
+ contentStoresClass, contentStoresParameters);
+ }
+
+ Enumeration scopeDefinitions =
+ definition.getConfigurations("scope");
+
+ while (scopeDefinitions.hasMoreElements()) {
+ loadScopeDefinition
+ ((Configuration) scopeDefinitions.nextElement(),
+ descriptorsStoresClass, descriptorsStoresParameters,
+ contentStoresClass, contentStoresParameters);
+ }
+
+ // Initialize all loaded services.
+ initializeServices();
+
+ }
+
+
+ /**
* Parses the contents of the specified reader, and uses that info to
* initialize the specified Slide namespace.
*
- * @param namespace Namespace
+ * @param namespaceBaseDataDefinition Namespace base data
+ * @exception SlideException Something went wrong during registry or
+ * services initialization
+ */
+ void loadBaseData(Configuration namespaceBaseDataDefinition)
+ throws SlideException, ConfigurationException {
+
+ Domain.info("Loading namespace " + getName() + " base data");
+
+ // Load Namespace Base Data
+ try {
+
+ // First, we create the root node
+ Uri rootUri = getUri("/");
+ SubjectNode rootNode = new SubjectNode("/");
+ NodePermission allAccess = new NodePermission("/", "/", "/");
+ rootUri.getDescriptorsStore().createObject(rootUri, rootNode);
+ rootUri.getDescriptorsStore()
+ .grantPermission(rootUri, allAccess);
+
+ // Create a dummy action
+ Uri tempActionUri = getUri("/tempaction");
+ ActionNode tempAction = new ActionNode("/tempaction");
+ tempActionUri.getDescriptorsStore()
+ .createObject(tempActionUri, tempAction);
+
+ // Create the dummy configuration
+ config = new NamespaceConfig();
+ config.initializeAsDummyConfig(this);
+
+ // Create the Access token
+ NamespaceAccessToken token =
+ new NamespaceAccessTokenImpl(this);
+
+ token.importData(new CredentialsToken(new String("/")),
+ namespaceBaseDataDefinition);
+
+ // Then, destroy the temp action
+ tempActionUri.getDescriptorsStore()
+ .removeObject(tempActionUri, tempAction);
+
+ // And remove the all permission from the root node
+ rootNode = (SubjectNode) rootUri.getDescriptorsStore()
+ .retrieveObject(rootUri);
+ rootUri.getDescriptorsStore().revokePermission(rootUri, allAccess);
+ rootUri.getDescriptorsStore().storeObject(rootUri, rootNode);
+
+ } catch (SlideException e) {
+ // If that occurs, then most likely the base config was
+ // already done before
+ Domain.info
+ ("Namespace base configuration was already done before");
+ } catch (Exception e) {
+ e.printStackTrace();
+ // Unable to load the base configuration XML file.
+ // Log the event, and hope it was already done before.
+ Domain.info
+ ("Unable to read Namespace base configuration file : "
+ + e.getMessage());
+ }
+
+ }
+
+
+ /**
+ * Parses the contents of the specified reader, and uses that info to
+ * initialize the specified Slide namespace.
+ *
+ * @param namespaceBaseDataDefinition Namespace base data
+ * @exception SlideException Something went wrong during registry or
+ * services initialization
+ */
+ void loadConfiguration(Configuration namespaceConfigurationDefinition)
+ throws SlideException {
+
+ Domain.info("Loading namespace " + getName() + " configuration");
+
+ // Load Namespace Config
+ config = new NamespaceConfig();
+ config.initializeNamespaceConfig(this,
+ namespaceConfigurationDefinition);
+
+ }
+
+
+ /**
+ * Parses the contents of the specified reader, and uses that info to
+ * initialize the specified Slide namespace.
+ *
* @param reader Reader object to initialization data
* @exception SlideException Something went wrong during registry or
* services initialization
@@ -511,7 +652,7 @@
org.apache.slide.common.xml.Namespace namespaceDef
= org.apache.slide.common.xml.Namespace.unmarshal(reader);
- CAT.info("Initializing namespace " + namespaceDef.getName());
+ Domain.info("Initializing namespace " + namespaceDef.getName());
Enumeration descriptorsStoresDef =
namespaceDef.enumerateDescriptorsstore();
@@ -656,13 +797,13 @@
} catch (SlideException e) {
// If that occurs, then most likely the base config was
// already done before
- CAT.info
+ Domain.info
("Namespace base configuration was already done before");
} catch (Exception e) {
e.printStackTrace();
// Unable to load the base configuration XML file.
// Log the event, and hope it was already done before.
- CAT.info
+ Domain.info
("Unable to read Namespace base configuration file : "
+ e.getMessage());
}
@@ -671,8 +812,8 @@
config = new NamespaceConfig();
config.initializeNamespaceConfig(this, namespaceDef.getConfig());
- CAT.info("Namespace " + namespaceDef.getName() +
- " initialization complete");
+ Domain.info("Namespace " + namespaceDef.getName() +
+ " initialization complete");
} catch (Exception e) {
e.printStackTrace();
@@ -685,6 +826,180 @@
/**
+ * Parse the descriptors store definition.
+ *
+ * @param descriptorsStoreDefinition Descriptors store definition
+ * @param descriptorsStoresClass Class names of the descriptors stores
+ * @param descriptorsStoresParameters Parameters of the descriptors stores
+ * @exception ConfigurationException Error parsing configuration file
+ * @exception SlideException Error loading the specified class
+ */
+ private void loadDescriptorsStoreDefinition
+ (Configuration descriptorsStoreDefinition,
+ Hashtable descriptorsStoresClass,
+ Hashtable descriptorsStoresParameters)
+ throws ConfigurationException, SlideException {
+
+ String descriptorsStoreName =
+ descriptorsStoreDefinition.getAttribute("name");
+ String descriptorsStoreClassname =
+ descriptorsStoreDefinition.getAttribute("classname");
+ Enumeration descriptorsStoreParametersDefinitions =
+ descriptorsStoreDefinition.getConfigurations("parameter");
+
+ // Load descriptors store class
+ Class descriptorsStoreClass = null;
+ try {
+ descriptorsStoreClass =
+ Class.forName(descriptorsStoreClassname);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new SlideException(e.getMessage());
+ }
+ descriptorsStoresClass.put(descriptorsStoreName,
+ descriptorsStoreClass);
+
+ // Load descriptor store parameters
+ Hashtable descriptorsStoreParameters = new Hashtable();
+ while (descriptorsStoreParametersDefinitions.hasMoreElements()) {
+ Configuration parameterDefinition = (Configuration)
+ descriptorsStoreParametersDefinitions.nextElement();
+ String parameterName = parameterDefinition.getAttribute("name");
+ String parameterValue = parameterDefinition.getValue();
+ descriptorsStoreParameters.put(parameterName,
+ parameterValue);
+ }
+ descriptorsStoresParameters.put(descriptorsStoreName,
+ descriptorsStoreParameters);
+
+ }
+
+
+
+ /**
+ * Parse the content store definition.
+ *
+ * @param contentStoreDefinition Content store definition
+ * @param contentStoresClass Class names of the content stores
+ * @param contentStoresParameters Parameters of the content stores
+ * @exception ConfigurationException Error parsing configuration file
+ * @exception SlideException Error loading the specified class
+ */
+ private void loadContentStoreDefinition
+ (Configuration contentStoreDefinition,
+ Hashtable contentStoresClass, Hashtable contentStoresParameters)
+ throws ConfigurationException, SlideException {
+
+ String contentStoreName = contentStoreDefinition.getAttribute("name");
+ String contentStoreClassname =
+ contentStoreDefinition.getAttribute("classname");
+ Enumeration contentStoreParametersDefinitions =
+ contentStoreDefinition.getConfigurations("parameter");
+
+ // Load content store class
+ Class contentStoreClass = null;
+ try {
+ contentStoreClass = Class.forName(contentStoreClassname);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new SlideException(e.getMessage());
+ }
+ contentStoresClass.put(contentStoreName, contentStoreClass);
+
+ // Load content store parameters
+ Hashtable contentStoreParameters = new Hashtable();
+ while (contentStoreParametersDefinitions.hasMoreElements()) {
+ Configuration parameterDefinition = (Configuration)
+ contentStoreParametersDefinitions.nextElement();
+ String parameterName = parameterDefinition.getAttribute("name");
+ String parameterValue = parameterDefinition.getValue();
+ contentStoreParameters.put(parameterName, parameterValue);
+ }
+ contentStoresParameters.put(contentStoreName, contentStoreParameters);
+
+ }
+
+
+
+ /**
+ * Parse the content store definition.
+ *
+ * @param contentStoreDefinition Content store definition
+ * @param contentStoresClass Class names of the content stores
+ * @param contentStoresParameters Parameters of the content stores
+ * @param descriptorsStoresClass Class names of the descriptors stores
+ * @param descriptorsStoresParameters Parameters of the descriptors stores
+ * @exception ConfigurationException Error parsing configuration file
+ * @exception UnknownServiceDeclarationException Reference to
+ * unknown service
+ * @exception ServiceParameterErrorException Service parameter error
+ * @exception ServiceParameterMissingException Service parameter missing
+ * @exception ServiceRegistrationFailedException Error registering service
+ */
+ private void loadScopeDefinition(Configuration scopeDefinition,
+ Hashtable descriptorsStoresClass,
+ Hashtable descriptorsStoresParameters,
+ Hashtable contentStoresClass,
+ Hashtable contentStoresParameters)
+ throws ConfigurationException, UnknownServiceDeclarationException,
+ ServiceParameterErrorException, ServiceParameterMissingException,
+ ServiceRegistrationFailedException {
+
+ String match = scopeDefinition.getAttribute("match");
+
+ // First, we get the correct class and parameters from the Hashtables.
+ String descriptorsStoreName =
+ scopeDefinition.getAttribute("descriptorsstore");
+
+ if (descriptorsStoreName != null) {
+ if ((!descriptorsStoresClass.containsKey(descriptorsStoreName)) ||
+ (!descriptorsStoresParameters.containsKey
+ (descriptorsStoreName))) {
+ throw new UnknownServiceDeclarationException
+ (descriptorsStoreName);
+ }
+ registerDescriptorsStore((Class) descriptorsStoresClass
+ .get(descriptorsStoreName),
+ (Hashtable) descriptorsStoresParameters
+ .get(descriptorsStoreName),
+ new Scope(match));
+ Domain.info("Registering Data Source name "
+ + descriptorsStoreName
+ + " of class "
+ + descriptorsStoresClass.get(descriptorsStoreName)
+ + " with parameters "
+ + descriptorsStoresParameters
+ .get(descriptorsStoreName)
+ + " on scope " + match);
+ }
+
+ // Load and Register store with the current path.
+
+ String contentStoreName = scopeDefinition.getAttribute("contentstore");
+
+ if (contentStoreName != null) {
+ if ((!contentStoresClass.containsKey(contentStoreName)) ||
+ (!contentStoresParameters.containsKey(contentStoreName))) {
+ throw new UnknownServiceDeclarationException(contentStoreName);
+ }
+ registerContentStore((Class) contentStoresClass
+ .get(contentStoreName),
+ (Hashtable) contentStoresParameters
+ .get(contentStoreName),
+ new Scope(match));
+ Domain.info("Registering Store name " + contentStoreName
+ + " of class "
+ + contentStoresClass.get(contentStoreName)
+ + " with parameters "
+ + contentStoresParameters.get(contentStoreName)
+ + " on scope " + match);
+ }
+
+ }
+
+
+
+ /**
* Load Scopes from Castor structures in the specified namespace.
*
* @param scopeDef Castor object
@@ -724,14 +1039,14 @@
(Hashtable) descriptorsStoresParameters
.get(descriptorsStoreName),
new Scope(currentPath));
- CAT.info("Registering Data Source name "
- + descriptorsStoreName
- + " of class "
- + descriptorsStoresClass.get(descriptorsStoreName)
- + " with parameters "
- + descriptorsStoresParameters.get(descriptorsStoreName)
- + " on scope "
- + currentPath);
+ Domain.info("Registering Data Source name "
+ + descriptorsStoreName
+ + " of class "
+ + descriptorsStoresClass.get(descriptorsStoreName)
+ + " with parameters "
+ + descriptorsStoresParameters
+ .get(descriptorsStoreName)
+ + " on scope " + currentPath);
}
// Load and Register store with the current path.
@@ -748,11 +1063,12 @@
(Hashtable) contentStoresParameters
.get(contentStoreName),
new Scope(currentPath));
- CAT.info("Registering Store name " + contentStoreName
- + " of class " + contentStoresClass.get(contentStoreName)
- + " with parameters "
- + contentStoresParameters.get(contentStoreName)
- + " on scope " + currentPath);
+ Domain.info("Registering Store name " + contentStoreName
+ + " of class "
+ + contentStoresClass.get(contentStoreName)
+ + " with parameters "
+ + contentStoresParameters.get(contentStoreName)
+ + " on scope " + currentPath);
}
Enumeration childScopesDef = scopeDef.enumerateScope();
1.3 +22 -15 jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java
Index: NamespaceAccessToken.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NamespaceAccessToken.java 2000/05/16 23:07:34 1.2
+++ NamespaceAccessToken.java 2000/06/14 05:12:12 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java,v 1.2 2000/05/16 23:07:34 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:34 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java,v 1.3 2000/06/14 05:12:12 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:12 $
*
* ====================================================================
*
@@ -70,7 +70,6 @@
import java.util.Date;
import java.io.Reader;
import java.io.Writer;
-import org.log4j.Category;
import org.apache.slide.structure.*;
import org.apache.slide.content.*;
import org.apache.slide.lock.*;
@@ -78,26 +77,18 @@
import org.apache.slide.macro.*;
import org.apache.slide.security.AccessDeniedException;
import org.apache.slide.authenticate.CredentialsToken;
+import org.apache.java.lang.Configuration;
+import org.apache.java.lang.ConfigurationException;
/**
* Namespace access token interface.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public interface NamespaceAccessToken {
- // ----------------------------------------------------- Instance Variables
-
-
- /**
- * Log4j category associated with this package.
- */
- final static Category CAT =
- Category.getInstance(NamespaceAccessToken.class.getName());
-
-
// ---------------------------------------------------------------- Methods
@@ -107,6 +98,22 @@
* @return NamespaceConfig Namespace configuration
*/
NamespaceConfig getNamespaceConfig();
+
+
+ /**
+ * Import data from Avalon configuration object.
+ *
+ * @param token CredentialsToken, used for access to the namespace
+ * @param objectNodeConfiguration Configuration object
+ * @exception ConfigurationException Something went wrong during the
+ * reading of the XML
+ * @exception UnknownObjectClassException Object class not found
+ * @exception ServiceAccessException Error accessing service
+ */
+ void importData(CredentialsToken token,
+ Configuration objectNodeConfiguration)
+ throws ConfigurationException, UnknownObjectClassException,
+ ServiceAccessException;
/**
1.3 +26 -5 jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java
Index: NamespaceAccessTokenImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NamespaceAccessTokenImpl.java 2000/05/16 23:07:35 1.2
+++ NamespaceAccessTokenImpl.java 2000/06/14 05:12:12 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java,v 1.2 2000/05/16 23:07:35 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:35 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java,v 1.3 2000/06/14 05:12:12 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:12 $
*
* ====================================================================
*
@@ -70,19 +70,20 @@
import java.util.Date;
import java.io.Reader;
import java.io.Writer;
-import org.log4j.Category;
import org.apache.slide.structure.*;
import org.apache.slide.content.*;
import org.apache.slide.lock.*;
import org.apache.slide.security.*;
import org.apache.slide.macro.*;
import org.apache.slide.authenticate.CredentialsToken;
+import org.apache.java.lang.Configuration;
+import org.apache.java.lang.ConfigurationException;
/**
* Namespace accessor class.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public final class NamespaceAccessTokenImpl implements NamespaceAccessToken {
@@ -215,6 +216,26 @@
// ------------------------------------------- NamespaceAccessToken Methods
+
+
+ /**
+ * Import data from Avalon configuration object.
+ *
+ * @param token CredentialsToken, used for access to the namespace
+ * @param dataConfiguration Configuration object
+ * @exception ConfigurationException Something went wrong during the
+ * reading of the XML
+ * @exception UnknownObjectClassException Object class not found
+ * @exception ServiceAccessException Error accessing service
+ */
+ public void importData(CredentialsToken token,
+ Configuration dataConfiguration)
+ throws ConfigurationException, UnknownObjectClassException,
+ ServiceAccessException {
+
+ XMLUnmarshaller.unmarshal(this, token, dataConfiguration);
+
+ }
/**
1.4 +192 -15 jakarta-slide/src/share/org/apache/slide/common/NamespaceConfig.java
Index: NamespaceConfig.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceConfig.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NamespaceConfig.java 2000/05/16 23:07:35 1.3
+++ NamespaceConfig.java 2000/06/14 05:12:13 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceConfig.java,v 1.3 2000/05/16 23:07:35 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/05/16 23:07:35 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceConfig.java,v 1.4 2000/06/14 05:12:13 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/06/14 05:12:13 $
*
* ====================================================================
*
@@ -69,30 +69,21 @@
import java.io.FileReader;
import java.io.Reader;
import java.io.IOException;
-import org.log4j.Category;
import org.apache.slide.structure.*;
import org.apache.slide.content.*;
import org.apache.slide.lock.*;
+import org.apache.java.lang.Configuration;
+import org.apache.java.lang.ConfigurationException;
/**
* Configuration of the Namespace.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public final class NamespaceConfig {
- // -------------------------------------------------------------- Constants
-
-
- /**
- * Log4j category associated with this package.
- */
- final static Category CAT =
- Category.getInstance(NamespaceConfig.class.getName());
-
-
// ----------------------------------------------------- Instance Variables
@@ -445,6 +436,192 @@
// -------------------------------------------------------- Package Methods
+
+
+ /**
+ * Initialize the Namespace configuration using the given Castor object.
+ *
+ * @param namespace Namespace on which we are trying to load the config
+ * @param config Castor Config object
+ * @exception InvalidNamespaceConfigurationException Namespace
+ * configuration is invalid
+ * @exception SlideException One of the action nodes doesn't exist
+ */
+ void initializeNamespaceConfig(Namespace namespace, Configuration config)
+ throws InvalidNamespaceConfigurationException, SlideException {
+
+ try {
+ defaultAction =
+ getActionNode(namespace, config.getConfiguration
+ ("default-action").getValue());
+ } catch (ConfigurationException e) {
+ throw new InvalidNamespaceConfigurationException
+ (namespace, e.getMessage());
+ }
+
+ try {
+ readObjectAction =
+ getActionNode(namespace, config.getConfiguration
+ ("read-object").getValue());
+ } catch (ConfigurationException e) {
+ readObjectAction = defaultAction;
+ }
+
+ try {
+ createObjectAction =
+ getActionNode(namespace, config.getConfiguration
+ ("create-object").getValue());
+ } catch (ConfigurationException e) {
+ createObjectAction = defaultAction;
+ }
+
+ try {
+ removeObjectAction =
+ getActionNode(namespace, config.getConfiguration
+ ("remove-object").getValue());
+ } catch (ConfigurationException e) {
+ removeObjectAction = defaultAction;
+ }
+
+ try {
+ grantPermissionAction =
+ getActionNode(namespace, config.getConfiguration
+ ("grant-permission").getValue());
+ } catch (ConfigurationException e) {
+ grantPermissionAction = defaultAction;
+ }
+
+ try {
+ revokePermissionAction =
+ getActionNode(namespace, config.getConfiguration
+ ("revoke-permission").getValue());
+ } catch (ConfigurationException e) {
+ revokePermissionAction = defaultAction;
+ }
+
+ try {
+ readPermissionsAction =
+ getActionNode(namespace, config.getConfiguration
+ ("read-permissions").getValue());
+ } catch (ConfigurationException e) {
+ readPermissionsAction = defaultAction;
+ }
+
+ try {
+ lockObjectAction =
+ getActionNode(namespace, config.getConfiguration
+ ("lock-object").getValue());
+ } catch (ConfigurationException e) {
+ lockObjectAction = defaultAction;
+ }
+
+ try {
+ killLockAction =
+ getActionNode(namespace, config.getConfiguration
+ ("kill-lock").getValue());
+ } catch (ConfigurationException e) {
+ killLockAction = defaultAction;
+ }
+
+ try {
+ readLocksAction =
+ getActionNode(namespace, config.getConfiguration
+ ("read-locks").getValue());
+ } catch (ConfigurationException e) {
+ readLocksAction = defaultAction;
+ }
+
+ try {
+ readRevisionMetadataAction =
+ getActionNode(namespace, config.getConfiguration
+ ("read-revision-metadata").getValue());
+ } catch (ConfigurationException e) {
+ readRevisionMetadataAction = defaultAction;
+ }
+
+ try {
+ createRevisionMetadataAction =
+ getActionNode(namespace, config.getConfiguration
+ ("create-revision-metadata").getValue());
+ } catch (ConfigurationException e) {
+ createRevisionMetadataAction = defaultAction;
+ }
+
+ try {
+ modifyRevisionMetadataAction =
+ getActionNode(namespace, config.getConfiguration
+ ("modify-revision-metadata").getValue());
+ } catch (ConfigurationException e) {
+ modifyRevisionMetadataAction = defaultAction;
+ }
+
+ try {
+ removeRevisionMetadataAction =
+ getActionNode(namespace, config.getConfiguration
+ ("remove-revision-metadata").getValue());
+ } catch (ConfigurationException e) {
+ removeRevisionMetadataAction = defaultAction;
+ }
+
+ try {
+ readRevisionContentAction =
+ getActionNode(namespace, config.getConfiguration
+ ("read-revision-content").getValue());
+ } catch (ConfigurationException e) {
+ readRevisionContentAction = defaultAction;
+ }
+
+ try {
+ createRevisionContentAction =
+ getActionNode(namespace, config.getConfiguration
+ ("create-revision-content").getValue());
+ } catch (ConfigurationException e) {
+ createRevisionContentAction = defaultAction;
+ }
+
+ try {
+ modifyRevisionContentAction =
+ getActionNode(namespace, config.getConfiguration
+ ("modify-revision-content").getValue());
+ } catch (ConfigurationException e) {
+ modifyRevisionContentAction = defaultAction;
+ }
+
+ try {
+ removeRevisionContentAction =
+ getActionNode(namespace, config.getConfiguration
+ ("remove-revision-content").getValue());
+ } catch (ConfigurationException e) {
+ removeRevisionContentAction = defaultAction;
+ }
+
+ try {
+ usersPath = config.getConfiguration("userspath").getValue();
+ } catch (ConfigurationException e) {
+ usersPath = "";
+ }
+
+ try {
+ filesPath = config.getConfiguration("filepath").getValue();
+ } catch (ConfigurationException e) {
+ filesPath = "";
+ }
+
+ parameters = new Hashtable();
+ Enumeration parametersDef = config.getConfigurations("parameter");
+ try {
+ while (parametersDef.hasMoreElements()) {
+ Configuration parameter =
+ (Configuration) parametersDef.nextElement();
+ addParameter(parameter.getAttribute("name"),
+ parameter.getValue());
+ }
+ } catch (ConfigurationException e) {
+ throw new InvalidNamespaceConfigurationException
+ (namespace, e.getMessage());
+ }
+
+ }
/**
1.3 +6 -18 jakarta-slide/src/share/org/apache/slide/common/SlideError.java
Index: SlideError.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideError.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SlideError.java 2000/05/16 23:07:35 1.2
+++ SlideError.java 2000/06/14 05:12:13 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideError.java,v 1.2 2000/05/16 23:07:35 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:35 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideError.java,v 1.3 2000/06/14 05:12:13 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:13 $
*
* ====================================================================
*
@@ -63,27 +63,15 @@
package org.apache.slide.common;
-import org.log4j.Category;
-
/**
* Error supertype for all Slide components.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class SlideError extends Error {
- // ----------------------------------------------------- Instance Variables
-
-
- /**
- * IBM log4j Category.
- */
- final static Category CAT =
- Category.getInstance(SlideError.class.getName());
-
-
// ----------------------------------------------------------- Constructors
@@ -95,7 +83,7 @@
*/
public SlideError(String message, Exception e) {
super(message);
- CAT.error(message, e);
+ Domain.error(message, e);
}
@@ -106,7 +94,7 @@
*/
public SlideError(String message) {
super(message);
- CAT.error(message);
+ Domain.error(message);
}
}
1.3 +5 -17 jakarta-slide/src/share/org/apache/slide/common/SlideException.java
Index: SlideException.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SlideException.java 2000/05/16 23:07:35 1.2
+++ SlideException.java 2000/06/14 05:12:13 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideException.java,v 1.2 2000/05/16 23:07:35 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:35 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideException.java,v 1.3 2000/06/14 05:12:13 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:13 $
*
* ====================================================================
*
@@ -63,27 +63,15 @@
package org.apache.slide.common;
-import org.log4j.Category;
-
/**
* Exception supertype for all Slide components.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class SlideException extends Exception {
- // ----------------------------------------------------- Instance Variables
-
-
- /**
- * IBM log4j Category.
- */
- final static Category CAT = Category.getInstance
- (SlideException.class.getName());
-
-
// ----------------------------------------------------------- Constructors
@@ -106,7 +94,7 @@
public SlideException(String message, boolean showTrace) {
super(message);
if (showTrace) {
- CAT.warn(message);
+ Domain.warn(message);
}
}
1.3 +5 -17 jakarta-slide/src/share/org/apache/slide/common/SlideRuntimeException.java
Index: SlideRuntimeException.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideRuntimeException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SlideRuntimeException.java 2000/05/16 23:07:36 1.2
+++ SlideRuntimeException.java 2000/06/14 05:12:13 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideRuntimeException.java,v 1.2 2000/05/16 23:07:36 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:36 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideRuntimeException.java,v 1.3 2000/06/14 05:12:13 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:13 $
*
* ====================================================================
*
@@ -63,27 +63,15 @@
package org.apache.slide.common;
-import org.log4j.Category;
-
/**
* Runtime Exception supertype for all Slide components.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class SlideRuntimeException extends RuntimeException {
- // ----------------------------------------------------- Instance Variables
-
-
- /**
- * IBM log4j Category.
- */
- final static Category CAT =
- Category.getInstance(SlideRuntimeException.class.getName());
-
-
// ----------------------------------------------------------- Constructors
@@ -106,7 +94,7 @@
public SlideRuntimeException(String message, boolean showTrace) {
super(message);
if (showTrace) {
- CAT.warn(message);
+ Domain.warn(message);
}
}
1.3 +4 -5 jakarta-slide/src/share/org/apache/slide/common/XMLMarshaller.java
Index: XMLMarshaller.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLMarshaller.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLMarshaller.java 2000/05/16 23:07:36 1.2
+++ XMLMarshaller.java 2000/06/14 05:12:13 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLMarshaller.java,v 1.2 2000/05/16 23:07:36 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:36 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLMarshaller.java,v 1.3 2000/06/14 05:12:13 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:13 $
*
* ====================================================================
*
@@ -70,7 +70,6 @@
import java.util.Date;
import java.io.Reader;
import java.io.Writer;
-import org.log4j.Category;
import org.apache.slide.structure.*;
import org.apache.slide.content.*;
import org.apache.slide.lock.*;
@@ -81,7 +80,7 @@
* XMLMarshaller helper class.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public final class XMLMarshaller {
1.3 +152 -17 jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java
Index: XMLUnmarshaller.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLUnmarshaller.java 2000/05/16 23:07:36 1.2
+++ XMLUnmarshaller.java 2000/06/14 05:12:13 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v 1.2 2000/05/16 23:07:36 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:36 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v 1.3 2000/06/14 05:12:13 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:13 $
*
* ====================================================================
*
@@ -70,33 +70,46 @@
import java.util.Date;
import java.io.Reader;
import java.io.Writer;
-import org.log4j.Category;
import org.apache.slide.structure.*;
import org.apache.slide.content.*;
import org.apache.slide.lock.*;
import org.apache.slide.security.*;
import org.apache.slide.authenticate.CredentialsToken;
+import org.apache.java.lang.Configuration;
+import org.apache.java.lang.ConfigurationException;
/**
* XMLUnmarshaller class.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public final class XMLUnmarshaller {
- // ----------------------------------------------------- Instance Variables
+ // --------------------------------------------------------- Public Methods
/**
- * Log4j category associated with this package.
+ * Import data from Avalon configuration object.
+ *
+ * @param token CredentialsToken, used for access to the namespace
+ * @param dataConfiguration Configuration object
+ * @exception ConfigurationException Something went wrong during the
+ * reading of the XML
+ * @exception UnknownObjectClassException Object class not found
+ * @exception ServiceAccessException Error accessing service
*/
- final static Category CAT =
- Category.getInstance(XMLUnmarshaller.class.getName());
-
-
- // --------------------------------------------------------- Public Methods
+ public static void unmarshal(NamespaceAccessToken accessToken,
+ CredentialsToken token,
+ Configuration dataConfiguration)
+ throws ConfigurationException, UnknownObjectClassException,
+ ServiceAccessException {
+
+ loadObjectNode(accessToken, token,
+ dataConfiguration.getConfiguration("objectnode"));
+
+ }
/**
@@ -185,6 +198,128 @@
* Loads a Slide Object.
*
* @param token Credentials token
+ * @param objectDefinition Configuration object
+ * @exception ServiceAccessException Object creation failed because
+ * a data access error occured
+ * @exception UnknownObjectClassException Object class not found
+ * @exception ConfigurationException Something went wrong during the
+ * reading of the XML
+ */
+ private static void loadObjectNode
+ (NamespaceAccessToken accessToken, CredentialsToken token,
+ Configuration objectDefinition)
+ throws ServiceAccessException, ConfigurationException,
+ UnknownObjectClassException {
+
+ String className = objectDefinition.getAttribute("classname");
+ String uri = objectDefinition.getAttribute("uri");
+
+ Domain.info("Loading object " + uri);
+
+ try {
+
+ Class objectClass = null;
+ try {
+ // First, load the object's class
+ objectClass = Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ // Class loading failed : The requested class was not found
+ // We throw an exception and interrupt the loading of the file.
+ throw new UnknownObjectClassException(className);
+ }
+ ObjectNode object = null;
+ try {
+ // Get a new instance of the class
+ object = (ObjectNode) objectClass.newInstance();
+ } catch(InstantiationException e) {
+ // Instantiation failed for some reason
+ throw new UnknownObjectClassException(className);
+ } catch(IllegalAccessException e) {
+ // The initializer could not be called because
+ // of access restrictions
+ throw new UnknownObjectClassException(className);
+ }
+
+ if (uri.equals("/")) {
+ // FIXME
+ } else {
+ accessToken.getStructureHelper().create(token, object, uri);
+ }
+
+ // Retrieving the list of permissions on the object
+ Enumeration permissionDefinitions =
+ objectDefinition.getConfigurations("permission");
+
+ // We've made sure that the object exists.
+ // We now parse the permissions definition list, adding each
+ // permission to the object's permission list.
+ while (permissionDefinitions.hasMoreElements()) {
+
+ Configuration permissionDefinition =
+ (Configuration) permissionDefinitions.nextElement();
+ // Create the NodePermission object matching the Castor object
+
+ String subjectUri =
+ permissionDefinition.getAttribute("subject");
+
+ String actionUri =
+ permissionDefinition.getAttribute("action");
+
+ NodePermission permission = null;
+
+ try {
+ if (permissionDefinition.getAttribute("inheritance")
+ .equals("false")) {
+ permission = new NodePermission(uri, subjectUri,
+ actionUri, false);
+ } else {
+ permission = new NodePermission(uri, subjectUri,
+ actionUri);
+ }
+ } catch (ConfigurationException e) {
+ permission = new NodePermission(uri, subjectUri,
+ actionUri);
+ }
+
+ // Adding the NodePermission to the ObjectNode
+ accessToken.getSecurityHelper()
+ .grantPermission(token, permission);
+
+ }
+
+ } catch (ObjectAlreadyExistsException e) {
+ // Object creation failed.
+ // The object probably does already exist in the data source.
+ Domain.info("Object already exists at " + uri);
+ } catch (ObjectNotFoundException e) {
+ // Should NEVER happen
+ e.printStackTrace();
+ Domain.warn(e.getMessage());
+ } catch (LinkedObjectNotFoundException e) {
+ // Icorrect link
+ e.printStackTrace();
+ Domain.warn("Incorrect link found while creating " + uri);
+ } catch (AccessDeniedException e) {
+ // Security exception
+ Domain.info("Insufficient credentials to create object");
+ }
+
+ Enumeration childConfigurations =
+ objectDefinition.getConfigurations("objectnode");
+
+ while(childConfigurations.hasMoreElements()) {
+ Configuration childConfiguration =
+ (Configuration) childConfigurations.nextElement();
+ loadObjectNode(accessToken, token, childConfiguration);
+ }
+
+ }
+
+
+ /**
+ * Loads a Slide Object.
+ *
+ * @param token Credentials token
* @param object Newly instantiated ObjectNode
* @param uri Uri of the ObjectNode
* @param metadata Object's Metadata
@@ -202,7 +337,7 @@
org.apache.slide.common.xml.Objectnode objectDef)
throws ServiceAccessException {
- CAT.info("Loading object " + uri);
+ Domain.info("Loading object " + uri);
try {
// If the current ObjectNode is an instance of LinkNode,
@@ -273,18 +408,18 @@
} catch (ObjectAlreadyExistsException e) {
// Object creation failed.
// The object probably does already exist in the data source.
- CAT.info("Object already exists at " + uri);
+ Domain.info("Object already exists at " + uri);
} catch (ObjectNotFoundException e) {
// Should NEVER happen
e.printStackTrace();
- CAT.warn(e.getMessage());
+ Domain.warn(e.getMessage());
} catch (LinkedObjectNotFoundException e) {
// Icorrect link
e.printStackTrace();
- CAT.warn("Incorrect link found while creating " + uri);
+ Domain.warn("Incorrect link found while creating " + uri);
} catch (AccessDeniedException e) {
// Security exception
- CAT.info("Insufficient credentials to create object");
+ Domain.info("Insufficient credentials to create object");
}
}
1.4 +4 -14 jakarta-slide/src/share/org/apache/slide/content/Content.java
Index: Content.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/Content.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Content.java 2000/06/01 23:47:34 1.3
+++ Content.java 2000/06/14 05:12:14 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/Content.java,v 1.3 2000/06/01 23:47:34 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/06/01 23:47:34 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/Content.java,v 1.4 2000/06/14 05:12:14 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/06/14 05:12:14 $
*
* ====================================================================
*
@@ -66,7 +66,6 @@
import java.util.Enumeration;
import java.util.Date;
import java.util.Vector;
-import org.log4j.Category;
import org.apache.slide.common.*;
import org.apache.slide.structure.*;
import org.apache.slide.lock.*;
@@ -77,18 +76,9 @@
* Content.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public interface Content {
-
-
- // -------------------------------------------------------------- Constants
-
-
- /**
- * Log4j category associated with this package.
- */
- final static Category CAT = Category.getInstance(Content.class.getName());
// ------------------------------------------------------ Interface Methods
1.3 +7 -8 jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java
Index: ContentImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ContentImpl.java 2000/05/16 23:07:37 1.2
+++ ContentImpl.java 2000/06/14 05:12:14 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java,v 1.2 2000/05/16 23:07:37 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:37 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java,v 1.3 2000/06/14 05:12:14 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:14 $
*
* ====================================================================
*
@@ -67,7 +67,6 @@
import java.util.Date;
import java.util.Vector;
import java.util.Hashtable;
-import org.log4j.Category;
import org.apache.slide.common.*;
import org.apache.slide.structure.*;
import org.apache.slide.lock.*;
@@ -78,7 +77,7 @@
* Implementation of the content interface.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public final class ContentImpl implements Content {
@@ -524,7 +523,7 @@
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
RevisionDescriptorNotFoundException, ObjectLockedException {
- CAT.info("Fork not implemented");
+ Domain.info("Fork not implemented");
}
@@ -543,7 +542,7 @@
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
RevisionDescriptorNotFoundException, ObjectLockedException {
- CAT.info("Merge not implemented");
+ Domain.info("Merge not implemented");
}
@@ -561,7 +560,7 @@
LinkedObjectNotFoundException, ServiceAccessException,
RevisionDescriptorNotFoundException, ObjectLockedException {
- CAT.info("Store new revision based on specified revision");
+ Domain.info("Store new revision based on specified revision");
// Retrieve the associated object
ObjectNode associatedObject = structureHelper.retrieve(token, strUri);
1.3 +4 -11 jakarta-slide/src/share/org/apache/slide/macro/Macro.java
Index: Macro.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/Macro.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Macro.java 2000/05/16 23:07:38 1.2
+++ Macro.java 2000/06/14 05:12:15 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/Macro.java,v 1.2 2000/05/16 23:07:38 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:38 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/Macro.java,v 1.3 2000/06/14 05:12:15 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:15 $
*
* ====================================================================
*
@@ -66,7 +66,6 @@
import java.util.Enumeration;
import java.util.Vector;
import java.util.Date;
-import org.log4j.Category;
import org.apache.slide.common.*;
import org.apache.slide.structure.*;
import org.apache.slide.security.*;
@@ -77,18 +76,12 @@
* Macro helper class.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public interface Macro {
// -------------------------------------------------------------- Constants
-
-
- /**
- * Log4j category associated with this package.
- */
- final static Category CAT = Category.getInstance(Macro.class.getName());
/**
1.3 +8 -9 jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java
Index: MacroImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MacroImpl.java 2000/05/16 23:07:38 1.2
+++ MacroImpl.java 2000/06/14 05:12:15 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v 1.2 2000/05/16 23:07:38 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:38 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v 1.3 2000/06/14 05:12:15 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:15 $
*
* ====================================================================
*
@@ -67,7 +67,6 @@
import java.util.Vector;
import java.util.Date;
import java.util.Stack;
-import org.log4j.Category;
import org.apache.slide.common.*;
import org.apache.slide.structure.*;
import org.apache.slide.security.*;
@@ -78,7 +77,7 @@
* Macro helper class.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public final class MacroImpl implements Macro {
@@ -170,7 +169,7 @@
String destinationUri, MacroParameters parameters)
throws CopyMacroException, DeleteMacroException {
- CAT.info("Copy " + sourceUri + " to " + destinationUri);
+ Domain.info("Copy " + sourceUri + " to " + destinationUri);
if (parameters.isOverwrite()) {
try {
@@ -260,7 +259,7 @@
public void delete(CredentialsToken credToken, String targetUri,
MacroParameters parameters)
throws DeleteMacroException {
- CAT.info("Delete " + targetUri);
+ Domain.info("Delete " + targetUri);
DeleteMacroException e = new DeleteMacroException("Delete failed");
@@ -290,7 +289,7 @@
String destinationUri, MacroParameters parameters,
CopyMacroException e) {
- CAT.info("Copy object : from " + sourceUri + " to "
+ Domain.info("Copy object : from " + sourceUri + " to "
+ destinationUri);
try {
@@ -407,7 +406,7 @@
private void deleteObject(CredentialsToken credToken, String targetUri,
MacroException e) {
- CAT.info("Delete object : " + targetUri);
+ Domain.info("Delete object : " + targetUri);
try {
1.4 +4 -14 jakarta-slide/src/share/org/apache/slide/security/Security.java
Index: Security.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/Security.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Security.java 2000/05/16 23:07:40 1.3
+++ Security.java 2000/06/14 05:12:15 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/Security.java,v 1.3 2000/05/16 23:07:40 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/05/16 23:07:40 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/Security.java,v 1.4 2000/06/14 05:12:15 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/06/14 05:12:15 $
*
* ====================================================================
*
@@ -64,7 +64,6 @@
package org.apache.slide.security;
import java.util.Enumeration;
-import org.log4j.Category;
import org.apache.slide.common.*;
import org.apache.slide.structure.*;
import org.apache.slide.authenticate.CredentialsToken;
@@ -74,18 +73,9 @@
* Security helper.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public interface Security {
-
-
- // -------------------------------------------------------------- Constants
-
-
- /**
- * Log4j category associated with this package.
- */
- final static Category CAT = Category.getInstance(Security.class.getName());
// ------------------------------------------------------ Interface Methods
1.5 +6 -6 jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java
Index: SecurityImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SecurityImpl.java 2000/05/16 23:07:40 1.4
+++ SecurityImpl.java 2000/06/14 05:12:15 1.5
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v 1.4 2000/05/16 23:07:40 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2000/05/16 23:07:40 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v 1.5 2000/06/14 05:12:15 remm Exp $
+ * $Revision: 1.5 $
+ * $Date: 2000/06/14 05:12:15 $
*
* ====================================================================
*
@@ -64,7 +64,6 @@
package org.apache.slide.security;
import java.util.Enumeration;
-import org.log4j.Category;
import org.apache.slide.common.*;
import org.apache.slide.structure.*;
import org.apache.slide.authenticate.CredentialsToken;
@@ -74,7 +73,7 @@
* Security helper.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public final class SecurityImpl implements Security {
@@ -102,6 +101,7 @@
*/
private Namespace namespace;
+
/**
* Namespace configuration.
*/
@@ -195,7 +195,7 @@
SubjectNode subject, ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException {
- //CAT.info("Revoke permission on " + object.getUri());
+ //Domain.info("Revoke permission on " + object.getUri());
checkCredentials(token, object, namespaceConfig
.getRevokePermissionAction());
NodePermission permission = new NodePermission(object, subject,
1.3 +4 -15 jakarta-slide/src/share/org/apache/slide/structure/Structure.java
Index: Structure.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/Structure.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Structure.java 2000/05/16 23:07:40 1.2
+++ Structure.java 2000/06/14 05:12:16 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/Structure.java,v 1.2 2000/05/16 23:07:40 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:40 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/Structure.java,v 1.3 2000/06/14 05:12:16 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:16 $
*
* ====================================================================
*
@@ -69,7 +69,6 @@
import java.util.Vector;
import java.util.Hashtable;
import java.util.Date;
-import org.log4j.Category;
import org.apache.slide.common.*;
import org.apache.slide.lock.*;
import org.apache.slide.security.*;
@@ -79,19 +78,9 @@
* Structure helper.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public interface Structure {
-
-
- // -------------------------------------------------------------- Constants
-
-
- /**
- * Log4j category associated with this package.
- */
- final static Category CAT =
- Category.getInstance(Structure.class.getName());
// ------------------------------------------------------ Interface Methods
1.4 +7 -8 jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java
Index: StructureImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- StructureImpl.java 2000/05/16 23:07:40 1.3
+++ StructureImpl.java 2000/06/14 05:12:17 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.3 2000/05/16 23:07:40 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/05/16 23:07:40 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.4 2000/06/14 05:12:17 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/06/14 05:12:17 $
*
* ====================================================================
*
@@ -69,7 +69,6 @@
import java.util.Vector;
import java.util.Hashtable;
import java.util.Date;
-import org.log4j.Category;
import org.apache.slide.common.*;
import org.apache.slide.lock.*;
import org.apache.slide.security.*;
@@ -79,7 +78,7 @@
* Data helper class.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public final class StructureImpl implements Structure {
@@ -415,7 +414,7 @@
NodePermission grantedPermission = null;
String userUri = namespaceConfig.getUsersPath()
+ token.getPublicCredentials();
- CAT.info("Checking basic permissions on new object");
+ Domain.info("Checking basic permissions on new object");
/*
try {
securityHelper.checkCredentials
@@ -460,8 +459,8 @@
newObject.addPermission(grantedPermission);
}
*/
- CAT.info("Basic permissions granted for user "
- + token.getPublicCredentials());
+ Domain.info("Basic permissions granted for user "
+ + token.getPublicCredentials());
// Now creating the new object
newObject.setUri(courUri.toString());
1.4 +4 -5 jakarta-slide/src/share/org/apache/slide/util/AbstractObjectCache.java
Index: AbstractObjectCache.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/AbstractObjectCache.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractObjectCache.java 2000/05/16 23:07:41 1.3
+++ AbstractObjectCache.java 2000/06/14 05:12:17 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/AbstractObjectCache.java,v 1.3 2000/05/16 23:07:41 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/05/16 23:07:41 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/AbstractObjectCache.java,v 1.4 2000/06/14 05:12:17 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/06/14 05:12:17 $
*
* ====================================================================
*
@@ -71,14 +71,13 @@
import java.io.InputStream;
import java.io.IOException;
import java.util.StringTokenizer;
-import org.log4j.Category;
import org.apache.slide.util.Messages;
/**
* Object cache abstract implementation.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.3 $ $Date: 2000/05/16 23:07:41 $
+ * @version $Revision: 1.4 $ $Date: 2000/06/14 05:12:17 $
*/
public abstract class AbstractObjectCache implements ObjectCache {
1.3 +11 -22 jakarta-slide/src/share/org/apache/slide/util/Configuration.java
Index: Configuration.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/Configuration.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Configuration.java 2000/05/16 23:07:42 1.2
+++ Configuration.java 2000/06/14 05:12:17 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/Configuration.java,v 1.2 2000/05/16 23:07:42 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:42 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/Configuration.java,v 1.3 2000/06/14 05:12:17 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:17 $
*
* ====================================================================
*
@@ -71,7 +71,7 @@
import java.io.InputStream;
import java.io.IOException;
import java.util.StringTokenizer;
-import org.log4j.Category;
+import org.apache.slide.common.Domain;
import org.apache.slide.util.Messages;
/**
@@ -92,21 +92,11 @@
* @author <a href="mailto:kvisco@exoffice.com">Keith Visco</a>
* @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $ $Date: 2000/05/16 23:07:42 $
+ * @version $Revision: 1.3 $ $Date: 2000/06/14 05:12:17 $
*/
public abstract class Configuration {
- // -------------------------------------------------------------- Constants
-
-
- /**
- * Log4j category associated with this package.
- */
- final static Category CAT =
- Category.getInstance(Configuration.class.getName());
-
-
// --------------------------------------------------- Property Inner Class
@@ -268,16 +258,15 @@
InputStream is;
// Get detault configuration from the Slide JAR.
- // Complain if not found.
_default = new Properties();
try {
_default.load(Configuration.class.getResourceAsStream
(Property.ResourceName));
} catch (Exception except) {
// This should never happen
- throw new RuntimeException
- (Messages.format("conf.notDefaultConfigurationFile",
- Property.FileName));
+ //throw new RuntimeException
+ // (Messages.format("conf.notDefaultConfigurationFile",
+ // Property.FileName));
}
// Get overriding configuration from the Java
@@ -288,7 +277,7 @@
_default = new Properties(_default);
try {
_default.load(new FileInputStream(file));
- CAT.info("Configuration found in java.home");
+ Domain.info("Configuration found in java.home");
} catch (IOException except) {
// Do nothing
}
@@ -302,7 +291,7 @@
if ( is != null ) {
_default = new Properties(_default);
_default.load(is);
- CAT.info("Configuration found in classpath");
+ Domain.info("Configuration found in classpath");
}
} catch (Exception except) {
// Do nothing
@@ -310,7 +299,7 @@
String prop;
- prop = _default.getProperty(Property.Debug, "");
+ prop = _default.getProperty(Property.Debug, "false");
if (prop.equalsIgnoreCase("true") || prop.equalsIgnoreCase("on")) {
_debug = true;
}
1.5 +4 -5 jakarta-slide/src/share/org/apache/slide/util/HashMapObjectCache.java
Index: HashMapObjectCache.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/HashMapObjectCache.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- HashMapObjectCache.java 2000/05/16 23:07:42 1.4
+++ HashMapObjectCache.java 2000/06/14 05:12:17 1.5
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/HashMapObjectCache.java,v 1.4 2000/05/16 23:07:42 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2000/05/16 23:07:42 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/HashMapObjectCache.java,v 1.5 2000/06/14 05:12:17 remm Exp $
+ * $Revision: 1.5 $
+ * $Date: 2000/06/14 05:12:17 $
*
* ====================================================================
*
@@ -71,14 +71,13 @@
import java.io.InputStream;
import java.io.IOException;
import java.util.StringTokenizer;
-import org.log4j.Category;
import org.apache.slide.util.Messages;
/**
* Object cache implementation using Keith Visco's HashMap structure.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.4 $ $Date: 2000/05/16 23:07:42 $
+ * @version $Revision: 1.5 $ $Date: 2000/06/14 05:12:17 $
*/
public class HashMapObjectCache extends AbstractObjectCache {
1.3 +6 -12 jakarta-slide/src/share/org/apache/slide/util/Messages.java
Index: Messages.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/Messages.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Messages.java 2000/05/16 23:07:42 1.2
+++ Messages.java 2000/06/14 05:12:18 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/Messages.java,v 1.2 2000/05/16 23:07:42 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/05/16 23:07:42 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/Messages.java,v 1.3 2000/06/14 05:12:18 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/14 05:12:18 $
*
* ====================================================================
*
@@ -65,14 +65,14 @@
import java.text.*;
import java.util.*;
-import org.log4j.Category;
+import org.apache.slide.common.Domain;
/**
* Messages resource bundle manager.
*
* @author <a href="arkin@exoffice.com">Assaf Arkin</a>
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.2 $ $Date: 2000/05/16 23:07:42 $
+ * @version $Revision: 1.3 $ $Date: 2000/06/14 05:12:18 $
*/
public class Messages {
@@ -81,12 +81,6 @@
/**
- * Log4j category associated with this package.
- */
- final static Category CAT = Category.getInstance(Messages.class.getName());
-
-
- /**
* Resource filename.
*/
public static final String ResourceName =
@@ -207,7 +201,7 @@
}
} catch (Exception except) {
_messages = new EmptyResourceBundle();
- CAT.error("Failed to locate messages resource " + ResourceName);
+ Domain.error("Failed to locate messages resource " + ResourceName);
}
}
1.4 +4 -15 jakarta-slide/src/share/org/apache/slide/util/ObjectCache.java
Index: ObjectCache.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/ObjectCache.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ObjectCache.java 2000/05/16 23:07:42 1.3
+++ ObjectCache.java 2000/06/14 05:12:18 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/ObjectCache.java,v 1.3 2000/05/16 23:07:42 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/05/16 23:07:42 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/util/ObjectCache.java,v 1.4 2000/06/14 05:12:18 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/06/14 05:12:18 $
*
* ====================================================================
*
@@ -71,7 +71,6 @@
import java.io.InputStream;
import java.io.IOException;
import java.util.StringTokenizer;
-import org.log4j.Category;
import org.apache.slide.util.Messages;
/**
@@ -91,19 +90,9 @@
* algorithm to limit cache size, like dropping LRU elements.
*
* @author <a href="mailto:remm@exoffice.com">Remy Maucherat</a>
- * @version $Revision: 1.3 $ $Date: 2000/05/16 23:07:42 $
+ * @version $Revision: 1.4 $ $Date: 2000/06/14 05:12:18 $
*/
public interface ObjectCache {
-
-
- // -------------------------------------------------------------- Constants
-
-
- /**
- * Log4j category associated with this package.
- */
- final static Category CAT =
- Category.getInstance(ObjectCache.class.getName());
// ------------------------------------------------------ Interface methods