JBoss Portal SVN: r10862 - in branches/JBoss_Portal_Branch_2_7: core-admin and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-05-30 10:16:09 -0400 (Fri, 30 May 2008)
New Revision: 10862
Removed:
branches/JBoss_Portal_Branch_2_7/core-admin/src/etc/
Modified:
branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
branches/JBoss_Portal_Branch_2_7/core-admin/build.xml
Log:
- Using PortletBridge 1.0.0.B2 from the repo
- Using RichFaces 3.2.1.GA
- Removed embedded libs
Modified: branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2008-05-30 13:44:38 UTC (rev 10861)
+++ branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2008-05-30 14:16:09 UTC (rev 10862)
@@ -77,7 +77,8 @@
<componentref name="ehcache" version="1.2.2"/>
<componentref name="el" version="1.0"/>
<componentref name="facelets" version="1.1.14"/>
- <componentref name="richfaces" version="3.1.4.SR1"/>
+ <componentref name="richfaces" version="3.2.1.GA"/>
+ <componentref name="jboss/portlet-bridge" version="1.0.0.B2"/>
<componentref name="hibernate" version="3.2.0.CR2"/>
<componentref name="httpunit" version="1.6"/>
<componentref name="hsqldb" version="1.8.0.2"/>
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/build.xml 2008-05-30 13:44:38 UTC (rev 10861)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/build.xml 2008-05-30 14:16:09 UTC (rev 10862)
@@ -103,8 +103,7 @@
<path refid="richfaces.richfaces.classpath"/>
<path refid="facelets.facelets.classpath"/>
<path refid="portlet.portlet.classpath"/>
- <pathelement location="${source.etc}/sun-jsf/portletbridge-api-1.0.0-SNAPSHOT.jar"/>
- <pathelement location="${source.etc}/sun-jsf/portletbridge-impl-1.0.0-SNAPSHOT.jar"/>
+ <path refid="jboss/portlet.bridge.classpath"/>
</path>
<!-- Configure modules -->
@@ -193,8 +192,8 @@
<copy todir="${build.resources}/portal-admin-war/WEB-INF/lib">
<fileset dir="${apache.myfaces.lib}" includes="jstl.jar"/>
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
- <fileset dir="../core-admin/src/etc/sun-jsf" includes="portletbridge-api-1.0.0-SNAPSHOT.jar"/>
- <fileset dir="../core-admin/src/etc/sun-jsf" includes="portletbridge-impl-1.0.0-SNAPSHOT.jar"/>
+ <fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-api.jar"/>
+ <fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-impl.jar"/>
<fileset dir="${richfaces.richfaces.lib}" includes="richfaces-api.jar"/>
<fileset dir="${richfaces.richfaces.lib}" includes="richfaces-impl.jar"/>
<fileset dir="${richfaces.richfaces.lib}" includes="richfaces-ui.jar"/>
16 years
JBoss Portal SVN: r10861 - in modules/presentation/trunk: classic/src/main/java/org/jboss/portal/presentation/classic and 17 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-05-30 09:44:38 -0400 (Fri, 30 May 2008)
New Revision: 10861
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeFactory.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UINode.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Constants.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/DefaultLayout.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Layout.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/LayoutFactory.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Orientation.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/RegionLayout.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/SimpleLayout.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java
Removed:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java
Modified:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/ClassicUINode.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/PresentationPortletControllerContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralNode.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/structural/StructuralState.java
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/structural/page_structure_1_0.xsd
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/AbstractModelTestCase.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObject.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObjectImpl.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/StructuralStateImpl.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/structural/StructuralStateContextTestCase.java
Log:
adding early support for layout
Modified: modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml
===================================================================
--- modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml 2008-05-30 13:44:38 UTC (rev 10861)
@@ -2,39 +2,14 @@
<context-def
xmlns="urn:jboss:portal:presentation:page:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
<page-def name="default">
- <window-def name="windowA">
- <properties>
- <property>
- <name>portlet-ref</name>
- <value>/classic-presentation.Catalog</value>
- </property>
- </properties>
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowB">
- <properties>
- <property>
- <name>portlet-ref</name>
- <value>/classic-presentation.Cart</value>
- </property>
- </properties>
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
- </window-def>
- <page-def name="child-page-default-1">
+ <simple-layout>
<window-def name="windowA">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowB">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
- </window-def>
- </page-def>
- <page-def name="child-page-default-2">
- <window-def name="windowA">
<properties>
<property>
<name>portlet-ref</name>
- <value>/classic-presentation.PublicParameterPortlet1</value>
+ <value>/classic-presentation.Catalog</value>
</property>
</properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
@@ -43,37 +18,71 @@
<properties>
<property>
<name>portlet-ref</name>
- <value>/classic-presentation.PublicParameterPortlet2</value>
+ <value>/classic-presentation.Cart</value>
</property>
</properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
</window-def>
+ </simple-layout>
+ <page-def name="child-page-default-1">
+ <simple-layout>
+ <window-def name="windowA">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowB">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ </simple-layout>
+ </page-def>
+ <page-def name="child-page-default-2">
+ <simple-layout>
+ <window-def name="windowA">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+ <value>/classic-presentation.PublicParameterPortlet1</value>
+ </property>
+ </properties>
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowB">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+ <value>/classic-presentation.PublicParameterPortlet2</value>
+ </property>
+ </properties>
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowC">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+ <value>/classic-presentation.PublicParameterPortlet3</value>
+ </property>
+ </properties>
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ </simple-layout>
+ </page-def>
+ </page-def>
+ <page-def name="default-sibling-1">
+ <simple-layout>
+ <window-def name="windowA">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowB">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
+ </window-def>
<window-def name="windowC">
- <properties>
- <property>
- <name>portlet-ref</name>
- <value>/classic-presentation.PublicParameterPortlet3</value>
- </property>
- </properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
</window-def>
- </page-def>
+ <window-def name="windowD">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowE">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ </simple-layout>
</page-def>
- <page-def name="default-sibling-1">
- <window-def name="windowA">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowB">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowC">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowD">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowE">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</content>
- </window-def>
- </page-def>
</context-def>
Modified: modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java
===================================================================
--- modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -35,6 +35,9 @@
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ViewPort;
import org.jboss.portal.presentation.model.ViewPortScope;
+import org.jboss.portal.presentation.model.layout.LayoutFactory;
+import org.jboss.portal.presentation.model.layout.Layout;
+import org.jboss.portal.presentation.model.layout.SimpleLayout;
import org.jboss.portal.presentation.model.content.WindowContent;
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
@@ -55,6 +58,7 @@
import org.jboss.portal.web.WebResponse;
import org.jboss.portal.web.impl.DefaultServletContainerFactory;
import org.jboss.portal.common.servlet.URLFormat;
+import org.jboss.portal.common.NotYetImplemented;
import java.io.IOException;
import java.io.PrintWriter;
@@ -234,13 +238,26 @@
{
if (node.getChildren() != null)
{
- writer.print("<div>");
+ LayoutFactory layoutFactory = new LayoutFactory();
//
- renderChildren(node, writer);
+ Layout layout = layoutFactory.getLayout(node);
//
- writer.print("</div>");
+ if (layout instanceof SimpleLayout)
+ {
+ writer.print("<div>");
+
+ //
+ renderChildren(node, writer);
+
+ //
+ writer.print("</div>");
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
}
else
{
Modified: modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/ClassicUINode.java
===================================================================
--- modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/ClassicUINode.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/ClassicUINode.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -23,6 +23,7 @@
package org.jboss.portal.presentation.classic.model;
import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.model.UINode;
import java.util.Collection;
import java.util.Map;
@@ -31,7 +32,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class ClassicUINode
+public class ClassicUINode implements UINode
{
/** . */
@@ -68,7 +69,7 @@
return object;
}
- public Collection<ClassicUINode> getChildren()
+ public Collection getChildren()
{
return children == null ? null : children.values();
}
Modified: modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java
===================================================================
--- modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -31,12 +31,12 @@
import org.jboss.portal.presentation.protocol.ProtocolAction;
import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UINode;
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.portlet.protocol.PortletContainerAction;
import org.jboss.portal.presentation.portlet.controller.PresentationPortletPageNavigationalState;
import org.jboss.portal.presentation.portlet.controller.PresentationPortletControllerContext;
-import org.jboss.portal.presentation.impl.model.tree.UINodeFactory;
+import org.jboss.portal.presentation.impl.model.UINodeFactory;
import org.jboss.portal.portlet.controller.request.ControllerRequest;
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
Modified: modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/PresentationPortletControllerContext.java
===================================================================
--- modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/PresentationPortletControllerContext.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/PresentationPortletControllerContext.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -26,6 +26,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
import org.jboss.portal.portlet.controller.PortletControllerContext;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
@@ -47,7 +48,7 @@
import org.jboss.portal.presentation.portlet.spi.PresentationPortalContext;
import org.jboss.portal.presentation.portlet.spi.PresentationSecurityContext;
import org.jboss.portal.presentation.client.PresentationClient;
-import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UINode;
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ui.UIWindow;
import org.jboss.portal.presentation.state.StateType;
@@ -190,6 +191,12 @@
//
Portlet portlet = portlets.get(ctx.getWindowId());
+ if (portlet == null)
+ {
+ throw new NoSuchPortletException(ctx.getWindowId());
+ }
+
+ //
portletInvocation.setTarget(portlet.getContext());
//
Modified: modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java
===================================================================
--- modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -25,7 +25,7 @@
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UINode;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
Modified: modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java
===================================================================
--- modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -23,7 +23,7 @@
package org.jboss.portal.presentation.portlet.spi;
import org.jboss.portal.portlet.spi.WindowContext;
-import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UINode;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
Copied: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeFactory.java (from rev 10724, modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java)
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeFactory.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeFactory.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.presentation.impl.model;
+
+import org.jboss.portal.presentation.model.UINode;
+import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class UINodeFactory
+{
+
+ /**
+ * Creates a user interface node.
+ *
+ * @param navigationalStateContext the navigational state context
+ * @param structuralStateContext the structural state context
+ * @param objectId the object id
+ * @return the corresponding node
+ */
+ public static UINode createNode(
+ NavigationalStateContext navigationalStateContext,
+ StructuralStateContext structuralStateContext,
+ String objectId)
+ {
+ StructuralObject object = structuralStateContext.load(objectId);
+
+ //
+ if (object != null)
+ {
+ return new UINodeImpl(navigationalStateContext, structuralStateContext, object);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+}
Copied: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeImpl.java (from rev 10724, modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java)
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeImpl.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeImpl.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,164 @@
+/******************************************************************************
+ * 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.presentation.impl.model;
+
+import org.jboss.portal.presentation.model.UINode;
+import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectContext;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
+
+import java.util.Collection;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+class UINodeImpl implements UINode, UIObjectContext
+{
+
+ /** . */
+ private final NavigationalStateContext navigationalStateContext;
+
+ /** . */
+ private final StructuralStateContext structuralStateContext;
+
+ /** . */
+ private final StructuralObject structuralObject;
+
+ /** . */
+ private Collection<UINode> children;
+
+ /** . */
+ private UINode parent;
+
+ /** . */
+ private boolean parentVisited;
+
+ /** . */
+ private UIObject object;
+
+ UINodeImpl(NavigationalStateContext navigationalStateContext, StructuralStateContext structuralStateContext, StructuralObject structuralObject)
+ {
+ this.navigationalStateContext = navigationalStateContext;
+ this.structuralStateContext = structuralStateContext;
+ this.structuralObject = structuralObject;
+ this.children = null;
+ this.parentVisited = false;
+ }
+
+ private UINodeImpl(NavigationalStateContext navigationalStateContext, StructuralStateContext structuralStateContext, StructuralObject structuralObject, Collection<UINode> children)
+ {
+ this.navigationalStateContext = navigationalStateContext;
+ this.structuralStateContext = structuralStateContext;
+ this.structuralObject = structuralObject;
+ this.children = children;
+ this.parentVisited = true;
+ }
+
+ public UIObject getObject()
+ {
+ if (object == null)
+ {
+ object = UIObjectImpl.create(structuralObject, this);
+ }
+
+ //
+ return object;
+ }
+
+ public UINode getParent()
+ {
+ if (!parentVisited)
+ {
+ StructuralObject parentObject = structuralStateContext.loadParent(structuralObject);
+
+ //
+ if (parentObject != null)
+ {
+ Collection<StructuralObject> siblingObjects = structuralStateContext.loadChildren(parentObject);
+ ArrayList<UINode> siblings = new ArrayList<UINode>(siblingObjects.size());
+ for (StructuralObject siblingObject : siblingObjects)
+ {
+ UINodeImpl sibling;
+ if (siblingObject.getId().equals(structuralObject.getId()))
+ {
+ sibling = this;
+ }
+ else
+ {
+ sibling = new UINodeImpl(navigationalStateContext, structuralStateContext, siblingObject);
+ sibling.parent = this;
+ sibling.parentVisited = true;
+ }
+
+ //
+ siblings.add(sibling);
+ }
+
+ //
+ parent = new UINodeImpl(navigationalStateContext, structuralStateContext, parentObject, siblings);
+ }
+
+ //
+ parentVisited = true;
+ }
+
+ //
+ return parent;
+ }
+
+ public Collection<UINode> getChildren()
+ {
+ if (children == null)
+ {
+ Collection<StructuralObject> childrenObject = structuralStateContext.loadChildren(structuralObject);
+ ArrayList<UINode> children = new ArrayList<UINode>(childrenObject.size());
+ for (StructuralObject childObject : childrenObject)
+ {
+ UINodeImpl child = new UINodeImpl(navigationalStateContext, structuralStateContext, childObject);
+ child.parent = this;
+ child.parentVisited = true;
+
+ //
+ children.add(child);
+ }
+
+ //
+ this.children = children;
+ }
+
+ //
+ return children;
+ }
+
+ // UIObjectContext implementation ***********************************************************************************
+
+ public NavigationalStateContext getNavigationalStateContext()
+ {
+ return navigationalStateContext;
+ }
+}
Deleted: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -1,63 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.impl.model.tree;
-
-import org.jboss.portal.presentation.model.tree.UINode;
-import org.jboss.portal.presentation.state.structural.StructuralStateContext;
-import org.jboss.portal.presentation.state.structural.StructuralObject;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class UINodeFactory
-{
-
- /**
- * Creates a user interface node.
- *
- * @param navigationalStateContext the navigational state context
- * @param structuralStateContext the structural state context
- * @param objectId the object id
- * @return the corresponding node
- */
- public static UINode createNode(
- NavigationalStateContext navigationalStateContext,
- StructuralStateContext structuralStateContext,
- String objectId)
- {
- StructuralObject object = structuralStateContext.load(objectId);
-
- //
- if (object != null)
- {
- return new UINodeImpl(navigationalStateContext, structuralStateContext, object);
- }
- else
- {
- return null;
- }
- }
-
-}
Deleted: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -1,164 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.impl.model.tree;
-
-import org.jboss.portal.presentation.model.tree.UINode;
-import org.jboss.portal.presentation.model.ui.UIObject;
-import org.jboss.portal.presentation.state.structural.StructuralObject;
-import org.jboss.portal.presentation.state.structural.StructuralStateContext;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-import org.jboss.portal.presentation.impl.model.ui.UIObjectContext;
-import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
-
-import java.util.Collection;
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-class UINodeImpl implements UINode, UIObjectContext
-{
-
- /** . */
- private final NavigationalStateContext navigationalStateContext;
-
- /** . */
- private final StructuralStateContext structuralStateContext;
-
- /** . */
- private final StructuralObject structuralObject;
-
- /** . */
- private Collection<UINode> children;
-
- /** . */
- private UINode parent;
-
- /** . */
- private boolean parentVisited;
-
- /** . */
- private UIObject object;
-
- UINodeImpl(NavigationalStateContext navigationalStateContext, StructuralStateContext structuralStateContext, StructuralObject structuralObject)
- {
- this.navigationalStateContext = navigationalStateContext;
- this.structuralStateContext = structuralStateContext;
- this.structuralObject = structuralObject;
- this.children = null;
- this.parentVisited = false;
- }
-
- private UINodeImpl(NavigationalStateContext navigationalStateContext, StructuralStateContext structuralStateContext, StructuralObject structuralObject, Collection<UINode> children)
- {
- this.navigationalStateContext = navigationalStateContext;
- this.structuralStateContext = structuralStateContext;
- this.structuralObject = structuralObject;
- this.children = children;
- this.parentVisited = true;
- }
-
- public UIObject getObject()
- {
- if (object == null)
- {
- object = UIObjectImpl.create(structuralObject, this);
- }
-
- //
- return object;
- }
-
- public UINode getParent()
- {
- if (!parentVisited)
- {
- StructuralObject parentObject = structuralStateContext.loadParent(structuralObject);
-
- //
- if (parentObject != null)
- {
- Collection<StructuralObject> siblingObjects = structuralStateContext.loadChildren(parentObject);
- ArrayList<UINode> siblings = new ArrayList<UINode>(siblingObjects.size());
- for (StructuralObject siblingObject : siblingObjects)
- {
- UINodeImpl sibling;
- if (siblingObject.getId().equals(structuralObject.getId()))
- {
- sibling = this;
- }
- else
- {
- sibling = new UINodeImpl(navigationalStateContext, structuralStateContext, siblingObject);
- sibling.parent = this;
- sibling.parentVisited = true;
- }
-
- //
- siblings.add(sibling);
- }
-
- //
- parent = new UINodeImpl(navigationalStateContext, structuralStateContext, parentObject, siblings);
- }
-
- //
- parentVisited = true;
- }
-
- //
- return parent;
- }
-
- public Collection<UINode> getChildren()
- {
- if (children == null)
- {
- Collection<StructuralObject> childrenObject = structuralStateContext.loadChildren(structuralObject);
- ArrayList<UINode> children = new ArrayList<UINode>(childrenObject.size());
- for (StructuralObject childObject : childrenObject)
- {
- UINodeImpl child = new UINodeImpl(navigationalStateContext, structuralStateContext, childObject);
- child.parent = this;
- child.parentVisited = true;
-
- //
- children.add(child);
- }
-
- //
- this.children = children;
- }
-
- //
- return children;
- }
-
- // UIObjectContext implementation ***********************************************************************************
-
- public NavigationalStateContext getNavigationalStateContext()
- {
- return navigationalStateContext;
- }
-}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -28,6 +28,7 @@
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
import org.jboss.portal.presentation.model.ui.UIWindow;
+import org.jboss.portal.presentation.model.ui.UIPane;
import org.jboss.portal.presentation.state.StateException;
import org.jboss.portal.presentation.state.StateType;
import org.jboss.portal.presentation.state.structural.StructuralObject;
@@ -65,6 +66,10 @@
{
object = new UIPageImpl(structuralObject, objectContext);
}
+ else if (type == UIPane.class)
+ {
+ object = new UIPaneImpl(structuralObject, objectContext);
+ }
else if (type == UIContext.class)
{
object = new UIContextImpl(structuralObject, objectContext);
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class UIPageImpl extends UIObjectImpl implements UIPage
+public class UIPageImpl extends UIPaneImpl implements UIPage
{
public UIPageImpl(
StructuralObject structuralObject,
Added: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.presentation.impl.model.ui;
+
+import org.jboss.portal.presentation.model.ui.UIPane;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class UIPaneImpl extends UIObjectImpl implements UIPane
+{
+
+ public UIPaneImpl(StructuralObject structuralObject, UIObjectContext context)
+ {
+ super(structuralObject, context);
+ }
+}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -24,7 +24,9 @@
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.xml.XMLTools;
+import org.jboss.portal.common.NotYetImplemented;
import static org.jboss.portal.common.xml.XMLTools.*;
+import org.jboss.portal.presentation.model.layout.Constants;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
@@ -37,6 +39,7 @@
import javax.xml.validation.SchemaFactory;
import java.io.IOException;
import java.io.InputStream;
+import java.io.Serializable;
import java.net.URL;
/**
@@ -119,11 +122,6 @@
}
}
- private void importProperties()
- {
-
- }
-
private void importContextDef(Element contextDefElt)
{
// Children pages
@@ -143,16 +141,42 @@
importPageDef(pageNode, childElt);
}
- // Windows
- for (Element childElt : getChildren(pageDefElt, "window-def"))
+ //
+ Element layoutElt = getUniqueChild(pageDefElt, "simple-layout", false);
+
+ //
+ if (layoutElt != null)
{
- importWindowDef(pageNode, childElt);
+ importLayout(pageNode, layoutElt);
}
//
return pageNode;
}
+ private void importLayout(StructuralNode paneNode, Element layoutElt)
+ {
+ if ("simple-layout".equals(layoutElt.getNodeName()))
+ {
+ paneNode.setProperty(Constants.LAYOUT_ID, Constants.SIMPLE_LAYOUT);
+ paneNode.setProperty(Constants.SIMPLE_LAYOUT_ORIENTATION, Constants.VERTICAL_ORIENTATION);
+
+ //
+ int index = 0;
+ for (Element childElt : getChildren(layoutElt, "window-def"))
+ {
+ WindowNode windowNode = importWindowDef(paneNode, childElt);
+
+ //
+ windowNode.setProperty(Constants.SIMPLE_LAYOUT_INDEX, index++);
+ }
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
private WindowNode importWindowDef(StructuralNode parentNode, Element windowDefElt)
{
WindowNode windowNode = createStructuralNode(parentNode, WindowNode.class, windowDefElt);
@@ -188,8 +212,23 @@
//
Element valueElt = XMLTools.getUniqueChild(propertyElt, "value", true);
- String propertyValue = XMLTools.asString(valueElt);
+ String litteralPropertyValue = XMLTools.asString(valueElt);
+ Serializable propertyValue;
+ String propertyType = valueElt.getAttribute("type");
+ if (propertyType == null || "string".equals(propertyType))
+ {
+ propertyValue = litteralPropertyValue;
+ }
+ else if ("int".equals(propertyType))
+ {
+ propertyValue = Integer.parseInt(litteralPropertyValue);
+ }
+ else
+ {
+ throw new AssertionError();
+ }
+
//
node.setProperty(propertyName, propertyValue);
}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralNode.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralNode.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralNode.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -35,6 +35,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -65,14 +66,14 @@
private boolean valid;
/** . */
- private final Map<String, String> properties;
+ private final Map<String, Serializable> properties;
protected StructuralNode(String name, StructuralStateContextImpl structuralStateContext)
{
this.name = name;
this.id = structuralStateContext.nextId();
this.structuralStateContext = structuralStateContext;
- this.properties = new HashMap<String, String>();
+ this.properties = new HashMap<String, Serializable>();
this.valid = true;
}
@@ -120,7 +121,7 @@
StructuralStateImpl state = new StructuralStateImpl(
getType(),
name,
- Collections.unmodifiableMap(new HashMap<String, String>(properties)));
+ Collections.unmodifiableMap(new HashMap<String, Serializable>(properties)));
//
Set<String> childrenIds = new HashSet<String>();
@@ -209,7 +210,7 @@
return Collections.unmodifiableSet(properties.keySet());
}
- public String getProperty(String propertyName)
+ public Serializable getProperty(String propertyName)
{
if (propertyName == null)
{
@@ -223,7 +224,7 @@
}
}
- public void setProperty(String propertyName, String propertyValue)
+ public void setProperty(String propertyName, Serializable propertyValue)
{
if (propertyName == null)
{
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateImpl.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateImpl.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateImpl.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -26,6 +26,7 @@
import org.jboss.portal.presentation.state.structural.StructuralState;
import java.util.Map;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -41,12 +42,12 @@
private final String name;
/** . */
- private final Map<String, String> properties;
+ private final Map<String, Serializable> properties;
public StructuralStateImpl(
Class<? extends UIObject> type,
String name,
- Map<String, String> properties)
+ Map<String, Serializable> properties)
{
this.type = type;
this.name = name;
@@ -63,7 +64,7 @@
return name;
}
- public Map<String, String> getProperties()
+ public Map<String, Serializable> getProperties()
{
return properties;
}
Copied: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UINode.java (from rev 10727, modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java)
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UINode.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UINode.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.presentation.model;
+
+import org.jboss.portal.presentation.model.ui.UIObject;
+
+import java.util.Collection;
+
+/**
+ * The node interface provides a pull style api for interacting with an ui object.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface UINode
+{
+
+ /**
+ * Returns the related ui object.
+ *
+ * @return the ui object
+ */
+ UIObject getObject();
+
+ /**
+ * Returns the parent node or null if it cannot be loaded (because it is the root or
+ * because the viewport scope does not go beyond)
+ *
+ * @return the parent node
+ */
+ UINode getParent();
+
+ /**
+ * Returns a collection of children nodes or null if the node children cannot be loaded.
+ *
+ * @return the children
+ */
+ Collection<UINode> getChildren();
+
+}
Added: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Constants.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Constants.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Constants.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.presentation.model.layout;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class Constants
+{
+
+ /** . */
+ public static final String LAYOUT_ID = "org.jboss.portal.presentation.layout_id";
+
+ /** . */
+ public static final String SIMPLE_LAYOUT_ORIENTATION = "org.jboss.portal.presentation.layout.simple.orientation";
+
+ /** . */
+ public static final String SIMPLE_LAYOUT_INDEX = "org.jboss.portal.presentation.layout.simple.index";
+
+ /** . */
+ public static final String VERTICAL_ORIENTATION = "vertical";
+
+ /** . */
+ public static final String HORIZONTAL_ORIENTATION = "horizontal";
+
+ /** . */
+ public static final String SIMPLE_LAYOUT = "simple_layout";
+
+ /** . */
+ public static final String REGION_LAYOUT = "region_layout";
+
+ /** . */
+ public static final String REGION_LAYOUT_NAME = "org.jboss.portal.presentation.layout.region.name";
+
+ /** . */
+ public static final String REGION_LAYOUT_INDEX = "org.jboss.portal.presentation.layout.region.index";
+}
Added: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/DefaultLayout.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/DefaultLayout.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/DefaultLayout.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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.presentation.model.layout;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class DefaultLayout implements Layout
+{
+}
Added: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Layout.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Layout.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Layout.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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.presentation.model.layout;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface Layout
+{
+}
Added: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/LayoutFactory.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/LayoutFactory.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/LayoutFactory.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,135 @@
+/******************************************************************************
+ * 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.presentation.model.layout;
+
+import org.jboss.portal.presentation.model.ui.UIPane;
+import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.model.UINode;
+import org.jboss.portal.presentation.state.StateType;
+
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.util.SetMap;
+
+import java.util.Collection;
+import java.util.TreeMap;
+import java.util.Comparator;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class LayoutFactory
+{
+
+ public Layout getLayout(UINode node)
+ {
+ UIPane pane = (UIPane)node.getObject();
+
+ //
+ String layoutId = pane.getProperty(StateType.STRUCTURAL, Constants.LAYOUT_ID, String.class);
+
+ //
+ if (Constants.SIMPLE_LAYOUT.equals(layoutId))
+ {
+ String orientationValue = pane.getProperty(StateType.STRUCTURAL, Constants.SIMPLE_LAYOUT_ORIENTATION, String.class);
+
+ //
+ Orientation orientation = Orientation.HORIZONTAL;
+
+ //
+ if (Constants.VERTICAL_ORIENTATION.equals(orientationValue))
+ {
+ orientation = Orientation.VERTICAL;
+ }
+
+ //
+ Collection<? extends UINode> chidrenNodes = node.getChildren();
+
+ //
+ if (chidrenNodes == null)
+ {
+ throw new IllegalStateException("No children found for the simple layout " + pane.getId());
+ }
+
+ //
+ TreeMap<Integer, UINode> layoutNodes = new TreeMap<Integer, UINode>();
+ for (UINode childNode : chidrenNodes)
+ {
+ UIObject child = childNode.getObject();
+
+ //
+ Integer index = child.getProperty(StateType.STRUCTURAL, Constants.SIMPLE_LAYOUT_INDEX, Integer.class);
+
+ //
+ if (index != null)
+ {
+ layoutNodes.put(index, childNode);
+ }
+ }
+
+ //
+ return new SimpleLayout(orientation, layoutNodes.values());
+ }
+ else if (Constants.REGION_LAYOUT.equals(layoutId))
+ {
+ Collection<? extends UINode> chidrenNodes = node.getChildren();
+
+ //
+ SetMap<String, UINode> map = new SetMap<String, UINode>(comparator);
+ for (UINode childNode : chidrenNodes)
+ {
+ UIObject child = childNode.getObject();
+
+ //
+ String regionName = child.getProperty(StateType.STRUCTURAL, Constants.REGION_LAYOUT_NAME, String.class);
+ Integer regionIndex = child.getProperty(StateType.STRUCTURAL, Constants.REGION_LAYOUT_INDEX, Integer.class);
+
+ //
+ if (regionName != null && regionIndex != null)
+ {
+ map.put(regionName, childNode);
+ }
+ }
+
+ //
+ return new RegionLayout(map);
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ /** . */
+ private static final Comparator<UINode> comparator = new Comparator<UINode>()
+ {
+ public int compare(UINode node1, UINode node2)
+ {
+ UIObject object1 = node1.getObject();
+ UIObject object2 = node2.getObject();
+ Integer index1 = object1.getProperty(StateType.STRUCTURAL, Constants.REGION_LAYOUT_INDEX, Integer.class);
+ Integer index2 = object2.getProperty(StateType.STRUCTURAL, Constants.REGION_LAYOUT_INDEX, Integer.class);
+ return index1.compareTo(index2);
+ }
+ };
+}
Added: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Orientation.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Orientation.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Orientation.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.presentation.model.layout;
+
+/**
+ * An orientation.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public enum Orientation
+{
+ VERTICAL, HORIZONTAL
+}
Added: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/RegionLayout.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/RegionLayout.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/RegionLayout.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.presentation.model.layout;
+
+import org.jboss.portal.presentation.model.UINode;
+
+import org.jboss.portal.common.util.CollectionMap;
+
+import java.util.Set;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class RegionLayout implements Layout
+{
+
+ /** . */
+ private final CollectionMap<String, UINode> map;
+
+ RegionLayout(CollectionMap<String, UINode> map)
+ {
+ this.map = map;
+ }
+
+ public Set<String> getRegionNames()
+ {
+ return map.keySet();
+ }
+
+ public Collection<? extends UINode> getNodes(String regionName)
+ {
+ return map.get(regionName);
+ }
+}
Added: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/SimpleLayout.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/SimpleLayout.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/SimpleLayout.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * 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.presentation.model.layout;
+
+import org.jboss.portal.presentation.model.UINode;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class SimpleLayout implements Layout
+{
+
+ /** . */
+ private final Orientation orientation;
+
+ /** . */
+ private final Collection<? extends UINode> nodes;
+
+ SimpleLayout(Orientation orientation, Collection<? extends UINode> nodes)
+ {
+ this.orientation = orientation;
+ this.nodes = nodes;
+ }
+
+ public Orientation getOrientation()
+ {
+ return orientation;
+ }
+
+ public Collection<? extends UINode> getNodes()
+ {
+ return nodes;
+ }
+}
Deleted: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -1,59 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model.tree;
-
-import org.jboss.portal.presentation.model.ui.UIObject;
-
-import java.util.Collection;
-
-/**
- * The node interface provides a pull style api for interacting with the structural context.
- *
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface UINode
-{
-
- /**
- * Returns the related ui object.
- *
- * @return the ui object
- */
- UIObject getObject();
-
- /**
- * Returns the parent node or null if it does not exist.
- *
- * @return the parent node
- */
- UINode getParent();
-
- /**
- * Returns a collection of children nodes.
- *
- * @return the children
- */
- Collection<UINode> getChildren();
-
-}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -26,6 +26,6 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public interface UIPage extends UIObject
+public interface UIPage extends UIPane
{
}
\ No newline at end of file
Added: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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.presentation.model.ui;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface UIPane extends UIObject
+{
+}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/structural/StructuralState.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/structural/StructuralState.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/structural/StructuralState.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -25,6 +25,7 @@
import org.jboss.portal.presentation.model.ui.UIObject;
import java.util.Map;
+import java.io.Serializable;
/**
* The structural state.
@@ -39,5 +40,5 @@
String getName();
- Map<String, String> getProperties();
+ Map<String, Serializable> getProperties();
}
\ No newline at end of file
Modified: modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/structural/page_structure_1_0.xsd
===================================================================
--- modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/structural/page_structure_1_0.xsd 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/structural/page_structure_1_0.xsd 2008-05-30 13:44:38 UTC (rev 10861)
@@ -7,10 +7,7 @@
attributeFormDefault="unqualified"
version="1.0">
- <xsd:element
- name="context-def"
- type="contextDefType">
- <xsd:annotation><xsd:documentation>A jboss-unit is the top container element.</xsd:documentation></xsd:annotation>
+ <xsd:element name="context-def" type="contextDefType">
</xsd:element>
<xsd:complexType name="nodeDefType">
@@ -34,10 +31,31 @@
</xsd:complexType>
<xsd:complexType name="nodePropertyType">
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="value" type="propertyValueType" minOccurs="1" maxOccurs="1"/>
+ </xsd:sequence>
</xsd:complexType>
+ <xsd:complexType name="propertyValueType">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="type" use="optional" default="string">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="string"/>
+ <xsd:enumeration value="int"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:simpleType name="contentType" >
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+
<xsd:complexType name="contextDefType">
<xsd:complexContent>
<xsd:extension base="nodeDefType">
@@ -53,10 +71,15 @@
<xsd:complexType name="pageDefType">
<xsd:complexContent>
<xsd:extension base="namedNodeDefType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="page-def" type="pageDefType"/>
- <xsd:element name="window-def" type="windowDefType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:choice minOccurs="1" maxOccurs="1">
+ <xsd:element name="simple-layout" type="simpleLayoutType"/>
+ <xsd:element name="region-layout" type="regionLayoutType"/>
+ </xsd:choice>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="page-def" type="pageDefType"/>
+ </xsd:choice>
+ </xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -71,8 +94,31 @@
</xsd:complexContent>
</xsd:complexType>
- <xsd:simpleType name="contentType" >
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
+ <xsd:complexType name="simpleLayoutType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="window-def" type="windowDefType"/>
+ </xsd:choice>
+ <xsd:attribute name="orientation" use="optional" default="vertical">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="vertical"/>
+ <xsd:enumeration value="horizontal"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:complexType name="regionLayoutType">
+ <xsd:sequence>
+ <xsd:element name="region" type="regionType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="regionType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="window-def" type="windowDefType"/>
+ </xsd:choice>
+ <xsd:attribute name="orientation" use="required" type="xsd:string"/>
+ </xsd:complexType>
+
</xsd:schema>
Modified: modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/AbstractModelTestCase.java
===================================================================
--- modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/AbstractModelTestCase.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/AbstractModelTestCase.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -39,6 +39,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -80,7 +81,7 @@
protected abstract void setProperty(MockObject object, String propertyName, String propertyValue);
- protected abstract String getProperty(MockObject object, String name);
+ protected abstract Serializable getProperty(MockObject object, String name);
protected final StructuralObject getStructuralObject(MockObject object)
{
Modified: modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObject.java
===================================================================
--- modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObject.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObject.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -81,13 +82,13 @@
int getVersion();
- String getPropertyValue(String propertyName) throws IllegalArgumentException;
+ Serializable getPropertyValue(String propertyName) throws IllegalArgumentException;
void setPropertyBehavior(String propertyName, UpdateBehavior propertyBehavior) throws IllegalArgumentException;
UpdateBehavior getPropertyBehavior(String propertyName) throws IllegalArgumentException;
- void setPropertyValue(String propertyName, String propertyValue) throws MockException;
+ void setPropertyValue(String propertyName, Serializable propertyValue) throws MockException;
Set<String> getPropertyNames();
Modified: modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObjectImpl.java
===================================================================
--- modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObjectImpl.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObjectImpl.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -31,6 +31,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -49,7 +50,7 @@
private final String name;
/** . */
- private final Map<String, String> propertyValues;
+ private final Map<String, Serializable> propertyValues;
/** . */
private final Map<String, UpdateBehavior> propertyBehaviors;
@@ -75,7 +76,7 @@
this.name = name;
this.type = type;
this.children = new LinkedHashMap<String, MockObjectImpl>();
- this.propertyValues = new HashMap<String, String>();
+ this.propertyValues = new HashMap<String, Serializable>();
this.propertyBehaviors = new HashMap<String, UpdateBehavior>();
this.valid = true;
this.handle = new StructuralObjectHandle(id, 0);
@@ -101,7 +102,7 @@
return handle.id;
}
- public String getPropertyValue(String propertyName)
+ public Serializable getPropertyValue(String propertyName)
{
if (name == null)
{
@@ -216,7 +217,7 @@
return propertyBehaviors.get(propertyName);
}
- public void setPropertyValue(String propertyName, String propertyValue) throws MockException
+ public void setPropertyValue(String propertyName, Serializable propertyValue) throws MockException
{
if (!valid)
{
@@ -256,7 +257,7 @@
}
//
- StructuralStateImpl state = new StructuralStateImpl(type, name, new HashMap<String, String>(propertyValues));
+ StructuralStateImpl state = new StructuralStateImpl(type, name, new HashMap<String, Serializable>(propertyValues));
//
return new StructuralObjectImpl(handle, parentHandle, childrenHandles, state);
Modified: modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/StructuralStateImpl.java
===================================================================
--- modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/StructuralStateImpl.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/StructuralStateImpl.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -26,6 +26,7 @@
import org.jboss.portal.presentation.state.structural.StructuralState;
import java.util.Map;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -41,9 +42,9 @@
private final String name;
/** . */
- private final Map<String, String> properties;
+ private final Map<String, Serializable> properties;
- public StructuralStateImpl(Class<? extends UIObject> type, String name, Map<String, String> properties)
+ public StructuralStateImpl(Class<? extends UIObject> type, String name, Map<String, Serializable> properties)
{
this.type = type;
this.name = name;
@@ -60,7 +61,7 @@
return name;
}
- public Map<String, String> getProperties()
+ public Map<String, Serializable> getProperties()
{
return properties;
}
Modified: modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/structural/StructuralStateContextTestCase.java
===================================================================
--- modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/structural/StructuralStateContextTestCase.java 2008-05-30 12:06:26 UTC (rev 10860)
+++ modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/structural/StructuralStateContextTestCase.java 2008-05-30 13:44:38 UTC (rev 10861)
@@ -37,6 +37,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -124,7 +125,7 @@
structuralNode.setProperty(propertyName, propertyValue);
}
- protected String getProperty(StructuralNode structuralNode, String name)
+ protected Serializable getProperty(StructuralNode structuralNode, String name)
{
return structuralNode.getProperty(name);
}
16 years
JBoss Portal SVN: r10860 - branches/JBoss_Portal_Branch_2_7/cms/src/resources/test.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-05-30 08:06:26 -0400 (Fri, 30 May 2008)
New Revision: 10860
Modified:
branches/JBoss_Portal_Branch_2_7/cms/src/resources/test/db-config.xml
branches/JBoss_Portal_Branch_2_7/cms/src/resources/test/standardidentity-config.xml
Log:
fix for cms tests
Modified: branches/JBoss_Portal_Branch_2_7/cms/src/resources/test/db-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/resources/test/db-config.xml 2008-05-30 10:46:24 UTC (rev 10859)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/resources/test/db-config.xml 2008-05-30 12:06:26 UTC (rev 10860)
@@ -47,7 +47,13 @@
<type>Membership</type>
<implementation>DB</implementation>
<config/>
- </module>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfile</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
</modules>
<options/>
</identity-configuration>
Modified: branches/JBoss_Portal_Branch_2_7/cms/src/resources/test/standardidentity-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/resources/test/standardidentity-config.xml 2008-05-30 10:46:24 UTC (rev 10859)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/resources/test/standardidentity-config.xml 2008-05-30 12:06:26 UTC (rev 10860)
@@ -140,8 +140,33 @@
</option>
</config>
</module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfile</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=UserProfile</service-name>
+ <class>org.jboss.portal.identity.db.HibernateUserProfileModuleImpl</class>
+
+ <!--set of options that are set in instantiated object-->
+ <config>
+ <option>
+ <name>sessionFactoryJNDIName</name>
+ <value>java:/SessionFactory</value>
+ </option>
+ <option>
+ <name>jNDIName</name>
+ <value>java:/portal/UserProfileModule</value>
+ </option>
+ </config>
+ </module>
+
</modules>
+
+
<options>
<!--Common options section-->
<option-group>
16 years
JBoss Portal SVN: r10859 - in branches/JBoss_Portal_Branch_2_7: cms/src/main/org/jboss/portal/cms/impl/jcr and 4 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-05-30 06:46:24 -0400 (Fri, 30 May 2008)
New Revision: 10859
Added:
branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/command/AsyncStoreArchiveCommand.java
Modified:
branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/CommandFactory.java
branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java
branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/commands/TestFileArchiveUpload.java
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
Log:
[JBPORTAL-1899] - Uploading large archives into Portal CMS results in Transaction timeout (merge missing from 2.6)
Modified: branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/CommandFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/CommandFactory.java 2008-05-30 10:40:00 UTC (rev 10858)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/CommandFactory.java 2008-05-30 10:46:24 UTC (rev 10859)
@@ -25,6 +25,7 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.portal.cms.CMS;
import org.jboss.portal.search.impl.jcr.JCRQuery;
import java.io.InputStream;
@@ -74,6 +75,8 @@
Command createContentCreateNewVersionCommand(List contents, boolean bMakeLive);
Command createStoreArchiveCommand(String sRootPath, InputStream is, String sLanguage);
+
+ Command createAsyncStoreArchiveCommand(CMS cms, String sRootPath, InputStream is, String sLanguage);
Command createItemExistsCommand(String sPath);
Modified: branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2008-05-30 10:40:00 UTC (rev 10858)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2008-05-30 10:46:24 UTC (rev 10859)
@@ -50,8 +50,11 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.portal.cms.CMS;
import org.jboss.portal.search.impl.jcr.JCRQuery;
+import org.jboss.portal.cms.impl.jcr.command.AsyncStoreArchiveCommand;
+
import java.io.InputStream;
import java.util.List;
import java.util.Locale;
@@ -153,8 +156,13 @@
public Command createStoreArchiveCommand(String sRootPath, InputStream is, String sLanguage)
{
- return new StoreArchiveCommand(sRootPath, is, sLanguage);
+ return new StoreArchiveCommand(sRootPath, is, sLanguage);
}
+
+ public Command createAsyncStoreArchiveCommand(CMS cms, String sRootPath, InputStream is, String sLanguage)
+ {
+ return new AsyncStoreArchiveCommand(cms,sRootPath, is, sLanguage);
+ }
public Command createItemExistsCommand(String sPath)
{
Copied: branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/command/AsyncStoreArchiveCommand.java (from rev 10735, branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/AsyncStoreArchiveCommand.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/command/AsyncStoreArchiveCommand.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/command/AsyncStoreArchiveCommand.java 2008-05-30 10:46:24 UTC (rev 10859)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * 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.cms.impl.jcr.command;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.portal.cms.impl.jcr.JCRCMS;
+import org.jboss.portal.cms.impl.jcr.JCRCommand;
+import org.jboss.portal.cms.impl.jcr.JCRCommandContext;
+import org.jboss.portal.cms.CMSException;
+
+
+import java.io.InputStream;
+
+import org.jboss.portal.cms.CMS;
+
+/**
+ * Saves an uploaded archive to the repo.
+ *
+ * @author <a href="mailto:roy@jboss.org">Roy Russo</a>
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class AsyncStoreArchiveCommand extends JCRCommand
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1568453649437987499L;
+ private static Logger log = Logger.getLogger(AsyncStoreArchiveCommand.class);
+
+ String msRootPath;
+ InputStream mIS;
+ String msLanguage;
+ CMS cms = null;
+
+ private Object user = null;
+ private Object approvePublishWorkflow = null;
+
+
+ /**
+ * @param sRootPath
+ * @param is
+ * @param sLanguage
+ */
+ public AsyncStoreArchiveCommand(CMS cms, String sRootPath, InputStream is, String sLanguage)
+ {
+ this.msRootPath = sRootPath;
+ this.mIS = is;
+ this.msLanguage = sLanguage;
+ this.cms = cms;
+ }
+
+ /**
+ *
+ */
+ public Object execute()
+ {
+ try
+ {
+ //Capture context information to be passed to the Async processor
+ this.user = context.getAttribute(JCRCommandContext.scope, "user");
+ this.approvePublishWorkflow = context.getAttribute(JCRCommandContext.scope, "approvePublishWorkflow");
+
+ Thread t = new Thread(new AsyncProcessor());
+ t.start();
+
+ return null;
+ }
+ catch(Exception e)
+ {
+ throw new CMSException(e);
+ }
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ private class AsyncProcessor implements Runnable
+ {
+ /**
+ *
+ */
+ public void run()
+ {
+ try
+ {
+ log.info("Async Processing started....................");
+
+ //Setup context information to be propagated to the new CMS Service Command call
+ JCRCMS.getUserInfo().set(user);
+ if(approvePublishWorkflow != null)
+ {
+ JCRCMS.turnOnWorkflow();
+ }
+
+ JCRCommand storeArchiveCommand = (JCRCommand)cms.getCommandFactory().createStoreArchiveCommand(msRootPath, mIS, msLanguage);
+ cms.execute(storeArchiveCommand);
+
+ log.info("Async Processing finished..................");
+ }
+ catch(Exception e)
+ {
+ log.error("Asynchronous Processing of archive failed------------------------------------");
+ log.error(this, e);
+ log.error("-----------------------------------------------------------------------------");
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java 2008-05-30 10:40:00 UTC (rev 10858)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java 2008-05-30 10:46:24 UTC (rev 10859)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.cms.impl.jcr.command;
+import org.apache.log4j.Logger;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipFile;
import org.jboss.portal.cms.CMSException;
@@ -37,10 +38,8 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
-import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
-import java.util.List;
import java.util.Locale;
import java.util.StringTokenizer;
@@ -54,6 +53,8 @@
{
/** The serialVersionUID */
private static final long serialVersionUID = 1568453649437987499L;
+ private static Logger log = Logger.getLogger(StoreArchiveCommand.class);
+
String msRootPath;
InputStream mIS;
String msLanguage;
@@ -75,7 +76,6 @@
*/
public Object execute()
{
- List contents = new ArrayList();
File tmpFile = null;
try
{
@@ -128,8 +128,10 @@
JCRCommand saveContentCMD = (JCRCommand)context.getCommandFactory().createContentSaveCommand(file);
context.execute(saveContentCMD);
-
- contents.add(content);
+
+ //Add this content to the repository
+ JCRCommand createContent = (JCRCommand)context.getCommandFactory().createContentCreateNewVersionCommand(content, true);
+ context.execute(createContent);
}
else // isDirectory
{
@@ -168,11 +170,11 @@
}
}
}
- return contents;
+ return null;
}
catch (Exception e)
{
- e.printStackTrace();
+ throw new CMSException(e);
}
finally
{
@@ -181,7 +183,6 @@
tmpFile.delete();
}
}
- return null;
}
/** @param parentPath */
Modified: branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/commands/TestFileArchiveUpload.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/commands/TestFileArchiveUpload.java 2008-05-30 10:40:00 UTC (rev 10858)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/commands/TestFileArchiveUpload.java 2008-05-30 10:46:24 UTC (rev 10859)
@@ -80,13 +80,9 @@
service.setDefaultLocale(Locale.ENGLISH.getLanguage());
InputStream is = IOTools.safeBufferedWrapper(new FileInputStream(sZipFile));
Command storearchiveCMD = service.getCommandFactory().createStoreArchiveCommand("", is, "en");
- List contentsToVersion = (List)service.execute(storearchiveCMD);
- is.close();
+ service.execute(storearchiveCMD);
+ is.close();
- Command createVersions = service.getCommandFactory()
- .createContentCreateNewVersionCommand(contentsToVersion, true);
- service.execute(createVersions);
-
// retrieve list
Command listCMD = service.getCommandFactory().createFolderGetListCommand("/ziptest/poop");
Folder whopper = (Folder)service.execute(listCMD);
@@ -107,13 +103,6 @@
Command listCMD3 = service.getCommandFactory().createFolderGetListCommand("/");
Folder whopper3 = (Folder)service.execute(listCMD3);
List folders3 = whopper3.getFolders();
- List files3 = whopper3.getFiles();
-
- //Create and Test an archive containing foreign files
- is = IOTools.safeBufferedWrapper(new FileInputStream(this.foreignArchive));
- storearchiveCMD = service.getCommandFactory().createStoreArchiveCommand("", is, "en");
- contentsToVersion = (List)service.execute(storearchiveCMD);
- assertTrue("Foreign Archive Creation Failed", (contentsToVersion != null && !contentsToVersion.isEmpty() && contentsToVersion.size() == 2));
- is.close();
+ List files3 = whopper3.getFiles();
}
}
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-05-30 10:40:00 UTC (rev 10858)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-05-30 10:46:24 UTC (rev 10859)
@@ -68,6 +68,7 @@
import org.jboss.portlet.JBossRenderResponse;
import javax.naming.InitialContext;
+import javax.portlet.PortletConfig;
import javax.portlet.PortletException;
import javax.portlet.PortletRequest;
import javax.portlet.PortletRequestDispatcher;
@@ -85,6 +86,7 @@
import java.util.Locale;
import java.util.Set;
import java.util.Vector;
+import java.util.ResourceBundle;
/**
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
@@ -99,6 +101,7 @@
private MembershipModule membershipModule;
private ApprovePublish approvePublish;
private AuthorizationManager authorizationManager;
+ private ResourceBundle resources = null;
public void init() throws PortletException
@@ -130,9 +133,22 @@
throw new PortletException("Authorization Service not found");
}
- this.initializeApprovePublishWorkflow();
+ this.initializeApprovePublishWorkflow();
}
+
+ /**
+ *
+ */
+ public void init(PortletConfig config) throws PortletException
+ {
+ super.init(config);
+
+ //Get the Resource Bundle for this Portlet
+ this.resources = config.getResourceBundle(Locale.getDefault());
+ }
+
+
protected void doView(final JBossRenderRequest rReq, final JBossRenderResponse rRes)
throws PortletException, IOException, UnavailableException
{
@@ -222,6 +238,14 @@
{
rReq.setAttribute("manageWorkflowAccessible", new Boolean(false));
}
+
+ //Messages
+ if(rReq.getPortletSession().getAttribute("messages") != null)
+ {
+ Object messages = rReq.getPortletSession().getAttribute("messages");
+ rReq.getPortletSession().removeAttribute("messages");
+ rReq.setAttribute("messages", messages);
+ }
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/main.jsp");
prd.include(rReq, rRes);
@@ -852,12 +876,14 @@
if (!item.isFormField())
{
InputStream is = item.getInputStream();
- Command storearchiveCMD = CMSService.getCommandFactory().createStoreArchiveCommand(sPath, is, sLanguage);
- List contentstoVersion = (List)CMSService.execute(storearchiveCMD);
+
+ Command storearchiveCMD = CMSService.getCommandFactory().createAsyncStoreArchiveCommand(CMSService, sPath, is, sLanguage);
+ CMSService.execute(storearchiveCMD);
+
+ List messages = new ArrayList();
+ messages.add(this.resources.getObject("CMS_MSG_UPLOADARCHIVE_ASYNC"));
+ aReq.getPortletSession().setAttribute("messages", messages);
- Command createVersions = CMSService.getCommandFactory().createContentCreateNewVersionCommand(contentstoVersion, true);
- CMSService.execute(createVersions);
-
aRes.setRenderParameter("path", FileUtil.cleanDoubleSlashes(sPath));
}
else
@@ -870,13 +896,13 @@
else if ("language".equals(fieldName))
{
sLanguage = item.getString(aReq.getCharacterEncoding());
- }
+ }
}
}
}
catch (Exception e)
{
- throw new PortletException(e);
+ throw new PortletException("CMS_ERROR_UPLOADARCHIVE_ASYNC");
}
aRes.setRenderParameter("op", CMSAdminConstants.OP_MAIN);
}
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-05-30 10:40:00 UTC (rev 10858)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-05-30 10:46:24 UTC (rev 10859)
@@ -58,6 +58,7 @@
CMS_CREATEFOLDER= Create Folder
CMS_CREATEFILE=Create File
CMS_UPLOADARCHIVE=Upload Archive
+CMS_UPLOADARCHIVE_ASYNC=Process Asynchronously
CMS_BACKTOBROWSER=Back to Directory Browser
CMS_TRANSFER=Import/Export
CMS_EXPORTARCHIVE=Export Folder
16 years
JBoss Portal SVN: r10858 - branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-05-30 06:40:00 -0400 (Fri, 30 May 2008)
New Revision: 10858
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
Log:
[JBPORTAL-1997] - Fixing the Security Logic issue with the accessibility of the CMSAdminPortlet (merge missing from 2.6)
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-05-30 10:28:35 UTC (rev 10857)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-05-30 10:40:00 UTC (rev 10858)
@@ -1510,6 +1510,12 @@
if (portletRequest.getUserPrincipal() != null)
{
+ if(portletRequest.getUserPrincipal().getName().equals(this.authorizationManager.getProvider().getRoot().getUserName()))
+ {
+ return true;
+ }
+
+ //Not the Root User. so now make sure the Portlet is accessible to the User that is logged in
User user = this.userModule.findUserByUserName(portletRequest.getUserPrincipal().getName());
String uri = this.authorizationManager.getProvider().getUserURI(user.getUserName());
Collection permissions = this.authorizationManager.getProvider().getSecurityBindings(uri);
@@ -1527,6 +1533,25 @@
}
}
}
+ else
+ {
+ //Make sure based on permissions if the resources are accessible to the Anonymous user
+ String uri = this.authorizationManager.getProvider().getRoleURI(AuthorizationManager.Anonymous);
+ Collection permissions = this.authorizationManager.getProvider().getSecurityBindings(uri);
+ if (permissions != null)
+ {
+ for (Iterator itr = permissions.iterator(); itr.hasNext();)
+ {
+ Permission permission = (Permission)itr.next();
+ if ((permission.getService().equals("cms")) &&
+ (permission.getAction().equals("write") || permission.getAction().equals("manage"))
+ )
+ {
+ isPortletAccessible = true;
+ }
+ }
+ }
+ }
return isPortletAccessible;
}
16 years
JBoss Portal SVN: r10857 - in branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates: lostPassword and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-05-30 06:28:35 -0400 (Fri, 30 May 2008)
New Revision: 10857
Added:
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/changeEmail/emailTemplate_it.tpl
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate_it.tpl
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/register/emailTemplate_it.tpl
Log:
Italian l10n for email templates
Copied: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/changeEmail/emailTemplate_it.tpl (from rev 10851, branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/conf/templates/changeEmail/emailTemplate_it.tpl)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/changeEmail/emailTemplate_it.tpl (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/changeEmail/emailTemplate_it.tpl 2008-05-30 10:28:35 UTC (rev 10857)
@@ -0,0 +1,9 @@
+Ciao,
+
+Hai provato a cambiare il tuo indirizzo e-mail su ${emailDomain}
+
+Segui questo link per verificare il nuovo indirizzo:
+${activationLink}
+
+Saluti,
+${emailDomain}
Copied: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate_it.tpl (from rev 10851, branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate_it.tpl)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate_it.tpl (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate_it.tpl 2008-05-30 10:28:35 UTC (rev 10857)
@@ -0,0 +1,12 @@
+Ciao,
+
+abbiamo ricevuto la tua richiesta di resettare la password su ${emailDomain}.
+
+Ti mandiamo le informazioni per l'utenza:
+Username: ${username}
+Password: ${password}
+
+E' raccomandato che modifichi la password dopo il prossimo login.
+
+Saluti,
+${emailDomain}
Copied: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/register/emailTemplate_it.tpl (from rev 10851, branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/conf/templates/register/emailTemplate_it.tpl)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/register/emailTemplate_it.tpl (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/templates/register/emailTemplate_it.tpl 2008-05-30 10:28:35 UTC (rev 10857)
@@ -0,0 +1,15 @@
+Ciao,
+
+hai provato a creare un account su ${emailDomain}
+
+Ti mandiamo le informazioni per l'utenza:
+Username: ${username}
+Password: ${password}
+
+L'account non è ancora abilitato. Hai bisogno di accedere a questo url per abilitare l'account.
+${activationLink}
+
+Se non hai richiesto alcuna creazione, puoi ignorare il messaggio.
+
+Best regards,
+${emailDomain}
16 years
JBoss Portal SVN: r10856 - in branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF: jsp/cms and 2 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-05-30 06:26:19 -0400 (Fri, 30 May 2008)
New Revision: 10856
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_it.properties
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup_error.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/folderlist.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/securenode.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/help.jsp
Log:
- Core-CMS i18n, contribution from Luca
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-05-30 10:26:19 UTC (rev 10856)
@@ -96,4 +96,26 @@
CMS_PATH=Location
CMS_EMPTY_FOLDER=This folder is empty.
-
\ No newline at end of file
+
+CMS_ERROR_UPLOADARCHIVE_ASYNC=An error occurred while processing your archive. Please try again with 'Asynchronous Processing' activated
+CMS_MSG_UPLOADARCHIVE_ASYNC=Your archive has been accepted for processing. The resources will appear in your Folder once the processing is finished
+
+CMS_REQUIRED=Required
+CMS_LINK_TO_RESOURCES=Links to resources within this portal should be absolute. For example: A link to an image located in default/images/back.gif should be typed in exactly as shown here. Do not prefix a slash (/) to the path of the resource. You can verify the link is correct by clicking on the preview button in the editor
+CMS_ERROR_PROCESSING=ERROR processing export request
+CMS_YOUR_EXPORT_0=Your export of
+CMS_YOUR_EXPORT_1=is ready for download
+CMS_CLICK_TO_DOWNLOAD=Click to Download
+CMS_ROOT_FOLDER=Root Folder
+CMS_MESSAGES=Messages
+CMS_HOME=Home
+CMS_ERROR=Error
+CMS_PENDING_APPROVAL_QUEUE=Pending Approval Queue
+CMS_CONFIGURE_RESTRICTION=Configure security restrictions on node
+CMS_SELECT_ACTION=Select Action
+CMS_BROWSING=Browsing
+CMS_CONTENT_NOT_FOUND=Content could not be found for the selected file
+CMS_INTRODUCTION=Introduction
+CMS_HELP=The CMS Portlet displays content from the file store inside a portlet window, or, in the case of binary content, outside of the portlet window altogether
+CMS_TO_MODIFY=To modify how this portlet behaves, please
+CMS_CLICK_HERE=click here
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_it.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_it.properties 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_it.properties 2008-05-30 10:26:19 UTC (rev 10856)
@@ -96,4 +96,23 @@
CMS_PATH=Localit\u00e0
CMS_EMPTY_FOLDER=Questa cartella \u00e8 vuota .
-
\ No newline at end of file
+
+CMS_REQUIRED=Obbligatorio
+CMS_LINK_TO_RESOURCES=I link alle risorse all\'interno del portale devono essere assoluti. Per esempio: Un link a un\'immagine che si trova in in default/images/back.gif deve essere digitato esattamente come mostrato. Non iniziare mai il percorso con uno (/). Puoi verificare la correttezza del link cliccando sul bottone di anteprima dell1'editor
+CMS_ERROR_PROCESSING=ERRORE nel processare l\'esportazione
+CMS_YOUR_EXPORT_0=L\'esportazione di
+CMS_YOUR_EXPORT_1=\u00e8 pronta per il Download
+CMS_CLICK_TO_DOWNLOAD=Clicca per il Download
+CMS_ROOT_FOLDER=Cartella principale
+CMS_MESSAGES=Messaggi
+CMS_HOME=Home
+CMS_ERROR=Errore
+CMS_PENDING_APPROVAL_QUEUE=Coda in attesa di approvazione
+CMS_CONFIGURE_RESTRICTION=Configura le restrizioni di sicurezza sul nodo
+CMS_SELECT_ACTION=Seleziona l\'azione
+CMS_BROWSING=Navigazione
+CMS_CONTENT_NOT_FOUND=Non ci sono contenuti per il file selezionato
+CMS_INTRODUCTION=Introduzione
+CMS_HELP=La Portlet CMS visualizza e salva i contenuti di un file da dentro la finestra di una Portlet, o, nel caso di un contenuto binario, fuori della finestra
+CMS_TO_MODIFY=Per modificare il comportamento di questa Portlet,
+CMS_CLICK_HERE=clicca qui
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -27,7 +27,7 @@
<table>
<tr>
<td valign="bottom">
- Destination:
+ ${n:i18n("CMS_DESTINATION")}:
</td>
<td>
<input DISABLED type="text" size="40" name="showdestination" value="<%= sCurrPath %>"
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -119,7 +119,7 @@
<input
type="text" name="filename"
class="portlet-form-input-field"/>
- : Required
+ : ${n:i18n("CMS_REQUIRED")}
</td>
</tr>
<tr>
@@ -195,11 +195,7 @@
<tr>
<td class="portlet-section-alternate">
<img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/info.gif" border="0"
- alt="Info"> Links to resources within this portal should be absolute. For example: A link to an image
- located in default/images/back.gif
- should be typed in exactly as shown here.
- Do not prefix a slash (/) to the path of the resource. You can verify the link is correct by clicking on the
- preview button in the editor.
+ alt="Info"> ${n:i18n("CMS_LINK_TO_RESOURCES")}.
</td>
</tr>
<tr>
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -147,14 +147,7 @@
<td class="portlet-section-alternate">
<img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/info.gif"
border="0"
- alt="Info"> Links to resources within this portal should be absolute. For example: A link to an
- image
- located in default/images/back.gif
- should be typed in exactly as shown here.
- Do not prefix a slash (/) to the path of the resource. You can verify the link is correct by clicking
- on
- the
- preview button in the editor.
+ alt="Info"> ${n:i18n("CMS_LINK_TO_RESOURCES")}.
</td>
</tr>
<tr>
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -20,8 +20,8 @@
<table width="100%">
<tr>
<td align="center">
- Your export of <b><%= sCurrPath %>
- </b> is ready for download.
+ ${n:i18n("CMS_YOUR_EXPORT_0")} <b><%= sCurrPath %>
+ </b> ${n:i18n("CMS_YOUR_EXPORT_1")}.
</td>
</tr>
<tr>
@@ -32,7 +32,7 @@
<a href="<%= request.getContextPath() %>/cmsexport?og" target="_blank"><img
src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/export_pickup.gif"
alt="${n:i18n("CMS_DELETE")}" border="0"></a><br/>
- <a href="<%= request.getContextPath() %>/cmsexport?og" target="_blank">Click to Download</a>
+ <a href="<%= request.getContextPath() %>/cmsexport?og" target="_blank">${n:i18n("CMS_CLICK_TO_DOWNLOAD")}</a>
<br/>
<input class="portlet-form-button" type="button" value="${n:i18n("CMS_BACKTOBROWSER")}"
name="cancel"
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup_error.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup_error.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup_error.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -19,7 +19,7 @@
<td align="left">
<table width="100%">
<tr>
- <td align="center"><font color="red">ERROR processing export request!</font></td>
+ <td align="center"><font color="red">${n:i18n("CMS_ERROR_PROCESSING")}!</font></td>
</tr>
<tr>
<td align="center"><input class="portlet-form-button" type="button"
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/folderlist.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/folderlist.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/folderlist.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -40,7 +40,7 @@
<img src="<%= request.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH %>/plus.gif" border="0"
alt="Expand"/></a>
-<a href="javascript:fillform('/')">Root Folder</a><br>
+<a href="javascript:fillform('/')">${n:i18n("CMS_ROOT_FOLDER")}</a><br>
<%
String sNavPath = (String)request.getAttribute("navpath");
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -21,6 +21,7 @@
String createDate = "";
String modifiedDate = "";
Boolean manageWorkflowAccessible = (Boolean)request.getAttribute("manageWorkflowAccessible");
+ List messages = (List)request.getAttribute("messages");
%>
<div class="admin-ui">
@@ -31,12 +32,29 @@
<div class="cms-tab-container">
+<!-- Displaying any messages that may have occurred during this request -->
+<%if(messages != null && !messages.isEmpty()){%>
+<table width="100%">
+ <th colspan="2"><h3 class="sectionTitle-blue">${n:i18n("CMS_MESSAGES")}:</h3></th>
+ <%for(int i=0; i<messages.size(); i++){%>
+ <tr colspan="2" align="center">
+ <td colspan="2">
+ <font color="red">
+ <%=(String)messages.get(i)%>
+ </font>
+ </td>
+ </tr>
+ <%}%>
+</table>
+<br/><br/>
+<%}%>
+
<!-- Currently browsing -->
<ul class="objectpath">
<li class="pathItem"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
<portlet:param name="path" value="/"/>
- </portlet:renderURL>">Home</a></li>
+ </portlet:renderURL>">${n:i18n("CMS_HOME")}</a></li>
<%
@@ -319,4 +337,4 @@
%>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -30,7 +30,7 @@
<li class="pathItem"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
<portlet:param name="path" value="/"/>
- </portlet:renderURL>">Home</a></li>
+ </portlet:renderURL>">${n:i18n("CMS_HOME")}</a></li>
<%
@@ -72,7 +72,7 @@
{
%>
<table width="100%">
- <th colspan="2"><h3 class="sectionTitle-blue">Error:</h3></th>
+ <th colspan="2"><h3 class="sectionTitle-blue">${n:i18n("CMS_ERROR")}:</h3></th>
<tr colspan="2" align="center">
<td colspan="2">
<font color="red">
@@ -87,7 +87,7 @@
<%}%>
<!-- the table listing the pending queue items -->
-<div align="center"><font class="portlet-font-dim"><b>Pending Approval Queue</b></font></div>
+<div align="center"><font class="portlet-font-dim"><b>${n:i18n("CMS_PENDING_APPROVAL_QUEUE")}</b></font></div>
<br/>
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -24,7 +24,7 @@
<li class="pathItem"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
<portlet:param name="path" value="/"/>
- </portlet:renderURL>">Home</a></li>
+ </portlet:renderURL>">${n:i18n("CMS_HOME")}</a></li>
</ul>
<br/>
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/securenode.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/securenode.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/securenode.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -50,7 +50,7 @@
%>
<tr>
<td colspan="2">
- <font class="portlet-font">Configure security restrictions on node: <%= sCurrPath %>
+ <font class="portlet-font">${n:i18n("CMS_CONFIGURE_RESTRICTION")}: <%= sCurrPath %>
</font>
</td>
</tr>
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -57,7 +57,7 @@
<li class="pathItem"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
<portlet:param name="path" value="/"/>
- </portlet:renderURL>">Home</a></li>
+ </portlet:renderURL>">${n:i18n("CMS_HOME")}</a></li>
<%
@@ -109,7 +109,7 @@
<div class="menu">
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
- <option value="">Select Action...</option>
+ <option value="">${n:i18n("CMS_SELECT_ACTION")}...</option>
<%
if (sType.equals("text/html") || sType.equals("text/plain"))
{
@@ -349,7 +349,7 @@
{
%>
<table width="100%">
- <th colspan="2"><h3 class="sectionTitle-blue">Error:</h3></th>
+ <th colspan="2"><h3 class="sectionTitle-blue">${n:i18n("CMS_ERROR")}:</h3></th>
<tr colspan="2" align="center">
<td colspan="2">
<font color="red">
@@ -363,7 +363,7 @@
onclick="window.location='<portlet:renderURL><portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/><portlet:param name="path" value="/"/></portlet:renderURL>'">
<%}%>
-<div align="center"><font class="portlet-font-dim"><b>Pending Approval Queue</b></font></div>
+<div align="center"><font class="portlet-font-dim"><b>${n:i18n("CMS_PENDING_APPROVAL_QUEUE")}</b></font></div>
<br/>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -25,7 +25,7 @@
%>
<!-- Currently browsing -->
-Browsing: <a href="<%= url %>">Home</a>
+${n:i18n("CMS_BROWSING")}: <a href="<%= url %>">${n:i18n("CMS_HOME")}</a>
<%
StringTokenizer parser = new StringTokenizer(sCurrPath, "/");
String sPathBuilder = "";
@@ -138,7 +138,7 @@
</p>
<%}else{%>
<p class="portlet-font">
- Content could not be found for the selected file
+ ${n:i18n("CMS_CONTENT_NOT_FOUND")}
</p>
<%}%>
<%
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/help.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/help.jsp 2008-05-30 10:05:05 UTC (rev 10855)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/help.jsp 2008-05-30 10:26:19 UTC (rev 10856)
@@ -7,11 +7,9 @@
<h2>CMS Portlet - Help</h2>
-<h2>Introduction</h2>
+<h2>${n:i18n("CMS_INTRODUCTION")}</h2>
-<p class="portlet-font">The CMS Portlet displays content from the file store inside a portlet window, or, in the case of
- binary content, outside of the portlet
- window altogether.</p>
+<p class="portlet-font">${n:i18n("CMS_HELP")}.</p>
-<p class="portlet-font">To modify how this portlet behaves, please
- <a href="<portlet:renderURL portletMode="edit"></portlet:renderURL>">click here.</a></p>
+<p class="portlet-font">${n:i18n("CMS_TO_MODIFY")}
+ <a href="<portlet:renderURL portletMode="edit"></portlet:renderURL>">${n:i18n("CMS_CLICK_HERE")}.</a></p>
16 years
JBoss Portal SVN: r10855 - in branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF: jsp/content and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-05-30 06:05:05 -0400 (Fri, 30 May 2008)
New Revision: 10855
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/portlet.xml
Log:
i18n the content selector
Modified: branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp 2008-05-30 09:20:48 UTC (rev 10854)
+++ branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp 2008-05-30 10:05:05 UTC (rev 10855)
@@ -1,3 +1,4 @@
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
<%@ page import="org.jboss.portal.common.i18n.LocalizedString" %>
<%@ page import="org.jboss.portal.common.util.IteratorStatus" %>
<%@ page import="org.jboss.portal.core.model.instance.Instance" %>
@@ -4,19 +5,20 @@
<%@ page import="org.jboss.portal.core.portlet.info.PortletIconInfo" %>
<%@ page import="org.jboss.portal.core.portlet.info.PortletInfoInfo" %>
<%@ page import="org.jboss.portal.core.ui.content.portlet.PortletContentEditorPortlet" %>
-<%@ page language="java" %>
+<%@ page import="org.jboss.portal.portlet.Portlet" %>
+<%@ page import="org.jboss.portal.portlet.PortletInvokerException" %>
+<%@ page import="org.jboss.portal.portlet.info.MetaInfo" %>
+<%@ page import="org.jboss.portal.portlet.info.PortletInfo" %>
+<%@ page import="java.util.Collection" %>
+<%@ page import="java.util.Locale" %>
+
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%
Collection instances = (Collection)request.getAttribute("INSTANCES");
Instance selectedInstance = (Instance)request.getAttribute("SELECTED_INSTANCE");
%>
-<%@page import="org.jboss.portal.portlet.Portlet" %>
-<%@page import="org.jboss.portal.portlet.PortletInvokerException" %>
-<%@page import="org.jboss.portal.portlet.info.MetaInfo" %>
-<%@page import="org.jboss.portal.portlet.info.PortletInfo" %>
-<%@ page import="java.util.Collection" %>
-<%@ page import="java.util.Locale" %>
<portlet:defineObjects/>
<script type='text/javascript' src='/portal-admin/js/domLib.js'></script>
<script type="text/javascript" src="/portal-admin/js/fadomatic.js"></script>
@@ -62,7 +64,7 @@
<table style="width:500px;">
<tr>
- <td><h3 class="sectionTitle tenpx-top-bottom">Portlet instance associated to this window:</h3></td>
+ <td><h3 class="sectionTitle tenpx-top-bottom">${n:i18n("PORTLET_INSTANCE_ASSOCIATED")}:</h3></td>
</tr>
<%
Locale locale = renderRequest.getLocale();
@@ -95,10 +97,10 @@
<span><%= displayName %></span>
<div>
- <span class="portlet-form-field-label">Portlet name:</span><%= displayName %>
+ <span class="portlet-form-field-label">${n:i18n("PORTLET_NAME")}:</span><%= displayName %>
</div>
<div>
- <span class="portlet-form-field-label">Portlet description:</span>
+ <span class="portlet-form-field-label">${n:i18n("PORTLET_DESCRIPTION")}:</span>
<%= getLocalizedValue(metaInfo.getMetaValue(MetaInfo.DESCRIPTION), locale) %>
</div>
</td>
@@ -150,22 +152,22 @@
</div>
</div>
</div>
- <tr class="<%= rowClass %>">
- <td>
- <img src="<%= iconLocation %>" align="middle" style="margin:0 4px 0 0" alt="icon"/>
+ <tr class="<%= rowClass %>">
+ <td>
+ <img src="<%= iconLocation %>" align="middle" style="margin:0 4px 0 0" alt="icon"/>
<span
onmouseover="domTT_activate(this, event, 'content', document.getElementById('info-container-<%= displayName %>'),'delay', 0, 'trail', false, 'fade', 'both', 'fadeMax', 95, 'styleClass', 'none');"><a
href="javascript:void(0);" onclick="submitForm('<%= url %>');return false"
id="portlet-instance-link"><%= displayName %>
</a></span>
</td>
- </tr>
- <%
- }
- %>
- </table>
- </div>
- </td>
+ </tr>
+ <%
+ }
+ %>
+ </table>
+ </div>
+ </td>
</tr>
</table>
Modified: branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/portlet.xml 2008-05-30 09:20:48 UTC (rev 10854)
+++ branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/portlet.xml 2008-05-30 10:05:05 UTC (rev 10855)
@@ -37,6 +37,7 @@
<portlet-mode>VIEW</portlet-mode>
<portlet-mode>EDIT_CONTENT</portlet-mode>
</supports>
+ <resource-bundle>Resource</resource-bundle>
<portlet-info>
<title>Portlet Content Portlet</title>
<keywords>management,admin</keywords>
16 years
JBoss Portal SVN: r10854 - branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-05-30 05:20:48 -0400 (Fri, 30 May 2008)
New Revision: 10854
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/portlet.xml
Log:
- Fix portlet_editor i18n (Resource bundle definition was missing)
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/portlet.xml 2008-05-30 08:40:45 UTC (rev 10853)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/portlet.xml 2008-05-30 09:20:48 UTC (rev 10854)
@@ -120,6 +120,7 @@
<portlet-mode>VIEW</portlet-mode>
<portlet-mode>EDIT_CONTENT</portlet-mode>
</supports>
+ <resource-bundle>Resource</resource-bundle>
<portlet-info>
<title>Portlet Content Portlet</title>
<keywords>management,admin</keywords>
16 years