JBoss Portal SVN: r12391 - in modules/deployer/trunk: deployer and 10 other directories.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2008-12-15 23:33:13 -0500 (Mon, 15 Dec 2008)
New Revision: 12391
Added:
modules/deployer/trunk/deployer/src/main/deployer/conf/
modules/deployer/trunk/deployer/src/main/deployer/conf/test.tld
modules/deployer/trunk/deployer/src/main/deployer/dtd/portal-object_2_6.dtd
modules/deployer/trunk/deployer/src/main/deployer/tld/
modules/deployer/trunk/deployer/src/main/deployer/tld/portlet.tld
modules/deployer/trunk/deployer/src/main/deployer/tld/portlet_2_0.tld
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalResolverFactory.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalUnmarshallerFactory.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/JBossPortletParsingDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalAppParsingDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalObjectParsingDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalResolverDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortletInstancesParsingDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortletParsingDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/CommandServletDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDependencyDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletTLDDeployer.java
Removed:
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/Deployment.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/jboss/
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/PortalDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletModule.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletModuleMBean.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletWarDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/parsing/
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/structure/
Modified:
modules/deployer/trunk/build/pom.xml
modules/deployer/trunk/deployer/
modules/deployer/trunk/deployer/pom.xml
modules/deployer/trunk/deployer/src/assemble/jboss-portal-deployer.xml
modules/deployer/trunk/deployer/src/main/deployer/META-INF/deployer-jboss-beans.xml
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalEntityResolver.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/LibDirectoryStructure.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/PortalPostWebDeployer.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/WebDeploymentListener.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDeployer.java
Log:
Code update dump.
Modified: modules/deployer/trunk/build/pom.xml
===================================================================
--- modules/deployer/trunk/build/pom.xml 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/build/pom.xml 2008-12-16 04:33:13 UTC (rev 12391)
@@ -17,9 +17,12 @@
<version.assembly>2.2-beta-2</version.assembly>
<version.jboss-deployers>2.0.0.CR1</version.jboss-deployers>
<version.jboss-metadata>1.0.0.CR1</version.jboss-metadata>
+ <version.jboss.portal>2.8-SNAPSHOT</version.jboss.portal>
<version.jboss.portal.metadata>trunk-SNAPSHOT</version.jboss.portal.metadata>
<version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
<version.jboss.portal.portlet>2.1.0-SNAPSHOT</version.jboss.portal.portlet>
+ <version.jboss.portal.server>2.7.0.GA</version.jboss.portal.server>
+ <version.jboss.portlet.server>2.7.0</version.jboss.portlet.server>
<version.jboss-as>5.0.0.CR2</version.jboss-as>
<version.saxon>6.5.3</version.saxon>
</properties>
@@ -103,6 +106,21 @@
<artifactId>portlet-mc</artifactId>
<version>${version.jboss.portal.portlet}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.portal.core</groupId>
+ <artifactId>server</artifactId>
+ <version>${version.jboss.portal.server}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.server</groupId>
+ <artifactId>portlet-server</artifactId>
+ <version>${version.jboss.portlet.server}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.core</groupId>
+ <artifactId>core</artifactId>
+ <version>${version.jboss.portal.server}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Property changes on: modules/deployer/trunk/deployer
___________________________________________________________________
Name: svn:ignore
+ target
Modified: modules/deployer/trunk/deployer/pom.xml
===================================================================
--- modules/deployer/trunk/deployer/pom.xml 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/pom.xml 2008-12-16 04:33:13 UTC (rev 12391)
@@ -54,7 +54,18 @@
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>portlet-mc</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.jboss.portal.core</groupId>
+ <artifactId>server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.server</groupId>
+ <artifactId>portlet-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.core</groupId>
+ <artifactId>core</artifactId>
+ </dependency>
</dependencies>
<build>
Modified: modules/deployer/trunk/deployer/src/assemble/jboss-portal-deployer.xml
===================================================================
--- modules/deployer/trunk/deployer/src/assemble/jboss-portal-deployer.xml 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/assemble/jboss-portal-deployer.xml 2008-12-16 04:33:13 UTC (rev 12391)
@@ -21,7 +21,8 @@
<include>org.jboss.portal.web:web-web</include>
<include>org.jboss.portal.portlet:portlet-portlet</include>
<include>org.jboss.portal.portlet:portlet-mc</include>
-
+ <include>org.jboss.portal.server:server-server</include>
+ <include>org.jboss.portal.server:portlet-server</include>
<include>javax.ccpp:ccpp</include>
<include>javax.portlet:portlet-api</include>
Modified: modules/deployer/trunk/deployer/src/main/deployer/META-INF/deployer-jboss-beans.xml
===================================================================
--- modules/deployer/trunk/deployer/src/main/deployer/META-INF/deployer-jboss-beans.xml 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/deployer/META-INF/deployer-jboss-beans.xml 2008-12-16 04:33:13 UTC (rev 12391)
@@ -30,11 +30,39 @@
<key>-//JBoss Portal//DTD Portlet Instances 2.6//EN</key>
<value>dtd/portlet-instances_2_6.dtd</value>
</entry>
+ <entry>
+ <key>-//JBoss Portal//DTD Portal Object 2.6//EN</key>
+ <value>dtd/portal-object_2_6.dtd</value>
+ </entry>
</map>
</property>
</bean>
+ <bean name="PortalResolverFactory" class="org.jboss.portal.deployer.PortalResolverFactory">
+ <constructor factoryClass="org.jboss.portal.deployer.PortalResolverFactory" factoryMethod="getInstance"/>
+ <property name="DTDMapping">
+ <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>jboss-portal-app_2_6.dtd</key>
+ <value>org.jboss.portal.metadata.jboss.app.PortalAppMetaData</value>
+ </entry>
+ <entry>
+ <key>portlet-instances_2_6.dtd</key>
+ <value>org.jboss.portal.metadata.portlet.PortletDeploymentInstancesMetaData</value>
+ </entry>
+ <entry>
+ <key>portal-object_2_6.dtd</key>
+ <value>org.jboss.portal.metadata.portal.object.PortalObjectMetaData</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+ <bean name="PortalUnmarshallerFactory" class="org.jboss.portal.deployer.PortalUnmarshallerFactory">
+ <constructor factoryClass="org.jboss.portal.deployer.PortalUnmarshallerFactory" factoryMethod="getInstance"/>
+ <property name="entityResolver"><inject bean="PortalEntityResolver"/></property>
+ </bean>
+
<!-- initial fake deployer only used to get JBoss AS 5 working with Portal 2.7 -->
<bean name="PortalPostWebDeployer" class="org.jboss.portal.deployer.portal.PortalPostWebDeployer">
<property name="warDeployerOrder"><inject bean="WarDeployer" property="relativeOrder"/></property>
@@ -42,31 +70,53 @@
<depends>WarDeployer</depends>
</bean>
<!-- end fake deployer -->
-
- <!-- Portal Deployer -->
+<!-- May not be needed in the recent JBoss AS5
<bean name="LibDirectoryStructure" class="org.jboss.portal.deployer.portal.LibDirectoryStructure">
</bean>
+-->
+ <!-- jboss-portal-app.xml parsing-->
+ <bean name="PortalAppParsingDeployer" class="org.jboss.portal.deployer.parsing.PortalAppParsingDeployer"/>
- <!-- Portlet Deployer -->
-<!-- <bean name="PortletStructure" class="org.jboss.portal.deployer.portlet.structure.PortletStructure">
- </bean> -->
+ <!-- portlet-instances.xml parsing -->
+ <bean name="PortletInstancesParsingDeployer" class="org.jboss.portal.deployer.parsing.PortletInstancesParsingDeployer"/>
- <bean name="PortalAppParsingDeployer" class="org.jboss.portal.deployer.portlet.parsing.PortalAppParsingDeployer">
- <property name="entityResolver"><inject bean="PortalEntityResolver"/></property>
- </bean>
+ <!-- *-object.xml parsing -->
+ <bean name="PortalObjectParsingDeployer" class="org.jboss.portal.deployer.parsing.PortalObjectParsingDeployer"/>
- <bean name="PortletParsingDeployer" class="org.jboss.portal.deployer.portlet.parsing.PortletParsingDeployer">
+ <!-- portlet.xml parsing -->
+ <bean name="PortletParsingDeployer" class="org.jboss.portal.deployer.parsing.PortletParsingDeployer">
<property name="entityResolver"><inject bean="PortalEntityResolver"/></property>
</bean>
- <bean name="JBossPortletParsingDeployer" class="org.jboss.portal.deployer.jboss.portlet.parsing.JBossPortletParsingDeployer">
+ <!-- jboss-portlet.xml parsing -->
+ <bean name="JBossPortletParsingDeployer" class="org.jboss.portal.deployer.parsing.JBossPortletParsingDeployer">
<property name="entityResolver"><inject bean="PortalEntityResolver"/></property>
</bean>
-<!-- <bean name="PortletWarDeployer" class="org.jboss.portal.deployer.portlet.PortletWarDeployer"/> -->
+ <!-- component deployables -->
+ <!--
+ where the actual deployment occurs, these classes will send the data to the various runtime containers
+ -->
+
+ <!-- deployer that makes sure that dependencies are running before continuing -->
+ <bean name="PortletDependencyDeployer" class="org.jboss.portal.deployer.portlet.PortletDependencyDeployer">
+ <!-- <property name="dependencies">
+ <list elementClass="java.lang.String">
+ <value>foo</value>
+ </list>
+ </property> -->
+ </bean>
+
+ <bean name="CommandServletDeployer" class="org.jboss.portal.deployer.portlet.CommandServletDeployer"/>
+ <bean name="PortletTLDDeployer" class="org.jboss.portal.deployer.portlet.PortletTLDDeployer">
+ <property name="warDeployer"><inject bean="WarDeployer"/></property>
+ <property name="MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+ <property name="TLDDirectory">tld</property>
+ </bean>
+
<bean name="PortletDeployer" class="org.jboss.portal.deployer.portlet.PortletDeployer">
<property name="warDeployerOrder"><inject bean="WarDeployer" property="relativeOrder"/></property>
</bean>
Added: modules/deployer/trunk/deployer/src/main/deployer/conf/test.tld
===================================================================
--- modules/deployer/trunk/deployer/src/main/deployer/conf/test.tld (rev 0)
+++ modules/deployer/trunk/deployer/src/main/deployer/conf/test.tld 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1 @@
+test tld
Added: modules/deployer/trunk/deployer/src/main/deployer/dtd/portal-object_2_6.dtd
===================================================================
--- modules/deployer/trunk/deployer/src/main/deployer/dtd/portal-object_2_6.dtd (rev 0)
+++ modules/deployer/trunk/deployer/src/main/deployer/dtd/portal-object_2_6.dtd 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,395 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!--
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+-->
+
+<!--
+The deployements element is a generic container for deployment elements.
+-->
+<!ELEMENT deployments (deployment*)>
+
+<!--
+The deployment is a generic container for portal object elements. The parent-ref
+child gives the name of the parent object that the current object will use as parent.
+The optional if-exists element define the behavior when a portal object which
+an identical name is already child of the parent element. The default behavior of
+the if-exist tag is to keep the existing object and not create a new object. The
+last element is the portal object itself.
+
+Example:
+
+<deployment>
+ <parent-ref>default</parent-ref>
+ <page>
+ ...
+ </page>
+</deployment>
+
+All portal objects have a common configuration which can be :
+
+1/ a listener : specifies the id of a listener is the listener registry. A listener
+object is able to listen portal events which apply to the portal node hierarchy.
+
+2/ properties : a set of generic properties owned by the portal object. Some
+properties can drive the behavior of the object.
+
+3/ security-constraint : defines security configuration of the portal object.
+
+-->
+<!ELEMENT deployment (parent-ref?,if-exists?,(context|portal|page|window))>
+
+<!--
+Contains a reference to the parent object. The naming convention for naming object
+is to concatenate the names of the path to the object and separate the names by a dot.
+If the path is empty then the empty string must be used.
+
+Example:
+
+<parent-ref/> the root having an empty path
+
+<parent-ref>default</parent-ref> the object with the name default under the root
+having the path (default)
+
+<parent-ref>default.default</parent-ref> the object with the path (default,default)
+
+-->
+<!ELEMENT parent-ref (#PCDATA)>
+
+<!--
+The authorized values are overwrite and keep. Overwrite means that the existing
+object will be destroyed and the current declaration will be used. Keep means that
+the existing object will not be destroyed and no creation hence will be done.
+-->
+<!ELEMENT if-exists (#PCDATA)>
+
+<!--
+A portal object of type context. A context type represent a node in the tree which
+does not have a visual representation. It can exist only under the root. A context can
+only have children with the portal type.
+-->
+<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
+ (display-name* | (resource-bundle, supported-locale+)))>
+
+<!--
+The context name value.
+-->
+<!ELEMENT context-name (#PCDATA)>
+
+<!--
+A portal object of type portal. A portal type represents a virtual portal and can
+have children of type page. In addition of the common portal object elements it support
+also the declaration of the modes and the window states it supports. If no declaration
+of modes or window states is done then the default value will be respectively
+(view,edit,help) and (normal,minimized,maximized).
+-->
+<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,
+ listener?,security-constraint?,page*,
+ (display-name* | (resource-bundle, supported-locale+)), coordination?)>
+
+<!--
+The portal name value.
+-->
+<!ELEMENT portal-name (#PCDATA)>
+
+
+<!--
+The supported modes of a portal.
+
+Example:
+
+<supported-mode>
+ <mode>view</mode>
+ <mode>edit</mode>
+ <mode>help</mode>
+</supported-mode>
+-->
+<!ELEMENT supported-modes (mode*)>
+
+<!--
+A portlet mode value.
+-->
+<!ELEMENT mode (#PCDATA)>
+
+<!--
+The supported window states of a portal.
+
+Example:
+
+<supported-window-states>
+ <window-state>normal</window-state>
+ <window-state>minimized</window-state>
+ <window-state>maximized</window-state>
+</supported-window-states>
+
+-->
+<!ELEMENT supported-window-states (window-state*)>
+
+<!--
+A window state value.
+-->
+<!ELEMENT window-state (#PCDATA)>
+
+<!--
+A portal object of type page. A page type represents a page which can have children of
+type page and window. The children windows are the windows of the page and the children
+pages are the subpages of this page.
+-->
+<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page|window)*,
+ (display-name* | (resource-bundle, supported-locale+)), coordination?)>
+
+<!ELEMENT display-name (#PCDATA)>
+<!ATTLIST display-name
+ xml:lang NMTOKEN #IMPLIED
+>
+
+<!ELEMENT resource-bundle (#PCDATA)>
+
+<!ELEMENT supported-locale (#PCDATA)>
+
+<!--
+The page name value.
+-->
+<!ELEMENT page-name (#PCDATA)>
+
+<!--
+A portal object of type window. A window type represents a window. Beside the common
+properties a window has a content and belong to a region on the page.
+
+The instance-ref or content tags are used to define the content of the window. The
+usage of the content tag is generic and can be used to describe any kind of content.
+The instance-ref is a shortcut to define a content type of portlet which points to a
+portlet instance.
+
+The region and height defines how the window is placed in the page.
+-->
+<!ELEMENT window (window-name,(instance-ref|content),region,height,
+ initial-window-state?,initial-mode?,properties?,listener?,
+ (display-name* | (resource-bundle, supported-locale+)))>
+
+<!--
+The window name value.
+-->
+<!ELEMENT window-name (#PCDATA)>
+
+<!--
+Define the content of the window as a reference to a portlet instance. The value
+is the id of the instance.
+
+Example:
+
+<instance-ref>MyPortletInstance</instance-ref>
+
+-->
+<!ELEMENT instance-ref (#PCDATA)>
+
+<!--
+Define the content of the window in a generic manner. The content is define by
+the type of the content and an URI which acts as an identificator for the content.
+
+Example:
+
+<content>
+ <content-type>portlet</content-type>
+ <content-uri>MyPortletInstance</content-uri>
+</content>
+
+<content>
+ <content-type>cms</content-type>
+ <content-uri>/default/index.html</content-uri>
+</content>
+
+-->
+<!ELEMENT content (content-type,content-uri)>
+
+<!--
+The content type of the window.
+-->
+<!ELEMENT content-type (#PCDATA)>
+
+<!--
+The content URI of the window.
+-->
+<!ELEMENT content-uri (#PCDATA)>
+
+<!--
+The region the window belongs to.
+-->
+<!ELEMENT region (#PCDATA)>
+
+<!--
+The window state to use when the window is first accessed
+-->
+<!ELEMENT initial-window-state (#PCDATA)>
+
+<!--
+The mode to use when the window is first accessed
+-->
+<!ELEMENT initial-mode (#PCDATA)>
+
+<!--
+The height of the window in the particular region.
+-->
+<!ELEMENT height (#PCDATA)>
+
+<!--
+Define a listener for a portal object. The value is the id of the listener.
+-->
+<!ELEMENT listener (#PCDATA)>
+
+<!--
+A set of generic properties for the portal object.
+-->
+<!ELEMENT properties (property*)>
+
+<!--
+A generic string property.
+-->
+<!ELEMENT property (name,value)>
+
+<!--
+A name value.
+-->
+<!ELEMENT name (#PCDATA)>
+
+<!--
+A value.
+-->
+<!ELEMENT value (#PCDATA)>
+
+<!--
+The security-constraint element is a container for policy-permission elements
+
+Examples:
+
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+-->
+<!ELEMENT security-constraint (policy-permission*)>
+
+<!--
+The policy-permission element is used to secure a specific portal page based on a
+user's role.
+-->
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
+
+<!--
+The role-name element is used to define a role that this security constraint will apply to
+
+ * <role-name>SOMEROLE</role-name> Access to this portal page is limited to the defined role.
+-->
+<!ELEMENT action-name (#PCDATA)>
+
+<!--
+The unchecked element is used to define (if present) that anyone can view this portal page
+-->
+<!ELEMENT unchecked EMPTY>
+
+<!--
+The action-name element is used to define the access rights given to the role defined.
+Possible values are:
+
+ * view - Users can view the page.
+-->
+<!ELEMENT role-name (#PCDATA)>
+
+<!--
+Configuration of explicit event and shared render parameter coordination
+-->
+<!ELEMENT coordination (wirings?, bindings?)>
+
+<!--Implicit mode. Allowed values are:
+- TRUE
+- FALSE
+-->
+<!ELEMENT implicit-mode (#PCDATA)>
+
+<!--
+Event wirings. Can be defined only for a page
+-->
+<!ELEMENT wirings (implicit-mode?, event-wiring*)>
+
+<!--
+Shared render parameter bindings. Can be defined only for a page
+-->
+<!ELEMENT bindings (implicit-mode?, parameter-binding*, alias-binding*)>
+
+<!--
+This element defines explicit event wiring
+-->
+<!ELEMENT event-wiring (name, sources, destinations)>
+
+<!--
+List all windows that produce source events
+-->
+<!ELEMENT sources (window-coordination+)>
+
+<!--
+List all windows that consume destination events
+-->
+<!ELEMENT destinations (window-coordination+)>
+
+<!--
+Shared parameter binding definition
+-->
+<!ELEMENT parameter-binding (id, window-coordination+)>
+
+
+<!--
+Alias binding definition
+-->
+<!ELEMENT alias-binding (id, qname+)>
+
+<!--
+This element defines window for coordination. It can be either source or destination window for event distribution or
+participate in parameter binding
+-->
+<!ELEMENT window-coordination (window-name, qname)>
+
+<!--
+QName identifying event or shared render parameter
+-->
+<!ELEMENT qname (#PCDATA)>
+
+<!--
+Id
+-->
+<!ELEMENT id (#PCDATA)>
+
+
Added: modules/deployer/trunk/deployer/src/main/deployer/tld/portlet.tld
===================================================================
--- modules/deployer/trunk/deployer/src/main/deployer/tld/portlet.tld (rev 0)
+++ modules/deployer/trunk/deployer/src/main/deployer/tld/portlet.tld 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+<taglib>
+
+ <tlib-version>1.0</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>portlet</short-name>
+
+ <uri>http://java.sun.com/portlet</uri>
+
+ <tag>
+
+ <name>param</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.URLParameterTag</tag-class>
+ <body-content>empty</body-content>
+
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>value</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>renderURL</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.RenderURLTag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTagTEI</tei-class>
+ <body-content>JSP</body-content>
+
+ <attribute>
+ <name>portletMode</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>windowState</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>defineObjects</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjectsTag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjectsTagTEI</tei-class>
+ <body-content>empty</body-content>
+
+ </tag>
+ <tag>
+
+ <name>actionURL</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.ActionURLTag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTagTEI</tei-class>
+ <body-content>JSP</body-content>
+
+ <attribute>
+ <name>portletMode</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>windowState</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>namespace</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.NamespaceTag</tag-class>
+ <body-content>empty</body-content>
+
+ </tag>
+
+</taglib>
Added: modules/deployer/trunk/deployer/src/main/deployer/tld/portlet_2_0.tld
===================================================================
--- modules/deployer/trunk/deployer/src/main/deployer/tld/portlet_2_0.tld (rev 0)
+++ modules/deployer/trunk/deployer/src/main/deployer/tld/portlet_2_0.tld 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
+ version="2.0">
+
+ <description>Portlet 2.0 Tag Library</description>
+ <display-name>Portlet 2.0 Tags</display-name>
+ <tlib-version>2.0</tlib-version>
+ <short-name>portlet</short-name>
+ <uri>http://java.sun.com/portlet_2_0</uri>
+
+ <tag>
+
+ <name>param</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr286.taglib.URLParameter286Tag</tag-class>
+ <body-content>empty</body-content>
+
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>value</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>property</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr286.taglib.URLProperty286Tag</tag-class>
+ <body-content>empty</body-content>
+
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>value</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>renderURL</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr286.taglib.RenderURL286Tag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr286.taglib.GenerateURL286TagTEI</tei-class>
+ <body-content>JSP</body-content>
+
+ <attribute>
+ <name>portletMode</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>windowState</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>escapeXml</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>copyCurrentRenderParameters</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>defineObjects</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr286.taglib.DefineObjects286Tag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr286.taglib.DefineObjects286TagTEI</tei-class>
+ <body-content>empty</body-content>
+
+ </tag>
+ <tag>
+
+ <name>actionURL</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr286.taglib.ActionURL286Tag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr286.taglib.GenerateURL286TagTEI</tei-class>
+ <body-content>JSP</body-content>
+
+ <attribute>
+ <name>portletMode</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>windowState</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>escapeXml</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>copyCurrentRenderParameters</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>name</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+
+ </tag>
+ <tag>
+
+ <name>resourceURL</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr286.taglib.ResourceURL286Tag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr286.taglib.ResourceURL286TagTEI</tei-class>
+ <body-content>JSP</body-content>
+
+ <attribute>
+ <name>secure</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>escapeXml</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>cacheability</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>id</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>namespace</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr286.taglib.Namespace286Tag</tag-class>
+ <body-content>empty</body-content>
+
+ </tag>
+
+</taglib>
Deleted: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/Deployment.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/Deployment.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/Deployment.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -1,139 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.deployer;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.logging.Logger;
-import org.jboss.mx.loading.RepositoryClassLoader;
-
-import javax.management.MBeanServer;
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 8784 $
- */
-public class Deployment
-{
-
- /** The logger. */
- protected final Logger log = Logger.getLogger(getClass());
-
- /** The deployment URL. */
- protected final URL url;
-
- /** The optional web app abstraction. */
- // protected final PortalWebApp pwa;
-
- /** The JMX server. */
- protected final MBeanServer mbeanServer;
-
- /**
- * Create a deployment that is not nested within a web application archive.
- *
- * @param url the deployment URL
- * @param mbeanServer the JMX mbean server
- */
- public Deployment(URL url, MBeanServer mbeanServer)
- {
- this.url = url;
-// this.pwa = null;
- this.mbeanServer = mbeanServer;
- }
-
- /**
- * Create a deployment nested within a web application archive
- *
- * @param url the deployment URL
- * @param pwa the web application
- * @param mbeanServer the JMX mbean server
- */
-// public Deployment(URL url, PortalWebApp pwa, MBeanServer mbeanServer)
-// {
-// this.url = url;
-// this.pwa = pwa;
-// this.mbeanServer = mbeanServer;
-// }
-
- public void create() throws DeploymentException
- {
- }
-
- public void start() throws DeploymentException
- {
- }
-
- public void stop() throws DeploymentException
- {
- }
-
- public void destroy() throws DeploymentException
- {
- }
-
- /** Find the URL of the WEB-INF directory in the war file. */
- public static URL findWEBINFURL(URL warURL) throws DeploymentException
- {
- try
- {
- if ("file".equals(warURL.getProtocol()))
- {
- File f = new File(warURL.getFile());
- f = new File(f, "WEB-INF");
- // this dir doesn't exist on exploded deployments and would miss the trailing slash then [JBPORTAL-1648]
- if (f.exists())
- {
- return f.toURL();
- }
- else
- {
- return new URL(warURL + "WEB-INF/");
- }
- }
- else
- {
- throw new DeploymentException("Deployment URL not found " + warURL);
- }
- }
- catch (MalformedURLException e)
- {
- throw new DeploymentException(e);
- }
- }
-
- /** Find the repository classloader reltated to the argument classloader. */
- public static RepositoryClassLoader findRepositoryClassLoader(ClassLoader loader) throws DeploymentException
- {
- while (loader != null)
- {
- if (loader instanceof RepositoryClassLoader)
- {
- return (RepositoryClassLoader)loader;
- }
- loader = loader.getParent();
- }
- throw new DeploymentException("No repository class loader found");
- }
-}
Modified: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalEntityResolver.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalEntityResolver.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalEntityResolver.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -48,7 +48,7 @@
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
{
-
+
// Let the parser open a regular URI connection to systemId
if (publicId == null)
{
@@ -56,7 +56,7 @@
}
//
- String dtdResourceName = (String)dtdMapping.get(publicId);
+ String dtdResourceName = (String) dtdMapping.get(publicId);
if (dtdResourceName != null)
{
Added: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalResolverFactory.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalResolverFactory.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalResolverFactory.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,90 @@
+/******************************************************************************
+ * 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.deployer;
+
+import java.util.Enumeration;
+import java.util.Properties;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaResolverFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class PortalResolverFactory implements SchemaResolverFactory
+{
+
+ private static final Logger log = Logger.getLogger(PortalResolverFactory.class);
+
+ protected static SchemaResolverFactory factory = new PortalResolverFactory();
+
+ private final DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+
+ public static SchemaResolverFactory getInstance()
+ {
+ return factory;
+ }
+
+ public SchemaBindingResolver getSchemaBindingResolver()
+ {
+ return (SchemaBindingResolver) resolver;
+ }
+
+ private PortalResolverFactory()
+ {
+ }
+
+ /**
+ * Get the DTD mappings and set the resolver to use them.
+ * @param mapping The mapping to use
+ */
+ public void setDTDMapping(Properties mapping)
+ {
+ ClassLoader classloader = Thread.currentThread().getContextClassLoader();
+ if (mapping != null && mapping.size() > 0)
+ {
+ Enumeration enumer = mapping.keys();
+ while (enumer.hasMoreElements())
+ {
+ String location = (String) enumer.nextElement();
+ String classname = (String) mapping.get(location);
+ try
+ {
+ Class clazz = classloader.loadClass(classname);
+ System.out.println("LOCATION : " + location + " : CLASS " + classname);
+ resolver.addClassBindingForLocation(location, clazz);
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.warn("Could not find class " + classname);
+ }
+ }
+ }
+ }
+
+}
Added: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalUnmarshallerFactory.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalUnmarshallerFactory.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/PortalUnmarshallerFactory.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * 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.deployer;
+
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.xml.sax.EntityResolver;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class PortalUnmarshallerFactory
+{
+
+ protected static PortalUnmarshallerFactory factory = new PortalUnmarshallerFactory();
+
+ protected Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+
+ protected EntityResolver entityResolver;
+
+ protected boolean schemaValidation;
+
+ protected boolean validation;
+
+ public static PortalUnmarshallerFactory getInstance()
+ {
+ return factory;
+ }
+
+ private PortalUnmarshallerFactory()
+ {
+ //set the default validation values.
+ this.schemaValidation = false;
+ this.validation = false;
+ }
+
+ public Unmarshaller getUnmarshaller()
+ {
+ // add the entityresolver if it exists
+ if (entityResolver != null)
+ {
+ try
+ {
+ unmarshaller.setEntityResolver(entityResolver);
+ }
+ catch (JBossXBException exception)
+ {
+ exception.printStackTrace();
+ }
+ }
+
+ // try and set the validations for the unmarshaller
+ try
+ {
+ unmarshaller.setSchemaValidation(schemaValidation);
+ unmarshaller.setValidation(validation);
+ }
+ catch (JBossXBException exception)
+ {
+ exception.printStackTrace();
+ }
+ return unmarshaller;
+ }
+
+ public void setEntityResolver(EntityResolver entityResolver)
+ {
+ this.entityResolver = entityResolver;
+ }
+
+ public void setSchemaValidation(boolean validate)
+ {
+ this.schemaValidation = validate;
+ }
+
+ public void setValidation(boolean validate)
+ {
+ this.validation = validate;
+ }
+
+}
Copied: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/JBossPortletParsingDeployer.java (from rev 12345, modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/jboss/portlet/parsing/JBossPortletParsingDeployer.java)
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/JBossPortletParsingDeployer.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/JBossPortletParsingDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * 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.deployer.parsing;
+
+import java.io.InputStream;
+
+import org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.portal.deployer.PortalEntityResolver;
+import org.jboss.portal.portlet.deployment.jboss.JBossApplicationMetaDataFactory;
+import org.jboss.portal.portlet.deployment.jboss.metadata.JBossApplicationMetaData;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+public class JBossPortletParsingDeployer extends SchemaResolverDeployer<JBossApplicationMetaData>
+{
+
+ private PortalEntityResolver entityResolver;
+
+ public void setEntityResolver(PortalEntityResolver entityResolver)
+ {
+ this.entityResolver = entityResolver;
+ }
+
+ public JBossPortletParsingDeployer()
+ {
+ super(JBossApplicationMetaData.class);
+ setName("jboss-portlet.xml");
+ }
+
+ public void setXmlPath(String xmlPath)
+ {
+ this.setName(xmlPath);
+ }
+
+ public String getXmlPath()
+ {
+ return getName();
+ }
+
+ protected JBossApplicationMetaData parse(VFSDeploymentUnit unit, VirtualFile file, JBossApplicationMetaData root)
+ throws Exception
+ {
+ InputStream stream = file.openStream();
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setEntityResolver(this.entityResolver);
+
+ JBossApplicationMetaData jbossPortletMetaData = (JBossApplicationMetaData) unmarshaller.unmarshal(stream,
+ new JBossApplicationMetaDataFactory(), root);
+
+ System.out.println("JBOSSPORTLETS : " + jbossPortletMetaData.getPortlets());
+
+ return jbossPortletMetaData;
+ }
+
+}
Copied: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalAppParsingDeployer.java (from rev 12345, modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/parsing/PortalAppParsingDeployer.java)
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalAppParsingDeployer.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalAppParsingDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.deployer.parsing;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.portal.metadata.jboss.app.PortalAppMetaData;
+import org.jboss.virtual.VirtualFile;
+
+public class PortalAppParsingDeployer extends PortalResolverDeployer<PortalAppMetaData>
+{
+
+ public PortalAppParsingDeployer()
+ {
+ super(PortalAppMetaData.class);
+ setName("jboss-portal-app.xml");
+ }
+
+ public void setXmlPath(String xmlPath)
+ {
+ this.setName(xmlPath);
+ }
+
+ public String getXmlPath()
+ {
+ return getName();
+ }
+
+ protected PortalAppMetaData parse(VFSDeploymentUnit unit, VirtualFile file, PortalAppMetaData root) throws Exception
+ {
+ return (PortalAppMetaData) super.parse(unit, file, root);
+ }
+
+}
Added: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalObjectParsingDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalObjectParsingDeployer.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalObjectParsingDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -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.deployer.parsing;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.portal.metadata.portal.object.PortalObjectMetaData;
+import org.jboss.portal.metadata.portlet.PortletDeploymentInstancesMetaData;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class PortalObjectParsingDeployer extends PortalResolverDeployer<PortalObjectMetaData>
+{
+ public PortalObjectParsingDeployer()
+ {
+ super(PortalObjectMetaData.class);
+ this.setSuffix("object.xml");
+ }
+
+ protected PortalObjectMetaData parse(VFSDeploymentUnit unit, VirtualFile file, PortalObjectMetaData root)
+ throws Exception
+ {
+ return (PortalObjectMetaData) super.parse(unit, file, root);
+ }
+
+}
Added: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalResolverDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalResolverDeployer.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortalResolverDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.deployer.parsing;
+
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.portal.deployer.PortalEntityResolver;
+import org.jboss.portal.deployer.PortalResolverFactory;
+import org.jboss.portal.deployer.PortalUnmarshallerFactory;
+import org.jboss.portal.metadata.jboss.app.PortalAppMetaData;
+import org.jboss.virtual.VirtualFile;
+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.SchemaBindingResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class PortalResolverDeployer<metadata> extends SchemaResolverDeployer<metadata>
+{
+
+ protected SchemaBindingResolver resolver = PortalResolverFactory.getInstance().getSchemaBindingResolver();
+
+ protected Unmarshaller unmarshaller = PortalUnmarshallerFactory.getInstance().getUnmarshaller();
+
+ public PortalResolverDeployer(Class<metadata> output)
+ {
+ super(output);
+ }
+
+ protected metadata parse(VFSDeploymentUnit unit, VirtualFile file, metadata root) throws Exception
+ {
+ InputStream stream = file.openStream();
+ InputSource source = new InputSource(stream);
+
+ return (metadata) unmarshaller.unmarshal(source, resolver);
+ }
+
+}
Added: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortletInstancesParsingDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortletInstancesParsingDeployer.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortletInstancesParsingDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -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.deployer.parsing;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.portal.metadata.portlet.PortletDeploymentInstancesMetaData;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class PortletInstancesParsingDeployer extends PortalResolverDeployer<PortletDeploymentInstancesMetaData>
+{
+
+ public PortletInstancesParsingDeployer()
+ {
+ super(PortletDeploymentInstancesMetaData.class);
+ this.setName("portlet-instances.xml");
+ }
+
+ protected PortletDeploymentInstancesMetaData parse(VFSDeploymentUnit unit, VirtualFile file,
+ PortletDeploymentInstancesMetaData root) throws Exception
+ {
+ return (PortletDeploymentInstancesMetaData) super.parse(unit, file, root);
+ }
+
+}
Copied: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortletParsingDeployer.java (from rev 12345, modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/parsing/PortletParsingDeployer.java)
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortletParsingDeployer.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/parsing/PortletParsingDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * 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.deployer.parsing;
+
+import java.io.InputStream;
+
+import org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.portal.deployer.PortalEntityResolver;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.mc.metadata.factory.PortletApplicationModelFactory; // note: these are the metadata from the metadata model
+//import org.jboss.portal.metadata.portlet.PortletApplication10MetaData;
+//import org.jboss.portal.metadata.portlet.portlet.PortletMetaData;
+//import org.jboss.portal.metamodel.portlet.PortletApplicationModelFactory;
+//import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+//import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+public class PortletParsingDeployer extends SchemaResolverDeployer<PortletApplication10MetaData>
+{
+
+ private PortalEntityResolver entityResolver;
+
+ public void setEntityResolver(PortalEntityResolver entityResolver)
+ {
+ this.entityResolver = entityResolver;
+ }
+
+ public PortletParsingDeployer()
+ {
+ super(PortletApplication10MetaData.class);
+ setName("portlet.xml");
+ }
+
+ public void setXmlPath(String xmlPath)
+ {
+ this.setName(xmlPath);
+ }
+
+ public String getXmlPath()
+ {
+ return getName();
+ }
+
+ protected PortletApplication10MetaData parse(VFSDeploymentUnit unit, VirtualFile file,
+ PortletApplication10MetaData root) throws Exception
+ {
+
+ //super.parse(unit, file, root);
+ InputStream stream = file.openStream();
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setEntityResolver(this.entityResolver);
+
+ PortletApplication10MetaData portletMetaData = (PortletApplication10MetaData) unmarshaller.unmarshal(stream,
+ new PortletApplicationModelFactory(), root);
+
+ System.out.println("PORTLETS : " + portletMetaData.getPortlets());
+
+ return portletMetaData;
+ }
+
+}
Modified: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/LibDirectoryStructure.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/LibDirectoryStructure.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/LibDirectoryStructure.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -1,3 +1,25 @@
+/******************************************************************************
+ * 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.deployer.portal;
import java.util.List;
@@ -6,58 +28,60 @@
import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
import org.jboss.deployers.vfs.spi.structure.StructureContext;
import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.portal.core.model.instance.metadata.InstanceMetaData;
import org.jboss.virtual.VirtualFile;
+/**
+ * may no longer be needed with jboss as5 ga, research this further
+ *
+ */
public class LibDirectoryStructure extends AbstractVFSStructureDeployer
{
-
- public LibDirectoryStructure()
- {
- setRelativeOrder(Integer.MAX_VALUE);
- }
- /**
- * Add jars from with a lib subdirectory.
- *
- * @param context The StrucutureContext to use
- * @return Always returns false
- */
- public boolean determineStructure(StructureContext context)
- throws DeploymentException
- {
- try
- {
- VirtualFile file = context.getFile();
- if (context.isTopLevel() == false && isLeaf(file) == false
- && context.getName().equals("lib"))
- {
- try
- {
- List<VirtualFile> children = context.getFile().getChildren();
- if (children != null && children.isEmpty() == false)
- {
- for (int i = 0; i < children.size(); i++)
- {
- VFSStructuralDeployers structuralDeployers = context.getDeployers();
-
- structuralDeployers.determineStructure(children.get(i), context.getParentContext());
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- }
- }
- catch (Exception e)
- {
- throw DeploymentException.rethrowAsDeploymentException(
- "Error determining Structure", e);
- }
- // always return false
- return false;
- }
-
+ public LibDirectoryStructure()
+ {
+ setRelativeOrder(Integer.MAX_VALUE);
+ }
+
+ /**
+ * Add jars from with a lib subdirectory.
+ *
+ * @param context The StrucutureContext to use
+ * @return Always returns false
+ */
+ public boolean determineStructure(StructureContext context) throws DeploymentException
+ {
+ try
+ {
+ VirtualFile file = context.getFile();
+ if (context.isTopLevel() == false && isLeaf(file) == false && context.getName().equals("lib"))
+ {
+ try
+ {
+ List<VirtualFile> children = context.getFile().getChildren();
+ if (children != null && children.isEmpty() == false)
+ {
+ for (int i = 0; i < children.size(); i++)
+ {
+ VFSStructuralDeployers structuralDeployers = context.getDeployers();
+
+ structuralDeployers.determineStructure(children.get(i), context.getParentContext());
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+ }
+ catch (Exception e)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Error determining Structure", e);
+ }
+ // always return false
+ return false;
+ }
+
}
Deleted: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/PortalDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/PortalDeployer.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/PortalDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -1,61 +0,0 @@
-//package org.jboss.portal.deployer.portal;
-//
-//import java.util.ArrayList;
-//import java.util.Iterator;
-//
-//import org.jboss.deployers.spi.DeploymentException;
-//import org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer;
-//import org.jboss.deployers.structure.spi.DeploymentUnit;
-//import org.jboss.portal.metadata.portlet.PortalAppMetaData;
-//import org.jboss.web.WebApplication;
-//import org.jboss.web.deployers.AbstractWarDeployer;
-//
-//public class PortalDeployer extends AbstractComponentDeployer
-//{
-//
-// //the relative order of the war deployer in the main deployer.
-// private int warDeployerOrder;
-//
-// private AbstractWarDeployer warDeployer;
-//
-//
-// private ArrayList listeners = new ArrayList();
-//
-// public PortalDeployer()
-// {
-// addInput(PortalAppMetaData.class);
-// System.out.println("CREATE PORTALDEPLOYER");
-// }
-//
-// public void setWarDeployer(AbstractWarDeployer warDeployer)
-// {
-// this.warDeployer = warDeployer;
-// }
-//
-// public void setWarDeployerOrder(int order)
-// {
-// System.out.println("WARDEPLOYERORDER : " + order);
-// this.warDeployerOrder = order;
-// }
-//
-// public int getRelativeOrder()
-// {
-// return warDeployerOrder + 1;
-// }
-//
-// @Override
-// public void internalDeploy(DeploymentUnit unit) throws DeploymentException
-// {
-// System.out.println("PORTALDEPLOYER : " + unit);
-// PortalAppMetaData metaData = unit.getAttachment(PortalAppMetaData.class);
-// if (metaData != null)
-// {
-// System.out.println("INTERNALDEPLOYAPPNAME : " + metaData.getAppName());
-// }
-// }
-//
-// @Override
-// public void internalUndeploy(DeploymentUnit unit)
-// {
-// }
-//}
Modified: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/PortalPostWebDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/PortalPostWebDeployer.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/PortalPostWebDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -1,3 +1,25 @@
+/******************************************************************************
+ * 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.deployer.portal;
import java.util.ArrayList;
@@ -17,75 +39,77 @@
*/
public class PortalPostWebDeployer extends AbstractComponentDeployer
{
-
- //the relative order of the war deployer in the main deployer.
- private int warDeployerOrder;
- private AbstractWarDeployer warDeployer;
-
-
- private ArrayList listeners = new ArrayList();
-
- public PortalPostWebDeployer()
- {
- //addInput(PortalMetaData.class);
- }
-
- public void setWarDeployer(AbstractWarDeployer warDeployer)
- {
- this.warDeployer = warDeployer;
- }
-
- public void setWarDeployerOrder(int order)
- {
- this.warDeployerOrder = order;
- }
-
- public int getRelativeOrder()
- {
- //return the order just after the war deployer
- //note: should really be +1 but other portal deployer is getting in the way right now
- return warDeployerOrder + 2;
- }
-
- @Override
- public void internalDeploy(DeploymentUnit unit) throws DeploymentException
- {
- WebApplication webapp = warDeployer.getDeployedApp(unit.getName());
-
- if (webapp != null)
- {
- Iterator<WebDeploymentListener> iter = listeners.listIterator();
- while (iter.hasNext())
- {
- iter.next().portalDeployed(webapp);
- }
- }
- }
+ //the relative order of the war deployer in the main deployer.
+ private int warDeployerOrder;
- @Override
- public void internalUndeploy(DeploymentUnit unit)
- {
- WebApplication webapp = warDeployer.getDeployedApp(unit.getName());
+ private AbstractWarDeployer warDeployer;
- if (webapp != null)
- {
- Iterator<WebDeploymentListener> iter = listeners.listIterator();
- while (iter.hasNext())
- {
- iter.next().portalUndeployed(webapp);
- }
- }
- }
-
- public void addDeploymentListener (WebDeploymentListener deploymentListener)
- {
- listeners.add(deploymentListener);
- }
-
- public void removeDeploymentListener (WebDeploymentListener deploymentListener)
- {
- listeners.remove(deploymentListener);
- }
-
+ private ArrayList listeners = new ArrayList();
+
+ public PortalPostWebDeployer()
+ {
+ //addInput(PortalMetaData.class);
+ }
+
+ public void setWarDeployer(AbstractWarDeployer warDeployer)
+ {
+ this.warDeployer = warDeployer;
+ }
+
+ public void setWarDeployerOrder(int order)
+ {
+ this.warDeployerOrder = order;
+ }
+
+ public int getRelativeOrder()
+ {
+ //return the order just after the war deployer
+ //note: should really be +1 but other portal deployer is getting in the way right now
+ return warDeployerOrder + 2;
+ }
+
+ @Override
+ public void internalDeploy(DeploymentUnit unit) throws DeploymentException
+ {
+ WebApplication webapp = warDeployer.getDeployedApp(unit.getName());
+
+ if (webapp != null)
+ {
+ Iterator<WebDeploymentListener> iter = listeners.listIterator();
+ while (iter.hasNext())
+ {
+ iter.next().portalDeployed(webapp);
+ }
+ }
+ }
+
+ @Override
+ public void internalUndeploy(DeploymentUnit unit)
+ {
+ if (warDeployer != null)
+ {
+ WebApplication webapp = warDeployer.getDeployedApp(unit.getName());
+
+ if (webapp != null)
+ {
+ Iterator<WebDeploymentListener> iter = listeners.listIterator();
+ while (iter.hasNext())
+ {
+ iter.next().portalUndeployed(webapp);
+ }
+ }
+ }
+ }
+
+ public void addDeploymentListener(WebDeploymentListener deploymentListener)
+ {
+ listeners.add(deploymentListener);
+ }
+
+ public void removeDeploymentListener(WebDeploymentListener deploymentListener)
+ {
+ listeners.remove(deploymentListener);
+ }
+
}
\ No newline at end of file
Modified: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/WebDeploymentListener.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/WebDeploymentListener.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portal/WebDeploymentListener.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -1,3 +1,25 @@
+/******************************************************************************
+ * 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.deployer.portal;
import org.jboss.web.WebApplication;
@@ -10,6 +32,7 @@
*/
public interface WebDeploymentListener
{
- public void portalDeployed(WebApplication webapp);
- public void portalUndeployed(WebApplication webapp);
+ public void portalDeployed(WebApplication webapp);
+
+ public void portalUndeployed(WebApplication webapp);
}
Added: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/CommandServletDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/CommandServletDeployer.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/CommandServletDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,90 @@
+/******************************************************************************
+ * 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.deployer.portlet;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossServletsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.FiltersMetaData;
+import org.jboss.metadata.web.spec.ServletMappingMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.web.command.CommandServlet;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class CommandServletDeployer extends AbstractSimpleVFSRealDeployer<PortletApplication10MetaData>
+{
+
+ public CommandServletDeployer()
+ {
+ super(PortletApplication10MetaData.class);
+ setStage(DeploymentStages.POST_PARSE);
+ }
+
+ @Override
+ public void deploy(VFSDeploymentUnit unit, PortletApplication10MetaData deployment) throws DeploymentException
+ {
+
+ JBossWebMetaData jbossWebMetaData = (JBossWebMetaData) unit.getAttachment(JBossWebMetaData.class);
+
+ JBossServletMetaData commandServlet = new JBossServletMetaData();
+ commandServlet.setServletName("CommandServlet");
+ commandServlet.setServletClass(CommandServlet.class.getName());
+ commandServlet.setLoadOnStartup(0);
+
+ JBossServletsMetaData servlets = jbossWebMetaData.getServlets();
+ if (servlets == null)
+ {
+ servlets = new JBossServletsMetaData();
+ jbossWebMetaData.setServlets(servlets);
+ }
+ servlets.add(commandServlet);
+
+ ServletMappingMetaData commandServletMapping = new ServletMappingMetaData();
+ commandServletMapping.setServletName("CommandServlet");
+ List<String> mappingUrls = new ArrayList<String>();
+ mappingUrls.add("/jbossportlet");
+ commandServletMapping.setUrlPatterns(mappingUrls);
+
+ List<ServletMappingMetaData> servletMappings = jbossWebMetaData.getServletMappings();
+ if (servletMappings == null)
+ {
+ servletMappings = new ArrayList<ServletMappingMetaData>();
+ jbossWebMetaData.setServletMappings(servletMappings);
+ }
+ servletMappings.add(commandServletMapping);
+
+ }
+
+}
Added: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDependencyDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDependencyDeployer.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDependencyDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * 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.deployer.portlet;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.dependency.plugins.AbstractDependencyItem;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.spi.deployer.helpers.DeploymentVisitor;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+
+/**
+ * This deployer adds a dependency item to the DeploymentUnit which
+ * will make sure the dependencies are met before continuing with the
+ * deployment.
+ *
+ * Note: we want to deploy portlets to the running portlet container and hence
+ * why we need for the container to be running. We cannot request that the
+ * deployment itself setup the dependencies.
+ *
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class PortletDependencyDeployer extends AbstractDeployer
+{
+
+ protected ArrayList<String> dependencies;
+
+ public PortletDependencyDeployer()
+ {
+ setAllInputs(false);
+ setInput(PortletApplication10MetaData.class);
+
+ //stage needs to be post parse since we need to parse the xml files to
+ //determine that the deployable contains a portlet and that we need this deployer
+ //to stop it from being deployed any further until its dependencies are met.
+ setStage(DeploymentStages.POST_PARSE);
+ }
+
+ public void setDependencies(ArrayList<String> dependencies)
+ {
+ this.dependencies = dependencies;
+ }
+
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+
+ if (dependencies != null)
+ {
+ for (int i = 0; i < dependencies.size(); i++)
+ {
+ String dependency = dependencies.get(i);
+
+ // the controller state must be set to Real to make sure that the deployable is not initalized before the dependencies.
+ // TODO: use ControllerState.REAL if it gets added as an option to the ControllerState class.
+ DependencyItem dependItem = new AbstractDependencyItem(context.getName(), dependency, new ControllerState(
+ "Real"), ControllerState.CREATE);
+
+ unit.addIDependOn(dependItem);
+ }
+ }
+ }
+
+}
Modified: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDeployer.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -1,3 +1,25 @@
+/******************************************************************************
+ * 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.deployer.portlet;
import java.util.ArrayList;
@@ -11,10 +33,7 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.portal.metadata.jboss.app.PortalAppMetaData;
-import org.jboss.portal.metadata.jboss.portlet.JBossApplicationMetaData;
-//import org.jboss.portal.metadata.jboss.portlet.JBossApplicationMetaData;
-//import org.jboss.portal.metadata.portlet.PortletApplication10MetaData;
-//import org.jboss.portal.metadata.portlet.portlet.PortletMetaData;
+import org.jboss.portal.portlet.deployment.jboss.metadata.JBossApplicationMetaData;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import org.jboss.system.metadata.ServiceConstructorMetaData;
import org.jboss.system.metadata.ServiceMetaData;
@@ -23,109 +42,95 @@
public class PortletDeployer extends AbstractComponentDeployer
{
-
- //the relative order of the war deployer in the main deployer.
- private int warDeployerOrder;
- private AbstractWarDeployer warDeployer;
-
-
- private ArrayList listeners = new ArrayList();
-
- public PortletDeployer()
- {
- setAllInputs(false);
- setInput(PortalAppMetaData.class);
- addInput(PortalAppMetaData.class);
- addInput(PortletApplication10MetaData.class);
- addInput(JBossApplicationMetaData.class);
- setOutput(ServiceMetaData.class);
- }
-
- public void setWarDeployerOrder(int order)
- {
- this.warDeployerOrder = order;
- }
-
- public int getRelativeOrder()
- {
- return warDeployerOrder + 1;
- }
-
- @Override
- public void internalDeploy(DeploymentUnit unit) throws DeploymentException
- {
- //super.internalDeploy(unit);
- MainDeployer md = unit.getMainDeployer();
-
- PortalAppMetaData metaData = unit.getAttachment(PortalAppMetaData.class);
- if (metaData != null)
- {
- System.out.println("INTERNALDEPLOYAPPNAME : " + metaData.getAppName());
- }
- else
- {
- System.out.println("NO PORTAL-APP.XML FILE");
- }
-
- PortletApplication10MetaData portletMetaData = unit.getAttachment(PortletApplication10MetaData.class);
- if (portletMetaData != null)
- {
- System.out.println("INTERNALDEPLOYPORTLETS : " + portletMetaData.getPortlets());
- }
- else
- {
- System.out.println("NO PORTLET.XML FILE");
- }
-
- JBossApplicationMetaData jbossPortletMetaData = unit.getAttachment(JBossApplicationMetaData.class);
- if (portletMetaData != null)
- {
- System.out.println("INTERNALDEPLOYJBOSSPORTLETS : " + jbossPortletMetaData.getPortlets());
- }
- else
- {
- System.out.println("NO JBOSS-PORTLET.XML FILE");
- }
-
-
- if (portletMetaData != null)
- {
- try
- {
- ServiceMetaData portletModule = new ServiceMetaData();
-
- JBossWebMetaData jbosswebMD = unit.getAttachment(JBossWebMetaData.class);
-
- //todo: fix situation for empty context root (ie for the ROOT war)
- String name = "jboss.portal.deployment:war="
- + jbosswebMD.getContextRoot();
- ObjectName objectName = new ObjectName(name);
+ //the relative order of the war deployer in the main deployer.
+ private int warDeployerOrder;
- portletModule.setObjectName(objectName);
+ private AbstractWarDeployer warDeployer;
- portletModule.setCode(PortletModule.class.getName());
- ServiceConstructorMetaData scMD = new ServiceConstructorMetaData();
- //scMD.setSignature(new String[] {String.class.getName()});
- //scMD.setParameters(new Object[] {"Hello"});
-
- scMD.setSignature(new String[] {});
- scMD.setParameters(new Object[] {});
- portletModule.setConstructor(scMD);
+ private ArrayList listeners = new ArrayList();
- unit.addAttachment("PortletModule", portletModule,
- ServiceMetaData.class);
+ public PortletDeployer()
+ {
+ setAllInputs(false);
+ setInput(PortalAppMetaData.class);
+ addInput(PortalAppMetaData.class);
+ addInput(PortletApplication10MetaData.class);
+ addInput(JBossApplicationMetaData.class);
+ setOutput(ServiceMetaData.class);
+ }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
+ public void setWarDeployerOrder(int order)
+ {
+ this.warDeployerOrder = order;
+ }
- @Override
- public void internalUndeploy(DeploymentUnit unit)
- {
- }
+ public int getRelativeOrder()
+ {
+ return warDeployerOrder + 1;
+ }
+
+ @Override
+ public void internalDeploy(DeploymentUnit unit) throws DeploymentException
+ {
+ //super.internalDeploy(unit);
+ MainDeployer md = unit.getMainDeployer();
+
+ PortalAppMetaData metaData = unit.getAttachment(PortalAppMetaData.class);
+ if (metaData != null)
+ {
+ System.out.println("INTERNALDEPLOYAPPNAME : " + metaData.getAppName());
+ }
+ else
+ {
+ System.out.println("NO PORTAL-APP.XML FILE");
+ }
+
+ PortletApplication10MetaData portletMetaData = unit.getAttachment(PortletApplication10MetaData.class);
+ if (portletMetaData != null)
+ {
+ System.out.println("INTERNALDEPLOYPORTLETS : " + portletMetaData.getPortlets());
+ }
+ else
+ {
+ System.out.println("NO PORTLET.XML FILE");
+ }
+
+ JBossApplicationMetaData jbossPortletMetaData = unit.getAttachment(JBossApplicationMetaData.class);
+ if (portletMetaData != null)
+ {
+ System.out.println("INTERNALDEPLOYJBOSSPORTLETS : " + jbossPortletMetaData.getPortlets());
+ }
+ else
+ {
+ System.out.println("NO JBOSS-PORTLET.XML FILE");
+ }
+
+ if (portletMetaData != null)
+ {
+ try
+ {
+ ServiceMetaData portletModule = new ServiceMetaData();
+
+ JBossWebMetaData jbosswebMD = unit.getAttachment(JBossWebMetaData.class);
+
+ //todo: fix situation for empty context root (ie for the ROOT war)
+ String name = "jboss.portal.deployment:war=" + jbosswebMD.getContextRoot();
+ ObjectName objectName = new ObjectName(name);
+
+ portletModule.setObjectName(objectName);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ public void internalUndeploy(DeploymentUnit unit)
+ {
+ System.out.println("INTERNALUNDEPLOY");
+ }
}
Deleted: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletModule.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletModule.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletModule.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -1,56 +0,0 @@
-package org.jboss.portal.deployer.portlet;
-
-import org.jboss.portal.metadata.jboss.app.PortalAppMetaData;
-import org.jboss.portal.metadata.jboss.portlet.JBossApplicationMetaData;
-import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
-
-public class PortletModule implements PortletModuleMBean
-{
-
- protected PortalAppMetaData portalAppMetaData;
- protected PortletApplication10MetaData portletAppMetaData;
- protected JBossApplicationMetaData jbossAppMetaData;
-
- public PortletModule(PortalAppMetaData portalAppMetaData, PortletApplication10MetaData portletAppMetaData, JBossApplicationMetaData jbossAppMetaData)
- {
- this.portalAppMetaData = portalAppMetaData;
- this.portletAppMetaData = portletAppMetaData;
- this.jbossAppMetaData = jbossAppMetaData;
- }
-
- public void create() throws Exception
- {
- /*
- * import tld (should probably be done in some sort of deployer, but I don't know exactly how. VFSDeployer + VFS file.getRoot.getChildren().add(vfsfile);
- *
- * merge and manipulate metadata stuff (should be done in a merged metadata deployer and this class should use that data)
- * create default metadata values if needed (also should be done in the merged metadata deployer class).
- *
- */
- }
-
- public void destroy() throws Exception
- {
- /*
- *
- */
-
- }
-
- public void start() throws Exception
- {
- /*
- * inject services
- * - add attibutes to the servlet context of the portalwebapp
- * - should be done in a separate deployer? can a deployer manipulate the servlet context?
- *
- *
- */
-
- }
-
- public void stop() throws Exception
- {
-
- }
-}
\ No newline at end of file
Deleted: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletModuleMBean.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletModuleMBean.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletModuleMBean.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -1,9 +0,0 @@
-package org.jboss.portal.deployer.portlet;
-
-public interface PortletModuleMBean
-{
- public void create() throws Exception;
- public void start() throws Exception;
- public void stop() throws Exception;
- public void destroy() throws Exception;
-}
Added: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletTLDDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletTLDDeployer.java (rev 0)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletTLDDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -0,0 +1,163 @@
+/******************************************************************************
+ * 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.deployer.portlet;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.dependency.plugins.AbstractDependencyItem;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.spi.deployer.helpers.DeploymentVisitor;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.web.WebApplication;
+import org.jboss.web.deployers.AbstractWarDeployer;
+
+/**
+ * Deployer to add the tld file to the portlet.
+ * There doesn't seem to be any way to easily add a file to a deployment so
+ * we are going to have to use the WarDeployer to give us access to where
+ * the portlet is deployed so that we can manually copy over the tld file.
+ * This deployer needs to be called right after the WarDeployer has installed
+ * the deployment.
+ *
+ * Note: more research should be done to determine if there is a better way
+ * of handling this deployment.
+ *
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class PortletTLDDeployer extends AbstractDeployer
+{
+
+ protected String tldDirectory;
+
+ protected AbstractWarDeployer warDeployer;
+
+ protected MBeanServer server;
+
+ public PortletTLDDeployer()
+ {
+ setAllInputs(false);
+ setInput(PortletApplication10MetaData.class);
+ setStage(DeploymentStages.INSTALLED);
+ }
+
+ public void setTLDDirectory(String path)
+ {
+ this.tldDirectory = path;
+ }
+
+ @Override
+ public int getRelativeOrder()
+ {
+ return warDeployer.getRelativeOrder() + 1;
+ }
+
+ public void setWarDeployer(AbstractWarDeployer warDeployer)
+ {
+ this.warDeployer = warDeployer;
+ }
+
+ public void setMBeanServer(MBeanServer server)
+ {
+ this.server = server;
+ }
+
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ //the name of the unit is the same as the war url used
+ String name = unit.getName();
+ WebApplication webApp = warDeployer.getDeployedApp(name);
+
+ //the AppData object is the name of the deployment MBean
+ ObjectName objectName = (ObjectName) webApp.getAppData();
+
+ try
+ {
+ // docBase will return where the webapp is deployed. This will either be in the
+ // deploy for an exploded war or the tmp/deploy for a non exploded war
+ String docBase = (String) server.getAttribute(objectName, "docBase");
+
+ PortletApplication10MetaData metaData = unit.getAttachment(PortletApplication10MetaData.class);
+ if (metaData instanceof PortletApplication20MetaData)
+ {
+ copyTld(tldDirectory + "/portlet_2_0.tld", docBase);
+ }
+ else
+ {
+ copyTld(tldDirectory + "/portlet.tld", docBase);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ protected void copyTld(String tldFileLocation, String webappDirectoryLocation) throws IOException
+ {
+ //the tld file will be copied to the web-inf directory of the webapp.
+ File webappWebInfFile = new File(webappDirectoryLocation + "/WEB-INF");
+
+ if (webappWebInfFile.exists())
+ {
+ if (webappWebInfFile.isFile())
+ {
+ throw new IOException("The WEB-INF directory of the webapp [" + webappDirectoryLocation
+ + "] is a file instead of a directory");
+ }
+ else if (webappWebInfFile.isDirectory())
+ {
+ InputStream fileInput = Thread.currentThread().getContextClassLoader().getResourceAsStream(tldFileLocation);
+ FileOutputStream fileOutput = new FileOutputStream(new File(webappWebInfFile, "portlet.tld"));
+
+ int in = fileInput.read();
+ while (in > 0)
+ {
+ fileOutput.write(in);
+ in = fileInput.read();
+ }
+ fileInput.close();
+ fileOutput.close();
+ }
+ }
+
+ }
+
+}
Deleted: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletWarDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletWarDeployer.java 2008-12-16 04:28:58 UTC (rev 12390)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletWarDeployer.java 2008-12-16 04:33:13 UTC (rev 12391)
@@ -1,70 +0,0 @@
-package org.jboss.portal.deployer.portlet;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStage;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.ServletMappingMetaData;
-import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.portal.web.command.CommandServlet;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
-public class PortletWarDeployer extends AbstractSimpleVFSRealDeployer<JBossWebMetaData>
-{
-
- public PortletWarDeployer()
- {
- super(JBossWebMetaData.class);
- setStage(DeploymentStages.POST_PARSE);
- }
-
- @Override
- public void deploy(VFSDeploymentUnit unit, JBossWebMetaData metadata)
- throws DeploymentException
- {
-
- addCommandServlet(metadata);
-
- CommandServlet cs = new CommandServlet();
- try
- {
- //Thread.currentThread().getContextClassLoader().getSystemClassLoader().loadClass(this.getClass().toString());
- //Thread.currentThread().getContextClassLoader().loadClass(this.getClass().toString());
- Thread.currentThread().getContextClassLoader().loadClass(CommandServlet.class.toString());
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- protected void addCommandServlet(JBossWebMetaData webmetadata)
- {
- JBossServletMetaData servletMD = new JBossServletMetaData();
- servletMD.setServletName("CommandServlet");
- servletMD.setServletClass(CommandServlet.class.toString());
- servletMD.setLoadOnStartup(0);
-
- ServletMappingMetaData servletMappingMD = new ServletMappingMetaData();
- servletMappingMD.setServletName("CommandServlet");
- List<String> urlPatterns = new ArrayList();
- urlPatterns.add("/jbossportal");
- servletMappingMD.setUrlPatterns(urlPatterns);
-
- webmetadata.getServlets().add(servletMD);
- webmetadata.getServletMappings();
- }
-
- protected void setCookiepath(String path)
- {
-
- }
-
-}
17 years, 5 months