Author: thomas.heute(a)jboss.com
Date: 2008-10-08 07:21:41 -0400 (Wed, 08 Oct 2008)
New Revision: 12051
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxAction.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/Renderer.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/RendererContext.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/TemplateInfo.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/impl/
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/impl/XHTMLTemplateImpl.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/info/
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/info/CSSInfo.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/info/ThemeInfo.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/node/ActionNode.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIActionImpl.java
Removed:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/
Modified:
modules/presentation/trunk/.classpath
modules/presentation/trunk/ajax/pom.xml
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemote.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemoteAsync.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDController.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ObjectType.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/UpdateObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/OpaqueWindowAction.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Logger.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientImpl.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionEncoderContext.java
modules/presentation/trunk/build/pom.xml
modules/presentation/trunk/classic/src/assemble/presentation-war.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/ClassicPresentationServlet.java
modules/presentation/trunk/portal/pom.xml
modules/presentation/trunk/portal/src/assemble/presentation-portal-war.xml
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/jboss-beans.xml
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/web.xml
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletPageNavigationalState.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationPortletInvocationContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelImporter.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/servlet/ModelImportTrigger.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/UIWindowImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/NavigationalStateContextImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/SessionNavigationalStateContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/SimpleNavigationalStateContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ViewPortScope.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIAction.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIWindow.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/LinkActivation.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServerException.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/NoSuchStateException.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StaleStateException.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StateChangeVetoException.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StateException.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/view/PageViewPortScope.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/MoveChildTestCase.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildTestCase.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/TypeTestCase.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/UpdateObjectTestCase.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/AbstractStructuralStateContextTestCase.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/mock/MockException.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/mock/impl/StructuralObjectImpl.java
Log:
(Backup)
- Upgraded GWT
- Removed Warnings
- Added Action support (model is hard-filled with a single action)
- JBoss 5 support
Modified: modules/presentation/trunk/.classpath
===================================================================
--- modules/presentation/trunk/.classpath 2008-10-08 11:18:48 UTC (rev 12050)
+++ modules/presentation/trunk/.classpath 2008-10-08 11:21:41 UTC (rev 12051)
@@ -2,18 +2,10 @@
<classpath>
<classpathentry kind="src" output="presentation/target/classes"
path="presentation/src/main/java"/>
<classpathentry kind="src"
output="presentation/target/test-classes"
path="presentation/src/test/java"/>
- <classpathentry excluding="**" kind="src"
output="presentation/target/classes"
path="presentation/src/main/resources"/>
<classpathentry kind="src" output="classic/target/classes"
path="classic/src/main/java"/>
- <classpathentry kind="src" output="classic/target/test-classes"
path="classic/src/test/java"/>
- <classpathentry excluding="**" kind="src"
output="classic/target/classes"
path="classic/src/main/resources"/>
- <classpathentry excluding="**" kind="src"
output="classic/target/test-classes"
path="classic/src/test/resources"/>
<classpathentry kind="src" output="ajax/target/classes"
path="ajax/src/main/java"/>
- <classpathentry kind="src" output="ajax/target/test-classes"
path="ajax/src/test/java"/>
- <classpathentry excluding="**" kind="src"
output="ajax/target/classes" path="ajax/src/main/resources"/>
- <classpathentry excluding="**" kind="src"
output="ajax/target/test-classes" path="ajax/src/test/resources"/>
<classpathentry kind="src" output="portal/target/classes"
path="portal/src/main/java"/>
<classpathentry kind="src" output="portal/target/test-classes"
path="portal/src/test/java"/>
- <classpathentry excluding="**" kind="src"
output="portal/target/classes" path="portal/src/main/resources"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con"
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: modules/presentation/trunk/ajax/pom.xml
===================================================================
--- modules/presentation/trunk/ajax/pom.xml 2008-10-08 11:18:48 UTC (rev 12050)
+++ modules/presentation/trunk/ajax/pom.xml 2008-10-08 11:21:41 UTC (rev 12051)
@@ -28,9 +28,20 @@
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.portal.common</groupId>
<artifactId>common-common</artifactId>
</dependency>
@@ -117,12 +128,12 @@
</activation>
<properties>
<gwt.os>linux</gwt.os>
-
<gwt.compiler.classpath>${maven.dependency.com.google.gwt.gwt-dev-linux.jar.path}</gwt.compiler.classpath>
+
<gwt.compiler.classpath>${maven.dependency.com.google.gwt.gwt-dev.jar.path}</gwt.compiler.classpath>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
- <artifactId>gwt-dev-linux</artifactId>
+ <artifactId>gwt-dev</artifactId>
<version>${version.gwt}</version>
<scope>package</scope>
</dependency>
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -82,7 +82,7 @@
log.info("About to perform action " + action);
//
- agent.getProxy().process(request, new AsyncCallback()
+ agent.getProxy().process(request, new AsyncCallback<Object>()
{
public void onFailure(Throwable throwable)
{
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,24 +22,22 @@
******************************************************************************/
package org.jboss.portal.presentation.ajax.client;
+import org.jboss.portal.presentation.ajax.client.model.AjaxObject;
+import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
+import org.jboss.portal.presentation.ajax.client.util.Bootstrap;
+import org.jboss.portal.presentation.ajax.client.util.logging.AppenderWidget;
+import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
+
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.AbsolutePanel;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Timer;
-import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
-import org.jboss.portal.presentation.ajax.client.model.AjaxObject;
-import org.jboss.portal.presentation.ajax.client.util.Bootstrap;
-import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
-import org.jboss.portal.presentation.ajax.client.util.logging.AppenderWidget;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+import com.google.gwt.user.client.ui.AbsolutePanel;
+import com.google.gwt.user.client.ui.RootPanel;
-import java.util.Map;
-import java.util.HashMap;
-
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
@@ -51,9 +49,6 @@
private static final Logger log = Logger.getLogger(PresentationClientAgent.class);
/** . */
- private Map pages = new HashMap();
-
- /** . */
private PresentationClientRemoteAsync proxy;
private final AppenderWidget appender = new AppenderWidget();
@@ -99,13 +94,8 @@
String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
endpoint.setServiceEntryPoint(moduleRelativeURL);
-
-
-
-
-
//
- AsyncCallback callback = new AsyncCallback()
+ AsyncCallback<Object> callback = new AsyncCallback<Object>()
{
public void onFailure(Throwable throwable)
{
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemote.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemote.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemote.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -38,7 +38,7 @@
/**
* Returns the set of updates for the root.
*
- * @return the set of updatees to populate the root
+ * @return the set of updates to populate the root
*/
ModelUpdate[] getRoot();
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemoteAsync.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemoteAsync.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemoteAsync.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -32,9 +32,9 @@
public interface PresentationClientRemoteAsync
{
- void getRoot(AsyncCallback async);
+ void getRoot(AsyncCallback<Object> async);
- void render(String windowId, AsyncCallback async);
+ void render(String windowId, AsyncCallback<Object> async);
- void process(AjaxRequest request, AsyncCallback async);
+ void process(AjaxRequest request, AsyncCallback<Object> async);
}
\ No newline at end of file
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -40,7 +40,7 @@
* @param y the y position
* @return an iterator of draggables
*/
- Iterator getDraggables(int x, int y);
+ Iterator<Draggable> getDraggables(int x, int y);
/**
* Returns an iterator of droppables found under the specifed coordinates.
@@ -49,7 +49,7 @@
* @param y the y position
* @return an iterator of droppables
*/
- Iterator findDroppable(int x, int y);
+ Iterator<Droppable> findDroppable(int x, int y);
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDController.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDController.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDController.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -84,7 +84,7 @@
private Draggable findDraggable(int x, int y)
{
- Iterator draggables = context.getDraggables(x, y);
+ Iterator<Draggable> draggables = context.getDraggables(x, y);
if (draggables.hasNext())
{
return (Draggable)draggables.next();
@@ -97,7 +97,7 @@
private Droppable findDroppable(int x, int y)
{
- Iterator droppables = context.findDroppable(x, y);
+ Iterator<Droppable> droppables = context.findDroppable(x, y);
//
while (droppables.hasNext())
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -30,7 +30,6 @@
import com.google.gwt.user.client.Window;
import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
-import java.util.List;
import java.util.Iterator;
/**
@@ -81,7 +80,7 @@
private Draggable findDraggable(int x, int y)
{
- Iterator draggables = context.getDraggables(x, y);
+ Iterator<Draggable> draggables = context.getDraggables(x, y);
if (draggables.hasNext())
{
return (Draggable)draggables.next();
@@ -94,7 +93,7 @@
private Droppable findDroppable(int x, int y)
{
- Iterator droppables = context.findDroppable(x, y);
+ Iterator<Droppable> droppables = context.findDroppable(x, y);
//
while (droppables.hasNext())
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxAction.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxAction.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxAction.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * 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.ajax.client.model;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import org.jboss.portal.presentation.ajax.client.dnd.Draggable;
+import org.jboss.portal.presentation.ajax.client.dnd.Droppable;
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class AjaxAction extends AjaxObject
+{
+
+ private Widget widget;
+
+ protected AjaxAction(String id, Map<String, Serializable> properties)
+ {
+ super(id, properties);
+ }
+
+ @Override
+ protected void doAddChild(AjaxObject child)
+ {
+ }
+
+ @Override
+ protected void doCreateWidget()
+ {
+ widget = new Label(getPropertyValue("displayName").toString());
+ widget.setStyleName("pf-Title");
+
+ }
+
+ @Override
+ protected void doDestroyWidget()
+ {
+ }
+
+ @Override
+ protected Draggable doFindDraggable(int x, int y)
+ {
+ return null;
+ }
+
+ @Override
+ protected Droppable doFindDroppable(int x, int y)
+ {
+ return null;
+ }
+
+ @Override
+ protected void doRefresh(boolean force)
+ {
+ }
+
+ @Override
+ protected void doRemoveChild(AjaxObject child)
+ {
+ }
+
+ @Override
+ public Widget getWidget()
+ {
+ return widget;
+ }
+
+}
+
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -27,6 +27,7 @@
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;
+import java.io.Serializable;
import java.util.Iterator;
import java.util.Map;
@@ -45,7 +46,7 @@
/** . */
private Panel layout;
- public AjaxLayout(String id, Map properties)
+ public AjaxLayout(String id, Map<String, Serializable> properties)
{
super(id, properties);
}
@@ -57,7 +58,7 @@
parent.remove(layout);
//
- for (Iterator i = layout.iterator();i.hasNext();)
+ for (Iterator<Widget> i = layout.iterator();i.hasNext();)
{
Widget child = (Widget)i.next();
@@ -100,7 +101,7 @@
layout.setStyleName("pf-Layout");
//
- for (Iterator i = getChildren().iterator();i.hasNext();)
+ for (Iterator<AjaxObject> i = getChildren().iterator();i.hasNext();)
{
AjaxObject child = (AjaxObject)i.next();
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -24,6 +24,7 @@
import com.google.gwt.user.client.ui.Widget;
+import java.io.Serializable;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
@@ -57,10 +58,10 @@
private final String id;
/** . */
- private Map children;
+ private Map<String, AjaxObject> children;
/** . */
- private Map properties;
+ private Map<String, Serializable> properties;
/** . */
private AjaxObject parent;
@@ -71,10 +72,10 @@
/** . */
protected final Logger log;
- protected AjaxObject(String id, Map properties)
+ protected AjaxObject(String id, Map<String, Serializable> properties)
{
this.id = id;
- this.children = new HashMap();
+ this.children = new HashMap<String, AjaxObject>();
this.properties = properties;
this.stale = true;
this.log = Logger.getLogger("AjaxObject." + id);
@@ -82,7 +83,7 @@
public final void createWidget()
{
- for (Iterator i = children.values().iterator();i.hasNext();)
+ for (Iterator<AjaxObject> i = children.values().iterator();i.hasNext();)
{
AjaxObject child = (AjaxObject)i.next();
@@ -99,7 +100,7 @@
doDestroyWidget();
//
- for (Iterator i = children.values().iterator();i.hasNext();)
+ for (Iterator<AjaxObject> i = children.values().iterator();i.hasNext();)
{
AjaxObject child = (AjaxObject)i.next();
@@ -110,7 +111,7 @@
private void refreshRecursive(boolean force)
{
- for (Iterator i = getChildren().iterator();i.hasNext();)
+ for (Iterator<AjaxObject> i = getChildren().iterator();i.hasNext();)
{
AjaxObject child = (AjaxObject)i.next();
@@ -134,9 +135,9 @@
}
}
- public final void findDraggabble(List draggables, int x, int y)
+ public final void findDraggabble(List<Draggable> draggables, int x, int y)
{
- for (Iterator i = getChildren().iterator();i.hasNext();)
+ for (Iterator<AjaxObject> i = getChildren().iterator();i.hasNext();)
{
AjaxObject child = (AjaxObject)i.next();
@@ -154,9 +155,9 @@
}
}
- public final void findDroppable(List droppables, int x, int y)
+ public final void findDroppable(List<Droppable> droppables, int x, int y)
{
- for (Iterator i = getChildren().iterator();i.hasNext();)
+ for (Iterator<AjaxObject> i = getChildren().iterator();i.hasNext();)
{
AjaxObject child = (AjaxObject)i.next();
@@ -222,7 +223,7 @@
return context;
}
- public final Collection getChildren()
+ public final Collection<AjaxObject> getChildren()
{
return children.values();
}
@@ -265,7 +266,7 @@
private final Logger log = Logger.getLogger(Context.class);
/** All the known objects. */
- private final Map objects;
+ private final Map<String, AjaxObject> objects;
/** . */
private AjaxPage root;
@@ -276,7 +277,7 @@
public Context(AgentContext agentContext)
{
this.agentContext = agentContext;
- this.objects = new HashMap();
+ this.objects = new HashMap<String, AjaxObject>();
}
public AgentContext getAgentContext()
@@ -332,6 +333,9 @@
case ObjectType.WINDOW:
object = new AjaxWindow(addObject.getObjectId(),
addObject.getObjectProperties());
break;
+ case ObjectType.ACTION:
+ object = new AjaxAction(addObject.getObjectId(),
addObject.getObjectProperties());
+ break;
case ObjectType.PANE:
object = new AjaxPane(addObject.getObjectId(),
addObject.getObjectProperties());
break;
@@ -340,9 +344,6 @@
// Wire to the context
objects.put(addObject.getObjectId(), object);
object.context = this;
-
- // We create the widget
- object.createWidget();
}
else if (update instanceof UpdateObject)
{
@@ -410,6 +411,24 @@
log.debug("Destroyed object " + removeObject.getObjectId());
}
}
+
+ // All objects and children are created, lets create the widgets
+ for (int i = 0; i < updates.length;i++)
+ {
+ ModelUpdate update = updates[i];
+ //
+ log.debug("Executing widget creation " + update);
+
+ //
+ if (update instanceof AddObject)
+ {
+ AddObject addObject = (AddObject)update;
+ AjaxObject object = objects.get(addObject.getObjectId());
+
+ // We create the widget
+ object.createWidget();
+ }
+ }
}
}
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -26,6 +26,7 @@
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
+import java.io.Serializable;
import java.util.Map;
import java.util.Iterator;
import java.util.List;
@@ -34,6 +35,7 @@
import org.jboss.portal.presentation.ajax.client.dnd.DnDController;
import org.jboss.portal.presentation.ajax.client.dnd.DnDContext;
import org.jboss.portal.presentation.ajax.client.dnd.Draggable;
+import org.jboss.portal.presentation.ajax.client.dnd.Droppable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -48,7 +50,7 @@
/** . */
private DnDController dndController;
- public AjaxPage(String id, Map properties)
+ public AjaxPage(String id, Map<String, Serializable> properties)
{
super(id, properties);
}
@@ -98,16 +100,16 @@
private final DnDContext dndContext = new DnDContext()
{
- public Iterator getDraggables(int x, int y)
+ public Iterator<Draggable> getDraggables(int x, int y)
{
- List draggables = new ArrayList();
+ List<Draggable> draggables = new ArrayList<Draggable>();
AjaxPage.this.findDraggabble(draggables, x, y);
return draggables.iterator();
}
- public Iterator findDroppable(int x, int y)
+ public Iterator<Droppable> findDroppable(int x, int y)
{
- List droppables = new ArrayList();
+ List<Droppable> droppables = new ArrayList<Droppable>();
AjaxPage.this.findDroppable(droppables, x, y);
return droppables.iterator();
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -26,6 +26,7 @@
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.Element;
+import java.io.Serializable;
import java.util.Map;
import java.util.Iterator;
@@ -99,7 +100,7 @@
/** . */
private Draggable draggable;
- public AjaxPane(String id, Map properties)
+ public AjaxPane(String id, Map<String, Serializable> properties)
{
super(id, properties);
@@ -119,7 +120,7 @@
protected Draggable doFindDraggable(int x, int y)
{
// Let's not shadow any widget
- for (Iterator i = getChildren().iterator();i.hasNext();)
+ for (Iterator<AjaxObject> i = getChildren().iterator();i.hasNext();)
{
AjaxObject child = (AjaxObject)i.next();
Widget childWidget = child.getWidget();
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -44,6 +44,8 @@
import org.jboss.portal.presentation.ajax.client.util.Tools;
import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
+import java.io.Serializable;
+import java.util.Collection;
import java.util.Map;
import java.util.HashMap;
@@ -58,9 +60,6 @@
private static final Logger log = Logger.getLogger(AjaxWindow.class);
/** . */
- private MetaWidget meta;
-
- /** . */
private Label title;
/** . */
@@ -125,7 +124,7 @@
}
}
- public AjaxWindow(String id, Map properties)
+ public AjaxWindow(String id, Map<String, Serializable> properties)
{
super(id, properties);
@@ -158,12 +157,19 @@
getContext().getAgentContext().process(new DestroyObjectAction(getId()));
}
});
-// MetaWidget meta = new MetaWidget(this);
-
- //
-// meta.add(title);
-// widget.add(meta);
+
widget.add(title);
+
+ Collection<AjaxObject> children = getChildren();
+
+ // Create Action links
+ for (AjaxObject object: children)
+ {
+ AjaxAction action = (AjaxAction) object;
+ Widget actionWidget = action.getWidget();
+ widget.add(actionWidget);
+ }
+
widget.add(close);
widget.add(markup);
@@ -239,38 +245,11 @@
{
log.info("Form found");
String uri = DOM.getElementAttribute(current, "action");
- Map form = new HashMap();
+ Map<String, String[]> form = new HashMap<String,
String[]>();
Tools.serialize(current, form);
windowAction = new OpaqueWindowAction(uri, form);
-
-
- /*
- var enctype = current.enctype
-
- // We don't handle file upload for now
- if (enctype != "multipart/form-data") {
-
- // Check it is a POST
- if (current.method.toLowerCase() == "post") {
-
- // Check we can handle this URL
- if (isURLAccepted(current.action)) {
-
- // Set URL
- url = current.action;
-
- // Set the specified enctype
- options.enctype = enctype;
- options.asynchronous = false;
- options.method = "post"
- options.postBody = Form.serialize(current);
- }
}
}
- }
- */
- }
- }
//
if (windowAction != null)
@@ -315,7 +294,7 @@
String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
endpoint.setServiceEntryPoint(moduleRelativeURL);
- AsyncCallback callback = new AsyncCallback()
+ AsyncCallback<Object> callback = new AsyncCallback<Object>()
{
public void onFailure(Throwable throwable)
{
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddObject.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddObject.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddObject.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.ajax.client.model.update;
+import java.io.Serializable;
import java.util.Map;
import java.util.Iterator;
@@ -39,13 +40,13 @@
private int objectType;
/** . */
- private Map objectProperties;
+ private Map<String, Serializable> objectProperties;
public AddObject()
{
}
- public AddObject(String objectId, int objectType, Map objectProperties)
+ public AddObject(String objectId, int objectType, Map<String, Serializable>
objectProperties)
{
this.objectId = objectId;
this.objectType = objectType;
@@ -72,12 +73,12 @@
this.objectType = objectType;
}
- public Map getObjectProperties()
+ public Map<String, Serializable> getObjectProperties()
{
return objectProperties;
}
- public void setObjectProperties(Map objectProperties)
+ public void setObjectProperties(Map<String, Serializable> objectProperties)
{
this.objectProperties = objectProperties;
}
@@ -92,9 +93,9 @@
if (objectProperties != null)
{
tmp.append('{');
- for (Iterator i = objectProperties.entrySet().iterator();i.hasNext();)
+ for (Iterator<Map.Entry<String, Serializable>> i =
objectProperties.entrySet().iterator();i.hasNext();)
{
- Map.Entry entry = (Map.Entry)i.next();
+ Map.Entry<String, Serializable> entry = i.next();
String key = (String)entry.getKey();
Object value = entry.getValue();
tmp.append(key).append('=').append(value);
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ObjectType.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ObjectType.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ObjectType.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -39,6 +39,10 @@
public static final int WINDOW = 2;
/** . */
- public static final int PANE = 3;
+ public static final int ACTION = 3;
+ /** . */
+ public static final int PANE = 4;
+
+
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/UpdateObject.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/UpdateObject.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/UpdateObject.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.ajax.client.model.update;
+import java.io.Serializable;
import java.util.Set;
import java.util.Map;
@@ -36,15 +37,15 @@
private String objectId;
/** . */
- private Set removedProperties;
+ private Set<String> removedProperties;
/** . */
- private Map updatedProperties;
+ private Map<String, Serializable> updatedProperties;
/** . */
- private Map addedProperties;
+ private Map<String, Serializable> addedProperties;
- public UpdateObject(String objectId, Set removedProperties, Map updatedProperties, Map
addedProperties)
+ public UpdateObject(String objectId, Set<String> removedProperties,
Map<String, Serializable> updatedProperties, Map<String, Serializable>
addedProperties)
{
this.objectId = objectId;
this.removedProperties = removedProperties;
@@ -66,32 +67,32 @@
this.objectId = objectId;
}
- public Set getRemovedProperties()
+ public Set<String> getRemovedProperties()
{
return removedProperties;
}
- public void setRemovedProperties(Set removedProperties)
+ public void setRemovedProperties(Set<String> removedProperties)
{
this.removedProperties = removedProperties;
}
- public Map getUpdatedProperties()
+ public Map<String, Serializable> getUpdatedProperties()
{
return updatedProperties;
}
- public void setUpdatedProperties(Map updatedProperties)
+ public void setUpdatedProperties(Map<String, Serializable> updatedProperties)
{
this.updatedProperties = updatedProperties;
}
- public Map getAddedProperties()
+ public Map<String, Serializable> getAddedProperties()
{
return addedProperties;
}
- public void setAddedProperties(Map addedProperties)
+ public void setAddedProperties(Map<String, Serializable> addedProperties)
{
this.addedProperties = addedProperties;
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/OpaqueWindowAction.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/OpaqueWindowAction.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/OpaqueWindowAction.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -35,13 +35,13 @@
private String uri;
/** . */
- private Map form;
+ private Map<String, String[]> form;
public OpaqueWindowAction()
{
}
- public OpaqueWindowAction(String uri, Map form)
+ public OpaqueWindowAction(String uri, Map<String, String[]> form)
{
this.uri = uri;
this.form = form;
@@ -57,12 +57,12 @@
this.uri = uri;
}
- public Map getForm()
+ public Map<String, String[]> getForm()
{
return form;
}
- public void setForm(Map form)
+ public void setForm(Map<String, String[]> form)
{
this.form = form;
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -54,11 +54,11 @@
}
/** . */
- private ArrayList listeners;
+ private ArrayList<ElementListener> listeners;
private Bootstrap()
{
- listeners = new ArrayList();
+ listeners = new ArrayList<ElementListener>();
}
private void perform()
@@ -71,11 +71,12 @@
public void addListener(ElementListener listener)
{
- ArrayList copy = new ArrayList(listeners);
+ ArrayList<ElementListener> copy = new
ArrayList<ElementListener>(listeners);
copy.add(listener);
listeners = copy;
}
+ @SuppressWarnings("unused")
private static void handle(Event event, Element element)
{
DOM.eventPreventDefault(event);
@@ -90,6 +91,7 @@
// }
}
+ @SuppressWarnings("unused")
private static void handle(Element element)
{
log.info("Element " + element + " clicked");
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -74,7 +74,7 @@
/**
* Serialize a form.
*/
- public static void serialize(Element element, Map map)
+ public static void serialize(Element element, Map<String, String[]> map)
{
String tag = getTagName(element);
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Logger.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Logger.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Logger.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -40,10 +40,10 @@
private static final String PREFIX =
"org.jboss.portal.presentation.ajax.client.";
/** . */
- private static final Map loggers = new HashMap();
+ private static final Map<String, Logger> loggers = new HashMap<String,
Logger>();
/** . */
- private static final Set appenders = new HashSet();
+ private static final Set<Appender> appenders = new HashSet<Appender>();
/**
* Returns a logger.
@@ -79,6 +79,7 @@
* @return the logger
* @throws IllegalArgumentException if the clazz argument is null
*/
+ @SuppressWarnings("unchecked")
public static Logger getLogger(Class clazz) throws IllegalArgumentException
{
if (clazz == null)
@@ -137,7 +138,7 @@
Date now = new Date();
//
- for (Iterator i = appenders.iterator();i.hasNext();)
+ for (Iterator<Appender> i = appenders.iterator();i.hasNext();)
{
Appender appender = (Appender)i.next();
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css 2008-10-08
11:21:41 UTC (rev 12051)
@@ -23,7 +23,7 @@
}
.pf-Pane {
-border: 1px solid black;
+border: 1px solid pink;
padding: 1px;
}
@@ -32,7 +32,7 @@
}
.pf-Window {
-border: 1px solid black;
+border: 1px solid ;
padding: 1px;
}
@@ -53,7 +53,7 @@
}
.pf-Layout {
-border: 1px solid black;
+border: 1px solid purple;
padding: 1px;
}
@@ -62,6 +62,6 @@
}
.pf-Pane {
-border: 1px solid black;
+border: 1px solid violet;
padding: 1px;
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientImpl.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientImpl.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientImpl.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,21 +22,20 @@
******************************************************************************/
package org.jboss.portal.presentation.ajax.server;
+import java.io.IOException;
+import java.io.Writer;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.jboss.portal.common.servlet.URLFormat;
+import org.jboss.portal.presentation.ajax.server.protocol.AjaxActionEncoderContext;
import org.jboss.portal.presentation.client.PresentationClient;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-import org.jboss.portal.presentation.protocol.ProtocolAction;
-import org.jboss.portal.presentation.protocol.codec.ActionEncoder;
-import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextImpl;
import
org.jboss.portal.presentation.impl.state.navigational.DelegatingNavigationalStateContext;
import
org.jboss.portal.presentation.impl.state.navigational.SessionNavigationalStateContext;
-import org.jboss.portal.presentation.ajax.server.protocol.AjaxActionEncoderContext;
+import org.jboss.portal.presentation.protocol.ProtocolAction;
+import org.jboss.portal.presentation.protocol.codec.ActionEncoder;
import org.jboss.portal.web.ServletContextDispatcher;
-import org.jboss.portal.common.servlet.URLFormat;
-import javax.servlet.http.HttpServletRequest;
-import java.io.Writer;
-import java.io.IOException;
-
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -56,6 +56,7 @@
import org.jboss.portal.web.Body;
import org.jboss.portal.web.impl.DefaultServletContainerFactory;
import org.jboss.portal.common.http.QueryStringParser;
+import org.jboss.portal.common.mc.bootstrap.WebBootstrap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -69,6 +70,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
+@SuppressWarnings("serial")
public class PresentationClientServlet extends RemoteServiceServlet implements
PresentationClientRemote
{
@@ -103,7 +105,7 @@
private PresentationServer getPresentationServer()
{
- return
(PresentationServer)getServletContext().getAttribute("PresentationServer");
+ return
(PresentationServer)getServletContext().getAttribute(WebBootstrap.BEAN_PREFIX +
"PresentationServer");
}
private PresentationClientImpl createPresentationClient()
@@ -112,7 +114,7 @@
HttpServletResponse resp = getThreadLocalResponse();
ServletContainer container =
DefaultServletContainerFactory.getInstance().getServletContainer();
ServletContextDispatcher dispatcher = new ServletContextDispatcher(req, resp,
container);
- ActionEncoder encoder =
(ActionEncoder)getServletContext().getAttribute("ActionEncoder");
+ ActionEncoder encoder =
(ActionEncoder)getServletContext().getAttribute(WebBootstrap.BEAN_PREFIX +
"ActionEncoder");
return new PresentationClientImpl(req, dispatcher, encoder);
}
@@ -149,7 +151,7 @@
AjaxAction ajaxAction = request.getAction();
//
- ActionDecoder decoder =
(ActionDecoder)getServletContext().getAttribute("ActionDecoder");
+ ActionDecoder decoder =
(ActionDecoder)getServletContext().getAttribute(WebBootstrap.BEAN_PREFIX +
"ActionDecoder");
//
System.out.println("handling action " + ajaxAction);
@@ -181,7 +183,7 @@
}
//
- Map form = windowAction.getForm();
+ Map<String, String[]> form = windowAction.getForm();
if (form != null)
{
body = new Body.Form("UTF8", form);
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -24,6 +24,7 @@
import org.jboss.portal.presentation.model.ViewPortContext;
import org.jboss.portal.presentation.model.UIObjectContext;
+import org.jboss.portal.presentation.model.ui.UIAction;
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
import org.jboss.portal.presentation.model.ui.UIWindow;
@@ -102,6 +103,10 @@
{
objectType = ObjectType.WINDOW;
}
+ else if (UIAction.class.isAssignableFrom(type))
+ {
+ objectType = ObjectType.ACTION;
+ }
else if (UILayout.class.isAssignableFrom(type))
{
objectType = ObjectType.PANE;
@@ -120,9 +125,9 @@
{
updates.add(new UpdateObject(
objectId,
- new HashSet(removedProperties),
- new HashMap(updatedProperties),
- new HashMap(addedProperties)
+ new HashSet<String>(removedProperties),
+ new HashMap<String, Serializable>(updatedProperties),
+ new HashMap<String, Serializable>(addedProperties)
));
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionEncoderContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionEncoderContext.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionEncoderContext.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -49,7 +49,7 @@
boolean first = true;
if (parameters != null)
{
- for (Map.Entry parameter: parameters.entrySet())
+ for (Map.Entry<String, String[]> parameter: parameters.entrySet())
{
String name = (String)parameter.getKey();
Modified: modules/presentation/trunk/build/pom.xml
===================================================================
--- modules/presentation/trunk/build/pom.xml 2008-10-08 11:18:48 UTC (rev 12050)
+++ modules/presentation/trunk/build/pom.xml 2008-10-08 11:21:41 UTC (rev 12051)
@@ -28,11 +28,11 @@
<version.apache-log4j>1.2.8</version.apache-log4j>
<version.junit>3.8.1</version.junit>
<version.httpunit>1.6</version.httpunit>
- <version.gwt>1.4.60</version.gwt>
+ <version.gwt>1.5.1</version.gwt>
<version.portlet-api>2.0</version.portlet-api>
- <version.jboss.portal.common>1.2.0</version.jboss.portal.common>
+ <version.jboss.portal.common>1.2-SNAPSHOT</version.jboss.portal.common>
<version.jboss.portal.portlet>2.1.0-SNAPSHOT</version.jboss.portal.portlet>
<version.jboss.portal.web>1.2.0</version.jboss.portal.web>
<version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
@@ -115,11 +115,17 @@
<dependency>
<groupId>com.google.gwt</groupId>
- <artifactId>gwt-dev-mac</artifactId>
+ <artifactId>gwt-servlet</artifactId>
<version>${version.gwt}</version>
</dependency>
<dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${version.gwt}</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>${version.portlet-api}</version>
Modified: modules/presentation/trunk/classic/src/assemble/presentation-war.xml
===================================================================
--- modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-10-08
11:18:48 UTC (rev 12050)
+++ modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-10-08
11:21:41 UTC (rev 12051)
@@ -38,7 +38,9 @@
<include>javax.portlet:portlet-api</include>
<include>org.jboss:jboss-common-core</include>
+ <!--
<include>org.jboss.microcontainer:jboss-kernel</include>
+ -->
<include>org.jboss.microcontainer:jboss-dependency</include>
<include>org.jboss:jboss-reflect</include>
<include>org.jboss:jboss-mdr</include>
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-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,60 +22,49 @@
******************************************************************************/
package org.jboss.portal.presentation.classic;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.io.SerializationFilter;
+import org.jboss.portal.common.servlet.URLFormat;
+import org.jboss.portal.common.util.Base64;
import org.jboss.portal.presentation.classic.protocol.ClassicActionDecoderContext;
import org.jboss.portal.presentation.classic.protocol.ClassicActionEncoderContext;
-import org.jboss.portal.presentation.view.PageViewPortScope;
-import org.jboss.portal.presentation.protocol.codec.ActionDecoder;
-import org.jboss.portal.presentation.protocol.codec.ActionDecoderContext;
-import org.jboss.portal.presentation.protocol.codec.ActionEncoder;
-import org.jboss.portal.presentation.protocol.codec.ActionEncoderContext;
+import org.jboss.portal.presentation.classic.theme.Renderer;
+import org.jboss.portal.presentation.classic.theme.RendererContext;
+import org.jboss.portal.presentation.classic.theme.TemplateInfo;
+import org.jboss.portal.presentation.classic.theme.impl.XHTMLTemplateImpl;
+import org.jboss.portal.presentation.classic.theme.info.ThemeInfo;
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.impl.model.UIModelImpl;
-import org.jboss.portal.presentation.impl.model.pull.DetachedViewPortContext;
import org.jboss.portal.presentation.impl.model.pull.DetachedUINode;
+import org.jboss.portal.presentation.impl.model.pull.DetachedViewPortContext;
import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextImpl;
import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextSerialization;
import org.jboss.portal.presentation.model.UIModel;
-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.UINode;
-import org.jboss.portal.presentation.layout.LayoutFactory;
-import org.jboss.portal.presentation.layout.Layout;
-import org.jboss.portal.presentation.layout.SimpleLayout;
-import org.jboss.portal.presentation.layout.Orientation;
-import org.jboss.portal.presentation.layout.ModelLayoutAdapter;
-import org.jboss.portal.presentation.content.ContentFragment;
-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.UILayout;
import org.jboss.portal.presentation.protocol.ProtocolAction;
import org.jboss.portal.presentation.protocol.ProtocolResponse;
import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
-import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
+import org.jboss.portal.presentation.protocol.codec.ActionDecoder;
+import org.jboss.portal.presentation.protocol.codec.ActionDecoderContext;
+import org.jboss.portal.presentation.protocol.codec.ActionEncoder;
+import org.jboss.portal.presentation.protocol.codec.ActionEncoderContext;
import org.jboss.portal.presentation.server.PresentationRequest;
import org.jboss.portal.presentation.server.PresentationResponse;
import org.jboss.portal.presentation.server.PresentationServer;
import org.jboss.portal.presentation.server.PresentationServerException;
import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.view.PageViewPortScope;
import org.jboss.portal.web.ServletContainer;
import org.jboss.portal.web.ServletContextDispatcher;
import org.jboss.portal.web.WebRequest;
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 org.jboss.portal.common.util.Base64;
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.common.io.SerializationFilter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.Collection;
-
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
@@ -118,7 +107,7 @@
NavigationalStateContext navigationalStateContext = null;
if (nsString != null)
{
- byte[] bytes = Base64.decode(nsString, true);
+ byte[] bytes = Base64.decode(nsString,
Base64.EncodingOption.USEURLSAFEENCODING);
NavigationalStateContextSerialization serialization = new
NavigationalStateContextSerialization();
navigationalStateContext = IOTools.unserialize(serialization,
SerializationFilter.COMPRESSOR ,bytes);
}
@@ -235,7 +224,7 @@
private void renderDocument(ViewPortScope scope, String nodeId) throws IOException
{
byte[] bytes = IOTools.serialize(new NavigationalStateContextSerialization(),
SerializationFilter.COMPRESSOR, navigationalStateContext);
- String ns = Base64.encodeBytes(bytes, true);
+ String ns = Base64.encodeBytes(bytes, Base64.EncodingOption.USEURLSAFEENCODING);
encoderContext = new ClassicActionEncoderContext(ns, resp);
//
@@ -249,149 +238,14 @@
//
DetachedUINode node = context.getNode(nodeId);
-
- //
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
-
- //
- writer.print("<html><head>");
-
- writer.print("</head><body>");
- renderNode(node, writer);
- writer.print("</body></html>");
+
+ // TEST
+ ThemeInfo theme = new ThemeInfo(null, null);
+ TemplateInfo template = new XHTMLTemplateImpl();
+ Renderer renderSet = new Renderer(theme, template);
+
+ RendererContext ctx = new RendererContext(encoder, encoderContext, req, resp);
+ renderSet.renderDocument(ctx, server, this, node);
}
- private void renderNode(UINode node, PrintWriter writer)
- {
- UIObject object = node.getObject();
-
- //
- writer.println("<div style=\"border: 1px solid
black\">");
-
- //
- if (object instanceof UIContext)
- {
- renderChildren(node, writer);
- }
- else if (object instanceof UILayout)
- {
- if (node.getChildren() != null)
- {
- renderPane(node, writer);
- }
- else
- {
- if (object instanceof UIPage)
- {
- ViewUIObjectAction viewPage = new ViewUIObjectAction(object.getId());
-
- String url = encoder.encode(viewPage, encoderContext);
-
- writer.print("<div>Link to page <a href=\"" + url
+ "\">" + object.getId() + "</a></div>");
- }
- }
- }
- else if (object instanceof UIWindow)
- {
- try
- {
- ContentFragment content = server.renderWindow(this, object.getId());
-
- //
- writer.print("<li class=\"element\">");
- writer.print("<div>");
- writer.print("Window " + object.getId());
- writer.print("</div>");
- writer.print("<div>");
- writer.print(content.getMarkup());
- writer.print("</div>");
- writer.print("</li>");
- }
- catch (PresentationServerException e)
- {
- e.printStackTrace();
- }
- }
-
- //
- writer.println("</div>");
- }
-
- private void renderPane(UINode node, PrintWriter writer)
- {
- LayoutFactory<UINode> layoutFactory = new LayoutFactory<UINode>(new
ModelLayoutAdapter());
-
- //
- Layout<UINode> layout = layoutFactory.getLayout(node);
-
- //
- if (layout instanceof SimpleLayout)
- {
- //
- SimpleLayout<UINode> simpleLayout = (SimpleLayout<UINode>)layout;
-
- //
- Orientation orientation = simpleLayout.getOrientation();
-
- //
- writer.print("<table>");
-
- //
- if (orientation == Orientation.HORIZONTAL)
- {
- writer.print("<tr>");
- }
-
- //
- Collection<? extends UINode> children = node.getChildren();
-
- //
- if (children != null)
- {
- for (UINode child : children)
- {
- if (orientation == Orientation.HORIZONTAL)
- {
- writer.print("<td>");
- renderNode(child, writer);
- writer.print("</td>");
- }
- else
- {
- writer.print("<tr><td>");
- renderNode(child, writer);
- writer.print("</td></tr>");
- }
- }
- }
-
- //
- if (orientation == Orientation.HORIZONTAL)
- {
- writer.print("</tr>");
- }
-
- //
- writer.print("</table>");
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- private void renderChildren(UINode node, PrintWriter writer)
- {
- Collection<? extends UINode> children = node.getChildren();
-
- //
- if (children != null)
- {
- for (UINode child : children)
- {
- renderNode(child, writer);
- }
- }
- }
}
Modified:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.classic;
+import org.jboss.portal.common.mc.bootstrap.WebBootstrap;
import org.jboss.portal.presentation.server.PresentationServer;
import org.jboss.portal.presentation.server.PresentationServerException;
import org.jboss.portal.presentation.protocol.codec.ActionEncoder;
@@ -38,6 +39,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
+@SuppressWarnings("serial")
public class ClassicPresentationServlet extends EndPointServlet
{
@@ -48,11 +50,11 @@
protected void service(WebRequest req, WebResponse resp) throws ServletException,
IOException
{
- PresentationServer server =
(PresentationServer)getServletContext().getAttribute("PresentationServer");
+ PresentationServer server =
(PresentationServer)getServletContext().getAttribute(WebBootstrap.BEAN_PREFIX +
"PresentationServer");
- ActionEncoder encoder =
(ActionEncoder)getServletContext().getAttribute("ActionEncoder");
+ ActionEncoder encoder =
(ActionEncoder)getServletContext().getAttribute(WebBootstrap.BEAN_PREFIX +
"ActionEncoder");
- ActionDecoder decoder =
(ActionDecoder)getServletContext().getAttribute("ActionDecoder");
+ ActionDecoder decoder =
(ActionDecoder)getServletContext().getAttribute(WebBootstrap.BEAN_PREFIX +
"ActionDecoder");
//
if (server == null)
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/Renderer.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/Renderer.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/Renderer.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -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.classic.theme;
+
+import java.io.IOException;
+
+import org.jboss.portal.presentation.classic.theme.info.ThemeInfo;
+import org.jboss.portal.presentation.client.PresentationClient;
+import org.jboss.portal.presentation.impl.model.pull.DetachedUINode;
+import org.jboss.portal.presentation.server.PresentationServer;
+
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class Renderer
+{
+
+ private ThemeInfo theme;
+
+ private TemplateInfo template;
+
+ public Renderer(ThemeInfo theme, TemplateInfo template)
+ {
+ this.theme = theme;
+ this.template = template;
+ }
+
+ public void renderDocument(RendererContext rendererContext, PresentationServer server,
PresentationClient client, DetachedUINode node) throws IOException
+ {
+ template.renderDocument(rendererContext, server, client, node, theme);
+ }
+
+}
+
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/RendererContext.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/RendererContext.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/RendererContext.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.classic.theme;
+
+import org.jboss.portal.presentation.protocol.codec.ActionEncoder;
+import org.jboss.portal.presentation.protocol.codec.ActionEncoderContext;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class RendererContext
+{
+ private ActionEncoder encoder;
+
+ private ActionEncoderContext encoderContext;
+
+ private WebRequest request;
+
+ private WebResponse response;
+
+ public RendererContext(ActionEncoder encoder, ActionEncoderContext encoderContext,
WebRequest req, WebResponse resp)
+ {
+ this.encoder = encoder;
+ this.encoderContext = encoderContext;
+ this.request = req;
+ this.response = resp;
+ }
+
+ public ActionEncoder getEncoder()
+ {
+ return encoder;
+ }
+
+ public ActionEncoderContext getEncoderContext()
+ {
+ return encoderContext;
+ }
+
+ public WebRequest getRequest()
+ {
+ return request;
+ }
+
+ public WebResponse getResponse()
+ {
+ return response;
+ }
+}
+
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/TemplateInfo.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/TemplateInfo.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/TemplateInfo.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.classic.theme;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import org.jboss.portal.presentation.classic.theme.info.ThemeInfo;
+import org.jboss.portal.presentation.client.PresentationClient;
+import org.jboss.portal.presentation.impl.model.pull.DetachedUINode;
+import org.jboss.portal.presentation.model.UINode;
+import org.jboss.portal.presentation.server.PresentationServer;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public interface TemplateInfo
+{
+ public void renderDocument(RendererContext rendererContext, PresentationServer
server, PresentationClient client, DetachedUINode node, ThemeInfo theme) throws
IOException;
+
+ public void renderNode(RendererContext rendererContext, PresentationServer server,
PresentationClient client, UINode node, PrintWriter writer);
+
+ public void renderPane(RendererContext rendererContext, PresentationServer server,
PresentationClient client, UINode node, PrintWriter writer);
+
+ public void renderChildren(RendererContext rendererContext, PresentationServer server,
PresentationClient client, UINode node, PrintWriter writer);
+}
+
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/impl/XHTMLTemplateImpl.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/impl/XHTMLTemplateImpl.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/impl/XHTMLTemplateImpl.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -0,0 +1,235 @@
+/******************************************************************************
+ * 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.classic.theme.impl;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Collection;
+import java.util.List;
+
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.presentation.classic.theme.RendererContext;
+import org.jboss.portal.presentation.classic.theme.TemplateInfo;
+import org.jboss.portal.presentation.classic.theme.info.CSSInfo;
+import org.jboss.portal.presentation.classic.theme.info.ThemeInfo;
+import org.jboss.portal.presentation.client.PresentationClient;
+import org.jboss.portal.presentation.content.ContentFragment;
+import org.jboss.portal.presentation.impl.model.pull.DetachedUINode;
+import org.jboss.portal.presentation.layout.Layout;
+import org.jboss.portal.presentation.layout.LayoutFactory;
+import org.jboss.portal.presentation.layout.ModelLayoutAdapter;
+import org.jboss.portal.presentation.layout.Orientation;
+import org.jboss.portal.presentation.layout.SimpleLayout;
+import org.jboss.portal.presentation.model.UINode;
+import org.jboss.portal.presentation.model.ui.UIAction;
+import org.jboss.portal.presentation.model.ui.UIContext;
+import org.jboss.portal.presentation.model.ui.UILayout;
+import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.model.ui.UIPage;
+import org.jboss.portal.presentation.model.ui.UIWindow;
+import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
+import org.jboss.portal.presentation.server.PresentationServer;
+import org.jboss.portal.presentation.server.PresentationServerException;
+import org.jboss.portal.web.WebResponse;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class XHTMLTemplateImpl implements TemplateInfo
+{
+ /*
+ private List<String> supportedBrowsersRegExps;
+
+ public List<String> getSupportedBrowsersRegExps()
+ {
+ return supportedBrowsersRegExps;
+ }
+ */
+
+ public void renderDocument(RendererContext rendererContext, PresentationServer server,
PresentationClient client, DetachedUINode node, ThemeInfo theme) throws IOException
+ {
+ //
+ WebResponse resp = rendererContext.getResponse();
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
+ writer.print("<html><head>");
+
+ List<CSSInfo> cssFiles = theme.getCSSFiles();
+ for (CSSInfo css: cssFiles)
+ {
+ writer.write("<link rel=\"stylesheet\"
type=\"text/css\" href=\"" + css.getLocation() +
"\"/>");
+ }
+
+ writer.print("</head><body>");
+ renderNode(rendererContext, server, client, node, writer);
+ writer.print("</body></html>");
+ }
+
+ public void renderNode(RendererContext rendererContext, PresentationServer server,
PresentationClient client, UINode node, PrintWriter writer)
+ {
+ UIObject object = node.getObject();
+
+ //
+ writer.println("<div style=\"border: 1px solid
black\">");
+
+ //
+ if (object instanceof UIContext)
+ {
+ renderChildren(rendererContext, server, client, node, writer);
+ }
+ else if (object instanceof UILayout)
+ {
+ if (node.getChildren() != null)
+ {
+ renderPane(rendererContext, server, client, node, writer);
+ }
+ else
+ {
+ if (object instanceof UIPage)
+ {
+ ViewUIObjectAction viewPage = new ViewUIObjectAction(object.getId());
+
+ String url = rendererContext.getEncoder().encode(viewPage,
rendererContext.getEncoderContext());
+
+ writer.print("<div>Link to page <a href=\"" + url
+ "\">" + object.getId() + "</a></div>");
+ }
+ }
+ }
+ else if (object instanceof UIWindow)
+ {
+ try
+ {
+ ContentFragment content = server.renderWindow(client, object.getId());
+ //
+
+ Collection<? extends UINode> actions = node.getChildren();
+ if (actions != null)
+ {
+ for (UINode actionNode: actions)
+ {
+ UIAction action = (UIAction) actionNode.getObject();
+ writer.print("<p>" + action.getFamily() + ":"
+ action.getDisplayName() + "</p>");
+ }
+ }
+
+ writer.print("<li class=\"element\">");
+ writer.print("<div>");
+ writer.print("Window " + object.getId());
+ writer.print("</div>");
+ writer.print("<div>");
+ writer.print(content.getMarkup());
+ writer.print("</div>");
+ writer.print("</li>");
+ }
+ catch (PresentationServerException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ //
+ writer.println("</div>");
+ }
+
+ public void renderPane(RendererContext rendererContext, PresentationServer server,
PresentationClient client, UINode node, PrintWriter writer)
+ {
+ LayoutFactory<UINode> layoutFactory = new LayoutFactory<UINode>(new
ModelLayoutAdapter());
+
+ //
+ Layout<UINode> layout = layoutFactory.getLayout(node);
+
+ //
+ if (layout instanceof SimpleLayout)
+ {
+ //
+ SimpleLayout<UINode> simpleLayout = (SimpleLayout<UINode>)layout;
+
+ //
+ Orientation orientation = simpleLayout.getOrientation();
+
+ //
+ writer.print("<table>");
+
+ //
+ if (orientation == Orientation.HORIZONTAL)
+ {
+ writer.print("<tr>");
+ }
+
+ //
+ Collection<? extends UINode> children = node.getChildren();
+
+ //
+ if (children != null)
+ {
+ for (UINode child : children)
+ {
+ if (orientation == Orientation.HORIZONTAL)
+ {
+ writer.print("<td>");
+ renderNode(rendererContext, server, client, child, writer);
+ writer.print("</td>");
+ }
+ else
+ {
+ writer.print("<tr><td>");
+ renderNode(rendererContext, server, client, child, writer);
+ writer.print("</td></tr>");
+ }
+ }
+ }
+
+ //
+ if (orientation == Orientation.HORIZONTAL)
+ {
+ writer.print("</tr>");
+ }
+
+ //
+ writer.print("</table>");
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ public void renderChildren(RendererContext rendererContext, PresentationServer server,
PresentationClient client, UINode node, PrintWriter writer)
+ {
+ Collection<? extends UINode> children = node.getChildren();
+
+ //
+ if (children != null)
+ {
+ for (UINode child : children)
+ {
+ renderNode(rendererContext, server, client, child, writer);
+ }
+ }
+ }
+
+}
+
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/info/CSSInfo.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/info/CSSInfo.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/info/CSSInfo.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.classic.theme.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class CSSInfo
+{
+ public String name;
+
+ public LocalizedString displayName;
+
+ public String location;
+
+ public CSSInfo(String name, LocalizedString displayName, String location)
+ {
+ this.name = name;
+ this.displayName = displayName;
+ this.location = location;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public LocalizedString getDisplayName(boolean defaultToName)
+ {
+ if (displayName != null)
+ {
+ return displayName;
+ }
+ else if (defaultToName)
+ {
+ return new LocalizedString(name);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public String getLocation()
+ {
+ return location;
+ }
+}
+
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/info/ThemeInfo.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/info/ThemeInfo.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/theme/info/ThemeInfo.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -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.classic.theme.info;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+@SuppressWarnings("serial")
+public class ThemeInfo
+{
+ private List<String> supportedBrowsersRegExps;
+
+ private List<CSSInfo> cssFiles;
+
+ public ThemeInfo(List<String> supportedBrowsersRegExps, List<CSSInfo>
cssFiles)
+ {
+ this.supportedBrowsersRegExps = supportedBrowsersRegExps;
+ this.cssFiles = cssFiles;
+ if (cssFiles == null)
+ {
+ this.cssFiles = new ArrayList<CSSInfo>();
+ }
+ }
+
+ public List<String> getSupportedBrowsersRegExps()
+ {
+ return supportedBrowsersRegExps;
+ }
+
+ public List<CSSInfo> getCSSFiles()
+ {
+ return cssFiles;
+ }
+
+}
+
Modified: modules/presentation/trunk/portal/pom.xml
===================================================================
--- modules/presentation/trunk/portal/pom.xml 2008-10-08 11:18:48 UTC (rev 12050)
+++ modules/presentation/trunk/portal/pom.xml 2008-10-08 11:21:41 UTC (rev 12051)
@@ -97,6 +97,7 @@
<dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
@@ -130,6 +131,9 @@
-->
<forkMode>never</forkMode>
<argLine>-enableassertions</argLine>
+ <excludes>
+
<exclude>org/jboss/portal/presentation/portal/model/StructuralStateContextTestCase.java</exclude>
+ </excludes>
</configuration>
</plugin>
Modified: modules/presentation/trunk/portal/src/assemble/presentation-portal-war.xml
===================================================================
--- modules/presentation/trunk/portal/src/assemble/presentation-portal-war.xml 2008-10-08
11:18:48 UTC (rev 12050)
+++ modules/presentation/trunk/portal/src/assemble/presentation-portal-war.xml 2008-10-08
11:21:41 UTC (rev 12051)
@@ -52,14 +52,16 @@
<include>org.jboss.portal.presentation:presentation-classic</include>
-
<include>org.jboss.portal.presentation:presentation-ajax</include>
- <include>com.google.gwt:gwt-user</include>
+ <include>org.jboss.portal.presentation:presentation-ajax</include
>
+ <include>com.google.gwt:gwt-servlet</include>
<include>javax.ccpp:ccpp</include>
<include>javax.portlet:portlet-api</include>
<include>org.jboss:jboss-common-core</include>
+ <!--
<include>org.jboss.microcontainer:jboss-kernel</include>
+ -->
<include>org.jboss.microcontainer:jboss-dependency</include>
<include>org.jboss:jboss-reflect</include>
<include>org.jboss:jboss-mdr</include>
Modified:
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/jboss-beans.xml 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/jboss-beans.xml 2008-10-08
11:21:41 UTC (rev 12051)
@@ -147,13 +147,15 @@
<parameter><inject
bean="PortalNodeAdapter"/></parameter>
</constructor>
</bean>
-
+
+<!--
<bean name="StructuralStateContextImporter"
class="org.jboss.portal.presentation.portal.servlet.ModelImportTrigger">
<property name="servletContext"><inject
bean="ServletContext"/></property>
<property name="portalNodeManager"><inject
bean="PortalNodeManager"/></property>
<property name="layoutStore"><inject
bean="LayoutStore"/></property>
</bean>
-
+ -->
+
<bean name="PresentationServer"
class="org.jboss.portal.presentation.portal.PresentationServerImpl">
<constructor>
<parameter><inject
bean="PortalNodeManager"/></parameter>
Modified:
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/web.xml
===================================================================
---
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/web.xml 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/web.xml 2008-10-08
11:21:41 UTC (rev 12051)
@@ -30,6 +30,9 @@
<listener>
<listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
</listener>
+ <listener>
+
<listener-class>org.jboss.portal.presentation.portal.servlet.ModelImportTrigger</listener-class>
+ </listener>
<servlet>
<servlet-name>ContainerServlet</servlet-name>
@@ -58,4 +61,4 @@
</servlet-mapping>
</web-app>
-
\ No newline at end of file
+
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletPageNavigationalState.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletPageNavigationalState.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletPageNavigationalState.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -102,6 +102,7 @@
navigationalStateContext.setProperty(portletWindowId, "portlet",
portletWindowState.getPortletNavigationalState());
}
+ @SuppressWarnings("unchecked")
public Map<String, String[]> getPortletPublicNavigationalState(String
portletWindowId) throws IllegalArgumentException
{
Map<QName, String[]> pageParameters = (Map<QName,
String[]>)navigationalStateContext.getProperty(portletWindowId, "public");
@@ -178,6 +179,7 @@
return publicNames;
}
+ @SuppressWarnings("unchecked")
public String[] getPublicNavigationalState(QName name) throws
IllegalArgumentException
{
for (String portletWindowId : portletControllerContext.getWindowIds())
@@ -202,6 +204,7 @@
return null;
}
+ @SuppressWarnings("unchecked")
public void setPublicNavigationalState(QName name, String[] value) throws
IllegalArgumentException, IllegalStateException
{
if (!modifiable)
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationPortletInvocationContext.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationPortletInvocationContext.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationPortletInvocationContext.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -45,6 +45,7 @@
private final MarkupInfo markup = new MarkupInfo(MediaType.TEXT_HTML,
"UTF-8");
/** . */
+ @SuppressWarnings("unused")
private final PresentationPortletControllerContext portletControllerContext;
/** . */
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelImporter.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelImporter.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelImporter.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -32,6 +32,7 @@
import org.jboss.portal.presentation.portal.model.layout.LayoutStructure;
import org.jboss.portal.presentation.portal.model.layout.LayoutStore;
import org.jboss.portal.presentation.portal.model.layout.LayoutElement;
+import org.jboss.portal.presentation.portal.model.node.ActionNode;
import org.jboss.portal.presentation.portal.model.node.PortalNode;
import org.jboss.portal.presentation.portal.model.node.PageNode;
import org.jboss.portal.presentation.portal.model.node.WindowNode;
@@ -41,12 +42,12 @@
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
-import javax.xml.XMLConstants;
+//import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
+//import javax.xml.validation.Schema;
+//import javax.xml.validation.SchemaFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
@@ -60,23 +61,23 @@
{
/** . */
- private final static Schema schema;
+ // private final static Schema schema;
/** . */
private static final URL schemaURL;
static
{
- try
- {
+// try
+// {
schemaURL =
ModelImporter.class.getClassLoader().getResource("org/jboss/portal/presentation/portal/page_structure_1_0.xsd");
- SchemaFactory factory =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- schema = factory.newSchema(schemaURL);
- }
- catch (SAXException e)
- {
- throw new Error("Could not load the page structure 1.0 schema", e);
- }
+// SchemaFactory factory =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ // schema = factory.newSchema(schemaURL);
+// }
+// catch (SAXException e)
+// {
+// throw new Error("Could not load the page structure 1.0 schema", e);
+// }
}
@@ -254,6 +255,10 @@
//
windowNode.setContent(content);
+ ActionNode node = windowNode.addChild("viewAction", ActionNode.class);
+ node.setProperty("family", "windowstate");
+ node.setProperty("displayName", "normal");
+
//
return windowNode;
}
Added:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/node/ActionNode.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/node/ActionNode.java
(rev 0)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/node/ActionNode.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * 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.portal.model.node;
+
+import org.jboss.portal.presentation.model.ui.UIAction;
+import org.jboss.portal.presentation.model.ui.UIObject;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class ActionNode extends PortalNode
+{
+ private String family;
+
+ private String name;
+
+ public ActionNode(String name, PortalNodeManager structuralStateContext)
+ {
+ super(name, structuralStateContext);
+ }
+
+ public Class<? extends UIObject> getType()
+ {
+ return UIAction.class;
+ }
+
+ public void setFamily(String family)
+ {
+ this.family = family;
+ }
+
+ public String getFamily()
+ {
+ return family;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+}
+
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/servlet/ModelImportTrigger.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/servlet/ModelImportTrigger.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/servlet/ModelImportTrigger.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -27,15 +27,19 @@
import org.jboss.portal.presentation.portal.model.node.ContextNode;
import org.jboss.portal.presentation.portal.model.layout.LayoutStore;
import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.mc.bootstrap.WebBootstrap;
import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
import java.io.InputStream;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
-public class ModelImportTrigger
+public class ModelImportTrigger implements ServletContextListener
{
/** . */
@@ -47,36 +51,6 @@
/** . */
private LayoutStore layoutStore;
- public ServletContext getServletContext()
- {
- return servletContext;
- }
-
- public void setServletContext(ServletContext servletContext)
- {
- this.servletContext = servletContext;
- }
-
- public PortalNodeManager getPortalNodeManager()
- {
- return portalNodeManager;
- }
-
- public void setPortalNodeManager(PortalNodeManager portalNodeManager)
- {
- this.portalNodeManager = portalNodeManager;
- }
-
- public LayoutStore getLayoutStore()
- {
- return layoutStore;
- }
-
- public void setLayoutStore(LayoutStore layoutStore)
- {
- this.layoutStore = layoutStore;
- }
-
public void start() throws Exception
{
InputStream in =
servletContext.getResourceAsStream("/WEB-INF/page-structure.xml");
@@ -92,4 +66,23 @@
IOTools.safeClose(in);
}
}
+
+ public void contextDestroyed(ServletContextEvent event)
+ {
+ }
+
+ public void contextInitialized(ServletContextEvent event)
+ {
+ servletContext = event.getServletContext();
+ portalNodeManager = (PortalNodeManager)
servletContext.getAttribute(WebBootstrap.BEAN_PREFIX + "PortalNodeManager");
+ layoutStore = (LayoutStore) servletContext.getAttribute(WebBootstrap.BEAN_PREFIX +
"LayoutStore");
+ try
+ {
+ start();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIActionImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIActionImpl.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIActionImpl.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -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.ui;
+
+import org.jboss.portal.presentation.model.UIObjectContext;
+import org.jboss.portal.presentation.model.ui.UIAction;
+import org.jboss.portal.presentation.state.StateType;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class UIActionImpl extends UIObjectImpl implements UIAction
+{
+
+ public UIActionImpl(NavigationalStateContext navigationalStateContext, UIObjectContext
context)
+ {
+ super(navigationalStateContext, context);
+ }
+
+ public String getDisplayName()
+ {
+ return getPropertyValue(StateType.STRUCTURAL, "displayName",
String.class);
+ }
+
+ public String getFamily()
+ {
+ return getPropertyValue(StateType.STRUCTURAL, "family", String.class);
+ }
+
+ public String getIconURL()
+ {
+ return getPropertyValue(StateType.STRUCTURAL, "iconURL", String.class);
+ }
+
+ public String getURL()
+ {
+ return getPropertyValue(StateType.STRUCTURAL, "url", String.class);
+ }
+
+}
+
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-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -24,6 +24,7 @@
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.common.reflect.Reflection;
+import org.jboss.portal.presentation.model.ui.UIAction;
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
@@ -56,11 +57,15 @@
UIObjectImpl object;
//
- Class type = objectContext.getType();
+ Class<? extends UIObject> type = objectContext.getType();
//
- if (type == UIWindow.class)
+ if (type == UIAction.class)
{
+ object = new UIActionImpl(navigationalStateContext, objectContext);
+ }
+ else if (type == UIWindow.class)
+ {
object = new UIWindowImpl(navigationalStateContext, objectContext);
}
else if (type == UIPage.class)
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIWindowImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIWindowImpl.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIWindowImpl.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -24,13 +24,14 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
+import org.jboss.portal.presentation.model.UIObjectContext;
import org.jboss.portal.presentation.model.ui.UIWindow;
-import org.jboss.portal.presentation.model.UIObjectContext;
import org.jboss.portal.presentation.state.StateType;
import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @author <a href="mailto:theute@jboss-portal.org">Thomas
Heute</a>
* @version $Revision: 630 $
*/
public class UIWindowImpl extends UIObjectImpl implements UIWindow
@@ -50,4 +51,5 @@
{
return getPropertyValue(StateType.NAVIGATIONAL, "mode", Mode.class);
}
+
}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/NavigationalStateContextImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/NavigationalStateContextImpl.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/NavigationalStateContextImpl.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,14 +22,9 @@
******************************************************************************/
package org.jboss.portal.presentation.impl.state.navigational;
-import org.jboss.portal.presentation.state.StateChangeVetoException;
-import org.jboss.portal.presentation.state.StateException;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
-import java.util.Set;
-import java.io.Serializable;
/**
* An implementation of the {@link
org.jboss.portal.presentation.state.navigational.NavigationalStateContext} interface
@@ -38,6 +33,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
+@SuppressWarnings("serial")
public class NavigationalStateContextImpl extends SimpleNavigationalStateContext
implements Serializable
{
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/SessionNavigationalStateContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/SessionNavigationalStateContext.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/SessionNavigationalStateContext.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -32,6 +32,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
+@SuppressWarnings("serial")
public class SessionNavigationalStateContext extends SimpleNavigationalStateContext
{
@@ -43,6 +44,7 @@
this.request = request;
}
+ @SuppressWarnings("unchecked")
protected Map<String, Serializable> getMap(String objectId, boolean create)
{
HttpSession session = request.getSession(create);
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/SimpleNavigationalStateContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/SimpleNavigationalStateContext.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/SimpleNavigationalStateContext.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,14 +22,13 @@
******************************************************************************/
package org.jboss.portal.presentation.impl.state.navigational;
-import org.jboss.portal.presentation.state.StateChangeVetoException;
-import org.jboss.portal.presentation.state.StateException;
-
-import java.util.HashMap;
+import java.io.Serializable;
import java.util.Map;
import java.util.Set;
-import java.io.Serializable;
+import org.jboss.portal.presentation.state.StateChangeVetoException;
+import org.jboss.portal.presentation.state.StateException;
+
/**
* An implementation of the {@link
org.jboss.portal.presentation.state.navigational.NavigationalStateContext} interface
* that is serializable.
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ViewPortScope.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ViewPortScope.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ViewPortScope.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.presentation.model;
-import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.state.structural.StructuralObject;
/**
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIAction.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIAction.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIAction.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -26,6 +26,7 @@
* An action that can be triggered.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision: 630 $
*/
public interface UIAction extends UIObject
@@ -51,5 +52,12 @@
* @return the url
*/
String getURL();
+
+ /**
+ * Returns the family name for the action
+ *
+ * @return the family name
+ */
+ String getFamily();
}
\ No newline at end of file
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIWindow.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIWindow.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIWindow.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -44,4 +44,5 @@
* @return the mode
*/
Mode getMode();
+
}
\ No newline at end of file
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/LinkActivation.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/LinkActivation.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/LinkActivation.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -24,9 +24,6 @@
import java.util.Map;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServerException.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServerException.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServerException.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -26,6 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 8784 $
*/
+@SuppressWarnings("serial")
public class PresentationServerException extends Exception
{
public PresentationServerException()
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/NoSuchStateException.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/NoSuchStateException.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/NoSuchStateException.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -26,6 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
+@SuppressWarnings("serial")
public class NoSuchStateException extends StateException
{
public NoSuchStateException()
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StaleStateException.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StaleStateException.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StaleStateException.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -26,6 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
+@SuppressWarnings("serial")
public class StaleStateException extends StateException
{
public StaleStateException()
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StateChangeVetoException.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StateChangeVetoException.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StateChangeVetoException.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -26,6 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
+@SuppressWarnings("serial")
public class StateChangeVetoException extends StateException
{
public StateChangeVetoException()
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StateException.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StateException.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/StateException.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -26,6 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
+@SuppressWarnings("serial")
public class StateException extends RuntimeException
{
public StateException()
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/view/PageViewPortScope.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/view/PageViewPortScope.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/view/PageViewPortScope.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -25,6 +25,7 @@
import org.jboss.portal.presentation.model.ObjectTraversalType;
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ViewPortScope;
+import org.jboss.portal.presentation.model.ui.UIAction;
import org.jboss.portal.presentation.model.ui.UIPage;
import org.jboss.portal.presentation.model.ui.UIWindow;
import org.jboss.portal.presentation.model.ui.UILayout;
@@ -34,6 +35,7 @@
* A view scope that retrieves a page and its visible content.
*
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @author <a href="mailto:theute@jboss-portal.org">Thomas
Heute</a>
* @version $Revision: 630 $
*/
public class PageViewPortScope implements ViewPortScope
@@ -113,7 +115,12 @@
}
else if (UIWindow.class.isAssignableFrom(type))
{
- // We don't traverse windows (for now as they are supposed to be leaves)
+ // Windows have actions
+ return ObjectTraversalType.RECURSIVE;
+ }
+ else if (UIAction.class.isAssignableFrom(type))
+ {
+ // An Action is a leaf
return ObjectTraversalType.SINGLE;
}
else
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/MoveChildTestCase.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/MoveChildTestCase.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/MoveChildTestCase.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -42,6 +42,7 @@
{
NodeDef rootDef = NodeDef.create(context);
NodeDef fooDef = rootDef.addChild("foo");
+ @SuppressWarnings("unused")
NodeDef juuDef = fooDef.addChild("juu");
NodeDef barDef = rootDef.addChild("bar");
@@ -80,6 +81,7 @@
NodeDef rootDef = NodeDef.create(context);
NodeDef fooDef = rootDef.addChild("foo");
NodeDef barDef = rootDef.addChild("bar");
+ @SuppressWarnings("unused")
NodeDef juuDef = barDef.addChild("juu");
//
@@ -116,8 +118,10 @@
{
NodeDef rootDef = NodeDef.create(context);
NodeDef fooDef = rootDef.addChild("foo");
+ @SuppressWarnings("unused")
NodeDef juuDef = fooDef.addChild("juu");
NodeDef barDef = rootDef.addChild("bar");
+ @SuppressWarnings("unused")
NodeDef daaDef = barDef.addChild("daa");
//
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildTestCase.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildTestCase.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/RemoveChildTestCase.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -43,6 +43,7 @@
{
NodeDef rootDef = NodeDef.create(context);
NodeDef fooDef = rootDef.addChild("foo");
+ @SuppressWarnings("unused")
NodeDef barDef = fooDef.addChild("bar");
NodeDef juuDef = fooDef.addChild("juu");
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/TypeTestCase.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/TypeTestCase.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/TypeTestCase.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -24,6 +24,7 @@
import org.jboss.portal.presentation.model.ViewPort;
import org.jboss.portal.presentation.model.ViewPortScope;
+import org.jboss.portal.presentation.model.ui.UIAction;
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
import org.jboss.portal.presentation.model.ui.UIWindow;
@@ -40,8 +41,12 @@
public void testType()
{
NodeDef rootDef = NodeDef.create(context);
+ @SuppressWarnings("unused")
NodeDef fooDef = rootDef.addChild("foo", UIPage.class);
+ @SuppressWarnings("unused")
NodeDef barDef = rootDef.addChild("bar", UIWindow.class);
+ @SuppressWarnings("unused")
+ NodeDef ouDef = barDef.addChild("ou", UIAction.class);
//
rootDef.populate(mockModel);
@@ -58,15 +63,18 @@
UIObjectNode root =
context.getNode(mockModel.getStructuralStateContext().getRootId());
UIObjectNode foo = getChild(root, "foo");
UIObjectNode bar = getChild(root, "bar");
+ UIObjectNode ou = getChild(bar, "ou");
//
assertNotNull(foo);
assertNotNull(bar);
+ assertNotNull(ou);
//
assertTrue(root.getObject() instanceof UIContext);
assertTrue("was not expecting: " + foo.getObject().getClass().getName(),
foo.getObject() instanceof UIPage);
assertTrue("was not expecting: " + bar.getObject().getClass().getName(),
bar.getObject() instanceof UIWindow);
+ assertTrue("was not expecting: " + ou.getObject().getClass().getName(),
ou.getObject() instanceof UIAction);
}
}
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/UpdateObjectTestCase.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/UpdateObjectTestCase.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/UpdateObjectTestCase.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -42,6 +42,7 @@
protected void test(ObjectTraversalType[] before, ObjectTraversalType[] after, Object
handback)
{
NodeDef rootDef = NodeDef.create(context);
+ @SuppressWarnings("unused")
NodeDef fooDef = rootDef.addChild("foo");
//
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/AbstractStructuralStateContextTestCase.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/AbstractStructuralStateContextTestCase.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/AbstractStructuralStateContextTestCase.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -277,6 +277,7 @@
//
MockObject mockFoo = addChild(mockRoot, "foo", UIPage.class);
+ @SuppressWarnings("unused")
MockObject mockBar = addChild(mockRoot, "bar", UIPage.class);
//
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/mock/MockException.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/mock/MockException.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/mock/MockException.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -26,6 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
+@SuppressWarnings("serial")
public class MockException extends RuntimeException
{
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/mock/impl/StructuralObjectImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/mock/impl/StructuralObjectImpl.java 2008-10-08
11:18:48 UTC (rev 12050)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/mock/impl/StructuralObjectImpl.java 2008-10-08
11:21:41 UTC (rev 12051)
@@ -22,11 +22,10 @@
******************************************************************************/
package org.jboss.portal.presentation.test.state.mock.impl;
-import org.jboss.portal.presentation.state.structural.StructuralObject;
-import org.jboss.portal.presentation.state.structural.StructuralState;
-
import java.util.List;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $