Author: chris.laprun(a)jboss.com
Date: 2008-03-12 02:59:37 -0400 (Wed, 12 Mar 2008)
New Revision: 10269
Added:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/MarkupAttribute.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/MarkupElement.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/MarkupTestCase.java
Removed:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoImpl.java
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/info/ContainerPortletInfoWrapper.java
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/CoreInfoBuilder.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/MarkupHeaderInfoImpl.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/ElementMetaData.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderContentMetaData.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/LinkElementMetaData.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/NamedMetaElementMetaData.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/portlet/info/CorePortletInfo.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/portlet/info/MarkupHeaderInfo.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/filter/JBossPortletFilter.java
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/InfoBuilder.java
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
Log:
- Started support for header injection:
+ Rewrote HeaderInterceptor
+ Adapted InternalContentProvider to get header string
+ Turned CorePortletInfo into a class instead of interface so that it can extend
ContainerPortletInfo
so that the correct portlet infor can be set on portlet containers in
PortletAppDeployment.start().
+ Removed CorePortletInfoImpl and ContainerPortletInfoWrapper.
+ DOES NOT WORK AT RUNTIME because of:
java.lang.IncompatibleClassChangeError
org.jboss.portal.portlet.impl.spi.AbstractServerContext.dispatch(AbstractServerContext.java:69)
org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:76)
org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
Need to figure out what's going on but this is a synchro commit...
- More generification
- Added and improved MarkupAttribute, MarkupElement and MarkupTestCase from common module
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,20 +22,21 @@
******************************************************************************/
package org.jboss.portal.core.aspects.portlet;
-import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.markup.MarkupElement;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+import org.jboss.portal.core.metadata.portlet.MarkupElement;
import org.jboss.portal.core.portlet.info.CorePortletInfo;
import org.jboss.portal.core.portlet.info.MarkupHeaderInfo;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
+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.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+import org.w3c.dom.Element;
-import java.io.StringWriter;
-import java.util.Iterator;
+import javax.portlet.MimeResponse;
/**
* @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
@@ -46,96 +47,46 @@
public class HeaderInterceptor extends PortletInterceptor
{
- protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception
{
PortletInvocationResponse response =
(PortletInvocationResponse)invocation.invokeNext();
// Only affect fragments
if (response instanceof FragmentResponse)
{
- System.out.println("TODO:
org.jboss.portal.core.aspects.portlet.HeaderInterceptor");
- /*
FragmentResponse fragment = (FragmentResponse)response;
- // The buffer that may become non null if we have content to write in it
- StringWriter buffer = null;
-
- // Get existing header which may be null
-
- String headerChars = fragment.getHeader();
-
- // Add declaratively injected header content here (get it via the component)
+ // Add declaratively injected header content here if needed (get it via the
component)
PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
- CorePortletInfo info = (CorePortletInfo)container.getInfo();
- MarkupHeaderInfo headerContentInfo = info.getMarkupHeader();
- if (headerContentInfo != null)
+ PortletInfo info = container.getInfo();
+ // only proceed if we have JBoss Portal specific metadata
+ if (info instanceof CorePortletInfo)
{
- // Init the buffer
- buffer = initBuffer(headerChars);
+ CorePortletInfo corePortletInfo = (CorePortletInfo)info;
+ MarkupHeaderInfo headerContentInfo = corePortletInfo.getMarkupHeader();
+ if (headerContentInfo != null)
+ {
+ ResponseProperties props = fragment.getProperties();
- // Get the context path
- String contextPath =
(String)invocation.getDispatchedRequest().getAttribute("javax.servlet.include.context_path");
+ // if we don't already have properties in the response, create some
+ if (props == null)
+ {
+ props = new ResponseProperties();
+ }
- // Render header
- render(headerContentInfo, buffer, contextPath);
- }
+ // Get the context path
+ String contextPath =
(String)invocation.getDispatchedRequest().getAttribute("javax.servlet.include.context_path");
- // Add header content coming from the response written by the portlet at
runtime
- String headerContent =
(String)invocation.getAttribute(PortletInvocation.RESPONSE_PROPERTIES_SCOPE,
"HEADER_CONTENT");
- if (headerContent != null)
- {
- // Init buffer if needed
- if (buffer == null)
- {
- buffer = initBuffer(headerChars);
+ MultiValuedPropertyMap<Element> headers = props.getMarkupHeaders();
+ for (MarkupElement markupElement : headerContentInfo.getMarkupElements())
+ {
+ headers.addValue(MimeResponse.MARKUP_HEAD_ELEMENT,
markupElement.toElement(contextPath));
+ }
}
-
- // Append the content as it is
- buffer.write(headerContent);
}
-
- // If the buffer is not empty, use it
- if (buffer != null)
- {
- headerChars = buffer.toString();
- }
-
- //
- fragment.setHeader(headerChars);
- */
}
//
return response;
}
-
- private StringWriter initBuffer(String existingBuffer)
- {
- if (existingBuffer != null)
- {
- StringWriter buffer = new StringWriter(existingBuffer.length() + 100);
- buffer.write(existingBuffer);
- return buffer;
- }
- else
- {
- return new StringWriter(100);
- }
- }
-
- /**
- * Render the header content provided by the portlet.
- *
- * @param headerContent
- * @param writer
- * @param contextPath
- */
- protected void render(MarkupHeaderInfo headerContent, StringWriter writer, String
contextPath)
- {
- for (Iterator i = headerContent.getMarkupElements().iterator(); i.hasNext();)
- {
- MarkupElement element = (MarkupElement)i.next();
- writer.write(element.toString(contextPath));
- }
- }
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2008, 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. *
@@ -25,7 +25,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.core.aspects.portlet.AjaxInterceptor;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.controller.command.response.SecurityErrorResponse;
import org.jboss.portal.core.controller.command.response.UnavailableResourceResponse;
@@ -35,30 +35,31 @@
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstancePermission;
import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.command.response.MarkupResponse;
import org.jboss.portal.core.model.portal.content.ContentRenderer;
+import org.jboss.portal.core.model.portal.content.ContentRendererContext;
import org.jboss.portal.core.model.portal.content.WindowRendition;
-import org.jboss.portal.core.model.portal.content.ContentRendererContext;
import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.info.WindowStateInfo;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
import
org.jboss.portal.portlet.invocation.response.InsufficientTransportGuaranteeResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
-import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
+import org.w3c.dom.Element;
+import javax.portlet.MimeResponse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -162,7 +163,7 @@
// Get the parent portal
Portal portal = null;
- for (PortalObject current = window;current != null;current = current.getParent())
+ for (PortalObject current = window; current != null; current =
current.getParent())
{
if (current.getType() == PortalObject.TYPE_PORTAL)
{
@@ -288,7 +289,7 @@
if (response instanceof FragmentResponse)
{
System.out.println("TODO:
org.jboss.portal.core.impl.model.content.InternalContentProvider.renderWindow()");
-
+
FragmentResponse fragment = (FragmentResponse)response;
//
@@ -298,9 +299,22 @@
windowTitle = window.getName();
}
- //
-// String headerChars = fragment.getHeader();
+ // header handling
+ String header = "";
+ ResponseProperties properties = fragment.getProperties();
+ if (properties != null)
+ {
+ MultiValuedPropertyMap<Element> headers =
properties.getMarkupHeaders();
+ List<Element> headElements =
headers.getValues(MimeResponse.MARKUP_HEAD_ELEMENT);
+ StringBuffer buffer = new StringBuffer(124 * headElements.size());
+ for (Element element : headElements)
+ {
+ buffer.append(element);
+ }
+ header = buffer.toString();
+ }
+
// Handle minimized here
String contentChars;
if (WindowState.MINIMIZED == windowNS.getWindowState())
@@ -309,7 +323,7 @@
}
else
{
- contentChars = fragment.getChars().toString();
+ contentChars = fragment.getChars();
}
// Update window props after render if needed
@@ -324,8 +338,8 @@
*/
//
- cr = new MarkupResponse(windowTitle, contentChars, "");
-
+ cr = new MarkupResponse(windowTitle, contentChars, header);
+
}
else if (response instanceof ErrorResponse)
{
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/CoreInfoBuilder.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/CoreInfoBuilder.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/CoreInfoBuilder.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,10 +22,8 @@
******************************************************************************/
package org.jboss.portal.core.impl.portlet.info;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-
import org.jboss.portal.core.metadata.portlet.JBossPortletMetaData;
+import org.jboss.portal.core.portlet.info.CorePortletInfo;
import org.jboss.portal.portlet.deployment.jboss.InfoBuilder;
import org.jboss.portal.portlet.deployment.jboss.PortletApplicationContextImpl;
import org.jboss.portal.portlet.deployment.jboss.metadata.JBossApplicationMetaData;
@@ -37,6 +35,9 @@
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import org.jboss.portal.portlet.info.PortletInfo;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
@@ -55,13 +56,14 @@
public CoreInfoBuilder(JBossApplicationMetaData jbossApplicationMetaData,
PortletApplication10MetaData portletApplicationMD,
- CoreInfoBuilderContext builderContext)
+ CoreInfoBuilderContext builderContext)
{
this.portletApplicationMD = portletApplicationMD;
this.jbossApplicationMetaData = jbossApplicationMetaData;
this.builderContext = builderContext;
this.portlets = new LinkedHashMap<String, PortletInfo>();
}
+
public Collection<PortletInfo> getPortlets()
{
return portlets.values();
@@ -71,23 +73,23 @@
{
return application;
}
-
+
public void build()
{
//
ContainerInfoBuilderContext containerBuilderContext = new
ContainerInfoBuilderContextImpl(portletApplicationMD, builderContext.getWebApp());
ContainerInfoBuilder builder = new
ContainerInfoBuilder(builderContext.getWebApp().getContextPath(), portletApplicationMD,
containerBuilderContext);
builder.build();
-
+
this.application = builder.getApplication();
-
+
//
for (ContainerPortletInfo containerInfo : builder.getPortlets())
{
org.jboss.portal.portlet.deployment.jboss.metadata.JBossPortletMetaData
jbPortletMD =
(org.jboss.portal.portlet.deployment.jboss.metadata.JBossPortletMetaData)jbossApplicationMetaData.getPortlets().get(containerInfo.getName());
if (jbPortletMD instanceof JBossPortletMetaData)
{
- CorePortletInfoImpl cpi = new CorePortletInfoImpl(containerInfo, new
PortletApplicationContextImpl(builderContext.getWebApp()),
(JBossPortletMetaData)jbPortletMD, containerInfo.getBundleManager());
+ CorePortletInfo cpi = new CorePortletInfo(containerInfo, new
PortletApplicationContextImpl(builderContext.getWebApp()),
(JBossPortletMetaData)jbPortletMD, containerInfo.getBundleManager());
portlets.put(jbPortletMD.getName(), cpi);
}
else
Deleted:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoImpl.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoImpl.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -1,162 +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.core.impl.portlet.info;
-
-import org.jboss.portal.common.i18n.ResourceBundleManager;
-import org.jboss.portal.common.transaction.Transactions;
-import org.jboss.portal.core.metadata.portlet.AjaxMetaData;
-import org.jboss.portal.core.metadata.portlet.HeaderContentMetaData;
-import org.jboss.portal.core.metadata.portlet.JBossPortletMetaData;
-import org.jboss.portal.core.metadata.portlet.PortletInfoMetaData;
-import org.jboss.portal.core.portlet.info.AjaxInfo;
-import org.jboss.portal.core.portlet.info.CorePortletInfo;
-import org.jboss.portal.core.portlet.info.MarkupHeaderInfo;
-import org.jboss.portal.core.portlet.info.PortletInfoInfo;
-import org.jboss.portal.portlet.container.PortletApplicationContext;
-import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
-import org.jboss.portal.portlet.info.CacheInfo;
-import org.jboss.portal.portlet.info.CapabilitiesInfo;
-import org.jboss.portal.portlet.info.EventingInfo;
-import org.jboss.portal.portlet.info.MetaInfo;
-import org.jboss.portal.portlet.info.NavigationInfo;
-import org.jboss.portal.portlet.info.PreferencesInfo;
-import org.jboss.portal.portlet.info.SecurityInfo;
-import org.jboss.portal.portlet.info.SessionInfo;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class CorePortletInfoImpl implements CorePortletInfo
-{
-
- /** . */
- private final Transactions.Type txType;
-
- /** . */
- private final AjaxInfoImpl ajax;
-
- /** . */
- private final MarkupHeaderInfoImpl markupHeader;
-
- /** . */
- private final PortletInfoInfoImpl portletInfo;
-
- private ContainerPortletInfo delegate;
-
- public CorePortletInfoImpl(ContainerPortletInfo delegate, PortletApplicationContext
portletApplicationContext, JBossPortletMetaData jbossPortletMD, ResourceBundleManager
bundleMgr)
- {
- this.delegate = delegate;
-
- //
- AjaxMetaData ajaxMD = ((JBossPortletMetaData)jbossPortletMD).getAjax();
- HeaderContentMetaData headerContentMD =
((JBossPortletMetaData)jbossPortletMD).getHeaderContent();
- PortletInfoMetaData portletInfoMD =
((JBossPortletMetaData)jbossPortletMD).getPortletInfo();
-
- //
- this.txType = jbossPortletMD.getTxType();
- this.ajax = ajaxMD != null ? new AjaxInfoImpl(ajaxMD) : null;
- this.markupHeader = headerContentMD != null ? new
MarkupHeaderInfoImpl(headerContentMD) : null;
- this.portletInfo = portletInfoMD != null ? new
PortletInfoInfoImpl(portletApplicationContext, portletInfoMD) : null;
- }
-
- public Transactions.Type getTxType()
- {
- return txType;
- }
-
- public AjaxInfo getAjax()
- {
- return ajax;
- }
-
- public MarkupHeaderInfo getMarkupHeader()
- {
- return markupHeader;
- }
-
- public PortletInfoInfo getPortletInfo()
- {
- return portletInfo;
- }
-
- public ContainerPortletInfo getContainerPortletInfo()
- {
- return delegate;
- }
-
- public String getApplicationName()
- {
- return delegate.getApplicationName();
- }
-
- public CacheInfo getCache()
- {
- return delegate.getCache();
- }
-
- public CapabilitiesInfo getCapabilities()
- {
- return delegate.getCapabilities();
- }
-
- public EventingInfo getEventing()
- {
- return delegate.getEventing();
- }
-
- public MetaInfo getMeta()
- {
- return delegate.getMeta();
- }
-
- public String getName()
- {
- return delegate.getName();
- }
-
- public NavigationInfo getNavigation()
- {
- return delegate.getNavigation();
- }
-
- public PreferencesInfo getPreferences()
- {
- return delegate.getPreferences();
- }
-
- public SecurityInfo getSecurity()
- {
- return delegate.getSecurity();
- }
-
- public SessionInfo getSession()
- {
- return delegate.getSession();
- }
-
- public Boolean isRemotable()
- {
- return delegate.isRemotable();
- }
-}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/MarkupHeaderInfoImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/MarkupHeaderInfoImpl.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/portlet/info/MarkupHeaderInfoImpl.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -24,12 +24,12 @@
import org.jboss.portal.core.metadata.portlet.ElementMetaData;
import org.jboss.portal.core.metadata.portlet.HeaderContentMetaData;
+import org.jboss.portal.core.metadata.portlet.MarkupElement;
import org.jboss.portal.core.portlet.info.MarkupHeaderInfo;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -39,22 +39,21 @@
{
/** . */
- private final Collection markupElements;
+ private final Collection<MarkupElement> markupElements;
public MarkupHeaderInfoImpl(HeaderContentMetaData headerContentMD)
{
- ArrayList markupElements = new ArrayList(headerContentMD.getElements().size());
- for (Iterator i = headerContentMD.getElements().iterator(); i.hasNext();)
+ ArrayList<MarkupElement> markupElements = new
ArrayList<MarkupElement>(headerContentMD.getElements().size());
+ for (ElementMetaData elementMetaData : headerContentMD.getElements())
{
- ElementMetaData elementMD = (ElementMetaData)i.next();
- markupElements.add(elementMD.getElement());
+ markupElements.add(elementMetaData.getElement());
}
//
this.markupElements = Collections.unmodifiableCollection(markupElements);
}
- public Collection getMarkupElements()
+ public Collection<MarkupElement> getMarkupElements()
{
return markupElements;
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/ElementMetaData.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/ElementMetaData.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/ElementMetaData.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.metadata.portlet;
-import org.jboss.portal.common.markup.MarkupElement;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderContentMetaData.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderContentMetaData.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderContentMetaData.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -37,11 +37,11 @@
{
/** . */
- private List elements;
+ private List<ElementMetaData> elements;
public HeaderContentMetaData()
{
- elements = new ArrayList();
+ elements = new ArrayList<ElementMetaData>();
}
/**
@@ -49,7 +49,7 @@
*
* @return a list of header elements (HeaderContentMetaData.Element)
*/
- public List getElements()
+ public List<ElementMetaData> getElements()
{
return elements;
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/LinkElementMetaData.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/LinkElementMetaData.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/LinkElementMetaData.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,9 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.metadata.portlet;
-import org.jboss.portal.common.markup.MarkupAttribute;
-import org.jboss.portal.common.markup.MarkupElement;
-
import java.util.ArrayList;
/**
Added:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/MarkupAttribute.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/MarkupAttribute.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/MarkupAttribute.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -0,0 +1,245 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.core.metadata.portlet;
+
+import org.jboss.portal.common.io.UndeclaredIOException;
+import org.jboss.portal.common.io.WriterCharWriter;
+import org.jboss.portal.common.text.AbstractCharEncoder;
+import org.jboss.portal.common.text.CharEncoder;
+import org.jboss.portal.common.text.CharWriter;
+import org.jboss.portal.common.text.EncodingException;
+import org.jboss.portal.common.text.FastURLEncoder;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+
+/**
+ * A markup attribute.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7228 $
+ */
+public class MarkupAttribute
+{
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final String value;
+
+ /** . */
+ final Type type;
+
+ /**
+ * @param name the attribute name
+ * @param value the attribute value
+ * @param type the attribute type
+ */
+ public MarkupAttribute(String name, String value, Type type)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("No null name accepted");
+ }
+ if (value == null)
+ {
+ throw new IllegalArgumentException("No null value accepted");
+ }
+ if (type == null)
+ {
+ throw new IllegalArgumentException("No null type accepted");
+ }
+ this.name = name;
+ this.value = value;
+ this.type = type;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public String getEncodedValue()
+ {
+ StringWriter tmp = new StringWriter(32);
+ type.encode(getValue(), tmp);
+ return tmp.toString();
+ }
+
+ public String getEncodedValue(String contextPath)
+ {
+ StringWriter writer = new StringWriter(64);
+ return getEncodedValue(contextPath, writer);
+ }
+
+ String getEncodedValue(String contextPath, Writer writer)
+ {
+ if (type == Type.URI && value.startsWith("/"))
+ {
+ Type.URI.encode(contextPath, writer);
+ }
+
+ try
+ {
+ writer.write(getEncodedValue());
+ }
+ catch (IOException e)
+ {
+ throw new UndeclaredIOException(e);
+ }
+
+ return writer.toString();
+ }
+
+ public Type getType()
+ {
+ return type;
+ }
+
+ public void write(String urlPrefix, Writer writer) throws UndeclaredIOException
+ {
+ if (urlPrefix == null)
+ {
+ throw new IllegalArgumentException("No context path provided");
+ }
+ if (writer == null)
+ {
+ throw new IllegalArgumentException("No writer provided");
+ }
+ try
+ {
+ writer.write(name);
+ writer.write("=\"");
+
+ writer.write(getEncodedValue(urlPrefix, writer));
+ writer.write('"');
+ }
+ catch (IOException e)
+ {
+ throw new UndeclaredIOException(e);
+ }
+ }
+
+ public String toString(String contextPath)
+ {
+ StringWriter buffer = new StringWriter(128);
+ write(contextPath, buffer);
+ return buffer.toString();
+ }
+
+ /** The type of the attribute value. */
+ public abstract static class Type
+ {
+
+ /**
+ * Encode the string in the proper format according to the type.
+ *
+ * @param string the string to encode
+ * @return the encoded string
+ */
+ public abstract void encode(String string, Writer writer) throws
UndeclaredIOException;
+
+ private static class CDATAType extends Type
+ {
+ public void encode(String string, Writer writer)
+ {
+ try
+ {
+ writer.write(string);
+ }
+ catch (IOException e)
+ {
+ throw new UndeclaredIOException(e);
+ }
+ }
+ }
+
+ /**
+ * CDATA is a sequence of characters from the document character set and may
include character entities. User
+ * agents should interpret attribute values as follows: <ul>
<li>Replace character entities with characters,</li>
+ * <li>Ignore line feeds,</li> <li>Replace each carriage return
or tab with a single space.</li> </ul>
+ */
+ public static final Type CDATA = new CDATAType();
+
+ /**
+ * NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any
number of letters, digits ([0-9]),
+ * hyphens ("-"), underscores ("_"), colons (":"),
and periods (".").
+ */
+ public static final Type NAME = new CDATAType();
+
+ /** %ContentType required : CDATA -- media type, as per [RFC2045]. */
+ public static final Type CONTENT_TYPE = new CDATAType();
+
+ private static final char[] SLASH_ARRAY = "/".toCharArray();
+
+ /** %URI : CDATA -- a Uniform Resource Identifier, see [URI]. */
+ public static final Type URI = new CDATAType()
+ {
+ {
+ // Patches the encoder to let '/' not being encoded
+ encoder = new AbstractCharEncoder()
+ {
+ protected void safeEncode(char c, CharWriter writer) throws
EncodingException
+ {
+ if (c == '/')
+ {
+ writer.append(SLASH_ARRAY);
+ }
+ else
+ {
+ FastURLEncoder.getUTF8Instance().encode(c, writer);
+ }
+ }
+ };
+ }
+
+ /** Our encoder for URI. */
+ final CharEncoder encoder;
+
+ public void encode(String string, Writer writer)
+ {
+ encoder.encode(string, new WriterCharWriter(writer));
+ }
+ };
+
+ /** %LinkTypes : CDATA -- space-separated list of link types. */
+ public static final Type LINK_TYPES = new CDATAType();
+
+ /** %Text : CDATA : CDATA. */
+ public static final Type TEXT = new CDATAType();
+
+ /** %MediaDesc : CDATA -- single or comma-separated list of media descriptors. */
+ public static final Type MEDIA_DESC = new CDATAType();
+
+ /** %URI : CDATA -- a Uniform Resource Identifier, see [URI]. */
+ public static final Type HREF = new CDATAType();
+ }
+}
Added:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/MarkupElement.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/MarkupElement.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/MarkupElement.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -0,0 +1,504 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.core.metadata.portlet;
+
+import org.jboss.portal.common.io.UndeclaredIOException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.TypeInfo;
+import org.w3c.dom.UserDataHandler;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * A markup element.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 7228 $
+ */
+public class MarkupElement
+{
+
+ /** . */
+ final String name;
+
+ /** . */
+ final String bodyContent;
+
+ /**
+ * If true and the body content is null then output the start tag and the end tag
instead of an empty tag. The use
+ * case is for the script element which when it is empty raise issues on IE, so it
start element and end element have
+ * to be used.
+ */
+ final boolean neverEmpty;
+
+ /** . */
+ final MarkupAttribute[] attributes;
+
+ /**
+ * @param name the element name
+ * @param bodyContent the optional body content
+ * @param neverEmpty
+ * @param attributes
+ */
+ public MarkupElement(String name, String bodyContent, boolean neverEmpty,
MarkupAttribute[] attributes)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("No null name accepted");
+ }
+ if (attributes == null)
+ {
+ throw new IllegalArgumentException("No null attributes accepted");
+ }
+
+ //
+ Set<String> tmp = new HashSet<String>(attributes.length);
+ for (MarkupAttribute attribute : attributes)
+ {
+ if (attribute == null)
+ {
+ throw new IllegalArgumentException("Cannot have a null
attribute");
+ }
+ if (!tmp.add(attribute.getName()))
+ {
+ throw new IllegalArgumentException("Cannot have two identical attributes
" + attribute.getName());
+ }
+ }
+
+ this.name = name;
+ this.bodyContent = bodyContent;
+ this.neverEmpty = neverEmpty;
+ this.attributes = attributes.clone();
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getBodyContent()
+ {
+ return bodyContent;
+ }
+
+ public boolean isNeverEmpty()
+ {
+ return neverEmpty;
+ }
+
+ public int getAttributeSize()
+ {
+ return attributes.length;
+ }
+
+ public MarkupAttribute getAttribute(int index)
+ {
+ return attributes[index];
+ }
+
+ public MarkupAttribute getAttribute(String name)
+ {
+ for (MarkupAttribute attribute : attributes)
+ {
+ if (attribute.getName().equals(name))
+ {
+ return attribute;
+ }
+ }
+ return null;
+ }
+
+ public void write(String urlPrefix, Writer writer) throws UndeclaredIOException
+ {
+ if (urlPrefix == null)
+ {
+ throw new IllegalArgumentException("No context path provided");
+ }
+ if (writer == null)
+ {
+ throw new IllegalArgumentException("No writer provided");
+ }
+ try
+ {
+ writer.write("<");
+ writer.write(name);
+
+ // attributes
+ for (MarkupAttribute attribute : attributes)
+ {
+ writer.write(" ");
+ attribute.write(urlPrefix, writer);
+ }
+
+ // content
+ if (bodyContent != null && bodyContent.length() > 0)
+ {
+ writer.write(">");
+ writer.write(bodyContent);
+ writer.write("</");
+ writer.write(name);
+ writer.write(">\n");
+ }
+ else if (neverEmpty)
+ {
+ writer.write(">");
+ writer.write("</");
+ writer.write(name);
+ writer.write(">\n");
+ }
+ else
+ {
+ writer.write("/>\n");
+ }
+ }
+ catch (IOException e)
+ {
+ throw new UndeclaredIOException(e);
+ }
+ }
+
+ public String toString(String contextPath)
+ {
+ StringWriter buffer = new StringWriter(128);
+ write(contextPath, buffer);
+ return buffer.toString();
+ }
+
+ public Element toElement(String contextPath)
+ {
+ return new SimpleElement(contextPath);
+ }
+
+ private class SimpleElement implements Element
+ {
+ private String contextPath;
+
+ private SimpleElement(String contextPath)
+ {
+ this.contextPath = contextPath;
+ }
+
+ @Override
+ public String toString()
+ {
+ return MarkupElement.this.toString(contextPath);
+ }
+
+ public String getTagName()
+ {
+ return name;
+ }
+
+ public String getAttribute(String name)
+ {
+ return MarkupElement.this.getAttribute(name).getEncodedValue(contextPath);
+ }
+
+ public void setAttribute(String name, String value) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removeAttribute(String name) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Attr getAttributeNode(String name)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Attr setAttributeNode(Attr newAttr) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Attr removeAttributeNode(Attr oldAttr) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeList getElementsByTagName(String name)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getAttributeNS(String namespaceURI, String localName) throws
DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removeAttributeNS(String namespaceURI, String localName) throws
DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Attr getAttributeNodeNS(String namespaceURI, String localName) throws
DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean hasAttribute(String name)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean hasAttributeNS(String namespaceURI, String localName) throws
DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public TypeInfo getSchemaTypeInfo()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setIdAttribute(String name, boolean isId) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getNodeName()
+ {
+ return getTagName();
+ }
+
+ public String getNodeValue() throws DOMException
+ {
+ return null;
+ }
+
+ public void setNodeValue(String nodeValue) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public short getNodeType()
+ {
+ return ELEMENT_NODE;
+ }
+
+ public Node getParentNode()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeList getChildNodes()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node getFirstChild()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node getLastChild()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node getPreviousSibling()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node getNextSibling()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NamedNodeMap getAttributes()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Document getOwnerDocument()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node insertBefore(Node newChild, Node refChild) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node replaceChild(Node newChild, Node oldChild) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node removeChild(Node oldChild) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node appendChild(Node newChild) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean hasChildNodes()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node cloneNode(boolean deep)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void normalize()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isSupported(String feature, String version)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getNamespaceURI()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getPrefix()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setPrefix(String prefix) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getLocalName()
+ {
+ return getTagName();
+ }
+
+ public boolean hasAttributes()
+ {
+ return MarkupElement.this.getAttributeSize() != 0;
+ }
+
+ public String getBaseURI()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public short compareDocumentPosition(Node other) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getTextContent() throws DOMException
+ {
+ return MarkupElement.this.getBodyContent();
+ }
+
+ public void setTextContent(String textContent) throws DOMException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isSameNode(Node other)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String lookupPrefix(String namespaceURI)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isDefaultNamespace(String namespaceURI)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String lookupNamespaceURI(String prefix)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isEqualNode(Node arg)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object getFeature(String feature, String version)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object setUserData(String key, Object data, UserDataHandler handler)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object getUserData(String key)
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/NamedMetaElementMetaData.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/NamedMetaElementMetaData.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/NamedMetaElementMetaData.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,9 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.metadata.portlet;
-import org.jboss.portal.common.markup.MarkupAttribute;
-import org.jboss.portal.common.markup.MarkupElement;
-
import java.util.ArrayList;
/**
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,9 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.metadata.portlet;
-import org.jboss.portal.common.markup.MarkupAttribute;
-import org.jboss.portal.common.markup.MarkupElement;
-
import java.util.ArrayList;
/**
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/portlet/info/CorePortletInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/portlet/info/CorePortletInfo.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/portlet/info/CorePortletInfo.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,23 +22,72 @@
******************************************************************************/
package org.jboss.portal.core.portlet.info;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
import org.jboss.portal.common.transaction.Transactions;
-import org.jboss.portal.portlet.deployment.jboss.info.ContainerPortletInfoWrapper;
+import org.jboss.portal.core.impl.portlet.info.AjaxInfoImpl;
+import org.jboss.portal.core.impl.portlet.info.MarkupHeaderInfoImpl;
+import org.jboss.portal.core.impl.portlet.info.PortletInfoInfoImpl;
+import org.jboss.portal.core.metadata.portlet.AjaxMetaData;
+import org.jboss.portal.core.metadata.portlet.HeaderContentMetaData;
+import org.jboss.portal.core.metadata.portlet.JBossPortletMetaData;
+import org.jboss.portal.core.metadata.portlet.PortletInfoMetaData;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 8786 $
*/
-public interface CorePortletInfo extends ContainerPortletInfoWrapper
+public class CorePortletInfo extends ContainerPortletInfo
{
- /** @return */
- Transactions.Type getTxType();
+ /** . */
+ private final Transactions.Type txType;
- /** @return */
- AjaxInfo getAjax();
+ /** . */
+ private final AjaxInfoImpl ajax;
- /** @return */
- MarkupHeaderInfo getMarkupHeader();
+ /** . */
+ private final MarkupHeaderInfoImpl markupHeader;
- PortletInfoInfo getPortletInfo();
+ /** . */
+ private final PortletInfoInfoImpl portletInfo;
+
+ public CorePortletInfo(ContainerPortletInfo delegate, PortletApplicationContext
portletApplicationContext, JBossPortletMetaData jbossPortletMD, ResourceBundleManager
bundleMgr)
+ {
+ super(delegate.getCapabilities(), delegate.getPreferences(), delegate.getMeta(),
delegate.getSecurity(),
+ delegate.getCache(), delegate.getSession(), delegate.getEventing(),
delegate.getNavigation(),
+ delegate.getFilterRefs(), delegate.getName(), delegate.getApplicationName(),
delegate.getClassName(),
+ delegate.getInitParameters(), delegate.isRemotable(),
delegate.getBundleManager(), delegate.getOptions());
+
+ //
+ AjaxMetaData ajaxMD = jbossPortletMD.getAjax();
+ HeaderContentMetaData headerContentMD = jbossPortletMD.getHeaderContent();
+ PortletInfoMetaData portletInfoMD = jbossPortletMD.getPortletInfo();
+
+ //
+ this.txType = jbossPortletMD.getTxType();
+ this.ajax = ajaxMD != null ? new AjaxInfoImpl(ajaxMD) : null;
+ this.markupHeader = headerContentMD != null ? new
MarkupHeaderInfoImpl(headerContentMD) : null;
+ this.portletInfo = portletInfoMD != null ? new
PortletInfoInfoImpl(portletApplicationContext, portletInfoMD) : null;
+ }
+
+ public Transactions.Type getTxType()
+ {
+ return txType;
+ }
+
+ public AjaxInfo getAjax()
+ {
+ return ajax;
+ }
+
+ public MarkupHeaderInfo getMarkupHeader()
+ {
+ return markupHeader;
+ }
+
+ public PortletInfoInfo getPortletInfo()
+ {
+ return portletInfo;
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/portlet/info/MarkupHeaderInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/portlet/info/MarkupHeaderInfo.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/portlet/info/MarkupHeaderInfo.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.jboss.portal.core.portlet.info;
+import org.jboss.portal.core.metadata.portlet.MarkupElement;
+
import java.util.Collection;
/**
@@ -30,5 +32,5 @@
*/
public interface MarkupHeaderInfo
{
- Collection getMarkupElements();
+ Collection<MarkupElement> getMarkupElements();
}
Added:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/MarkupTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/MarkupTestCase.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/MarkupTestCase.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2008, Your Corporation. All Rights Reserved.
+ */
+package org.jboss.portal.test.core;
+
+import junit.framework.TestCase;
+import org.jboss.portal.core.metadata.portlet.MarkupAttribute;
+import org.jboss.portal.core.metadata.portlet.MarkupElement;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MarkupTestCase extends TestCase
+{
+
+ public void testAttributeConstructor()
+ {
+ try
+ {
+ new MarkupAttribute(null, "value", MarkupAttribute.Type.CDATA);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ try
+ {
+ new MarkupAttribute("name", null, MarkupAttribute.Type.CDATA);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ try
+ {
+ new MarkupAttribute("name", "value", null);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ MarkupAttribute attribute = new MarkupAttribute("name",
"value", MarkupAttribute.Type.CDATA);
+ assertEquals("name", attribute.getName());
+ assertEquals("value", attribute.getValue());
+ assertEquals(MarkupAttribute.Type.CDATA, attribute.getType());
+ }
+
+ public void testElementContructor()
+ {
+ try
+ {
+ new MarkupElement(null, "body", false, new MarkupAttribute[0]);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ try
+ {
+ new MarkupElement("name", "body", false, null);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ try
+ {
+ new MarkupElement("name", "body", false, new
MarkupAttribute[]{null});
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ MarkupElement element = new MarkupElement("elementname",
"body", false, new MarkupAttribute[]{new
MarkupAttribute("attributename", "attributevalue",
MarkupAttribute.Type.CDATA)});
+ assertEquals("elementname", element.getName());
+ assertEquals("body", element.getBodyContent());
+ assertEquals(false, element.isNeverEmpty());
+ assertEquals(1, element.getAttributeSize());
+ MarkupAttribute attribute = element.getAttribute(0);
+ assertEquals("attributename", attribute.getName());
+ assertEquals("attributevalue", attribute.getValue());
+ assertEquals(MarkupAttribute.Type.CDATA, attribute.getType());
+ attribute = element.getAttribute("attributename");
+ assertEquals("attributename", attribute.getName());
+ assertEquals("attributevalue", attribute.getValue());
+ assertEquals(MarkupAttribute.Type.CDATA, attribute.getType());
+ assertEquals(null, element.getAttribute("someotherattributename"));
+ }
+
+ public void testAttributeURIEncoding()
+ {
+ MarkupAttribute attribute = new MarkupAttribute("name",
"/-_.*ABCabc012# ", MarkupAttribute.Type.URI);
+ assertEquals("/-_.*ABCabc012%23+", attribute.getEncodedValue());
+ }
+}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/filter/JBossPortletFilter.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/filter/JBossPortletFilter.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/filter/JBossPortletFilter.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,36 +22,38 @@
******************************************************************************/
package org.jboss.portlet.filter;
-import java.io.IOException;
+import org.jboss.portlet.JBossActionRequest;
+import org.jboss.portlet.JBossActionResponse;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
import javax.portlet.filter.ActionFilter;
+import javax.portlet.filter.EventFilter;
import javax.portlet.filter.FilterChain;
import javax.portlet.filter.FilterConfig;
-import javax.portlet.filter.PortletFilter;
import javax.portlet.filter.RenderFilter;
+import javax.portlet.filter.ResourceFilter;
+import java.io.IOException;
-import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
-import org.jboss.portlet.JBossActionRequest;
-import org.jboss.portlet.JBossActionResponse;
-
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
*/
-public class JBossPortletFilter implements ActionFilter, RenderFilter, PortletFilter
+public class JBossPortletFilter implements ActionFilter, RenderFilter, ResourceFilter,
EventFilter
{
public void doFilter(ActionRequest request, ActionResponse response, FilterChain
filterChain) throws IOException, PortletException
{
JBossActionRequest actionRequest = new JBossActionRequest(request);
JBossActionResponse actionResponse = new JBossActionResponse(response);
-
+
filterChain.doFilter(actionRequest, actionResponse);
}
@@ -72,5 +74,14 @@
filterChain.doFilter(request, response);
}
+ public void doFilter(ResourceRequest resourceRequest, ResourceResponse
resourceResponse, FilterChain filterChain) throws IOException, PortletException
+ {
+ filterChain.doFilter(resourceRequest, resourceResponse);
+ }
+
+ public void doFilter(EventRequest eventRequest, EventResponse eventResponse,
FilterChain filterChain) throws IOException, PortletException
+ {
+ filterChain.doFilter(eventRequest, eventResponse);
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/InfoBuilder.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/InfoBuilder.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/InfoBuilder.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,11 +22,10 @@
******************************************************************************/
package org.jboss.portal.portlet.deployment.jboss;
-import java.util.Collection;
-
-import org.jboss.portal.portlet.deployment.jboss.info.ContainerPortletInfoWrapper;
import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
+import java.util.Collection;
+
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
Modified:
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -22,15 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.deployment.jboss;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.management.MBeanServer;
-import javax.servlet.ServletContext;
-
import org.jboss.deployment.DeploymentException;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.xml.NullEntityResolver;
@@ -43,7 +34,6 @@
import org.jboss.portal.portlet.container.object.PortletFilterObject;
import org.jboss.portal.portlet.deployment.CorePortletInvoker;
import org.jboss.portal.portlet.deployment.PortletApplicationModelFactory;
-import org.jboss.portal.portlet.deployment.jboss.info.ContainerPortletInfoWrapper;
import org.jboss.portal.portlet.deployment.jboss.metadata.JBossApplicationMetaData;
import org.jboss.portal.portlet.deployment.jboss.metadata.JBossPortletMetaData;
import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle;
@@ -64,6 +54,14 @@
import org.jboss.xb.binding.UnmarshallerFactory;
import org.xml.sax.EntityResolver;
+import javax.management.MBeanServer;
+import javax.servlet.ServletContext;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
@@ -85,10 +83,10 @@
/** . */
protected PortletApplicationContextImpl portletApplicationContext;
-
+
/** . */
private PortletApplicationLifeCycle portletApplicationLifeCycle;
-
+
private ManagedObjectRegistryEventListener listener;
public PortletAppDeployment(URL url, PortalWebApp pwa,
ManagedObjectRegistryEventListener listener, MBeanServer mbeanServer,
PortletAppDeploymentFactory factory)
@@ -97,7 +95,7 @@
this.factory = factory;
this.listener = listener;
}
-
+
public void create() throws DeploymentException
{
importTLD();
@@ -150,12 +148,12 @@
public void start() throws DeploymentException
{
-
+
log.debug("Starting installation");
//
InfoBuilder infoBuilder =
factory.getCoreInfoBuilderFactory().createInfoBuilder(pwa, jbossAppMD, portletAppMD);
-
+
infoBuilder.build();
/*
ContainerInfoBuilderContext builderContext = new
ContainerInfoBuilderContextImpl(portletAppMD, pwa);
@@ -166,7 +164,6 @@
PortletApplicationObject portletApplicationObject = new
PortletApplicationImpl(infoBuilder.getApplication());
PortletApplicationContext portletApplicationContext = new
PortletApplicationContextImpl(pwa);
-
//
portletApplicationLifeCycle = new PortletApplicationLifeCycle(
listener,
@@ -186,26 +183,15 @@
//
for (PortletInfo portletInfo : infoBuilder.getPortlets())
{
- ContainerPortletInfo cpi = null;
- if (portletInfo instanceof ContainerPortletInfoWrapper)
- {
- cpi = ((ContainerPortletInfoWrapper)portletInfo).getContainerPortletInfo();
- }
- else
- {
- cpi = (ContainerPortletInfo)portletInfo;
- }
-
+ ContainerPortletInfo cpi = (ContainerPortletInfo)portletInfo;
PortletContainerObject portletContainerObject = new PortletContainerImpl(cpi);
PortletContainerContext portletContainerContext = new
PortletContainerContextImpl();
-
+
//
PortletContainerLifeCycle portletContainerLifeCycle =
portletApplicationLifeCycle.addPortletContainer(portletContainerContext,
portletContainerObject);
((CorePortletInvoker)factory.getCorePortletInvoker()).addPortletInfo(portletInfo.getApplicationName(),
portletInfo.getName(), portletInfo);
-
-
-
+
// Now create deps
for (String filterRef : cpi.getFilterRefs())
{
@@ -231,107 +217,104 @@
//
-
-
-
/*
- try
- {
- portletApplicationContext = new PortletApplicationContextImpl(
- factory.getWebAppRegistry(),
- factory.getPortletAPIFactory(),
- factory.getPortletInfoFactory(),
- portletAppMD,
- jbossAppMD,
- pwa.getServletContext(),
- pwa.getClassLoader(),
- pwa.getContextPath()
- );
-
- // Install portlet containers
- portletApplicationContext.startPortletApplication();
- }
- catch (Throwable e)
- {
- throw new DeploymentException("Cannot deploy portlet application",
e);
- }
-
- // Configure security
- PortletSecurityService portletSecurityService =
factory.getPortletSecurityService();
- if (portletSecurityService != null)
- {
- AuthorizationDomain authDomain =
portletSecurityService.getAuthorizationDomain();
- DomainConfigurator domainConfigurator = authDomain.getConfigurator();
-
- //
- for (Iterator i = jbossAppMD.getPortlets().values().iterator(); i.hasNext();)
- {
- JBossPortletMetaData portletMD = (JBossPortletMetaData)i.next();
- SecurityConstraintMetaData securityConstraintMD =
portletMD.getSecurityConstraint();
-
- //
- if (securityConstraintMD == null)
+ try
{
- securityConstraintMD = new SecurityConstraintMetaData();
- PolicyPermissionMetaData policyPermission = new
PolicyPermissionMetaData();
- policyPermission.setRoleName(SecurityConstants.UNCHECKED_ROLE_NAME);
- policyPermission.getActions().add("view");
-
securityConstraintMD.getPolicyPermissions().put(SecurityConstants.UNCHECKED_ROLE_NAME,
policyPermission);
- }
+ portletApplicationContext = new PortletApplicationContextImpl(
+ factory.getWebAppRegistry(),
+ factory.getPortletAPIFactory(),
+ factory.getPortletInfoFactory(),
+ portletAppMD,
+ jbossAppMD,
+ pwa.getServletContext(),
+ pwa.getClassLoader(),
+ pwa.getContextPath()
+ );
- //
- Set bindings = new HashSet();
- for (Iterator j =
securityConstraintMD.getPolicyPermissions().values().iterator(); j.hasNext();)
+ // Install portlet containers
+ portletApplicationContext.startPortletApplication();
+ }
+ catch (Throwable e)
{
- PolicyPermissionMetaData policyPermissionMD =
(PolicyPermissionMetaData)j.next();
- RoleSecurityBinding binding = new
RoleSecurityBinding(policyPermissionMD.getActions(), policyPermissionMD.getRoleName());
- bindings.add(binding);
+ throw new DeploymentException("Cannot deploy portlet
application", e);
}
- //
- try
+ // Configure security
+ PortletSecurityService portletSecurityService =
factory.getPortletSecurityService();
+ if (portletSecurityService != null)
{
- String portletId = pwa.getId() + "." + portletMD.getName();
- domainConfigurator.setSecurityBindings(portletId, bindings);
+ AuthorizationDomain authDomain =
portletSecurityService.getAuthorizationDomain();
+ DomainConfigurator domainConfigurator = authDomain.getConfigurator();
+
+ //
+ for (Iterator i = jbossAppMD.getPortlets().values().iterator();
i.hasNext();)
+ {
+ JBossPortletMetaData portletMD = (JBossPortletMetaData)i.next();
+ SecurityConstraintMetaData securityConstraintMD =
portletMD.getSecurityConstraint();
+
+ //
+ if (securityConstraintMD == null)
+ {
+ securityConstraintMD = new SecurityConstraintMetaData();
+ PolicyPermissionMetaData policyPermission = new
PolicyPermissionMetaData();
+
policyPermission.setRoleName(SecurityConstants.UNCHECKED_ROLE_NAME);
+ policyPermission.getActions().add("view");
+
securityConstraintMD.getPolicyPermissions().put(SecurityConstants.UNCHECKED_ROLE_NAME,
policyPermission);
+ }
+
+ //
+ Set bindings = new HashSet();
+ for (Iterator j =
securityConstraintMD.getPolicyPermissions().values().iterator(); j.hasNext();)
+ {
+ PolicyPermissionMetaData policyPermissionMD =
(PolicyPermissionMetaData)j.next();
+ RoleSecurityBinding binding = new
RoleSecurityBinding(policyPermissionMD.getActions(), policyPermissionMD.getRoleName());
+ bindings.add(binding);
+ }
+
+ //
+ try
+ {
+ String portletId = pwa.getId() + "." +
portletMD.getName();
+ domainConfigurator.setSecurityBindings(portletId, bindings);
+ }
+ catch (SecurityConfigurationException e)
+ {
+ log.error("Error in configuration", e);
+ }
+ }
}
- catch (SecurityConfigurationException e)
- {
- log.error("Error in configuration", e);
- }
- }
- }
-*/
+ */
//
super.start();
}
public void stop() throws DeploymentException
{
-
- /*
- PortletSecurityService portletSecurityService =
factory.getPortletSecurityService();
- if (portletSecurityService != null)
- {
- AuthorizationDomain authDomain =
portletSecurityService.getAuthorizationDomain();
- DomainConfigurator domainConfigurator = authDomain.getConfigurator();
- for (Iterator i = portletAppMD.getPortlets().values().iterator(); i.hasNext();)
- {
- PortletMetaData portletMD = (PortletMetaData)i.next();
- //
- try
+ /*
+ PortletSecurityService portletSecurityService =
factory.getPortletSecurityService();
+ if (portletSecurityService != null)
{
- String portletId = pwa.getId() + "." + portletMD.getId();
- domainConfigurator.removeSecurityBindings(portletId);
+ AuthorizationDomain authDomain =
portletSecurityService.getAuthorizationDomain();
+ DomainConfigurator domainConfigurator = authDomain.getConfigurator();
+ for (Iterator i = portletAppMD.getPortlets().values().iterator();
i.hasNext();)
+ {
+ PortletMetaData portletMD = (PortletMetaData)i.next();
+
+ //
+ try
+ {
+ String portletId = pwa.getId() + "." + portletMD.getId();
+ domainConfigurator.removeSecurityBindings(portletId);
+ }
+ catch (SecurityConfigurationException e)
+ {
+ log.error("Error in configuration", e);
+ }
+ }
}
- catch (SecurityConfigurationException e)
- {
- log.error("Error in configuration", e);
- }
- }
- }
-*/
+ */
//
super.stop();
}
Deleted:
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/info/ContainerPortletInfoWrapper.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/info/ContainerPortletInfoWrapper.java 2008-03-12
06:47:39 UTC (rev 10268)
+++
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/info/ContainerPortletInfoWrapper.java 2008-03-12
06:59:37 UTC (rev 10269)
@@ -1,36 +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.portlet.deployment.jboss.info;
-
-import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
-import org.jboss.portal.portlet.info.PortletInfo;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public interface ContainerPortletInfoWrapper extends PortletInfo
-{
- public ContainerPortletInfo getContainerPortletInfo();
-}
-