You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by cd...@apache.org on 2007/08/04 16:41:49 UTC
svn commit: r562725 [9/33] - in /portals/pluto/branches/1.1-286-trunk-merge:
./ assembly/ assembly/src/ assembly/src/main/ assembly/src/main/assembly/
assembly/src/main/resources/ maven-pluto-plugin/ maven-pluto-plugin/src/
maven-pluto-plugin/src/main/...
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesService.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesService.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesService.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesService.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2003-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.spi.optional;
+
+import java.util.Map;
+
+import javax.portlet.PortletRequest;
+
+import org.apache.pluto.PortletContainerException;
+import org.apache.pluto.spi.ContainerService;
+
+/**
+ * Used to access user information attributes as described in
+ * PLT.17.2 of the JSR-168 specificiation. Attribute persistence is
+ * not covered by the spec so it is not done here.
+ *
+ * @author <a href="cdoremus@apache.org">Craig Doremus</a>
+ */
+public interface UserInfoAttributesService extends ContainerService {
+
+ /**
+ * To access user information attributes as defined in PLT.17
+ * of JSR-168.
+ *
+ * @param request Used to extract the authenticated user name.
+ * @return A map of names and values of user information attributes
+ * for a particular authenticated user.
+ */
+ Map getAttributes(PortletRequest request)
+ throws PortletContainerException ;
+
+ /**
+ * Persists user information attributes.
+ *
+ * @param attributes The attributes to persist.
+ void store(UserInfoAttribute[] attributes)
+ throws PortletContainerException;
+ */
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesServiceImpl.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesServiceImpl.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesServiceImpl.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2003-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.spi.optional;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.portlet.PortletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.PortletContainerException;
+
+/**
+ * TODO: Add a cache keyed by logged-in username.
+ * FIXME: Only include attributes that are defined in portlet.xml
+ *
+ * This is a default implementation of that gets user information attributes
+ * from a properties file where the user information attribute name (as defined
+ * in PLT.D of the JSR-168 spec) is prefixed by the user name (e.g. craig.user.name.given=Craig).
+ *
+ * @author <a href="cdoremus@apache.org">Craig Doremus</a>
+ */
+public class UserInfoAttributesServiceImpl implements UserInfoAttributesService {
+
+ private static UserInfoAttributesServiceImpl instance = new UserInfoAttributesServiceImpl();
+
+ private static final String USER_INFO_ATTR_FILE = "/user-info-attributes.properties";
+ /** Logger. */
+ private static final Log LOG = LogFactory.getLog(
+ UserInfoAttributesServiceImpl.class);
+ private static Properties props = new Properties();
+ private static Map cache = new HashMap();
+
+ private UserInfoAttributesServiceImpl(){
+
+ }
+
+ public static UserInfoAttributesServiceImpl getInstance() throws IOException {
+ loadProperties();
+ return instance;
+ }
+
+ public static UserInfoAttributesServiceImpl getInstance(Properties inprops) throws IOException {
+ props = inprops;
+ return instance;
+ }
+
+ /**
+ * Implementation of PLT.17.2 used to access user information attributes.
+ *
+ * @see org.apache.pluto.services.optional.UserInfoAttributesService#getAttributes(javax.portlet.PortletRequest)
+ * @return As per the spec, return null if the user is not authenticated or an empty Map if there are
+ * no attributes in the properties file or a Map containing only those attributes found in the attribute
+ * data store (properties file).
+ */
+ public Map getAttributes(PortletRequest request)
+ throws PortletContainerException {
+ Map map = null;
+ String user = request.getRemoteUser();
+ if (user == null) {
+ return null;
+ }
+ map = (Map)cache.get(user);
+ if (map == null) {
+ map = new HashMap();
+ int len = P3PAttributes.ATTRIBUTE_ARRAY.length;
+ StringBuffer prefix = new StringBuffer();
+ prefix.append(user);
+ prefix.append('.');
+ StringBuffer name = null;
+ for (int i = 0; i < len ; i++) {
+ name = new StringBuffer();
+ name.append(prefix);
+ String attr = P3PAttributes.ATTRIBUTE_ARRAY[i];
+ name.append(attr);
+ String prop = props.getProperty(name.toString());
+ //spec says that Map only attributes that have data
+ if ( prop != null) {
+ //TODO: convert user.bdate to milliseconds since January 1, 1970, 00:00:00 GMT.
+ map.put(attr, prop);
+ }
+ }
+ cache.put(user, map);
+ }
+ return map;
+ }
+
+ private static void loadProperties() throws IOException {
+ //get the properties from prop file
+ if (props.isEmpty()) {
+ InputStream stream = UserInfoAttributesServiceImpl.class.getResourceAsStream(USER_INFO_ATTR_FILE);
+ if (stream == null) {
+ String msg = "The properties file '" + USER_INFO_ATTR_FILE +"' cannot be found." +
+ " Please make sure this file exists and is in the classpath (i.e. WEB-INF/classes).";
+ LOG.error(msg);
+ throw new IOException(msg);
+ }
+ props.load(stream);
+ }
+ }
+
+
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/ArgumentUtility.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/ArgumentUtility.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/ArgumentUtility.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/ArgumentUtility.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Static class that provides utility static methods for argument validation.
+ *
+ * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
+ * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
+ */
+public class ArgumentUtility {
+
+ /** Logger. */
+ public static final Log LOG = LogFactory.getLog(ArgumentUtility.class);
+
+
+ // Static Utility Methods --------------------------------------------------
+
+ /**
+ * Validates that the passed-in argument value is not null.
+ * @param argumentName the argument name.
+ * @param argument the argument value.
+ * @throws IllegalArgumentException if the argument value is null.
+ */
+ public static void validateNotNull(String argumentName, Object argument)
+ throws IllegalArgumentException {
+ if (argument == null) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Validation failed for argument: " + argumentName
+ + ": argument should not be null.");
+ }
+ throw new IllegalArgumentException(
+ "Illegal Argument: " + argumentName
+ + " (argument should not be null)");
+ }
+ }
+
+ /**
+ * Validates that the passed-in string argument value is not null or empty.
+ * @param argumentName the argument name.
+ * @param argument the argument value.
+ * @throws IllegalArgumentException if the argument value is null or empty.
+ */
+ public static void validateNotEmpty(String argumentName, String argument)
+ throws IllegalArgumentException {
+ if (argument == null || "".equals(argument)) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Validation failed for argument: " + argumentName
+ + ": argument should not be null or empty.");
+ }
+ throw new IllegalArgumentException(
+ "Illegal Argument: " + argumentName
+ + " (argument should not be null or empty)");
+ }
+ }
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/Enumerator.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/Enumerator.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/Enumerator.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/Enumerator.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util;
+
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+
+/**
+ * Uitlity class to wraps an <code>Enumeration</code> around a Collection, i.e.
+ * <code>Iterator</code> classes.
+ */
+
+public final class Enumerator implements Enumeration {
+
+
+ // Iterator over which the Enumeration takes place
+ private Iterator iterator = null;
+
+
+ /**
+ * Returns an Enumeration over the specified Collection.
+ * @param collection Collection with values that should be enumerated
+ */
+ public Enumerator(Collection collection) {
+ this(collection.iterator());
+ }
+
+
+ /**
+ * Returns an Enumeration over the values of the specified Iterator.
+ * @param iterator Iterator to be wrapped
+ */
+ public Enumerator(Iterator iterator) {
+ super();
+ this.iterator = iterator;
+ }
+
+
+ /**
+ * Returns an Enumeration over the values of the specified Map.
+ * @param map Map with values that should be enumerated
+ */
+ public Enumerator(Map map) {
+ this(map.values().iterator());
+ }
+
+
+ /**
+ * Tests if this enumeration contains more elements.
+ * @return <code>true</code> if this enumeration contains at least one more
+ * element to provide, <code>false</code> otherwise.
+ */
+ public boolean hasMoreElements() {
+ return (iterator.hasNext());
+ }
+
+
+ /**
+ * Returns the next element of this enumeration.
+ * @return the next element of this enumeration
+ * @throws NoSuchElementException if no more elements exist
+ */
+ public Object nextElement() throws NoSuchElementException {
+ return (iterator.next());
+ }
+
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/NamespaceMapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/NamespaceMapper.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/NamespaceMapper.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/NamespaceMapper.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util;
+
+import org.apache.pluto.PortletWindowID;
+
+/**
+ **/
+public interface NamespaceMapper {
+
+
+ public String encode(PortletWindowID namespace, String name);
+
+ public String encode(PortletWindowID ns1, PortletWindowID ns2, String name);
+
+ public String decode(PortletWindowID ns, String name);
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/PrintWriterServletOutputStream.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/PrintWriterServletOutputStream.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/PrintWriterServletOutputStream.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/PrintWriterServletOutputStream.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletOutputStream;
+
+/**
+ * This is a specialized class implementing a ServletOutputStream that works in
+ * conjunction with a PrintWriter to send data to the browser. It is used when a
+ * J2EE server throws an IllegalStateException when you call getOutputStream on
+ * a response which someone has previously called getWriter on.
+ */
+public class PrintWriterServletOutputStream extends ServletOutputStream {
+
+ /**
+ * The PrintWriter that is wrapped on top of the base input stream
+ */
+ PrintWriter mPrintWriter;
+
+ /**
+ * Construct a ServletOutputStream that coordinates output using a base
+ * ServletOutputStream and a PrintWriter that is wrapped on top of that
+ * OutputStream.
+ */
+ public PrintWriterServletOutputStream(PrintWriter pO) {
+ super();
+ mPrintWriter = pO;
+ }
+
+ /**
+ * Writes an array of bytes
+ * @param pBuf the array to be written
+ * @throws IOException if an I/O error occurred
+ */
+ public void write(byte[] pBuf) throws IOException {
+ char[] cbuf = new char[pBuf.length];
+ for (int i = 0; i < cbuf.length; i++) {
+ cbuf[i] = (char) (pBuf[i] & 0xff);
+ }
+ mPrintWriter.write(cbuf, 0, pBuf.length);
+ }
+
+ /**
+ * Writes a single byte to the output stream
+ */
+ public void write(int pVal) throws IOException {
+ mPrintWriter.write(pVal);
+ }
+
+ /**
+ * Writes a subarray of bytes
+ * @param pBuf the array to be written
+ * @param pOffset the offset into the array
+ * @param pLength the number of bytes to write
+ * @throws IOException if an I/O error occurred
+ */
+ public void write(byte[] pBuf, int pOffset, int pLength)
+ throws IOException {
+ char[] cbuf = new char[pLength];
+ for (int i = 0; i < pLength; i++) {
+ cbuf[i] = (char) (pBuf[i + pOffset] & 0xff);
+ }
+ mPrintWriter.write(cbuf, 0, pLength);
+ }
+
+ /**
+ * Flushes the stream, writing any buffered output bytes
+ * @throws IOException if an I/O error occurred
+ */
+ public void flush() throws IOException {
+ mPrintWriter.flush();
+ }
+
+ /**
+ * Closes the stream
+ * @throws IOException if an I/O error occurred
+ */
+ public void close() throws IOException {
+ mPrintWriter.close();
+ }
+
+ /**
+ * Prints a string.
+ * @param pVal the String to be printed
+ * @throws IOException if an I/O error has occurred
+ */
+ public void print(String pVal) throws IOException {
+ mPrintWriter.print(pVal);
+ }
+
+ /**
+ * Prints an string followed by a CRLF.
+ * @param pVal the String to be printed
+ * @throws IOException if an I/O error has occurred
+ */
+ public void println(String pVal) throws IOException {
+ mPrintWriter.println(pVal);
+ }
+
+ /**
+ * Prints a CRLF
+ * @throws IOException if an I/O error has occurred
+ */
+ public void println() throws IOException {
+ mPrintWriter.println();
+ }
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/StringManager.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/StringManager.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/StringManager.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/StringManager.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,256 @@
+/*
+ * Copyright 1999,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util;
+
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
+
+import java.net.URLClassLoader;
+import java.text.MessageFormat;
+import java.util.Hashtable;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * An internationalization / localization helper class which reduces the bother
+ * of handling ResourceBundles and takes care of the common cases of message
+ * formating which otherwise require the creation of Object arrays and such.
+ * <p/>
+ * <p>The StringManager operates on a package basis. One StringManager per
+ * package can be created and accessed via the getManager method call.
+ * <p/>
+ * <p>The StringManager will look for a ResourceBundle named by the package name
+ * given plus the suffix of "LocalStrings". In practice, this means that the
+ * localized information will be contained in a LocalStrings.properties file
+ * located in the package directory of the classpath.
+ * <p/>
+ * <p>Please see the documentation for java.util.ResourceBundle for more
+ * information.
+ * @author James Duncan Davidson [duncan@eng.sun.com]
+ * @author James Todd [gonzo@eng.sun.com]
+ */
+
+public class StringManager {
+ private static final Log LOG = LogFactory.getLog(StringManager.class);
+
+ /**
+ * The ResourceBundle for this StringManager.
+ */
+
+ private ResourceBundle bundle;
+
+ /**
+ * The package this StringManager belongs to.
+ */
+ private String packageName = null;
+
+ /**
+ * Creates a new StringManager for a given package. This is a private method
+ * and all access to it is arbitrated by the static getManager method call
+ * so that only one StringManager per package will be created.
+ * @param packageName Name of package to create StringManager for.
+ */
+
+ private StringManager(String packageName) {
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("String Manager Created for package: "+packageName);
+ }
+ this.packageName = packageName;
+ String bundleName = packageName + ".LocalStrings";
+ try {
+ bundle = ResourceBundle.getBundle(bundleName);
+ return;
+ } catch (MissingResourceException ex) {
+ // Try from the current loader ( that's the case for trusted apps )
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ if (cl != null) {
+ try {
+ bundle =
+ ResourceBundle.getBundle(bundleName, Locale.getDefault(),
+ cl);
+ return;
+ } catch (MissingResourceException ex2) {
+ }
+ }
+ if (cl == null) {
+ cl = this.getClass().getClassLoader();
+ }
+
+ System.out.println("Can't find resource " + bundleName +
+ " " + cl);
+ if (cl instanceof URLClassLoader) {
+ System.out.println(((URLClassLoader) cl).getURLs());
+ }
+ }
+ }
+
+ /**
+ * Get a string from the underlying resource bundle.
+ * @param key The resource name
+ */
+ public String getString(String key) {
+ return MessageFormat.format(getStringInternal(key), null);
+ }
+
+
+ protected String getStringInternal(String key) {
+ if (key == null) {
+ String msg = "key is null";
+
+ throw new NullPointerException(msg);
+ }
+
+ String str = null;
+
+ if (bundle == null) {
+ return key;
+ }
+ try {
+ str = bundle.getString(key);
+ } catch (MissingResourceException mre) {
+ String name = null;
+ if (packageName == null) {
+ name = "unknown";
+ } else {
+ name = packageName;
+ }
+ str = "Cannot find message in the ResourceBundle associated with key '" + key + "' " +
+ "(package " + name + ")";
+ LOG.warn(str, mre);
+ }
+
+ return str;
+ }
+
+ /**
+ * Get a string from the underlying resource bundle and format it with the
+ * given set of arguments.
+ * @param key The resource name
+ * @param args Formatting directives
+ */
+
+ public String getString(String key, Object[] args) {
+ String iString = null;
+ String value = getStringInternal(key);
+
+ // this check for the runtime exception is some pre 1.1.6
+ // VM's don't do an automatic toString() on the passed in
+ // objects and barf out
+
+ try {
+ // ensure the arguments are not null so pre 1.2 VM's don't barf
+ Object nonNullArgs[] = args;
+ for (int i = 0; i < args.length; i++) {
+ if (args[i] == null) {
+ if (nonNullArgs == args) {
+ nonNullArgs =
+ (Object[]) args.clone();
+ }
+ nonNullArgs[i] = "null";
+ }
+ }
+
+ iString = MessageFormat.format(value, nonNullArgs);
+ } catch (IllegalArgumentException iae) {
+ StringBuffer buf = new StringBuffer();
+ buf.append(value);
+ for (int i = 0; i < args.length; i++) {
+ buf.append(" arg[").append(i).append("]=").append(args[i]);
+ }
+ iString = buf.toString();
+ }
+ return iString;
+ }
+
+ /**
+ * Get a string from the underlying resource bundle and format it with the
+ * given object argument. This argument can of course be a String object.
+ * @param key The resource name
+ * @param arg Formatting directive
+ */
+
+ public String getString(String key, Object arg) {
+ Object[] args = new Object[]{arg};
+ return getString(key, args);
+ }
+
+ /**
+ * Get a string from the underlying resource bundle and format it with the
+ * given object arguments. These arguments can of course be String objects.
+ * @param key The resource name
+ * @param arg1 Formatting directive
+ * @param arg2 Formatting directive
+ */
+
+ public String getString(String key, Object arg1, Object arg2) {
+ Object[] args = new Object[]{arg1, arg2};
+ return getString(key, args);
+ }
+
+ /**
+ * Get a string from the underlying resource bundle and format it with the
+ * given object arguments. These arguments can of course be String objects.
+ * @param key The resource name
+ * @param arg1 Formatting directive
+ * @param arg2 Formatting directive
+ * @param arg3 Formatting directive
+ */
+
+ public String getString(String key, Object arg1, Object arg2,
+ Object arg3) {
+ Object[] args = new Object[]{arg1, arg2, arg3};
+ return getString(key, args);
+ }
+
+ /**
+ * Get a string from the underlying resource bundle and format it with the
+ * given object arguments. These arguments can of course be String objects.
+ * @param key The resource name
+ * @param arg1 Formatting directive
+ * @param arg2 Formatting directive
+ * @param arg3 Formatting directive
+ * @param arg4 Formatting directive
+ */
+
+ public String getString(String key, Object arg1, Object arg2,
+ Object arg3, Object arg4) {
+ Object[] args = new Object[]{arg1, arg2, arg3, arg4};
+ return getString(key, args);
+ }
+ // --------------------------------------------------------------
+ // STATIC SUPPORT METHODS
+ // --------------------------------------------------------------
+
+ private static Hashtable managers = new Hashtable();
+
+ /**
+ * Get the StringManager for a particular package. If a manager for a
+ * package already exists, it will be reused, else a new StringManager will
+ * be created and returned.
+ * @param packageName The package name
+ */
+
+ public synchronized static StringManager getManager(String packageName) {
+ StringManager mgr = (StringManager) managers.get(packageName);
+
+ if (mgr == null) {
+ mgr = new StringManager(packageName);
+ managers.put(packageName, mgr);
+ }
+ return mgr;
+ }
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/StringUtils.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/StringUtils.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/StringUtils.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/StringUtils.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * Static class hosting a couple of utility methods around strings.
+ * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
+ * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
+ */
+public class StringUtils {
+
+ // Private Constructor -----------------------------------------------------
+
+ /**
+ * Private constructor that prevents external instantiation.
+ */
+ private StringUtils() {
+ // Do nothing.
+ }
+
+
+ // Static Utility Methods --------------------------------------------------
+
+ /**
+ * Replaces all occurrences of a pattern within a string by a replacement.
+ * @param source the string that should be searched.
+ * @param pattern the pattern that should be replaced.
+ * @param replace the replacement that should be inserted instead of the
+ * pattern.
+ * @return The updated source string.
+ */
+ public static String replace(String source, String pattern, String replace) {
+ if (source == null || source.length() == 0
+ || pattern == null || pattern.length() == 0) {
+ return source;
+ }
+
+ int k = source.indexOf(pattern);
+
+ if (k == -1) {
+ return source;
+ }
+
+ StringBuffer out = new StringBuffer();
+ int i = 0, l = pattern.length();
+
+ while (k != -1) {
+ out.append(source.substring(i, k));
+
+ if (replace != null) {
+ out.append(replace);
+ }
+
+ i = k + l;
+ k = source.indexOf(pattern, i);
+ }
+ out.append(source.substring(i));
+ return out.toString();
+ }
+
+ /**
+ * TODO: can't we just use String[].clone()?
+ * @param source
+ * @return
+ */
+ public static String[] copy(String[] source) {
+ if (source == null) {
+ return null;
+ }
+ int length = source.length;
+ String[] result = new String[length];
+ System.arraycopy(source, 0, result, 0, length);
+ return result;
+ }
+
+ /**
+ * Deep-clones a parameter map. The key is the parameter name as a String
+ * instance, while the value is a String array (String[]) instance.
+ * @param parameters the parameter map to deep-clone.
+ * @return the deep-cloned parameter map.
+ */
+ public static Map copyParameters(Map parameters) {
+ Map result = new HashMap(parameters);
+ for (Iterator it = result.entrySet().iterator(); it.hasNext();) {
+ Map.Entry entry = (Map.Entry) it.next();
+ if (!(entry.getKey() instanceof String)) {
+ throw new IllegalArgumentException("Parameter map keys "
+ + "must not be null and of type java.lang.String.");
+ }
+ try {
+ entry.setValue(copy((String[]) entry.getValue()));
+ } catch (ClassCastException ex) {
+ throw new IllegalArgumentException("Parameter map values "
+ + "must not be null and of type java.lang.String[].");
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Strips the specified mime type by removing the character encoding
+ * specified at the end of the mime type (all characters after the ';').
+ * The stripped mime type is trimmed string which contains no white
+ * spaces at the beginning and the end.
+ * @param mimeType the mime type to strip.
+ * @return the stripped mime type.
+ */
+ public static String getMimeTypeWithoutEncoding(String mimeType) {
+ int index = mimeType.indexOf(';');
+ String strippedType = null;
+ if (index == -1) {
+ strippedType = mimeType;
+ } else {
+ strippedType = mimeType.substring(0, index);
+ }
+ return strippedType.trim();
+ }
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/impl/NamespaceMapperImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/impl/NamespaceMapperImpl.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/impl/NamespaceMapperImpl.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/util/impl/NamespaceMapperImpl.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util.impl;
+
+import org.apache.pluto.PortletWindowID;
+import org.apache.pluto.util.NamespaceMapper;
+
+/**
+ * Default implementation of <code>NamespaceMapper</code> interface.
+ * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
+ * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
+ */
+public class NamespaceMapperImpl implements NamespaceMapper {
+
+ public NamespaceMapperImpl() {
+ // Do nothing.
+ }
+
+
+ // NamespaceMapper Impl ----------------------------------------------------
+
+ public String encode(PortletWindowID portletWindowId, String name) {
+ StringBuffer buffer = new StringBuffer(50);
+ buffer.append("Pluto_");
+ buffer.append(portletWindowId.getStringId());
+ buffer.append('_');
+ buffer.append(name);
+ return buffer.toString();
+ }
+
+ public String encode(PortletWindowID portletWindowId1,
+ PortletWindowID portletWindowId2,
+ String name) {
+ StringBuffer buffer = new StringBuffer(50);
+ buffer.append("Pluto_");
+ buffer.append(portletWindowId1.getStringId());
+ buffer.append('_');
+ buffer.append(portletWindowId2.getStringId());
+ buffer.append('_');
+ buffer.append(name);
+ return buffer.toString();
+ }
+
+ public String decode(PortletWindowID portletWindowId, String name) {
+ if (!name.startsWith("Pluto_")) {
+ return null;
+ }
+ StringBuffer buffer = new StringBuffer(50);
+ buffer.append("Pluto_");
+ buffer.append(portletWindowId.getStringId());
+ buffer.append('_');
+ if (!name.startsWith(buffer.toString())) {
+ return null;
+ }
+ return name.substring(buffer.length());
+ }
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionRequestWrapper.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionRequestWrapper.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionRequestWrapper.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.wrappers;
+
+import javax.portlet.ActionRequest;
+
+public class ActionRequestWrapper extends PortletRequestWrapper
+ implements ActionRequest {
+
+ /**
+ * Creates a ServletRequest adaptor wrapping the given request object.
+ * @throws java.lang.IllegalArgumentException
+ * if the request is null.
+ */
+ public ActionRequestWrapper(ActionRequest actionRequest) {
+ super(actionRequest);
+
+ if (actionRequest == null) {
+ throw new IllegalArgumentException("Request cannot be null");
+ }
+ }
+
+ // javax.portlet.ActionRequest implementation -------------------------------------------------
+ public java.io.InputStream getPortletInputStream()
+ throws java.io.IOException {
+ return this.getActionRequest().getPortletInputStream();
+ }
+
+ public void setCharacterEncoding(String enc)
+ throws java.io.UnsupportedEncodingException {
+ this.getActionRequest().setCharacterEncoding(enc);
+ }
+
+ public java.io.BufferedReader getReader()
+ throws java.io.UnsupportedEncodingException, java.io.IOException {
+ return this.getActionRequest().getReader();
+ }
+
+ public java.lang.String getCharacterEncoding() {
+ return this.getActionRequest().getCharacterEncoding();
+ }
+
+ public java.lang.String getContentType() {
+ return this.getActionRequest().getContentType();
+ }
+
+ public int getContentLength() {
+ return this.getActionRequest().getContentLength();
+ }
+
+ // --------------------------------------------------------------------------------------------
+
+ // additional methods -------------------------------------------------------------------------
+ /**
+ * Return the wrapped ServletRequest object.
+ */
+ public ActionRequest getActionRequest() {
+ return (ActionRequest) getPortletRequest();
+ }
+
+ // --------------------------------------------------------------------------------------------
+}
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionResponseWrapper.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionResponseWrapper.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionResponseWrapper.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.wrappers;
+
+import java.util.Enumeration;
+import java.util.Map;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.StateAwareResponse;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.xml.namespace.QName;
+
+public class ActionResponseWrapper extends PortletResponseWrapper
+ implements ActionResponse {
+
+ /**
+ * Creates a ServletResponse adaptor wrapping the given response object.
+ * @throws java.lang.IllegalArgumentException
+ * if the response is null.
+ */
+ public ActionResponseWrapper(ActionResponse actionResponse) {
+ super(actionResponse);
+
+ if (actionResponse == null) {
+ throw new IllegalArgumentException("Response cannot be null");
+ }
+ }
+
+ // javax.portlet.ActionResponse implementation ------------------------------------------------
+ public void setWindowState(WindowState windowState)
+ throws WindowStateException {
+ this.getActionResponse().setWindowState(windowState);
+ }
+
+ public void setPortletMode(PortletMode portletMode)
+ throws PortletModeException {
+ this.getActionResponse().setPortletMode(portletMode);
+ }
+
+ public void sendRedirect(String location) throws java.io.IOException {
+ this.getActionResponse().sendRedirect(location);
+ }
+
+ public void setRenderParameters(Map<String, String[]> parameters) {
+ this.getActionResponse().setRenderParameters(parameters);
+ }
+
+ public void setRenderParameter(String key, String value) {
+ this.getActionResponse().setRenderParameter(key, value);
+ }
+
+ public void setRenderParameter(String key, String[] values) {
+ this.getActionResponse().setRenderParameter(key, values);
+ }
+
+ // --------------------------------------------------------------------------------------------
+
+ // additional methods -------------------------------------------------------------------------
+ /**
+ * Return the wrapped ServletResponse object.
+ */
+ public ActionResponse getActionResponse() {
+ return (ActionResponse) getPortletResponse();
+ }
+
+ public StateAwareResponse getStateAwareResponse(){
+ return (StateAwareResponse) getPortletResponse();
+ }
+
+ public void setEvent(QName qname, java.io.Serializable value) {
+ this.getStateAwareResponse().setEvent(qname, value);
+ }
+
+ public void setEvents(Map<javax.xml.namespace.QName, java.io.Serializable> events) {
+ // TODO look for setEvents in StateAwareResponse
+// this.getStateAwareResponse().setEvents(events);
+ }
+ // --------------------------------------------------------------------------------------------
+
+ public PortletMode getPortletMode() {
+ return this.getStateAwareResponse().getPortletMode();
+ }
+
+ public Map getRenderParameterMap() {
+ return this.getStateAwareResponse().getRenderParameterMap();
+ }
+
+ public WindowState getWindowState() {
+ return this.getStateAwareResponse().getWindowState();
+ }
+
+ public void setNextPossiblePortletModes(Enumeration portletModes) {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException("This method needs to be implemented.");
+ }
+
+ public void setDefaultNamespacedEvents(Map<String, Object> events) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setEvent(String name, java.io.Serializable value) {
+ // TODO Auto-generated method stub
+
+ }
+}
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletRequestWrapper.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletRequestWrapper.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletRequestWrapper.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.wrappers;
+
+import java.util.Enumeration;
+import java.util.Map;
+
+import javax.portlet.PortalContext;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+import javax.portlet.WindowState;
+import javax.servlet.http.Cookie;
+
+public class PortletRequestWrapper
+ extends javax.servlet.http.HttpServletRequestWrapper
+ implements PortletRequest {
+
+ /**
+ * Creates a ServletRequest adaptor wrapping the given request object.
+ * @throws java.lang.IllegalArgumentException
+ * if the request is null.
+ */
+ public PortletRequestWrapper(PortletRequest portletRequest) {
+ super((javax.servlet.http.HttpServletRequest) portletRequest);
+
+ if (portletRequest == null) {
+ throw new IllegalArgumentException("Request cannot be null");
+ }
+ }
+
+ // javax.portlet.PortletRequest implementation -------------------------------------------------
+ public boolean isWindowStateAllowed(WindowState state) {
+ return this.getPortletRequest().isWindowStateAllowed(state);
+ }
+
+ public boolean isPortletModeAllowed(PortletMode mode) {
+ return this.getPortletRequest().isPortletModeAllowed(mode);
+ }
+
+ public PortletMode getPortletMode() {
+ return this.getPortletRequest().getPortletMode();
+ }
+
+ public WindowState getWindowState() {
+ return this.getPortletRequest().getWindowState();
+ }
+
+ public PortletPreferences getPreferences() {
+ return this.getPortletRequest().getPreferences();
+ }
+
+ public PortletSession getPortletSession() {
+ return this.getPortletRequest().getPortletSession();
+ }
+
+ public PortletSession getPortletSession(boolean create) {
+ return this.getPortletRequest().getPortletSession(create);
+ }
+
+ public String getProperty(String name) {
+ return this.getPortletRequest().getProperty(name);
+ }
+
+ public Enumeration getProperties(String name) {
+ return this.getPortletRequest().getProperties(name);
+ }
+
+ public Enumeration getPropertyNames() {
+ return this.getPortletRequest().getPropertyNames();
+ }
+
+ public PortalContext getPortalContext() {
+ return this.getPortletRequest().getPortalContext();
+ }
+
+ public java.lang.String getAuthType() {
+ return this.getPortletRequest().getAuthType();
+ }
+
+ public String getContextPath() {
+ return this.getPortletRequest().getContextPath();
+ }
+
+ public java.lang.String getRemoteUser() {
+ return this.getPortletRequest().getRemoteUser();
+ }
+
+ public java.security.Principal getUserPrincipal() {
+ return this.getPortletRequest().getUserPrincipal();
+ }
+
+ public boolean isUserInRole(java.lang.String role) {
+ return this.getPortletRequest().isUserInRole(role);
+ }
+
+ public Object getAttribute(String name) {
+ return this.getPortletRequest().getAttribute(name);
+ }
+
+ public java.util.Enumeration getAttributeNames() {
+ return this.getPortletRequest().getAttributeNames();
+ }
+
+ public String getParameter(String name) {
+ return this.getPortletRequest().getParameter(name);
+ }
+
+ public java.util.Enumeration getParameterNames() {
+ return this.getPortletRequest().getParameterNames();
+ }
+
+ public String[] getParameterValues(String name) {
+ return this.getPortletRequest().getParameterValues(name);
+ }
+
+ public java.util.Map getParameterMap() {
+ return this.getPortletRequest().getParameterMap();
+ }
+
+ public boolean isSecure() {
+ return this.getPortletRequest().isSecure();
+ }
+
+ public void setAttribute(String name, Object o) {
+ this.getPortletRequest().setAttribute(name, o);
+ }
+
+ public void removeAttribute(String name) {
+ this.getPortletRequest().removeAttribute(name);
+ }
+
+ public String getRequestedSessionId() {
+ return this.getPortletRequest().getRequestedSessionId();
+ }
+
+ public boolean isRequestedSessionIdValid() {
+ return this.getPortletRequest().isRequestedSessionIdValid();
+ }
+
+ public String getResponseContentType() {
+ return this.getPortletRequest().getResponseContentType();
+ }
+
+ public java.util.Enumeration getResponseContentTypes() {
+ return this.getPortletRequest().getResponseContentTypes();
+ }
+
+ public java.util.Locale getLocale() {
+ return this.getPortletRequest().getLocale();
+ }
+
+ public java.util.Enumeration getLocales() {
+ return this.getPortletRequest().getLocales();
+ }
+
+ public String getScheme() {
+ return this.getPortletRequest().getScheme();
+ }
+
+ public String getServerName() {
+ return this.getPortletRequest().getServerName();
+ }
+
+ public int getServerPort() {
+ return this.getPortletRequest().getServerPort();
+ }
+
+ public String getWindowID() {
+ return this.getPortletRequest().getWindowID();
+ }
+
+ // --------------------------------------------------------------------------------------------
+
+ // additional methods -------------------------------------------------------------------------
+ /**
+ * Return the wrapped ServletRequest object.
+ */
+ public PortletRequest getPortletRequest() {
+ return (PortletRequest) super.getRequest();
+ }
+
+ /**
+ * Sets the request being wrapped.
+ * @throws java.lang.IllegalArgumentException
+ * if the request is null.
+ */
+ public void setRequest(PortletRequest request) {
+ if (request == null) {
+ throw new IllegalArgumentException("Request cannot be null");
+ }
+ setRequest((javax.servlet.http.HttpServletRequest) request);
+ }
+ // --------------------------------------------------------------------------------------------
+
+ public String getLifecyclePhase() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException("This method needs to be implemented.");
+ }
+
+ public Cookie[] getCookieProperties() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException("This method needs to be implemented.");
+ }
+
+ public Map<String, String[]> getPrivateParameterMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, String[]> getPublicParameterMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletResponseWrapper.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletResponseWrapper.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletResponseWrapper.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.wrappers;
+
+import javax.portlet.PortletResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.ResourceURL;
+import javax.servlet.http.Cookie;
+
+import org.w3c.dom.Element;
+
+public class PortletResponseWrapper
+ extends javax.servlet.http.HttpServletResponseWrapper
+ implements PortletResponse {
+
+ /**
+ * Creates a ServletResponse adaptor wrapping the given response object.
+ * @throws java.lang.IllegalArgumentException
+ * if the response is null.
+ */
+ public PortletResponseWrapper(PortletResponse portletResponse) {
+ super((javax.servlet.http.HttpServletResponse) portletResponse);
+
+ if (portletResponse == null) {
+ throw new IllegalArgumentException("Response cannot be null");
+ }
+ }
+
+ // javax.portlet.PortletResponse implementation ------------------------------------------------
+ public void addProperty(String key, String value) {
+ this.getPortletResponse().addProperty(key, value);
+ }
+
+ public void addProperty(Cookie cookie){
+ this.getPortletResponse().addProperty(cookie);
+ }
+
+ public void setProperty(String key, String value) {
+ this.getPortletResponse().setProperty(key, value);
+ }
+
+ public String encodeURL(String path) {
+ return this.getPortletResponse().encodeURL(path);
+ }
+
+ // FIXME: can we delete this function?
+// public void addProperty(String arg0, String arg1, int arg2) {
+// this.getPortletResponse().addProperty(arg0, arg1, arg2);
+// }
+
+ public PortletURL createActionURL() {
+ return this.getPortletResponse().createActionURL();
+ }
+
+ public PortletURL createRenderURL() {
+ return this.getPortletResponse().createRenderURL();
+ }
+
+ public ResourceURL createResourceURL() {
+ return this.getPortletResponse().createResourceURL();
+ }
+
+ public String getNamespace() {
+ return this.getPortletResponse().getNamespace();
+ }
+
+ // --------------------------------------------------------------------------------------------
+
+ // additional methods -------------------------------------------------------------------------
+ /**
+ * Return the wrapped ServletResponse object.
+ */
+ public PortletResponse getPortletResponse() {
+ return (PortletResponse) super.getResponse();
+ }
+
+ /**
+ * Sets the response being wrapped.
+ * @throws java.lang.IllegalArgumentException
+ * if the response is null.
+ */
+ public void setResponse(PortletResponse response) {
+ if (response == null) {
+ throw new IllegalArgumentException("Response cannot be null");
+ }
+ setResponse((javax.servlet.http.HttpServletResponse) response);
+ }
+
+ public void addProperty(String key, Element element) {
+ // TODO Auto-generated method stub
+
+ }
+}
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderRequestWrapper.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderRequestWrapper.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderRequestWrapper.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.wrappers;
+
+import javax.portlet.RenderRequest;
+
+public class RenderRequestWrapper extends PortletRequestWrapper
+ implements RenderRequest {
+
+ /**
+ * Creates a ServletRequest adaptor wrapping the given request object.
+ * @throws java.lang.IllegalArgumentException
+ * if the request is null.
+ */
+ public RenderRequestWrapper(RenderRequest renderRequest) {
+ super(renderRequest);
+
+ if (renderRequest == null) {
+ throw new IllegalArgumentException("Request cannot be null");
+ }
+ }
+
+ // javax.portlet.RenderRequest implementation -------------------------------------------------
+
+ /**
+ * Returns an implementation of JSR-286 <code>ETag</code>.
+ *
+ * @since 2.0
+ */
+ public String getETag() {
+ return getRenderRequest().getETag();
+ }
+
+ // --------------------------------------------------------------------------------------------
+
+ // additional methods -------------------------------------------------------------------------
+ /**
+ * Return the wrapped ServletRequest object.
+ */
+ public RenderRequest getRenderRequest() {
+ return (RenderRequest) getPortletRequest();
+ }
+
+ // --------------------------------------------------------------------------------------------
+}
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderResponseWrapper.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderResponseWrapper.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderResponseWrapper.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.wrappers;
+
+import javax.portlet.CacheControl;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderResponse;
+import javax.servlet.http.Cookie;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Collection;
+import java.util.Enumeration;
+
+public class RenderResponseWrapper extends PortletResponseWrapper
+ implements RenderResponse {
+ /**
+ * Creates a ServletResponse adaptor wrapping the given response object.
+ * @throws java.lang.IllegalArgumentException
+ * if the response is null.
+ */
+ public RenderResponseWrapper(RenderResponse renderResponse) {
+ super(renderResponse);
+
+ if (renderResponse == null) {
+ throw new IllegalArgumentException("Response cannot be null");
+ }
+ }
+
+ // javax.portlet.RenderResponse implementation ------------------------------------------------
+ public String getContentType() {
+ return this.getRenderResponse().getContentType();
+ }
+
+ public PortletURL createRenderURL() {
+ return this.getRenderResponse().createRenderURL();
+ }
+
+ public PortletURL createActionURL() {
+ return this.getRenderResponse().createActionURL();
+ }
+
+ public String getNamespace() {
+ return this.getRenderResponse().getNamespace();
+ }
+
+ public void setTitle(String title) {
+ this.getRenderResponse().setTitle(title);
+ }
+
+ public void setContentType(String type) {
+ this.getRenderResponse().setContentType(type);
+ }
+
+ public String getCharacterEncoding() {
+ return this.getRenderResponse().getCharacterEncoding();
+ }
+
+ public java.io.PrintWriter getWriter() throws java.io.IOException {
+ return this.getRenderResponse().getWriter();
+ }
+
+ public java.util.Locale getLocale() {
+ return this.getRenderResponse().getLocale();
+ }
+
+ public void setBufferSize(int size) {
+ this.getRenderResponse().setBufferSize(size);
+ }
+
+ public int getBufferSize() {
+ return this.getRenderResponse().getBufferSize();
+ }
+
+ public void flushBuffer() throws java.io.IOException {
+ this.getRenderResponse().flushBuffer();
+ }
+
+ public void resetBuffer() {
+ this.getRenderResponse().resetBuffer();
+ }
+
+ public boolean isCommitted() {
+ return this.getRenderResponse().isCommitted();
+ }
+
+ public void reset() {
+ this.getRenderResponse().reset();
+ }
+
+ public OutputStream getPortletOutputStream() throws IOException {
+ return this.getRenderResponse().getPortletOutputStream();
+ }
+ // --------------------------------------------------------------------------------------------
+
+ /**
+ * Returns an implementation of JSR-286 <code>CacheContol</code>.
+ *
+ * @since 2.0
+ */
+ public CacheControl getCacheControl() {
+ return this.getRenderResponse().getCacheControl();
+ }
+
+ // additional methods -------------------------------------------------------------------------
+ /**
+ * Return the wrapped ServletResponse object.
+ */
+ public RenderResponse getRenderResponse() {
+ return (RenderResponse) getPortletResponse();
+ }
+ // --------------------------------------------------------------------------------------------
+
+ public void addProperty(Cookie cookie) {
+ this.getRenderResponse().addProperty(cookie);
+ }
+
+ public void setNextPossiblePortletModes(Collection<PortletMode> portletModes) {
+ // TODO Auto-generated method stub
+ this.getRenderResponse().setNextPossiblePortletModes(portletModes);
+ }
+}
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/LocalStrings.properties
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/LocalStrings.properties?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/LocalStrings.properties (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/LocalStrings.properties Sat Aug 4 07:41:23 2007
@@ -0,0 +1,34 @@
+#
+# Copyright 2005 The Apache Software Foundation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+
+pluto.container.init=Unable to initialize portlet container {0}
+
+error.load.portlet.xml=Unable to load portlet.xml for context {0} {1}
+
+error.context.descriptor.load=An error occured while loading the context descriptor {0}
+
+####################################
+## Portlet Invocation ##
+####################################
+
+error.portlet.invoker=Unable to successfully invoke portlet. Error during processing.
+error.portlet.invoker.dispatcher=Unable to locate request dispatcher for context {0} and portlet {1}.
+error.portlet.invoker.unavailable=Unable to invoke portlet. Resource {0} unavailable for {1} seconds.
+
+error.config.context.null=Error creating portlet invoker for portlet {0}. Unable to locate context {1}. Check your portlet configuration and ensure cross context dispatching is enabled.
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/impl/LocalStrings.properties
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/impl/LocalStrings.properties?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/impl/LocalStrings.properties (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/impl/LocalStrings.properties Sat Aug 4 07:41:23 2007
@@ -0,0 +1,50 @@
+#
+# Copyright 2005 The Apache Software Foundation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+
+## PortletModeException caused by Portal
+javax.portlet.PortletModeException.portlet=Portlet mode '{0}' is not supported by the portal.
+
+## PortletModeException caused by Portlet
+javax.portlet.PortletModeException.portal=Portlet mode '{0}' is not supported by the portlet.
+
+## PortletModeException caused by null mode
+javax.portlet.PortletModeException.null=Portlet mode may not be null.
+
+
+############################################
+# Error Messages:
+#
+############################################
+
+error.null={0} may not be null
+## Replace the following with the above
+error.contenttype.null=Content Type Not Set
+error.attributeName.null=Attribute Name may not be null.
+error.propertyName.null=Property Name may not be null.
+
+error.session.illegalState=Session may not be retrieved before cross context portlet invocation.
+error.preference.readonly=Preference {0} may not be modified. It is marked as read only.
+
+############################################
+# Warning Messages:
+#
+############################################
+
+warning.resourcebundle.notfound=Unable to locate Resource Bundle {0}: {1}
+
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/pluto-configuration.properties
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/pluto-configuration.properties?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/pluto-configuration.properties (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/core/pluto-configuration.properties Sat Aug 4 07:41:23 2007
@@ -0,0 +1,25 @@
+#
+# Copyright 2005 The Apache Software Foundation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+
+org.apache.pluto.descriptors.services.PortletAppDescriptorService=org.apache.pluto.descriptors.services.jaxb.PortletAppDescriptorServiceImpl
+
+######################################################################
+# if you want to use castor for xml binding use the following instead
+# (Note: its not possible to use QNames, because Castor doesn't support this)
+######################################################################
+#org.apache.pluto.descriptors.services.PortletAppDescriptorService=org.apache.pluto.descriptors.services.castor.PortletAppDescriptorServiceImpl
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/environment.properties
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/environment.properties?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/environment.properties (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/environment.properties Sat Aug 4 07:41:23 2007
@@ -0,0 +1,25 @@
+#
+# Copyright 2005 The Apache Software Foundation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+
+pluto.container.name=Pluto
+pluto.container.version.major=1
+pluto.container.version.minor=1.0-286-SNAPSHOT
+
+javax.portlet.version.major=2
+javax.portlet.version.minor=0
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/internal/LocalStrings.properties
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/internal/LocalStrings.properties?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/internal/LocalStrings.properties (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/internal/LocalStrings.properties Sat Aug 4 07:41:23 2007
@@ -0,0 +1,20 @@
+#
+# Copyright 2006 The Apache Software Foundation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+
+error.context.descriptor.load=Error loading context: {0}
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/internal/impl/LocalStrings.properties
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/internal/impl/LocalStrings.properties?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/internal/impl/LocalStrings.properties (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/main/resources/org/apache/pluto/internal/impl/LocalStrings.properties Sat Aug 4 07:41:23 2007
@@ -0,0 +1,34 @@
+#
+# Copyright 2006 The Apache Software Foundation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+javax.portlet.PortletModeException.null=PortletMode is null
+
+javax.portlet.PortletModeException.portlet=PortletMode is not allowed by portlet: {0}
+
+javax.portlet.PortletModeException.portal=PortletMode not supported by portal: {0}
+
+warning.resourcebundle.notfound=Resource not found: {0}
+
+error.null=Null object: {0}
+
+error.session.illegalState=Session is in an illegal state
+
+error.config.context.null=Error creating portlet invoker for portlet {0}. Unable to locate context {1}. Check your portlet configuration and ensure cross context dispatching is enabled.
+
+error.contenttype.null=Null content-type
+
+error.preference.readonly=Read-only preference: {0}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/site.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/site.xml?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/site.xml (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/site.xml Sat Aug 4 07:41:23 2007
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2004 The Apache Software Foundation
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<project name="Pluto Portlet Container">
+
+ <bannerLeft>
+ <name>Pluto</name>
+ <src>http://portals.apache.org/pluto/images/pluto.png</src>
+ <href>http://portals.apache.org/pluto</href>
+ </bannerLeft>
+ <bannerRight>
+ <src>http://portals.apache.org/pluto/images/banner.png</src>
+ </bannerRight>
+
+ <body>
+
+ <links>
+ <item name="Pluto Home" href="http://portals.apache.org/pluto/"/>
+ <item name="JSR 168" href="http://jcp.org/en/jsr/detail?id=168"/>
+ <item name="JSR 286" href="http://jcp.org/en/jsr/detail?id=286"/>
+ <item name="Chinese Translation" href="http://people.apache.org/~zheng/pluto/chinese/"/>
+ </links>
+
+ <menu name="Portlet Container">
+ <item name="Getting Started" href="/getting-started.html"/>
+ <item name="Embedding Pluto" href="/embed.html"/>
+ </menu>
+
+ ${reports}
+
+ </body>
+
+</project>
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/xdoc/embed.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/xdoc/embed.xml?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/xdoc/embed.xml (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/xdoc/embed.xml Sat Aug 4 07:41:23 2007
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2004 The Apache Software Foundation
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<document>
+
+ <properties>
+ <title>Embedding the Pluto Container</title>
+ <author email="ddewolf@apache.org">David DeWolf</author>
+ </properties>
+
+ <body>
+
+ <section name="Embedding the Pluto Container">
+
+ <p>
+ This document is currently <b>very</b> breif. Please feel free to submit
+ patches.
+ </p>
+
+ <subsection name="Steps for Embedding Pluto">
+ <p>
+ <b>Step 1:</b> Implement <code>org.apache.pluto.PortletContainerServices</code>
+ </p>
+ <p>
+ <b>Step 2:</b> Manage the Portlet Container Lifecycle:
+ <ul>
+ <li>
+ Create an instance of the container:
+ <source><![CDATA[
+//
+// Step 1) Create and instance of the PortletContainerService
+//
+PortletContainerServices impl = . . .
+
+//
+// Step 2) Request a new container from the container factory
+//
+PortletContainerFactory factory =
+ PortletContainerFactory.getInstance();
+
+PortletContainer container = factory.createContainer(
+ "My Container Name", impl
+);
+
+//
+// Step 3) Initialize the Container with the embedding
+// application's ServletContext
+//
+container.init(ctx);
+ ]]></source>
+ </li>
+ <li>Destroy the Container during Shutdown.</li>
+ </ul>
+ </p>
+ <p>
+ <b>Step 3:</b> Invoke the Container as necessary:
+ <source><![CDATA[
+// Load a portlet
+container.doLoad(portletWindow, request, response);
+// Process a Portlet Action
+container.doAction(portletWindow, request, response);
+// Render a portlet
+container.doRender(portletWindow, request, response);
+ ]]></source>
+ </p>
+
+ </subsection>
+
+ </section>
+
+ </body>
+
+</document>
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/xdoc/getting-started.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/xdoc/getting-started.xml?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/xdoc/getting-started.xml (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-container/src/site/xdoc/getting-started.xml Sat Aug 4 07:41:23 2007
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2004 The Apache Software Foundation
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<document>
+
+ <properties>
+ <title>Getting Started</title>
+ <author email="ddewolf@apache.org">David DeWolf</author>
+ </properties>
+
+ <body>
+
+ <section name="Getting Started">
+ <p>
+ The Pluto Portlet Container is not designed for use by end users. The
+ container is meant to be embeded within portal and web applications to
+ provide Java Portlet Specification compliance. If you are a user looking
+ to develop, test, or deploy portlets, please see the
+ <a href="../pluto-portal-driver/index.html">Pluto Portal Driver</a>.
+ </p>
+ <p>
+ If you are looking for information on how to embed pluto in your portal
+ or web application, please see the <a href="embed.html">embedding pluto</a>
+ documentation for Pluto 1.1.
+ </p>
+ </section>
+
+ </body>
+
+</document>
+