Author: julien(a)jboss.com
Date: 2007-03-15 18:36:31 -0400 (Thu, 15 Mar 2007)
New Revision: 6704
Added:
trunk/common/src/main/org/jboss/portal/common/util/ContentInfo.java
trunk/common/src/main/org/jboss/portal/common/util/MarkupInfo.java
trunk/common/src/main/org/jboss/portal/common/util/MediaType.java
Removed:
trunk/common/src/main/org/jboss/portal/common/MediaType.java
trunk/server/src/main/org/jboss/portal/common/http/HTTPStreamInfo.java
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
trunk/core/src/main/org/jboss/portal/core/portlet/login/LoginPortlet.java
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFActionContext.java
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFRenderContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/PortletInvocationContextSupport.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/server/src/main/org/jboss/portal/server/ServerRequest.java
trunk/server/src/main/org/jboss/portal/server/ServerResponse.java
trunk/server/src/main/org/jboss/portal/server/aspects/server/ContentTypeInterceptor.java
trunk/theme/src/main/org/jboss/portal/test/theme/TestLayoutServiceImpl.java
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestLayoutStrategySetMetaData.java
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestRenderSetMetaData.java
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRenderedMarkup.java
trunk/theme/src/main/org/jboss/portal/test/theme/servlet/TestThemeServlet.java
trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java
trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutStategyMetaDataFactory.java
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetMetaDataFactory.java
trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java
trunk/theme/src/main/org/jboss/portal/theme/metadata/LayoutStrategyMetaData.java
trunk/theme/src/main/org/jboss/portal/theme/metadata/RendererSetMetaData.java
trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java
trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/strategy/LayoutStrategy.java
trunk/theme/src/main/org/jboss/portal/theme/strategy/StrategyContext.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPResourceURL.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRenderContext.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
Log:
- moved HTTPStreamInfo to common package
- renamed HTTPStreamInfo -> MarkupInfo
- added a superclass to MarkupInfo which is ContentInfo whichs holds the content type.
MarkupInfo extends it and add a charset field
Deleted: trunk/common/src/main/org/jboss/portal/common/MediaType.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/MediaType.java 2007-03-15 21:51:04 UTC
(rev 6703)
+++ trunk/common/src/main/org/jboss/portal/common/MediaType.java 2007-03-15 22:36:31 UTC
(rev 6704)
@@ -1,342 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.common;
-
-import javax.activation.MimeType;
-import javax.activation.MimeTypeParseException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * This is a immutable wrapper to the activation MimeTpye.
- * <p>This class contains some extensions to the activation MimeType, such as the
typesafe enum
- * pattern, and allows for a mime type to specify allowed sub types.</p>
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $LastChangedRevision$, $LastChangedDate$
- * @see javax.activation.MimeType
- * see also
ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/
- */
-public final class MediaType
-{
- private static Map allowedTypes = new HashMap();
- private static Map supportedExtensions = new HashMap();
-
- /**
- * Mime type 'Any' maps to an accept mime type of '*.*' (used by IE
for css, images, etc.)
- */
- public static final MediaType ANY =
- new MediaType("*", "*", new String[]{});
-
- /**
- * Mime type xhtml
- */
- public static final MediaType XHTML = new MediaType("application",
"xhtml+xml",
- new String[]{"xhtml"});
-
- /**
- * Mime type html
- */
- public static final MediaType HTML = new MediaType("text",
"html",
- new String[]{"html", "htm"},
- new MediaType[]{XHTML});
-
- /**
- * Mime type form (application/x-www-form-urlencoded)
- */
- public static final MediaType FORM =
- new MediaType("application", "x-www-form-urlencoded", new
String[]{});
-
- /**
- * Mime type xml
- */
- public static final MediaType XML = new MediaType("text", "xml",
new String[]{"xml"},
- new MediaType[]{XHTML});
-
- /**
- * Mime type wml
- */
- public static final MediaType WML = new MediaType("text",
"vnd.wap.wml",
- new String[]{"wml"});
-
- /**
- * Mime type css
- */
- public static final MediaType CSS = new MediaType("text", "css",
- new String[]{"css"});
-
- /**
- * Mime type text
- */
- public static final MediaType TEXT = new MediaType("text",
"plain",
- new String[]{"txt"});
-
- /**
- * Mime type js
- */
- public static final MediaType JS = new MediaType("text",
"javascript",
- new String[]{"js"});
-
- /**
- * Mime type svg
- */
- public static final MediaType SVG = new MediaType("image",
"svg+xml",
- new String[]{"svg"});
-
- /**
- * Mime type jpeg
- */
- public static final MediaType JPEG = new MediaType("image",
"jpeg",
- new String[]{"jpeg", "jpg"});
-
- /**
- * Mime type gif
- */
- public static final MediaType GIF = new MediaType("image", "gif",
- new String[]{"gif"});
-
- /**
- * Mime type png
- */
- public static final MediaType PNG = new MediaType("image", "png",
- new String[]{"png"});
-
- /**
- * Mime type wbmp
- */
- public static final MediaType WBMP = new MediaType("image",
"vnd.wap.wbmp",
- new String[]{"wbpm"});
-
- /**
- * Mime type rss
- */
- public static final MediaType RSS = new MediaType("application",
"rss+xml",
- new String[]{});
-
- /**
- * Mime type ico (see
http://filext.com/detaillist.php?extdetail=ICO)
- */
- public static final MediaType ICO = new MediaType("application",
"octet-stream",
- new String[]{"ico"});
- private MimeType m_mimeType = null;
- private MediaType[] m_allowedSubTypes;
- private Set allowSubTypeSet;
-
- /**
- * Construct a mime type instance without any allowed subtypes.
- *
- * @param primaryType the primary type of the mime type (i.e. 'text')
- * @param subType the sub type of the mime type (i.e. 'html')
- */
- private MediaType(String primaryType, String subType, String[] extensions)
- {
- try
- {
- m_mimeType = new MimeType(primaryType, subType);
- m_allowedSubTypes = null;
- allowSubTypeSet = null;
- allowedTypes.put(m_mimeType.getBaseType(), this);
- for (int i = 0; i < extensions.length; i++)
- {
- supportedExtensions.put(extensions[i], this);
- }
- }
- catch (MimeTypeParseException e)
- {
- // +++TODO handle this , but where ?
- System.out.println(e.getMessage());
- }
- }
-
- /**
- * Construct a mime type with the provided allowed subtypes.
- *
- * @param primaryType the primary type of the mime type (i.e. 'text')
- * @param subType the sub type of the mime type (i.e. 'html')
- * @param allowedSubTypes an array of <code>MediaType</code>s to allow as
valid subtypes of this type
- */
- private MediaType(String primaryType, String subType, String[] extensions, MediaType[]
allowedSubTypes)
- {
- this(primaryType, subType, extensions);
- // only if the mime type was sucessfully created
- if (m_mimeType != null)
- {
- m_allowedSubTypes = allowedSubTypes;
- allowSubTypeSet = new HashSet(Arrays.asList(allowedSubTypes));
- }
- }
-
- /**
- * Get the mime type for the presented string, if the string contains a valid mime
type.
- *
- * @param mimeType the <code>java.lang.String</code> to parse into a
<code>RegistryMimeTpye</code>
- * @return the <code>RegistryMimeTpye</code> that matches with the
presented string
- * @throws MimeTypeParseException if the presented mimetype is not supported
- * @throws IllegalArgumentException if the presented string is null or empty
- */
- public static MediaType parseMimeType(String mimeType) throws MimeTypeParseException
- {
- if (mimeType == null || "".equals(mimeType))
- {
- throw new IllegalArgumentException("no valid mime type provided");
- }
-
- String type = mimeType.trim().toLowerCase();
- if (allowedTypes.keySet().contains(type))
- {
- return (MediaType)allowedTypes.get(type);
- }
-
- throw new MimeTypeParseException("Type [" + mimeType + "] not
supported");
- }
-
- /**
- * Get the mime type for the presented string.
- * <p>The string is handles as a file name extension. example: 'xml'
returns MediaType.XML</p>
- *
- * @param extension the <code>java.lang.String</code> to parse into a
<code>RegistryMimeTpye</code>
- * @return the <code>RegistryMimeTpye</code> that matches with the
presented string
- * @throws MimeTypeParseException if the presented mimetype is not supported
- * @throws IllegalArgumentException if the presented string is null or empty
- */
- public static MediaType parseMimeTypeByExtension(String extension)
- throws MimeTypeParseException
- {
- if (extension == null || "".equals(extension))
- {
- throw new IllegalArgumentException("no valid mime type provided [" +
extension + "]");
- }
-
- String ext = extension.trim().toLowerCase();
- if (supportedExtensions.keySet().contains(ext))
- {
- return (MediaType)supportedExtensions.get(ext);
- }
-
- throw new MimeTypeParseException("Extension [" + extension + "] not
supported");
- }
-
- /**
- * Get a list of allowed sub types for the passed mime type.
- *
- * @param mimeType the <code>RegistryMimeTpye</code> to get the list of
allowed subtypes for
- * @return a <code>java.util.List</code> of
<code>PortalMimeTpye</code>s
- */
- public static List getAllowedSubTypes(MediaType mimeType)
- {
- if (mimeType.m_allowedSubTypes == null)
- {
- return Collections.EMPTY_LIST;
- }
- else
- {
- return Collections.unmodifiableList(Arrays.asList(mimeType.m_allowedSubTypes));
- }
- }
-
- /**
- * Get a list of allowed sub types for for this mime type.
- *
- * @return a <code>java.util.List</code> of
<code>RegistryMimeTpye</code>s
- */
- public List getAllowedSubTypes()
- {
- if (m_allowedSubTypes == null)
- {
- return Collections.EMPTY_LIST;
- }
- else
- {
- return Collections.unmodifiableList(Arrays.asList(m_allowedSubTypes));
- }
- }
-
- /**
- * Return true if the allowed sub types contains the specified media type.
- *
- * @param other the sub type to test
- * @return true if it is an allowed sub type
- */
- public boolean isAllowedSubType(MediaType other)
- {
- if (equals(other))
- {
- return true;
- }
- if (allowSubTypeSet == null)
- {
- return false;
- }
- return allowSubTypeSet.contains(other);
- }
-
- /**
- * Get the String representation of the mime type (i.e. 'text/html').
- *
- * @return the mime type as a <code>java.lang.String</code>
- * @see java.lang.Object#toString
- */
- public String toString()
- {
- return m_mimeType.getBaseType();
- }
-
- /**
- * compare the parameter with this instance and see if they are equals.
- *
- * @param o the Object to compare this instance to
- * @return true if this and the paramters o are equal
- * @see java.lang.Object#equals
- */
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (!(o instanceof MediaType))
- {
- return false;
- }
-
- final MediaType type = (MediaType)o;
-
- return m_mimeType.equals(type.m_mimeType);
- }
-
- /**
- * Get the hascode for this mime type.
- *
- * @return an int value representing this instance
- * @see java.lang.Object#hashCode
- */
- public int hashCode()
- {
- return m_mimeType.hashCode();
- }
-}
Copied: trunk/common/src/main/org/jboss/portal/common/util/ContentInfo.java (from rev
6701, trunk/server/src/main/org/jboss/portal/common/http/HTTPStreamInfo.java)
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/ContentInfo.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/util/ContentInfo.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.util;
+
+/**
+ * Describe how content should be interpreted.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ContentInfo
+{
+
+ /** The content type. */
+ private final MediaType contentType;
+
+ public ContentInfo(MediaType contentType)
+ {
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("Content type cannot be null");
+ }
+ this.contentType = contentType;
+ }
+
+ public MediaType getContentType()
+ {
+ return contentType;
+ }
+}
Property changes on: trunk/common/src/main/org/jboss/portal/common/util/ContentInfo.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/common/src/main/org/jboss/portal/common/util/MarkupInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/MarkupInfo.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/util/MarkupInfo.java 2007-03-15 22:36:31
UTC (rev 6704)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.util;
+
+/**
+ * Extends content to describe markup content.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MarkupInfo extends ContentInfo
+{
+
+ /** The charset. */
+ private final String charset;
+
+ public MarkupInfo(MediaType contentType, String charset)
+ {
+ super(contentType);
+
+ //
+ if (charset == null)
+ {
+ throw new IllegalArgumentException("Charset cannot be null");
+ }
+
+ //
+ this.charset = charset;
+ }
+
+ public String getCharset()
+ {
+ return charset;
+ }
+}
Copied: trunk/common/src/main/org/jboss/portal/common/util/MediaType.java (from rev 6701,
trunk/common/src/main/org/jboss/portal/common/MediaType.java)
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/MediaType.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/util/MediaType.java 2007-03-15 22:36:31
UTC (rev 6704)
@@ -0,0 +1,342 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.util;
+
+import javax.activation.MimeType;
+import javax.activation.MimeTypeParseException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This is a immutable wrapper to the activation MimeTpye.
+ * <p>This class contains some extensions to the activation MimeType, such as the
typesafe enum
+ * pattern, and allows for a mime type to specify allowed sub types.</p>
+ *
+ * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
+ * @version $LastChangedRevision$, $LastChangedDate$
+ * @see javax.activation.MimeType
+ * see also
ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/
+ */
+public final class MediaType
+{
+ private static Map allowedTypes = new HashMap();
+ private static Map supportedExtensions = new HashMap();
+
+ /**
+ * Mime type 'Any' maps to an accept mime type of '*.*' (used by IE
for css, images, etc.)
+ */
+ public static final MediaType ANY =
+ new MediaType("*", "*", new String[]{});
+
+ /**
+ * Mime type xhtml
+ */
+ public static final MediaType XHTML = new MediaType("application",
"xhtml+xml",
+ new String[]{"xhtml"});
+
+ /**
+ * Mime type html
+ */
+ public static final MediaType HTML = new MediaType("text",
"html",
+ new String[]{"html", "htm"},
+ new MediaType[]{XHTML});
+
+ /**
+ * Mime type form (application/x-www-form-urlencoded)
+ */
+ public static final MediaType FORM =
+ new MediaType("application", "x-www-form-urlencoded", new
String[]{});
+
+ /**
+ * Mime type xml
+ */
+ public static final MediaType XML = new MediaType("text", "xml",
new String[]{"xml"},
+ new MediaType[]{XHTML});
+
+ /**
+ * Mime type wml
+ */
+ public static final MediaType WML = new MediaType("text",
"vnd.wap.wml",
+ new String[]{"wml"});
+
+ /**
+ * Mime type css
+ */
+ public static final MediaType CSS = new MediaType("text", "css",
+ new String[]{"css"});
+
+ /**
+ * Mime type text
+ */
+ public static final MediaType TEXT = new MediaType("text",
"plain",
+ new String[]{"txt"});
+
+ /**
+ * Mime type js
+ */
+ public static final MediaType JS = new MediaType("text",
"javascript",
+ new String[]{"js"});
+
+ /**
+ * Mime type svg
+ */
+ public static final MediaType SVG = new MediaType("image",
"svg+xml",
+ new String[]{"svg"});
+
+ /**
+ * Mime type jpeg
+ */
+ public static final MediaType JPEG = new MediaType("image",
"jpeg",
+ new String[]{"jpeg", "jpg"});
+
+ /**
+ * Mime type gif
+ */
+ public static final MediaType GIF = new MediaType("image", "gif",
+ new String[]{"gif"});
+
+ /**
+ * Mime type png
+ */
+ public static final MediaType PNG = new MediaType("image", "png",
+ new String[]{"png"});
+
+ /**
+ * Mime type wbmp
+ */
+ public static final MediaType WBMP = new MediaType("image",
"vnd.wap.wbmp",
+ new String[]{"wbpm"});
+
+ /**
+ * Mime type rss
+ */
+ public static final MediaType RSS = new MediaType("application",
"rss+xml",
+ new String[]{});
+
+ /**
+ * Mime type ico (see
http://filext.com/detaillist.php?extdetail=ICO)
+ */
+ public static final MediaType ICO = new MediaType("application",
"octet-stream",
+ new String[]{"ico"});
+ private MimeType m_mimeType = null;
+ private MediaType[] m_allowedSubTypes;
+ private Set allowSubTypeSet;
+
+ /**
+ * Construct a mime type instance without any allowed subtypes.
+ *
+ * @param primaryType the primary type of the mime type (i.e. 'text')
+ * @param subType the sub type of the mime type (i.e. 'html')
+ */
+ private MediaType(String primaryType, String subType, String[] extensions)
+ {
+ try
+ {
+ m_mimeType = new MimeType(primaryType, subType);
+ m_allowedSubTypes = null;
+ allowSubTypeSet = null;
+ allowedTypes.put(m_mimeType.getBaseType(), this);
+ for (int i = 0; i < extensions.length; i++)
+ {
+ supportedExtensions.put(extensions[i], this);
+ }
+ }
+ catch (MimeTypeParseException e)
+ {
+ // +++TODO handle this , but where ?
+ System.out.println(e.getMessage());
+ }
+ }
+
+ /**
+ * Construct a mime type with the provided allowed subtypes.
+ *
+ * @param primaryType the primary type of the mime type (i.e. 'text')
+ * @param subType the sub type of the mime type (i.e. 'html')
+ * @param allowedSubTypes an array of <code>MediaType</code>s to allow as
valid subtypes of this type
+ */
+ private MediaType(String primaryType, String subType, String[] extensions, MediaType[]
allowedSubTypes)
+ {
+ this(primaryType, subType, extensions);
+ // only if the mime type was sucessfully created
+ if (m_mimeType != null)
+ {
+ m_allowedSubTypes = allowedSubTypes;
+ allowSubTypeSet = new HashSet(Arrays.asList(allowedSubTypes));
+ }
+ }
+
+ /**
+ * Get the mime type for the presented string, if the string contains a valid mime
type.
+ *
+ * @param mimeType the <code>java.lang.String</code> to parse into a
<code>RegistryMimeTpye</code>
+ * @return the <code>RegistryMimeTpye</code> that matches with the
presented string
+ * @throws MimeTypeParseException if the presented mimetype is not supported
+ * @throws IllegalArgumentException if the presented string is null or empty
+ */
+ public static MediaType parseMimeType(String mimeType) throws MimeTypeParseException
+ {
+ if (mimeType == null || "".equals(mimeType))
+ {
+ throw new IllegalArgumentException("no valid mime type provided");
+ }
+
+ String type = mimeType.trim().toLowerCase();
+ if (allowedTypes.keySet().contains(type))
+ {
+ return (MediaType)allowedTypes.get(type);
+ }
+
+ throw new MimeTypeParseException("Type [" + mimeType + "] not
supported");
+ }
+
+ /**
+ * Get the mime type for the presented string.
+ * <p>The string is handles as a file name extension. example: 'xml'
returns MediaType.XML</p>
+ *
+ * @param extension the <code>java.lang.String</code> to parse into a
<code>RegistryMimeTpye</code>
+ * @return the <code>RegistryMimeTpye</code> that matches with the
presented string
+ * @throws MimeTypeParseException if the presented mimetype is not supported
+ * @throws IllegalArgumentException if the presented string is null or empty
+ */
+ public static MediaType parseMimeTypeByExtension(String extension)
+ throws MimeTypeParseException
+ {
+ if (extension == null || "".equals(extension))
+ {
+ throw new IllegalArgumentException("no valid mime type provided [" +
extension + "]");
+ }
+
+ String ext = extension.trim().toLowerCase();
+ if (supportedExtensions.keySet().contains(ext))
+ {
+ return (MediaType)supportedExtensions.get(ext);
+ }
+
+ throw new MimeTypeParseException("Extension [" + extension + "] not
supported");
+ }
+
+ /**
+ * Get a list of allowed sub types for the passed mime type.
+ *
+ * @param mimeType the <code>RegistryMimeTpye</code> to get the list of
allowed subtypes for
+ * @return a <code>java.util.List</code> of
<code>PortalMimeTpye</code>s
+ */
+ public static List getAllowedSubTypes(MediaType mimeType)
+ {
+ if (mimeType.m_allowedSubTypes == null)
+ {
+ return Collections.EMPTY_LIST;
+ }
+ else
+ {
+ return Collections.unmodifiableList(Arrays.asList(mimeType.m_allowedSubTypes));
+ }
+ }
+
+ /**
+ * Get a list of allowed sub types for for this mime type.
+ *
+ * @return a <code>java.util.List</code> of
<code>RegistryMimeTpye</code>s
+ */
+ public List getAllowedSubTypes()
+ {
+ if (m_allowedSubTypes == null)
+ {
+ return Collections.EMPTY_LIST;
+ }
+ else
+ {
+ return Collections.unmodifiableList(Arrays.asList(m_allowedSubTypes));
+ }
+ }
+
+ /**
+ * Return true if the allowed sub types contains the specified media type.
+ *
+ * @param other the sub type to test
+ * @return true if it is an allowed sub type
+ */
+ public boolean isAllowedSubType(MediaType other)
+ {
+ if (equals(other))
+ {
+ return true;
+ }
+ if (allowSubTypeSet == null)
+ {
+ return false;
+ }
+ return allowSubTypeSet.contains(other);
+ }
+
+ /**
+ * Get the String representation of the mime type (i.e. 'text/html').
+ *
+ * @return the mime type as a <code>java.lang.String</code>
+ * @see java.lang.Object#toString
+ */
+ public String toString()
+ {
+ return m_mimeType.getBaseType();
+ }
+
+ /**
+ * compare the parameter with this instance and see if they are equals.
+ *
+ * @param o the Object to compare this instance to
+ * @return true if this and the paramters o are equal
+ * @see java.lang.Object#equals
+ */
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (!(o instanceof MediaType))
+ {
+ return false;
+ }
+
+ final MediaType type = (MediaType)o;
+
+ return m_mimeType.equals(type.m_mimeType);
+ }
+
+ /**
+ * Get the hascode for this mime type.
+ *
+ * @return an int value representing this instance
+ * @see java.lang.Object#hashCode
+ */
+ public int hashCode()
+ {
+ return m_mimeType.hashCode();
+ }
+}
Property changes on: trunk/common/src/main/org/jboss/portal/common/util/MediaType.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -43,7 +43,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.server.impl.MapAttributeResolver;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
@@ -97,7 +97,7 @@
PortletContextFactory cf,
InvokePortletCommandFactory cpc)
{
- HTTPStreamInfo streamInfo =
controllerContext.getServerInvocation().getResponse().getStreamInfo();
+ MarkupInfo markupInfo =
(MarkupInfo)controllerContext.getServerInvocation().getResponse().getContentInfo();
//
ActionContext ctx = new ControllerActionContext(
@@ -105,7 +105,7 @@
controllerContext,
mode, windowState,
navigationalState,
- streamInfo,
+ markupInfo,
interactionState,
form);
@@ -134,7 +134,7 @@
PortletContextFactory cf,
InvokePortletCommandFactory cpc)
{
- HTTPStreamInfo streamInfo =
controllerContext.getServerInvocation().getResponse().getStreamInfo();
+ MarkupInfo markupInfo =
(MarkupInfo)controllerContext.getServerInvocation().getResponse().getContentInfo();
//
RenderContext ctx = new ControllerRenderContext(
@@ -143,7 +143,7 @@
mode,
windowState,
navigationalState,
- streamInfo);
+ markupInfo);
//
RenderInvocation render = new RenderInvocation(ctx);
@@ -166,9 +166,9 @@
{
private InvokePortletCommandFactory cmdFactory;
private ControllerContext controllerContext;
- public ControllerActionContext(InvokePortletCommandFactory cmdFactory,
ControllerContext controllerContext, Mode mode, WindowState windowState, StateString
navigationalState, HTTPStreamInfo streamInfo, StateString interactionState,
PortletParameters form)
+ public ControllerActionContext(InvokePortletCommandFactory cmdFactory,
ControllerContext controllerContext, Mode mode, WindowState windowState, StateString
navigationalState, MarkupInfo markupInfo, StateString interactionState, PortletParameters
form)
{
- super(mode, windowState, navigationalState, streamInfo, interactionState,
form);
+ super(mode, windowState, navigationalState, markupInfo, interactionState,
form);
//
this.cmdFactory = cmdFactory;
@@ -198,9 +198,9 @@
{
private InvokePortletCommandFactory cmdFactory;
private ControllerContext controllerContext;
- public ControllerRenderContext(InvokePortletCommandFactory cmdFactory,
ControllerContext controllerContext, Mode mode, WindowState windowState, StateString
navigationalState, HTTPStreamInfo streamInfo)
+ public ControllerRenderContext(InvokePortletCommandFactory cmdFactory,
ControllerContext controllerContext, Mode mode, WindowState windowState, StateString
navigationalState, MarkupInfo markupInfo)
{
- super(mode, windowState, navigationalState, streamInfo);
+ super(mode, windowState, navigationalState, markupInfo);
//
this.cmdFactory = cmdFactory;
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/login/LoginPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/login/LoginPortlet.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/login/LoginPortlet.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -23,7 +23,7 @@
package org.jboss.portal.core.portlet.login;
import org.apache.log4j.Logger;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portlet.JBossPortlet;
import org.jboss.portlet.JBossRenderRequest;
import org.jboss.portlet.JBossRenderResponse;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -31,7 +31,7 @@
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.common.util.LocalizedString;
import org.jboss.portal.common.util.IteratorStatus;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.info.MetaInfo;
Modified:
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFActionContext.java
===================================================================
---
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFActionContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFActionContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -29,7 +29,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.server.impl.RequestAttributeResolver;
import org.jboss.portal.server.impl.PrincipalAttributeResolver;
import org.jboss.portal.server.impl.MapAttributeResolver;
@@ -51,10 +52,10 @@
Mode mode, WindowState
windowState,
StateString interactionState,
- HTTPStreamInfo streamInfo,
+ MarkupInfo markupInfo,
JSFInvocation invocation)
{
- super(mode, windowState, null, streamInfo, interactionState, null);
+ super(mode, windowState, null, markupInfo, interactionState, null);
//
this.invocation = invocation;
Modified:
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
===================================================================
---
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -42,11 +42,11 @@
import org.jboss.portal.portlet.impl.PortletRequestEncoder;
import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
import org.jboss.portal.common.text.FastURLEncoder;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.bridge.JBossServletContextProvider;
-import org.jboss.portal.common.http.HTTPStreamInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -148,7 +148,7 @@
mode,
windowState,
interactionState,
- new HTTPStreamInfo(MediaType.HTML, "UTF-8"),
+ new MarkupInfo(MediaType.HTML, "UTF-8"),
this);
//
@@ -169,7 +169,7 @@
mode,
windowState,
navState,
- new HTTPStreamInfo(MediaType.HTML, "UTF-8"),
+ new MarkupInfo(MediaType.HTML, "UTF-8"),
this);
//
Modified:
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFRenderContext.java
===================================================================
---
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFRenderContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFRenderContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -30,7 +30,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.server.impl.MapAttributeResolver;
import org.jboss.portal.server.impl.PrincipalAttributeResolver;
import org.jboss.portal.server.impl.RequestAttributeResolver;
@@ -52,10 +52,10 @@
Mode mode, WindowState
windowState,
PortletParameters navState,
- HTTPStreamInfo streamInfo,
+ MarkupInfo markupInfo,
JSFInvocation invocation)
{
- super(mode, windowState, navState != null ? new
PortletParametersStateString(navState) : null, streamInfo);
+ super(mode, windowState, navState != null ? new
PortletParametersStateString(navState) : null, markupInfo);
//
this.invocation = invocation;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -28,7 +28,7 @@
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.ContentInfo;
import java.util.HashSet;
import java.util.Iterator;
@@ -64,7 +64,7 @@
protected Set getModes(PortletInvocation invocation)
{
// Get content type
- HTTPStreamInfo si = invocation.getPortletContext().getStreamInfo();
+ ContentInfo si = invocation.getPortletContext().getMarkupInfo();
String contentType = si.getContentType().toString();
// Get the modes for this content type
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -431,7 +431,7 @@
public String getResponseContentType()
{
- return invocation.getPortletContext().getStreamInfo().getContentType().toString();
+ return invocation.getPortletContext().getMarkupInfo().getContentType().toString();
}
public Enumeration getResponseContentTypes()
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.api;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.ContentInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
-import org.jboss.portal.common.http.HTTPStreamInfo;
import javax.activation.MimeTypeParseException;
import javax.portlet.PortletURL;
@@ -93,7 +93,7 @@
MediaType requestedMediaType = MediaType.parseMimeType(contentType);
// Get the response media type
- HTTPStreamInfo info = invocation.getPortletContext().getStreamInfo();
+ ContentInfo info = invocation.getPortletContext().getMarkupInfo();
MediaType responseMediaType = info.getContentType();
// Check if the requested media type is allowed as a subtype of the main
response
@@ -145,7 +145,7 @@
public String getCharacterEncoding()
{
- return invocation.getPortletContext().getStreamInfo().getCharset();
+ return invocation.getPortletContext().getMarkupInfo().getCharset();
}
public Locale getLocale()
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -27,7 +27,7 @@
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import java.io.BufferedReader;
import java.io.IOException;
@@ -51,11 +51,11 @@
Mode mode,
WindowState windowState,
StateString navigationalState,
- HTTPStreamInfo streamInfo,
+ MarkupInfo markupInfo,
StateString interactionState,
PortletParameters form)
{
- super(mode, windowState, navigationalState, streamInfo);
+ super(mode, windowState, navigationalState, markupInfo);
this.interactionState = interactionState;
this.form = form;
}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -24,7 +24,7 @@
import org.jboss.portal.common.invocation.AbstractInvocationContext;
import org.jboss.portal.common.util.URLTools;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.Mode;
@@ -43,7 +43,7 @@
{
/** . */
- protected HTTPStreamInfo streamInfo;
+ protected MarkupInfo markupInfo;
/** . */
protected Mode mode;
@@ -54,12 +54,12 @@
/** . */
protected StateString navigationalState;
- protected AbstractPortletInvocationContext(Mode mode, WindowState windowState,
StateString navigationalState, HTTPStreamInfo streamInfo)
+ protected AbstractPortletInvocationContext(Mode mode, WindowState windowState,
StateString navigationalState, MarkupInfo markupInfo)
{
this.mode = mode;
this.windowState = windowState;
this.navigationalState = navigationalState;
- this.streamInfo = streamInfo;
+ this.markupInfo = markupInfo;
}
/**
@@ -106,8 +106,8 @@
return navigationalState;
}
- public HTTPStreamInfo getStreamInfo()
+ public MarkupInfo getMarkupInfo()
{
- return streamInfo;
+ return markupInfo;
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -26,7 +26,8 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.common.util.MarkupInfo;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -38,8 +39,8 @@
Mode mode,
WindowState windowState,
StateString navigationalState,
- HTTPStreamInfo streamInfo)
+ MarkupInfo markupInfo)
{
- super(mode, windowState, navigationalState, streamInfo);
+ super(mode, windowState, navigationalState, markupInfo);
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -25,7 +25,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.InvocationContext;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.PortletURL;
import org.jboss.portal.portlet.StateString;
@@ -63,7 +63,7 @@
*
* @return the stream info
*/
- HTTPStreamInfo getStreamInfo();
+ MarkupInfo getMarkupInfo();
/**
* <p>Encodes the specified URL by including the session ID in it, or, if
encoding is not needed, returns the URL
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/PortletInvocationContextSupport.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/PortletInvocationContextSupport.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/PortletInvocationContextSupport.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -25,7 +25,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.AbstractInvocationContext;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.PortletURL;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
@@ -52,7 +52,7 @@
throw new UnsupportedOperationException();
}
- public HTTPStreamInfo getStreamInfo()
+ public MarkupInfo getMarkupInfo()
{
throw new UnsupportedOperationException();
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -28,6 +28,7 @@
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.URLTools;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.portlet.ActionURL;
import org.jboss.portal.portlet.PortletParameters;
@@ -579,7 +580,7 @@
WindowState windowState,
Mode mode)
{
- super(mode, windowState, navigationalState,
invocation.getResponse().getStreamInfo());
+ super(mode, windowState, navigationalState,
(MarkupInfo)invocation.getResponse().getContentInfo());
//
this.portlet = portlet;
Deleted: trunk/server/src/main/org/jboss/portal/common/http/HTTPStreamInfo.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/common/http/HTTPStreamInfo.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/server/src/main/org/jboss/portal/common/http/HTTPStreamInfo.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -1,64 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.common.http;
-
-import org.jboss.portal.common.MediaType;
-
-/**
- * The info about how the content of an HTTP stream should be interpreted.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class HTTPStreamInfo
-{
- /** The content type. */
- private final MediaType contentType;
-
- /** The charset. */
- private final String charset;
-
- public HTTPStreamInfo(MediaType contentType, String charset)
- {
- if (contentType == null)
- {
- throw new IllegalArgumentException("Content type cannot be null");
- }
- if (charset == null)
- {
- throw new IllegalArgumentException("Charset cannot be null");
- }
- this.contentType = contentType;
- this.charset = charset;
- }
-
- public MediaType getContentType()
- {
- return contentType;
- }
-
- public String getCharset()
- {
- return charset;
- }
-}
Modified: trunk/server/src/main/org/jboss/portal/server/ServerRequest.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/ServerRequest.java 2007-03-15 21:51:04
UTC (rev 6703)
+++ trunk/server/src/main/org/jboss/portal/server/ServerRequest.java 2007-03-15 22:36:31
UTC (rev 6704)
@@ -37,6 +37,7 @@
/** The server used during the request. */
protected Server server;
+ /** . */
protected ServerInvocationContext invocationContext;
public ServerRequest(ServerInvocationContext invocationContext)
Modified: trunk/server/src/main/org/jboss/portal/server/ServerResponse.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/ServerResponse.java 2007-03-15 21:51:04
UTC (rev 6703)
+++ trunk/server/src/main/org/jboss/portal/server/ServerResponse.java 2007-03-15 22:36:31
UTC (rev 6704)
@@ -24,7 +24,7 @@
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.ContentInfo;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -40,7 +40,7 @@
protected ServerRequest req;
/** . */
- protected HTTPStreamInfo streamInfo;
+ protected ContentInfo contentInfo;
/** Indicate that the invocation requires a sign out of the current authenticated
user. */
boolean wantSignOut;
@@ -54,14 +54,14 @@
this.invocationCtx = invocationCtx;
}
- public HTTPStreamInfo getStreamInfo()
+ public ContentInfo getContentInfo()
{
- return streamInfo;
+ return contentInfo;
}
- public void setStreamInfo(HTTPStreamInfo streamInfo)
+ public void setContentInfo(ContentInfo contentInfo)
{
- this.streamInfo = streamInfo;
+ this.contentInfo = contentInfo;
}
public boolean getWantSignOut()
Modified:
trunk/server/src/main/org/jboss/portal/server/aspects/server/ContentTypeInterceptor.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/server/aspects/server/ContentTypeInterceptor.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/server/src/main/org/jboss/portal/server/aspects/server/ContentTypeInterceptor.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,14 +22,15 @@
******************************************************************************/
package org.jboss.portal.server.aspects.server;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.ServerInterceptor;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
import org.jboss.portal.server.ServerResponse;
-import org.jboss.portal.common.http.HTTPStreamInfo;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
@@ -59,9 +60,9 @@
}
// Configure the stream info
- HTTPStreamInfo info = new HTTPStreamInfo(MediaType.HTML, "UTF-8");
+ ContentInfo info = new MarkupInfo(MediaType.HTML, "UTF-8");
ServerResponse resp = invocation.getResponse();
- resp.setStreamInfo(info);
+ resp.setContentInfo(info);
// Continue invocation
invocation.invokeNext();
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/TestLayoutServiceImpl.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/TestLayoutServiceImpl.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestLayoutServiceImpl.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.theme;
import junit.framework.TestCase;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.theme.LayoutException;
Modified:
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestLayoutStrategySetMetaData.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestLayoutStrategySetMetaData.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestLayoutStrategySetMetaData.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.theme.metadata;
import junit.framework.TestCase;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.theme.deployment.jboss.LayoutStategyMetaDataFactory;
import org.jboss.portal.theme.metadata.LayoutStrategyMetaData;
import org.jboss.xb.binding.JBossXBException;
Modified:
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestRenderSetMetaData.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestRenderSetMetaData.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestRenderSetMetaData.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.theme.metadata;
import junit.framework.TestCase;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.theme.deployment.jboss.RenderSetMetaDataFactory;
import org.jboss.portal.theme.metadata.RenderSetMetaData;
import org.jboss.portal.theme.metadata.RendererSetMetaData;
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRenderedMarkup.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRenderedMarkup.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRenderedMarkup.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,10 +22,10 @@
package org.jboss.portal.test.theme.render;
import junit.framework.TestCase;
-import org.jboss.portal.common.MediaType;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.server.ServerRequest;
import org.jboss.portal.test.theme.TestHelper;
import org.jboss.portal.theme.LayoutService;
@@ -135,7 +135,7 @@
portalProps.put(ThemeConstants.PORTAL_PROP_RENDERSET, renderSet.getName());
//
- HTTPStreamInfo streamInfo = new HTTPStreamInfo(MediaType.HTML, "utf-8");
+ MarkupInfo streamInfo = new MarkupInfo(MediaType.HTML, "utf-8");
ServerRequest serverRequest = TestHelper.createServerRequest();
// pageresult obj
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/servlet/TestThemeServlet.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/servlet/TestThemeServlet.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/servlet/TestThemeServlet.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -25,8 +25,8 @@
import org.jboss.mx.util.MBeanProxy;
import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.portal.common.MediaType;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.server.ServerRequest;
import org.jboss.portal.theme.LayoutConstants;
import org.jboss.portal.theme.LayoutDispatcher;
@@ -154,7 +154,7 @@
portalProps.put(ThemeConstants.PORTAL_PROP_RENDERSET, renderSet.getName());
//
- HTTPStreamInfo streamInfo = new HTTPStreamInfo(MediaType.HTML, "utf-8");
+ MarkupInfo markupInfo = new MarkupInfo(MediaType.HTML, "utf-8");
ServerRequest serverRequest = new ServerRequest(null);
// pageresult obj
@@ -177,7 +177,7 @@
}
// set the renderctx and req/res attr
- RenderContext renderCtx = new RenderContext(layout, streamInfo, pageResult,
serverRequest);
+ RenderContext renderCtx = new RenderContext(layout, markupInfo, pageResult,
serverRequest);
httpServletResponse.setContentType(renderCtx.getContentType().toString());
httpServletResponse.setCharacterEncoding(renderCtx.getCharset());
httpServletRequest.setAttribute(LayoutConstants.ATTR_RENDERCONTEXT, renderCtx);
Modified: trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java 2007-03-15 21:51:04
UTC (rev 6703)
+++ trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java 2007-03-15 22:36:31
UTC (rev 6704)
@@ -23,8 +23,8 @@
package org.jboss.portal.theme;
-import org.jboss.portal.common.MediaType;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.ContentInfo;
import org.jboss.portal.theme.render.PortalRenderSet;
import org.jboss.portal.theme.strategy.LayoutStrategy;
import org.jboss.portal.theme.page.PageResult;
@@ -119,5 +119,5 @@
*/
Collection getRenderSets();
- PortalRenderSet getRenderSet(LayoutInfo info, HTTPStreamInfo streamInfo, PageResult
result);
+ PortalRenderSet getRenderSet(LayoutInfo info, ContentInfo streamInfo, PageResult
result);
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java 2007-03-15 21:51:04 UTC
(rev 6703)
+++ trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java 2007-03-15 22:36:31 UTC
(rev 6704)
@@ -24,7 +24,8 @@
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.theme.render.RenderContext;
import org.jboss.portal.theme.page.PageResult;
@@ -95,13 +96,13 @@
/**
* Create a new render context for this request and layout
*
- * @param streamInfo the information about the content type and encoding this layout
should produce
+ * @param markupInfo the information about the content type and encoding this layout
should produce
* @param request the current server request
* @param markupResult the result of the portlet render process
* @return a new render context
*/
- public RenderContext getRenderContext(HTTPStreamInfo streamInfo, ServerRequest
request, PageResult markupResult)
+ public RenderContext getRenderContext(MarkupInfo markupInfo, ServerRequest request,
PageResult markupResult)
{
- return new RenderContext(this, streamInfo, markupResult, request);
+ return new RenderContext(this, markupInfo, markupResult, request);
}
}
Modified:
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutStategyMetaDataFactory.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutStategyMetaDataFactory.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutStategyMetaDataFactory.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.theme.deployment.jboss;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.theme.metadata.LayoutStrategyMetaData;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
Modified:
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetMetaDataFactory.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetMetaDataFactory.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetMetaDataFactory.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.theme.deployment.jboss;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.theme.metadata.RenderSetMetaData;
import org.jboss.portal.theme.metadata.RendererSetMetaData;
import org.jboss.xb.binding.ObjectModelFactory;
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-03-15 21:51:04
UTC (rev 6703)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-03-15 22:36:31
UTC (rev 6704)
@@ -28,6 +28,7 @@
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.page.PageResult;
import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.common.util.MarkupInfo;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -49,7 +50,7 @@
{
HttpServletRequest httpRequest = invocation.getServerContext().getClientRequest();
HttpServletResponse httpResponse =
invocation.getServerContext().getClientResponse();
- RenderContext renderCtx =
getRenderContext(invocation.getResponse().getStreamInfo(), invocation.getRequest(),
markupResult);
+ RenderContext renderCtx =
getRenderContext((MarkupInfo)invocation.getResponse().getContentInfo(),
invocation.getRequest(), markupResult);
LayoutDispatcher dispatcher = new LayoutDispatcher(renderCtx, httpRequest,
httpResponse, markupResult);
dispatcher.include();
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -23,9 +23,9 @@
package org.jboss.portal.theme.impl;
import org.jboss.logging.Logger;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.ContentInfo;
import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.common.http.HTTPStreamInfo;
import org.jboss.portal.theme.LayoutException;
import org.jboss.portal.theme.LayoutInfo;
import org.jboss.portal.theme.LayoutService;
@@ -355,7 +355,7 @@
}
}
- /** @see LayoutService#getStrategy(String,org.jboss.portal.common.MediaType) */
+ /** @see LayoutService#getStrategy(String,org.jboss.portal.common.util.MediaType) */
public LayoutStrategy getStrategy(String strategyName, MediaType mediaType)
{
ServerRegistrationID id;
@@ -433,7 +433,7 @@
}
}
- /** @see LayoutService#getRenderSet(String,org.jboss.portal.common.MediaType) */
+ /** @see LayoutService#getRenderSet(String,org.jboss.portal.common.util.MediaType) */
public PortalRenderSet getRenderSet(String renderSetName, MediaType mediaType)
{
ServerRegistrationID id;
@@ -515,7 +515,7 @@
* @param result
* @return a renderSet to decorate the markup fragments on the page with
*/
- public PortalRenderSet getRenderSet(LayoutInfo info, HTTPStreamInfo streamInfo,
PageResult result)
+ public PortalRenderSet getRenderSet(LayoutInfo info, ContentInfo streamInfo,
PageResult result)
{
if (info == null || result == null || streamInfo == null)
{
Modified:
trunk/theme/src/main/org/jboss/portal/theme/metadata/LayoutStrategyMetaData.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/metadata/LayoutStrategyMetaData.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/theme/src/main/org/jboss/portal/theme/metadata/LayoutStrategyMetaData.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.theme.metadata;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
/**
* Meta data describing a single layout strategy as provided in the portal-layouts.xml
descriptor.
Modified: trunk/theme/src/main/org/jboss/portal/theme/metadata/RendererSetMetaData.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/metadata/RendererSetMetaData.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/theme/src/main/org/jboss/portal/theme/metadata/RendererSetMetaData.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.theme.metadata;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
/**
* Meta data describing a render set.
Modified: trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.theme.render;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.theme.RuntimeContext;
import org.jboss.portal.theme.ServerRegistrationID;
import org.jboss.portal.theme.impl.render.dynamic.DynaDecorationRenderer;
Modified: trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.theme.render;
-import org.jboss.portal.common.MediaType;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.server.ServerRequest;
import org.jboss.portal.theme.LayoutInfo;
import org.jboss.portal.theme.PortalLayout;
@@ -59,12 +59,12 @@
private StringBuffer markup;
private Object fragment;
- private HTTPStreamInfo streamInfo;
+ private MarkupInfo markupInfo;
// initialize
- private void init(PortalLayout layout, Object fragment, HTTPStreamInfo streamInfo,
PageResult result, ServerRequest request)
+ private void init(PortalLayout layout, Object fragment, MarkupInfo markupInfo,
PageResult result, ServerRequest request)
{
- this.renderSet = layout.getServiceInfo().getRenderSet(layout.getLayoutInfo(),
streamInfo, result);
+ this.renderSet = layout.getServiceInfo().getRenderSet(layout.getLayoutInfo(),
markupInfo, result);
if (renderSet == null)
{
throw new IllegalStateException("No RenderSet determined");
@@ -76,7 +76,7 @@
this.pageResult = result;
this.request = request;
this.fragment = fragment;
- this.streamInfo = streamInfo;
+ this.markupInfo = markupInfo;
if (fragment != null && fragment instanceof Region)
{
@@ -90,7 +90,7 @@
}
}
- private RenderContext(PortalLayout layout, Object markupContainer, HTTPStreamInfo
streamInfo, PageResult result, ServerRequest request)
+ private RenderContext(PortalLayout layout, Object markupContainer, MarkupInfo
streamInfo, PageResult result, ServerRequest request)
{
init(layout, markupContainer, streamInfo, result, request);
}
@@ -100,17 +100,17 @@
* (page, region , window context) to render.</p>
*
* @param layout the layout that is used for this render context
- * @param streamInfo information about the content type and encoding to use when
writing the response
+ * @param markupInfo information about the content type and encoding to use when
writing the response
* @param result the rendered result(s) from the portlet container (PageResult,
RegionResult, WindowResult)
* @param request the current server request
*/
- public RenderContext(PortalLayout layout, HTTPStreamInfo streamInfo, PageResult
result, ServerRequest request)
+ public RenderContext(PortalLayout layout, MarkupInfo markupInfo, PageResult result,
ServerRequest request)
{
if (layout == null)
{
throw new IllegalArgumentException("no layout provided");
}
- if (streamInfo == null)
+ if (markupInfo == null)
{
throw new IllegalArgumentException("no stream info provided");
}
@@ -124,7 +124,7 @@
}
// context for the entire page
- init(layout, null, streamInfo, result, request);
+ init(layout, null, markupInfo, result, request);
}
/**
@@ -139,7 +139,7 @@
*/
public RenderContext getContext(Region region, String cssId, RegionOrientation
orientation)
{
- RenderContext context = new RenderContext(this.layout, region, this.streamInfo,
this.pageResult, this.request);
+ RenderContext context = new RenderContext(this.layout, region, this.markupInfo,
this.pageResult, this.request);
if (cssId != null)
{
context.regionCssId = cssId;
@@ -160,7 +160,7 @@
*/
public RenderContext getContext(WindowContext windowContext)
{
- return new RenderContext(layout, windowContext, streamInfo, pageResult, request);
+ return new RenderContext(layout, windowContext, markupInfo, pageResult, request);
}
/** @return a markup fragment */
@@ -172,13 +172,13 @@
/** @return the content type */
public MediaType getContentType()
{
- return streamInfo.getContentType();
+ return markupInfo.getContentType();
}
/** @return the encoding to use when writing to the output */
public String getCharset()
{
- return streamInfo.getCharset();
+ return markupInfo.getCharset();
}
/** @return the region orientation */
@@ -213,7 +213,7 @@
return getRegionRenderer();
}
- PortalRenderSet renderSet = layout.getServiceInfo().getRenderSet(renderSetName,
streamInfo.getContentType());
+ PortalRenderSet renderSet = layout.getServiceInfo().getRenderSet(renderSetName,
markupInfo.getContentType());
if (renderSet != null)
{
@@ -253,7 +253,7 @@
if (renderSetName != null)
{
- PortalRenderSet renderSet = layout.getServiceInfo().getRenderSet(renderSetName,
streamInfo.getContentType());
+ PortalRenderSet renderSet = layout.getServiceInfo().getRenderSet(renderSetName,
markupInfo.getContentType());
if (renderSet != null)
{
@@ -295,7 +295,7 @@
if (renderSetName != null)
{
- PortalRenderSet renderSet = layout.getServiceInfo().getRenderSet(renderSetName,
streamInfo.getContentType());
+ PortalRenderSet renderSet = layout.getServiceInfo().getRenderSet(renderSetName,
markupInfo.getContentType());
if (renderSet != null)
{
@@ -341,7 +341,7 @@
if (renderSetName != null)
{
- PortalRenderSet renderSet = layout.getServiceInfo().getRenderSet(renderSetName,
streamInfo.getContentType());
+ PortalRenderSet renderSet = layout.getServiceInfo().getRenderSet(renderSetName,
markupInfo.getContentType());
if (renderSet != null)
{
Modified: trunk/theme/src/main/org/jboss/portal/theme/strategy/LayoutStrategy.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/strategy/LayoutStrategy.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/theme/src/main/org/jboss/portal/theme/strategy/LayoutStrategy.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.theme.strategy;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.theme.RuntimeContext;
import org.jboss.portal.theme.ServerRegistrationID;
import org.jboss.portal.theme.metadata.LayoutStrategyMetaData;
Modified: trunk/theme/src/main/org/jboss/portal/theme/strategy/StrategyContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/strategy/StrategyContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/theme/src/main/org/jboss/portal/theme/strategy/StrategyContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -25,8 +25,8 @@
import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.MediaType;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.common.invocation.AttributeResolver;
import org.jboss.portal.theme.navigation.WindowNavigationalState;
import org.jboss.portal.theme.page.WindowContext;
@@ -57,18 +57,18 @@
private final HttpServletRequest httpRequest;
private final Set supportedWindowStates;
private final Set supportedPortletModes;
- private final HTTPStreamInfo streamInfo;
+ private final MarkupInfo markupInfo;
private final List localWindowContexts;
private final AttributeResolver navigationalStateContext;
public StrategyContext(AttributeResolver navCtx,
- HttpServletRequest httpRequest, HTTPStreamInfo streamInfo,
+ HttpServletRequest httpRequest, MarkupInfo markupInfo,
Set windowStates, Set portletModes, List regionNames)
{
this.httpRequest = httpRequest;
this.supportedWindowStates = windowStates;
this.supportedPortletModes = portletModes;
- this.streamInfo = streamInfo;
+ this.markupInfo = markupInfo;
this.navigationalStateContext = navCtx;
this.localWindowContexts = new ArrayList();
}
@@ -85,12 +85,12 @@
public MediaType getMediaType()
{
- return streamInfo.getContentType();
+ return markupInfo.getContentType();
}
public String getCharSet()
{
- return streamInfo.getCharset();
+ return markupInfo.getCharset();
}
public boolean isSupportedWindowState(WindowState state)
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -25,7 +25,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.PortletURL;
import org.jboss.portal.portlet.StateString;
@@ -35,7 +35,7 @@
import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.spi.RenderContext;
import org.jboss.portal.server.impl.RequestAttributeResolver;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.wsrp.WSRPConstants;
import javax.servlet.http.HttpServletRequest;
@@ -64,7 +64,7 @@
mode != null ? mode : Mode.VIEW,
state != null ? state : WindowState.MAXIMIZED,
StateString.createFrom(ns),
- new HTTPStreamInfo(MediaType.HTML, WSRPConstants.DEFAULT_CHARACTER_SET));
+ new MarkupInfo(MediaType.HTML, WSRPConstants.DEFAULT_CHARACTER_SET));
ClassLoader classLoader = getClass().getClassLoader();
HttpSession session = (HttpSession)Proxy.newProxyInstance(classLoader, new
Class[]{HttpSession.class},
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPResourceURL.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPResourceURL.java 2007-03-15 21:51:04 UTC
(rev 6703)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPResourceURL.java 2007-03-15 22:36:31 UTC
(rev 6704)
@@ -26,7 +26,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.URLTools;
import javax.activation.MimeTypeParseException;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -25,7 +25,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.ContentInfo;
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
@@ -83,7 +83,7 @@
ParameterValidation.throwIllegalArgExceptionIfNull(userContext, USER_CONTEXT);
PortletInvocationContext context = invocation.getPortletContext();
ParameterValidation.throwIllegalArgExceptionIfNull(context, INVOCATION_CONTEXT);
- HTTPStreamInfo streamInfo = context.getStreamInfo();
+ ContentInfo streamInfo = context.getMarkupInfo();
ParameterValidation.throwIllegalArgExceptionIfNull(streamInfo, STREAM_INFO);
String mode;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -33,7 +33,7 @@
import org.jboss.portal.portlet.spi.SecurityContext;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.wsrp.servlet.ServletAccess;
import javax.servlet.ServletRequest;
@@ -56,12 +56,12 @@
private StateString interactionState;
public WSRPActionContext(StateString navigationalState,
- SecurityContext securityContext, HTTPStreamInfo streamInfo,
PortalContext portalContext,
+ SecurityContext securityContext, MarkupInfo markupInfo,
PortalContext portalContext,
UserContext userContext, InstanceContext instanceContext,
WindowContext windowContext,
Mode mode, WindowState windowState, StateString
interactionState,
PortletParameters formParameters, String characterEncoding,
String contentType)
{
- super(navigationalState, securityContext, streamInfo, portalContext, userContext,
instanceContext,
+ super(navigationalState, securityContext, markupInfo, portalContext, userContext,
instanceContext,
windowContext, mode, windowState);
this.formParameters = formParameters;
this.request = ServletAccess.getRequest();
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -26,6 +26,8 @@
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
import org.jboss.portal.common.util.URLTools;
+import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.PortletURL;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
@@ -39,7 +41,6 @@
import org.jboss.portal.portlet.spi.WindowContext;
import org.jboss.portal.server.impl.MapAttributeResolver;
import org.jboss.portal.server.impl.RequestAttributeResolver;
-import org.jboss.portal.common.http.HTTPStreamInfo;
import org.jboss.portal.wsrp.WSRPPortletURL;
import org.jboss.portal.wsrp.WSRPRewritingConstants;
import org.jboss.portal.wsrp.servlet.ServletAccess;
@@ -69,13 +70,13 @@
private static final String EQ_TRUE = "=true";
public WSRPPortletInvocationContext(StateString navigationalState, SecurityContext
securityContext,
- HTTPStreamInfo streamInfo, PortalContext
portalContext, UserContext userContext,
+ MarkupInfo markupInfo, PortalContext
portalContext, UserContext userContext,
InstanceContext instanceContext, WindowContext
windowContext, Mode mode, WindowState windowState)
{
- super(mode, windowState, navigationalState, streamInfo);
+ super(mode, windowState, navigationalState, markupInfo);
this.securityContext = securityContext;
- this.streamInfo = streamInfo;
+ this.markupInfo = markupInfo;
this.portalContext = portalContext;
this.userContext = userContext;
this.instanceContext = instanceContext;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRenderContext.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRenderContext.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPRenderContext.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -24,7 +24,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.PortalContext;
@@ -41,10 +41,10 @@
{
public WSRPRenderContext(StateString navigationalState, SecurityContext
securityContext,
- HTTPStreamInfo streamInfo, PortalContext portalContext,
UserContext userContext,
+ MarkupInfo markupInfo, PortalContext portalContext,
UserContext userContext,
InstanceContext instanceContext, WindowContext windowContext,
Mode mode, WindowState windowState)
{
- super(navigationalState, securityContext, streamInfo, portalContext, userContext,
instanceContext,
+ super(navigationalState, securityContext, markupInfo, portalContext, userContext,
instanceContext,
windowContext, mode, windowState);
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -34,7 +34,8 @@
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.InteractionParams;
@@ -116,7 +117,7 @@
}
void initInvocation(StateString navigationalState, SecurityContext securityContext,
- HTTPStreamInfo streamInfo, PortalContext portalContext,
+ MarkupInfo markupInfo, PortalContext portalContext,
UserContext userContext,
WindowContext windowContext
)
@@ -156,7 +157,7 @@
StateString interactionState =
createNavigationalState(interactionParams.getInteractionState());
- WSRPActionContext actionContext = new WSRPActionContext(navigationalState,
securityContext, streamInfo,
+ WSRPActionContext actionContext = new WSRPActionContext(navigationalState,
securityContext, markupInfo,
portalContext, userContext, instanceContext, windowContext,
WSRPUtils.getJSR168PortletModeFromWSRPName(markupRequest.getMode()),
WSRPUtils.getJSR168WindowStateFromWSRPName(markupRequest.getWindowState()),
interactionState, parameters,
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java 2007-03-15
21:51:04 UTC (rev 6703)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -24,7 +24,7 @@
package org.jboss.portal.wsrp.producer;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
import org.jboss.portal.portlet.info.CacheInfo;
@@ -111,12 +111,12 @@
}
void initInvocation(StateString navigationalState, SecurityContext securityContext,
- HTTPStreamInfo streamInfo, PortalContext portalContext,
+ MarkupInfo markupInfo, PortalContext portalContext,
UserContext userContext,
WindowContext windowContext
)
{
- WSRPRenderContext renderContext = new WSRPRenderContext(navigationalState,
securityContext, streamInfo,
+ WSRPRenderContext renderContext = new WSRPRenderContext(navigationalState,
securityContext, markupInfo,
portalContext, userContext, instanceContext, windowContext,
WSRPUtils.getJSR168PortletModeFromWSRPName(markupRequest.getMode()),
WSRPUtils.getJSR168WindowStateFromWSRPName(markupRequest.getWindowState()));
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2007-03-15
21:51:04 UTC (rev 6703)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2007-03-15
22:36:31 UTC (rev 6704)
@@ -23,9 +23,9 @@
package org.jboss.portal.wsrp.producer;
-import org.jboss.portal.common.MediaType;
-import org.jboss.portal.common.http.HTTPStreamInfo;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.OpaqueStateString;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -135,7 +135,7 @@
checkUserContext(wsrpUserContext);
SecurityContext securityContext = createSecurityContext(params, runtimeContext,
wsrpUserContext);
- HTTPStreamInfo streamInfo = createStreamInfo(markupRequest);
+ MarkupInfo streamInfo = createStreamInfo(markupRequest);
PortalContext portalContext = createPortalContext(params, markupRequest);
UserContext userContext = createUserContext(wsrpUserContext,
markupRequest.getLocale(), desiredLocales);
instanceContext = createInstanceContext(portletContext, getAccessMode());
@@ -160,7 +160,7 @@
abstract AccessMode getAccessMode() throws MissingParametersFault;
abstract void initInvocation(StateString navigationalState, SecurityContext
securityContext,
- HTTPStreamInfo streamInfo, PortalContext portalContext,
UserContext userContext,
+ MarkupInfo markupInfo, PortalContext portalContext,
UserContext userContext,
WindowContext windowContext);
abstract Object processResponse(PortletInvocationResponse response);
@@ -383,19 +383,19 @@
};
}
- private HTTPStreamInfo createStreamInfo(MarkupRequest markupRequest)
+ private MarkupInfo createStreamInfo(MarkupRequest markupRequest)
throws UnsupportedMimeTypeFault
{
- HTTPStreamInfo streamInfo;
+ MarkupInfo markupInfo;
try
{
- streamInfo = new
HTTPStreamInfo(MediaType.parseMimeType(markupRequest.getMimeType()),
markupRequest.getCharacterSet());
+ markupInfo = new
MarkupInfo(MediaType.parseMimeType(markupRequest.getMimeType()),
markupRequest.getCharacterSet());
}
catch (MimeTypeParseException e)
{
throw
(UnsupportedMimeTypeFault)WSRPUtils.createFaultFrom(UnsupportedMimeTypeFault.class, e);
}
- return streamInfo;
+ return markupInfo;
}
// fix-me: check that the correct semantics is used.