commit - 38d6902abcd0b0df66b7f3fa21bc0dbaf3c9a184
commit + 94c82cf8f19e3c01657205fe07aa2dcf076d2c45
blob - e18fd28ce14d3a2be37d715ceb339c75cac22e24
blob + e86862a28e464828cb71b81ea128aa5125deb316
--- build.xml
+++ build.xml
<!-- the overall class path -->
<path id="app.classpath">
- <pathelement location="${jar}/rss-ng-1.0-alpha-1.jar"/>
- <pathelement location="${jar}/jdbcstorage-1.0-alpha-1.jar"/>
+ <pathelement location="${jar}/${jdbcstorage.jar}"/>
+ <pathelement location="${jar}/${rss-ng.jar}"/>
<pathelement location="${jar}/${search-ng.jar}"/>
<pathelement location="${jar}/gabriel.jar"/>
<pathelement location="${jar}/jmdns.jar"/>
<include name="lib/${appname}-utils.jar"/>
<include name="lib/gabriel.jar"/>
<include name="lib/jmdns.jar"/>
- <include name="lib/${rome.jar}"/>
- <include name="lib/${jdom.jar}"/>
- <include name="lib/${spring-core.jar}"/>
- <include name="lib/${spring-beans.jar}"/>
+ <include name="lib/${rome.jar}"/>
+ <include name="lib/${jdom.jar}"/>
+ <include name="lib/${spring-core.jar}"/>
+ <include name="lib/${spring-beans.jar}"/>
<include name="lib/jdom-b10.jar"/>
<include name="lib/asm-1.4.1.jar"/>
<include name="lib/dynaop-1.0-beta.jar"/>
<target name="buildtask">
<mkdir dir="${target}/ant"/>
<javac deprecation="false" debug="false"
- srcdir="${src}" destdir="${target}/ant">
+ srcdir="${src}" destdir="${target}/ant">
<include name="org/snipsnap/util/PropertyConstantBuilder.java"/>
</javac>
</target>
<target depends="buildtask" name="declaretask">
<taskdef name="constants"
- classname="org.snipsnap.util.PropertyConstantBuilder"
- classpath="${target}/ant"/>
+ classname="org.snipsnap.util.PropertyConstantBuilder"
+ classpath="${target}/ant"/>
</target>
<!-- prepare special generated classes -->
<target depends="declaretask" name="generate">
<constants
- properties="${src}/org/snipsnap/config/defaults.conf"
- file="${target}/ant/config.stub" prefix="app."
- />
+ properties="${src}/org/snipsnap/config/defaults.conf"
+ file="${target}/ant/config.stub" prefix="app."
+ />
<loadfile property="config-stub" srcfile="${target}/ant/config.stub" failonerror="false"/>
<copy file="${src}/org/snipsnap/config/Configuration.java.tmpl"
- tofile="${src}/org/snipsnap/config/Configuration.java" filtering="true" overwrite="true">
+ tofile="${src}/snipsnap/api/config/Configuration.java" filtering="true" overwrite="true">
<filterset>
<filter token="DEFAULTS" value="${config-stub}"/>
</filterset>
</copy>
<constants
- properties="${src}/org/snipsnap/config/globals.conf"
- file="${target}/ant/globals.stub" prefix="app."
- />
+ properties="${src}/org/snipsnap/config/globals.conf"
+ file="${target}/ant/globals.stub" prefix="app."
+ />
<loadfile property="globals-stub" srcfile="${target}/ant/globals.stub" failonerror="false"/>
<copy file="${src}/org/snipsnap/config/Globals.java.tmpl"
- tofile="${src}/org/snipsnap/config/Globals.java" filtering="true" overwrite="true">
+ tofile="${src}/org/snipsnap/config/Globals.java" filtering="true" overwrite="true">
<filterset>
<filter token="DEFAULTS" value="${globals-stub}"/>
</filterset>
</target>
<target depends="compile-api" description="create api jar" name="jar-api">
- <jar destfile="${jar}/snipsnap-api.jar">
- <fileset dir="${target}/api/" includes="snipsnap/api/**"/>
- </jar>
+ <jar destfile="${jar}/snipsnap-api.jar">
+ <fileset dir="${target}/api/" includes="snipsnap/api/**"/>
+ </jar>
</target>
-
+
<target description="compile api code" name="compile-api">
<mkdir dir="${target}/api"/>
<javac deprecation="${deprecation}" debug="${debug}"
- srcdir="${src}"
- destdir="${target}/api"
- classpathref="all.classpath">
+ srcdir="${src}"
+ destdir="${target}/api"
+ classpathref="all.classpath">
<include name="snipsnap/api/**"/>
</javac>
</target>
+ <target description="compile implementation code" name="compile-impl">
+ <mkdir dir="${target}/impl"/>
+ <javac deprecation="${deprecation}" debug="${debug}"
+ srcdir="${src}"
+ destdir="${target}/impl"
+ classpathref="all.classpath">
+
+ <include name="org/snipsnap/util/ApplicationAwareMap.java"/>
+ <include name="org/snipsnap/interceptor/Aspects.java"/>
+ <include name="org/snipsnap/snip/SnipFactory.java"/>
+ <include name="org/snipsnap/versioning/VersionInfo.java"/>
+ <include name="org/snipsnap/user/Security.java"/>
+ <include name="org/snipsnap/snip/storage/query/*.java"/>
+ <include name="org/snipsnap/render/PlainTextRenderEngine.java"/>
+ </javac>
+ </target>
+
+ <target depends="compile-impl" description="create implementation jar" name="jar-impl">
+ <jar destfile="${jar}/snipsnap-impl.jar">
+ <fileset dir="${target}/impl/" includes="**"/>
+ </jar>
+ </target>
+
<!-- create server code -->
- <target depends="compile-jsp, compile-server,installer-war,snipsnap-war" description="create server jar" name="jar-server">
+ <target depends="compile-jsp, compile-server,installer-war,snipsnap-war" description="create server jar"
+ name="jar-server">
<copy file="conf/copyright.txt" tofile="${target}/server/conf/copyright.txt" filtering="true">
<filterset>
<filter token="VERSION" value="${snipsnap.server.version}"/>
</filterset>
</copy>
- <jar destfile="${jar}/${appname}-server.jar" excludes="**/CVS, org/snipsnap/server/*Launcher*" manifest="conf/manifest">
+ <jar destfile="${jar}/${appname}-server.jar" excludes="**/CVS, org/snipsnap/server/*Launcher*"
+ manifest="conf/manifest">
<fileset dir="${target}/server" includes="**">
<exclude name="org/snipsnap/server/*Launcher*"/>
</fileset>
<target depends="generate" description="compile server code" name="compile-server">
<mkdir dir="${target}/server"/>
<javac deprecation="${deprecation}" debug="${debug}"
- srcdir="${src}"
- destdir="${target}/server"
- classpathref="server.classpath">
+ srcdir="${src}"
+ destdir="${target}/server"
+ classpathref="server.classpath">
<include name="org/snipsnap/server/**"/>
<exclude name="org/snipsnap/server/Admin*"/>
<target depends="generate" description="compile util code" name="compile-util">
<mkdir dir="${target}/util"/>
<javac deprecation="${deprecation}" debug="${debug}"
- srcdir="${src}"
- classpathref="all.classpath"
- destdir="${target}/util">
+ srcdir="${src}"
+ classpathref="all.classpath"
+ destdir="${target}/util">
<include name="org/snipsnap/util/Test*"/>
<include name="org/snipsnap/util/*Util.java"/>
<include name="org/snipsnap/util/DB*.java"/>
<target depends="generate" description="compile test code" name="compile-test">
<mkdir dir="${target}/test"/>
<javac deprecation="${deprecation}" debug="${debug}"
- srcdir="${src}"
- classpathref="test.classpath"
- destdir="${target}/test"
- includes="org/snipsnap/test/**"/>
+ srcdir="${src}"
+ classpathref="test.classpath"
+ destdir="${target}/test"
+ includes="org/snipsnap/test/**"/>
</target>
<target depends="generate" description="compile template application code" name="compile-servlets">
<mkdir dir="${target}/default/WEB-INF/classes"/>
<!-- fix, why junit to compile servlets? -->
<javac deprecation="${deprecation}" debug="${debug}"
- srcdir="${src}"
- classpathref="test.classpath"
- destdir="${target}/default/WEB-INF/classes"
- excludes="org/snipsnap/admin/**, org/snipsnap/server/**">
+ srcdir="${src}"
+ classpathref="test.classpath"
+ destdir="${target}/default/WEB-INF/classes"
+ excludes="org/snipsnap/admin/**, org/snipsnap/server/**">
<src path="${src}"/>
<include name="org/snipsnap/**"/>
</javac>
<mkdir dir="${target}/jsp/source"/>
<mkdir dir="${target}/jsp/classes"/>
<jspc destdir="${target}/jsp/source"
- verbose="1" srcdir="${src}/apps/default"
- classpathref="all.classpath"
- webinc="${target}/jsp/web.inc">
+ verbose="1" srcdir="${src}/apps/default"
+ classpathref="all.classpath"
+ webinc="${target}/jsp/web.inc">
<include name="**/*.jsp"/>
<webapp basedir="${src}/apps/default"/>
</jspc>
<depend
- srcdir="${target}/jsp/source"
- destdir="${target}/jsp/classes"
- cache="${target}/jsp/dependencies"
- classpathref="all.classpath"/>
+ srcdir="${target}/jsp/source"
+ destdir="${target}/jsp/classes"
+ cache="${target}/jsp/dependencies"
+ classpathref="all.classpath"/>
<javac deprecation="${deprecation}" debug="${debug}"
- srcdir="${target}/jsp/source"
- classpath="${src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar"
- classpathref="all.classpath"
- destdir="${target}/jsp/classes">
+ srcdir="${target}/jsp/source"
+ classpath="${src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar"
+ classpathref="all.classpath"
+ destdir="${target}/jsp/classes">
<include name="**"/>
</javac>
</target>
<mkdir dir="${target}/jsp/source"/>
<mkdir dir="${target}/jsp/classes"/>
<jspc destdir="${target}/jsp/source"
- verbose="1" srcdir="${src}"
- package="org.snipsnap.jsp"
- classpathref="all.classpath">
+ verbose="1" srcdir="${src}"
+ package="org.snipsnap.jsp"
+ classpathref="all.classpath">
<include name="**/EditTest.jsp"/>
</jspc>
<depend
- srcdir="${target}/jsp/source"
- destdir="${target}/jsp/classes"
- cache="${target}/jsp/dependencies"
- classpathref="all.classpath"/>
+ srcdir="${target}/jsp/source"
+ destdir="${target}/jsp/classes"
+ cache="${target}/jsp/dependencies"
+ classpathref="all.classpath"/>
<javac deprecation="${deprecation}" debug="${debug}"
- srcdir="${target}/jsp/source"
- classpath="${src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar"
- classpathref="all.classpath"
- destdir="${target}/jsp/classes">
+ srcdir="${target}/jsp/source"
+ classpath="${src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar"
+ classpathref="all.classpath"
+ destdir="${target}/jsp/classes">
<include name="**"/>
</javac>
<jar destfile="${src}/apps/default/WEB-INF/lib/edittest.jar" excludes="**/CVS">
</fileset>
</copy>
<copy tofile="${target}/webapp/WEB-INF/classes/i18n/messages.properties"
- file="${src}/apps/default/WEB-INF/classes/i18n/messages_en.properties"/>
+ file="${src}/apps/default/WEB-INF/classes/i18n/messages_en.properties"/>
<loadfile property="web.inc" srcfile="${target}/jsp/web.inc" failonerror="false"/>
<condition property="web.inc" value="">
</condition>
<!-- copy with filter if web.inc is available -->
<copy
- tofile="${target}/webapp/WEB-INF/web.xml"
- file="${src}/apps/default/WEB-INF/web-xml.tmpl" overwrite="true">
+ tofile="${target}/webapp/WEB-INF/web.xml"
+ file="${src}/apps/default/WEB-INF/web-xml.tmpl" overwrite="true">
<filterset>
<filter token="VERSION" value="${snipsnap.server.version}"/>
<filter token="PRECOMPILED-JSP" value="${web.inc}"/>
<copy file="${src}/apps/default/index.jsp" tofile="${target}/webapp/index.jsp"/>
<copy file="conf/copyright.txt" filtering="true"
- todir="${target}/webapp/WEB-INF/classes/defaults">
+ todir="${target}/webapp/WEB-INF/classes/defaults">
<filterset>
<filter token="VERSION" value="${snipsnap.server.version}"/>
</filterset>
<include name="asm-1.4.1.jar"/>
<include name="gabriel.jar"/>
<include name="jmdns.jar"/>
- <include name="${rome.jar}"/>
- <include name="${jdom.jar}"/>
- <include name="${spring-core.jar}"/>
- <include name="${spring-beans.jar}"/>
+ <include name="${rome.jar}"/>
+ <include name="${jdom.jar}"/>
+ <include name="${spring-core.jar}"/>
+ <include name="${spring-beans.jar}"/>
<include name="dynaop-1.0-beta.jar"/>
<include name="cglib-asm-1.0.jar"/>
<include name="asm-util-1.4.1.jar"/>
<include name="nanocontainer-1.0.jar"/>
<include name="nanocontainer-dynaop-1.0-beta-1-SNAPSHOT.jar"/>
<include name="rss-ng-1.0-alpha-1.jar"/>
- <include name="${search-ng.jar}"/>
+ <include name="${search-ng.jar}"/>
<include name="jdbcstorage-1.0-alpha-1.jar"/>
</fileset>
</copy>
</jar>
</target>
- <target if="precompile.jsp" depends="installer-servlets-jar" name="compile-installer-jsp" description="compile installer jsp files">
+ <target if="precompile.jsp" depends="installer-servlets-jar" name="compile-installer-jsp"
+ description="compile installer jsp files">
<mkdir dir="${target}/installer/jsp/source"/>
<mkdir dir="${target}/installer/jsp/classes"/>
<jspc destdir="${target}/installer/jsp/source"
- verbose="1"
- classpathref="all.classpath"
- webinc="${target}/installer/jsp/web.inc">
+ verbose="1"
+ classpathref="all.classpath"
+ webinc="${target}/installer/jsp/web.inc">
<include name="**/*.jsp"/>
<webapp basedir="${src}/apps/installer"/>
</jspc>
<depend
- srcdir="${target}/installer/jsp/source"
- destdir="${target}/installer/jsp/classes"
- cache="${target}/installer/jsp/dependencies"
- classpathref="all.classpath"/>
+ srcdir="${target}/installer/jsp/source"
+ destdir="${target}/installer/jsp/classes"
+ cache="${target}/installer/jsp/dependencies"
+ classpathref="all.classpath"/>
<javac deprecation="${deprecation}" debug="${debug}"
- srcdir="${target}/installer/jsp/source"
- classpath="${target}/installer/webapp/WEB-INF/lib/installer-servlets.jar"
- classpathref="all.classpath"
- destdir="${target}/installer/jsp/classes">
+ srcdir="${target}/installer/jsp/source"
+ classpath="${target}/installer/webapp/WEB-INF/lib/installer-servlets.jar"
+ classpathref="all.classpath"
+ destdir="${target}/installer/jsp/classes">
<include name="**"/>
</javac>
</target>
<target description="compile installer application code" name="compile-installer">
<mkdir dir="${target}/installer/servlets"/>
<javac deprecation="${deprecation}" debug="${debug}"
- srcdir="${src}"
- classpathref="all.classpath"
- destdir="${target}/installer/servlets">
+ srcdir="${src}"
+ classpathref="all.classpath"
+ destdir="${target}/installer/servlets">
<include name="org/snipsnap/admin/AdminInitFilter.java"/>
<include name="org/snipsnap/admin/Installer.java"/>
</javac>
</target>
- <target if="precompile.jsp" depends="compile-installer-jsp" name="installer-jsp-jar" description="package precompiled installer jsp files">
+ <target if="precompile.jsp" depends="compile-installer-jsp" name="installer-jsp-jar"
+ description="package precompiled installer jsp files">
<mkdir dir="${target}/installer/webapp/WEB-INF/lib"/>
<jar destfile="${target}/installer/webapp/WEB-INF/lib/installer-jsp.jar" excludes="**/CVS">
<fileset dir="${target}/installer/jsp/classes" includes="**"/>
</not>
</condition>
<copy
- tofile="${target}/installer/webapp/WEB-INF/web.xml"
- file="${src}/apps/installer/WEB-INF/web-xml.tmpl" overwrite="true">
+ tofile="${target}/installer/webapp/WEB-INF/web.xml"
+ file="${src}/apps/installer/WEB-INF/web-xml.tmpl" overwrite="true">
<filterset>
<filter token="PRECOMPILED-JSP" value="${installer-web.inc}"/>
</filterset>
<target description="generation javadocs" name="javadoc">
<javadoc packagenames="org.snipsnap.*"
- sourcepath="src"
- excludepackagenames="org.snipsnap.test.*"
- defaultexcludes="yes"
- destdir="docs/api"
- author="true"
- version="true"
- use="true"
- windowtitle="SnipSnap API">
+ sourcepath="src"
+ excludepackagenames="org.snipsnap.test.*"
+ defaultexcludes="yes"
+ destdir="docs/api"
+ author="true"
+ version="true"
+ use="true"
+ windowtitle="SnipSnap API">
<doctitle><![CDATA[<h1>SnipSnap</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2001-2004 Matthias L. Jugel, Stephan J. Schmidt. All Rights Reserved
.</i>]]></bottom>
blob - 2e0c6d6fb5f61a116c4a5c0ca9f1d7915ed4622c
blob + 9033ca3bbf50b8fbbfbadd95ff0b22c58fc673c3
--- conf/libs.properties
+++ conf/libs.properties
jdom.jar=jdom-1.0.jar
spring-core.jar=spring-core.jar
spring-beans.jar=spring-beans.jar
+jdbcstorage.jar=jdbcstorage-1.0-alpha-1.jar
search-ng.jar=search-ng-1.0-alpha-1.jar
+rss-ng.jar=rss-ng-1.0-alpha-1.jar
\ No newline at end of file
blob - 521f2e062918f91e1e4ee0a8a08c06e1a4ef2151
blob + 554f80e4c1cbc259c14d7413d226c937b60497d6
Binary files lib/jdbcstorage-1.0-alpha-1.jar and lib/jdbcstorage-1.0-alpha-1.jar differ
blob - c090defcc531bbfdbb620137f4f92194b6bcfc82
blob + d031bd9b57b4ca6f5567487acc6d487f56feaafa
Binary files lib/rss-ng-1.0-alpha-1.jar and lib/rss-ng-1.0-alpha-1.jar differ
blob - 084f2faabe4b636c262c3e7afc4860979e6b1c4d
blob + 6789de8caa694edd5a8336c65b6341801e1e7205
--- src/apps/default/WEB-INF/classes/i18n/setup_de.properties
+++ src/apps/default/WEB-INF/classes/i18n/setup_de.properties
Diese Einstellungen können die Funktionsweise von SnipSnap erheblich verändern und \
sollten nur mit großer Sorgfalt geändert werden. <b>SnipSnap kann durch Verändern \
dieser Einstellungen unbrauchbar werden!</b>
+config.app.auth = Authentifizierungsschema
+config.app.auth.text = \
+ Wählen Sie hier die Art und Weise der Authentifizierung der Benutzer. Es stehen \
+ neben dem Standard auch noch Basic und Digest, sowie Zertifikatbasierte Methoden \
+ zur Verfügung.
+config.app.auth.cookie = Formularbasiert (Standard)
+config.app.auth.basic = Einfache Browserabfrage (Basic)
+config.app.auth.digest = Browserabfrage (Digest)
+config.app.auth.certificate = Benutzerzertifikat
config.app.start.snip = Start Snip
config.app.start.snip.text = \
Üblicherweise ist 'start' die Startseite Ihrer SnipSnap site. Sie können \
blob - aae677585e8331ef650fae7c46639f59a57a7d6b
blob + 1d2f95671e783823d7169e030c170ee6ff631b68
--- src/apps/default/WEB-INF/classes/i18n/setup_en.properties
+++ src/apps/default/WEB-INF/classes/i18n/setup_en.properties
These settings may heavily change the way SnipSnap works and should be \
changed with care. <b>Changing some of these values may make SnipSnap \
unusable!</b>
+config.app.auth = Authentication Scheme
+config.app.auth.text = \
+ Select your preferred authentication scheme here. SnipSnap supports next to its \
+ default cookie and form based scheme, basic and digest browser authentication as \
+ well as certificate based authentication.
+config.app.auth.cookie = Form and Cookie (default)
+config.app.auth.basic = Basic Browser Auth
+config.app.auth.digest = Digest Browser Auth
+config.app.auth.certificate = Client Certificate
config.app.start.snip = Start Snip
config.app.start.snip.text = \
Normally 'start' is the home page of the SnipSnap site. You can redirect \
blob - fe3339928b9e97882560119a10962d806b686d57
blob + 5abe85d3d47912a943723f33460d87c12ecffa8e
--- src/apps/default/admin/config/expert.jsp
+++ src/apps/default/admin/config/expert.jsp
<table>
<tr>
+ <td><fmt:message key="config.app.auth.text"/></td>
+ <td>
+ <fmt:message key="config.app.auth"/><br/>
+ <select name="app.auth">
+ <option value="Cookie"
+ <c:if test="${newconfig.auth == 'Cookie'}">selected="selected"</c:if>>
+ <fmt:message key="config.app.auth.cookie"/></option>
+ <option value="Basic"
+ <c:if test="${newconfig.auth == 'Basic'}">selected="selected"</c:if>>
+ <fmt:message key="config.app.auth.basic"/></option>
+ <option value="Digest"
+ <c:if test="${newconfig.auth == 'Digest'}">selected="selected"</c:if>>
+ <fmt:message key="config.app.auth.digest"/></option>
+ <option value="Certificate"
+ <c:if test="${newconfig.auth == 'Certificate'}">selected="selected"</c:if>>
+ <fmt:message key="config.app.auth.certificate"/></option>
+ </select>
+ <%--
+ <input type="checkbox" name="app.auth.guest" value="<c:out value='${newconfig.auth}'/>">
+ --%>
+ </td>
+ </tr>
+ <tr>
<td><fmt:message key="config.app.start.snip.text"/></td>
<td>
<fmt:message key="config.app.start.snip"/><br/>
blob - 40c6992c7bb85960a40e92b30ef8e29b7ba2a438
blob + 677aca4157bc5baca67560bf9ebd0375f0cbb820
--- src/apps/default/main.jsp
+++ src/apps/default/main.jsp
<%@ page import="snipsnap.api.snip.SnipSpace,
snipsnap.api.app.Application,
- snipsnap.api.snip.SnipSpaceFactory,
snipsnap.api.container.Components,
snipsnap.api.snip.Snip,
java.util.Collection,
<s:debug/>
</div>
<%
- SnipSpace space = (SnipSpace)org.snipsnap.container.Components.getComponent(SnipSpace.class);
+ SnipSpace space = (SnipSpace) Components.getComponent(SnipSpace.class);
for(int i = 1; space.exists("snipsnap-portlet-"+i) || space.exists("SnipSnap/portlet/"+i); i++) {
Snip snip = space.load("snipsnap-portlet-"+i);
if(null == snip) {
pageContext.removeAttribute("view_handler");
pageContext.removeAttribute("mime_type");
- String viewHandler = null;
- String type = null;
+ String viewHandler;
+ String type;
Collection mimeTypes = snip.getLabels().getLabels("TypeLabel");
if (!mimeTypes.isEmpty()) {
Iterator handlerIt = mimeTypes.iterator();
blob - 1679badb9876e80ca1b95135e65f136c4779a693
blob + d602e364f20c0f068e40214952115a000d92790e
--- src/org/snipsnap/app/ApplicationManager.java
+++ src/org/snipsnap/app/ApplicationManager.java
package org.snipsnap.app;
+import snipsnap.api.storage.ApplicationStorage;
+
import java.util.Collection;
import java.util.Map;
import java.util.Iterator;
blob - cee37cfc9f0cbe239833674d5814a87933107443 (mode 644)
blob + /dev/null
--- src/org/snipsnap/app/ApplicationStorage.java
+++ /dev/null
-/*
- * This file is part of "SnipSnap Wiki/Weblog".
- *
- * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
- * All Rights Reserved.
- *
- * Please visit http://snipsnap.org/ for updates and contact.
- *
- * --LICENSE NOTICE--
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- * --LICENSE NOTICE--
- */
-
-package org.snipsnap.app;
-
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * ApplicationStorage is a DAO for applications.
- *
- * @author Stephan J. Schmidt
- * @version $Id$
- */
-
-public interface ApplicationStorage {
- public final static String OID = "OID";
- public final static String PREFIX = "prefix";
- public final static String NAME = "name";
-
-
- public Map getApplications();
- public void removeApplication(String oid);
- public Properties createApplication(String name, String prefix);
-}
blob - 42eb040fb3bac87d83941e97802809a9ae4d121a
blob + 1ef5b6f767a469316fe5f3dc8e165d74a0fb9272
--- src/org/snipsnap/app/PropertyFileApplicationStorage.java
+++ src/org/snipsnap/app/PropertyFileApplicationStorage.java
*/
package org.snipsnap.app;
-import snipsnap.api.config.Configuration;
import org.snipsnap.config.Globals;
import org.snipsnap.jdbc.UIDGenerator;
import org.radeox.util.logging.Logger;
import java.util.HashMap;
import java.util.Iterator;
-import snipsnap.api.app.*;
import snipsnap.api.app.Application;
+import snipsnap.api.storage.ApplicationStorage;
public class PropertyFileApplicationStorage implements ApplicationStorage {
private final static String PREFIX_FILE = "prefix.properties";
blob - 7701189c2189adf2f28da1cbe867920ec928424f
blob + ecf5dc7db3c860984d8074f713e213eeb45fabf9
--- src/org/snipsnap/config/Configuration.java.tmpl
+++ src/org/snipsnap/config/Configuration.java.tmpl
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* --LICENSE NOTICE--
*/
-package org.snipsnap.config;
+package snipsnap.api.config;
+import org.snipsnap.config.Globals;
+
import java.util.Locale;
import java.util.Properties;
import java.io.InputStream;
blob - 8cc78a2af4b1f5cf3b7bdc2ccc797384b65999f5
blob + 3753b05733c2698f429a614bb5c2c927e86433e5
--- src/org/snipsnap/config/ConfigurationManager.java
+++ src/org/snipsnap/config/ConfigurationManager.java
*/
package org.snipsnap.config;
-import org.snipsnap.notification.Consumer;
+import org.radeox.util.logging.Logger;
+import snipsnap.api.notification.Consumer;
import org.snipsnap.notification.Message;
import org.snipsnap.notification.MessageService;
-import snipsnap.api.snip.Snip;
-import snipsnap.api.config.*;
import snipsnap.api.config.Configuration;
import snipsnap.api.container.Components;
-import org.radeox.util.logging.Logger;
+import snipsnap.api.snip.Snip;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
/**
* Manages configurations of this web application (different contexts)
prefixMap = new HashMap();
}
- public snipsnap.api.config.Configuration addConfiguration(String oid, Configuration config) {
- if(config.isInstalled()) {
- MessageService service = (MessageService)Components.getComponent(MessageService.class);
+ public Configuration addConfiguration(String oid, Configuration config) {
+ if (config.isInstalled()) {
+ System.err.println("Registering configuration manager at message service ...");
+ MessageService service = (MessageService) Components.getComponent(MessageService.class);
+ System.err.println("MessageService: "+service);
service.register(this);
}
configMap.put(oid, config);
}
public void removeConfiguration(String oid) {
- Configuration config = (Configuration)configMap.get(oid);
- if(config != null) {
+ Configuration config = (Configuration) configMap.get(oid);
+ if (config != null) {
configMap.remove(oid);
prefixMap.remove(config);
}
}
public String checkForPrefix(String prefix) {
- return (String)prefixMap.get(prefix);
+ return (String) prefixMap.get(prefix);
}
public Iterator getOids() {
}
public void consume(Message messsage) {
- if(Message.SNIP_MODIFIED.equals(messsage.getType())) {
- Snip snip = (snipsnap.api.snip.Snip)messsage.getValue();
- if("SnipSnap/config".equals(snip.getName())) {
+ if (Message.SNIP_MODIFIED.equals(messsage.getType())) {
+ Snip snip = (snipsnap.api.snip.Snip) messsage.getValue();
+ if ("SnipSnap/config".equals(snip.getName())) {
String appOid = snip.getApplication();
Configuration config = getConfiguration(appOid);
try {
- Logger.log("reloading config for: "+appOid);
+ Logger.log("reloading config for: " + appOid);
config.load(new ByteArrayInputStream(snip.getContent().getBytes()));
} catch (IOException e) {
- System.err.println("ConfigurationManager: unable to reload configuration: "+e);
+ System.err.println("ConfigurationManager: unable to reload configuration: " + e);
e.printStackTrace();
}
}
blob - a98229c2d24ad01a45ecc4c9a868488cfae1d609
blob + c50cf3eaf342aa5cf00e4e5e70001d3d1306814a
--- src/org/snipsnap/config/InitializeDatabase.java
+++ src/org/snipsnap/config/InitializeDatabase.java
package org.snipsnap.config;
import snipsnap.api.app.Application;
+import snipsnap.api.storage.ApplicationStorage;
import org.snipsnap.app.ApplicationManager;
-import org.snipsnap.app.ApplicationStorage;
import snipsnap.api.container.Components;
import org.snipsnap.snip.HomePage;
import snipsnap.api.snip.Snip;
import org.snipsnap.user.Permissions;
import org.snipsnap.user.Roles;
import snipsnap.api.user.User;
-import snipsnap.api.config.*;
import snipsnap.api.config.Configuration;
import org.snipsnap.user.UserManager;
import org.snipsnap.user.UserManagerFactory;
blob - 2946cc1053e84aa7621620661245d80d81e51c03
blob + 8660d77edcd0d484d6e68a7daa16f8dcac34fdc8
--- src/org/snipsnap/config/defaults.conf
+++ src/org/snipsnap/config/defaults.conf
app.tagline = The easy Weblog and Wiki Software
app.logo =
app.prefix = /
+app.auth = Cookie
#
# - locale
app.timezone = GMT+00
blob - 110a52c684a727db6ebfe52f0c5978543e40254f (mode 644)
blob + /dev/null
--- src/org/snipsnap/container/Components.java
+++ /dev/null
-package org.snipsnap.container;
-
-/*
- * This file is part of "SnipSnap Wiki/Weblog".
- *
- * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
- * All Rights Reserved.
- *
- * Please visit http://snipsnap.org/ for updates and contact.
- *
- * --LICENSE NOTICE--
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- * --LICENSE NOTICE--
- */
-
-import java.util.Collection;
-
-public class Components {
- public final static String DEFAULT_ENGINE = "defaultRenderEngine";
-
- private static Container container;
-
- public static synchronized Container getContainer() {
- if (null == container) {
- container = new PicoContainer();
- container.init();
- }
-
- return container;
- }
-
- public static Object getComponent(Class c) {
- return getContainer().getComponent(c);
- }
-
- public static Object getComponent(String id) {
- return getContainer().getComponent(id);
- }
-
- public static Collection findComponents(Class c) {
- return getContainer().findComponents(c);
- }
-}
blob - beb02fe553fdecc0cf7dd58e4fb0f2f3496420c5
blob + 8eb7926600edfe79b8f81b028f5203d6e97393a5
--- src/org/snipsnap/container/MessageLogService.java
+++ src/org/snipsnap/container/MessageLogService.java
package org.snipsnap.container;
import org.snipsnap.notification.MessageService;
-import org.snipsnap.notification.Consumer;
+import snipsnap.api.notification.Consumer;
import org.snipsnap.notification.Message;
blob - 348d1da118b06758b1f1e7b2ad4e4ffdda2712ce
blob + 515aedefb582fa2b6069b26a5fd706265ad9aba9
--- src/org/snipsnap/container/PicoContainer.java
+++ src/org/snipsnap/container/PicoContainer.java
import org.picocontainer.defaults.DefaultPicoContainer;
import org.radeox.util.Service;
import org.snipsnap.app.ApplicationManager;
-import org.snipsnap.app.ApplicationStorage;
+import snipsnap.api.storage.ApplicationStorage;
import org.snipsnap.app.JDBCApplicationStorage;
import org.snipsnap.app.PropertyFileApplicationStorage;
import org.snipsnap.components.IndexerService;
import org.snipsnap.versioning.cookbook.CookbookDifferenceService;
import org.snipsnap.xmlrpc.*;
import snipsnap.api.snip.SnipSpace;
-import snipsnap.api.container.*;
+import snipsnap.api.storage.SnipStorage;
+import snipsnap.api.storage.UserStorage;
+import snipsnap.api.storage.VersionStorage;
import javax.sql.DataSource;
import java.util.ArrayList;
blob - 1ecd23cd7c906544358a48a1ef1f393de915021f
blob + 69b6b78b3ae510f7eb94ab1c3aaee73ded09d625
--- src/org/snipsnap/net/NewUserServlet.java
+++ src/org/snipsnap/net/NewUserServlet.java
try {
request = new MultipartWrapper(request, config.getEncoding() != null ? config.getEncoding() : "UTF-8");
} catch (IllegalArgumentException e) {
- Logger.warn("FileUploadServlet: multipart/form-data wrapper:" + e.getMessage());
+ Logger.warn("NewUserServlet: multipart/form-data wrapper:" + e.getMessage());
}
}
blob - c3c1b622b58be40dd44a0de4921960b9d4d3bb8d
blob + 063bce6efd8e2bda209bc328d2dd00e3474c6631
--- src/org/snipsnap/net/PluginServlet.java
+++ src/org/snipsnap/net/PluginServlet.java
import groovy.text.SimpleTemplateEngine;
import groovy.text.Template;
import org.radeox.util.logging.Logger;
-import org.snipsnap.container.Components;
import org.snipsnap.snip.label.TypeLabel;
import org.snipsnap.user.Permissions;
import org.snipsnap.user.Roles;
import snipsnap.api.snip.Snip;
import snipsnap.api.plugin.ServletPlugin;
import snipsnap.api.app.Application;
+import snipsnap.api.container.Components;
public class PluginServlet extends HttpServlet {
private Map extTypeMap = new HashMap();
blob - d51678b75c7a8b4c92276b2f9f68e6ff575b7657
blob + 67f41ee142ff770ff8bd275ade60bfde54e9ced4
--- src/org/snipsnap/net/admin/SetupExpert.java
+++ src/org/snipsnap/net/admin/SetupExpert.java
}
public Map setup(HttpServletRequest request, HttpServletResponse response, Configuration config, Map errors) {
+ config.setAuth(request.getParameter(Configuration.APP_AUTH));
String startSnip = request.getParameter(Configuration.APP_START_SNIP);
config.setStartSnip(null == startSnip || "".equals(startSnip) ? "start" : startSnip);
config.setPermCreateSnip(allowDeny(request.getParameter(Configuration.APP_PERM_CREATESNIP)));
blob - 78bbdb7a188e5fafd0df30974cfcc834f5256f70
blob + c5c685aa054df3649f9fe4469459285ffc540bc2
--- src/org/snipsnap/net/filter/InitFilter.java
+++ src/org/snipsnap/net/filter/InitFilter.java
import snipsnap.api.snip.SnipLink;
import snipsnap.api.snip.SnipSpace;
import snipsnap.api.user.User;
+import snipsnap.api.container.Components;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
session.setAttribute("space", snipsnap.api.snip.SnipSpaceFactory.getInstance());
// check for a logged in user
- SessionService service = (SessionService) snipsnap.api.container.Components.getComponent(SessionService.class);
+ SessionService service = (SessionService) Components.getComponent(SessionService.class);
User user = service.getUser(request, (HttpServletResponse) response);
+ if(null == user) {
+ // someone else did something and is responsible for status codes
+ return;
+ }
+
app.setUser(user, session);
Iterator paramIt = request.getParameterMap().keySet().iterator();
blob - 47a05aa1aeb12a9b7e7881880855b33ba95f339c
blob + 4a6e037d114afdb0c4be775c9e16bd373855d3eb
--- src/org/snipsnap/net/iCalServlet.java
+++ src/org/snipsnap/net/iCalServlet.java
password = auth.substring(auth.indexOf(':') + 1);
}
- User user = ((AuthenticationService) snipsnap.api.container.Components.getComponent(AuthenticationService.class)).authenticate(login, password);
+ User user = ((AuthenticationService) Components.getComponent(AuthenticationService.class)).authenticate(login, password);
if (user == null) {
response.setHeader("WWW-Authenticate", "Basic realm=\"SnipSnap\"");
response.setStatus(WD_UNAUTHORIZED);
blob - b9abc1c2b56a97168944986ef52b9441ff3fdefb (mode 644)
blob + /dev/null
--- src/org/snipsnap/notification/Consumer.java
+++ /dev/null
-/*
- * This file is part of "SnipSnap Wiki/Weblog".
- *
- * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
- * All Rights Reserved.
- *
- * Please visit http://snipsnap.org/ for updates and contact.
- *
- * --LICENSE NOTICE--
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- * --LICENSE NOTICE--
- */
-
-package org.snipsnap.notification;
-
-
-/**
- * Simple Consumer interface to consume Messages from MessageService
- *
- * @author Stephan J. Schmidt
- * @version $Id$
- */
-
-public interface Consumer {
- public void consume(Message message);
-}
blob - 158ad291e1cd167b3412d9b6955cf776427d1a8c
blob + 453aff44d1a917f254c9a7dc31231fbf32e92c22
--- src/org/snipsnap/notification/MessageService.java
+++ src/org/snipsnap/notification/MessageService.java
package org.snipsnap.notification;
-import snipsnap.api.app.Application;
-import snipsnap.api.config.Configuration;
-import org.snipsnap.notification.jabber.JabberNotifier;
-import snipsnap.api.snip.Snip;
-import snipsnap.api.user.User;
+import snipsnap.api.notification.Consumer;
import java.util.ArrayList;
import java.util.Iterator;
private List consumers;
public MessageService() {
+ System.err.println("Creating new MessageService: "+this);
consumers = new ArrayList();
}
blob - d33b137f68394890a40114dd88517efd27c5c694
blob + edb208178a95d2209ad131873e1bbba95cd2b5c7
--- src/org/snipsnap/notification/NotificationService.java
+++ src/org/snipsnap/notification/NotificationService.java
import snipsnap.api.config.Configuration;
import org.snipsnap.notification.jabber.JabberNotifier;
import snipsnap.api.snip.Snip;
-import snipsnap.api.user.User;
import snipsnap.api.container.Components;
+import snipsnap.api.notification.Consumer;
import java.util.ArrayList;
import java.util.Iterator;
blob - 453ba0500999ce96e120c876f35224796a18a258
blob + 5eb52c12efbdee55de724181ac52a0ca090355df
--- src/org/snipsnap/render/macro/loader/GroovyMacroLoader.java
+++ src/org/snipsnap/render/macro/loader/GroovyMacroLoader.java
import org.radeox.macro.Macro;
import org.radeox.macro.MacroLoader;
import org.radeox.macro.Repository;
-import snipsnap.api.container.Components;
-import org.snipsnap.notification.Consumer;
+import snipsnap.api.notification.Consumer;
import org.snipsnap.notification.Message;
import org.snipsnap.notification.MessageService;
import snipsnap.api.snip.Snip;
-import snipsnap.api.snip.SnipSpace;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
blob - 1a227dece8469782cfa23a8dae5cfc1131ece740
blob + e9848ee5ec8c2bb28ca04c01b9ef717bd446af9f
--- src/org/snipsnap/snip/SnipSpaceImpl.java
+++ src/org/snipsnap/snip/SnipSpaceImpl.java
import org.radeox.util.logging.Logger;
import snipsnap.api.app.Application;
import org.snipsnap.app.ApplicationManager;
-import org.snipsnap.app.ApplicationStorage;
+import snipsnap.api.storage.ApplicationStorage;
import snipsnap.api.container.Components;
import org.snipsnap.notification.Message;
import org.snipsnap.notification.MessageService;
import org.snipsnap.snip.storage.CacheSnipStorage;
import org.snipsnap.snip.storage.CacheStorage;
-import org.snipsnap.snip.storage.CacheableStorage;
+import snipsnap.api.storage.CacheableStorage;
import org.snipsnap.snip.storage.MemorySnipStorage;
import org.snipsnap.snip.storage.QuerySnipStorage;
-import org.snipsnap.snip.storage.SnipStorage;
+import snipsnap.api.storage.SnipStorage;
import org.snipsnap.user.Digest;
import org.snipsnap.util.ApplicationAwareMap;
import org.snipsnap.util.Queue;
import java.util.Timer;
import java.util.TimerTask;
-import snipsnap.api.snip.*;
import snipsnap.api.snip.Snip;
/**
blob - c00defa04d89100c3b9d0eee2e503f213fb86743
blob + 21060bbc902e0f06b0d13acf474e6baff91810fd
--- src/org/snipsnap/snip/storage/CacheSnipStorage.java
+++ src/org/snipsnap/snip/storage/CacheSnipStorage.java
package org.snipsnap.snip.storage;
import snipsnap.api.snip.Snip;
+import snipsnap.api.storage.SnipStorage;
import org.snipsnap.util.ApplicationAwareMap;
import java.sql.Timestamp;
blob - d334539b0ddc74c7080a77da408a45f87259de0a (mode 644)
blob + /dev/null
--- src/org/snipsnap/snip/storage/CacheableStorage.java
+++ /dev/null
-/*
-* This file is part of "SnipSnap Wiki/Weblog".
-*
-* Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
-* All Rights Reserved.
-*
-* Please visit http://snipsnap.org/ for updates and contact.
-*
-* --LICENSE NOTICE--
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-* --LICENSE NOTICE--
-*/
-
-package org.snipsnap.snip.storage;
-
-import org.snipsnap.util.ApplicationAwareMap;
-
-public interface CacheableStorage {
- void setCache(ApplicationAwareMap cache);
-}
blob - 0c9f05abafe32ad97fe9f68c1c7c010d90aaa720
blob + 9c09525acb2cef8b7bddcdf5793df7da50eedd91
--- src/org/snipsnap/snip/storage/FileSnipStorage.java
+++ src/org/snipsnap/snip/storage/FileSnipStorage.java
import snipsnap.api.snip.Snip;
import org.snipsnap.snip.SnipFactory;
import org.snipsnap.snip.attachment.Attachments;
-import snipsnap.api.label.Labels;
+import snipsnap.api.storage.SnipStorage;
+import snipsnap.api.storage.CacheableStorage;
import org.snipsnap.user.Permissions;
import org.snipsnap.util.ApplicationAwareMap;
import org.snipsnap.versioning.VersionInfo;
-import org.snipsnap.versioning.VersionStorage;
+import snipsnap.api.storage.VersionStorage;
import java.io.File;
import java.io.IOException;
blob - 897105320dbf439bbc37deb262e3539787f754bd
blob + ddc94c6a32ad4779cb982ae15d444aa26c5f9ffd
--- src/org/snipsnap/snip/storage/FileUserStorage.java
+++ src/org/snipsnap/snip/storage/FileUserStorage.java
import org.radeox.util.logging.Logger;
import snipsnap.api.app.Application;
import snipsnap.api.user.User;
+import snipsnap.api.storage.UserStorage;
import java.io.File;
import java.io.FileInputStream;
blob - 4ffa9000d3dde8b05e2ce70515badcf83cea318a
blob + b2eefba3d1aa9eb35c7fa451d5643d8d2c6897da
--- src/org/snipsnap/snip/storage/MemorySnipStorage.java
+++ src/org/snipsnap/snip/storage/MemorySnipStorage.java
import org.snipsnap.util.ApplicationAwareMap;
import snipsnap.api.app.Application;
import org.snipsnap.app.ApplicationManager;
-import org.snipsnap.app.ApplicationStorage;
+import snipsnap.api.storage.ApplicationStorage;
+import snipsnap.api.storage.SnipStorage;
+import snipsnap.api.storage.CacheableStorage;
import java.sql.Timestamp;
import java.util.*;
blob - 2e8f0fad536435b43beae93b842f805c4234e1a3
blob + 8da7aabfdaba6b3ce8f4826c217dfb76c062b2a7
--- src/org/snipsnap/snip/storage/QuerySnipStorage.java
+++ src/org/snipsnap/snip/storage/QuerySnipStorage.java
package org.snipsnap.snip.storage;
-import snipsnap.api.app.Application;
import snipsnap.api.snip.Snip;
+import snipsnap.api.storage.SnipStorage;
import org.snipsnap.snip.SnipPostNameComparator;
import org.snipsnap.snip.storage.query.QueryKit;
import org.snipsnap.snip.storage.query.SnipComparator;
blob - d17afeca85d5378e0e40a3d1437de3227a0bdb26 (mode 644)
blob + /dev/null
--- src/org/snipsnap/snip/storage/SnipStorage.java
+++ /dev/null
-/*
- * This file is part of "SnipSnap Wiki/Weblog".
- *
- * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
- * All Rights Reserved.
- *
- * Please visit http://snipsnap.org/ for updates and contact.
- *
- * --LICENSE NOTICE--
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- * --LICENSE NOTICE--
- */
-
-package org.snipsnap.snip.storage;
-
-import snipsnap.api.snip.Snip;
-
-import java.sql.Timestamp;
-import java.util.List;
-
-/**
- * Interface that describes SnipStorage backends for SnipSnap
- *
- * @author Stephan J. Schmidt
- * @version $Id$
- */
-
-public interface SnipStorage {
- // Basic manipulation methods Load,Store,Create,Remove
- public Snip[] match(String pattern);
-
- public Snip[] match(String start, String end);
-
- public Snip storageLoad(String name);
-
- public void storageStore(List snips);
-
- public void storageStore(Snip snip);
-
- public Snip storageCreate(String name, String content);
-
- public void storageRemove(Snip snip);
-
- // Finder methods
- public int storageCount();
-
- public List storageAll();
-
- public List storageAll(String applicationOid);
-
- public List storageByHotness(int size);
-
- // find all Snips with the cUser matching the login
- public List storageByUser(String login);
-
- public List storageByDateSince(Timestamp date);
-
- public List storageByRecent(String applicationOid, int size);
-
- public List storageByComments(Snip parent);
-
- // find all Snips matching the parent
- public List storageByParent(Snip parent);
-
- public List storageByParentNameOrder(Snip parent, int count);
-
- public List storageByParentModifiedOrder(Snip parent, int count);
-
- public List storageByDateInName(String nameSpace, String start, String end);
-
-}
blob - 54212de0a1a1cdf9ff50bc9168b96c0b6a6178b4 (mode 644)
blob + /dev/null
--- src/org/snipsnap/snip/storage/UserStorage.java
+++ /dev/null
-/*
- * This file is part of "SnipSnap Wiki/Weblog".
- *
- * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
- * All Rights Reserved.
- *
- * Please visit http://snipsnap.org/ for updates and contact.
- *
- * --LICENSE NOTICE--
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- * --LICENSE NOTICE--
- */
-
-package org.snipsnap.snip.storage;
-
-import snipsnap.api.user.User;
-
-import java.util.List;
-
-/**
- * Storage backend for User data
- *
- * @author Stephan J. Schmidt
- * @version $Id$
- */
-
-public interface UserStorage {
- /**
- * Store an user in to the backend
- *
- * @param user User to store
- */
- public void storageStore(User user);
-
- /**
- * Create a new user in the backend
- *
- * @param login Login name of the user
- * @param passwd Credential of the user
- * @param email Email adress of the user
- * @return
- */
- public User storageCreate(String login, String passwd, String email);
-
- /**
- * Remove an user from the backend
- *
- * @param user User to remove
- */
- public void storageRemove(User user);
-
- /**
- * Return the number of users in the backend
- *
- * @return
- */
- public int storageUserCount();
-
- /**
- * Load a user from the backend
- *
- * @param login Login of the user to load
- * @return
- */
-
- public User storageLoad(String login);
-
- /**
- * Return a list of all users
- *
- * @return
- */
- public List storageAll();
-}
blob - 78308b90047d503186bacafa07f385e6d4d997ee
blob + 86b27e44521f89d2afbfcb5899722b049515fcd5
--- src/org/snipsnap/test/user/DefaultPermissionManagerTest.java
+++ src/org/snipsnap/test/user/DefaultPermissionManagerTest.java
public User authenticate(String login, String passwd, boolean encrypted) {
return null;
}
+ public User authenticate(String login) {
+ return null;
+ }
public boolean isAuthenticated(User user) {
return false;
blob - 0ef7e05b21efdfc25894cf9fdfc7c1e1e1f6e095
blob + 0489d68f55a1d56a174b3712047e42ab78a93951
--- src/org/snipsnap/user/AuthenticationService.java
+++ src/org/snipsnap/user/AuthenticationService.java
public User authenticate(String login, String passwd, boolean encrypted);
public User authenticate(String login, String passwd);
+ public User authenticate(String login);
public boolean isAuthenticated(snipsnap.api.user.User user);
}
blob - a13f370dc18c1269ad43c72738ee9bd07d2902d0
blob + 6f7ab233436aab404e290b763aafe31cd3e2b6df
--- src/org/snipsnap/user/DefaultAuthenticationService.java
+++ src/org/snipsnap/user/DefaultAuthenticationService.java
package org.snipsnap.user;
-import org.snipsnap.snip.storage.UserStorage;
-import snipsnap.api.user.*;
+import snipsnap.api.storage.UserStorage;
import snipsnap.api.user.User;
/*
}
}
+ /** Used for password-less login, i.e. X509Certificate
+ */
+ public User authenticate(String login) {
+ User user = storage.storageLoad(login);
+
+ //@TODO split authenticate and lastLogin
+ if (null != user) {
+ user.lastLogin();
+ storage.storageStore(user);
+ return user;
+ } else {
+ return null;
+ }
+ }
+
public boolean isAuthenticated(User user) {
return user != null && !(user.isGuest() || user.isNonUser());
}
blob - 182da1e952edf19377a01220d1badb335fb92839
blob + 4d327e40da0e8bee4a7c06e9da3c7c5bab0a9cf7
--- src/org/snipsnap/user/DefaultUserManager.java
+++ src/org/snipsnap/user/DefaultUserManager.java
*/
package org.snipsnap.user;
-import snipsnap.api.container.Components;
-import org.snipsnap.snip.storage.UserStorage;
+import snipsnap.api.storage.UserStorage;
import org.snipsnap.util.ApplicationAwareMap;
import org.snipsnap.util.ApplicationAwareIntegerMap;
import org.snipsnap.jdbc.IntHolder;
import java.sql.Timestamp;
import java.util.*;
-import snipsnap.api.user.*;
import snipsnap.api.user.User;
/**
blob - 6ef92f9725986a95e66ec129b0677727251d1e99
blob + 4b8a176ed43a861d85e9bfac3b567d47e7beb06f
--- src/org/snipsnap/user/PasswordService.java
+++ src/org/snipsnap/user/PasswordService.java
package org.snipsnap.user;
-import org.snipsnap.snip.storage.UserStorage;
+import snipsnap.api.storage.UserStorage;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;
-import snipsnap.api.user.*;
import snipsnap.api.user.User;
/*
blob - aebb07aebeacb567c395c0a120de3d02bcdb44b1
blob + 1912efd28dbb1cefb64ccf1c5a811b8153384a55
--- src/org/snipsnap/versioning/DefaultVersionManager.java
+++ src/org/snipsnap/versioning/DefaultVersionManager.java
package org.snipsnap.versioning;
-import snipsnap.api.snip.Snip;
+import snipsnap.api.storage.VersionStorage;
import org.snipsnap.snip.SnipFactory;
import java.util.List;
blob - fc8ca5b51524279e6956740ba4e10518800a2f8e (mode 644)
blob + /dev/null
--- src/org/snipsnap/versioning/VersionStorage.java
+++ /dev/null
-/*
- * This file is part of "SnipSnap Wiki/Weblog".
- *
- * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
- * All Rights Reserved.
- *
- * Please visit http://snipsnap.org/ for updates and contact.
- *
- * --LICENSE NOTICE--
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- * --LICENSE NOTICE--
- */
-
-package org.snipsnap.versioning;
-
-import snipsnap.api.snip.Snip;
-
-import java.util.List;
-
-/**
- * Stores versions of snips
- *
- * @author Stephan J. Schmidt
- * @version $Id$
- */
-
-public interface VersionStorage {
-
- /**
- * Return a list of VersionInfo objects for the
- * given snip. Objects should be ordered by decreasing version
- *
- * @param snip Snip for which the revision should be loaded
- * @return
- */
- public List getVersionHistory(Snip snip);
-
- /**
- * Load a version of a snip from the storage
- *
- * @param snip Example of a snip to load
- * @param version Version number
- * @return
- */
- public Snip loadVersion(Snip snip, int version);
-
- /**
- * Stora a version of a snip in the storage.
- *
- * @param snip Snip to store
- */
- public void storeVersion(Snip snip);
-}
blob - 6f1993937ac2099c9e8caf8174ebc5b2c12964f5
blob + c01b2c2af205e8de8591537447415b3bcfa7e979
--- src/org/snipsnap/xmlrpc/SnipSnapHandler.java
+++ src/org/snipsnap/xmlrpc/SnipSnapHandler.java
import org.snipsnap.config.ConfigurationProxy;
import org.snipsnap.config.Globals;
import org.snipsnap.config.InitializeDatabase;
-import org.snipsnap.container.Components;
import org.snipsnap.snip.XMLSnipExport;
import org.snipsnap.snip.XMLSnipImport;
import org.snipsnap.snip.storage.SnipSerializer;
import snipsnap.api.app.Application;
import snipsnap.api.user.User;
import snipsnap.api.config.Configuration;
+import snipsnap.api.container.Components;
/**
* Handles XML-RPC calls for the SnipSnap API
blob - 47519555010466ead598f0aab7dbc98ed2218548
blob + 1e4a52f8c84e2c07303a9633c625004b43382ed8
--- src/org/snipsnap/xmlrpc/WeblogsPing.java
+++ src/org/snipsnap/xmlrpc/WeblogsPing.java
import org.radeox.util.logging.Logger;
import snipsnap.api.app.Application;
-import snipsnap.api.config.Configuration;
import snipsnap.api.snip.Snip;
import snipsnap.api.snip.SnipSpace;
import org.snipsnap.xmlrpc.ping.PingHandler;
import org.snipsnap.notification.Message;
import org.snipsnap.notification.MessageService;
-import org.snipsnap.notification.Consumer;
+import snipsnap.api.notification.Consumer;
import snipsnap.api.container.Components;
-import org.apache.xmlrpc.XmlRpc;
import java.io.BufferedReader;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ByteArrayInputStream;
-import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
blob - 02b27616f1bf843ba86b613b9ba367f3894d13bf
blob + 309abf051a1cd0843cce3af7144adebcc0fe4b86
--- src/snipsnap/api/config/Configuration.java
+++ src/snipsnap/api/config/Configuration.java
// EASY ACCESS
// automatically created interface/constants stub from
- // /Users/stephan/src/snipsnap/trunk/src/org/snipsnap/config/defaults.conf
- // generated on 4/6/05 7:40 PM
+ // /Users/leo/src/Projects/SnipSnap/core/trunk/src/org/snipsnap/config/defaults.conf
+ // generated on 2/7/06 9:58 PM
// constant/getter for 'app.admin.email'
public final static String APP_ADMIN_EMAIL = "app.admin.email";
public String getAdminEmail();
public final static String APP_ADMIN_PASSWORD = "app.admin.password";
public String getAdminPassword();
public String setAdminPassword(String value);
+ // constant/getter for 'app.auth'
+ public final static String APP_AUTH = "app.auth";
+ public String getAuth();
+ public String setAuth(String value);
// constant/getter for 'app.configured'
public final static String APP_CONFIGURED = "app.configured";
public String getConfigured();
blob - 77925f4728d3d4432aca3765e36c929aa18b346a
blob + d9990feb9c93827a2eaa00b32f963d8525d977e7
--- src/snipsnap/api/container/Components.java
+++ src/snipsnap/api/container/Components.java
*/
import org.snipsnap.container.Container;
-import org.snipsnap.container.PicoContainer;
import java.util.Collection;
public class Components {
- public final static String DEFAULT_ENGINE = "defaultRenderEngine";
+ private static final String DEFAULT_CONTAINER_SERVICE = "org.snipsnap.container.PicoContainer";
+ public final static String DEFAULT_ENGINE = "defaultRenderEngine";
- private static Container container;
+ private static Container container;
- public static synchronized Container getContainer() {
- if (null == container) {
- container = new PicoContainer();
- container.init();
- }
-
- return container;
+ public static synchronized Container getContainer() {
+ if (null == container) {
+ try {
+ container = (Container) Class.forName(DEFAULT_CONTAINER_SERVICE).newInstance();
+ container.init();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
}
- public static Object getComponent(Class c) {
- return getContainer().getComponent(c);
- }
+ return container;
+ }
- public static Object getComponent(String id) {
- return getContainer().getComponent(id);
- }
+ public static Object getComponent(Class c) {
+ return getContainer().getComponent(c);
+ }
- public static Collection findComponents(Class c) {
- return getContainer().findComponents(c);
- }
+ public static Object getComponent(String id) {
+ return getContainer().getComponent(id);
+ }
+
+ public static Collection findComponents(Class c) {
+ return getContainer().findComponents(c);
+ }
}
blob - /dev/null
blob + be1cdda2f894038757086cd5d030f6e9ba0f67c7 (mode 644)
--- /dev/null
+++ src/snipsnap/api/notification/Consumer.java
+/*
+ * This file is part of "SnipSnap Wiki/Weblog".
+ *
+ * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
+ * All Rights Reserved.
+ *
+ * Please visit http://snipsnap.org/ for updates and contact.
+ *
+ * --LICENSE NOTICE--
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * --LICENSE NOTICE--
+ */
+
+package snipsnap.api.notification;
+
+import org.snipsnap.notification.Message;
+
+
+/**
+ * Simple Consumer interface to consume Messages from MessageService
+ *
+ * @author Stephan J. Schmidt
+ * @version $Id: Consumer.java 1606 2004-05-17 10:56:18Z leo $
+ */
+
+public interface Consumer {
+ public void consume(Message message);
+}
blob - /dev/null
blob + 502259f49fe0c0a793f6a9f9d55f4d5827eeab08 (mode 644)
--- /dev/null
+++ src/snipsnap/api/storage/ApplicationStorage.java
+/*
+ * This file is part of "SnipSnap Wiki/Weblog".
+ *
+ * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
+ * All Rights Reserved.
+ *
+ * Please visit http://snipsnap.org/ for updates and contact.
+ *
+ * --LICENSE NOTICE--
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * --LICENSE NOTICE--
+ */
+
+package snipsnap.api.storage;
+
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * ApplicationStorage is a DAO for applications.
+ *
+ * @author Stephan J. Schmidt
+ * @version $Id: ApplicationStorage.java 1257 2003-12-11 13:36:55Z leo $
+ */
+
+public interface ApplicationStorage {
+ public final static String OID = "OID";
+ public final static String PREFIX = "prefix";
+ public final static String NAME = "name";
+
+
+ public Map getApplications();
+ public void removeApplication(String oid);
+ public Properties createApplication(String name, String prefix);
+}
blob - /dev/null
blob + 69e6385faa58563b4a210134ff9980286b3ca497 (mode 644)
--- /dev/null
+++ src/snipsnap/api/storage/CacheableStorage.java
+/*
+* This file is part of "SnipSnap Wiki/Weblog".
+*
+* Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
+* All Rights Reserved.
+*
+* Please visit http://snipsnap.org/ for updates and contact.
+*
+* --LICENSE NOTICE--
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+* --LICENSE NOTICE--
+*/
+
+package snipsnap.api.storage;
+
+import org.snipsnap.util.ApplicationAwareMap;
+
+public interface CacheableStorage {
+ void setCache(ApplicationAwareMap cache);
+}
blob - /dev/null
blob + 7ff806d8b0027d1c273afa75efea72642be5adb8 (mode 644)
--- /dev/null
+++ src/snipsnap/api/storage/SnipStorage.java
+/*
+ * This file is part of "SnipSnap Wiki/Weblog".
+ *
+ * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
+ * All Rights Reserved.
+ *
+ * Please visit http://snipsnap.org/ for updates and contact.
+ *
+ * --LICENSE NOTICE--
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * --LICENSE NOTICE--
+ */
+
+package snipsnap.api.storage;
+
+import snipsnap.api.snip.Snip;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+/**
+ * Interface that describes SnipStorage backends for SnipSnap
+ *
+ * @author Stephan J. Schmidt
+ * @version $Id: SnipStorage.java 1816 2005-04-06 17:56:22Z stephan $
+ */
+
+public interface SnipStorage {
+ // Basic manipulation methods Load,Store,Create,Remove
+ public Snip[] match(String pattern);
+
+ public Snip[] match(String start, String end);
+
+ public Snip storageLoad(String name);
+
+ public void storageStore(List snips);
+
+ public void storageStore(Snip snip);
+
+ public Snip storageCreate(String name, String content);
+
+ public void storageRemove(Snip snip);
+
+ // Finder methods
+ public int storageCount();
+
+ public List storageAll();
+
+ public List storageAll(String applicationOid);
+
+ public List storageByHotness(int size);
+
+ // find all Snips with the cUser matching the login
+ public List storageByUser(String login);
+
+ public List storageByDateSince(Timestamp date);
+
+ public List storageByRecent(String applicationOid, int size);
+
+ public List storageByComments(Snip parent);
+
+ // find all Snips matching the parent
+ public List storageByParent(Snip parent);
+
+ public List storageByParentNameOrder(Snip parent, int count);
+
+ public List storageByParentModifiedOrder(Snip parent, int count);
+
+ public List storageByDateInName(String nameSpace, String start, String end);
+
+}
blob - /dev/null
blob + 22af4f17dd8d388a1188cd935da1b6c15b1dbe82 (mode 644)
--- /dev/null
+++ src/snipsnap/api/storage/UserStorage.java
+/*
+ * This file is part of "SnipSnap Wiki/Weblog".
+ *
+ * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
+ * All Rights Reserved.
+ *
+ * Please visit http://snipsnap.org/ for updates and contact.
+ *
+ * --LICENSE NOTICE--
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * --LICENSE NOTICE--
+ */
+
+package snipsnap.api.storage;
+
+import snipsnap.api.user.User;
+
+import java.util.List;
+
+/**
+ * Storage backend for User data
+ *
+ * @author Stephan J. Schmidt
+ * @version $Id: UserStorage.java 1816 2005-04-06 17:56:22Z stephan $
+ */
+
+public interface UserStorage {
+ /**
+ * Store an user in to the backend
+ *
+ * @param user User to store
+ */
+ public void storageStore(User user);
+
+ /**
+ * Create a new user in the backend
+ *
+ * @param login Login name of the user
+ * @param passwd Credential of the user
+ * @param email Email adress of the user
+ * @return
+ */
+ public User storageCreate(String login, String passwd, String email);
+
+ /**
+ * Remove an user from the backend
+ *
+ * @param user User to remove
+ */
+ public void storageRemove(User user);
+
+ /**
+ * Return the number of users in the backend
+ *
+ * @return
+ */
+ public int storageUserCount();
+
+ /**
+ * Load a user from the backend
+ *
+ * @param login Login of the user to load
+ * @return
+ */
+
+ public User storageLoad(String login);
+
+ /**
+ * Return a list of all users
+ *
+ * @return
+ */
+ public List storageAll();
+}
blob - /dev/null
blob + 1bc7f82cb60d2210dc6ec2214f8f899b734d5e9a (mode 644)
--- /dev/null
+++ src/snipsnap/api/storage/VersionStorage.java
+/*
+ * This file is part of "SnipSnap Wiki/Weblog".
+ *
+ * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
+ * All Rights Reserved.
+ *
+ * Please visit http://snipsnap.org/ for updates and contact.
+ *
+ * --LICENSE NOTICE--
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * --LICENSE NOTICE--
+ */
+
+package snipsnap.api.storage;
+
+import snipsnap.api.snip.Snip;
+
+import java.util.List;
+
+/**
+ * Stores versions of snips
+ *
+ * @author Stephan J. Schmidt
+ * @version $Id: VersionStorage.java 1816 2005-04-06 17:56:22Z stephan $
+ */
+
+public interface VersionStorage {
+
+ /**
+ * Return a list of VersionInfo objects for the
+ * given snip. Objects should be ordered by decreasing version
+ *
+ * @param snip Snip for which the revision should be loaded
+ * @return list of version infos
+ */
+ public List getVersionHistory(Snip snip);
+
+ /**
+ * Load a version of a snip from the storage
+ *
+ * @param snip Example of a snip to load
+ * @param version Version number
+ * @return version of a snip
+ */
+ public Snip loadVersion(Snip snip, int version);
+
+ /**
+ * Stora a version of a snip in the storage.
+ *
+ * @param snip Snip to store
+ */
+ public void storeVersion(Snip snip);
+}