Author: julien(a)jboss.com
Date: 2008-02-29 12:00:22 -0500 (Fri, 29 Feb 2008)
New Revision: 10158
Added:
modules/portlet/trunk/mc/
modules/portlet/trunk/mc/pom.xml
modules/portlet/trunk/mc/src/
modules/portlet/trunk/mc/src/main/
modules/portlet/trunk/mc/src/main/java/
modules/portlet/trunk/mc/src/main/java/org/
modules/portlet/trunk/mc/src/main/java/org/jboss/
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationContextImpl.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployer.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployment.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletContainerContextImpl.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletFilterContextImpl.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/factory/
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/factory/LocalizedStringBuilder.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/factory/PortletApplicationModelFactory.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/AnnotationPortletApplication10MetaData.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/AnnotationPortletApplication20MetaData.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/PortletApplicationMetaDataException.java
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/ValueTrimmingFilter.java
modules/portlet/trunk/mc/src/test/
modules/portlet/trunk/mc/src/test/java/
modules/portlet/trunk/mc/src/test/java/org/
modules/portlet/trunk/mc/src/test/java/org/jboss/
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/AbstractMetaDataTestCase.java
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/CustomPortletModeTestEverythingTestCase.java
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/CustomWindowStateTestEverythingTestCase.java
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/EventTestEverythingTestCase.java
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/FilterTestEverythingTestCase.java
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/GeneralMetaDataTestCase.java
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/PortletTestEverythingTestCase.java
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/RenderParameterTestEverythingTestCase.java
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/SecurityConstraintTestEverythingTestCase.java
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/UserAttributeTestEverythingTestCase.java
modules/portlet/trunk/mc/src/test/resources/
modules/portlet/trunk/mc/src/test/resources/local-jboss-unit.xml
modules/portlet/trunk/mc/src/test/resources/metadata/
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet1-fail.xml
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/
modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/portlet1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/portlet2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/event/
modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event2-fail.xml
modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/filter/
modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filter1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filter2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/general/
modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app_1_0.xml
modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app_2_0.xml
modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2-jsr286.xml
modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_1_0.xsd
modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_2_0.xsd
modules/portlet/trunk/mc/src/test/resources/metadata/portlet/
modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1-simple.xml
modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2-jsr286.xml
modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter/
modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter/portlet2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/security/
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-fail1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-fail2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-fail1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-fail2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2.xml
modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/
modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portlet1.xml
modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portlet2.xml
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletContainerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletFilterContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/metadata/
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/
modules/portlet/trunk/test/src/test/resources/metadata/
Modified:
modules/portlet/trunk/pom.xml
modules/portlet/trunk/test/pom.xml
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletApplicationDeployer.java
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml
Log:
create a portlet-mc module for holding integration with JBoss MC
Added: modules/portlet/trunk/mc/pom.xml
===================================================================
--- modules/portlet/trunk/mc/pom.xml (rev 0)
+++ modules/portlet/trunk/mc/pom.xml 2008-02-29 17:00:22 UTC (rev 10158)
@@ -0,0 +1,58 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>portlet-mc</artifactId>
+ <packaging>jar</packaging>
+ <name>Portlet Container / JBoss MC integration</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-portlet</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-maven2</artifactId>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <testsuites>
+ <testsuite>
+ <config>local-jboss-unit.xml</config>
+ </testsuite>
+ </testsuites>
+ <reports>
+ <xml>target/tests/reports/xml/local</xml>
+ <html>target/tests/reports/html/local</html>
+ </reports>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationContextImpl.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationContextImpl.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationContextImpl.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.portlet.mc;
+
+import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
+import org.jboss.portal.web.WebApp;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletApplicationContextImpl implements PortletApplicationContext
+{
+
+ /** . */
+ private final WebApp webApp;
+
+ ManagedPortletApplication managedPortletApplication;
+
+ public PortletApplicationContextImpl(WebApp webApp)
+ {
+ this.webApp = webApp;
+ }
+
+ public ServletContext getServletContext()
+ {
+ return webApp.getServletContext();
+ }
+
+ public String getContextPath()
+ {
+ return webApp.getContextPath();
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return webApp.getClassLoader();
+ }
+
+ public void managedStart()
+ {
+ managedPortletApplication.managedStart();
+ }
+
+ public void managedStop()
+ {
+ managedPortletApplication.managedStop();
+ }
+}
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployer.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployer.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployer.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,346 @@
+/******************************************************************************
+ * 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.portlet.mc;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
+import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEventBroadcaster;
+import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEventListener;
+import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEvent;
+import org.jboss.portal.portlet.container.managed.ManagedObjectEvent;
+import org.jboss.portal.portlet.container.managed.ManagedObject;
+import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEvent;
+import org.jboss.portal.portlet.container.managed.LifeCycleStatus;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import static
org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_168_NS;
+import static
org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_286_NS;
+import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle;
+import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle;
+import org.jboss.portal.portlet.mc.metadata.factory.PortletApplicationModelFactory;
+import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplication10MetaData;
+import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplication20MetaData;
+import org.jboss.portal.portlet.mc.metadata.impl.ValueTrimmingFilter;
+import org.jboss.portal.web.ServletContainer;
+import org.jboss.portal.web.WebApp;
+import org.jboss.portal.web.WebAppEvent;
+import org.jboss.portal.web.WebAppLifeCycleEvent;
+import org.jboss.portal.web.WebAppListener;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletApplicationDeployer implements WebAppListener,
PortletApplicationRegistry
+{
+
+ static
+ {
+ try
+ {
+ SingletonSchemaResolverFactory factory =
SingletonSchemaResolverFactory.getInstance();
+ DefaultSchemaResolver resolver =
(DefaultSchemaResolver)factory.getSchemaBindingResolver();
+
+ /** SchemaResolver */
+ resolver.addSchemaLocation(PORTLET_JSR_168_NS,
"portlet-app_1_0.xsd");
+ resolver.addSchemaLocation(PORTLET_JSR_286_NS,
"portlet-app_2_0.xsd");
+ resolver.addClassBinding(PORTLET_JSR_286_NS,
AnnotationPortletApplication20MetaData.class);
+ resolver.addClassBinding(PORTLET_JSR_168_NS,
AnnotationPortletApplication10MetaData.class);
+ }
+ catch (Exception e)
+ {
+ throw new Error(e);
+ }
+ }
+
+ /** . */
+ private Logger log = Logger.getLogger(PortletApplicationDeployer.class);
+
+ /** . */
+ private PortletApplicationRegistry registry;
+
+ /** . */
+ private ServletContainer servletContainer;
+
+ /** . */
+ private Map<String, PortletApplicationDeployment> deploymentMap = new
HashMap<String, PortletApplicationDeployment>();
+
+ /** . */
+ private ClassLoader classLoader;
+
+ /** . */
+ private final Map<String, PortletApplicationLifeCycle> applications = new
HashMap<String, PortletApplicationLifeCycle>();
+
+ /** . */
+ private PortletContainerInvoker portletContainerInvoker;
+
+ /** . */
+ private ManagedObjectRegistryEventBroadcaster broadcaster;
+
+ public PortletApplicationRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(PortletApplicationRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public ServletContainer getServletContainer()
+ {
+ return servletContainer;
+ }
+
+ public void setServletContainer(ServletContainer servletContainer)
+ {
+ this.servletContainer = servletContainer;
+ }
+
+ public PortletContainerInvoker getPortletContainerInvoker()
+ {
+ return portletContainerInvoker;
+ }
+
+ public void setPortletContainerInvoker(PortletContainerInvoker
portletContainerInvoker)
+ {
+ this.portletContainerInvoker = portletContainerInvoker;
+ }
+
+ public void onEvent(WebAppEvent event)
+ {
+ if (event instanceof WebAppLifeCycleEvent)
+ {
+ WebAppLifeCycleEvent lifeCycleEvent = (WebAppLifeCycleEvent)event;
+ String cp = event.getWebApp().getContextPath();
+ switch (lifeCycleEvent.getType())
+ {
+ case WebAppLifeCycleEvent.ADDED:
+ log.debug("Going to install war file" + cp);
+ add(event.getWebApp());
+ log.debug("Installed war file" + cp);
+ break;
+ case WebAppLifeCycleEvent.REMOVED:
+ try
+ {
+ log.debug("Going to uninstall war file" + cp);
+ remove(event.getWebApp());
+ log.debug("Uninstalled war file" + cp);
+ }
+ catch (Throwable e)
+ {
+ log.error("Uninstalled war file " + cp + " with an
error", e);
+ }
+ break;
+ }
+ }
+ }
+
+ protected void add(WebApp webApp)
+ {
+ //
+ PortletApplication10MetaData metaData = buildPortletApplicationMetaData(webApp);
+ if (metaData != null)
+ {
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ PortletApplicationDeployment deployment = new
PortletApplicationDeployment(broadcaster, webApp, metaData);
+ deploymentMap.put(webApp.getContextPath(), deployment);
+ deployment.install();
+
+ //
+ PortletApplicationLifeCycle portletApplicationLifeCycle =
deployment.getPortletApplicationLifeCycle();
+ applications.put(portletApplicationLifeCycle.getId(),
portletApplicationLifeCycle);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
+ }
+ }
+
+ private void remove(WebApp webApp)
+ {
+ PortletApplicationDeployment deployment =
deploymentMap.remove(webApp.getContextPath());
+ if (deployment != null)
+ {
+ PortletApplicationLifeCycle portletApplicationLifeCycle =
deployment.getPortletApplicationLifeCycle();
+ applications.remove(portletApplicationLifeCycle.getId());
+
+ //
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ deployment.uninstall();
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
+ }
+ }
+
+ public void start()
+ {
+ broadcaster = new ManagedObjectRegistryEventBroadcaster();
+ classLoader = Thread.currentThread().getContextClassLoader();
+
+ //
+ broadcaster.addListener(bridgeToInvoker);
+ servletContainer.addWebAppListener(this);
+ }
+
+ public void stop()
+ {
+ // This should generate remove web app event and in cascade clear the registry
+ // as well as the portlet container invoker
+ servletContainer.removeWebAppListener(this);
+
+ //
+ classLoader = null;
+ broadcaster = null;
+ }
+
+ private PortletApplication10MetaData buildPortletApplicationMetaData(WebApp webApp)
+ {
+ try
+ {
+ URL url =
webApp.getServletContext().getResource("/WEB-INF/portlet.xml");
+ if (url != null)
+ {
+ InputStream in = null;
+ try
+ {
+ in = IOTools.safeBufferedWrapper(url.openStream());
+
+ // Validate
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setNamespaceAware(true);
+ unmarshaller.setSchemaValidation(false);
+ unmarshaller.setValidation(false);
+
+ //
+ PortletApplicationModelFactory factory = new
PortletApplicationModelFactory();
+
+ // Unmarshal
+ PortletApplication10MetaData portletApplicationMD =
(PortletApplication10MetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter(factory),
null);
+
+ //
+ return portletApplicationMD;
+ }
+ finally
+ {
+ IOTools.safeClose(in);
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ log.error("Cannot read portlet.xml", e);
+ }
+ catch (JBossXBException e)
+ {
+ log.error("Cannot parse portlet.xml", e);
+ }
+ return null;
+ }
+
+ public Collection<? extends ManagedPortletApplication>
getManagedPortletApplications()
+ {
+ return applications.values();
+ }
+
+ public ManagedPortletApplication getManagedPortletApplication(String id)
+ {
+ return applications.get(id);
+ }
+
+ public void addListener(ManagedObjectRegistryEventListener listener)
+ {
+ broadcaster.addListener(listener);
+ }
+
+ public void removeListener(ManagedObjectRegistryEventListener listener)
+ {
+ broadcaster.addListener(listener);
+ }
+
+ /**
+ * Bridge managed object event to add/remove portlet container in portlet container
invoker.
+ */
+ private final ManagedObjectRegistryEventListener bridgeToInvoker = new
ManagedObjectRegistryEventListener()
+ {
+ public void onEvent(ManagedObjectRegistryEvent event)
+ {
+ if (event instanceof ManagedObjectEvent)
+ {
+ ManagedObjectEvent managedObjectEvent = (ManagedObjectEvent)event;
+ ManagedObject managedObject = managedObjectEvent.getManagedObject();
+
+ //
+ if (managedObject instanceof PortletContainerLifeCycle)
+ {
+ PortletContainerLifeCycle portletContainerLifeCycle =
(PortletContainerLifeCycle)managedObject;
+ PortletContainer portletContainer =
portletContainerLifeCycle.getPortletContainer();
+
+ //
+ if (managedObjectEvent instanceof ManagedObjectLifeCycleEvent)
+ {
+ ManagedObjectLifeCycleEvent lifeCycleEvent =
(ManagedObjectLifeCycleEvent)managedObjectEvent;
+
+ //
+ LifeCycleStatus status = lifeCycleEvent.getStatus();
+
+ //
+ if (status == LifeCycleStatus.STARTED)
+ {
+ portletContainerInvoker.addPortletContainer(portletContainer);
+ }
+ else
+ {
+ portletContainerInvoker.removePortletContainer(portletContainer);
+ }
+ }
+ }
+ }
+ }
+ };
+}
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployment.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployment.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployment.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,168 @@
+/******************************************************************************
+ * 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.portlet.mc;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder;
+import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext;
+import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
+import org.jboss.portal.portlet.impl.info.ContainerFilterInfo;
+import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletFilterImpl;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle;
+import org.jboss.portal.portlet.impl.container.PortletFilterLifeCycle;
+import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle;
+import org.jboss.portal.portlet.container.object.PortletApplicationObject;
+import org.jboss.portal.portlet.container.object.PortletContainerObject;
+import org.jboss.portal.portlet.container.object.PortletFilterObject;
+import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEventListener;
+import org.jboss.portal.web.WebApp;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletApplicationDeployment
+{
+
+ /** . */
+ private final Logger log;
+
+ /** . */
+ private final WebApp webApp;
+
+ /** . */
+ private final PortletApplication10MetaData metaData;
+
+ /** . */
+ private final ManagedObjectRegistryEventListener listener;
+
+ /** . */
+ private PortletApplicationLifeCycle portletApplicationLifeCycle;
+
+ public PortletApplicationDeployment(
+ ManagedObjectRegistryEventListener listener,
+ WebApp webApp,
+ PortletApplication10MetaData metaData)
+ {
+ this.listener = listener;
+ this.webApp = webApp;
+ this.metaData = metaData;
+ this.log = Logger.getLogger(PortletApplicationDeployment.class + "." +
webApp.getContextPath().replace('.', '_'));
+ }
+
+ public PortletApplicationLifeCycle getPortletApplicationLifeCycle()
+ {
+ return portletApplicationLifeCycle;
+ }
+
+ void install()
+ {
+
+ log.debug("Starting installation");
+
+ //
+ ContainerInfoBuilderContext builderContext = new
ContainerInfoBuilderContextImpl(metaData, webApp);
+ ContainerInfoBuilder builder = new ContainerInfoBuilder(webApp.getContextPath(),
metaData, builderContext);
+ builder.build();
+
+ //
+ PortletApplicationObject portletApplicationObject = new
PortletApplicationImpl(builder.getApplication());
+ PortletApplicationContextImpl portletApplicationContext = new
PortletApplicationContextImpl(webApp);
+
+
+ //
+ portletApplicationLifeCycle = new PortletApplicationLifeCycle(
+ listener,
+ portletApplicationContext,
+ portletApplicationObject);
+
+ // Needed for the managed callbacks
+ portletApplicationContext.managedPortletApplication = portletApplicationLifeCycle;
+
+ //
+ for (ContainerFilterInfo filterInfo :
builder.getApplication().getFilters().values())
+ {
+ PortletFilterObject portletFilterObject = new PortletFilterImpl(filterInfo);
+ PortletFilterContextImpl portletFilterContext = new PortletFilterContextImpl();
+
+ //
+ PortletFilterLifeCycle portletFilterLifeCycle =
portletApplicationLifeCycle.addPortletFilter(portletFilterContext, portletFilterObject);
+
+ // Needed for the managed callbacks
+ portletFilterContext.managedPortletFilter = portletFilterLifeCycle;
+ }
+
+ //
+ for (ContainerPortletInfo containerInfo : builder.getPortlets())
+ {
+ PortletContainerObject portletContainerObject = new
PortletContainerImpl(containerInfo);
+ PortletContainerContextImpl portletContainerContext = new
PortletContainerContextImpl();
+
+ //
+ PortletContainerLifeCycle portletContainerLifeCycle =
portletApplicationLifeCycle.addPortletContainer(portletContainerContext,
portletContainerObject);
+
+ // Needed for the managed callbacks
+ portletContainerContext.managedPortletContainer = portletContainerLifeCycle;
+
+ // Now create deps
+ for (String filterRef : containerInfo.getFilterRefs())
+ {
+ PortletFilterLifeCycle portletFilterLifeCycle =
portletApplicationLifeCycle.getManagedPortletFilter(filterRef);
+
+ //
+ if (portletFilterLifeCycle != null)
+ {
+ portletApplicationLifeCycle.addDependency(portletFilterLifeCycle,
portletContainerLifeCycle);
+ }
+ else
+ {
+ // todo
+ }
+ }
+ }
+
+ //
+ portletApplicationLifeCycle.create();
+
+ //
+ portletApplicationLifeCycle.managedStart();
+
+ //
+
+ }
+
+ void uninstall()
+ {
+ log.debug("Uninstalling");
+
+ //
+ portletApplicationLifeCycle.managedStop();
+
+ //
+ log.debug("Uninstalled");
+ }
+}
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletContainerContextImpl.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletContainerContextImpl.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletContainerContextImpl.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.portlet.mc;
+
+import org.jboss.portal.portlet.container.PortletContainerContext;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletContainerContextImpl implements PortletContainerContext
+{
+
+ /** . */
+ ManagedPortletContainer managedPortletContainer;
+
+ public void managedStart()
+ {
+ managedPortletContainer.managedStart();
+ }
+
+ public void managedStop()
+ {
+ managedPortletContainer.managedStop();
+ }
+}
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletFilterContextImpl.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletFilterContextImpl.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletFilterContextImpl.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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.portlet.mc;
+
+import org.jboss.portal.portlet.container.PortletFilterContext;
+import org.jboss.portal.portlet.container.managed.ManagedPortletFilter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletFilterContextImpl implements PortletFilterContext
+{
+
+ ManagedPortletFilter managedPortletFilter;
+
+ public void managedStart()
+ {
+ managedPortletFilter.managedStart();
+ }
+
+ public void managedStop()
+ {
+ managedPortletFilter.managedStop();
+ }
+}
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/factory/LocalizedStringBuilder.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/factory/LocalizedStringBuilder.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/factory/LocalizedStringBuilder.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * 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.portlet.mc.metadata.factory;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapter;
+import org.jboss.portal.portlet.impl.metadata.common.LocalizedDescriptionMetaData;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class LocalizedStringBuilder
+{
+
+ /** The object to localized meta data. */
+ private Map<Object, LocalizedMetaDataContainer> map = new
LinkedHashMap<Object, LocalizedMetaDataContainer>();
+
+ /** The logger. */
+ private static final Logger log = Logger.getLogger(LocalizedStringBuilder.class);
+
+ public void put(Object object, LocalizedDescriptionMetaData description)
+ {
+ LocalizedMetaDataContainer container = map.get(object);
+ if (container == null)
+ {
+ container = new LocalizedMetaDataContainer();
+ map.put(object, container);
+ }
+ container.addLocalizedDescription(description);
+ }
+
+ public LocalizedString getLocalizedString(Object key)
+ {
+ try
+ {
+ return this.map.get(key) != null ? this.map.get(key).getLocalizedString() :
null;
+ }
+ catch (Exception e)
+ {
+ log.error("could not generate localized string.", e);
+ return null;
+ }
+ }
+
+ private static class LocalizedMetaDataContainer
+ {
+ /** The list of localiezd meta data */
+ private List<LocalizedDescriptionMetaData> list = new
ArrayList<LocalizedDescriptionMetaData>();
+
+ public void addLocalizedDescription(LocalizedDescriptionMetaData description)
+ {
+ this.list.add(description);
+ }
+
+ public LocalizedString getLocalizedString() throws Exception
+ {
+ LocalizedStringAdapter adapter = new LocalizedStringAdapter();
+ return adapter.unmarshal(list);
+ }
+ }
+}
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/factory/PortletApplicationModelFactory.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/factory/PortletApplicationModelFactory.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/factory/PortletApplicationModelFactory.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,850 @@
+/******************************************************************************
+ * 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.portlet.mc.metadata.factory;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.LifeCyclePhase;
+import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData;
+import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData;
+import org.jboss.portal.portlet.impl.metadata.ListenerMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import static
org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.DEFAULT_LOCALE;
+import static
org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_286_NS;
+import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaData;
+import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.ContainerRuntimeMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.LocalizedDescriptionMetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMappingMetaData;
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletCacheScopeEnum;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletInfoMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletModeMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferencesMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SecurityRoleRefMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportedLocaleMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportsMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.WindowStateMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.PortletCollectionMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.UserDataConstraintMetaData;
+import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplication10MetaData;
+import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplication20MetaData;
+import org.jboss.xb.binding.GenericObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletApplicationModelFactory implements GenericObjectModelFactory
+{
+
+ /** LocalizedDescriptionMetaData container for descriptions */
+ private LocalizedStringBuilder descriptions = new LocalizedStringBuilder();
+
+ /** LocalizedDescriptionMetaData container for displayNames */
+ private LocalizedStringBuilder displayNames = new LocalizedStringBuilder();
+
+ /** Guess what? The logger. */
+ private static final Logger log =
Logger.getLogger(PortletApplicationModelFactory.class);
+
+ public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+
+ String version = attrs.getValue("version");
+ String id = attrs.getValue("id");
+
+ // portlet-app 2.0 or 1.0
+ PortletApplication10MetaData md = PORTLET_JSR_286_NS.equals(nsURI)
+ ? new AnnotationPortletApplication20MetaData()
+ : new AnnotationPortletApplication10MetaData();
+
+ // Set portlet-app id
+ md.setId(id);
+ // Set portlet-app version
+ md.setVersion(version);
+ // return
+ return md;
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String nsURI, String
name)
+ {
+ return root;
+ }
+
+ public Object newChild(Object object, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ String id = attrs.getValue("id");
+ if (object instanceof DescribableMetaData)
+ {
+
+ if ("description".equals(localName))
+ {
+ String locale = attrs.getValue("xml:lang") != null ?
attrs.getValue("xml:lang") : DEFAULT_LOCALE;
+ LocalizedDescriptionMetaData localized = new
LocalizedDescriptionMetaData(locale);
+ this.descriptions.put(object, localized);
+ return localized;
+ }
+ }
+
+ // portlet-app
+ if (object instanceof PortletApplication10MetaData)
+ {
+ if ("portlet".equals(localName))
+ {
+ return new PortletMetaData(id);
+ }
+ else if ("custom-portlet-mode".equals(localName))
+ {
+ return new CustomPortletModeMetaData(id);
+ }
+ else if ("custom-window-state".equals(localName))
+ {
+ return new CustomWindowStateMetaData(id);
+ }
+ else if ("user-attribute".equals(localName))
+ {
+ return new UserAttributeMetaData(id);
+ }
+ else if ("security-constraint".equals(localName))
+ {
+ return new SecurityConstraintMetaData(id);
+ }
+ }
+
+ // portlet-app 2.0
+ if (object instanceof PortletApplication20MetaData &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ if ("public-render-parameter".equals(localName))
+ {
+ return new PublicRenderParameterMetaData(id);
+ }
+ else if ("event-definition".equals(localName))
+ {
+ return new EventDefinitionMetaData(id);
+ }
+ else if ("filter".equals(localName))
+ {
+ return new FilterMetaData();
+ }
+ else if ("filter-mapping".equals(localName))
+ {
+ return new FilterMappingMetaData();
+ }
+ else if ("listener".equals(localName))
+ {
+ return new ListenerMetaData(id);
+ }
+ else if ("container-runtime-option".equals(localName))
+ {
+ return new ContainerRuntimeMetaData();
+ }
+ }
+
+ // portlet
+ if (object instanceof PortletMetaData)
+ {
+ if ("init-param".equals(localName))
+ {
+ return new InitParamMetaData(id);
+ }
+ else if ("display-name".equals(localName))
+ {
+ String locale = attrs.getValue("xml:lang") != null ?
attrs.getValue("xml:lang") : DEFAULT_LOCALE;
+ LocalizedDescriptionMetaData localized = new
LocalizedDescriptionMetaData(locale);
+ this.displayNames.put(object, localized);
+ return localized;
+ }
+ else if ("supports".equals(localName))
+ {
+ return new SupportsMetaData(id);
+ }
+ else if ("supported-locale".equals(localName))
+ {
+ return new SupportedLocaleMetaData();
+ }
+ else if ("portlet-info".equals(localName))
+ {
+ return new PortletInfoMetaData(id);
+ }
+ else if ("portlet-preferences".equals(localName))
+ {
+ return new PortletPreferencesMetaData(id);
+ }
+ else if ("security-role-ref".equals(localName))
+ {
+ return new SecurityRoleRefMetaData(id);
+ }
+ else if ("supported-processing-event".equals(localName) &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ return new EventDefinitionReferenceMetaData(id);
+ }
+ else if ("supported-publishing-event".equals(localName) &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ return new EventDefinitionReferenceMetaData(id);
+ }
+ else if ("container-runtime-option".equals(localName) &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ return new ContainerRuntimeMetaData();
+ }
+ }
+
+ // security-constraint
+ if (object instanceof SecurityConstraintMetaData)
+ {
+ if ("portlet-collection".equals(localName))
+ {
+ return new PortletCollectionMetaData();
+ }
+ else if ("user-data-constraint".equals(localName))
+ {
+ return new UserDataConstraintMetaData(id);
+ }
+ else if ("display-name".equals(localName))
+ {
+ String locale = attrs.getValue("xml:lang") != null ?
attrs.getValue("xml:lang") : DEFAULT_LOCALE;
+ LocalizedDescriptionMetaData localized = new
LocalizedDescriptionMetaData(locale);
+ this.displayNames.put(object, localized);
+ return localized;
+ }
+ }
+
+ // supports
+ if (object instanceof SupportsMetaData)
+ {
+ if ("portlet-mode".equals(localName))
+ {
+ return new PortletModeMetaData();
+ }
+ else if ("window-state".equals(localName) &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ return new WindowStateMetaData();
+ }
+ }
+
+ // preference (in portlet-preferences)
+ if (object instanceof PortletPreferencesMetaData)
+ {
+ if ("preference".equals(localName))
+ {
+ return new PortletPreferenceMetaData(id);
+ }
+ }
+
+ // filter
+ if (object instanceof FilterMetaData)
+ {
+ if ("init-param".equals(localName))
+ {
+ return new InitParamMetaData(id);
+ }
+ else if ("display-name".equals(localName))
+ {
+ String locale = attrs.getValue("xml:lang") != null ?
attrs.getValue("xml:lang") : DEFAULT_LOCALE;
+ LocalizedDescriptionMetaData localized = new
LocalizedDescriptionMetaData(locale);
+ this.displayNames.put(object, localized);
+ return localized;
+ }
+ }
+
+ // listener
+ if (object instanceof ListenerMetaData)
+ {
+ if ("display-name".equals(localName))
+ {
+ String locale = attrs.getValue("xml:lang") != null ?
attrs.getValue("xml:lang") : DEFAULT_LOCALE;
+ LocalizedDescriptionMetaData localized = new
LocalizedDescriptionMetaData(locale);
+ this.displayNames.put(object, localized);
+ return localized;
+ }
+ }
+
+ return null;
+ }
+
+ public void addChild(Object parent, Object child, UnmarshallingContext nav, String
nsURI, String localName)
+ {
+
+ if (child instanceof DescribableMetaData)
+ {
+ DescribableMetaData md = (DescribableMetaData)child;
+ LocalizedString d = this.descriptions.getLocalizedString(md);
+ md.setDescription(d);
+ }
+
+ // portlet app
+ if (parent instanceof PortletApplication10MetaData)
+ {
+ PortletApplication10MetaData md = (PortletApplication10MetaData)parent;
+ // add portlet
+ if (child instanceof PortletMetaData)
+ {
+ PortletMetaData portlet = (PortletMetaData)child;
+ portlet.setDisplayName(this.displayNames.getLocalizedString(portlet));
+ md.addPortlet(portlet);
+ }
+ // add custom-portlet-mode
+ else if (child instanceof CustomPortletModeMetaData)
+ {
+ md.addCustomPortletMode((CustomPortletModeMetaData)child);
+ }
+ // add custom window state
+ else if (child instanceof CustomWindowStateMetaData)
+ {
+ md.addCustomWindowState((CustomWindowStateMetaData)child);
+ }
+ // add user-attribute
+ else if (child instanceof UserAttributeMetaData)
+ {
+ md.addUserAttribute((UserAttributeMetaData)child);
+ }
+ // add security-constraint
+ else if (child instanceof SecurityConstraintMetaData)
+ {
+ SecurityConstraintMetaData security = (SecurityConstraintMetaData)child;
+ // display-name
+ security.setDisplayName(this.displayNames.getLocalizedString(security));
+ md.addSecurityConstraint(security);
+ }
+ }
+
+ // portlet-app 2.0
+ if (parent instanceof PortletApplication20MetaData)
+ {
+ PortletApplication20MetaData md = (PortletApplication20MetaData)parent;
+ // add public-render-parameter
+ if (child instanceof PublicRenderParameterMetaData)
+ {
+ md.addPublicRenderParameter((PublicRenderParameterMetaData)child);
+ }
+ // add event-defintion
+ else if (child instanceof EventDefinitionMetaData)
+ {
+ md.addEventDefinition((EventDefinitionMetaData)child);
+ }
+ // add filter
+ else if (child instanceof FilterMetaData)
+ {
+ FilterMetaData filter = (FilterMetaData)child;
+ filter.setDisplayName(this.displayNames.getLocalizedString(filter));
+ md.addFilter(filter);
+ }
+ // add filter-mapping
+ else if (child instanceof FilterMappingMetaData)
+ {
+ md.addFilterMapping((FilterMappingMetaData)child);
+ }
+ // add container-runtime-option
+ else if (child instanceof ContainerRuntimeMetaData)
+ {
+ md.addContainerRuntime((ContainerRuntimeMetaData)child);
+ }
+ // add listener
+ else if (child instanceof ListenerMetaData)
+ {
+ ListenerMetaData listener = (ListenerMetaData)child;
+ listener.setDisplayName(this.displayNames.getLocalizedString(listener));
+ md.addListener(listener);
+ }
+ }
+
+ // portlet
+ if (parent instanceof PortletMetaData)
+ {
+ PortletMetaData md = (PortletMetaData)parent;
+ // init-param
+ if (child instanceof InitParamMetaData)
+ {
+ md.addInitParam((InitParamMetaData)child);
+ }
+ // supports
+ else if (child instanceof SupportsMetaData)
+ {
+ md.addSupport((SupportsMetaData)child);
+ }
+ // supported-locale
+ else if (child instanceof SupportedLocaleMetaData)
+ {
+ md.addSupportedLocale((SupportedLocaleMetaData)child);
+ }
+ // portlet-info
+ else if (child instanceof PortletInfoMetaData)
+ {
+ md.setPortletInfo((PortletInfoMetaData)child);
+ }
+ // portlet-preferences
+ else if (child instanceof PortletPreferencesMetaData)
+ {
+ md.setPortletPreferences((PortletPreferencesMetaData)child);
+ }
+ // security-role-ref
+ else if (child instanceof SecurityRoleRefMetaData)
+ {
+ md.addSecurityRoleRef((SecurityRoleRefMetaData)child);
+ }
+ // supported-events
+ else if (child instanceof EventDefinitionReferenceMetaData)
+ {
+ if ("supported-processing-event".equals(localName))
+ {
+ md.addSupportedProcessingEvent((EventDefinitionReferenceMetaData)child);
+ }
+ else if ("supported-publishing-event".equals(localName))
+ {
+ md.addSupportedPublishingEvent((EventDefinitionReferenceMetaData)child);
+ }
+ }
+ // container-runtime-option
+ else if (child instanceof ContainerRuntimeMetaData)
+ {
+ md.addContainerRuntime((ContainerRuntimeMetaData)child);
+ }
+ }
+
+ // adding user-data-constraint and portlet-name(s) to security-constraint
+ if (parent instanceof SecurityConstraintMetaData)
+ {
+ SecurityConstraintMetaData md = (SecurityConstraintMetaData)parent;
+ // add user-data-constraint
+ if (child instanceof UserDataConstraintMetaData)
+ {
+ md.setUserDataConstraint((UserDataConstraintMetaData)child);
+ }
+ // add portlet-collection
+ else if (child instanceof PortletCollectionMetaData)
+ {
+ md.setPortletList((PortletCollectionMetaData)child);
+ }
+ }
+
+ // filter
+ if (parent instanceof FilterMetaData)
+ {
+ FilterMetaData md = (FilterMetaData)parent;
+ // add init-param
+ if (child instanceof InitParamMetaData)
+ {
+ md.addInitParam((InitParamMetaData)child);
+ }
+ }
+
+ // add portlet-mode and window-state
+ if (parent instanceof SupportsMetaData)
+ {
+ SupportsMetaData md = (SupportsMetaData)parent;
+ if (child instanceof PortletModeMetaData)
+ {
+ md.addPortletMode((PortletModeMetaData)child);
+ }
+ else if (child instanceof WindowStateMetaData)
+ {
+ md.addWindowState((WindowStateMetaData)child);
+ }
+ }
+
+ // add preference
+ if (parent instanceof PortletPreferencesMetaData)
+ {
+ PortletPreferencesMetaData md = (PortletPreferencesMetaData)parent;
+ if (child instanceof PortletPreferenceMetaData)
+ {
+ md.addPortletPreference((PortletPreferenceMetaData)child);
+ }
+ }
+ }
+
+ public void setValue(Object object, UnmarshallingContext nav, String nsURI, String
localName, String value)
+ {
+
+ // JSR 286 portlet-app attributes - default-namespace and resource-bundle.
+ if (object instanceof PortletApplication20MetaData)
+ {
+ PortletApplication20MetaData md = (PortletApplication20MetaData)object;
+ if ("resource-bundle".equals(localName))
+ {
+ md.setResourceBundle(value);
+ }
+ else if ("default-namespace".equals(localName))
+ {
+ try
+ {
+ md.setDefaultNamespace(new URI(value));
+ }
+ catch (URISyntaxException e)
+ {
+ log.error("Invalid syntax for default-namespace: " + value);
+ }
+ }
+ }
+
+ // portlet
+ if (object instanceof PortletMetaData)
+ {
+ PortletMetaData md = (PortletMetaData)object;
+ if ("portlet-name".equals(localName))
+ {
+ md.setPortletName(value);
+ }
+ else if ("portlet-class".equals(localName))
+ {
+ md.setPortletClass(value);
+ }
+ else if ("cache-scope".equals(localName) &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ md.setCacheScope(PortletCacheScopeEnum.valueOf(value));
+ }
+ else if ("expiration-cache".equals(localName))
+ {
+ md.setExpirationCache(Integer.valueOf(value));
+ }
+ else if ("resource-bundle".equals(localName))
+ {
+ md.setResourceBundle(value);
+ }
+ else if ("supported-public-render-parameter".equals(localName)
&& PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ md.addSupportedPublicRenderParameter(value);
+ }
+ }
+
+ if (object instanceof LocalizedDescriptionMetaData)
+ {
+ LocalizedDescriptionMetaData localized = (LocalizedDescriptionMetaData)object;
+ if ("description".equals(localName))
+ {
+ localized.setDescription(value);
+ }
+ else if ("display-name".equals(localName))
+ {
+ localized.setDescription(value);
+ }
+ }
+
+ // init-param
+ if (object instanceof InitParamMetaData)
+ {
+ InitParamMetaData md = (InitParamMetaData)object;
+ if ("name".equals(localName))
+ {
+ md.setName(value);
+ }
+ else if ("value".equals(localName))
+ {
+ md.setValue(value);
+ }
+ }
+
+ // supports
+ if (object instanceof SupportsMetaData)
+ {
+ SupportsMetaData md = (SupportsMetaData)object;
+ if ("mime-type".equals(localName))
+ {
+ md.setMimeType(value);
+ }
+ }
+
+ // supports --- portlet-mode
+ if (object instanceof PortletModeMetaData)
+ {
+ PortletModeMetaData md = (PortletModeMetaData)object;
+ if ("portlet-mode".equals(localName))
+ {
+ md.setPortletMode(Mode.create(value));
+ }
+ }
+
+ // supports --- window-state
+ if (object instanceof WindowStateMetaData)
+ {
+ WindowStateMetaData md = (WindowStateMetaData)object;
+ if ("window-state".equals(localName))
+ {
+ md.setWindowState(WindowState.create(value));
+ }
+ }
+
+ // supported-locale
+ if (object instanceof SupportedLocaleMetaData)
+ {
+ SupportedLocaleMetaData md = (SupportedLocaleMetaData)object;
+ if ("supported-locale".equals(localName))
+ {
+ md.setLocale(value);
+ }
+ }
+
+ // portlet-info
+ if (object instanceof PortletInfoMetaData)
+ {
+ PortletInfoMetaData md = (PortletInfoMetaData)object;
+ if ("title".equals(localName))
+ {
+ md.setTitle(value);
+ }
+ else if ("short-title".equals(localName))
+ {
+ md.setShortTitle(value);
+ }
+ else if ("keywords".equals(localName))
+ {
+ md.setKeywords(value);
+ }
+ }
+
+ // portlet-preferences
+ if (object instanceof PortletPreferencesMetaData)
+ {
+ PortletPreferencesMetaData md = (PortletPreferencesMetaData)object;
+ if ("preferences-validator".equals(localName))
+ {
+ md.setPreferenceValidator(value);
+ }
+ }
+
+ // preference
+ if (object instanceof PortletPreferenceMetaData)
+ {
+ PortletPreferenceMetaData md = (PortletPreferenceMetaData)object;
+ if ("name".equals(localName))
+ {
+ md.setName(value);
+ }
+ else if ("value".equals(localName))
+ {
+ md.addValue(value);
+ }
+ else if ("read-only".equals(localName))
+ {
+ md.setReadOnly(Boolean.valueOf(value));
+ }
+ }
+
+ // security-role-ref
+ if (object instanceof SecurityRoleRefMetaData)
+ {
+ SecurityRoleRefMetaData md = (SecurityRoleRefMetaData)object;
+ if ("role-name".equals(localName))
+ {
+ md.setRoleName(value);
+ }
+ else if ("role-link".equals(localName))
+ {
+ md.setRoleLink(value);
+ }
+ }
+
+ // supported events
+ if (object instanceof EventDefinitionReferenceMetaData)
+ {
+ EventDefinitionReferenceMetaData md = (EventDefinitionReferenceMetaData)object;
+ if ("qname".equals(localName))
+ {
+ md.setQname(nav.resolveQName(value));
+ }
+ else if ("name".equals(localName))
+ {
+ md.setName(value);
+ }
+ }
+
+ // custom-portlet-mode
+ if (object instanceof CustomPortletModeMetaData)
+ {
+ CustomPortletModeMetaData mode = (CustomPortletModeMetaData)object;
+ if ("portlet-mode".equals(localName))
+ {
+ mode.setPortletMode(value);
+ }
+ else if ("portal-managed".equals(localName) &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ mode.setPortalManaged(Boolean.parseBoolean(value));
+ }
+ }
+
+ // custom-window-state
+ if (object instanceof CustomWindowStateMetaData)
+ {
+ CustomWindowStateMetaData md = (CustomWindowStateMetaData)object;
+ if ("window-state".equals(localName))
+ {
+ md.setWindowState(value);
+ }
+ }
+
+ // user-attribute
+ if (object instanceof UserAttributeMetaData)
+ {
+ UserAttributeMetaData md = (UserAttributeMetaData)object;
+ if ("name".equals(localName))
+ {
+ md.setName(value);
+ }
+ }
+
+ // user-data-constraint
+ if (object instanceof UserDataConstraintMetaData)
+ {
+ UserDataConstraintMetaData md = (UserDataConstraintMetaData)object;
+ if ("transport-guarantee".equals(localName))
+ {
+ md.setTransportQuarantee(TransportGuarantee.valueOf(value));
+ }
+ }
+
+ // portlet-collection in security-constraint
+ if (object instanceof PortletCollectionMetaData)
+ {
+ PortletCollectionMetaData md = (PortletCollectionMetaData)object;
+ if ("portlet-name".equals(localName))
+ {
+ md.addPortletname(value);
+ }
+ }
+
+ // filter
+ if (object instanceof FilterMetaData && PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ FilterMetaData md = (FilterMetaData)object;
+ if ("filter-class".equals(localName))
+ {
+ md.setFilterClass(value);
+ }
+ else if ("filter-name".equals(localName))
+ {
+ md.setFilterName(value);
+ }
+ else if ("lifecycle".equals(localName))
+ {
+ int end = value.length() - "_PHASE".length();
+ String lifeCycle = value.substring(0, end > 0 ? end : 0);
+ try
+ {
+ md.addLifecycle(LifeCyclePhase.valueOf(lifeCycle));
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new IllegalArgumentException("Invalid value for lifecycle.
Valid values are [RENDER_PHASE, RESOURCE_PHASE, ACTION_PHASE, EVENT_PHASE]");
+ }
+ }
+ }
+
+ // filter-mapping
+ if (object instanceof FilterMappingMetaData &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ FilterMappingMetaData md = (FilterMappingMetaData)object;
+ if ("filter-name".equals(localName))
+ {
+ md.setName(value);
+ }
+ if ("portlet-name".equals(localName))
+ {
+ md.addPortletName(value);
+ }
+ }
+
+ // event-defintion
+ if (object instanceof EventDefinitionMetaData &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ EventDefinitionMetaData md = (EventDefinitionMetaData)object;
+ if ("name".equals(localName))
+ {
+ md.setName(value);
+ }
+ else if ("qname".equals(localName))
+ {
+ md.setQname(nav.resolveQName(value));
+ }
+ else if ("value-type".equals(localName))
+ {
+ md.setValueType(value);
+ }
+ else if ("alias".equals(localName))
+ {
+ md.addAlias(nav.resolveQName(value));
+ }
+ }
+
+ // public-render-parameter
+ if (object instanceof PublicRenderParameterMetaData &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ PublicRenderParameterMetaData md = (PublicRenderParameterMetaData)object;
+ if ("identifier".equals(localName))
+ {
+ md.setIdentifier(value);
+ }
+ else if ("name".equals(localName))
+ {
+ md.setName(value);
+ }
+ else if ("qname".equals(localName))
+ {
+ md.setQname(nav.resolveQName(value));
+ }
+ else if ("alias".equals(localName))
+ {
+ md.addAlias(nav.resolveQName(value));
+ }
+ }
+
+ // container-runtime-option
+ if (object instanceof ContainerRuntimeMetaData &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ ContainerRuntimeMetaData md = (ContainerRuntimeMetaData)object;
+ if ("name".equals(localName))
+ {
+ md.setName(value);
+ }
+ else if ("value".equals(localName))
+ {
+ md.addValue(value);
+ }
+ }
+
+ // listener
+ if (object instanceof ListenerMetaData &&
PORTLET_JSR_286_NS.equals(nsURI))
+ {
+ ListenerMetaData md = (ListenerMetaData)object;
+ if ("listener-class".equals(localName))
+ {
+ md.setListenerClass(value);
+ }
+ }
+ }
+}
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/AnnotationPortletApplication10MetaData.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/AnnotationPortletApplication10MetaData.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/AnnotationPortletApplication10MetaData.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.portlet.mc.metadata.impl;
+
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlRootElement(name = "portlet-app")
+@XmlType(name = "portlet-appType")
+@JBossXmlSchema(xmlns = {@XmlNs(namespaceURI =
PortletMetaDataConstants.PORTLET_JSR_168_NS, prefix = "portlet")},
+ ignoreUnresolvedFieldOrClass = false,
+ namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS,
+ elementFormDefault = XmlNsForm.QUALIFIED)
+public class AnnotationPortletApplication10MetaData extends PortletApplication10MetaData
+{
+}
\ No newline at end of file
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/AnnotationPortletApplication20MetaData.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/AnnotationPortletApplication20MetaData.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/AnnotationPortletApplication20MetaData.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.portlet.mc.metadata.impl;
+
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+
+@XmlRootElement(name = "portlet-app")
+@XmlType(name = "portlet-appType")
+@JBossXmlSchema(xmlns = {@XmlNs(namespaceURI =
PortletMetaDataConstants.PORTLET_JSR_286_NS, prefix = "portlet")},
+ ignoreUnresolvedFieldOrClass = false,
+ namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS,
+ elementFormDefault = XmlNsForm.QUALIFIED)
+public class AnnotationPortletApplication20MetaData extends PortletApplication20MetaData
+{
+}
\ No newline at end of file
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/PortletApplicationMetaDataException.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/PortletApplicationMetaDataException.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/PortletApplicationMetaDataException.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * 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.portlet.mc.metadata.impl;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletApplicationMetaDataException extends Exception
+{
+ public PortletApplicationMetaDataException()
+ {
+ super();
+ }
+
+ public PortletApplicationMetaDataException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public PortletApplicationMetaDataException(String message)
+ {
+ super(message);
+ }
+
+ public PortletApplicationMetaDataException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Added:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/ValueTrimmingFilter.java
===================================================================
---
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/ValueTrimmingFilter.java
(rev 0)
+++
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/metadata/impl/ValueTrimmingFilter.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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.portlet.mc.metadata.impl;
+
+import org.jboss.xb.binding.GenericObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * Filter <code>setValue</code> method by doing a trimming before calling the
next model.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ValueTrimmingFilter implements GenericObjectModelFactory
+{
+
+ private final GenericObjectModelFactory next;
+
+ public ValueTrimmingFilter(GenericObjectModelFactory next) throws
IllegalArgumentException
+ {
+ if (next == null)
+ {
+ throw new IllegalArgumentException("Cannot be null");
+ }
+ this.next = next;
+ }
+
+ public Object newChild(Object object, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ return next.newChild(object, nav, nsURI, localName, attrs);
+ }
+
+ public void addChild(Object parent, Object child, UnmarshallingContext nav, String
nsURI, String localName)
+ {
+ next.addChild(parent, child, nav, nsURI, localName);
+ }
+
+ public void setValue(Object object, UnmarshallingContext nav, String nsURI, String
localName, String value)
+ {
+ value = value.trim();
+ next.setValue(object, nav, nsURI, localName, value);
+ }
+
+ public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ return next.newRoot(root, nav, nsURI, localName, attrs);
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName)
+ {
+ return next.completeRoot(root, nav, nsURI, localName);
+ }
+
+}
\ No newline at end of file
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/AbstractMetaDataTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/AbstractMetaDataTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/AbstractMetaDataTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,171 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.jboss.portal.portlet.mc.metadata.factory.PortletApplicationModelFactory;
+import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplication10MetaData;
+import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplication20MetaData;
+import org.jboss.portal.portlet.mc.metadata.impl.ValueTrimmingFilter;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+
+import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.*;
+
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
+import org.xml.sax.SAXException;
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public abstract class AbstractMetaDataTestCase
+{
+
+ /** Test parameter for using xml binding annotation. */
+ public static final String ANNOTATION_BINDING = "annotation";
+
+ /** Test parameter for using the ObjectModelFactory. */
+ public static final String FACTORY_BINDING = "factory";
+
+ /** The schema resolver factory. */
+ protected static SingletonSchemaResolverFactory factory;
+
+ /** The schema resolver. */
+ protected static DefaultSchemaResolver resolver;
+
+ /** The unmarshaller. */
+ protected Unmarshaller unmarshaller = null;
+
+ /** Annotation or ObjectModelFactory parsing. */
+ private String parser;
+
+ @Parameter(name = "parser")
+ public void setParser(String parser)
+ {
+ this.parser = parser;
+ }
+
+ static
+ {
+ try
+ {
+ factory = SingletonSchemaResolverFactory.getInstance();
+ resolver = (DefaultSchemaResolver) factory.getSchemaBindingResolver();
+
+ /** SchemaResolver */
+ resolver.addSchemaLocation(PORTLET_JSR_168_NS,
"portlet-app_1_0.xsd");
+ resolver.addSchemaLocation(PORTLET_JSR_286_NS,
"portlet-app_2_0.xsd");
+ resolver.addClassBinding(PORTLET_JSR_286_NS,
AnnotationPortletApplication20MetaData.class);
+ resolver.addClassBinding(PORTLET_JSR_168_NS,
AnnotationPortletApplication10MetaData.class);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ protected PortletApplication10MetaData unmarshall10(String file) throws
JBossXBException, SAXException, IOException
+ {
+ if (ANNOTATION_BINDING.equals(parser))
+ {
+ return this.unmarshallAnnotation(file);
+ }
+ else if (FACTORY_BINDING.equals(parser))
+ {
+ return this.unmarshallWithFactory(file);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Wrong parameter for parser.");
+ }
+ }
+
+ protected PortletApplication20MetaData unmarshall20(String file) throws
JBossXBException, SAXException, IOException
+ {
+ if (ANNOTATION_BINDING.equals(parser))
+ {
+ return (PortletApplication20MetaData)this.unmarshallAnnotation(file);
+ }
+ else if (FACTORY_BINDING.equals(parser))
+ {
+ return (PortletApplication20MetaData)this.unmarshallWithFactory(file);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Wrong parameter for parser.");
+ }
+ }
+
+ private PortletApplication10MetaData unmarshallAnnotation(String file) throws
JBossXBException, SAXException,
+ IOException
+ {
+ /** validate */
+ unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setNamespaceAware(true);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setValidation(true);
+
+ /** unmarshal */
+ return (PortletApplication10MetaData) unmarshaller.unmarshal(getPath(file),
resolver);
+ }
+
+ private PortletApplication10MetaData unmarshallWithFactory(String file) throws
JBossXBException
+ {
+ /** validate */
+ unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setNamespaceAware(true);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setValidation(true);
+
+ PortletApplicationModelFactory factory = new PortletApplicationModelFactory();
+ /** unmarshal */
+ return (PortletApplication10MetaData) unmarshaller.unmarshal(getStream(file), new
ValueTrimmingFilter(factory),
+ null);
+ }
+
+ protected String getPath(String file)
+ {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(file);
+ if (url == null)
+ {
+ fail(file + " not found.");
+ }
+ return url.toString();
+ }
+
+ protected InputStream getStream(String file)
+ {
+ return Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
+ }
+
+}
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/CustomPortletModeTestEverythingTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/CustomPortletModeTestEverythingTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/CustomPortletModeTestEverythingTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,131 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class CustomPortletModeTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+
+ @Test
+ public void test01()
+ {
+ try
+ {
+ String xmlFile = "metadata/customPortletMode/portlet1.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+ assertNotNull(md.getCustomPortletModes());
+
+ CustomPortletModeMetaData cmd1 =
md.getCustomPortletModes().get("Custom");
+ assertNotNull(cmd1);
+ assertEquals("mode1", cmd1.getId());
+ assertEquals("Custom", cmd1.getPortletMode());
+ assertEquals("portletMode1",
cmd1.getDescription().getDefaultString());
+ assertEquals("eigener portlet modus",
cmd1.getDescription().getString(new Locale("de"), false));
+
+ assertNotNull(md.getCustomPortletModes().get("Custom2"));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/customPortletMode/portlet2.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ CustomPortletModeMetaData cmd1 =
md.getCustomPortletModes().get("Custom");
+ assertNotNull(cmd1);
+ assertEquals("Custom", cmd1.getPortletMode());
+ assertEquals("portletMode1",
cmd1.getDescription().getDefaultString());
+ assertEquals(true, cmd1.isPortalManaged());
+ assertEquals("cmode1", cmd1.getId());
+
+ CustomPortletModeMetaData cmd2 =
md.getCustomPortletModes().get("Custom2");
+ assertNotNull(cmd2);
+ assertEquals("Custom2", cmd2.getPortletMode());
+ assertEquals(false, cmd2.isPortalManaged());
+
+ CustomPortletModeMetaData cmd3 =
md.getCustomPortletModes().get("Custom3");
+ assertNotNull(cmd3);
+ assertEquals("Custom3", cmd3.getPortletMode());
+
+ // default value
+ assertEquals(true, cmd3.isPortalManaged());
+ assertEquals("eigener portlet modus",
cmd1.getDescription().getString(new Locale("de"), false));
+ assertEquals("Portlet Mode Three",
cmd3.getDescription().getDefaultString());
+
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test03()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/customPortletMode/portlet1-fail.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ fail("portlet 2.0 properties are not allowed");
+ }
+ catch (Exception e)
+ {
+ // OK
+ }
+ }
+
+}
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/CustomWindowStateTestEverythingTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/CustomWindowStateTestEverythingTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/CustomWindowStateTestEverythingTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,103 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class CustomWindowStateTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+ @Test
+ public void test01()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/customWindowState/portlet1.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+
+ CustomWindowStateMetaData cws1 =
md.getCustomWindowStates().get("windowState1");
+ assertEquals("WindowState",
cws1.getDescription().getDefaultString());
+ assertEquals("windowState1", cws1.getWindowState());
+ assertEquals("Offenes Fenster", cws1.getDescription().getString(new
Locale("de"), false));
+ assertEquals("foo", cws1.getId());
+ CustomWindowStateMetaData cws2 =
md.getCustomWindowStates().get("windowState2");
+ assertNotNull(cws2);
+
+ CustomWindowStateMetaData cws3 =
md.getCustomWindowStates().get("windowState3");
+ assertEquals("drei", cws3.getId());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/customWindowState/portlet2.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ CustomWindowStateMetaData cws1 =
md.getCustomWindowStates().get("windowState1");
+ assertEquals("WindowState",
cws1.getDescription().getDefaultString());
+ assertEquals("windowState1", cws1.getWindowState());
+ assertEquals("Offenes Fenster", cws1.getDescription().getString(new
Locale("de"), false));
+ assertEquals("foo", cws1.getId());
+
+ CustomWindowStateMetaData cws2 =
md.getCustomWindowStates().get("windowState2");
+ assertNotNull(cws2);
+
+ CustomWindowStateMetaData cws3 =
md.getCustomWindowStates().get("windowState3");
+ assertEquals("drei", cws3.getId());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+}
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/EventTestEverythingTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/EventTestEverythingTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/EventTestEverythingTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,145 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class EventTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ @Test
+ public void test01()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/event/portlet-event1.xml";
+
+ unmarshall10(xmlFile);
+ fail();
+ }
+ catch (Exception e)
+ {
+ // ok
+ }
+ }
+
+ @Test
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/event/portlet-event2.xml";
+
+ PortletApplication20MetaData md = unmarshall20(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ EventDefinitionMetaData emd = md.getEvents().get(0);
+ QName qname = emd.getQname();
+ assertEquals("eventID", emd.getId());
+
assertEquals("http://example.com/testEvents",
qname.getNamespaceURI());
+ assertEquals("portletEvent", qname.getLocalPart());
+ assertEquals("x", qname.getPrefix());
+ assertEquals("org.jboss.portal.event.invoke.refill.beer",
emd.getValueType());
+ assertEquals("descriptionDefaultLanguage",
emd.getDescription().getDefaultString());
+ assertEquals("descriptionDefaultLanguage",
emd.getDescription().getString(new Locale("en"), false));
+ assertEquals("Beschreibung in Deutsch",
emd.getDescription().getString(new Locale("de"), false));
+
+ EventDefinitionMetaData emd2 = md.getEvents().get(1);
+
+ assertNull(emd2.getQname());
+ assertEquals("hellouh", emd2.getName());
+ assertEquals("hello", emd2.getAlias().get(0).getLocalPart());
+
+ // portlet event reference testing
+ PortletMetaData p1 = md.getPortlet("Portlet2");
+ QName referenceQName = new
QName("http://example.com/testEvents",
"portletEvent");
+ assertNotNull(p1);
+ assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet",
p1.getPortletClass());
+
+ EventDefinitionReferenceMetaData ermd1 =
p1.getSupportedProcessingEvent().get(0);
+ assertNotNull(ermd1);
+ assertEquals(referenceQName, ermd1.getQname());
+
+ EventDefinitionReferenceMetaData ermd2 =
p1.getSupportedProcessingEvent().get(1);
+ assertNotNull(ermd2);
+ assertEquals("hellouh", ermd2.getName());
+
+ EventDefinitionReferenceMetaData ermd3 =
p1.getSupportedPublishingEvent().get(0);
+ assertNotNull(ermd3);
+ assertEquals(referenceQName, ermd3.getQname());
+
+ EventDefinitionReferenceMetaData ermd4 =
p1.getSupportedPublishingEvent().get(1);
+ assertNotNull(ermd4);
+ assertEquals("hellouh", ermd4.getName());
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test021()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/event/portlet-event2-fail.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertEquals("2.0", md.getVersion());
+
+// EventDefinitionMetaData edm = md.getEvents().get(0);
+
+ fail("Should fail: choice and qname defined!");
+ }
+ catch (Exception e)
+ {
+ // ok
+ }
+ }
+
+
+}
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/FilterTestEverythingTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/FilterTestEverythingTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/FilterTestEverythingTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.LifeCyclePhase;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class FilterTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ @Test
+ public void test01()
+ {
+ try
+ {
+ unmarshall10("metadata/filter/portlet-filter1.xml");
+ // no filters in jsr 168
+ fail();
+ }
+ catch (Exception e)
+ {
+ // ok
+ }
+ }
+
+ @Test
+ public void test02()
+ {
+ try
+ {
+ String xmlFile = "metadata/filter/portlet-filter2.xml";
+
+ PortletApplication20MetaData md = unmarshall20(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+
+ FilterMetaData filter = md.getFilter("testFilter");
+ assertNotNull(filter);
+ assertEquals("org.jboss.portal.meta.NoExistingClass",
filter.getFilterClass());
+ assertEquals("testFilter", filter.getFilterName());
+ assertEquals(LifeCyclePhase.ACTION, filter.getLifecycle().get(0));
+ assertEquals(LifeCyclePhase.RENDER, filter.getLifecycle().get(1));
+
+ assertEquals("test", filter.getDescription().getDefaultString());
+ assertEquals("bla", filter.getDescription().getString(new
Locale("de"), false));
+
+ assertEquals("foo", filter.getDisplayName().getString(new
Locale("fr"), false));
+ assertEquals("foobar", filter.getDisplayName().getDefaultString());
+
+ InitParamMetaData ip = filter.getInitParams().get(0);
+ assertEquals("eins", ip.getId());
+ assertEquals("foo", ip.getName());
+ assertEquals("bar", ip.getValue());
+ assertNotNull(ip.getDescription());
+
+ InitParamMetaData ip2 = filter.getInitParams().get(1);
+ assertEquals("test", ip2.getName());
+ assertEquals("testing", ip2.getValue());
+ assertNull(ip2.getId());
+
+ //
+ FilterMetaData filter2 = md.getFilter("testFilterZwei");
+ assertEquals("testFilterZwei", filter2.getFilterName());
+ assertEquals(LifeCyclePhase.ACTION, filter2.getLifecycle().get(0));
+
+ // Filter mapping
+ assertTrue(md.getFilterMapping().containsKey("testFilter"));
+ assertEquals("Portlet1",
md.getFilterMapping().get("testFilter").getPortletNames().get(0));
+ assertEquals("Portlet2",
md.getFilterMapping().get("testFilter").getPortletNames().get(1));
+
+ assertTrue(md.getFilterMapping().containsKey("testFilterZwei"));
+ assertEquals("Portlet2",
md.getFilterMapping().get("testFilterZwei").getPortletNames().get(0));
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+}
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/GeneralMetaDataTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/GeneralMetaDataTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/GeneralMetaDataTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,151 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import java.net.URI;
+import java.util.Locale;
+
+import org.jboss.portal.portlet.impl.metadata.ListenerMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class GeneralMetaDataTestCase extends AbstractMetaDataTestCase
+{
+
+ @Test
+ public void test01()
+ {
+ try
+ {
+ PortletApplication10MetaData md =
this.unmarshall10("metadata/general/portlet1.xml");
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail("No exception expected");
+ }
+ }
+
+ @Test
+ public void test02()
+ {
+ try
+ {
+ PortletApplication10MetaData md =
this.unmarshall10("metadata/general/portlet2.xml");
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test021()
+ {
+ try
+ {
+ PortletApplication20MetaData md =
unmarshall20("metadata/general/portlet2-jsr286.xml");
+ assertEquals("2.0", md.getVersion());
+ assertTrue(md instanceof PortletApplication20MetaData);
+
+ assertEquals("MyResourceBundle", md.getResourceBundle());
+ assertEquals(new URI("foobar"), md.getDefaultNamespace());
+
+ PublicRenderParameterMetaData prp1 = md.getPublicRenderParameters().get(0);
+
+ assertEquals("Public render parameter one",
prp1.getDescription().getDefaultString());
+ assertEquals("param1", prp1.getId());
+ assertEquals("param1", prp1.getName());
+ assertEquals("Parameter1", prp1.getAlias().get(0).getLocalPart());
+ assertEquals("Parameter2", prp1.getAlias().get(1).getLocalPart());
+ assertEquals("blub", prp1.getIdentifier());
+
+ assertEquals("foobar",
md.getContainerRuntimeOption("foo").getValues().get(0));
+ assertEquals("foobar2",
md.getContainerRuntimeOption("foo").getValues().get(1));
+
+ ListenerMetaData listener1 = md.getListeners().get(0);
+ assertNotNull(listener1);
+ assertEquals("org.jboss.portal.portlet.test.listener.MyListener",
listener1.getListenerClass());
+ assertEquals("Mein Zuh\u00f6rer Eins",
listener1.getDisplayName().getString(new Locale("de"), false));
+ assertEquals("Beschreibung", listener1.getDescription().getString(new
Locale("de"), false));
+
+ assertNotNull(md.getListeners().get(1));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test01_generated()
+ {
+ try
+ {
+ PortletApplication10MetaData md =
unmarshall10("metadata/general/portlet-app_1_0.xml");
+
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+ assertNotNull(md.getCustomPortletModes());
+
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test02_generated()
+ {
+ try
+ {
+ PortletApplication10MetaData md =
this.unmarshall10("metadata/general/portlet-app_2_0.xml");
+ assertEquals("2.0", md.getVersion());
+ assertTrue(md instanceof PortletApplication20MetaData);
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+}
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/PortletTestEverythingTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/PortletTestEverythingTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/PortletTestEverythingTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,506 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import java.util.List;
+import java.util.Locale;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletCacheScopeEnum;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletInfoMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferencesMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SecurityRoleRefMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportedLocaleMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportsMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ @Test
+ public void test01()
+ {
+ try
+ {
+ String xmlFile = "metadata/portlet/portlet1.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+
+ Locale fr = new Locale("fr");
+ Locale default_locale = new Locale(PortletMetaDataConstants.DEFAULT_LOCALE);
+
+ PortletMetaData p1 = md.getPortlet("Portlet1");
+ assertNotNull(p1);
+ assertEquals(md, p1.getPortletApplication());
+ assertEquals("fragmichnicht", p1.getId());
+ assertEquals("Portlet1", p1.getPortletName());
+ assertEquals(default_locale, p1.getDescription().getDefaultLocale());
+ assertEquals("default", p1.getDescription().getDefaultString());
+ assertEquals("defaut", p1.getDescription().getString(fr, false));
+ assertEquals(default_locale, p1.getDisplayName().getDefaultLocale());
+ assertEquals("display", p1.getDisplayName().getDefaultString());
+ assertEquals("affichage", p1.getDisplayName().getString(fr, false));
+ assertEquals("org.jboss.portal.test.portlet.TestPortlet",
p1.getPortletClass());
+
+ InitParamMetaData ip1 = p1.getInitParams().get(0);
+ assertEquals(default_locale, ip1.getDescription().getDefaultLocale());
+ assertEquals("first parameter",
ip1.getDescription().getDefaultString());
+ assertEquals("premier parametre", ip1.getDescription().getString(fr,
false));
+ assertEquals("one", ip1.getName());
+ assertEquals("1", ip1.getValue());
+
+ InitParamMetaData ip2 = p1.getInitParams().get(1);
+ assertNotNull(ip2);
+ assertEquals("second parameter",
ip2.getDescription().getDefaultString());
+ assertEquals("deuxieme parametre", ip2.getDescription().getString(fr,
false));
+ assertEquals("two", ip2.getName());
+ assertEquals("2", ip2.getValue());
+
+ // Expiration cache
+ assertEquals(0, p1.getExpirationCache());
+
+ SupportsMetaData smd1 = p1.getSupports().get(0);
+ assertEquals("text/html", smd1.getMimeType());
+ assertEquals(Mode.create("VIEW"),
smd1.getPortletModes().get(0).getPortletMode());
+ assertEquals(Mode.create("EDIT"),
smd1.getPortletModes().get(1).getPortletMode());
+ assertEquals(Mode.create("HELP"),
smd1.getPortletModes().get(2).getPortletMode());
+
+ SupportsMetaData smd2 = p1.getSupports().get(1);
+ assertEquals("text/wml", smd2.getMimeType());
+ assertEquals(Mode.create("VIEW"),
smd2.getPortletModes().get(0).getPortletMode());
+ assertEquals(Mode.create("HELP"),
smd2.getPortletModes().get(1).getPortletMode());
+
+ assertEquals("MyResourceBundle", p1.getResourceBundle());
+
+ List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
+ assertEquals(3, localeList.size());
+ assertEquals("en", localeList.get(0).getLocale());
+ assertEquals("fr", localeList.get(1).getLocale());
+ assertEquals("fr_FR", localeList.get(2).getLocale());
+
+ PortletInfoMetaData pimd = p1.getPortletInfo();
+ assertNotNull(pimd);
+ assertEquals("very long portlet title", pimd.getTitle());
+ assertEquals("short portlet title", pimd.getShortTitle());
+ assertEquals("a,b,c,d,e,f", pimd.getKeywords());
+
+ PortletPreferencesMetaData ppmd = p1.getPortletPreferences();
+ assertNotNull(ppmd);
+
+ assertEquals("MyValidator", ppmd.getPreferenceValidator());
+ assertEquals("1",
ppmd.getPortletPreferences().get("one").getValue().get(0));
+ assertEquals("2",
ppmd.getPortletPreferences().get("two").getValue().get(0));
+ assertEquals(false,
ppmd.getPortletPreferences().get("two").isReadOnly());
+ assertEquals("3",
ppmd.getPortletPreferences().get("three").getValue().get(0));
+ assertEquals(true,
ppmd.getPortletPreferences().get("three").isReadOnly());
+ assertEquals("1",
ppmd.getPortletPreferences().get("all").getValue().get(0));
+ assertEquals("2",
ppmd.getPortletPreferences().get("all").getValue().get(1));
+ assertEquals("3",
ppmd.getPortletPreferences().get("all").getValue().get(2));
+
+ SecurityRoleRefMetaData srrmd1 = p1.getSecurityRoleRef().get(0);
+ assertNotNull(srrmd1);
+ assertEquals("role with no link",
srrmd1.getDescription().getDefaultString());
+ assertEquals("role sans link", srrmd1.getDescription().getString(fr,
false));
+ assertEquals("ROLE_NAME_WITHOUT_LINK", srrmd1.getRoleName());
+
+ SecurityRoleRefMetaData srrmd2 = p1.getSecurityRoleRef().get(1);
+ assertNotNull(srrmd2);
+ assertEquals("role with link",
srrmd2.getDescription().getDefaultString());
+ assertEquals("role avec link", srrmd2.getDescription().getString(fr,
false));
+ assertEquals("ROLE_NAME_WITH_LINK", srrmd2.getRoleName());
+ assertEquals("ROLE_LINK", srrmd2.getRoleLink());
+
+ // Portlet 2
+
+ PortletMetaData p2 = md.getPortlet("Portlet2");
+ assertNotNull(p2);
+ assertEquals(md, p2.getPortletApplication());
+ assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet",
p2.getPortletClass());
+ assertEquals("text/html", p2.getSupports().get(0).getMimeType());
+ assertEquals("test the portlet session",
p2.getPortletInfo().getTitle());
+
+ // default value should be 0
+ assertEquals(0, p2.getExpirationCache());
+
+ PortletMetaData p3 = md.getPortlet("Portlet3");
+ assertNotNull(p3);
+ assertEquals(md, p3.getPortletApplication());
+
+ PortletMetaData p4 = md.getPortlet("Portlet4");
+ assertNotNull(p4);
+ assertEquals(md, p4.getPortletApplication());
+
+ PortletMetaData p5 = md.getPortlet("Portlet5");
+ assertNotNull(p5);
+ assertEquals(md, p5.getPortletApplication());
+ PortletPreferencesMetaData ppmd5 = p5.getPortletPreferences();
+ assertEquals("1",
ppmd5.getPortletPreferences().get("one").getValue().get(0));
+ assertEquals("2",
ppmd5.getPortletPreferences().get("two").getValue().get(0));
+ assertEquals(false,
ppmd5.getPortletPreferences().get("two").isReadOnly());
+ assertEquals("3",
ppmd5.getPortletPreferences().get("three").getValue().get(0));
+ assertEquals(true,
ppmd5.getPortletPreferences().get("three").isReadOnly());
+ assertEquals("1",
ppmd5.getPortletPreferences().get("all").getValue().get(0));
+ assertEquals("2",
ppmd5.getPortletPreferences().get("all").getValue().get(1));
+ assertEquals("3",
ppmd5.getPortletPreferences().get("all").getValue().get(2));
+
+ PortletMetaData p6 = md.getPortlet("Portlet6");
+ assertNotNull(p6);
+ assertEquals(md, p6.getPortletApplication());
+ assertEquals("Portlet6", p6.getResourceBundle());
+ assertEquals(3, p6.getSupportedLocale().size());
+ assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
+ assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
+ assertEquals("fr_FR", p6.getSupportedLocale().get(2).getLocale());
+
+ PortletMetaData p7 = md.getPortlet("Portlet7");
+ assertNotNull(p7);
+
+ PortletMetaData p8 = md.getPortlet("Portlet8");
+ assertNotNull(p8);
+
+ PortletMetaData p9 = md.getPortlet("Portlet9");
+ assertNotNull(p9);
+
+ PortletMetaData p10 = md.getPortlet("Portlet10");
+ assertNotNull(p10);
+
+ PortletMetaData p11 = md.getPortlet("Portlet11");
+ assertNotNull(p11);
+
+ PortletMetaData p12 = md.getPortlet("Portlet12");
+ assertNotNull(p12);
+ assertEquals(60, p12.getExpirationCache());
+
+ PortletMetaData p13 = md.getPortlet("Portlet13");
+ assertNotNull(p13);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test02()
+ {
+ try
+ {
+ String xmlFile = "metadata/portlet/portlet2.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ Locale fr = new Locale("fr");
+ Locale default_locale = new Locale(PortletMetaDataConstants.DEFAULT_LOCALE);
+
+ PortletMetaData p1 = md.getPortlet("Portlet1");
+ assertNotNull(p1);
+ assertEquals("fragmichnicht2", p1.getId());
+ assertEquals("Portlet1", p1.getPortletName());
+ assertEquals(default_locale, p1.getDescription().getDefaultLocale());
+ assertEquals("default", p1.getDescription().getDefaultString());
+ assertEquals("defaut", p1.getDescription().getString(fr, false));
+ assertEquals(default_locale, p1.getDisplayName().getDefaultLocale());
+ assertEquals("display", p1.getDisplayName().getDefaultString());
+ assertEquals("affichage", p1.getDisplayName().getString(fr, false));
+ assertEquals("org.jboss.portal.test.portlet.TestPortlet",
p1.getPortletClass());
+
+ InitParamMetaData ip1 = p1.getInitParams().get(0);
+ assertEquals(default_locale, ip1.getDescription().getDefaultLocale());
+ assertEquals("first parameter",
ip1.getDescription().getDefaultString());
+ assertEquals("premier parametre", ip1.getDescription().getString(fr,
false));
+ assertEquals("one", ip1.getName());
+ assertEquals("1", ip1.getValue());
+
+ InitParamMetaData ip2 = p1.getInitParams().get(1);
+ assertNotNull(ip2);
+ assertEquals("second parameter",
ip2.getDescription().getDefaultString());
+ assertEquals("deuxieme parametre", ip2.getDescription().getString(fr,
false));
+ assertEquals("two", ip2.getName());
+ assertEquals("2", ip2.getValue());
+
+ // Expiration cache
+ assertEquals(0, p1.getExpirationCache());
+
+ // cache Scope - JSR 286
+ assertEquals(PortletCacheScopeEnum.PUBLIC, p1.getCacheScope());
+
+ SupportsMetaData smd1 = p1.getSupports().get(0);
+ assertEquals("text/html", smd1.getMimeType());
+ assertEquals(Mode.create("VIEW"),
smd1.getPortletModes().get(0).getPortletMode());
+ assertEquals(Mode.create("EDIT"),
smd1.getPortletModes().get(1).getPortletMode());
+ assertEquals(Mode.create("HELP"),
smd1.getPortletModes().get(2).getPortletMode());
+
+ SupportsMetaData smd2 = p1.getSupports().get(1);
+ assertEquals("text/wml", smd2.getMimeType());
+ assertEquals(Mode.create("VIEW"),
smd2.getPortletModes().get(0).getPortletMode());
+ assertEquals(Mode.create("HELP"),
smd2.getPortletModes().get(1).getPortletMode());
+
+ List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
+ assertEquals(3, localeList.size());
+ assertEquals("en", localeList.get(0).getLocale());
+ assertEquals("fr", localeList.get(1).getLocale());
+ assertEquals("fr_FR", localeList.get(2).getLocale());
+
+ assertEquals("MyResourceBundle", p1.getResourceBundle());
+
+ PortletInfoMetaData pimd = p1.getPortletInfo();
+ assertNotNull(pimd);
+ assertEquals("very long portlet title", pimd.getTitle());
+ assertEquals("short portlet title", pimd.getShortTitle());
+ assertEquals("a,b,c,d,e,f", pimd.getKeywords());
+
+ PortletPreferencesMetaData ppmd = p1.getPortletPreferences();
+ assertNotNull(ppmd);
+ assertEquals("MyValidator", ppmd.getPreferenceValidator());
+ assertEquals("1",
ppmd.getPortletPreferences().get("one").getValue().get(0));
+ assertEquals("2",
ppmd.getPortletPreferences().get("two").getValue().get(0));
+ assertEquals(false,
ppmd.getPortletPreferences().get("two").isReadOnly());
+ assertEquals("3",
ppmd.getPortletPreferences().get("three").getValue().get(0));
+ assertEquals(true,
ppmd.getPortletPreferences().get("three").isReadOnly());
+ assertEquals("1",
ppmd.getPortletPreferences().get("all").getValue().get(0));
+ assertEquals("2",
ppmd.getPortletPreferences().get("all").getValue().get(1));
+ assertEquals("3",
ppmd.getPortletPreferences().get("all").getValue().get(2));
+
+ SecurityRoleRefMetaData srrmd1 = p1.getSecurityRoleRef().get(0);
+ assertNotNull(srrmd1);
+ assertEquals("role with no link",
srrmd1.getDescription().getDefaultString());
+ assertEquals("role sans link", srrmd1.getDescription().getString(fr,
false));
+ assertEquals("ROLE_NAME_WITHOUT_LINK", srrmd1.getRoleName());
+
+ SecurityRoleRefMetaData srrmd2 = p1.getSecurityRoleRef().get(1);
+ assertNotNull(srrmd2);
+ assertEquals("role with link",
srrmd2.getDescription().getDefaultString());
+ assertEquals("role avec link", srrmd2.getDescription().getString(fr,
false));
+ assertEquals("ROLE_NAME_WITH_LINK", srrmd2.getRoleName());
+ assertEquals("ROLE_LINK", srrmd2.getRoleLink());
+
+ // Portlet2
+
+ PortletMetaData p2 = md.getPortlet("Portlet2");
+ assertNotNull(p2);
+ assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet",
p2.getPortletClass());
+ assertEquals("text/html", p2.getSupports().get(0).getMimeType());
+ assertEquals("test the portlet session",
p2.getPortletInfo().getTitle());
+
+ PortletMetaData p3 = md.getPortlet("Portlet3");
+ assertNotNull(p3);
+
+ PortletMetaData p4 = md.getPortlet("Portlet4");
+ assertNotNull(p4);
+
+ PortletMetaData p5 = md.getPortlet("Portlet5");
+ assertNotNull(p5);
+ PortletPreferencesMetaData ppmd5 = p5.getPortletPreferences();
+ assertEquals("1",
ppmd5.getPortletPreferences().get("one").getValue().get(0));
+ assertEquals("2",
ppmd5.getPortletPreferences().get("two").getValue().get(0));
+ assertEquals(false,
ppmd5.getPortletPreferences().get("two").isReadOnly());
+ assertEquals("3",
ppmd5.getPortletPreferences().get("three").getValue().get(0));
+ assertEquals(true,
ppmd5.getPortletPreferences().get("three").isReadOnly());
+ assertEquals("1",
ppmd5.getPortletPreferences().get("all").getValue().get(0));
+ assertEquals("2",
ppmd5.getPortletPreferences().get("all").getValue().get(1));
+ assertEquals("3",
ppmd5.getPortletPreferences().get("all").getValue().get(2));
+
+ PortletMetaData p6 = md.getPortlet("Portlet6");
+ assertNotNull(p6);
+ assertEquals("Portlet6", p6.getResourceBundle());
+ assertEquals(3, p6.getSupportedLocale().size());
+ assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
+ assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
+ assertEquals("fr_FR", p6.getSupportedLocale().get(2).getLocale());
+
+ PortletMetaData p7 = md.getPortlet("Portlet7");
+ assertNotNull(p7);
+
+ PortletMetaData p8 = md.getPortlet("Portlet8");
+ assertNotNull(p8);
+
+ PortletMetaData p9 = md.getPortlet("Portlet9");
+ assertNotNull(p9);
+
+ PortletMetaData p10 = md.getPortlet("Portlet10");
+ assertNotNull(p10);
+
+ PortletMetaData p11 = md.getPortlet("Portlet11");
+ assertNotNull(p11);
+
+ PortletMetaData p12 = md.getPortlet("Portlet12");
+ assertNotNull(p12);
+ assertEquals(60, p12.getExpirationCache());
+
+ PortletMetaData p13 = md.getPortlet("Portlet13");
+ assertNotNull(p13);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test021()
+ {
+ try
+ {
+ String xmlFile = "metadata/portlet/portlet2-jsr286.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ Locale fr = new Locale("fr");
+ Locale default_locale = new Locale(PortletMetaDataConstants.DEFAULT_LOCALE);
+
+ PortletMetaData p1 = md.getPortlet("Portlet1");
+ assertNotNull(p1);
+ assertEquals("fragmichnicht2", p1.getId());
+ assertEquals("Portlet1", p1.getPortletName());
+ assertEquals(default_locale, p1.getDescription().getDefaultLocale());
+ assertEquals("default", p1.getDescription().getDefaultString());
+ assertEquals("defaut", p1.getDescription().getString(fr, false));
+ assertEquals(default_locale, p1.getDisplayName().getDefaultLocale());
+ assertEquals("display", p1.getDisplayName().getDefaultString());
+ assertEquals("affichage", p1.getDisplayName().getString(fr, false));
+ assertEquals("org.jboss.portal.test.portlet.TestPortlet",
p1.getPortletClass());
+
+ InitParamMetaData ip1 = p1.getInitParams().get(0);
+ assertEquals(default_locale, ip1.getDescription().getDefaultLocale());
+ assertEquals("first parameter",
ip1.getDescription().getDefaultString());
+ assertEquals("premier parametre", ip1.getDescription().getString(fr,
false));
+ assertEquals("one", ip1.getName());
+ assertEquals("1", ip1.getValue());
+
+ InitParamMetaData ip2 = p1.getInitParams().get(1);
+ assertNotNull(ip2);
+ assertEquals("second parameter",
ip2.getDescription().getDefaultString());
+ assertEquals("deuxieme parametre", ip2.getDescription().getString(fr,
false));
+ assertEquals("two", ip2.getName());
+ assertEquals("2", ip2.getValue());
+
+ // Expiration cache
+ assertEquals(0, p1.getExpirationCache());
+
+ SupportsMetaData smd1 = p1.getSupports().get(0);
+ assertEquals("text/html", smd1.getMimeType());
+ assertEquals(Mode.create("VIEW"),
smd1.getPortletModes().get(0).getPortletMode());
+ assertEquals(Mode.create("EDIT"),
smd1.getPortletModes().get(1).getPortletMode());
+ assertEquals(Mode.create("HELP"),
smd1.getPortletModes().get(2).getPortletMode());
+ // window state jsr 286
+ assertEquals(WindowState.create("MAXIMIZED"),
smd1.getWindowStates().get(0).getWindowState());
+ assertEquals(WindowState.create("NORMAL"),
smd1.getWindowStates().get(1).getWindowState());
+
+ SupportsMetaData smd2 = p1.getSupports().get(1);
+ assertEquals("foo", smd2.getId());
+ assertEquals("text/wml", smd2.getMimeType());
+ assertEquals(Mode.create("VIEW"),
smd2.getPortletModes().get(0).getPortletMode());
+ assertEquals(Mode.create("HELP"),
smd2.getPortletModes().get(1).getPortletMode());
+ // window state jsr 286
+ assertEquals(WindowState.create("NORMAL"),
smd2.getWindowStates().get(0).getWindowState());
+ assertEquals(WindowState.create("CUSTOM"),
smd2.getWindowStates().get(1).getWindowState());
+
+ List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
+ assertEquals(3, localeList.size());
+ assertEquals("en", localeList.get(0).getLocale());
+ assertEquals("fr", localeList.get(1).getLocale());
+ assertEquals("fr_FR", localeList.get(2).getLocale());
+
+ assertEquals("MyResourceBundle", p1.getResourceBundle());
+
+ PortletInfoMetaData pimd = p1.getPortletInfo();
+ assertNotNull(pimd);
+ assertEquals("very long portlet title", pimd.getTitle());
+ assertEquals("short portlet title", pimd.getShortTitle());
+ assertEquals("a,b,c,d,e,f", pimd.getKeywords());
+
+ PortletPreferencesMetaData ppmd = p1.getPortletPreferences();
+ assertNotNull(ppmd);
+ assertEquals("MyValidator", ppmd.getPreferenceValidator());
+ assertEquals("1",
ppmd.getPortletPreferences().get("one").getValue().get(0));
+ assertEquals("2",
ppmd.getPortletPreferences().get("two").getValue().get(0));
+ assertEquals(false,
ppmd.getPortletPreferences().get("two").isReadOnly());
+ assertEquals("3",
ppmd.getPortletPreferences().get("three").getValue().get(0));
+ assertEquals(true,
ppmd.getPortletPreferences().get("three").isReadOnly());
+ assertEquals("1",
ppmd.getPortletPreferences().get("all").getValue().get(0));
+ assertEquals("2",
ppmd.getPortletPreferences().get("all").getValue().get(1));
+ assertEquals("3",
ppmd.getPortletPreferences().get("all").getValue().get(2));
+
+ SecurityRoleRefMetaData srrmd1 = p1.getSecurityRoleRef().get(0);
+ assertNotNull(srrmd1);
+ assertEquals("role with no link",
srrmd1.getDescription().getDefaultString());
+ assertEquals("role sans link", srrmd1.getDescription().getString(fr,
false));
+ assertEquals("ROLE_NAME_WITHOUT_LINK", srrmd1.getRoleName());
+
+ SecurityRoleRefMetaData srrmd2 = p1.getSecurityRoleRef().get(1);
+ assertNotNull(srrmd2);
+ assertEquals("role with link",
srrmd2.getDescription().getDefaultString());
+ assertEquals("role avec link", srrmd2.getDescription().getString(fr,
false));
+ assertEquals("ROLE_NAME_WITH_LINK", srrmd2.getRoleName());
+ assertEquals("ROLE_LINK", srrmd2.getRoleLink());
+
+ // JSR 286 properties
+ assertEquals(PortletCacheScopeEnum.PUBLIC, p1.getCacheScope());
+
assertEquals("http://example.com/testEvents",
p1.getSupportedProcessingEvent().get(0).getQname()
+ .getNamespaceURI());
+ assertEquals("portletEvent",
p1.getSupportedProcessingEvent().get(0).getQname().getLocalPart());
+ assertEquals("x",
p1.getSupportedProcessingEvent().get(0).getQname().getPrefix());
+ assertEquals("foo", p1.getSupportedPublicRenderParameters().get(0));
+ assertEquals("bar", p1.getSupportedPublicRenderParameters().get(1));
+ assertEquals("foo2", p1.getSupportedPublicRenderParameters().get(2));
+ assertEquals("foo2bar",
p1.getSupportedPublicRenderParameters().get(3));
+
+ assertTrue(p1.getContainerRuntimeOptions().containsKey("option1"));
+ assertTrue(p1.getContainerRuntimeOptions().containsKey("option2"));
+ assertEquals("value1",
p1.getContainerRuntimeOptions().get("option1").getValues().get(0));
+ assertEquals("value2",
p1.getContainerRuntimeOptions().get("option1").getValues().get(1));
+ assertEquals("value3",
p1.getContainerRuntimeOptions().get("option2").getValues().get(0));
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+}
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/RenderParameterTestEverythingTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/RenderParameterTestEverythingTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/RenderParameterTestEverythingTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class RenderParameterTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ @Test
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/renderParameter/portlet2.xml";
+
+ PortletApplication20MetaData md = unmarshall20(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ PublicRenderParameterMetaData prp1 = md.getPublicRenderParameters().get(0);
+ assertNotNull(prp1);
+
+ assertEquals("blah", prp1.getIdentifier());
+ assertEquals("renderParameter1", prp1.getName());
+
+
+ PublicRenderParameterMetaData prp2 = md.getPublicRenderParameters().get(1);
+ assertEquals("foo", prp2.getQname().getLocalPart());
+ assertEquals("x", prp2.getQname().getPrefix());
+ assertEquals("http://someurl.com",
prp2.getQname().getNamespaceURI());
+
+ assertEquals("fooo", prp1.getAlias().get(0).getLocalPart());
+ assertEquals("rP1", prp1.getAlias().get(1).getLocalPart());
+
+ assertEquals("foo", prp2.getAlias().get(0).getLocalPart());
+ assertEquals("http://someurl.alias.com",
prp2.getAlias().get(0).getNamespaceURI());
+ assertEquals("s", prp2.getAlias().get(0).getPrefix());
+
+ assertEquals("render parameter foo",
prp1.getDescription().getDefaultString());
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+}
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/SecurityConstraintTestEverythingTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/SecurityConstraintTestEverythingTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/SecurityConstraintTestEverythingTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,215 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class SecurityConstraintTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ @Test
+ public void test01()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/security/portlet1.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+ assertEquals("1.0", md.getVersion());
+
+ SecurityConstraintMetaData scd1 = md.getSecurityConstraints().get(0);
+ assertNotNull(scd1);
+ assertEquals("test", scd1.getDisplayName().getDefaultString());
+ assertEquals("Test", scd1.getDisplayName().getString(new
Locale("de"), false));
+ assertEquals(TransportGuarantee.NONE,
scd1.getUserDataConstraint().getTransportQuarantee());
+
+ assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
+ assertEquals("foobar",
scd1.getPortletList().getPortletNames().get(1));
+ assertEquals("foo", scd1.getId());
+
+ SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
+ assertNotNull(scd2);
+ assertEquals(TransportGuarantee.INTEGRAL,
scd2.getUserDataConstraint().getTransportQuarantee());
+ assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
+ assertEquals("fooConstraint",
scd1.getUserDataConstraint().getDescription().getDefaultString());
+ assertEquals("FooConstraint",
scd1.getUserDataConstraint().getDescription().getString(new Locale("de"),
false));
+
+ try
+ {
+ scd2.getPortletList().getPortletNames().get(1);
+ fail("2nd security constraint should only contain one element,");
+ }
+ catch (IndexOutOfBoundsException e)
+ {
+ // expected java.lang.IndexOutOfBoundsException
+ }
+
+ PortletMetaData pmd1 = md.getPortlet("foo");
+ assertNotNull(pmd1);
+
+ PortletMetaData pmd2 = md.getPortlet("foobar");
+ assertNotNull(pmd2);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ /*
+ public void test011()
+ {
+ try
+ {
+
+ String xmlFile = "security/portlet1-fail1.xml";
+ String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+
+ unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+
+ fail();
+ }
+ catch(Exception e)
+ {
+ // OK
+ }
+ }
+
+ public void test012()
+ {
+ try
+ {
+
+ String xmlFile = "security/portlet1-fail1.xml";
+ String namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS;
+
+ unmarshall(xmlFile, namespace, PortletApplication10MetaData.class);
+ fail();
+ }
+ catch(Exception e)
+ {
+ // OK
+ }
+ }
+ */
+
+ @Test
+ public void test02()
+ {
+ try
+ {
+
+ String xmlFile = "metadata/security/portlet2.xml";
+
+ PortletApplication10MetaData md = unmarshall10( xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+ assertEquals("2.0", md.getVersion());
+
+ SecurityConstraintMetaData scd1 = md.getSecurityConstraints().get(0);
+ assertNotNull(scd1);
+ assertEquals("test", scd1.getDisplayName().getDefaultString());
+ assertEquals("Test", scd1.getDisplayName().getString(new
Locale("de"), false));
+ assertEquals("foo", scd1.getId());
+
+ assertEquals(TransportGuarantee.NONE,
scd1.getUserDataConstraint().getTransportQuarantee());
+ assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
+ assertEquals("foobar",
scd1.getPortletList().getPortletNames().get(1));
+
+
+ SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
+ assertNotNull(scd2);
+ assertEquals(TransportGuarantee.INTEGRAL,
scd2.getUserDataConstraint().getTransportQuarantee());
+ assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
+ assertEquals("fooConstraint",
scd1.getUserDataConstraint().getDescription().getDefaultString());
+ assertEquals("FooConstraint",
scd1.getUserDataConstraint().getDescription().getString(new Locale("de"),
false));
+
+ try
+ {
+ scd2.getPortletList().getPortletNames().get(1);
+ fail("2nd security constraint should only contain one element,");
+ }
+ catch (IndexOutOfBoundsException e)
+ {
+ // expected java.lang.IndexOutOfBoundsException
+ }
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+ /*
+ public void test021()
+ {
+ try
+ {
+
+ String xmlFile = "security/portlet2-fail1.xml";
+ String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+ unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+ fail();
+ }
+ catch(Exception e)
+ {
+ // OK
+ }
+ }
+
+ public void test022()
+ {
+ try
+ {
+
+ String xmlFile = "security/portlet2-fail2.xml";
+ String namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS;
+
+ unmarshall(xmlFile, namespace, PortletApplication20MetaData.class);
+ fail();
+ }
+ catch(Exception e)
+ {
+ // OK
+ }
+ }
+ */
+}
Added:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/UserAttributeTestEverythingTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/UserAttributeTestEverythingTestCase.java
(rev 0)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/UserAttributeTestEverythingTestCase.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,100 @@
+/******************************************************************************
+ * 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.mc.metadata;
+
+import java.util.Locale;
+
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import static org.jboss.unit.api.Assert.*;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class UserAttributeTestEverythingTestCase extends AbstractMetaDataTestCase
+{
+
+ @Test
+ public void test01()
+ {
+ try
+ {
+ String xmlFile = "metadata/userAttribute/portlet1.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication10MetaData);
+
+ UserAttributeMetaData umb = md.getUserAttributes().get("blub");
+ assertNotNull(umb);
+ assertEquals("notFoo", umb.getId());
+ assertNull(umb.getDescription());
+
+ UserAttributeMetaData umd = md.getUserAttributes().get("foo");
+ assertNotNull(umd);
+ assertEquals("realFoo", umd.getId());
+ assertEquals("foobar", umd.getDescription().getDefaultString());
+ assertEquals("fuhbar", umd.getDescription().getString(new
Locale("de"), true));
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ @Test
+ public void test02()
+ {
+ try
+ {
+ String xmlFile = "metadata/userAttribute/portlet2.xml";
+
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
+ assertNotNull(md);
+ assertTrue(md instanceof PortletApplication20MetaData);
+
+ UserAttributeMetaData umb = md.getUserAttributes().get("blub");
+ assertNotNull(umb);
+ assertEquals("notFoo", umb.getId());
+ assertNull(umb.getDescription());
+
+ UserAttributeMetaData umd = md.getUserAttributes().get("foo");
+ assertNotNull(umd);
+ assertEquals("realFoo", umd.getId());
+ assertEquals("foobar", umd.getDescription().getDefaultString());
+ assertEquals("fuhbar", umd.getDescription().getString(new
Locale("de"), true));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+}
Added: modules/portlet/trunk/mc/src/test/resources/local-jboss-unit.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/local-jboss-unit.xml
(rev 0)
+++ modules/portlet/trunk/mc/src/test/resources/local-jboss-unit.xml 2008-02-29 17:00:22
UTC (rev 10158)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-unit
+ xmlns="urn:jboss:jboss-unit:1.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
+ <pojo>
+ <test>
+ <class
name="org.jboss.portal.portlet.mc.metadata.CustomPortletModeTestEverythingTestCase"
/>
+ <parameter name="parser">
+ <value>annotation</value>
+ <value>factory</value>
+ </parameter>
+ </test>
+ <test>
+ <class
name="org.jboss.portal.portlet.mc.metadata.CustomWindowStateTestEverythingTestCase"
/>
+ <parameter name="parser">
+ <value>annotation</value>
+ <value>factory</value>
+ </parameter>
+ </test>
+ <test>
+ <class
name="org.jboss.portal.portlet.mc.metadata.EventTestEverythingTestCase" />
+ <parameter name="parser">
+ <value>annotation</value>
+ <value>factory</value>
+ </parameter>
+ </test>
+ <test>
+ <class
name="org.jboss.portal.portlet.mc.metadata.FilterTestEverythingTestCase" />
+ <parameter name="parser">
+ <value>annotation</value>
+ <value>factory</value>
+ </parameter>
+ </test>
+ <test>
+ <class
name="org.jboss.portal.portlet.mc.metadata.GeneralMetaDataTestCase" />
+ <parameter name="parser">
+ <value>annotation</value>
+ <value>factory</value>
+ </parameter>
+ </test>
+ <test>
+ <class
name="org.jboss.portal.portlet.mc.metadata.PortletTestEverythingTestCase" />
+ <parameter name="parser">
+ <value>annotation</value>
+ <value>factory</value>
+ </parameter>
+ </test>
+ <test>
+ <class
name="org.jboss.portal.portlet.mc.metadata.RenderParameterTestEverythingTestCase"
/>
+ <parameter name="parser">
+ <value>annotation</value>
+ <value>factory</value>
+ </parameter>
+ </test>
+ <test>
+ <class
name="org.jboss.portal.portlet.mc.metadata.SecurityConstraintTestEverythingTestCase"
/>
+ <parameter name="parser">
+ <value>annotation</value>
+ <value>factory</value>
+ </parameter>
+ </test>
+ <test>
+ <class
name="org.jboss.portal.portlet.mc.metadata.UserAttributeTestEverythingTestCase"
/>
+ <parameter name="parser">
+ <value>annotation</value>
+ <value>factory</value>
+ </parameter>
+ </test>
+ </pojo>
+</jboss-unit>
Added:
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet1-fail.xml
===================================================================
---
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet1-fail.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet1-fail.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <custom-portlet-mode id="cmode1">
+ <description>portletMode1</description>
+ <description xml:lang="de">eigener portlet modus</description>
+ <portlet-mode>Custom</portlet-mode>
+ <portal-managed>true</portal-managed>
+ <decoration-name>Portlet Mode One</decoration-name>
+ <decoration-name xml:lang="de">Eigener Portlet Modus
Eins</decoration-name>
+ </custom-portlet-mode>
+
+ <custom-portlet-mode>
+ <decoration-name>Portlet Mode One</decoration-name>
+ <portlet-mode>Custom2</portlet-mode>
+ <portal-managed>false</portal-managed>
+ </custom-portlet-mode>
+
+</portlet-app>
\ No newline at end of file
Added:
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet1.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <custom-portlet-mode id="mode1">
+ <description>portletMode1</description>
+ <description xml:lang="de">eigener portlet modus</description>
+ <portlet-mode>Custom</portlet-mode>
+ </custom-portlet-mode>
+
+ <custom-portlet-mode>
+ <portlet-mode>Custom2</portlet-mode>
+ </custom-portlet-mode>
+
+</portlet-app>
\ No newline at end of file
Added:
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet2.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/customPortletMode/portlet2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <custom-portlet-mode id="cmode1">
+ <description>portletMode1</description>
+ <description xml:lang="de">eigener portlet modus</description>
+ <portlet-mode>Custom</portlet-mode>
+ <portal-managed>true</portal-managed>
+ </custom-portlet-mode>
+
+ <custom-portlet-mode>
+ <portlet-mode>Custom2</portlet-mode>
+ <portal-managed>false</portal-managed>
+ </custom-portlet-mode>
+
+ <custom-portlet-mode>
+ <description>Portlet Mode Three</description>
+ <portlet-mode>Custom3</portlet-mode>
+ </custom-portlet-mode>
+
+</portlet-app>
\ No newline at end of file
Added:
modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/portlet1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/portlet1.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/portlet1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <custom-window-state id="foo">
+ <description>WindowState</description>
+ <description xml:lang="de">Offenes Fenster</description>
+ <window-state>windowState1</window-state>
+ </custom-window-state>
+
+ <custom-window-state>
+ <window-state>windowState2</window-state>
+ </custom-window-state>
+
+ <custom-window-state id="drei">
+ <window-state>windowState3</window-state>
+ </custom-window-state>
+
+</portlet-app>
\ No newline at end of file
Added:
modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/portlet2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/portlet2.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/customWindowState/portlet2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <custom-window-state id="foo">
+ <description>WindowState</description>
+ <description xml:lang="de">Offenes Fenster</description>
+ <window-state>windowState1</window-state>
+ </custom-window-state>
+
+ <custom-window-state>
+ <window-state>windowState2</window-state>
+ </custom-window-state>
+
+ <custom-window-state id="drei">
+ <window-state>windowState3</window-state>
+ </custom-window-state>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event1.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <event-definition id="shouldfail">
+ <name>MustFail</name>
+ </event-definition>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event2-fail.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event2-fail.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event2-fail.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet id="portlet">
+ <portlet-name>Portlet2</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet session</title>
+ </portlet-info>
+ <supported-processing-event>
+ <qname
xmlns:x="http://example.com/testEvents">x:portletEvent</q...
+ </supported-processing-event>
+ <supported-processing-event>
+ <name>hellouh</name>
+ </supported-processing-event>
+
+ <supported-publishing-event>
+ <qname
xmlns:x="http://example.com/testEvents">x:portletEvent</q...
+ <name>fooooo</name>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <name>hellouh</name>
+ </supported-publishing-event>
+ </portlet>
+
+ <event-definition>
+ <qname
xmlns:x="http://example.com/testEvents">x:portletEvent</q...
+ <name>hellouh</name>
+ <alias>hello</alias>
+ </event-definition>
+
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event2.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/event/portlet-event2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet id="portlet">
+ <portlet-name>Portlet2</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet session</title>
+ </portlet-info>
+ <supported-processing-event>
+ <qname
xmlns:x="http://example.com/testEvents">x:portletEvent</q...
+ </supported-processing-event>
+ <supported-processing-event>
+ <name>hellouh</name>
+ </supported-processing-event>
+
+ <supported-publishing-event>
+ <qname
xmlns:x="http://example.com/testEvents">x:portletEvent</q...
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <name>hellouh</name>
+ </supported-publishing-event>
+ </portlet>
+
+ <event-definition id="eventID">
+ <description>descriptionDefaultLanguage</description>
+ <description xml:lang="de">Beschreibung in Deutsch</description>
+ <qname
xmlns:x="http://example.com/testEvents">x:portletEvent</q...
+ <value-type>
+ org.jboss.portal.event.invoke.refill.beer
+ </value-type>
+ </event-definition>
+
+ <event-definition>
+ <name>hellouh</name>
+ <alias>hello</alias>
+ </event-definition>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filter1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filter1.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filter1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <filter>
+ <filter-name>testFilter</filter-name>
+ </filter>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filter2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filter2.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/filter/portlet-filter2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <filter>
+ <description>test</description>
+ <description xml:lang="de">bla</description>
+ <display-name xml:lang="fr">foo</display-name>
+ <display-name>foobar</display-name>
+ <filter-name>testFilter</filter-name>
+ <filter-class>
+ org.jboss.portal.meta.NoExistingClass
+ </filter-class>
+ <lifecycle>ACTION_PHASE</lifecycle>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ <init-param id="eins">
+ <description xml:lang="fr">biere</description>
+ <description>beer</description>
+ <name>foo</name>
+ <value>bar</value>
+ </init-param>
+ <init-param>
+ <name>test</name>
+ <value>testing</value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>testFilterZwei</filter-name>
+ <filter-class>org.jboss.portal.meta.NoExistingClass</filter-class>
+ <lifecycle>ACTION_PHASE</lifecycle>
+ </filter>
+
+ <filter>
+ <filter-name>foo</filter-name>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>testFilter</filter-name>
+ <portlet-name>Portlet1</portlet-name>
+ <portlet-name>Portlet2</portlet-name>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>testFilterZwei</filter-name>
+ <portlet-name>Portlet2</portlet-name>
+ </filter-mapping>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app_1_0.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app_1_0.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app_1_0.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0"
+ id="id">
+ <portlet id="id">
+ <description xml:lang="en">description</description>
+ <portlet-name>portlet-name</portlet-name>
+ <display-name xml:lang="en">display-name</display-name>
+ <portlet-class>portlet-class</portlet-class>
+ <init-param id="id">
+ <description xml:lang="en">description</description>
+ <name>name</name>
+ <value>value</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports id="id">
+ <mime-type>mime-type</mime-type>
+ <portlet-mode>portlet-mode</portlet-mode>
+ </supports>
+ <supported-locale>supported-locale</supported-locale>
+ <resource-bundle>resource-bundle</resource-bundle>
+ <portlet-info id="id">
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ <portlet-preferences id="id">
+ <preference id="id">
+ <name>name</name>
+ <value>value</value>
+ <read-only>true</read-only>
+ </preference>
+ <preferences-validator>preferences-validator</preferences-validator>
+ </portlet-preferences>
+ <security-role-ref id="id">
+ <description xml:lang="">description</description>
+ <role-name>NMTOKEN</role-name>
+ <role-link>role-link</role-link>
+ </security-role-ref>
+ </portlet>
+ <custom-portlet-mode id="id">
+ <description xml:lang="en">description</description>
+ <portlet-mode>portlet-mode</portlet-mode>
+ </custom-portlet-mode>
+ <custom-window-state id="id">
+ <description xml:lang="en">description</description>
+ <window-state>window-state</window-state>
+ </custom-window-state>
+ <user-attribute id="">
+ <description xml:lang="en">description</description>
+ <name>name</name>
+ </user-attribute>
+ <security-constraint id="id">
+ <display-name xml:lang="en">display-name</display-name>
+ <portlet-collection>
+ <portlet-name>portlet-name</portlet-name>
+ </portlet-collection>
+ <user-data-constraint id="">
+ <description xml:lang="">description</description>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+</portlet-app>
Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app_2_0.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app_2_0.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet-app_2_0.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0"
+ id="id">
+ <portlet id="id">
+ <description xml:lang="en">description</description>
+ <portlet-name>portlet-name</portlet-name>
+ <display-name xml:lang="en">display-name</display-name>
+ <portlet-class>portlet-class</portlet-class>
+ <init-param id="id">
+ <description xml:lang="en">description</description>
+ <name>name</name>
+ <value>value</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <cache-scope>PRIVATE</cache-scope>
+ <supports id="id">
+ <mime-type>mime-type</mime-type>
+ <portlet-mode>portlet-mode</portlet-mode>
+ <window-state>window-state</window-state>
+ </supports>
+ <supported-locale>supported-locale</supported-locale>
+ <resource-bundle>resource-bundle</resource-bundle>
+ <portlet-info id="id">
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ <portlet-preferences id="id">
+ <preference id="id">
+ <name>name</name>
+ <value>value</value>
+ <read-only>true</read-only>
+ </preference>
+ <preferences-validator>preferences-validator</preferences-validator>
+ </portlet-preferences>
+ <security-role-ref id="id">
+ <description xml:lang="en">description</description>
+ <role-name>NMTOKEN</role-name>
+ <role-link>role-link</role-link>
+ </security-role-ref>
+ <supported-processing-event id="id">
+ <qname>QName</qname>
+ </supported-processing-event>
+ <supported-publishing-event id="id">
+ <qname>QName</qname>
+ </supported-publishing-event>
+
<supported-public-render-parameter>supported-public-render-parameter</supported-public-render-parameter>
+ <container-runtime-option>
+ <name>name</name>
+ <value>value</value>
+ </container-runtime-option>
+ </portlet>
+ <custom-portlet-mode id="id">
+ <description xml:lang="en">description</description>
+ <portlet-mode>portlet-mode</portlet-mode>
+ <portal-managed>true</portal-managed>
+ </custom-portlet-mode>
+ <custom-window-state id="id">
+ <description xml:lang="en">description</description>
+ <window-state>window-state</window-state>
+ </custom-window-state>
+ <user-attribute id="id">
+ <description xml:lang="en">description</description>
+ <name>name</name>
+ </user-attribute>
+ <security-constraint id="id">
+ <display-name xml:lang="en">display-name</display-name>
+ <portlet-collection>
+ <portlet-name>portlet-name</portlet-name>
+ </portlet-collection>
+ <user-data-constraint id="id">
+ <description xml:lang="en">description</description>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <resource-bundle>resource-bundle</resource-bundle>
+ <filter>
+ <description xml:lang="en">description</description>
+ <display-name xml:lang="en">display-name</display-name>
+ <filter-name>filter-name</filter-name>
+ <filter-class>filter-class</filter-class>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ <init-param id="">
+ <description xml:lang="en">description</description>
+ <name>name</name>
+ <value>value</value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>filter-name</filter-name>
+ <portlet-name>portlet-name</portlet-name>
+ </filter-mapping>
+ <default-namespace>http://tempuri.org</default-namespace>
+ <event-definition id="id">
+ <description xml:lang="en">description</description>
+ <qname>QName</qname>
+ <alias>QName</alias>
+ <value-type>value-type</value-type>
+ </event-definition>
+ <public-render-parameter id="id">
+ <description xml:lang="en">description</description>
+ <identifier>identifier</identifier>
+ <qname>QName</qname>
+ <alias>QName</alias>
+ </public-render-parameter>
+ <listener id="id">
+ <description xml:lang="en">description</description>
+ <display-name xml:lang="en">display-name</display-name>
+ <listener-class>listener-class</listener-class>
+ </listener>
+ <container-runtime-option>
+ <name>name</name>
+ <value>value</value>
+ </container-runtime-option>
+</portlet-app>
Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet1.xml
(rev 0)
+++ modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>default</description>
+ <description xml:lang="fr">defaut</description>
+ <portlet-name>Portlet1</portlet-name>
+ <display-name>display</display-name>
+ <display-name xml:lang="fr">affichage</display-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortlet
+ </portlet-class>
+ <init-param>
+ <description>first parameter</description>
+ <description xml:lang="fr">premier parametre</description>
+ <name>one</name>
+ <value>1</value>
+ </init-param>
+ <init-param>
+ <description>second parameter</description>
+ <description xml:lang="fr">deuxieme parametre</description>
+ <name>two</name>
+ <value>2</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supports>
+ <mime-type>text/wml</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <resource-bundle>MyResourceBundle</resource-bundle>
+ <portlet-info>
+ <title>very long portlet title</title>
+ <short-title>short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ <preferences-validator>MyValidator</preferences-validator>
+ </portlet-preferences>
+ <security-role-ref>
+ <description>role with no link</description>
+ <description xml:lang="fr">role sans link</description>
+ <role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <description>role with link</description>
+ <description xml:lang="fr">role avec link</description>
+ <role-name>ROLE_NAME_WITH_LINK</role-name>
+ <role-link>ROLE_LINK</role-link>
+ </security-role-ref>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet2</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet session</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet3</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestDispatcherPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet request dispatcher</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet4</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestRedirectPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet redirection</title>
+ </portlet-info>
+ </portlet>
+
+
+ <portlet>
+ <portlet-name>Portlet5</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet preferences</title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet6</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestResourceBundlePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <resource-bundle>Portlet6</resource-bundle>
+ <portlet-info>
+ <title>Very long portlet title</title>
+ <short-title>Short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet7</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test exception during the action request</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet8</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecurityPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet security</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet9</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestUserInformationPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test user information</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet10</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletModePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet modes</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet11</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test https URL</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet12</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestCachedContentPortlet
+ </portlet-class>
+ <expiration-cache>60</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test cached content</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet13</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.CrossContextSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test cross session context</title>
+ </portlet-info>
+ </portlet>
+
+
+ <custom-portlet-mode>
+ <description>first mode</description>
+ <description xml:lang="fr">premier mode</description>
+ <portlet-mode>configure</portlet-mode>
+ </custom-portlet-mode>
+ <custom-portlet-mode>
+ <description>second mode</description>
+ <portlet-mode>inactive</portlet-mode>
+ </custom-portlet-mode>
+ <custom-window-state>
+ <description>first state</description>
+ <description xml:lang="fr">premier etat</description>
+ <window-state>blur</window-state>
+ </custom-window-state>
+ <custom-window-state>
+ <description>second state</description>
+ <window-state>black and white</window-state>
+ </custom-window-state>
+ <user-attribute>
+ <description>first attribute</description>
+ <description xml:lang="fr">premier attribut</description>
+ <name>att1</name>
+ </user-attribute>
+ <user-attribute>
+ <description>second attribute</description>
+ <name>att2</name>
+ </user-attribute>
+
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>Portlet1</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>Portlet1</portlet-name>
+ <portlet-name>Portlet4</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>INTEGRAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+</portlet-app>
Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2-jsr286.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2-jsr286.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2-jsr286.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,367 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <description>default</description>
+ <description xml:lang="fr">defaut</description>
+ <portlet-name>Portlet1</portlet-name>
+ <display-name>display</display-name>
+ <display-name xml:lang="fr">affichage</display-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortlet
+ </portlet-class>
+ <init-param>
+ <description>first parameter</description>
+ <description xml:lang="fr">premier parametre</description>
+ <name>one</name>
+ <value>1</value>
+ </init-param>
+ <init-param>
+ <description>second parameter</description>
+ <description xml:lang="fr">deuxieme parametre</description>
+ <name>two</name>
+ <value>2</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supports>
+ <mime-type>text/wml</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <resource-bundle>MyResourceBundle</resource-bundle>
+ <portlet-info>
+ <title>very long portlet title</title>
+ <short-title>short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ <preferences-validator>MyValidator</preferences-validator>
+ </portlet-preferences>
+ <security-role-ref>
+ <description>role with no link</description>
+ <description xml:lang="fr">role sans link</description>
+ <role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <description>role with link</description>
+ <description xml:lang="fr">role avec link</description>
+ <role-name>ROLE_NAME_WITH_LINK</role-name>
+ <role-link>ROLE_LINK</role-link>
+ </security-role-ref>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet2</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet session</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet3</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestDispatcherPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet request dispatcher</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet4</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestRedirectPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet redirection</title>
+ </portlet-info>
+ </portlet>
+
+
+ <portlet>
+ <portlet-name>Portlet5</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet preferences</title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet6</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestResourceBundlePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <resource-bundle>Portlet6</resource-bundle>
+ <portlet-info>
+ <title>Very long portlet title</title>
+ <short-title>Short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet7</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test exception during the action request</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet8</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecurityPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet security</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet9</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestUserInformationPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test user information</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet10</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletModePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet modes</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet11</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test https URL</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet12</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestCachedContentPortlet
+ </portlet-class>
+ <expiration-cache>60</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test cached content</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet13</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.CrossContextSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test cross session context</title>
+ </portlet-info>
+ </portlet>
+
+
+ <custom-portlet-mode>
+ <description>first mode</description>
+ <description xml:lang="fr">premier mode</description>
+ <portlet-mode>configure</portlet-mode>
+ </custom-portlet-mode>
+ <custom-portlet-mode>
+ <description>second mode</description>
+ <portlet-mode>inactive</portlet-mode>
+ </custom-portlet-mode>
+ <custom-window-state>
+ <description>first state</description>
+ <description xml:lang="fr">premier etat</description>
+ <window-state>blur</window-state>
+ </custom-window-state>
+ <custom-window-state>
+ <description>second state</description>
+ <window-state>black and white</window-state>
+ </custom-window-state>
+ <user-attribute>
+ <description>first attribute</description>
+ <description xml:lang="fr">premier attribut</description>
+ <name>att1</name>
+ </user-attribute>
+ <user-attribute>
+ <description>second attribute</description>
+ <name>att2</name>
+ </user-attribute>
+
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>Portlet1</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>Portlet1</portlet-name>
+ <portlet-name>Portlet4</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>INTEGRAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+ <resource-bundle>MyResourceBundle</resource-bundle>
+ <default-namespace>foobar</default-namespace>
+
+ <public-render-parameter id="param1">
+ <description>Public render parameter one</description>
+ <identifier>blub</identifier>
+ <name>param1</name>
+ <alias>Parameter1</alias>
+ <alias>Parameter2</alias>
+ </public-render-parameter>
+
+ <listener id="myListener1">
+ <description>Description EN</description>
+ <description xml:lang="de">Beschreibung</description>
+ <display-name>My Listener One</display-name>
+ <display-name xml:lang="de">Mein Zuhörer Eins</display-name>
+ <listener-class>org.jboss.portal.portlet.test.listener.MyListener</listener-class>
+ </listener>
+
+ <listener id="myListener2">
+ <display-name>My Listener Two</display-name>
+ <listener-class>org.jboss.portal.portlet.test.listener.MyListenerTwo</listener-class>
+ </listener>
+
+ <container-runtime-option>
+ <name>foo</name>
+ <value>foobar</value>
+ <value>foobar2</value>
+ </container-runtime-option>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2.xml
(rev 0)
+++ modules/portlet/trunk/mc/src/test/resources/metadata/general/portlet2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <description>default</description>
+ <description xml:lang="fr">defaut</description>
+ <portlet-name>Portlet1</portlet-name>
+ <display-name>display</display-name>
+ <display-name xml:lang="fr">affichage</display-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortlet
+ </portlet-class>
+ <init-param>
+ <description>first parameter</description>
+ <description xml:lang="fr">premier parametre</description>
+ <name>one</name>
+ <value>1</value>
+ </init-param>
+ <init-param>
+ <description>second parameter</description>
+ <description xml:lang="fr">deuxieme parametre</description>
+ <name>two</name>
+ <value>2</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supports>
+ <mime-type>text/wml</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <resource-bundle>MyResourceBundle</resource-bundle>
+ <portlet-info>
+ <title>very long portlet title</title>
+ <short-title>short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ <preferences-validator>MyValidator</preferences-validator>
+ </portlet-preferences>
+ <security-role-ref>
+ <description>role with no link</description>
+ <description xml:lang="fr">role sans link</description>
+ <role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <description>role with link</description>
+ <description xml:lang="fr">role avec link</description>
+ <role-name>ROLE_NAME_WITH_LINK</role-name>
+ <role-link>ROLE_LINK</role-link>
+ </security-role-ref>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet2</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet session</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet3</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestDispatcherPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet request dispatcher</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet4</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestRedirectPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet redirection</title>
+ </portlet-info>
+ </portlet>
+
+
+ <portlet>
+ <portlet-name>Portlet5</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet preferences</title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet6</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestResourceBundlePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <resource-bundle>Portlet6</resource-bundle>
+ <portlet-info>
+ <title>Very long portlet title</title>
+ <short-title>Short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet7</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test exception during the action request</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet8</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecurityPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet security</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet9</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestUserInformationPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test user information</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet10</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletModePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet modes</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet11</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test https URL</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet12</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestCachedContentPortlet
+ </portlet-class>
+ <expiration-cache>60</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test cached content</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet13</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.CrossContextSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test cross session context</title>
+ </portlet-info>
+ </portlet>
+
+
+ <custom-portlet-mode>
+ <description>first mode</description>
+ <description xml:lang="fr">premier mode</description>
+ <portlet-mode>configure</portlet-mode>
+ </custom-portlet-mode>
+ <custom-portlet-mode>
+ <description>second mode</description>
+ <portlet-mode>inactive</portlet-mode>
+ </custom-portlet-mode>
+ <custom-window-state>
+ <description>first state</description>
+ <description xml:lang="fr">premier etat</description>
+ <window-state>blur</window-state>
+ </custom-window-state>
+ <custom-window-state>
+ <description>second state</description>
+ <window-state>black and white</window-state>
+ </custom-window-state>
+ <user-attribute>
+ <description>first attribute</description>
+ <description xml:lang="fr">premier attribut</description>
+ <name>att1</name>
+ </user-attribute>
+ <user-attribute>
+ <description>second attribute</description>
+ <name>att2</name>
+ </user-attribute>
+
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>Portlet1</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>Portlet1</portlet-name>
+ <portlet-name>Portlet4</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>INTEGRAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1-simple.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1-simple.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1-simple.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,10 @@
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <portlet>
+ <portlet-name>foo</portlet-name>
+ </portlet>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1.xml
(rev 0)
+++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,268 @@
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet id="fragmichnicht">
+ <description>default</description>
+ <description xml:lang="fr">defaut</description>
+ <portlet-name>Portlet1</portlet-name>
+ <display-name>display</display-name>
+ <display-name xml:lang="fr">affichage</display-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortlet
+ </portlet-class>
+ <init-param>
+ <description>first parameter</description>
+ <description xml:lang="fr">premier parametre</description>
+ <name>one</name>
+ <value>1</value>
+ </init-param>
+ <init-param>
+ <description>second parameter</description>
+ <description xml:lang="fr">deuxieme parametre</description>
+ <name>two</name>
+ <value>2</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supports>
+ <mime-type>text/wml</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>fr_FR</supported-locale>
+ <resource-bundle>MyResourceBundle</resource-bundle>
+ <portlet-info>
+ <title>very long portlet title</title>
+ <short-title>short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ <preferences-validator>MyValidator</preferences-validator>
+ </portlet-preferences>
+ <security-role-ref>
+ <description>role with no link</description>
+ <description xml:lang="fr">role sans link</description>
+ <role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <description>role with link</description>
+ <description xml:lang="fr">role avec link</description>
+ <role-name>ROLE_NAME_WITH_LINK</role-name>
+ <role-link>ROLE_LINK</role-link>
+ </security-role-ref>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet2</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet session</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet3</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestDispatcherPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet request dispatcher</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet4</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestRedirectPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet redirection</title>
+ </portlet-info>
+ </portlet>
+
+
+ <portlet>
+ <portlet-name>Portlet5</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet preferences</title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet6</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestResourceBundlePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>fr_FR</supported-locale>
+ <resource-bundle>Portlet6</resource-bundle>
+ <portlet-info>
+ <title>Very long portlet title</title>
+ <short-title>Short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet7</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test exception during the action request</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet8</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecurityPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet security</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet9</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestUserInformationPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test user information</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet10</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletModePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet modes</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet11</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test https URL</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet12</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestCachedContentPortlet
+ </portlet-class>
+ <expiration-cache>60</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test cached content</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet13</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.CrossContextSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test cross session context</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>
Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2-jsr286.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2-jsr286.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2-jsr286.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,111 @@
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet id="fragmichnicht2">
+ <description>default</description>
+ <description xml:lang="fr">defaut</description>
+ <portlet-name>Portlet1</portlet-name>
+ <display-name>display</display-name>
+ <display-name xml:lang="fr">affichage</display-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortlet
+ </portlet-class>
+ <init-param>
+ <description>first parameter</description>
+ <description xml:lang="fr">premier parametre</description>
+ <name>one</name>
+ <value>1</value>
+ </init-param>
+ <init-param>
+ <description>second parameter</description>
+ <description xml:lang="fr">deuxieme parametre</description>
+ <name>two</name>
+ <value>2</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <cache-scope>PUBLIC</cache-scope>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ <window-state>MAXIMIZED</window-state>
+ <window-state>NORMAL</window-state>
+ </supports>
+ <supports id="foo">
+ <mime-type>text/wml</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ <window-state>NORMAL</window-state>
+ <window-state>CUSTOM</window-state>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>fr_FR</supported-locale>
+ <resource-bundle>MyResourceBundle</resource-bundle>
+ <portlet-info>
+ <title>very long portlet title</title>
+ <short-title>short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ <preferences-validator>MyValidator</preferences-validator>
+ </portlet-preferences>
+ <security-role-ref>
+ <description>role with no link</description>
+ <description xml:lang="fr">role sans link</description>
+ <role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <description>role with link</description>
+ <description xml:lang="fr">role avec link</description>
+ <role-name>ROLE_NAME_WITH_LINK</role-name>
+ <role-link>ROLE_LINK</role-link>
+ </security-role-ref>
+ <supported-processing-event>
+ <qname
xmlns:x="http://example.com/testEvents">x:portletEvent</q...
+ </supported-processing-event>
+ <supported-publishing-event>
+ <qname
xmlns:x="http://example.com/testEvents">x:portletEvent</q...
+ </supported-publishing-event>
+
+ <supported-public-render-parameter>foo</supported-public-render-parameter>
+ <supported-public-render-parameter>bar</supported-public-render-parameter>
+ <supported-public-render-parameter>foo2</supported-public-render-parameter>
+ <supported-public-render-parameter>foo2bar</supported-public-render-parameter>
+ <container-runtime-option>
+ <name>option1</name>
+ <value>value1</value>
+ <value>value2</value>
+ </container-runtime-option>
+
+ <container-runtime-option>
+ <name>option2</name>
+ <value>value3</value>
+ </container-runtime-option>
+
+ </portlet>
+
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2.xml
(rev 0)
+++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet/portlet2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,270 @@
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet id="fragmichnicht2">
+ <description>default</description>
+ <description xml:lang="fr">defaut</description>
+ <portlet-name>Portlet1</portlet-name>
+ <display-name>display</display-name>
+ <display-name xml:lang="fr">affichage</display-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortlet
+ </portlet-class>
+ <init-param>
+ <description>first parameter</description>
+ <description xml:lang="fr">premier parametre</description>
+ <name>one</name>
+ <value>1</value>
+ </init-param>
+ <init-param>
+ <description>second parameter</description>
+ <description xml:lang="fr">deuxieme parametre</description>
+ <name>two</name>
+ <value>2</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <cache-scope>PUBLIC</cache-scope>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supports id="foo">
+ <mime-type>text/wml</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>fr_FR</supported-locale>
+ <resource-bundle>MyResourceBundle</resource-bundle>
+ <portlet-info>
+ <title>very long portlet title</title>
+ <short-title>short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ <preferences-validator>MyValidator</preferences-validator>
+ </portlet-preferences>
+ <security-role-ref>
+ <description>role with no link</description>
+ <description xml:lang="fr">role sans link</description>
+ <role-name>ROLE_NAME_WITHOUT_LINK</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <description>role with link</description>
+ <description xml:lang="fr">role avec link</description>
+ <role-name>ROLE_NAME_WITH_LINK</role-name>
+ <role-link>ROLE_LINK</role-link>
+ </security-role-ref>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet2</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet session</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet3</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestDispatcherPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet request dispatcher</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet4</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestRedirectPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet redirection</title>
+ </portlet-info>
+ </portlet>
+
+
+ <portlet>
+ <portlet-name>Portlet5</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletPreferencesPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>test the portlet preferences</title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>one</name>
+ <value>1</value>
+ </preference>
+ <preference>
+ <name>two</name>
+ <value>2</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>three</name>
+ <value>3</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>all</name>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet6</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestResourceBundlePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>fr_FR</supported-locale>
+ <resource-bundle>Portlet6</resource-bundle>
+ <portlet-info>
+ <title>Very long portlet title</title>
+ <short-title>Short portlet title</short-title>
+ <keywords>a,b,c,d,e,f</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet7</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test exception during the action request</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet8</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecurityPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet security</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet9</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestUserInformationPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test user information</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet10</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestPortletModePortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test portlet modes</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet11</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestSecuredProtocolPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test https URL</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet12</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.TestCachedContentPortlet
+ </portlet-class>
+ <expiration-cache>60</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Test cached content</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>Portlet13</portlet-name>
+ <portlet-class>
+ org.jboss.portal.test.portlet.CrossContextSessionPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>p13</title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_1_0.xsd
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_1_0.xsd
(rev 0)
+++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_1_0.xsd 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,682 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema
+
targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_1_0....
+
xmlns="http://www.w3.org/2001/XMLSchema"
+
xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xs...
+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" attributeFormDefault="unqualified"
+ version="1.0" xml:lang="en">
+ <annotation>
+ <documentation>
+ This is the XML Schema for the Portlet 1.0 deployment
+ descriptor.
+ </documentation>
+ </annotation>
+ <annotation>
+ <documentation>
+ The following conventions apply to all J2EE deployment
+ descriptor elements unless indicated otherwise. - In
+ elements that specify a pathname to a file within the same
+ JAR file, relative filenames (i.e., those not starting with
+ "/") are considered relative to the root of the JAR file's
+ namespace. Absolute filenames (i.e., those starting with
+ "/") also specify names in the root of the JAR file's
+ namespace. In general, relative names are preferred. The
+ exception is .war files where absolute names are preferred
+ for consistency with the Servlet API.
+ </documentation>
+ </annotation>
+ <!-- *********************************************************** -->
+ <import
namespace="http://www.w3.org/XML/1998/namespace"
+
schemaLocation="http://www.w3.org/2001/xml.xsd" />
+ <element name="portlet-app" type="portlet:portlet-appType">
+ <annotation>
+ <documentation>
+ The portlet-app element is the root of the deployment
+ descriptor for a portlet application. This element has a
+ required attribute version to specify to which version
+ of the schema the deployment descriptor conforms.
+ </documentation>
+ </annotation>
+ <unique name="portlet-name-uniqueness">
+ <annotation>
+ <documentation>
+ The portlet element contains the name of a portlet.
+ This name must be unique within the portlet
+ application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:portlet" />
+ <field xpath="portlet:portlet-name" />
+ </unique>
+ <unique name="custom-portlet-mode-uniqueness">
+ <annotation>
+ <documentation>
+ The custom-portlet-mode element contains the
+ portlet-mode. This portlet mode must be unique
+ within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:custom-portlet-mode" />
+ <field xpath="portlet:portlet-mode" />
+ </unique>
+ <unique name="custom-window-state-uniqueness">
+ <annotation>
+ <documentation>
+ The custom-window-state element contains the
+ window-state. This window state must be unique
+ within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:custom-window-state" />
+ <field xpath="portlet:window-state" />
+ </unique>
+ <unique name="user-attribute-name-uniqueness">
+ <annotation>
+ <documentation>
+ The user-attribute element contains the name the
+ attribute. This name must be unique within the
+ portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:user-attribute" />
+ <field xpath="portlet:name" />
+ </unique>
+ </element>
+ <complexType name="portlet-appType">
+ <sequence>
+ <element name="portlet" type="portlet:portletType"
+ minOccurs="0" maxOccurs="unbounded">
+ <unique name="init-param-name-uniqueness">
+ <annotation>
+ <documentation>
+ The init-param element contains the name the
+ attribute. This name must be unique within
+ the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:init-param" />
+ <field xpath="portlet:name" />
+ </unique>
+ <unique name="supports-mime-type-uniqueness">
+ <annotation>
+ <documentation>
+ The supports element contains the supported
+ mime-type. This mime type must be unique
+ within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:supports" />
+ <field xpath="mime-type" />
+ </unique>
+ <unique name="preference-name-uniqueness">
+ <annotation>
+ <documentation>
+ The preference element contains the name the
+ preference. This name must be unique within
+ the portlet.
+ </documentation>
+ </annotation>
+ <selector
+ xpath="portlet:portlet-preferences/portlet:preference" />
+ <field xpath="portlet:name" />
+ </unique>
+ <unique name="security-role-ref-name-uniqueness">
+ <annotation>
+ <documentation>
+ The security-role-ref element contains the
+ role-name. This role name must be unique
+ within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:security-role-ref" />
+ <field xpath="portlet:role-name" />
+ </unique>
+ </element>
+ <element name="custom-portlet-mode"
+ type="portlet:custom-portlet-modeType" minOccurs="0"
+ maxOccurs="unbounded" />
+ <element name="custom-window-state"
+ type="portlet:custom-window-stateType" minOccurs="0"
+ maxOccurs="unbounded" />
+ <element name="user-attribute"
+ type="portlet:user-attributeType" minOccurs="0"
+ maxOccurs="unbounded" />
+ <element name="security-constraint"
+ type="portlet:security-constraintType" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="version" type="string" use="required"
/>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="custom-portlet-modeType">
+ <annotation>
+ <documentation>
+ A custom portlet mode that one or more portlets in this
+ portlet application supports. Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="portlet-mode"
+ type="portlet:portlet-modeType" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="custom-window-stateType">
+ <annotation>
+ <documentation>
+ A custom window state that one or more portlets in this
+ portlet application supports. Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="window-state"
+ type="portlet:window-stateType" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="expiration-cacheType">
+ <annotation>
+ <documentation>
+ Expriation-cache defines expiration-based caching for
+ this portlet. The parameter indicates the time in
+ seconds after which the portlet output expires. -1
+ indicates that the output never expires. Used in:
+ portlet
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="int" />
+ </simpleContent>
+ </complexType>
+ <complexType name="init-paramType">
+ <annotation>
+ <documentation>
+ The init-param element contains a name/value pair as an
+ initialization param of the portlet Used in:portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="name" type="portlet:nameType" />
+ <element name="value" type="portlet:valueType" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="keywordsType">
+ <annotation>
+ <documentation>
+ Locale specific keywords associated with this portlet.
+ The kewords are separated by commas. Used in:
+ portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="mime-typeType">
+ <annotation>
+ <documentation>
+ MIME type name, e.g. "text/html". The MIME type may also
+ contain the wildcard character '*', like "text/*" or
+ "*/*". Used in: supports
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="nameType">
+ <annotation>
+ <documentation>
+ The name element contains the name of a parameter. Used
+ in: init-param, ...
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="portletType">
+ <annotation>
+ <documentation>
+ The portlet element contains the declarative data of a
+ portlet. Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="portlet-name"
+ type="portlet:portlet-nameType" />
+ <element name="display-name" type="portlet:display-nameType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="portlet-class"
+ type="portlet:portlet-classType" />
+ <element name="init-param" type="portlet:init-paramType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="expiration-cache"
+ type="portlet:expiration-cacheType" minOccurs="0" />
+ <element name="supports" type="portlet:supportsType"
+ maxOccurs="unbounded" />
+ <element name="supported-locale"
+ type="portlet:supported-localeType" minOccurs="0"
+ maxOccurs="unbounded" />
+ <choice>
+ <sequence>
+ <element name="resource-bundle"
+ type="portlet:resource-bundleType" />
+ <element name="portlet-info"
+ type="portlet:portlet-infoType" minOccurs="0" />
+ </sequence>
+ <element name="portlet-info"
+ type="portlet:portlet-infoType" />
+ </choice>
+ <element name="portlet-preferences"
+ type="portlet:portlet-preferencesType" minOccurs="0" />
+ <element name="security-role-ref"
+ type="portlet:security-role-refType" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <simpleType name="portlet-classType">
+ <annotation>
+ <documentation>
+ The portlet-class element contains the fully qualified
+ class name of the portlet. Used in: portlet
+ </documentation>
+ </annotation>
+ <restriction base="portlet:fully-qualified-classType" />
+ </simpleType>
+ <complexType name="portlet-collectionType">
+ <annotation>
+ <documentation>
+ The portlet-collectionType is used to identify a subset
+ of portlets within a portlet application to which a
+ security constraint applies. Used in:
+ security-constraint
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="portlet-name" type="portlet:portlet-nameType"
+ maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+ <complexType name="portlet-infoType">
+ <sequence>
+ <element name="title" type="portlet:titleType" />
+ <element name="short-title" type="portlet:short-titleType"
+ minOccurs="0" />
+ <element name="keywords" type="portlet:keywordsType"
+ minOccurs="0" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="portlet-modeType">
+ <annotation>
+ <documentation>
+ Portlet modes. The specification pre-defines the
+ following values as valid portlet mode constants:
+ "edit", "help", "view". Portlet mode names are not
case
+ sensitive. Used in: custom-portlet-mode, supports
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="portlet-nameType">
+ <annotation>
+ <documentation>
+ The portlet-name element contains the canonical name of
+ the portlet. Each portlet name is unique within the
+ portlet application. Used in: portlet, portlet-mapping
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="portlet-preferencesType">
+ <annotation>
+ <documentation>
+ Portlet persistent preference store. Used in: portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="preference" type="portlet:preferenceType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="preferences-validator"
+ type="portlet:preferences-validatorType" minOccurs="0" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="preferenceType">
+ <annotation>
+ <documentation>
+ Persistent preference values that may be used for
+ customization and personalization by the portlet. Used
+ in: portlet-preferences
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="name" type="portlet:nameType" />
+ <element name="value" type="portlet:valueType"
minOccurs="0"
+ maxOccurs="unbounded" />
+ <element name="read-only" type="portlet:read-onlyType"
+ minOccurs="0" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <simpleType name="preferences-validatorType">
+ <annotation>
+ <documentation>
+ The class specified under preferences-validator
+ implements the PreferencesValidator interface to
+ validate the preferences settings. Used in:
+ portlet-preferences
+ </documentation>
+ </annotation>
+ <restriction base="portlet:fully-qualified-classType" />
+ </simpleType>
+ <simpleType name="read-onlyType">
+ <annotation>
+ <documentation>
+ read-only indicates that a setting cannot be changed in
+ any of the standard portlet modes ("view","edit" or
+ "help"). Per default all preferences are modifiable.
+ Valid values are: - true for read-only - false for
+ modifiable Used in: preferences
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string">
+ <enumeration value="true" />
+ <enumeration value="false" />
+ </restriction>
+ </simpleType>
+ <complexType name="resource-bundleType">
+ <annotation>
+ <documentation>
+ Filename of the resource bundle containing the language
+ specific portlet informations in different languages.
+ Used in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="role-linkType">
+ <annotation>
+ <documentation>
+ The role-link element is a reference to a defined
+ security role. The role-link element must contain the
+ name of one of the security roles defined in the
+ security-role elements. Used in: security-role-ref
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="security-constraintType">
+ <annotation>
+ <documentation>
+ The security-constraintType is used to associate
+ intended security constraints with one or more portlets.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="display-name" type="portlet:display-nameType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="portlet-collection"
+ type="portlet:portlet-collectionType" />
+ <element name="user-data-constraint"
+ type="portlet:user-data-constraintType" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="security-role-refType">
+ <annotation>
+ <documentation>
+ The security-role-ref element contains the declaration
+ of a security role reference in the code of the web
+ application. The declaration consists of an optional
+ description, the security role name used in the code,
+ and an optional link to a security role. If the security
+ role is not specified, the Deployer must choose an
+ appropriate security role. The value of the role name
+ element must be the String used as the parameter to the
+ EJBContext.isCallerInRole(String roleName) method or the
+ HttpServletRequest.isUserInRole(String role) method.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="role-name" type="portlet:role-nameType" />
+ <element name="role-link" type="portlet:role-linkType"
+ minOccurs="0" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="short-titleType">
+ <annotation>
+ <documentation>
+ Locale specific short version of the static title. Used
+ in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="supportsType">
+ <annotation>
+ <documentation>
+ Supports indicates the portlet modes a portlet supports
+ for a specific content type. All portlets must support
+ the view mode. Used in: portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="mime-type" type="portlet:mime-typeType" />
+ <element name="portlet-mode" type="portlet:portlet-modeType"
+ minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="supported-localeType">
+ <annotation>
+ <documentation>
+ Indicated the locales the portlet supports. Used in:
+ portlet
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="titleType">
+ <annotation>
+ <documentation>
+ Locale specific static title for this portlet. Used in:
+ portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <simpleType name="transport-guaranteeType">
+ <annotation>
+ <documentation>
+ The transport-guaranteeType specifies that the
+ communication between client and portlet should be NONE,
+ INTEGRAL, or CONFIDENTIAL. NONE means that the portlet
+ does not require any transport guarantees. A value of
+ INTEGRAL means that the portlet requires that the data
+ sent between the client and portlet be sent in such a
+ way that it can't be changed in transit. CONFIDENTIAL
+ means that the portlet requires that the data be
+ transmitted in a fashion that prevents other entities
+ from observing the contents of the transmission. In most
+ cases, the presence of the INTEGRAL or CONFIDENTIAL flag
+ will indicate that the use of SSL is required. Used in:
+ user-data-constraint
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string">
+ <enumeration value="NONE" />
+ <enumeration value="INTEGRAL" />
+ <enumeration value="CONFIDENTIAL" />
+ </restriction>
+ </simpleType>
+ <complexType name="user-attributeType">
+ <annotation>
+ <documentation>
+ User attribute defines a user specific attribute that
+ the portlet application needs. The portlet within this
+ application can access this attribute via the request
+ parameter USER_INFO map. Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="name" type="portlet:nameType" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="user-data-constraintType">
+ <annotation>
+ <documentation>
+ The user-data-constraintType is used to indicate how
+ data communicated between the client and portlet should
+ be protected. Used in: security-constraint
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="transport-guarantee"
+ type="portlet:transport-guaranteeType" />
+ </sequence>
+ <attribute name="id" type="string" use="optional"
/>
+ </complexType>
+ <complexType name="valueType">
+ <annotation>
+ <documentation>
+ The value element contains the value of a parameter.
+ Used in: init-param
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <complexType name="window-stateType">
+ <annotation>
+ <documentation>
+ Portlet window state. Window state names are not case
+ sensitive. Used in: custom-window-state
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string" />
+ </simpleContent>
+ </complexType>
+ <!--- everything below is copied from j2ee_1_4.xsd -->
+ <complexType name="descriptionType">
+ <annotation>
+ <documentation>
+ The description element is used to provide text
+ describing the parent element. The description element
+ should include any information that the portlet
+ application war file producer wants to provide to the
+ consumer of the portlet application war file (i.e., to
+ the Deployer). Typically, the tools used by the portlet
+ application war file consumer will display the
+ description when processing the parent element that
+ contains the description. It has an optional attribute
+ xml:lang to indicate which language is used in the
+ description according to RFC 1766
+ (
http://www.ietf.org/rfc/rfc1766.txt). The default value
+ of this attribute is English(“en”). Used in: init-param,
+ portlet, portlet-app, security-role
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string">
+ <attribute ref="xml:lang" />
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="display-nameType">
+ <annotation>
+ <documentation>
+ The display-name type contains a short name that is
+ intended to be displayed by tools. It is used by
+ display-name elements. The display name need not be
+ unique. Example: ...
+ <display-name xml:lang="en">
+ Employee Self Service
+ </display-name>
+
+ It has an optional attribute xml:lang to indicate which
+ language is used in the description according to RFC
+ 1766 (
http://www.ietf.org/rfc/rfc1766.txt). The default
+ value of this attribute is English(“en”).
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string">
+ <attribute ref="xml:lang" />
+ </extension>
+ </simpleContent>
+ </complexType>
+ <simpleType name="fully-qualified-classType">
+ <annotation>
+ <documentation>
+ The elements that use this type designate the name of a
+ Java class or interface.
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string" />
+ </simpleType>
+ <simpleType name="role-nameType">
+ <annotation>
+ <documentation>
+ The role-nameType designates the name of a security
+ role.
+
+ The name must conform to the lexical rules for an
+ NMTOKEN.
+ </documentation>
+ </annotation>
+ <restriction base="NMTOKEN" />
+ </simpleType>
+ <simpleType name="string">
+ <annotation>
+ <documentation>
+ This is a special string datatype that is defined by
+ J2EE as a base type for defining collapsed strings. When
+ schemas require trailing/leading space elimination as
+ well as collapsing the existing whitespace, this base
+ type may be used.
+ </documentation>
+ </annotation>
+ <restriction base="string">
+ <whiteSpace value="collapse" />
+ </restriction>
+ </simpleType>
+</schema>
Added: modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_2_0.xsd
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_2_0.xsd
(rev 0)
+++ modules/portlet/trunk/mc/src/test/resources/metadata/portlet-app_2_0.xsd 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,830 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xs...
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_2_0....
elementFormDefault="qualified" attributeFormDefault="unqualified"
version="2.0" xml:lang="en">
+ <annotation>
+ <documentation>
+ This is the XML Schema for the Portlet 2.0 deployment descriptor.
+ </documentation>
+ </annotation>
+ <annotation>
+ <documentation>
+ The following conventions apply to all J2EE
+ deployment descriptor elements unless indicated otherwise.
+ - In elements that specify a pathname to a file within the
+ same JAR file, relative filenames (i.e., those not
+ starting with "/") are considered relative to the root of
+ the JAR file's namespace. Absolute filenames (i.e., those
+ starting with "/") also specify names in the root of the
+ JAR file's namespace. In general, relative names are
+ preferred. The exception is .war files where absolute
+ names are preferred for consistency with the Servlet API.
+ </documentation>
+ </annotation>
+ <!-- *********************************************************** -->
+ <import
namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+ <element name="portlet-app" type="portlet:portlet-appType">
+ <annotation>
+ <documentation>
+ The portlet-app element is the root of the deployment descriptor
+ for a portlet application. This element has a required attribute version
+ to specify to which version of the schema the deployment descriptor
+ conforms. In order to be a valid JSR 286 portlet application the version
+ must have the value "2.0".
+ </documentation>
+ </annotation>
+ <unique name="portlet-name-uniqueness">
+ <annotation>
+ <documentation>
+ The portlet element contains the name of a portlet.
+ This name must be unique within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:portlet"/>
+ <field xpath="portlet:portlet-name"/>
+ </unique>
+ <unique name="custom-portlet-mode-uniqueness">
+ <annotation>
+ <documentation>
+ The custom-portlet-mode element contains the portlet-mode.
+ This portlet mode must be unique within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:custom-portlet-mode"/>
+ <field xpath="portlet:portlet-mode"/>
+ </unique>
+ <unique name="custom-window-state-uniqueness">
+ <annotation>
+ <documentation>
+ The custom-window-state element contains the window-state.
+ This window state must be unique within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:custom-window-state"/>
+ <field xpath="portlet:window-state"/>
+ </unique>
+ <unique name="user-attribute-name-uniqueness">
+ <annotation>
+ <documentation>
+ The user-attribute element contains the name the attribute.
+ This name must be unique within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:user-attribute"/>
+ <field xpath="portlet:name"/>
+ </unique>
+ <unique name="filter-name-uniqueness">
+ <annotation>
+ <documentation>
+ The filter element contains the name of a filter.
+ The name must be unique within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:filter"/>
+ <field xpath="portlet:filter-name"/>
+ </unique>
+ </element>
+ <complexType name="portlet-appType">
+ <sequence>
+ <element name="portlet" type="portlet:portletType"
minOccurs="0" maxOccurs="unbounded">
+ <unique name="init-param-name-uniqueness">
+ <annotation>
+ <documentation>
+ The init-param element contains the name the attribute.
+ This name must be unique within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:init-param"/>
+ <field xpath="portlet:name"/>
+ </unique>
+ <unique name="supports-mime-type-uniqueness">
+ <annotation>
+ <documentation>
+ The supports element contains the supported mime-type.
+ This mime type must be unique within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:supports"/>
+ <field xpath="mime-type"/>
+ </unique>
+ <unique name="preference-name-uniqueness">
+ <annotation>
+ <documentation>
+ The preference element contains the name the preference.
+ This name must be unique within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:portlet-preferences/portlet:preference"/>
+ <field xpath="portlet:name"/>
+ </unique>
+ <unique name="security-role-ref-name-uniqueness">
+ <annotation>
+ <documentation>
+ The security-role-ref element contains the role-name.
+ This role name must be unique within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:security-role-ref"/>
+ <field xpath="portlet:role-name"/>
+ </unique>
+ </element>
+ <element name="custom-portlet-mode"
type="portlet:custom-portlet-modeType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="custom-window-state"
type="portlet:custom-window-stateType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="user-attribute"
type="portlet:user-attributeType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="security-constraint"
type="portlet:security-constraintType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="resource-bundle"
type="portlet:resource-bundleType" minOccurs="0"/>
+ <element name="filter" type="portlet:filterType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="filter-mapping"
type="portlet:filter-mappingType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="default-namespace" type="xs:anyURI"
minOccurs="0"/>
+ <element name="event-definition"
type="portlet:event-definitionType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="public-render-parameter"
type="portlet:public-render-parameterType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="listener" type="portlet:listenerType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="container-runtime-option"
type="portlet:container-runtime-optionType" minOccurs="0"
maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="version" type="portlet:string"
use="required"/>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="cache-scopeType">
+ <annotation>
+ <documentation>
+ Caching scope, allowed values are "private" indicating that the content
should not be shared
+ across users and "public" indicating that the content may be shared across
users.
+ The default value if not present is "private".
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="custom-portlet-modeType">
+ <annotation>
+ <documentation>
+ A custom portlet mode that one or more portlets in
+ this portlet application supports.
+ If the portal does not need to provide some management functionality
+ for this portlet mode, the portal-managed element needs to be set
+ to "false", otherwise to "true". Default is "true".
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="portlet-mode"
type="portlet:portlet-modeType"/>
+ <element name="portal-managed"
type="portlet:portal-managedType" minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="custom-window-stateType">
+ <annotation>
+ <documentation>
+ A custom window state that one or more portlets in this
+ portlet application supports.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="window-state"
type="portlet:window-stateType"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="expiration-cacheType">
+ <annotation>
+ <documentation>
+ Expiration-time defines the time in seconds after which the portlet output expires.
+ -1 indicates that the output never expires.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="int"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="init-paramType">
+ <annotation>
+ <documentation>
+ The init-param element contains a name/value pair as an
+ initialization param of the portlet
+ Used in:portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="name" type="portlet:nameType"/>
+ <element name="value" type="portlet:valueType"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="keywordsType">
+ <annotation>
+ <documentation>
+ Locale specific keywords associated with this portlet.
+ The kewords are separated by commas.
+ Used in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="mime-typeType">
+ <annotation>
+ <documentation>
+ MIME type name, e.g. "text/html".
+ The MIME type may also contain the wildcard
+ character '*', like "text/*" or "*/*".
+ Used in: supports
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="nameType">
+ <annotation>
+ <documentation>
+ The name element contains the name of a parameter.
+ Used in: init-param, ...
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="portletType">
+ <annotation>
+ <documentation>
+ The portlet element contains the declarative data of a portlet.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="portlet-name"
type="portlet:portlet-nameType"/>
+ <element name="display-name" type="portlet:display-nameType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="portlet-class"
type="portlet:portlet-classType"/>
+ <element name="init-param" type="portlet:init-paramType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="expiration-cache"
type="portlet:expiration-cacheType" minOccurs="0"/>
+ <element name="cache-scope" type="portlet:cache-scopeType"
minOccurs="0"/>
+ <element name="supports" type="portlet:supportsType"
maxOccurs="unbounded"/>
+ <element name="supported-locale"
type="portlet:supported-localeType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="resource-bundle"
type="portlet:resource-bundleType" minOccurs="0"/>
+ <element name="portlet-info" type="portlet:portlet-infoType"
minOccurs="0"/>
+ <element name="portlet-preferences"
type="portlet:portlet-preferencesType" minOccurs="0"/>
+ <element name="security-role-ref"
type="portlet:security-role-refType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="supported-processing-event"
type="portlet:event-definition-referenceType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="supported-publishing-event"
type="portlet:event-definition-referenceType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="supported-public-render-parameter"
type="portlet:string" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="container-runtime-option"
type="portlet:container-runtime-optionType" minOccurs="0"
maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <simpleType name="portlet-classType">
+ <annotation>
+ <documentation>
+ The portlet-class element contains the fully
+ qualified class name of the portlet.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <restriction base="portlet:fully-qualified-classType"/>
+ </simpleType>
+ <complexType name="container-runtime-optionType">
+ <annotation>
+ <documentation>
+ The container-runtime-option element contains settings
+ for the portlet container that the portlet expects to be honored
+ at runtime. These settings may re-define default portlet container
+ behavior, like the javax.portlet.escapeXml setting that disables
+ XML encoding of URLs produced by the portlet tag library as
+ default.
+ Names with the javax.portlet prefix are reserved for the Java
+ Portlet Specification.
+ Used in: portlet-app, portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="name" type="portlet:nameType"/>
+ <element name="value" type="portlet:valueType"
minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="filter-mappingType">
+ <annotation>
+ <documentation>
+ Declaration of the filter mappings in this portlet
+ application is done by using filter-mappingType.
+ The container uses the filter-mapping
+ declarations to decide which filters to apply to a request,
+ and in what order. To determine which filters to
+ apply it matches filter-mapping declarations on the
+ portlet-name and the lifecyle phase defined in the
+ filter element. The order in which filters are invoked
+ is the order in which filter-mapping declarations
+ that match appear in the list of filter-mapping elements.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="filter-name"
type="portlet:filter-nameType"/>
+ <element name="portlet-name" type="portlet:portlet-nameType"
maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="filterType">
+ <annotation>
+ <documentation>
+ The filter element specifies a filter that can transform the
+ content of portlet requests and portlet responses.
+ Filters can access the initialization parameters declared in
+ the deployment descriptor at runtime via the FilterConfig
+ interface.
+ A filter can be restricted to one or more lifecycle phases
+ of the portlet. Valid entries for lifecycle are:
+ ACTION_PHASE, EVENT_PHASE, RENDER_PHASE,
+ RESOURCE_PHASE
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="display-name" type="portlet:display-nameType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="filter-name"
type="portlet:filter-nameType"/>
+ <element name="filter-class"
type="portlet:fully-qualified-classType"/>
+ <element name="lifecycle" type="portlet:string"
maxOccurs="unbounded"/>
+ <element name="init-param" type="portlet:init-paramType"
minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="portlet-collectionType">
+ <annotation>
+ <documentation>
+ The portlet-collectionType is used to identify a subset
+ of portlets within a portlet application to which a
+ security constraint applies.
+ Used in: security-constraint
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="portlet-name" type="portlet:portlet-nameType"
maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="event-definitionType">
+ <annotation>
+ <documentation>
+ The event-definitionType is used to declare events the portlet can either
+ receive or emit.
+ The name must be unique and must be the one the
+ portlet is using in its code for referencing this event.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <choice>
+ <element name="qname" type="xs:QName"/>
+ <element name="name" type="xs:NCName"/>
+ </choice>
+ <element name="alias" type="xs:QName" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="value-type"
type="portlet:fully-qualified-classType" minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="event-definition-referenceType">
+ <annotation>
+ <documentation>
+ The event-definition-referenceType is used to reference events
+ declared with the event-definition element at application level.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <choice>
+ <element name="qname" type="xs:QName"/>
+ <element name="name" type="xs:NCName"/>
+ </choice>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="listenerType">
+ <annotation>
+ <documentation>
+ The listenerType is used to declare listeners for this portlet application.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="display-name" type="portlet:display-nameType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="listener-class"
type="portlet:fully-qualified-classType"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="portlet-infoType">
+ <sequence>
+ <element name="title" type="portlet:titleType"
minOccurs="0"/>
+ <element name="short-title" type="portlet:short-titleType"
minOccurs="0"/>
+ <element name="keywords" type="portlet:keywordsType"
minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <simpleType name="portal-managedType">
+ <annotation>
+ <documentation>
+ portal-managed indicates if a custom portlet mode
+ needs to be managed by the portal or not.
+ Per default all custom portlet modes are portal managed.
+ Valid values are:
+ - true for portal-managed
+ - false for not portal managed
+ Used in: custom-portlet-modes
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string">
+ <enumeration value="true"/>
+ <enumeration value="false"/>
+ </restriction>
+ </simpleType>
+ <complexType name="portlet-modeType">
+ <annotation>
+ <documentation>
+ Portlet modes. The specification pre-defines the following values
+ as valid portlet mode constants:
+ "edit", "help", "view".
+ Portlet mode names are not case sensitive.
+ Used in: custom-portlet-mode, supports
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="portlet-nameType">
+ <annotation>
+ <documentation>
+ The portlet-name element contains the canonical name of the
+ portlet. Each portlet name is unique within the portlet
+ application.
+ Used in: portlet, filter-mapping
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="portlet-preferencesType">
+ <annotation>
+ <documentation>
+ Portlet persistent preference store.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="preference" type="portlet:preferenceType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="preferences-validator"
type="portlet:preferences-validatorType" minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="preferenceType">
+ <annotation>
+ <documentation>
+ Persistent preference values that may be used for customization
+ and personalization by the portlet.
+ Used in: portlet-preferences
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="name" type="portlet:nameType"/>
+ <element name="value" type="portlet:valueType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="read-only" type="portlet:read-onlyType"
minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <simpleType name="preferences-validatorType">
+ <annotation>
+ <documentation>
+ The class specified under preferences-validator implements
+ the PreferencesValidator interface to validate the
+ preferences settings.
+ Used in: portlet-preferences
+ </documentation>
+ </annotation>
+ <restriction base="portlet:fully-qualified-classType"/>
+ </simpleType>
+ <simpleType name="read-onlyType">
+ <annotation>
+ <documentation>
+ read-only indicates that a setting cannot
+ be changed in any of the standard portlet modes
+ ("view","edit" or "help").
+ Per default all preferences are modifiable.
+ Valid values are:
+ - true for read-only
+ - false for modifiable
+ Used in: preferences
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string">
+ <enumeration value="true"/>
+ <enumeration value="false"/>
+ </restriction>
+ </simpleType>
+ <complexType name="resource-bundleType">
+ <annotation>
+ <documentation>
+ Name of the resource bundle containing the language specific
+ portlet informations in different languages (Filename without
+ the language specific part (e.g. _en) and the ending (.properties).
+ Used in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="role-linkType">
+ <annotation>
+ <documentation>
+ The role-link element is a reference to a defined security role.
+ The role-link element must contain the name of one of the
+ security roles defined in the security-role elements.
+ Used in: security-role-ref
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="security-constraintType">
+ <annotation>
+ <documentation>
+ The security-constraintType is used to associate
+ intended security constraints with one or more portlets.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="display-name" type="portlet:display-nameType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="portlet-collection"
type="portlet:portlet-collectionType"/>
+ <element name="user-data-constraint"
type="portlet:user-data-constraintType"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="security-role-refType">
+ <annotation>
+ <documentation>
+ The security-role-ref element contains the declaration of a
+ security role reference in the code of the web application. The
+ declaration consists of an optional description, the security
+ role name used in the code, and an optional link to a security
+ role. If the security role is not specified, the Deployer must
+ choose an appropriate security role.
+ The value of the role name element must be the String used
+ as the parameter to the
+ EJBContext.isCallerInRole(String roleName) method
+ or the HttpServletRequest.isUserInRole(String role) method.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="role-name" type="portlet:role-nameType"/>
+ <element name="role-link" type="portlet:role-linkType"
minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="public-render-parameterType">
+ <annotation>
+ <documentation>
+ The public-render-parameters defines a render parameter that is allowed to be public
+ and thus be shared with other portlets.
+ The identifier must be used for referencing this public render parameter in the
portlet code.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="identifier" type="portlet:string"/>
+ <choice>
+ <element name="qname" type="xs:QName"/>
+ <element name="name" type="xs:NCName"/>
+ </choice>
+ <element name="alias" type="xs:QName" minOccurs="0"
maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="short-titleType">
+ <annotation>
+ <documentation>
+ Locale specific short version of the static title.
+ Used in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="supportsType">
+ <annotation>
+ <documentation>
+ Supports indicates the portlet modes a
+ portlet supports for a specific content type. All portlets must
+ support the view mode.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="mime-type" type="portlet:mime-typeType"/>
+ <element name="portlet-mode" type="portlet:portlet-modeType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="window-state" type="portlet:window-stateType"
minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="supported-localeType">
+ <annotation>
+ <documentation>
+ Indicated the locales the portlet supports.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="titleType">
+ <annotation>
+ <documentation>
+ Locale specific static title for this portlet.
+ Used in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <simpleType name="transport-guaranteeType">
+ <annotation>
+ <documentation>
+ The transport-guaranteeType specifies that
+ the communication between client and portlet should
+ be NONE, INTEGRAL, or CONFIDENTIAL.
+ NONE means that the portlet does not
+ require any transport guarantees. A value of
+ INTEGRAL means that the portlet requires that the
+ data sent between the client and portlet be sent in
+ such a way that it can't be changed in transit.
+ CONFIDENTIAL means that the portlet requires
+ that the data be transmitted in a fashion that
+ prevents other entities from observing the contents
+ of the transmission.
+ In most cases, the presence of the INTEGRAL or
+ CONFIDENTIAL flag will indicate that the use
+ of SSL is required.
+ Used in: user-data-constraint
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string">
+ <enumeration value="NONE"/>
+ <enumeration value="INTEGRAL"/>
+ <enumeration value="CONFIDENTIAL"/>
+ </restriction>
+ </simpleType>
+ <complexType name="user-attributeType">
+ <annotation>
+ <documentation>
+ User attribute defines a user specific attribute that the
+ portlet application needs. The portlet within this application
+ can access this attribute via the request parameter USER_INFO
+ map.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="name" type="portlet:nameType"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="user-data-constraintType">
+ <annotation>
+ <documentation>
+ The user-data-constraintType is used to indicate how
+ data communicated between the client and portlet should be
+ protected.
+ Used in: security-constraint
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="transport-guarantee"
type="portlet:transport-guaranteeType"/>
+ </sequence>
+ <attribute name="id" type="portlet:string"
use="optional"/>
+ </complexType>
+ <complexType name="valueType">
+ <annotation>
+ <documentation>
+ The value element contains the value of a parameter.
+ Used in: init-param
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="window-stateType">
+ <annotation>
+ <documentation>
+ Portlet window state. Window state names are not case sensitive.
+ Used in: custom-window-state
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string"/>
+ </simpleContent>
+ </complexType>
+ <!--- everything below is copied from j2ee_1_4.xsd -->
+ <complexType name="descriptionType">
+ <annotation>
+ <documentation>
+ The description element is used to provide text describing the
+ parent element. The description element should include any
+ information that the portlet application war file producer wants
+ to provide to the consumer of the portlet application war file
+ (i.e., to the Deployer). Typically, the tools used by the
+ portlet application war file consumer will display the
+ description when processing the parent element that contains the
+ description. It has an optional attribute xml:lang to indicate
+ which language is used in the description according to
+ RFC 1766 (
http://www.ietf.org/rfc/rfc1766.txt). The default
+ value of this attribute is English(“en”).
+ Used in: init-param, portlet, portlet-app, security-role
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string">
+ <attribute ref="xml:lang"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="display-nameType">
+ <annotation>
+ <documentation>
+ The display-name type contains a short name that is intended
+ to be displayed by tools. It is used by display-name
+ elements. The display name need not be unique.
+ Example:
+ ...
+ <display-name xml:lang="en">Employee Self
Service</display-name>
+
+ It has an optional attribute xml:lang to indicate
+ which language is used in the description according to
+ RFC 1766 (
http://www.ietf.org/rfc/rfc1766.txt). The default
+ value of this attribute is English(“en”).
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string">
+ <attribute ref="xml:lang"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <simpleType name="fully-qualified-classType">
+ <annotation>
+ <documentation>
+ The elements that use this type designate the name of a
+ Java class or interface.
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string"/>
+ </simpleType>
+ <simpleType name="role-nameType">
+ <annotation>
+ <documentation>
+ The role-nameType designates the name of a security role.
+
+ The name must conform to the lexical rules for an NMTOKEN.
+ </documentation>
+ </annotation>
+ <restriction base="NMTOKEN"/>
+ </simpleType>
+ <simpleType name="string">
+ <annotation>
+ <documentation>
+ This is a special string datatype that is defined by JavaEE
+ as a base type for defining collapsed strings. When
+ schemas require trailing/leading space elimination as
+ well as collapsing the existing whitespace, this base
+ type may be used.
+ </documentation>
+ </annotation>
+ <restriction base="string">
+ <whiteSpace value="collapse"/>
+ </restriction>
+ </simpleType>
+ <simpleType name="filter-nameType">
+ <annotation>
+ <documentation>
+ The logical name of the filter is declare
+ by using filter-nameType. This name is used to map the
+ filter. Each filter name is unique within the portlet
+ application.
+ Used in: filter, filter-mapping
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string"/>
+ </simpleType>
+</schema>
Added: modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter/portlet2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter/portlet2.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/renderParameter/portlet2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,20 @@
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <public-render-parameter>
+ <description>render parameter foo</description>
+ <identifier>blah</identifier>
+ <name>renderParameter1</name>
+ <alias>fooo</alias>
+ <alias>rP1</alias>
+ </public-render-parameter>
+
+ <public-render-parameter>
+ <identifier>blub</identifier>
+ <qname xmlns:x="http://someurl.com">x:foo</qname>
+ <alias xmlns:s="http://someurl.alias.com">s:foo</alias>
+ </public-render-parameter>
+
+</portlet-app>
Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-fail1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-fail1.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-fail1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <portlet>
+ <portlet-name>foo</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ </portlet>
+
+ <portlet>
+ <portlet-name>foobar</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ </portlet>
+
+ <security-constraint id="foo">
+ <display-name>test</display-name>
+ <display-name xml:lang="de">Test</display-name>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ <portlet-name>foobar</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <description>fooConstraint</description>
+ <description xml:lang="de">FooConstraint</description>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-fail2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-fail2.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1-fail2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <portlet>
+ <portlet-name>foo</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ </portlet>
+
+ <security-constraint id="foo">
+ <display-name>test</display-name>
+ <display-name xml:lang="de">Test</display-name>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ <portlet-name>foobar</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <description>fooConstraint</description>
+ <description xml:lang="de">FooConstraint</description>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1.xml
(rev 0)
+++ modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <portlet>
+ <portlet-name>foo</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Foo</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>foobar</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>FooBar</title>
+ </portlet-info>
+ </portlet>
+
+ <security-constraint id="foo">
+ <display-name>test</display-name>
+ <display-name xml:lang="de">Test</display-name>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ <portlet-name>foobar</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <description>fooConstraint</description>
+ <description xml:lang="de">FooConstraint</description>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>INTEGRAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-fail1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-fail1.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-fail1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>foo</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ </portlet>
+
+ <portlet>
+ <portlet-name>foobar</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ </portlet>
+
+ <security-constraint id="foo">
+ <display-name>test</display-name>
+ <display-name xml:lang="de">Test</display-name>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ <portlet-name>foobar</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <description>fooConstraint</description>
+ <description xml:lang="de">FooConstraint</description>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-fail2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-fail2.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2-fail2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>foo</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ </portlet>
+
+ <security-constraint id="foo">
+ <display-name>test</display-name>
+ <display-name xml:lang="de">Test</display-name>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ <portlet-name>foobar</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <description>fooConstraint</description>
+ <description xml:lang="de">FooConstraint</description>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2.xml
(rev 0)
+++ modules/portlet/trunk/mc/src/test/resources/metadata/security/portlet2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>foo</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Foo</title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>foobar</portlet-name>
+ <portlet-class>org.jboss.portal.foo</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>FooBar</title>
+ </portlet-info>
+ </portlet>
+
+ <security-constraint id="foo">
+ <display-name>test</display-name>
+ <display-name xml:lang="de">Test</display-name>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ <portlet-name>foobar</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <description>fooConstraint</description>
+ <description xml:lang="de">FooConstraint</description>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>foo</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>INTEGRAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portlet1.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portlet1.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portlet1.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,17 @@
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <user-attribute id="notFoo">
+ <name>blub</name>
+ </user-attribute>
+
+ <user-attribute id="realFoo">
+ <description>foobar</description>
+ <description xml:lang="de">fuhbar</description>
+ <name>foo</name>
+ </user-attribute>
+
+
+</portlet-app>
\ No newline at end of file
Added: modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portlet2.xml
===================================================================
--- modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portlet2.xml
(rev 0)
+++
modules/portlet/trunk/mc/src/test/resources/metadata/userAttribute/portlet2.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -0,0 +1,17 @@
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <user-attribute id="notFoo">
+ <name>blub</name>
+ </user-attribute>
+
+ <user-attribute id="realFoo">
+ <description>foobar</description>
+ <description xml:lang="de">fuhbar</description>
+ <name>foo</name>
+ </user-attribute>
+
+
+</portlet-app>
\ No newline at end of file
Modified: modules/portlet/trunk/pom.xml
===================================================================
--- modules/portlet/trunk/pom.xml 2008-02-29 00:27:43 UTC (rev 10157)
+++ modules/portlet/trunk/pom.xml 2008-02-29 17:00:22 UTC (rev 10158)
@@ -42,6 +42,7 @@
<module>bridge</module>
<module>federation</module>
<module>management</module>
+ <module>mc</module>
<module>test</module>
</modules>
Modified: modules/portlet/trunk/test/pom.xml
===================================================================
--- modules/portlet/trunk/test/pom.xml 2008-02-29 00:27:43 UTC (rev 10157)
+++ modules/portlet/trunk/test/pom.xml 2008-02-29 17:00:22 UTC (rev 10158)
@@ -30,6 +30,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-mc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>concurrent</groupId>
<artifactId>concurrent</artifactId>
</dependency>
@@ -62,10 +67,6 @@
<artifactId>portal-test-generic</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- </dependency>
- <dependency>
<groupId>jboss</groupId>
<artifactId>jboss-logging-jdk</artifactId>
</dependency>
@@ -343,21 +344,17 @@
<property name="dependency.junit.jar"
value="${maven.dependency.junit.junit.jar.path}"/>
<property name="dependency.cargo-manager.war"
value="${maven.dependency.cargo.cargo-manager.war.path}"/>
- <property name="dependency.portal-web.jar"
-
value="${maven.dependency.org.jboss.portal.web.web-web.jar.path}"/>
+ <property name="dependency.portal-web.jar"
value="${maven.dependency.org.jboss.portal.web.web-web.jar.path}"/>
<!--<property name="dependency.jsr168api.jar"
value="${maven.dependency.org.jboss.portal.portlet.portlet-jsr168api.jar.path}"/>-->
- <property name="dependency.jsr168api.jar"
-
value="${maven.dependency.javax.portlet.portlet-api.jar.path}"/>
- <property name="dependency.ccpp.jar"
-
value="${maven.dependency.javax.ccpp.ccpp.jar.path}"/>
- <property name="dependency.portal-portlet.jar"
-
value="${maven.dependency.org.jboss.portal.portlet.portlet-portlet.jar.path}"/>
- <property
name="dependency.portal-portlet-controller.jar"
-
value="${maven.dependency.org.jboss.portal.portlet.portlet-controller.jar.path}"/>
- <property
name="dependency.portal-portlet-tests.test-jar"
-
value="${maven.dependency.org.jboss.portal.portlet.portlet-portlet.tests.test-jar.path}"/>
- <property name="dependency.cargo-core-uberjar.jar"
-
value="${maven.dependency.cargo.cargo-core-uberjar.jar.path}"/>
+ <property name="dependency.jsr168api.jar"
value="${maven.dependency.javax.portlet.portlet-api.jar.path}"/>
+ <property name="dependency.ccpp.jar"
value="${maven.dependency.javax.ccpp.ccpp.jar.path}"/>
+
+ <property name="dependency.portal-portlet.jar"
value="${maven.dependency.org.jboss.portal.portlet.portlet-portlet.jar.path}"/>
+ <property
name="dependency.portal-portlet-controller.jar"
value="${maven.dependency.org.jboss.portal.portlet.portlet-controller.jar.path}"/>
+ <property name="dependency.portal-portlet-mc.jar"
value="${maven.dependency.org.jboss.portal.portlet.portlet-mc.jar.path}"/>
+ <property
name="dependency.portal-portlet-tests.test-jar"
value="${maven.dependency.org.jboss.portal.portlet.portlet-portlet.tests.test-jar.path}"/>
+
+ <property name="dependency.cargo-core-uberjar.jar"
value="${maven.dependency.cargo.cargo-core-uberjar.jar.path}"/>
<property name="dependency.cargo-ant.jar"
value="${maven.dependency.cargo.cargo-ant.jar.path}"/>
<property name="dependency.jaxb-api.jar"
value="${maven.dependency.javax.xml.bind.jaxb-api.jar.path}"/>
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationContextImpl.java 2008-02-29
00:27:43 UTC (rev 10157)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationContextImpl.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -1,72 +0,0 @@
-/******************************************************************************
- * 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.portlet.test;
-
-import org.jboss.portal.portlet.container.PortletApplicationContext;
-import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
-import org.jboss.portal.web.WebApp;
-
-import javax.servlet.ServletContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletApplicationContextImpl implements PortletApplicationContext
-{
-
- /** . */
- private final WebApp webApp;
-
- ManagedPortletApplication managedPortletApplication;
-
- public PortletApplicationContextImpl(WebApp webApp)
- {
- this.webApp = webApp;
- }
-
- public ServletContext getServletContext()
- {
- return webApp.getServletContext();
- }
-
- public String getContextPath()
- {
- return webApp.getContextPath();
- }
-
- public ClassLoader getClassLoader()
- {
- return webApp.getClassLoader();
- }
-
- public void managedStart()
- {
- managedPortletApplication.managedStart();
- }
-
- public void managedStop()
- {
- managedPortletApplication.managedStop();
- }
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2008-02-29
00:27:43 UTC (rev 10157)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -1,346 +0,0 @@
-/******************************************************************************
- * 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.portlet.test;
-
-import org.apache.log4j.Logger;
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
-import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
-import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEventBroadcaster;
-import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEventListener;
-import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEvent;
-import org.jboss.portal.portlet.container.managed.ManagedObjectEvent;
-import org.jboss.portal.portlet.container.managed.ManagedObject;
-import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEvent;
-import org.jboss.portal.portlet.container.managed.LifeCycleStatus;
-import org.jboss.portal.portlet.container.PortletContainerInvoker;
-import org.jboss.portal.portlet.container.PortletContainer;
-import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
-import static
org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_168_NS;
-import static
org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_286_NS;
-import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle;
-import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle;
-import org.jboss.portal.portlet.test.metadata.factory.PortletApplicationModelFactory;
-import
org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication10MetaData;
-import
org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.ValueTrimmingFilter;
-import org.jboss.portal.web.ServletContainer;
-import org.jboss.portal.web.WebApp;
-import org.jboss.portal.web.WebAppEvent;
-import org.jboss.portal.web.WebAppLifeCycleEvent;
-import org.jboss.portal.web.WebAppListener;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletApplicationDeployer implements WebAppListener,
PortletApplicationRegistry
-{
-
- static
- {
- try
- {
- SingletonSchemaResolverFactory factory =
SingletonSchemaResolverFactory.getInstance();
- DefaultSchemaResolver resolver =
(DefaultSchemaResolver)factory.getSchemaBindingResolver();
-
- /** SchemaResolver */
- resolver.addSchemaLocation(PORTLET_JSR_168_NS,
"portlet-app_1_0.xsd");
- resolver.addSchemaLocation(PORTLET_JSR_286_NS,
"portlet-app_2_0.xsd");
- resolver.addClassBinding(PORTLET_JSR_286_NS,
AnnotationPortletApplication20MetaData.class);
- resolver.addClassBinding(PORTLET_JSR_168_NS,
AnnotationPortletApplication10MetaData.class);
- }
- catch (Exception e)
- {
- throw new Error(e);
- }
- }
-
- /** . */
- private Logger log = Logger.getLogger(PortletApplicationDeployer.class);
-
- /** . */
- private PortletApplicationRegistry registry;
-
- /** . */
- private ServletContainer servletContainer;
-
- /** . */
- private Map<String, PortletApplicationDeployment> deploymentMap = new
HashMap<String, PortletApplicationDeployment>();
-
- /** . */
- private ClassLoader classLoader;
-
- /** . */
- private final Map<String, PortletApplicationLifeCycle> applications = new
HashMap<String, PortletApplicationLifeCycle>();
-
- /** . */
- private PortletContainerInvoker portletContainerInvoker;
-
- /** . */
- private ManagedObjectRegistryEventBroadcaster broadcaster;
-
- public PortletApplicationRegistry getRegistry()
- {
- return registry;
- }
-
- public void setRegistry(PortletApplicationRegistry registry)
- {
- this.registry = registry;
- }
-
- public ServletContainer getServletContainer()
- {
- return servletContainer;
- }
-
- public void setServletContainer(ServletContainer servletContainer)
- {
- this.servletContainer = servletContainer;
- }
-
- public PortletContainerInvoker getPortletContainerInvoker()
- {
- return portletContainerInvoker;
- }
-
- public void setPortletContainerInvoker(PortletContainerInvoker
portletContainerInvoker)
- {
- this.portletContainerInvoker = portletContainerInvoker;
- }
-
- public void onEvent(WebAppEvent event)
- {
- if (event instanceof WebAppLifeCycleEvent)
- {
- WebAppLifeCycleEvent lifeCycleEvent = (WebAppLifeCycleEvent)event;
- String cp = event.getWebApp().getContextPath();
- switch (lifeCycleEvent.getType())
- {
- case WebAppLifeCycleEvent.ADDED:
- log.debug("Going to install war file" + cp);
- add(event.getWebApp());
- log.debug("Installed war file" + cp);
- break;
- case WebAppLifeCycleEvent.REMOVED:
- try
- {
- log.debug("Going to uninstall war file" + cp);
- remove(event.getWebApp());
- log.debug("Uninstalled war file" + cp);
- }
- catch (Throwable e)
- {
- log.error("Uninstalled war file " + cp + " with an
error", e);
- }
- break;
- }
- }
- }
-
- protected void add(WebApp webApp)
- {
- //
- PortletApplication10MetaData metaData = buildPortletApplicationMetaData(webApp);
- if (metaData != null)
- {
- ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- PortletApplicationDeployment deployment = new
PortletApplicationDeployment(broadcaster, webApp, metaData);
- deploymentMap.put(webApp.getContextPath(), deployment);
- deployment.install();
-
- //
- PortletApplicationLifeCycle portletApplicationLifeCycle =
deployment.getPortletApplicationLifeCycle();
- applications.put(portletApplicationLifeCycle.getId(),
portletApplicationLifeCycle);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(oldCL);
- }
- }
- }
-
- private void remove(WebApp webApp)
- {
- PortletApplicationDeployment deployment =
deploymentMap.remove(webApp.getContextPath());
- if (deployment != null)
- {
- PortletApplicationLifeCycle portletApplicationLifeCycle =
deployment.getPortletApplicationLifeCycle();
- applications.remove(portletApplicationLifeCycle.getId());
-
- //
- ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- deployment.uninstall();
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(oldCL);
- }
- }
- }
-
- public void start()
- {
- broadcaster = new ManagedObjectRegistryEventBroadcaster();
- classLoader = Thread.currentThread().getContextClassLoader();
-
- //
- broadcaster.addListener(bridgeToInvoker);
- servletContainer.addWebAppListener(this);
- }
-
- public void stop()
- {
- // This should generate remove web app event and in cascade clear the registry
- // as well as the portlet container invoker
- servletContainer.removeWebAppListener(this);
-
- //
- classLoader = null;
- broadcaster = null;
- }
-
- private PortletApplication10MetaData buildPortletApplicationMetaData(WebApp webApp)
- {
- try
- {
- URL url =
webApp.getServletContext().getResource("/WEB-INF/portlet.xml");
- if (url != null)
- {
- InputStream in = null;
- try
- {
- in = IOTools.safeBufferedWrapper(url.openStream());
-
- // Validate
- Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setNamespaceAware(true);
- unmarshaller.setSchemaValidation(false);
- unmarshaller.setValidation(false);
-
- //
- PortletApplicationModelFactory factory = new
PortletApplicationModelFactory();
-
- // Unmarshal
- PortletApplication10MetaData portletApplicationMD =
(PortletApplication10MetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter(factory),
null);
-
- //
- return portletApplicationMD;
- }
- finally
- {
- IOTools.safeClose(in);
- }
- }
- }
- catch (IOException e)
- {
- log.error("Cannot read portlet.xml", e);
- }
- catch (JBossXBException e)
- {
- log.error("Cannot parse portlet.xml", e);
- }
- return null;
- }
-
- public Collection<? extends ManagedPortletApplication>
getManagedPortletApplications()
- {
- return applications.values();
- }
-
- public ManagedPortletApplication getManagedPortletApplication(String id)
- {
- return applications.get(id);
- }
-
- public void addListener(ManagedObjectRegistryEventListener listener)
- {
- broadcaster.addListener(listener);
- }
-
- public void removeListener(ManagedObjectRegistryEventListener listener)
- {
- broadcaster.addListener(listener);
- }
-
- /**
- * Bridge managed object event to add/remove portlet container in portlet container
invoker.
- */
- private final ManagedObjectRegistryEventListener bridgeToInvoker = new
ManagedObjectRegistryEventListener()
- {
- public void onEvent(ManagedObjectRegistryEvent event)
- {
- if (event instanceof ManagedObjectEvent)
- {
- ManagedObjectEvent managedObjectEvent = (ManagedObjectEvent)event;
- ManagedObject managedObject = managedObjectEvent.getManagedObject();
-
- //
- if (managedObject instanceof PortletContainerLifeCycle)
- {
- PortletContainerLifeCycle portletContainerLifeCycle =
(PortletContainerLifeCycle)managedObject;
- PortletContainer portletContainer =
portletContainerLifeCycle.getPortletContainer();
-
- //
- if (managedObjectEvent instanceof ManagedObjectLifeCycleEvent)
- {
- ManagedObjectLifeCycleEvent lifeCycleEvent =
(ManagedObjectLifeCycleEvent)managedObjectEvent;
-
- //
- LifeCycleStatus status = lifeCycleEvent.getStatus();
-
- //
- if (status == LifeCycleStatus.STARTED)
- {
- portletContainerInvoker.addPortletContainer(portletContainer);
- }
- else
- {
- portletContainerInvoker.removePortletContainer(portletContainer);
- }
- }
- }
- }
- }
- };
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-29
00:27:43 UTC (rev 10157)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -1,168 +0,0 @@
-/******************************************************************************
- * 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.portlet.test;
-
-import org.apache.log4j.Logger;
-import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder;
-import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext;
-import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
-import org.jboss.portal.portlet.impl.info.ContainerFilterInfo;
-import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImpl;
-import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
-import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
-import org.jboss.portal.portlet.impl.jsr168.PortletFilterImpl;
-import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
-import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle;
-import org.jboss.portal.portlet.impl.container.PortletFilterLifeCycle;
-import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle;
-import org.jboss.portal.portlet.container.object.PortletApplicationObject;
-import org.jboss.portal.portlet.container.object.PortletContainerObject;
-import org.jboss.portal.portlet.container.object.PortletFilterObject;
-import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEventListener;
-import org.jboss.portal.web.WebApp;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletApplicationDeployment
-{
-
- /** . */
- private final Logger log;
-
- /** . */
- private final WebApp webApp;
-
- /** . */
- private final PortletApplication10MetaData metaData;
-
- /** . */
- private final ManagedObjectRegistryEventListener listener;
-
- /** . */
- private PortletApplicationLifeCycle portletApplicationLifeCycle;
-
- public PortletApplicationDeployment(
- ManagedObjectRegistryEventListener listener,
- WebApp webApp,
- PortletApplication10MetaData metaData)
- {
- this.listener = listener;
- this.webApp = webApp;
- this.metaData = metaData;
- this.log = Logger.getLogger(PortletApplicationDeployment.class + "." +
webApp.getContextPath().replace('.', '_'));
- }
-
- public PortletApplicationLifeCycle getPortletApplicationLifeCycle()
- {
- return portletApplicationLifeCycle;
- }
-
- void install()
- {
-
- log.debug("Starting installation");
-
- //
- ContainerInfoBuilderContext builderContext = new
ContainerInfoBuilderContextImpl(metaData, webApp);
- ContainerInfoBuilder builder = new ContainerInfoBuilder(webApp.getContextPath(),
metaData, builderContext);
- builder.build();
-
- //
- PortletApplicationObject portletApplicationObject = new
PortletApplicationImpl(builder.getApplication());
- PortletApplicationContextImpl portletApplicationContext = new
PortletApplicationContextImpl(webApp);
-
-
- //
- portletApplicationLifeCycle = new PortletApplicationLifeCycle(
- listener,
- portletApplicationContext,
- portletApplicationObject);
-
- // Needed for the managed callbacks
- portletApplicationContext.managedPortletApplication = portletApplicationLifeCycle;
-
- //
- for (ContainerFilterInfo filterInfo :
builder.getApplication().getFilters().values())
- {
- PortletFilterObject portletFilterObject = new PortletFilterImpl(filterInfo);
- PortletFilterContextImpl portletFilterContext = new PortletFilterContextImpl();
-
- //
- PortletFilterLifeCycle portletFilterLifeCycle =
portletApplicationLifeCycle.addPortletFilter(portletFilterContext, portletFilterObject);
-
- // Needed for the managed callbacks
- portletFilterContext.managedPortletFilter = portletFilterLifeCycle;
- }
-
- //
- for (ContainerPortletInfo containerInfo : builder.getPortlets())
- {
- PortletContainerObject portletContainerObject = new
PortletContainerImpl(containerInfo);
- PortletContainerContextImpl portletContainerContext = new
PortletContainerContextImpl();
-
- //
- PortletContainerLifeCycle portletContainerLifeCycle =
portletApplicationLifeCycle.addPortletContainer(portletContainerContext,
portletContainerObject);
-
- // Needed for the managed callbacks
- portletContainerContext.managedPortletContainer = portletContainerLifeCycle;
-
- // Now create deps
- for (String filterRef : containerInfo.getFilterRefs())
- {
- PortletFilterLifeCycle portletFilterLifeCycle =
portletApplicationLifeCycle.getManagedPortletFilter(filterRef);
-
- //
- if (portletFilterLifeCycle != null)
- {
- portletApplicationLifeCycle.addDependency(portletFilterLifeCycle,
portletContainerLifeCycle);
- }
- else
- {
- // todo
- }
- }
- }
-
- //
- portletApplicationLifeCycle.create();
-
- //
- portletApplicationLifeCycle.managedStart();
-
- //
-
- }
-
- void uninstall()
- {
- log.debug("Uninstalling");
-
- //
- portletApplicationLifeCycle.managedStop();
-
- //
- log.debug("Uninstalled");
- }
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletContainerContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletContainerContextImpl.java 2008-02-29
00:27:43 UTC (rev 10157)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletContainerContextImpl.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -1,47 +0,0 @@
-/******************************************************************************
- * 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.portlet.test;
-
-import org.jboss.portal.portlet.container.PortletContainerContext;
-import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletContainerContextImpl implements PortletContainerContext
-{
-
- /** . */
- ManagedPortletContainer managedPortletContainer;
-
- public void managedStart()
- {
- managedPortletContainer.managedStart();
- }
-
- public void managedStop()
- {
- managedPortletContainer.managedStop();
- }
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletFilterContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletFilterContextImpl.java 2008-02-29
00:27:43 UTC (rev 10157)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletFilterContextImpl.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -1,46 +0,0 @@
-/******************************************************************************
- * 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.portlet.test;
-
-import org.jboss.portal.portlet.container.PortletFilterContext;
-import org.jboss.portal.portlet.container.managed.ManagedPortletFilter;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletFilterContextImpl implements PortletFilterContext
-{
-
- ManagedPortletFilter managedPortletFilter;
-
- public void managedStart()
- {
- managedPortletFilter.managedStart();
- }
-
- public void managedStop()
- {
- managedPortletFilter.managedStop();
- }
-}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletApplicationDeployer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletApplicationDeployer.java 2008-02-29
00:27:43 UTC (rev 10157)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletApplicationDeployer.java 2008-02-29
17:00:22 UTC (rev 10158)
@@ -24,6 +24,7 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.web.WebApp;
+import org.jboss.portal.portlet.mc.PortletApplicationDeployer;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-02-29 00:27:43 UTC (rev 10157)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-02-29 17:00:22 UTC (rev 10158)
@@ -134,6 +134,9 @@
<path id="mc.portal-portlet-controller">
<pathelement
path="${dependency.portal-portlet-controller.jar}"/>
</path>
+ <path id="mc.portal-portlet-mc">
+ <pathelement path="${dependency.portal-portlet-mc.jar}"/>
+ </path>
<path id="mc.jaxb-api">
<pathelement path="${dependency.jaxb-api.jar}"/>
</path>
@@ -404,6 +407,7 @@
<path refid="mc.portal-common"/>
<path refid="mc.portal-portlet-controller"/>
+ <path refid="mc.portal-portlet-mc"/>
<!-- Remote plugin -->
<path refid="mc.jboss-remoting"/>
@@ -440,6 +444,7 @@
<path refid="mc.portal-common"/>
<path refid="mc.portal-portlet-controller"/>
+ <path refid="mc.portal-portlet-mc"/>
<!-- Remote plugin -->
<path refid="mc.jboss-remoting"/>
@@ -707,6 +712,7 @@
<path location="${dependency.jsr168api.jar}"/>
<path location="${dependency.ccpp.jar}"/>
<path refid="mc.portal-portlet-controller"/>
+ <path refid="mc.portal-portlet-mc"/>
</path>
</copy>
@@ -749,6 +755,7 @@
<path refid="mc.portal-common"/>
<path refid="mc.portal-portlet-controller"/>
+ <path refid="mc.portal-portlet-mc"/>
<!-- Remote plugin -->
<path refid="mc.jboss-remoting"/>
@@ -809,6 +816,7 @@
<path refid="mc.portal-common"/>
<path refid="mc.portal-portlet-controller"/>
+ <path refid="mc.portal-portlet-mc"/>
<!-- Remote plugin -->
<path refid="mc.jboss-remoting"/>
Modified:
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-02-29
00:27:43 UTC (rev 10157)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -23,7 +23,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="PortletApplicationDeployer"
class="org.jboss.portal.portlet.test.PortletApplicationDeployer">
+ <bean name="PortletApplicationDeployer"
class="org.jboss.portal.portlet.mc.PortletApplicationDeployer">
<property name="servletContainer"><inject
bean="ServletContainer"/></property>
<property name="portletContainerInvoker"><inject
bean="PortletContainerInvoker"/></property>
</bean>
Modified: modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml 2008-02-29
00:27:43 UTC (rev 10157)
+++ modules/portlet/trunk/test/src/test/resources/test/local-jboss-unit.xml 2008-02-29
17:00:22 UTC (rev 10158)
@@ -21,69 +21,6 @@
</class>
</test>
<test>
- <class
name="org.jboss.portal.portlet.test.metadata.CustomPortletModeTestEverythingTestCase"
/>
- <parameter name="parser">
- <value>annotation</value>
- <value>factory</value>
- </parameter>
- </test>
- <test>
- <class
name="org.jboss.portal.portlet.test.metadata.CustomWindowStateTestEverythingTestCase"
/>
- <parameter name="parser">
- <value>annotation</value>
- <value>factory</value>
- </parameter>
- </test>
- <test>
- <class
name="org.jboss.portal.portlet.test.metadata.EventTestEverythingTestCase" />
- <parameter name="parser">
- <value>annotation</value>
- <value>factory</value>
- </parameter>
- </test>
- <test>
- <class
name="org.jboss.portal.portlet.test.metadata.FilterTestEverythingTestCase"
/>
- <parameter name="parser">
- <value>annotation</value>
- <value>factory</value>
- </parameter>
- </test>
- <test>
- <class
name="org.jboss.portal.portlet.test.metadata.GeneralMetaDataTestCase" />
- <parameter name="parser">
- <value>annotation</value>
- <value>factory</value>
- </parameter>
- </test>
- <test>
- <class
name="org.jboss.portal.portlet.test.metadata.PortletTestEverythingTestCase"
/>
- <parameter name="parser">
- <value>annotation</value>
- <value>factory</value>
- </parameter>
- </test>
- <test>
- <class
name="org.jboss.portal.portlet.test.metadata.RenderParameterTestEverythingTestCase"
/>
- <parameter name="parser">
- <value>annotation</value>
- <value>factory</value>
- </parameter>
- </test>
- <test>
- <class
name="org.jboss.portal.portlet.test.metadata.SecurityConstraintTestEverythingTestCase"
/>
- <parameter name="parser">
- <value>annotation</value>
- <value>factory</value>
- </parameter>
- </test>
- <test>
- <class
name="org.jboss.portal.portlet.test.metadata.UserAttributeTestEverythingTestCase"
/>
- <parameter name="parser">
- <value>annotation</value>
- <value>factory</value>
- </parameter>
- </test>
- <test>
<class
name="org.jboss.portal.portlet.controller.StateControllerContextTestCase">
</class>
</test>