You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2003/06/30 13:46:33 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting MultipartHttpServletRequestAction.java PMLAuthorizerAction.java RollbackAction.java DefaultCreatorAction.java BitfluxAction.java UserAuthenticatorAction.java UserAdminActionInterface.java TaskAction.java ReservedCheckoutAction.java ArticleImageUploadCreatorAction.java AbstractAuthorizerAction.java ParentChildCreatorAction.java EditorSaveAction.java DelegatingAuthorizerAction.java IMLAuthenticatorAction.java PageEnvelopeAction.java EditorAction.java ReservedCheckinAction.java URIParametrizerAction.java RequestParamAction.java UserAdminModifyAction.java EditorMainAction.java EditorTempfileAction.java DeleteDocumentAction.java AbstractUsernamePasswordAuthenticatorAction.java AbstractAuthenticatorAction.java XopusHandlerAction.java HTMLFormWriteAction.java UserAdminAddAction.java ResourceExistsAction.java UserAdminDeleteAction.java DefaultAuthenticatorAction.java RevisionControllerAction.java NoPasswordYetAction.java
andreas 2003/06/30 04:46:33
Modified: src/java/org/apache/lenya/cms/cocoon/acting
MultipartHttpServletRequestAction.java
PMLAuthorizerAction.java RollbackAction.java
DefaultCreatorAction.java BitfluxAction.java
UserAuthenticatorAction.java
UserAdminActionInterface.java TaskAction.java
ReservedCheckoutAction.java
ArticleImageUploadCreatorAction.java
AbstractAuthorizerAction.java
ParentChildCreatorAction.java EditorSaveAction.java
DelegatingAuthorizerAction.java
IMLAuthenticatorAction.java PageEnvelopeAction.java
EditorAction.java ReservedCheckinAction.java
URIParametrizerAction.java RequestParamAction.java
UserAdminModifyAction.java EditorMainAction.java
EditorTempfileAction.java DeleteDocumentAction.java
AbstractUsernamePasswordAuthenticatorAction.java
AbstractAuthenticatorAction.java
XopusHandlerAction.java HTMLFormWriteAction.java
UserAdminAddAction.java ResourceExistsAction.java
UserAdminDeleteAction.java
DefaultAuthenticatorAction.java
RevisionControllerAction.java
NoPasswordYetAction.java
Log:
added cocoon license header
Revision Changes Path
1.3 +96 -85 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/MultipartHttpServletRequestAction.java
Index: MultipartHttpServletRequestAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/MultipartHttpServletRequestAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MultipartHttpServletRequestAction.java 30 May 2003 09:24:38 -0000 1.2
+++ MultipartHttpServletRequestAction.java 30 Jun 2003 11:46:27 -0000 1.3
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configuration;
@@ -49,21 +61,22 @@
import org.apache.avalon.framework.thread.ThreadSafe;
import org.apache.cocoon.acting.AbstractConfigurableAction;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.servlet.multipart.Part;
+
import java.io.*;
import java.util.*;
-import org.apache.cocoon.environment.ObjectModelHelper;
-import org.apache.cocoon.servlet.multipart.Part;
/**
* @author <a href="mailto:michael.wechner@wyona.org">Michael Wechner</a>
*/
-public class MultipartHttpServletRequestAction extends AbstractConfigurableAction implements ThreadSafe {
-
+public class MultipartHttpServletRequestAction extends AbstractConfigurableAction
+ implements ThreadSafe {
/**
* Describe <code>configure</code> method here.
*
@@ -88,27 +101,29 @@
*
* @exception Exception if an error occurs
*/
- public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception {
-
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source,
+ Parameters parameters) throws Exception {
Request request = ObjectModelHelper.getRequest(objectModel);
String title = request.getParameter("title");
getLogger().debug(".act(): title: " + title);
+
String usecase = request.getParameter("lenya.usecase");
getLogger().debug(".act(): usecase: " + usecase);
-/*
- HttpRequest httpRequest = (HttpRequest) objectModel.get(ObjectModelHelper.REQUEST_OBJECT);
- int length = httpRequest.getContentLength();
- PostInputStream pis = new PostInputStream(intercept(httpRequest.getInputStream()), length);
-*/
-
+ /*
+ HttpRequest httpRequest = (HttpRequest) objectModel.get(ObjectModelHelper.REQUEST_OBJECT);
+ int length = httpRequest.getContentLength();
+ PostInputStream pis = new PostInputStream(intercept(httpRequest.getInputStream()), length);
+ */
java.util.Enumeration params = request.getParameterNames();
+
while (params.hasMoreElements()) {
String name = (String) params.nextElement();
getLogger().debug(".act(): Parameter: " + name);
}
Part part = (Part) request.get("title");
+
if (part != null) {
getLogger().debug(".act(): TITLE: " + part);
} else {
@@ -117,37 +132,33 @@
getLogger().debug(".act(): Classname: " + request.getClass().getName());
-/*
- byte[] boundary = new byte[65535];
- try {
- org.apache.commons.fileupload.MultipartStream multipartStream = new org.apache.commons.fileupload.MultipartStream(httpRequest.getInputStream(), boundary);
- boolean nextPart = multipartStream.skipPreamble();
- java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
- while(nextPart) {
- getLogger().debug(".act(): next part");
- multipartStream.readBodyData(out);
- nextPart = multipartStream.readBoundary();
- }
- getLogger().debug(".act(): out:" + out.toString());
- out.close();
- } catch (Exception e) {
- getLogger().error(".act(): " + e.getClass().getName());
- }
-*/
-
-
-
-/*
- // FIXME: Thread "upload problem, 2003-05-16 3:45:07, cocoon-dev"
- if (false) {
- //if (!(request instanceof MultipartHttpServletRequest)) {
- getLogger().error("Not a multipart request!");
- } else {
- Part part = (Part) request.get("title");
- getLogger().debug(".act(): TITLE: " + part.getFileName());
- }
-*/
-
+ /*
+ byte[] boundary = new byte[65535];
+ try {
+ org.apache.commons.fileupload.MultipartStream multipartStream = new org.apache.commons.fileupload.MultipartStream(httpRequest.getInputStream(), boundary);
+ boolean nextPart = multipartStream.skipPreamble();
+ java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
+ while(nextPart) {
+ getLogger().debug(".act(): next part");
+ multipartStream.readBodyData(out);
+ nextPart = multipartStream.readBoundary();
+ }
+ getLogger().debug(".act(): out:" + out.toString());
+ out.close();
+ } catch (Exception e) {
+ getLogger().error(".act(): " + e.getClass().getName());
+ }
+ */
+ /*
+ // FIXME: Thread "upload problem, 2003-05-16 3:45:07, cocoon-dev"
+ if (false) {
+ //if (!(request instanceof MultipartHttpServletRequest)) {
+ getLogger().error("Not a multipart request!");
+ } else {
+ Part part = (Part) request.get("title");
+ getLogger().debug(".act(): TITLE: " + part.getFileName());
+ }
+ */
return null;
}
1.19 +72 -52 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/PMLAuthorizerAction.java
Index: PMLAuthorizerAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/PMLAuthorizerAction.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- PMLAuthorizerAction.java 24 Apr 2003 13:52:38 -0000 1.18
+++ PMLAuthorizerAction.java 30 Jun 2003 11:46:27 -0000 1.19
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configuration;
@@ -50,13 +62,13 @@
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
+import org.apache.lenya.cms.ac.Identity;
+import org.apache.lenya.cms.ac.Policy;
+
import org.apache.xpath.XPathAPI;
import org.w3c.dom.Document;
-import org.apache.lenya.cms.ac.Identity;
-import org.apache.lenya.cms.ac.Policy;
-
import java.net.URL;
import java.util.Map;
@@ -126,7 +138,8 @@
*
* @throws Exception DOCUMENT ME!
*/
- public boolean authorize(Request request, Map map) throws Exception {
+ public boolean authorize(Request request, Map map)
+ throws Exception {
String remoteAddress = request.getRemoteAddr();
// Permit ?Identity? and Policy requests for localhost
@@ -148,14 +161,17 @@
try {
policyDoc = getPolicyDoc(request);
} catch (Exception e) {
- getLogger().error(".authorize(): No policy could be retrieved (" + e + "). Access denied (return false).");
+ getLogger().error(".authorize(): No policy could be retrieved (" + e +
+ "). Access denied (return false).");
+
return false;
}
Policy policy = new Policy(policyDoc, getLogger());
// Read action (read, write, publish, etc.)
- String action = XPathAPI.selectSingleNode(policyDoc, "/ac/request/action/@name").getNodeValue(); //"read";
+ String action = XPathAPI.selectSingleNode(policyDoc, "/ac/request/action/@name")
+ .getNodeValue(); //"read";
if (getLogger().isDebugEnabled()) {
getLogger().debug(".authorize(): action: " + action);
@@ -178,19 +194,23 @@
return false;
}
-
// Needs to be here after authorizeMachine() check, else every component (XPSAssembler) must be wrapped by a proxy!
- String authenticator_type = (String) session.getAttribute("org.apache.lenya.cms.cocoon.acting.Authenticator.id");
+ String authenticator_type = (String) session.getAttribute(
+ "org.apache.lenya.cms.cocoon.acting.Authenticator.id");
+
if (!this.authenticator_type.equals(authenticator_type)) {
if (authenticator_type == null) {
getLogger().warn(".authorize(): No authenticator yet");
} else {
- getLogger().warn(".authorize(): Authenticators do not match: " + authenticator_type + " (Authorizer's authenticator: " + this.authenticator_type + ")");
+ getLogger().warn(".authorize(): Authenticators do not match: " +
+ authenticator_type + " (Authorizer's authenticator: " +
+ this.authenticator_type + ")");
}
+
getLogger().warn(".authorize(): Permission denied");
+
return false;
}
-
Identity identity = (Identity) session.getAttribute("org.apache.lenya.cms.ac.Identity");
1.14 +63 -54 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/RollbackAction.java
Index: RollbackAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/RollbackAction.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- RollbackAction.java 20 May 2003 16:45:19 -0000 1.13
+++ RollbackAction.java 30 Jun 2003 11:46:27 -0000 1.14
@@ -1,60 +1,71 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
-
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Map;
-import org.apache.cocoon.environment.ObjectModelHelper;
/**
@@ -64,7 +75,6 @@
* @version 2002.8.02
*/
public class RollbackAction extends RevisionControllerAction {
-
/**
* DOCUMENT ME!
*
@@ -100,26 +110,25 @@
long newtime = 0;
try {
- newtime = rc.rollback(filename, username, true,
- new Long(rollbackTime).longValue());
+ newtime = rc.rollback(filename, username, true, new Long(rollbackTime).longValue());
} catch (FileNotFoundException e) {
- getLogger().error("Unable to roll back!" + e);
+ getLogger().error("Unable to roll back!" + e);
- return null;
+ return null;
} catch (Exception e) {
- getLogger().error("Unable to roll back!" + e);
+ getLogger().error("Unable to roll back!" + e);
- return null;
+ return null;
}
- getLogger().debug("rollback complete, old (and now current) time was " +
- rollbackTime + " backup time is " + newtime);
+ getLogger().debug("rollback complete, old (and now current) time was " + rollbackTime +
+ " backup time is " + newtime);
String location = request.getHeader("Referer");
getLogger().debug("redirect to " + location);
actionMap.put("location", location);
- return actionMap;
+ return actionMap;
}
}
1.7 +161 -142 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/DefaultCreatorAction.java
Index: DefaultCreatorAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/DefaultCreatorAction.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DefaultCreatorAction.java 26 Jun 2003 14:02:12 -0000 1.6
+++ DefaultCreatorAction.java 30 Jun 2003 11:46:27 -0000 1.7
@@ -1,81 +1,99 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
-package org.apache.lenya.cms.cocoon.acting;
+$Id
+<License>
-import java.io.File;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
+package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.parameters.ParameterException;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.ProcessingException;
-
import org.apache.cocoon.acting.AbstractComplementaryConfigurableAction;
-
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.SourceResolver;
-import org.dom4j.Attribute;
-import org.dom4j.Document;
-import org.dom4j.io.SAXReader;
-
+import org.apache.lenya.cms.authoring.ParentChildCreatorInterface;
import org.apache.lenya.cms.publication.DefaultSiteTree;
import org.apache.lenya.cms.publication.Label;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationFactory;
-import org.apache.lenya.cms.authoring.ParentChildCreatorInterface;
+import org.dom4j.Attribute;
+import org.dom4j.Document;
+import org.dom4j.io.SAXReader;
+
+import java.io.File;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
public class DefaultCreatorAction extends AbstractComplementaryConfigurableAction
implements Configurable {
private String treeAuthoringPath = null;
@@ -113,9 +131,8 @@
*/
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src,
Parameters parameters) throws Exception {
-
- Publication publication = PublicationFactory.getPublication(objectModel);
-
+ Publication publication = PublicationFactory.getPublication(objectModel);
+
getLogger().debug(".act(): PARENT PATH OF SITEMAP: " + publication.getDirectory());
// Get request object
@@ -163,21 +180,19 @@
// Get creator
ParentChildCreatorInterface creator = null;
- String absoluteDoctypesPath = publication.getDirectory() +
- File.separator + doctypesPath;
+ String absoluteDoctypesPath = publication.getDirectory() + File.separator + doctypesPath;
Document doctypesDoc = new SAXReader().read("file:" + absoluteDoctypesPath +
"doctypes.xconf");
- Attribute creator_src = (Attribute)doctypesDoc.selectSingleNode("/doctypes/doc[@type='" +
+ Attribute creator_src = (Attribute) doctypesDoc.selectSingleNode("/doctypes/doc[@type='" +
doctype + "']/creator/@src");
if (creator_src != null) {
getLogger().info(".act(): Creator found for \"" + doctype + "\": " +
- creator_src.getName() + " " + creator_src.getPath() + " " +
- creator_src.getValue());
+ creator_src.getName() + " " + creator_src.getPath() + " " + creator_src.getValue());
- // now get the constructor that accepts the configuration
- Class creatorClass = Class.forName(creator_src.getValue());
- creator = (ParentChildCreatorInterface) creatorClass.newInstance();
+ // now get the constructor that accepts the configuration
+ Class creatorClass = Class.forName(creator_src.getValue());
+ creator = (ParentChildCreatorInterface) creatorClass.newInstance();
} else {
getLogger().warn(".act(): No creator found for \"" + doctype +
"\". DefaultBranchCreator will be taken.");
@@ -187,89 +202,95 @@
getLogger().debug(".act(): Creator : " + creator.getClass().getName());
// Init creator
- // "Read" the configuration from the DOM node
- DefaultConfigurationBuilder defaultConfigBuilder = new DefaultConfigurationBuilder();
- Configuration[] docTypeConfigs =
- defaultConfigBuilder.buildFromFile(absoluteDoctypesPath +
- "doctypes.xconf").getChildren();
-
- Configuration doctypeConf = null;
- for (int i = 0; i < docTypeConfigs.length; i++) {
- String typeName = docTypeConfigs[i].getAttribute("type");
- if (typeName.equals(doctype)) {
- doctypeConf = docTypeConfigs[i].getChild("creator", false);
- }
- }
- creator.init(doctypeConf);
-
- // add a node to the tree
+ // "Read" the configuration from the DOM node
+ DefaultConfigurationBuilder defaultConfigBuilder = new DefaultConfigurationBuilder();
+ Configuration[] docTypeConfigs = defaultConfigBuilder.buildFromFile(absoluteDoctypesPath +
+ "doctypes.xconf").getChildren();
+
+ Configuration doctypeConf = null;
+
+ for (int i = 0; i < docTypeConfigs.length; i++) {
+ String typeName = docTypeConfigs[i].getAttribute("type");
+
+ if (typeName.equals(doctype)) {
+ doctypeConf = docTypeConfigs[i].getChild("creator", false);
+ }
+ }
+
+ creator.init(doctypeConf);
+
+ // add a node to the tree
getLogger().debug("invoking DefaultSiteTree(" + publication.getDirectory() +
- File.separator + treeAuthoringPath + ")");
-
- DefaultSiteTree siteTree = new DefaultSiteTree(new File(publication.getDirectory(),
- treeAuthoringPath));
- Label[] labels = new Label[1];
- labels[0] = new Label(childname, null);
- siteTree.addNode(parentid, creator.generateTreeId(childid, childType), labels);
+ File.separator + treeAuthoringPath + ")");
+
+ DefaultSiteTree siteTree = new DefaultSiteTree(new File(publication.getDirectory(),
+ treeAuthoringPath));
+ Label[] labels = new Label[1];
+ labels[0] = new Label(childname, null);
+ siteTree.addNode(parentid, creator.generateTreeId(childid, childType), labels);
// Transaction should actually be finished here!
// Create actual document
+ // grab all the parameters from session, request params and
+ // sitemap params
+ HashMap allParameters = new HashMap();
+ String[] names = parameters.getNames();
+
+ for (int i = 0; i < names.length; i++) {
+ String name = names[i];
+ String value = null;
+
+ try {
+ value = parameters.getParameter(name);
+ } catch (ParameterException pe) {
+ value = null;
+ }
- // grab all the parameters from session, request params and
- // sitemap params
- HashMap allParameters = new HashMap();
- String[] names = parameters.getNames();
-
- for( int i = 0; i < names.length; i++ ) {
- String name = names[ i ];
- String value = null;
- try {
- value = parameters.getParameter( name );
- } catch (ParameterException pe) {
- value = null;
- }
-
- allParameters.put(name, value);
- }
-
- Enumeration requestParameters = request.getParameterNames();
- while (requestParameters.hasMoreElements()) {
- String requestParameterName = (String) requestParameters.nextElement();
- if (allParameters.containsKey(requestParameterName)) {
- // we do not allow name clashes
- throw new ProcessingException("Name clash in request parameter " +
- "and sitemap parameter: " +
- requestParameterName);
- }
- allParameters.put(requestParameterName,
- request.getParameter(requestParameterName));
- }
-
- Enumeration sessionAttributeNames = session.getAttributeNames();
- while (sessionAttributeNames.hasMoreElements()) {
- String sessionAttributeName = (String) sessionAttributeNames.nextElement();
- if (allParameters.containsKey(sessionAttributeName)) {
- // we do not allow name clashes
- throw new ProcessingException("Name clash in session attribute " +
- "and request parameter or sitemap parameter: " +
- sessionAttributeName);
- }
- allParameters.put(sessionAttributeName, session.getAttribute(sessionAttributeName));
- }
-
- try {
+ allParameters.put(name, value);
+ }
+
+ Enumeration requestParameters = request.getParameterNames();
+
+ while (requestParameters.hasMoreElements()) {
+ String requestParameterName = (String) requestParameters.nextElement();
+
+ if (allParameters.containsKey(requestParameterName)) {
+ // we do not allow name clashes
+ throw new ProcessingException("Name clash in request parameter " +
+ "and sitemap parameter: " + requestParameterName);
+ }
+
+ allParameters.put(requestParameterName, request.getParameter(requestParameterName));
+ }
+
+ Enumeration sessionAttributeNames = session.getAttributeNames();
+
+ while (sessionAttributeNames.hasMoreElements()) {
+ String sessionAttributeName = (String) sessionAttributeNames.nextElement();
+
+ if (allParameters.containsKey(sessionAttributeName)) {
+ // we do not allow name clashes
+ throw new ProcessingException("Name clash in session attribute " +
+ "and request parameter or sitemap parameter: " + sessionAttributeName);
+ }
+
+ allParameters.put(sessionAttributeName, session.getAttribute(sessionAttributeName));
+ }
+
+ try {
creator.create(new File(absoluteDoctypesPath + "samples"),
- new File(publication.getDirectory(), docsPath + parentid),
- childid, childType, childname, allParameters);
+ new File(publication.getDirectory(), docsPath + parentid), childid, childType,
+ childname, allParameters);
} catch (Exception e) {
getLogger().error(".act(): Creator threw exception: " + e);
}
- // commit (sort of)
- siteTree.save();
+ // commit (sort of)
+ siteTree.save();
+
+ HashMap actionMap = new HashMap();
- HashMap actionMap = new HashMap();
- return actionMap;
+ return actionMap;
}
/**
@@ -283,9 +304,8 @@
*
* @return DOCUMENT ME!
*/
- public boolean validate(String parentid,
- String childid, String childname, String childtype,
- String doctype) {
+ public boolean validate(String parentid, String childid, String childname, String childtype,
+ String doctype) {
getLogger().debug(".validate(): parentid=" + parentid + " ; childid=" + childid +
" ; childname=" + childname + " ; childtype=" + childtype + " ; doctype=" + doctype);
@@ -299,5 +319,4 @@
return true;
}
-
}
1.15 +64 -49 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/BitfluxAction.java
Index: BitfluxAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/BitfluxAction.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- BitfluxAction.java 30 May 2003 09:24:07 -0000 1.14
+++ BitfluxAction.java 30 Jun 2003 11:46:27 -0000 1.15
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.excalibur.io.FileUtil;
@@ -52,8 +64,6 @@
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.acting.ConfigurableComposerAction;
-import org.apache.excalibur.source.Source;
-import org.apache.excalibur.xml.dom.DOMParser;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Session;
@@ -64,12 +74,15 @@
import org.apache.cocoon.util.PostInputStream;
import org.apache.cocoon.xml.dom.DOMStreamer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.xml.dom.DOMParser;
import org.apache.lenya.cms.ac.Identity;
import org.apache.lenya.cms.rc.RevisionController;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -78,7 +91,6 @@
import java.io.IOException;
import java.io.OutputStream;
-
import java.util.HashMap;
import java.util.Map;
@@ -256,12 +268,15 @@
throw new Exception("No session");
}
- Identity identity = (Identity) session.getAttribute("org.apache.lenya.cms.ac.Identity");
+ Identity identity = (Identity) session.getAttribute(
+ "org.apache.lenya.cms.ac.Identity");
rc.reservedCheckIn(xmlRoot + "/" + relativeFilename, identity.getUsername(), true);
FileUtil.copyFile(tempFile, permFile);
} catch (Exception e) {
- getLogger().error(".act(): Exception during checkin of " + xmlRoot + "/" +relativeFilename + " (" + e +")");
+ getLogger().error(".act(): Exception during checkin of " + xmlRoot + "/" +
+ relativeFilename + " (" + e + ")");
+
return null;
}
}
1.3 +73 -73 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAuthenticatorAction.java
Index: UserAuthenticatorAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAuthenticatorAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UserAuthenticatorAction.java 25 Jun 2003 14:46:03 -0000 1.2
+++ UserAuthenticatorAction.java 30 Jun 2003 11:46:27 -0000 1.3
@@ -1,102 +1,107 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2003 Wyona. 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. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment: "This product
- * includes software developed by Wyona (http://www.wyona.com)"
- *
- * 4. The name "Lenya" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact contact@wyona.com
- *
- * 5. Products derived from this software may not be called "Lenya" nor
- * may "Lenya" appear in their names without prior written permission
- * of Wyona.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment: "This product includes software developed by Wyona
- * (http://www.wyona.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY Wyona "AS IS" WITHOUT ANY WARRANTY EXPRESS
- * OR IMPLIED, INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * Wyona WILL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY YOU AS A RESULT
- * OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF Wyona HAS BEEN
- * ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. Wyona WILL NOT BE LIABLE
- * FOR ANY THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
-import java.io.File;
-import java.util.Map;
-
import org.apache.avalon.framework.parameters.Parameters;
+
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.SourceResolver;
+
import org.apache.lenya.cms.ac.Identity;
import org.apache.lenya.cms.ac.ItemManager;
import org.apache.lenya.cms.ac.User;
import org.apache.lenya.cms.ac.UserManager;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationFactory;
+
import org.w3c.dom.Document;
+import java.io.File;
+
+import java.util.Map;
+
+
/**
* @author egli
- *
- *
+ *
+ *
*/
public class UserAuthenticatorAction extends IMLAuthenticatorAction {
-
private Publication publication;
- /*
- * This is an implementation of an authenticator which uses
+ /*
+ * This is an implementation of an authenticator which uses
* the User classes and delegates the authentication to them.
* An LDAPUser authenticates itself differently than a FileUser
- *
+ *
* @param username
* @param password
* @param request
* @param map is ignored
- *
+ *
* @return true if authentication succeded
*/
- public boolean authenticate(
- String username,
- String password,
- Request request,
- Map map)
+ public boolean authenticate(String username, String password, Request request, Map map)
throws Exception {
-
File configurationDirectory = new File(publication.getDirectory(), ItemManager.PATH);
UserManager manager = UserManager.instance(configurationDirectory);
User user = manager.getUser(username);
-
+
if (getLogger().isDebugEnabled()) {
getLogger().debug("Authenticating user: " + user);
}
@@ -118,21 +123,17 @@
return true;
}
+
return false;
}
/* (non-Javadoc)
* @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
*/
- public Map act(
- Redirector redirector,
- SourceResolver resolver,
- Map objectModel,
- String src,
- Parameters parameters)
- throws Exception {
-
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src,
+ Parameters parameters) throws Exception {
publication = PublicationFactory.getPublication(objectModel);
+
return super.act(redirector, resolver, objectModel, src, parameters);
}
@@ -143,5 +144,4 @@
public Publication getPublication() {
return publication;
}
-
}
1.3 +63 -58 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAdminActionInterface.java
Index: UserAdminActionInterface.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAdminActionInterface.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UserAdminActionInterface.java 6 Jun 2003 17:23:45 -0000 1.2
+++ UserAdminActionInterface.java 30 Jun 2003 11:46:27 -0000 1.3
@@ -1,66 +1,71 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2003 Wyona. 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. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment: "This product
- * includes software developed by Wyona (http://www.wyona.com)"
- *
- * 4. The name "Lenya" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact contact@wyona.com
- *
- * 5. Products derived from this software may not be called "Lenya" nor
- * may "Lenya" appear in their names without prior written permission
- * of Wyona.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment: "This product includes software developed by Wyona
- * (http://www.wyona.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY Wyona "AS IS" WITHOUT ANY WARRANTY EXPRESS
- * OR IMPLIED, INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * Wyona WILL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY YOU AS A RESULT
- * OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF Wyona HAS BEEN
- * ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. Wyona WILL NOT BE LIABLE
- * FOR ANY THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
-
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
+
/**
* @author egli
- *
- *
+ *
+ *
*/
public interface UserAdminActionInterface {
-
- public static final String USER_ID = "user-id";
- public static final String FULL_NAME = "fullname";
- public static final String EMAIL = "email";
- public static final String PASSWORD = "password";
- public static final String CONFIRM_PASSWORD = "confirm-password";
- public static final String GROUPS = "groups";
-
+ public static final String USER_ID = "user-id";
+ public static final String FULL_NAME = "fullname";
+ public static final String EMAIL = "email";
+ public static final String PASSWORD = "password";
+ public static final String CONFIRM_PASSWORD = "confirm-password";
+ public static final String GROUPS = "groups";
}
1.18 +79 -69 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/TaskAction.java
Index: TaskAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/TaskAction.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- TaskAction.java 30 Jun 2003 08:53:45 -0000 1.17
+++ TaskAction.java 30 Jun 2003 11:46:27 -0000 1.18
@@ -1,80 +1,88 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
-/*
- * TaskAction.java
- *
- * Created on November 6, 2002, 6:22 PM
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
-import java.io.File;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractComplementaryConfigurableAction;
import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
-
-import org.apache.lenya.cms.task.*;
-import org.apache.lenya.cms.workflow.WorkflowFactory;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.SourceResolver;
+
import org.apache.lenya.cms.publication.Document;
import org.apache.lenya.cms.publication.PageEnvelope;
import org.apache.lenya.cms.publication.PageEnvelopeFactory;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationFactory;
+import org.apache.lenya.cms.task.*;
+import org.apache.lenya.cms.workflow.WorkflowFactory;
import org.apache.lenya.workflow.Event;
import org.apache.lenya.workflow.Situation;
import org.apache.lenya.workflow.WorkflowInstance;
+import java.io.File;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* An action that executes a task.
@@ -125,12 +133,11 @@
*
* @throws java.lang.Exception DOCUMENT ME!
*/
- public java.util.Map act(Redirector redirector, SourceResolver sourceResolver,
- Map objectModel, String str, Parameters parameters) throws java.lang.Exception {
-
+ public java.util.Map act(Redirector redirector, SourceResolver sourceResolver, Map objectModel,
+ String str, Parameters parameters) throws java.lang.Exception {
Publication publication = PublicationFactory.getPublication(objectModel);
File publicationDirectory = publication.getDirectory();
-
+
// Get request object
Request request = ObjectModelHelper.getRequest(objectModel);
@@ -151,7 +158,8 @@
//------------------------------------------------------------
Parameters taskParameters = new Parameters();
- taskParameters.setParameter(Task.PARAMETER_SERVLET_CONTEXT, publication.getServletContext().getCanonicalPath());
+ taskParameters.setParameter(Task.PARAMETER_SERVLET_CONTEXT,
+ publication.getServletContext().getCanonicalPath());
taskParameters.setParameter(Task.PARAMETER_CONTEXT_PREFIX, request.getContextPath() + "/");
taskParameters.setParameter(Task.PARAMETER_SERVER_PORT,
Integer.toString(request.getServerPort()));
@@ -167,8 +175,9 @@
//------------------------------------------------------------
// execute task
//------------------------------------------------------------
- getLogger().debug("\n-------------------------------------------------" + "\n- Executing task '" +
- getTaskId() + "'" + "\n-------------------------------------------------");
+ getLogger().debug("\n-------------------------------------------------" +
+ "\n- Executing task '" + getTaskId() + "'" +
+ "\n-------------------------------------------------");
TaskManager manager = new TaskManager(publication.getDirectory().getCanonicalPath());
Task task = manager.getTask(getTaskId());
@@ -177,26 +186,28 @@
task.execute(publication.getServletContext().getCanonicalPath());
WorkflowFactory factory = WorkflowFactory.newInstance();
-
+
PageEnvelope envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
Document document = envelope.getDocument();
-
+
if (factory.hasWorkflow(document)) {
String eventName = request.getParameter("lenya.event");
WorkflowInstance instance = factory.buildInstance(document);
Situation situation = factory.buildSituation(objectModel);
-
+
Event event = null;
- Event events[] = instance.getExecutableEvents(situation);
+ Event[] events = instance.getExecutableEvents(situation);
+
for (int i = 0; i < events.length; i++) {
if (events[i].getName().equals(eventName)) {
event = events[i];
}
}
+
assert event != null;
instance.invoke(situation, event);
}
-
+
//------------------------------------------------------------
// get session
//------------------------------------------------------------
@@ -219,5 +230,4 @@
return actionMap;
}
-
}
1.10 +54 -43 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ReservedCheckoutAction.java
Index: ReservedCheckoutAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ReservedCheckoutAction.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ReservedCheckoutAction.java 24 Apr 2003 13:52:38 -0000 1.9
+++ ReservedCheckoutAction.java 30 Jun 2003 11:46:27 -0000 1.10
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.parameters.Parameters;
@@ -61,7 +73,6 @@
* @version 2002.6.25
*/
public class ReservedCheckoutAction extends RevisionControllerAction {
-
/**
* DOCUMENT ME!
*
1.34 +92 -76 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ArticleImageUploadCreatorAction.java
Index: ArticleImageUploadCreatorAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ArticleImageUploadCreatorAction.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- ArticleImageUploadCreatorAction.java 30 May 2003 09:23:14 -0000 1.33
+++ ArticleImageUploadCreatorAction.java 30 Jun 2003 11:46:27 -0000 1.34
@@ -1,65 +1,65 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
-package org.apache.lenya.cms.cocoon.acting;
+$Id
+<License>
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
+package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.avalon.framework.thread.ThreadSafe;
+
import org.apache.cocoon.acting.AbstractConfigurableAction;
import org.apache.cocoon.environment.Context;
import org.apache.cocoon.environment.ObjectModelHelper;
@@ -68,6 +68,7 @@
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.servlet.multipart.MultipartHttpServletRequest;
import org.apache.cocoon.servlet.multipart.Part;
+
import org.apache.excalibur.source.Source;
import org.dom4j.Document;
@@ -75,10 +76,25 @@
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.Node;
+
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
/**
* The class <code>ArticleImageUploadCreatorAction</code> implements an action that allows for
@@ -250,13 +266,11 @@
return null;
}
-
+
// upload the file to the uploadDir
if (!(request instanceof MultipartHttpServletRequest)) {
getLogger().error("Not a multipart request!");
- }
- else {
-
+ } else {
Part part = (Part) request.get(UPLOADFILE_PARAM_NAME);
getLogger().debug("Uploading file: " + part.getFileName());
@@ -300,34 +314,36 @@
getLogger().info(".act(): Create directories: " + dir);
dir.mkdirs();
}
-
+
File uploadedFile = new File(dir, part.getFileName());
uploadedFile.createNewFile();
-
+
FileOutputStream out = new FileOutputStream(uploadedFile);
InputStream in = part.getInputStream();
int read = in.read(buf);
+
while (read > 0) {
out.write(buf, 0, read);
read = in.read(buf);
}
-/*
- if (obj instanceof FilePartFile) {
- ((FilePartFile) obj).getFile().renameTo(new File(imagePath));
- } else {
- FileOutputStream out = new FileOutputStream(imagePath);
- InputStream in = ((FilePart) obj).getInputStream();
- int read = in.read(buf);
-
- while (read > 0) {
- out.write(buf, 0, read);
- read = in.read(buf);
- }
+ /*
+ if (obj instanceof FilePartFile) {
+ ((FilePartFile) obj).getFile().renameTo(new File(imagePath));
+ } else {
+ FileOutputStream out = new FileOutputStream(imagePath);
+ InputStream in = ((FilePart) obj).getInputStream();
+ int read = in.read(buf);
+
+ while (read > 0) {
+ out.write(buf, 0, read);
+ read = in.read(buf);
+ }
+
+ out.close();
+ }
+ */
- out.close();
- }
-*/
// create an extra file containing the meta description for
// the image.
String metaDataFilePath = getMetaDataPath(sitemapPath, metaRoot, documentId,
1.13 +72 -65 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/AbstractAuthorizerAction.java
Index: AbstractAuthorizerAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/AbstractAuthorizerAction.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- AbstractAuthorizerAction.java 24 Apr 2003 13:52:38 -0000 1.12
+++ AbstractAuthorizerAction.java 30 Jun 2003 11:46:27 -0000 1.13
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configurable;
@@ -49,22 +61,22 @@
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractComplementaryConfigurableAction;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.sitemap.PatternException;
+import org.apache.lenya.util.Stack;
+
import org.apache.regexp.RE;
import org.apache.regexp.RECompiler;
import org.apache.regexp.REProgram;
import org.apache.regexp.RESyntaxException;
-import org.apache.lenya.util.Stack;
-
import java.util.HashMap;
import java.util.Map;
-import org.apache.cocoon.environment.ObjectModelHelper;
/**
@@ -77,7 +89,6 @@
implements Configurable {
REProgram[] public_matchers;
boolean logRequests = false;
-
String authenticator_type = null;
/**
@@ -92,6 +103,7 @@
Configuration authenticatorConf = conf.getChild("authenticator");
authenticator_type = authenticatorConf.getAttribute("type");
+
if (getLogger().isDebugEnabled()) {
getLogger().debug(".configure(): authenticator type=" + authenticator_type);
}
@@ -162,9 +174,6 @@
return null;
}
-
-
-
// Get uri
String request_uri = req.getRequestURI();
String sitemap_uri = req.getSitemapURI();
@@ -205,24 +214,22 @@
session.setAttribute("protected_destination", request_uri);
}
+ // FIXME: Can't be here. Please see comment within PMLAuthorizerAction
-// FIXME: Can't be here. Please see comment within PMLAuthorizerAction
-/*
- String authenticator_type = (String) session.getAttribute("org.apache.lenya.cms.cocoon.acting.Authenticator.id");
- if (!this.authenticator_type.equals(authenticator_type)) {
- if (authenticator_type == null) {
- getLogger().debug(".act(): No authenticator yet");
- } else {
- getLogger().warn(".act(): Authenticators do not match: " + authenticator_type + " (Authorizer's authenticator: " + this.authenticator_type + ")");
- }
-
- return null;
- }
-*/
-
-
+ /*
+ String authenticator_type = (String) session.getAttribute("org.apache.lenya.cms.cocoon.acting.Authenticator.id");
+ if (!this.authenticator_type.equals(authenticator_type)) {
+ if (authenticator_type == null) {
+ getLogger().debug(".act(): No authenticator yet");
+ } else {
+ getLogger().warn(".act(): Authenticators do not match: " + authenticator_type + " (Authorizer's authenticator: " + this.authenticator_type + ")");
+ }
+ return null;
+ }
+ */
HashMap actionMap = new HashMap();
+
if (authorize(req, actionMap)) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Permission granted dues to authorisation: " + request_uri);
1.31 +146 -132 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ParentChildCreatorAction.java
Index: ParentChildCreatorAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ParentChildCreatorAction.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ParentChildCreatorAction.java 30 May 2003 09:37:16 -0000 1.30
+++ ParentChildCreatorAction.java 30 Jun 2003 11:46:27 -0000 1.31
@@ -1,81 +1,94 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
-package org.apache.lenya.cms.cocoon.acting;
+$Id
+<License>
-import java.io.File;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
+package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.parameters.ParameterException;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.ProcessingException;
-
import org.apache.cocoon.acting.AbstractComplementaryConfigurableAction;
-
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.SourceResolver;
+
import org.apache.excalibur.source.Source;
+import org.apache.lenya.cms.authoring.ParentChildCreatorInterface;
+
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.XPath;
+
import org.dom4j.io.SAXReader;
-import org.apache.lenya.cms.authoring.ParentChildCreatorInterface;
+import java.io.File;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
/**
@@ -180,12 +193,11 @@
if (creator_src != null) {
getLogger().info(".act(): Creator found for \"" + doctype + "\": " +
- creator_src.getName() + " " + creator_src.getPath() + " " +
- creator_src.getValue());
- // now get the constructor that accepts the configuration
-
- Class creatorClass = Class.forName(creator_src.getValue());
- creator = (ParentChildCreatorInterface) creatorClass.newInstance();
+ creator_src.getName() + " " + creator_src.getPath() + " " + creator_src.getValue());
+
+ // now get the constructor that accepts the configuration
+ Class creatorClass = Class.forName(creator_src.getValue());
+ creator = (ParentChildCreatorInterface) creatorClass.newInstance();
} else {
getLogger().warn(".act(): No creator found for \"" + doctype +
"\". DefaultParentChildreator will be taken.");
@@ -195,21 +207,22 @@
getLogger().debug(".act(): Creator : " + creator.getClass().getName());
// Init creator
- // "Read" the configuration from the DOM node
- DefaultConfigurationBuilder defaultConfigBuilder = new DefaultConfigurationBuilder();
- Configuration[] docTypeConfigs =
- defaultConfigBuilder.buildFromFile(absoluteDoctypesPath +
- "doctypes.xconf").getChildren();
-
- Configuration doctypeConf = null;
- for (int i = 0; i < docTypeConfigs.length; i++) {
- String typeName = docTypeConfigs[i].getAttribute("type");
- if (typeName.equals(doctype)) {
- doctypeConf = docTypeConfigs[i].getChild("creator", false);
- }
- }
+ // "Read" the configuration from the DOM node
+ DefaultConfigurationBuilder defaultConfigBuilder = new DefaultConfigurationBuilder();
+ Configuration[] docTypeConfigs = defaultConfigBuilder.buildFromFile(absoluteDoctypesPath +
+ "doctypes.xconf").getChildren();
+
+ Configuration doctypeConf = null;
- creator.init(doctypeConf);
+ for (int i = 0; i < docTypeConfigs.length; i++) {
+ String typeName = docTypeConfigs[i].getAttribute("type");
+
+ if (typeName.equals(doctype)) {
+ doctypeConf = docTypeConfigs[i].getChild("creator", false);
+ }
+ }
+
+ creator.init(doctypeConf);
// Transaction should actually be started here!
// Read tree
@@ -263,9 +276,9 @@
if (doc.selectSingleNode(newChildXPath + "[@relURI='" +
creator.generateTreeId(childid, childType) + "']") != null) {
getLogger().error("Exception: XPath exists: " + newChildXPath + "[@relURI='" +
- creator.generateTreeId(childid, childType) + "']");
+ creator.generateTreeId(childid, childType) + "']");
getLogger().error("No child added");
-
+
return null;
}
@@ -283,68 +296,71 @@
// Transaction should actually be finished here!
// Create actual document
+ // grab all the parameters from session, request params and
+ // sitemap params
+ HashMap allParameters = new HashMap();
+ String[] names = parameters.getNames();
- // grab all the parameters from session, request params and
- // sitemap params
- HashMap allParameters = new HashMap();
- String[] names = parameters.getNames();
-
- for( int i = 0; i < names.length; i++ ) {
- String name = names[ i ];
- String value = null;
- try {
- value = parameters.getParameter( name );
- } catch (ParameterException pe) {
- value = null;
- }
-
- allParameters.put(name, value);
- }
-
- Enumeration requestParameters = request.getParameterNames();
- while (requestParameters.hasMoreElements()) {
- String requestParameterName = (String) requestParameters.nextElement();
- if (allParameters.containsKey(requestParameterName)) {
- // we do not allow name clashes
- throw new ProcessingException("Name clash in request parameter " +
- "and sitemap parameter: " +
- requestParameterName);
- }
- allParameters.put(requestParameterName,
- request.getParameter(requestParameterName));
- }
-
- Enumeration sessionAttributeNames = session.getAttributeNames();
- while (sessionAttributeNames.hasMoreElements()) {
- String sessionAttributeName = (String) sessionAttributeNames.nextElement();
- if (allParameters.containsKey(sessionAttributeName)) {
- // we do not allow name clashes
- throw new ProcessingException("Name clash in session attribute " +
- "and request parameter or sitemap parameter: " +
- sessionAttributeName);
- }
- allParameters.put(sessionAttributeName, session.getAttribute(sessionAttributeName));
- }
-
- try {
+ for (int i = 0; i < names.length; i++) {
+ String name = names[i];
+ String value = null;
+
+ try {
+ value = parameters.getParameter(name);
+ } catch (ParameterException pe) {
+ value = null;
+ }
+
+ allParameters.put(name, value);
+ }
+
+ Enumeration requestParameters = request.getParameterNames();
+
+ while (requestParameters.hasMoreElements()) {
+ String requestParameterName = (String) requestParameters.nextElement();
+
+ if (allParameters.containsKey(requestParameterName)) {
+ // we do not allow name clashes
+ throw new ProcessingException("Name clash in request parameter " +
+ "and sitemap parameter: " + requestParameterName);
+ }
+
+ allParameters.put(requestParameterName, request.getParameter(requestParameterName));
+ }
+
+ Enumeration sessionAttributeNames = session.getAttributeNames();
+
+ while (sessionAttributeNames.hasMoreElements()) {
+ String sessionAttributeName = (String) sessionAttributeNames.nextElement();
+
+ if (allParameters.containsKey(sessionAttributeName)) {
+ // we do not allow name clashes
+ throw new ProcessingException("Name clash in session attribute " +
+ "and request parameter or sitemap parameter: " + sessionAttributeName);
+ }
+
+ allParameters.put(sessionAttributeName, session.getAttribute(sessionAttributeName));
+ }
+
+ try {
creator.create(new File(absoluteDoctypesPath + "samples"),
- new File(sitemapParentPath + docsPath + parentid),
- childid, childType, childname, allParameters);
+ new File(sitemapParentPath + docsPath + parentid), childid, childType, childname,
+ allParameters);
} catch (Exception e) {
getLogger().error(".act(): Creator threw exception: " + e);
}
// Redirect to referer
- String parent_uri = (String) session.getAttribute(
+ String parent_uri = (String) session.getAttribute(
+ "org.apache.lenya.cms.cocoon.acting.ParentChildCreatorAction.parent_uri");
+ getLogger().info(".act(): Child added");
+
+ HashMap actionMap = new HashMap();
+ actionMap.put("parent_uri", parent_uri);
+ session.removeAttribute(
"org.apache.lenya.cms.cocoon.acting.ParentChildCreatorAction.parent_uri");
- getLogger().info(".act(): Child added");
- HashMap actionMap = new HashMap();
- actionMap.put("parent_uri", parent_uri);
- session.removeAttribute(
- "org.apache.lenya.cms.cocoon.acting.ParentChildCreatorAction.parent_uri");
-
- return actionMap;
+ return actionMap;
}
/**
@@ -358,9 +374,8 @@
*
* @return DOCUMENT ME!
*/
- public boolean validate(String parentid,
- String childid, String childname, String childtype,
- String doctype) {
+ public boolean validate(String parentid, String childid, String childname, String childtype,
+ String doctype) {
getLogger().debug(".validate(): parentid=" + parentid + " ; childid=" + childid +
" ; childname=" + childname + " ; childtype=" + childtype + " ; doctype=" + doctype);
@@ -374,5 +389,4 @@
return true;
}
-
}
1.13 +55 -43 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/EditorSaveAction.java
Index: EditorSaveAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/EditorSaveAction.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- EditorSaveAction.java 24 Apr 2003 13:52:38 -0000 1.12
+++ EditorSaveAction.java 30 Jun 2003 11:46:27 -0000 1.13
@@ -1,52 +1,65 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.avalon.framework.thread.ThreadSafe;
import org.apache.cocoon.acting.AbstractValidatorAction;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
@@ -60,7 +73,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.cocoon.environment.ObjectModelHelper;
/**
1.4 +78 -72 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/DelegatingAuthorizerAction.java
Index: DelegatingAuthorizerAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/DelegatingAuthorizerAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DelegatingAuthorizerAction.java 30 Jun 2003 08:51:48 -0000 1.3
+++ DelegatingAuthorizerAction.java 30 Jun 2003 11:46:27 -0000 1.4
@@ -1,64 +1,79 @@
/*
- * $Id
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
-package org.apache.lenya.cms.cocoon.acting;
+$Id
+<License>
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
+package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.parameters.Parameters;
+
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.SourceResolver;
+
import org.apache.lenya.cms.ac2.Authorizer;
import org.apache.lenya.cms.ac2.Identity;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationFactory;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+
/**
* @author andreas
*
@@ -66,10 +81,8 @@
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class DelegatingAuthorizerAction extends AbstractAuthorizerAction {
-
protected static final String AUTHORIZER_ELEMENT = "authorizer";
protected static final String CLASS_ATTRIBUTE = "src";
-
private List authorizers = new ArrayList();
/**
@@ -78,11 +91,13 @@
public void configure(Configuration conf) throws ConfigurationException {
super.configure(conf);
- Configuration authorizerConfigurations[] = conf.getChildren(AUTHORIZER_ELEMENT);
+ Configuration[] authorizerConfigurations = conf.getChildren(AUTHORIZER_ELEMENT);
+
for (int i = 0; i < authorizerConfigurations.length; i++) {
String className = authorizerConfigurations[i].getAttribute(CLASS_ATTRIBUTE);
Authorizer authorizer;
+
try {
authorizer = (Authorizer) Class.forName(className).newInstance();
} catch (Exception e) {
@@ -113,35 +128,32 @@
/**
* @see org.apache.lenya.cms.cocoon.acting.AbstractAuthorizerAction#authorize(org.apache.cocoon.environment.Request, java.util.Map)
*/
- public boolean authorize(Request request, Map ignore) throws Exception {
+ public boolean authorize(Request request, Map ignore)
+ throws Exception {
boolean authorized = false;
if (request != null) {
-
Session session = request.getSession(true);
Identity identity = (Identity) session.getAttribute(Identity.class.getName());
+
if (getLogger().isDebugEnabled()) {
getLogger().debug("Trying to authorize identity: " + identity);
}
if (identity != null) {
-
if (hasAuthorizers()) {
- Authorizer authorizers[] = getAuthorizers();
+ Authorizer[] authorizers = getAuthorizers();
int i = 0;
authorized = true;
- while (i < authorizers.length && authorized) {
- authorized =
- authorized
- && authorizers[i].authorize(identity, getPublication(), request);
+
+ while ((i < authorizers.length) && authorized) {
+ authorized = authorized &&
+ authorizers[i].authorize(identity, getPublication(), request);
+
if (getLogger().isDebugEnabled()) {
- getLogger().debug(
- "Authorizer ["
- + authorizers[i]
- + "] returned ["
- + authorized
- + "]");
+ getLogger().debug("Authorizer [" + authorizers[i] + "] returned [" +
+ authorized + "]");
}
i++;
@@ -156,15 +168,10 @@
/**
* @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
*/
- public Map act(
- Redirector redirector,
- SourceResolver resolver,
- Map objectModel,
- String src,
- Parameters parameters)
- throws Exception {
-
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src,
+ Parameters parameters) throws Exception {
publication = PublicationFactory.getPublication(objectModel);
+
return super.act(redirector, resolver, objectModel, src, parameters);
}
@@ -177,5 +184,4 @@
protected Publication getPublication() {
return publication;
}
-
}
1.16 +56 -45 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/IMLAuthenticatorAction.java
Index: IMLAuthenticatorAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/IMLAuthenticatorAction.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- IMLAuthenticatorAction.java 19 Jun 2003 14:45:44 -0000 1.15
+++ IMLAuthenticatorAction.java 30 Jun 2003 11:46:27 -0000 1.16
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2003 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configuration;
@@ -50,11 +62,11 @@
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
-import org.w3c.dom.Document;
-
import org.apache.lenya.cms.ac.Identity;
import org.apache.lenya.cms.ac.Password;
+import org.w3c.dom.Document;
+
import java.net.URL;
import java.util.Map;
@@ -121,7 +133,6 @@
if (getLogger().isDebugEnabled()) {
getLogger().debug("CONFIGURATION: type=" + type);
}
-
}
/**
1.10 +86 -24 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/PageEnvelopeAction.java
Index: PageEnvelopeAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/PageEnvelopeAction.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- PageEnvelopeAction.java 30 Jun 2003 08:52:19 -0000 1.9
+++ PageEnvelopeAction.java 30 Jun 2003 11:46:27 -0000 1.10
@@ -1,54 +1,116 @@
/*
- * PageEnvelopeAction.java
- *
- * Created on 10. April 2003, 13:43
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Request;
+
import org.apache.lenya.cms.publication.PageEnvelope;
import org.apache.lenya.cms.publication.PageEnvelopeFactory;
import org.apache.lenya.cms.publishing.PublishingEnvironment;
import org.apache.lenya.cms.rc.RCEnvironment;
+import java.util.HashMap;
+import java.util.Map;
+
+
/**
*
* @author nobby
*/
-public class PageEnvelopeAction
- extends AbstractAction {
-
+public class PageEnvelopeAction extends AbstractAction {
+ /**
+ * DOCUMENT ME!
+ *
+ * @param redirector DOCUMENT ME!
+ * @param resolver DOCUMENT ME!
+ * @param objectModel DOCUMENT ME!
+ * @param str DOCUMENT ME!
+ * @param parameters DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ *
+ * @throws java.lang.Exception DOCUMENT ME!
+ */
public java.util.Map act(org.apache.cocoon.environment.Redirector redirector,
- org.apache.cocoon.environment.SourceResolver resolver,
- java.util.Map objectModel,
- String str,
- org.apache.avalon.framework.parameters.Parameters parameters)
- throws java.lang.Exception {
-
+ org.apache.cocoon.environment.SourceResolver resolver, java.util.Map objectModel,
+ String str, org.apache.avalon.framework.parameters.Parameters parameters)
+ throws java.lang.Exception {
Request request = ObjectModelHelper.getRequest(objectModel);
- PageEnvelope envelope = null;
+ PageEnvelope envelope = null;
+
try {
- envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
+ envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
+ } catch (Exception e) {
+ getLogger().error(e.getMessage(), e);
+
+ return null;
}
- catch (Exception e) {
- getLogger().error(e.getMessage(), e);
- return null;
- }
+
Map result = new HashMap();
-
+
result.put(PageEnvelope.PUBLICATION_ID, envelope.getPublication().getId());
result.put(PageEnvelope.CONTEXT, envelope.getContext());
result.put(PageEnvelope.AREA, envelope.getArea());
- result.put(PublishingEnvironment.PUBLICATION_PATH, envelope.getPublication().getDirectory().getCanonicalPath());
+ result.put(PublishingEnvironment.PUBLICATION_PATH,
+ envelope.getPublication().getDirectory().getCanonicalPath());
result.put(RCEnvironment.RCML_DIRECTORY, envelope.getRCEnvironment().getRCMLDirectory());
result.put(RCEnvironment.BACKUP_DIRECTORY, envelope.getRCEnvironment().getBackupDirectory());
return result;
}
-
}
1.15 +59 -46 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/EditorAction.java
Index: EditorAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/EditorAction.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- EditorAction.java 30 May 2003 09:37:16 -0000 1.14
+++ EditorAction.java 30 Jun 2003 11:46:27 -0000 1.15
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configurable;
@@ -49,11 +61,14 @@
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractComplementaryConfigurableAction;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.SourceResolver;
+import org.apache.excalibur.source.Source;
+
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
@@ -62,9 +77,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.cocoon.environment.ObjectModelHelper;
-import org.apache.excalibur.source.Source;
-
/**
* DOCUMENT ME!
@@ -117,7 +129,8 @@
return null;
}
- String tempFile = (String) session.getAttribute("org.apache.lenya.cms.editor.HTMLForm.tempFile");
+ String tempFile = (String) session.getAttribute(
+ "org.apache.lenya.cms.editor.HTMLForm.tempFile");
getLogger().error("**** tempfile=" + tempFile);
// prepare the return params
1.10 +54 -43 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ReservedCheckinAction.java
Index: ReservedCheckinAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ReservedCheckinAction.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ReservedCheckinAction.java 24 Apr 2003 13:52:38 -0000 1.9
+++ ReservedCheckinAction.java 30 Jun 2003 11:46:28 -0000 1.10
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.parameters.Parameters;
@@ -61,7 +73,6 @@
* @version 2002.6.25
*/
public class ReservedCheckinAction extends RevisionControllerAction {
-
/**
* DOCUMENT ME!
*
1.10 +169 -61 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/URIParametrizerAction.java
Index: URIParametrizerAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/URIParametrizerAction.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- URIParametrizerAction.java 27 May 2003 15:34:03 -0000 1.9
+++ URIParametrizerAction.java 30 Jun 2003 11:46:28 -0000 1.10
@@ -1,108 +1,216 @@
+/*
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.cocoon.environment.Redirector;
-import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.acting.ConfigurableComposerAction;
-
import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.cocoon.environment.Redirector;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.xml.AbstractXMLConsumer;
import org.apache.excalibur.source.Source;
-import org.apache.cocoon.xml.AbstractXMLConsumer;
+
+import org.apache.log4j.Category;
import org.xml.sax.Attributes;
import java.util.HashMap;
import java.util.Map;
-import org.apache.log4j.Category;
-public class URIParametrizerAction extends ConfigurableComposerAction {
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class URIParametrizerAction extends ConfigurableComposerAction {
static Category log = Category.getInstance(URIParametrizerAction.class);
+ /**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
public class URIParametrizerConsumer extends AbstractXMLConsumer {
+ boolean inParamElement = false;
+ String parameterValue = null;
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param uri DOCUMENT ME!
+ * @param loc DOCUMENT ME!
+ * @param raw DOCUMENT ME!
+ * @param a DOCUMENT ME!
+ */
+ public void startElement(String uri, String loc, String raw, Attributes a) {
+ if (loc.equals("parameter")) {
+ log.debug("start Element " + uri + ":" + loc + ":" + raw);
+ inParamElement = true;
+ }
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param uri DOCUMENT ME!
+ * @param loc DOCUMENT ME!
+ * @param raw DOCUMENT ME!
+ * @param a DOCUMENT ME!
+ */
+ public void endElement(String uri, String loc, String raw, Attributes a) {
+ if (loc.equals("parameter")) {
+ log.debug("stop Element " + uri + ":" + loc + ":" + raw);
+ inParamElement = false;
+ }
+
+ log.debug("processing Element " + uri + ":" + loc + ":" + raw);
+ }
- boolean inParamElement = false;
- String parameterValue = null;
+ /**
+ * DOCUMENT ME!
+ *
+ * @param ch DOCUMENT ME!
+ * @param start DOCUMENT ME!
+ * @param len DOCUMENT ME!
+ */
+ public void characters(char[] ch, int start, int len) {
+ if (inParamElement) {
+ parameterValue = new String(ch, start, len);
+ log.debug("grab Element " + parameterValue);
+ }
+ }
- public void startElement(String uri, String loc, String raw, Attributes a) {
- if (loc.equals("parameter")) {
- log.debug("start Element " + uri + ":"+ loc + ":" + raw);
- inParamElement = true;
- }
- }
-
- public void endElement(String uri, String loc, String raw, Attributes a) {
- if (loc.equals("parameter")) {
- log.debug("stop Element " + uri + ":"+ loc + ":" + raw);
- inParamElement = false;
- }
- log.debug("processing Element " + uri + ":"+ loc + ":" + raw);
- }
-
- public void characters(char[] ch, int start, int len) {
- if (inParamElement) {
- parameterValue = new String(ch, start, len);
- log.debug("grab Element " + parameterValue);
- }
- }
- public String getParameter() {
- return parameterValue;
- }
+ /**
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ public String getParameter() {
+ return parameterValue;
+ }
}
- public Map act (Redirector redirector, SourceResolver resolver,
- Map objectModel, String src, Parameters parameters) throws Exception {
- Source inputSource = null;
- URIParametrizerConsumer xmlConsumer = new URIParametrizerConsumer();
+ /**
+ * DOCUMENT ME!
+ *
+ * @param redirector DOCUMENT ME!
+ * @param resolver DOCUMENT ME!
+ * @param objectModel DOCUMENT ME!
+ * @param src DOCUMENT ME!
+ * @param parameters DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ *
+ * @throws Exception DOCUMENT ME!
+ */
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src,
+ Parameters parameters) throws Exception {
+ Source inputSource = null;
+ URIParametrizerConsumer xmlConsumer = new URIParametrizerConsumer();
+
+ Map map = new HashMap();
- Map map = new HashMap();
-
/*
- if (this.getLogger().isDebugEnabled()) {
- this.getLogger().debug("processing file " + src);
- }
+ if (this.getLogger().isDebugEnabled()) {
+ this.getLogger().debug("processing file " + src);
+ }
Request request = ObjectModelHelper.getRequest(objectModel);
-
+
String requestUri = request.getRequestURI();
-
+
if (getLogger().isDebugEnabled()) {
getLogger().debug("request URI (not processed): " + requestUri);
}
-
+
String servletPath = request.getServletPath();
if (requestUri.startsWith(servletPath)) {
requestUri = requestUri.substring(0, servletPath.length());
}
-
+
if (requestUri.startsWith("/")) {
requestUri = requestUri.substring(0, 1);
}
-
+
String publicationId = requestUri.substring(0, requestUri.indexOf("/"));
requestUri = requestUri.substring(0, publicationId.length());
-
+
if (getLogger().isDebugEnabled()) {
getLogger().debug("request URI (processed): " + requestUri);
}
*/
-
- String parameterNames[] = parameters.getNames();
+ String[] parameterNames = parameters.getNames();
+
for (int i = 0; i < parameterNames.length; i++) {
- String parameterSrc = parameters.getParameter(parameterNames[i]) + "/" + src;
- inputSource = resolver.resolveURI(parameterSrc);
-
- if (this.getLogger().isDebugEnabled()) {
- this.getLogger().debug("file resolved to " + inputSource.getURI());
- }
- SourceUtil.toSAX(inputSource, xmlConsumer);
- map.put(parameterNames[i], xmlConsumer.getParameter());
+ String parameterSrc = parameters.getParameter(parameterNames[i]) + "/" + src;
+ inputSource = resolver.resolveURI(parameterSrc);
+
+ if (this.getLogger().isDebugEnabled()) {
+ this.getLogger().debug("file resolved to " + inputSource.getURI());
+ }
+
+ SourceUtil.toSAX(inputSource, xmlConsumer);
+ map.put(parameterNames[i], xmlConsumer.getParameter());
}
- return map;
+ return map;
}
}
-
-
-
1.8 +56 -44 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/RequestParamAction.java
Index: RequestParamAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/RequestParamAction.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- RequestParamAction.java 24 Apr 2003 13:52:38 -0000 1.7
+++ RequestParamAction.java 30 Jun 2003 11:46:29 -0000 1.8
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
@@ -72,7 +84,7 @@
* <pre>
* <map:action name="request" src="org.apache.cocoon.acting.RequestParamAction"/>
* </pre>
- *
+ *
* <p>
* Example use:
* <pre>
1.6 +119 -112 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAdminModifyAction.java
Index: UserAdminModifyAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAdminModifyAction.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- UserAdminModifyAction.java 25 Jun 2003 14:43:19 -0000 1.5
+++ UserAdminModifyAction.java 30 Jun 2003 11:46:29 -0000 1.6
@@ -1,64 +1,68 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2003 Wyona. 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. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment: "This product
- * includes software developed by Wyona (http://www.wyona.com)"
- *
- * 4. The name "Lenya" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact contact@wyona.com
- *
- * 5. Products derived from this software may not be called "Lenya" nor
- * may "Lenya" appear in their names without prior written permission
- * of Wyona.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment: "This product includes software developed by Wyona
- * (http://www.wyona.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY Wyona "AS IS" WITHOUT ANY WARRANTY EXPRESS
- * OR IMPLIED, INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * Wyona WILL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY YOU AS A RESULT
- * OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF Wyona HAS BEEN
- * ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. Wyona WILL NOT BE LIABLE
- * FOR ANY THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
-import java.io.File;
-import java.util.Collections;
-import java.util.Map;
-
import org.apache.avalon.framework.parameters.Parameters;
+
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
+
import org.apache.lenya.cms.ac.AccessControlException;
import org.apache.lenya.cms.ac.Group;
import org.apache.lenya.cms.ac.GroupManager;
@@ -68,71 +72,74 @@
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationFactory;
+import java.io.File;
+
+import java.util.Collections;
+import java.util.Map;
+
+
/**
* @author egli
- *
- *
+ *
+ *
*/
-public class UserAdminModifyAction
- extends AbstractAction
- implements UserAdminActionInterface {
-
- /* (non-Javadoc)
- * @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
- */
- public Map act(
- Redirector redirector,
- SourceResolver resolver,
- Map objectModel,
- String source,
- Parameters parameters)
- throws Exception {
-
- Request request = ObjectModelHelper.getRequest(objectModel);
- Publication publication = PublicationFactory.getPublication(objectModel);
-
- Map emptyMap = Collections.EMPTY_MAP;
-
- String userId = request.getParameter(USER_ID);
- String fullName = request.getParameter(FULL_NAME);
- String email = request.getParameter(EMAIL);
- String password = request.getParameter(PASSWORD);
- String confirmPassword = request.getParameter(CONFIRM_PASSWORD);
- String[] groups = request.getParameterValues(GROUPS);
-
- if ((password != null) && (!password.equals(confirmPassword))) {
- getLogger().info("Password not confirmed");
- return null;
- }
+public class UserAdminModifyAction extends AbstractAction implements UserAdminActionInterface {
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
+ */
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source,
+ Parameters parameters) throws Exception {
+ Request request = ObjectModelHelper.getRequest(objectModel);
+ Publication publication = PublicationFactory.getPublication(objectModel);
+
+ Map emptyMap = Collections.EMPTY_MAP;
+
+ String userId = request.getParameter(USER_ID);
+ String fullName = request.getParameter(FULL_NAME);
+ String email = request.getParameter(EMAIL);
+ String password = request.getParameter(PASSWORD);
+ String confirmPassword = request.getParameter(CONFIRM_PASSWORD);
+ String[] groups = request.getParameterValues(GROUPS);
+
+ if ((password != null) && (!password.equals(confirmPassword))) {
+ getLogger().info("Password not confirmed");
+
+ return null;
+ }
File configurationDirectory = new File(publication.getDirectory(), ItemManager.PATH);
- UserManager userManager = null;
- GroupManager groupManager = null;
- try {
- userManager = UserManager.instance(configurationDirectory);
- groupManager = GroupManager.instance(configurationDirectory);
- } catch (AccessControlException e) {
- getLogger().error(e.getMessage(), e);
- return null;
- }
-
- User user = userManager.getUser(userId);
- user.setFullName(fullName);
- user.setEmail(email);
- user.setPassword(password);
-
- user.removeFromAllGroups();
- for (int i = 0; i < groups.length; i++) {
- Group group = (Group) groupManager.getGroup(groups[i]);
- group.add(user);
- }
- try {
- user.save();
- } catch (AccessControlException e) {
- getLogger().error(e.getMessage(), e);
- return null;
- }
- return emptyMap;
- }
+ UserManager userManager = null;
+ GroupManager groupManager = null;
+
+ try {
+ userManager = UserManager.instance(configurationDirectory);
+ groupManager = GroupManager.instance(configurationDirectory);
+ } catch (AccessControlException e) {
+ getLogger().error(e.getMessage(), e);
+
+ return null;
+ }
+
+ User user = userManager.getUser(userId);
+ user.setFullName(fullName);
+ user.setEmail(email);
+ user.setPassword(password);
+
+ user.removeFromAllGroups();
+
+ for (int i = 0; i < groups.length; i++) {
+ Group group = (Group) groupManager.getGroup(groups[i]);
+ group.add(user);
+ }
+
+ try {
+ user.save();
+ } catch (AccessControlException e) {
+ getLogger().error(e.getMessage(), e);
+
+ return null;
+ }
+ return emptyMap;
+ }
}
1.21 +79 -46 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/EditorMainAction.java
Index: EditorMainAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/EditorMainAction.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- EditorMainAction.java 30 May 2003 09:37:16 -0000 1.20
+++ EditorMainAction.java 30 Jun 2003 11:46:29 -0000 1.21
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configurable;
@@ -49,14 +61,16 @@
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractComplementaryConfigurableAction;
-import org.apache.excalibur.source.Source;
-import org.apache.excalibur.xml.sax.SAXParser;
import org.apache.cocoon.environment.Context;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.SourceResolver;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.xml.sax.SAXParser;
+
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -71,7 +85,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.cocoon.environment.ObjectModelHelper;
/**
* $Id$
@@ -81,10 +94,30 @@
*/
public class EditorMainAction extends AbstractComplementaryConfigurableAction
implements Configurable {
+ /**
+ * DOCUMENT ME!
+ *
+ * @param conf DOCUMENT ME!
+ *
+ * @throws ConfigurationException DOCUMENT ME!
+ */
public void configure(Configuration conf) throws ConfigurationException {
super.configure(conf);
}
+ /**
+ * DOCUMENT ME!
+ *
+ * @param redirector DOCUMENT ME!
+ * @param resolver DOCUMENT ME!
+ * @param objectModel DOCUMENT ME!
+ * @param src DOCUMENT ME!
+ * @param parameters DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ *
+ * @throws Exception DOCUMENT ME!
+ */
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src,
Parameters parameters) throws Exception {
// Get request object
1.13 +57 -45 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/EditorTempfileAction.java
Index: EditorTempfileAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/EditorTempfileAction.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- EditorTempfileAction.java 24 Apr 2003 13:52:38 -0000 1.12
+++ EditorTempfileAction.java 30 Jun 2003 11:46:29 -0000 1.13
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configurable;
@@ -49,6 +61,7 @@
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractComplementaryConfigurableAction;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
@@ -57,8 +70,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.cocoon.environment.ObjectModelHelper;
-
/**
* this class does nothing but provide the name of the tempfile to the sitemap
@@ -113,7 +124,8 @@
}
// Get tempfile
- String tempFile = (String) session.getAttribute("org.apache.lenya.cms.editor.HTMLForm.tempFile");
+ String tempFile = (String) session.getAttribute(
+ "org.apache.lenya.cms.editor.HTMLForm.tempFile");
if (tempFile != null) {
HashMap actionMap = new HashMap();
1.12 +57 -44 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/DeleteDocumentAction.java
Index: DeleteDocumentAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/DeleteDocumentAction.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DeleteDocumentAction.java 27 May 2003 14:59:54 -0000 1.11
+++ DeleteDocumentAction.java 30 Jun 2003 11:46:29 -0000 1.12
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configurable;
@@ -49,18 +61,19 @@
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractComplementaryConfigurableAction;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
+import org.apache.excalibur.source.Source;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
-import org.apache.cocoon.environment.ObjectModelHelper;
-import org.apache.excalibur.source.Source;
/**
1.12 +65 -43 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/AbstractUsernamePasswordAuthenticatorAction.java
Index: AbstractUsernamePasswordAuthenticatorAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/AbstractUsernamePasswordAuthenticatorAction.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AbstractUsernamePasswordAuthenticatorAction.java 17 Jun 2003 07:28:47 -0000 1.11
+++ AbstractUsernamePasswordAuthenticatorAction.java 30 Jun 2003 11:46:29 -0000 1.12
@@ -1,52 +1,65 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2003 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.cocoon.environment.Request;
import java.util.Map;
+
/**
* DOCUMENT ME!
*
@@ -55,7 +68,16 @@
*/
public abstract class AbstractUsernamePasswordAuthenticatorAction
extends AbstractAuthenticatorAction {
-
+ /**
+ * DOCUMENT ME!
+ *
+ * @param request DOCUMENT ME!
+ * @param map DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ *
+ * @throws Exception DOCUMENT ME!
+ */
public boolean authenticate(Request request, Map map)
throws Exception {
String username = request.getParameter("username");
1.14 +64 -47 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/AbstractAuthenticatorAction.java
Index: AbstractAuthenticatorAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/AbstractAuthenticatorAction.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- AbstractAuthenticatorAction.java 17 Jun 2003 07:28:47 -0000 1.13
+++ AbstractAuthenticatorAction.java 30 Jun 2003 11:46:29 -0000 1.14
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2003 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configurable;
@@ -49,6 +61,7 @@
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractComplementaryConfigurableAction;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
@@ -56,7 +69,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.cocoon.environment.ObjectModelHelper;
/**
@@ -65,7 +77,8 @@
* @author Michael Wechner
* @version 2001.12.10
*/
-public abstract class AbstractAuthenticatorAction extends AbstractComplementaryConfigurableAction implements Configurable {
+public abstract class AbstractAuthenticatorAction extends AbstractComplementaryConfigurableAction
+ implements Configurable {
protected String authenticatorId = null;
protected String authenticatorName = null;
@@ -81,6 +94,7 @@
Configuration typeConf = conf.getChild("type");
authenticatorId = typeConf.getValue(null);
+
// FIXME: add to sitemap: /map:sitemap/map:components/map:actions/map:action/name
authenticatorName = typeConf.getValue(null);
}
@@ -98,7 +112,8 @@
*
* @throws Exception DOCUMENT ME!
*/
- public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws Exception {
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src,
+ Parameters parameters) throws Exception {
// Get request object
Request req = ObjectModelHelper.getRequest(objectModel);
@@ -120,8 +135,10 @@
if (authenticate(req, new HashMap())) {
getLogger().info(".act(): Authentication succeeded");
- session.setAttribute("org.apache.lenya.cms.cocoon.acting.Authenticator.id", authenticatorId);
- session.setAttribute("org.apache.lenya.cms.cocoon.acting.Authenticator.name", authenticatorName);
+ session.setAttribute("org.apache.lenya.cms.cocoon.acting.Authenticator.id",
+ authenticatorId);
+ session.setAttribute("org.apache.lenya.cms.cocoon.acting.Authenticator.name",
+ authenticatorName);
HashMap actionMap = new HashMap();
actionMap.put("protected_destination", session.getAttribute("protected_destination"));
1.32 +79 -73 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/XopusHandlerAction.java
Index: XopusHandlerAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/XopusHandlerAction.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- XopusHandlerAction.java 30 May 2003 09:25:44 -0000 1.31
+++ XopusHandlerAction.java 30 Jun 2003 11:46:29 -0000 1.32
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.excalibur.io.FileUtil;
@@ -51,8 +63,6 @@
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.acting.ConfigurableComposerAction;
-import org.apache.excalibur.source.Source;
-import org.apache.excalibur.xml.dom.DOMParser;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Session;
@@ -60,14 +70,18 @@
import org.apache.cocoon.environment.http.HttpRequest;
import org.apache.cocoon.util.IOUtils;
import org.apache.cocoon.util.PostInputStream;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
+
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.xml.dom.DOMParser;
import org.apache.lenya.cms.ac.Identity;
import org.apache.lenya.cms.rc.RevisionController;
import org.apache.lenya.xml.DOMParserFactory;
import org.apache.lenya.xml.DOMWriter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -152,13 +166,6 @@
getLogger().debug(".act(): Absolute XSD Root Directory: " + sitemapPath + xsdRoot);
getLogger().debug(".act(): Absolute Temp Root Directory: " + sitemapPath + tempRoot);
-
-
-
-
-
-
-
// Get request object
HttpRequest httpReq = (HttpRequest) objectModel.get(ObjectModelHelper.REQUEST_OBJECT);
@@ -199,15 +206,9 @@
// close the input stream
reqContent.close();
-
-
-
-
-
-
-
// Define Files
- File tempFileDir = new File(sitemapPath + relRootDirs.get("temp") + "/" + relRootDirs.get(fileType));
+ File tempFileDir = new File(sitemapPath + relRootDirs.get("temp") + "/" +
+ relRootDirs.get(fileType));
if (!(tempFileDir.exists())) {
tempFileDir.mkdir();
@@ -216,10 +217,11 @@
File tempFile = IOUtils.createFile(tempFileDir, reqFile);
File permFile = new File(sitemapPath + relRootDirs.get(fileType) + "/" + reqFile);
-
- if(!permFile.exists()) {
+ if (!permFile.exists()) {
getLogger().error(".act(): No such file: " + permFile.getAbsolutePath());
- getLogger().error(".act(): No such file: " + sitemapPath + "::" + relRootDirs.get(fileType) + "::" + reqFile);
+ getLogger().error(".act(): No such file: " + sitemapPath + "::" +
+ relRootDirs.get(fileType) + "::" + reqFile);
+
return null;
}
@@ -238,31 +240,32 @@
sitemapParams.put("fileType", fileType);
if ("xml".equals(fileType) && ("open".equals(reqType) || "save".equals(reqType))) {
- sitemapParams.put("reqFilePath", (String) relRootDirs.get("temp") + "/" + (String) relRootDirs.get(fileType) + "/" + reqFile);
- getLogger().debug(".act(): File to be edited (in temp dir): " + sitemapParams.get("reqFilePath"));
+ sitemapParams.put("reqFilePath",
+ (String) relRootDirs.get("temp") + "/" + (String) relRootDirs.get(fileType) + "/" +
+ reqFile);
+ getLogger().debug(".act(): File to be edited (in temp dir): " +
+ sitemapParams.get("reqFilePath"));
} else {
sitemapParams.put("reqFilePath", (String) relRootDirs.get(fileType) + "/" + reqFile);
}
-
// The xopus sitemap will return the XML
if ("open".equals(reqType)) {
return sitemapParams;
}
-
-
-
// save to temporary file, if needed
if ("save".equals(reqType) || "checkin".equals(reqType)) {
getLogger().debug(".act(): Write to temp file: " + tempFile);
+
try {
Element contentNode = (Element) data.getFirstChild();
DOMParserFactory dpf = new DOMParserFactory();
// Create a new document, where the actual content starts at the root element, which is the inner part of requestDoc
Document contentDocument = dpf.getDocument();
- contentDocument.appendChild((Element) dpf.cloneNode(contentDocument, contentNode, true));
+ contentDocument.appendChild((Element) dpf.cloneNode(contentDocument, contentNode,
+ true));
new DOMWriter(new FileOutputStream(tempFile)).printWithoutFormatting(contentDocument);
} catch (Exception e) {
getLogger().error(".act(): Exception during writing to temp file: " + e);
@@ -283,12 +286,15 @@
throw new Exception("No session");
}
- Identity identity = (Identity) session.getAttribute("org.apache.lenya.cms.ac.Identity");
+ Identity identity = (Identity) session.getAttribute(
+ "org.apache.lenya.cms.ac.Identity");
getLogger().debug(".act(): Checkin: " + reqFile + "::" + identity.getUsername());
rc.reservedCheckIn(xmlRoot + reqFile, identity.getUsername(), true);
FileUtil.copyFile(tempFile, permFile);
} catch (Exception e) {
- getLogger().error(".act(): Exception during checkin of " + xmlRoot + reqFile + " (" + e + ")");
+ getLogger().error(".act(): Exception during checkin of " + xmlRoot + reqFile +
+ " (" + e + ")");
+
return null;
}
}
1.11 +58 -52 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormWriteAction.java
Index: HTMLFormWriteAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormWriteAction.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- HTMLFormWriteAction.java 24 Apr 2003 13:52:38 -0000 1.10
+++ HTMLFormWriteAction.java 30 Jun 2003 11:46:29 -0000 1.11
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.configuration.Configurable;
@@ -64,7 +76,6 @@
*/
public class HTMLFormWriteAction extends AbstractComplementaryConfigurableAction
implements Configurable {
-
/**
* DOCUMENT ME!
*
@@ -74,7 +85,6 @@
*/
public void configure(Configuration conf) throws ConfigurationException {
super.configure(conf);
-
}
/**
@@ -90,14 +100,10 @@
*
* @throws Exception DOCUMENT ME!
*/
- public Map act(Redirector redirector, SourceResolver resolver,
- Map objectModel, String src,
- Parameters parameters)
- throws Exception {
-
- HashMap actionMap = new HashMap();
-
- return actionMap;
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src,
+ Parameters parameters) throws Exception {
+ HashMap actionMap = new HashMap();
+ return actionMap;
}
}
1.4 +123 -105 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAdminAddAction.java
Index: UserAdminAddAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAdminAddAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- UserAdminAddAction.java 25 Jun 2003 14:42:20 -0000 1.3
+++ UserAdminAddAction.java 30 Jun 2003 11:46:29 -0000 1.4
@@ -1,64 +1,68 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2003 Wyona. 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. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment: "This product
- * includes software developed by Wyona (http://www.wyona.com)"
- *
- * 4. The name "Lenya" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact contact@wyona.com
- *
- * 5. Products derived from this software may not be called "Lenya" nor
- * may "Lenya" appear in their names without prior written permission
- * of Wyona.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment: "This product includes software developed by Wyona
- * (http://www.wyona.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY Wyona "AS IS" WITHOUT ANY WARRANTY EXPRESS
- * OR IMPLIED, INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * Wyona WILL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY YOU AS A RESULT
- * OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF Wyona HAS BEEN
- * ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. Wyona WILL NOT BE LIABLE
- * FOR ANY THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
-import java.io.File;
-import java.util.Collections;
-import java.util.Map;
-
import org.apache.avalon.framework.parameters.Parameters;
+
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
+
import org.apache.lenya.cms.ac.AccessControlException;
import org.apache.lenya.cms.ac.FileUser;
import org.apache.lenya.cms.ac.Group;
@@ -67,64 +71,78 @@
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationFactory;
+import java.io.File;
+
+import java.util.Collections;
+import java.util.Map;
+
+
/**
* @author egli
- *
- *
+ *
+ *
*/
-public class UserAdminAddAction
- extends AbstractAction
- implements UserAdminActionInterface {
-
- public Map act(
- Redirector redirector,
- SourceResolver resolver,
- Map objectModel,
- String source,
- Parameters parameters)
- throws Exception {
-
- Request request = ObjectModelHelper.getRequest(objectModel);
-
- Map emptyMap = Collections.EMPTY_MAP;
-
- Publication publication = PublicationFactory.getPublication(objectModel);
-
- String userId = request.getParameter(USER_ID);
- String fullName = request.getParameter(FULL_NAME);
- String email = request.getParameter(EMAIL);
- String password = request.getParameter(PASSWORD);
- String confirmPassword = request.getParameter(CONFIRM_PASSWORD);
-
- if ((password != null) && (!password.equals(confirmPassword))) {
- getLogger().info("Password not confirmed");
- return null;
- }
+public class UserAdminAddAction extends AbstractAction implements UserAdminActionInterface {
+ /**
+ * DOCUMENT ME!
+ *
+ * @param redirector DOCUMENT ME!
+ * @param resolver DOCUMENT ME!
+ * @param objectModel DOCUMENT ME!
+ * @param source DOCUMENT ME!
+ * @param parameters DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ *
+ * @throws Exception DOCUMENT ME!
+ */
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source,
+ Parameters parameters) throws Exception {
+ Request request = ObjectModelHelper.getRequest(objectModel);
+
+ Map emptyMap = Collections.EMPTY_MAP;
+
+ Publication publication = PublicationFactory.getPublication(objectModel);
+
+ String userId = request.getParameter(USER_ID);
+ String fullName = request.getParameter(FULL_NAME);
+ String email = request.getParameter(EMAIL);
+ String password = request.getParameter(PASSWORD);
+ String confirmPassword = request.getParameter(CONFIRM_PASSWORD);
+
+ if ((password != null) && (!password.equals(confirmPassword))) {
+ getLogger().info("Password not confirmed");
+
+ return null;
+ }
File configurationDirectory = new File(publication.getDirectory(), ItemManager.PATH);
- GroupManager manager = null;
- try {
- manager = GroupManager.instance(configurationDirectory);
- } catch (AccessControlException e) {
- getLogger().error(e.getMessage(), e);
- return null;
- }
-
- FileUser user =
- new FileUser(configurationDirectory, userId, fullName, email, password);
- String[] groups = request.getParameterValues(GROUPS);
- for (int i = 0; i < groups.length; i++) {
- Group group = (Group) manager.getGroup(groups[i]);
- group.add(user);
- }
-
- try {
- user.save();
- } catch (AccessControlException e) {
- getLogger().error(e.getMessage(), e);
- return null;
- }
- return emptyMap;
- }
+ GroupManager manager = null;
+
+ try {
+ manager = GroupManager.instance(configurationDirectory);
+ } catch (AccessControlException e) {
+ getLogger().error(e.getMessage(), e);
+
+ return null;
+ }
+
+ FileUser user = new FileUser(configurationDirectory, userId, fullName, email, password);
+ String[] groups = request.getParameterValues(GROUPS);
+
+ for (int i = 0; i < groups.length; i++) {
+ Group group = (Group) manager.getGroup(groups[i]);
+ group.add(user);
+ }
+
+ try {
+ user.save();
+ } catch (AccessControlException e) {
+ getLogger().error(e.getMessage(), e);
+
+ return null;
+ }
+ return emptyMap;
+ }
}
1.4 +26 -8 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ResourceExistsAction.java
Index: ResourceExistsAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/ResourceExistsAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ResourceExistsAction.java 25 Jun 2003 14:51:46 -0000 1.3
+++ ResourceExistsAction.java 30 Jun 2003 11:46:29 -0000 1.4
@@ -1,4 +1,6 @@
/*
+$Id
+<License>
============================================================================
The Apache Software License, Version 1.1
@@ -22,7 +24,7 @@
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
- 4. The names "Apache Cocoon" and "Apache Software Foundation" must not be
+ 4. The names "Apache Lenya" 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.
@@ -44,23 +46,31 @@
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation and was originally created by
- Stefano Mazzocchi <st...@apache.org>. For more information on the Apache
- Software Foundation, please see <http://www.apache.org/>.
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.avalon.framework.thread.ThreadSafe;
+
import org.apache.cocoon.acting.ComposerAction;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.SourceResolver;
+
import org.apache.excalibur.source.Source;
import java.io.File;
+
import java.net.URL;
+
import java.util.Map;
+
/**
* This action simply checks to see if a given resource exists. It checks
* whether the specified in the src attribute source exists or not.
@@ -68,7 +78,7 @@
* <p>Instead of src attribute, source can be specified using
* parameter named 'url' (this is old syntax).
* <p>In order to differentiate between files and directories, the type can be specified
- * using the parameter 'type' (<map:parameter name="type" value="file"/> or
+ * using the parameter 'type' (<map:parameter name="type" value="file"/> or
* <map:parameter name="type" value="directory"/>). The parameter 'type' is optional.
* <p>
* <b>Note:</b> {@link org.apache.cocoon.selection.ResourceExistsSelector}
@@ -80,34 +90,42 @@
* @version CVS $Id$
*/
public class ResourceExistsAction extends ComposerAction implements ThreadSafe {
-
/**
*
*/
- public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception {
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source,
+ Parameters parameters) throws Exception {
String urlstring = parameters.getParameter("url", source);
String typestring = parameters.getParameter("type", "resource");
Source src = null;
+
try {
src = resolver.resolveURI(urlstring);
+
File resource = new File(new URL(src.getURI()).getFile());
+
if (typestring.equals("resource") && src.exists()) {
getLogger().debug(".act(): Resource (file or directory) exists: " + src.getURI());
+
return EMPTY_MAP;
} else if (typestring.equals("file") && resource.isFile()) {
getLogger().debug(".act(): File exists: " + resource);
+
return EMPTY_MAP;
} else if (typestring.equals("directory") && resource.isDirectory()) {
getLogger().debug(".act(): Directory exists: " + resource);
+
return EMPTY_MAP;
} else {
- getLogger().debug(".act(): Resource " + resource + " as type \"" + typestring + "\" does not exist");
+ getLogger().debug(".act(): Resource " + resource + " as type \"" + typestring +
+ "\" does not exist");
}
} catch (Exception e) {
getLogger().warn(".act(): Exception", e);
} finally {
resolver.release(src);
}
+
return null;
}
}
1.6 +99 -95 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAdminDeleteAction.java
Index: UserAdminDeleteAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/UserAdminDeleteAction.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- UserAdminDeleteAction.java 25 Jun 2003 14:43:04 -0000 1.5
+++ UserAdminDeleteAction.java 30 Jun 2003 11:46:29 -0000 1.6
@@ -1,64 +1,68 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2003 Wyona. 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. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment: "This product
- * includes software developed by Wyona (http://www.wyona.com)"
- *
- * 4. The name "Lenya" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact contact@wyona.com
- *
- * 5. Products derived from this software may not be called "Lenya" nor
- * may "Lenya" appear in their names without prior written permission
- * of Wyona.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment: "This product includes software developed by Wyona
- * (http://www.wyona.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY Wyona "AS IS" WITHOUT ANY WARRANTY EXPRESS
- * OR IMPLIED, INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * Wyona WILL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY YOU AS A RESULT
- * OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF Wyona HAS BEEN
- * ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. Wyona WILL NOT BE LIABLE
- * FOR ANY THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
-import java.io.File;
-import java.util.Collections;
-import java.util.Map;
-
import org.apache.avalon.framework.parameters.Parameters;
+
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
+
import org.apache.lenya.cms.ac.AccessControlException;
import org.apache.lenya.cms.ac.ItemManager;
import org.apache.lenya.cms.ac.User;
@@ -66,57 +70,57 @@
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationFactory;
+import java.io.File;
+
+import java.util.Collections;
+import java.util.Map;
+
+
/**
* @author egli
- *
- *
+ *
+ *
*/
-public class UserAdminDeleteAction
- extends AbstractAction
- implements UserAdminActionInterface {
-
- /* (non-Javadoc)
- * @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
- */
- public Map act(
- Redirector redirector,
- SourceResolver resolver,
- Map objectModel,
- String source,
- Parameters parameters)
- throws Exception {
-
- Request request = ObjectModelHelper.getRequest(objectModel);
- Publication publication =
- PublicationFactory.getPublication(objectModel);
+public class UserAdminDeleteAction extends AbstractAction implements UserAdminActionInterface {
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
+ */
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source,
+ Parameters parameters) throws Exception {
+ Request request = ObjectModelHelper.getRequest(objectModel);
+ Publication publication = PublicationFactory.getPublication(objectModel);
- Map emptyMap = Collections.EMPTY_MAP;
+ Map emptyMap = Collections.EMPTY_MAP;
- String userId = request.getParameter(USER_ID);
+ String userId = request.getParameter(USER_ID);
File configurationDirectory = new File(publication.getDirectory(), ItemManager.PATH);
- UserManager manager = null;
- try {
- manager = UserManager.instance(configurationDirectory);
- } catch (AccessControlException e) {
- getLogger().error(e.getMessage(), e);
- return null;
- }
- User user = manager.getUser(userId);
-
- if (user == null) {
- getLogger().warn("Trying to delete non-existing user: " + userId);
- return null;
- }
-
- try {
- user.delete();
- } catch (AccessControlException e) {
- getLogger().error(e.getMessage(), e);
- return null;
- }
+ UserManager manager = null;
+
+ try {
+ manager = UserManager.instance(configurationDirectory);
+ } catch (AccessControlException e) {
+ getLogger().error(e.getMessage(), e);
+
+ return null;
+ }
+
+ User user = manager.getUser(userId);
+
+ if (user == null) {
+ getLogger().warn("Trying to delete non-existing user: " + userId);
+
+ return null;
+ }
+
+ try {
+ user.delete();
+ } catch (AccessControlException e) {
+ getLogger().error(e.getMessage(), e);
- return emptyMap;
- }
+ return null;
+ }
+ return emptyMap;
+ }
}
1.2 +67 -53 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/DefaultAuthenticatorAction.java
Index: DefaultAuthenticatorAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/DefaultAuthenticatorAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultAuthenticatorAction.java 25 Jun 2003 14:46:30 -0000 1.1
+++ DefaultAuthenticatorAction.java 30 Jun 2003 11:46:29 -0000 1.2
@@ -1,58 +1,73 @@
/*
- * $Id
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
-package org.apache.lenya.cms.cocoon.acting;
+$Id
+<License>
-import java.io.File;
-import java.util.Map;
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
+package org.apache.lenya.cms.cocoon.acting;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
+
import org.apache.lenya.cms.ac.ItemManager;
import org.apache.lenya.cms.ac.User;
import org.apache.lenya.cms.ac.UserManager;
import org.apache.lenya.cms.ac2.Identity;
+import java.io.File;
+
+import java.util.Map;
+
+
/**
* @author andreas
*
@@ -60,35 +75,34 @@
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class DefaultAuthenticatorAction extends UserAuthenticatorAction {
-
/**
* @see org.apache.lenya.cms.cocoon.acting.AbstractUsernamePasswordAuthenticatorAction#authenticate(java.lang.String, java.lang.String, org.apache.cocoon.environment.Request, java.util.Map)
*/
public boolean authenticate(String username, String password, Request request, Map map)
throws Exception {
boolean authenticated = super.authenticate(username, password, request, map);
-
+
if (getLogger().isDebugEnabled()) {
getLogger().debug("Authenticating");
}
-
+
if (authenticated) {
Identity identity = new Identity();
-
+
File publicationDir = getPublication().getDirectory();
File configDir = new File(publicationDir, ItemManager.PATH);
User user = UserManager.instance(configDir).getUser(username);
-
+
identity.addIdentifiable(user);
+
Session session = request.getSession(false);
session.setAttribute(Identity.class.getName(), identity);
-
+
if (getLogger().isDebugEnabled()) {
getLogger().debug("Adding identity to session: " + identity);
}
}
-
+
return authenticated;
}
-
}
1.18 +63 -59 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/RevisionControllerAction.java
Index: RevisionControllerAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/RevisionControllerAction.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- RevisionControllerAction.java 30 Jun 2003 08:53:06 -0000 1.17
+++ RevisionControllerAction.java 30 Jun 2003 11:46:29 -0000 1.18
@@ -1,46 +1,58 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.parameters.Parameters;
@@ -53,17 +65,18 @@
import org.apache.cocoon.environment.SourceResolver;
import org.apache.lenya.cms.ac.Identity;
-import org.apache.lenya.cms.rc.RevisionController;
-import org.apache.lenya.cms.rc.RCEnvironment;
-
import org.apache.lenya.cms.publication.PageEnvelope;
import org.apache.lenya.cms.publication.PageEnvelopeFactory;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationFactory;
+import org.apache.lenya.cms.rc.RCEnvironment;
+import org.apache.lenya.cms.rc.RevisionController;
import java.io.File;
+
import java.util.Map;
+
/**
* DOCUMENT ME!
*
@@ -90,14 +103,8 @@
*
* @throws Exception DOCUMENT ME!
*/
- public Map act(
- Redirector redirector,
- SourceResolver resolver,
- Map objectModel,
- String src,
- Parameters parameters)
- throws Exception {
-
+ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src,
+ Parameters parameters) throws Exception {
// Get request object
Request request = ObjectModelHelper.getRequest(objectModel);
@@ -129,8 +136,8 @@
// Initialize Revision Controller
rc = new RevisionController(rcmlDirectory, backupDirectory, publicationPath);
getLogger().debug("revision controller" + rc);
- // /Initialize Revision Controller
+ // /Initialize Revision Controller
// Get session
Session session = request.getSession(false);
@@ -144,11 +151,8 @@
getLogger().debug(".act(): Identity: " + identity);
String docId = request.getParameter("documentid");
- String authoringPath =
- new File(
- publication.getDirectory().getCanonicalPath(),
- "content" + File.separator + Publication.AUTHORING_AREA)
- .getCanonicalPath();
+ String authoringPath = new File(publication.getDirectory().getCanonicalPath(),
+ "content" + File.separator + Publication.AUTHORING_AREA).getCanonicalPath();
filename = authoringPath + "/" + docId;
getLogger().debug(".act(): publicationAuthPath + docId : " + authoringPath + " : " + docId);
username = null;
1.9 +56 -44 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/NoPasswordYetAction.java
Index: NoPasswordYetAction.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/NoPasswordYetAction.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- NoPasswordYetAction.java 24 Apr 2003 13:52:38 -0000 1.8
+++ NoPasswordYetAction.java 30 Jun 2003 11:46:29 -0000 1.9
@@ -1,52 +1,65 @@
/*
- * $Id$
- * <License>
- * The Apache Software License
- *
- * Copyright (c) 2002 lenya. 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. All advertising materials mentioning features or use of this software must
- * display the following acknowledgment: "This product includes software developed
- * by lenya (http://www.lenya.org)"
- *
- * 4. The name "lenya" must not be used to endorse or promote products derived from
- * this software without prior written permission. For written permission, please
- * contact contact@lenya.org
- *
- * 5. Products derived from this software may not be called "lenya" nor may "lenya"
- * appear in their names without prior written permission of lenya.
- *
- * 6. Redistributions of any form whatsoever must retain the following acknowledgment:
- * "This product includes software developed by lenya (http://www.lenya.org)"
- *
- * THIS SOFTWARE IS PROVIDED BY lenya "AS IS" WITHOUT ANY WARRANTY EXPRESS OR IMPLIED,
- * INCLUDING THE WARRANTY OF NON-INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTI-
- * BILITY AND FITNESS FOR A PARTICULAR PURPOSE. lenya WILL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY YOU AS A RESULT OF USING THIS SOFTWARE. IN NO EVENT WILL lenya BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR LOST PROFITS EVEN IF lenya HAS
- * BEEN ADVISED OF THE POSSIBILITY OF THEIR OCCURRENCE. lenya WILL NOT BE LIABLE FOR ANY
- * THIRD PARTY CLAIMS AGAINST YOU.
- *
- * Lenya includes software developed by the Apache Software Foundation, W3C,
- * DOM4J Project, BitfluxEditor and Xopus.
- * </License>
- */
+$Id
+<License>
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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 acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Lenya" 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 name, without prior written permission of the
+ Apache Software Foundation.
+
+ 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 (INCLU-
+ DING, 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 and was originally created by
+ Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
+ ware Foundation, please see <http://www.apache.org/>.
+
+ Lenya includes software developed by the Apache Software Foundation, W3C,
+ DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
+</License>
+*/
package org.apache.lenya.cms.cocoon.acting;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.Context;
+import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.SourceResolver;
@@ -54,7 +67,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.cocoon.environment.ObjectModelHelper;
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org