JBoss Portal SVN: r9128 - in branches/presentation: core-presentation/src/main/org/jboss/portal/core/presentation/server and 10 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-27 11:28:30 -0500 (Tue, 27 Nov 2007)
New Revision: 9128
Added:
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/ObjectState.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java
Removed:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/content/
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ObjectState.java
Modified:
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
branches/presentation/core-presentation/src/resources/presentation-sar/META-INF/jboss-service.xml
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIContext.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/server/PresentationServer.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockObject.java
Log:
reorg of packages for model state
Copied: branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java (from rev 9052, branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java)
===================================================================
--- branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java (rev 0)
+++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -0,0 +1,177 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.presentation.model;
+
+import java.util.Map;
+import java.util.List;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ArrayList;
+
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.UIPortal;
+import org.jboss.portal.presentation.model.UIPage;
+import org.jboss.portal.presentation.model.UIWindow;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
+
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.Portal;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class StructuralStateManagerImpl implements StructuralStateManager
+{
+ /**
+ *
+ */
+ private PortalObjectContainer portalObjectContainer = null;
+
+ /**
+ *
+ * @return
+ */
+ public PortalObjectContainer getPortalObjectContainer()
+ {
+ return portalObjectContainer;
+ }
+
+ /**
+ *
+ * @param portalObjectContainer
+ */
+ public void setPortalObjectContainer(
+ PortalObjectContainer portalObjectContainer)
+ {
+ this.portalObjectContainer = portalObjectContainer;
+ }
+
+
+ public String getRootId()
+ {
+ return portalObjectContainer.getContext().getId().toString();
+ }
+
+ /**
+ *
+ */
+ public ObjectState loadState(String objectId) throws IllegalArgumentException
+ {
+ ObjectState objectState = null;
+
+ // Get the PortalObject corresponding to this objectId from the PortalObjectContainer
+ PortalObject portalObject = this.portalObjectContainer.getObject(PortalObjectId.parse(objectId,
+ PortalObjectPath.CANONICAL_FORMAT));
+
+ if(portalObject == null)
+ {
+ // Object by this id was not found in the Portal
+ return null;
+ }
+
+ // Type
+ Class<? extends UIObject> type = this.getType(portalObject);
+
+ // Name
+ String name = portalObject.getName();
+
+ // Properties
+ Map<String, String> properties = portalObject.getDeclaredProperties();
+
+ // Parent Id
+ String parentId = null;
+ if(portalObject.getParent() != null)
+ {
+ parentId = portalObject.getParent().getId().toString();
+ }
+
+ //Children Ids
+ List<String> childrenIds = new ArrayList<String>();
+ Collection children = portalObject.getChildren();
+ for(Iterator itr=children.iterator(); itr.hasNext();)
+ {
+ PortalObject child = (PortalObject)itr.next();
+ childrenIds.add(child.getId().toString());
+ }
+
+ objectState = new ObjectState(
+ type, //type
+ name,
+ properties, //properties
+ parentId,
+ childrenIds // childrenIds
+ );
+
+ return objectState;
+ }
+
+ /**
+ *
+ * @param portalObject
+ * @return
+ */
+ private Class<? extends UIObject> getType(PortalObject portalObject)
+ {
+ Class<? extends UIObject> type = null;
+
+ if(portalObject instanceof Portal)
+ {
+ type = UIPortal.class;
+ }
+ else if(portalObject instanceof Page)
+ {
+ type = UIPage.class;
+ }
+ else if(portalObject instanceof Window)
+ {
+ type = UIWindow.class;
+ }
+
+ return type;
+ }
+
+ /**
+ *
+ *
+ */
+ public void start()
+ {
+
+ }
+
+ /**
+ *
+ *
+ */
+ public void stop()
+ {
+
+ }
+}
Modified: branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
===================================================================
--- branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -26,8 +26,8 @@
import org.jboss.portal.presentation.server.Processor;
import org.jboss.portal.presentation.server.PresentationServer;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.model.state.ModelLoader;
+import org.jboss.portal.presentation.model.state.content.WindowContent;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.model.portal.command.response.MarkupResponse;
import org.jboss.portal.core.model.portal.PortalObjectId;
@@ -56,7 +56,7 @@
/**
*
*/
- private ModelLoader modelLoader;
+ private StructuralStateManager structuralStateManager;
/**
*
@@ -98,18 +98,18 @@
/**
*
*/
- public ModelLoader getModelLoader()
+ public StructuralStateManager getStructuralStateManager()
{
- return modelLoader;
+ return structuralStateManager;
}
/**
*
- * @param modelLoader
+ * @param structuralStateManager
*/
- public void setModelLoader(ModelLoader modelLoader)
+ public void setModelLoader(StructuralStateManager structuralStateManager)
{
- this.modelLoader = modelLoader;
+ this.structuralStateManager = structuralStateManager;
}
/**
Modified: branches/presentation/core-presentation/src/resources/presentation-sar/META-INF/jboss-service.xml
===================================================================
--- branches/presentation/core-presentation/src/resources/presentation-sar/META-INF/jboss-service.xml 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/core-presentation/src/resources/presentation-sar/META-INF/jboss-service.xml 2007-11-27 16:28:30 UTC (rev 9128)
@@ -82,7 +82,7 @@
<depends optional-attribute-name="CustomizationManager" proxy-type="attribute">portal:service=CustomizationManager</depends>
</mbean>
<mbean
- code="org.jboss.portal.core.presentation.model.ModelLoaderImpl"
+ code="org.jboss.portal.core.presentation.model.StructuralStateManagerImpl"
name="portal:container=ModelLoader"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -28,7 +28,7 @@
import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.model.UIPage;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.model.state.content.WindowContent;
import org.jboss.portal.presentation.protocol.GetActivation;
import org.jboss.portal.presentation.protocol.PostActivation;
import org.jboss.portal.presentation.protocol.ServerAction;
@@ -307,7 +307,7 @@
String token = st.nextToken();
buffer.append(token);
String id = buffer.toString();
- ObjectState objectState = this.presentationServer.getModelLoader().loadState(id);
+ ObjectState objectState = this.presentationServer.getStructuralStateManager().loadState(id);
if(objectState != null && objectState.getType() == UIPortal.class)
{
targetPortal = (UIPortal)requestContext.getUIContext().getObject(id);
@@ -336,7 +336,7 @@
String token = st.nextToken();
buffer.append(token);
String id = buffer.toString();
- ObjectState objectState = this.presentationServer.getModelLoader().loadState(id);
+ ObjectState objectState = this.presentationServer.getStructuralStateManager().loadState(id);
if(objectState != null)
{
if(objectState.getType() == UIPage.class)
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -78,7 +78,7 @@
/**
* TODO: decouple the implementation via factory pattern
*/
- uiContext = new UIContextImpl(this.presentationServer.getModelLoader());
+ uiContext = new UIContextImpl(this.presentationServer.getStructuralStateManager());
session.setAttribute("uicontext", uiContext);
}
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -25,7 +25,7 @@
import org.jboss.portal.presentation.model.UIContainer;
import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -31,8 +31,8 @@
import org.jboss.portal.presentation.model.UIPage;
import org.jboss.portal.presentation.model.UIContainer;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.state.ModelLoader;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -47,24 +47,24 @@
/**
*
*/
- private ModelLoader modelLoader = null;
+ private StructuralStateManager structuralStateManager = null;
- private static String getRootId(ModelLoader loader)
+ private static String getRootId(StructuralStateManager loader)
{
return loader.getRootId();
}
- private static ObjectState getRootState(ModelLoader loader)
+ private static ObjectState getRootState(StructuralStateManager loader)
{
return loader.loadState(loader.getRootId());
}
- public UIContextImpl(ModelLoader modelLoader)
+ public UIContextImpl(StructuralStateManager structuralStateManager)
{
- super(getRootId(modelLoader), getRootState(modelLoader));
+ super(getRootId(structuralStateManager), getRootState(structuralStateManager));
//
- this.modelLoader = modelLoader;
+ this.structuralStateManager = structuralStateManager;
// Put our self in the object cache
objects.put(getId(), this);
@@ -81,7 +81,7 @@
if (object == null)
{
//Fetch the state of the UIObject in question
- ObjectState objectState = this.modelLoader.loadState(id);
+ ObjectState objectState = this.structuralStateManager.loadState(id);
object = getImplementation(id, objectState);
objects.put(id, object);
}
@@ -124,9 +124,9 @@
/**
*
*/
- public ModelLoader getModelLoader()
+ public StructuralStateManager getModelLoader()
{
- return this.modelLoader;
+ return this.structuralStateManager;
}
/**
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -25,7 +25,7 @@
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.presentation.model.StateScopeType;
import org.jboss.portal.presentation.model.UIObject;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
import java.io.Serializable;
import java.util.HashMap;
@@ -270,7 +270,7 @@
// ((UIObjectImpl)child).id = this.generateChildId(name);
//
// //State
-// ((UIObjectImpl)child).state = this.getUIContext().getModelLoader().loadState(((UIObjectImpl)child).id);
+// ((UIObjectImpl)child).state = this.getUIContext().getStructuralStateManager().loadState(((UIObjectImpl)child).id);
//
// this.children.add(child);
//
@@ -312,7 +312,7 @@
// //Parent..load using parentId from state being used
// if(loadParent && state.getParentId() != null && state.getParentId().trim().length()>0)
// {
-// ObjectState parentState = uiContext.getModelLoader().loadState(state.getParentId());
+// ObjectState parentState = uiContext.getStructuralStateManager().loadState(state.getParentId());
// this.parent = uiContext.getObject(state.getParentId(), parentState.getType());
// }
//
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -26,7 +26,7 @@
import org.jboss.portal.presentation.model.UIContainer;
import org.jboss.portal.presentation.model.UIPage;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -25,7 +25,7 @@
import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.model.UIPortal;
import org.jboss.portal.presentation.model.UIPage;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -27,8 +27,8 @@
import org.jboss.portal.presentation.model.StateScopeType;
import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.content.WindowContent;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIContext.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIContext.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIContext.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -22,8 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.model;
-import java.util.Map;
-import org.jboss.portal.presentation.model.state.ModelLoader;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -42,5 +41,5 @@
*
* @return
*/
- ModelLoader getModelLoader();
+ StructuralStateManager getModelLoader();
}
Deleted: branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -1,45 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model.state;
-
-import org.jboss.portal.presentation.model.state.ObjectState;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface ModelLoader
-{
-
- /**
- * Load the state of a specified object.
- *
- * @param objectId the object id
- * @return the state of the object or null if such state does not exist
- * @throws IllegalArgumentException if the object id argument is null
- */
- ObjectState loadState(String objectId) throws IllegalArgumentException;
-
- String getRootId();
-
-}
Deleted: branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ObjectState.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ObjectState.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ObjectState.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -1,86 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model.state;
-
-import org.jboss.portal.presentation.model.UIObject;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ObjectState implements Serializable
-{
-
- /** . */
- private final Class<? extends UIObject> type;
-
- /** . */
- private final String name;
-
- /** . */
- private final Map<String, String> properties;
-
- /** . */
- private final String parentId;
-
- /** . */
- private final List<String> childrenIds;
-
- public ObjectState(Class<? extends UIObject> type, String name, Map<String, String> properties, String parentId, List<String> childrenIds)
- {
- this.type = type;
- this.name = name;
- this.properties = properties;
- this.parentId = parentId;
- this.childrenIds = childrenIds;
- }
-
- public Class<? extends UIObject> getType()
- {
- return type;
- }
-
- public String getName()
- {
- return name;
- }
-
- public Map<String, String> getProperties()
- {
- return properties;
- }
-
- public String getParentId()
- {
- return parentId;
- }
-
- public List<String> getChildrenIds()
- {
- return childrenIds;
- }
-}
Copied: branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java (from rev 9052, branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/content/WindowContent.java)
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java (rev 0)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.state.content;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowContent
+{
+
+ /** . */
+ private final long expirationMillis;
+
+ /** . */
+ private final String title;
+
+ /** . */
+ private final String markup;
+
+
+ public WindowContent(long expirationMillis, String title, String markup)
+ {
+ this.expirationMillis = expirationMillis;
+ this.title = title;
+ this.markup = markup;
+ }
+
+ public long getExpirationMillis()
+ {
+ return expirationMillis;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public String getMarkup()
+ {
+ return markup;
+ }
+}
Added: branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/ObjectState.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/ObjectState.java (rev 0)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/ObjectState.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.state.structural;
+
+import org.jboss.portal.presentation.model.UIObject;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectState implements Serializable
+{
+
+ /** . */
+ private final Class<? extends UIObject> type;
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final Map<String, String> properties;
+
+ /** . */
+ private final String parentId;
+
+ /** . */
+ private final List<String> childrenIds;
+
+ public ObjectState(Class<? extends UIObject> type, String name, Map<String, String> properties, String parentId, List<String> childrenIds)
+ {
+ this.type = type;
+ this.name = name;
+ this.properties = properties;
+ this.parentId = parentId;
+ this.childrenIds = childrenIds;
+ }
+
+ public Class<? extends UIObject> getType()
+ {
+ return type;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return properties;
+ }
+
+ public String getParentId()
+ {
+ return parentId;
+ }
+
+ public List<String> getChildrenIds()
+ {
+ return childrenIds;
+ }
+}
Added: branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java (rev 0)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.state.structural;
+
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface StructuralStateManager
+{
+
+ /**
+ * Load the state of a specified object.
+ *
+ * @param objectId the object id
+ * @return the state of the object or null if such state does not exist
+ * @throws IllegalArgumentException if the object id argument is null
+ */
+ ObjectState loadState(String objectId) throws IllegalArgumentException;
+
+ String getRootId();
+
+}
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/server/PresentationServer.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/server/PresentationServer.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/server/PresentationServer.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -24,8 +24,8 @@
import org.jboss.portal.presentation.client.PresentationContext;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.model.state.ModelLoader;
+import org.jboss.portal.presentation.model.state.content.WindowContent;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -53,5 +53,5 @@
*
* @return
*/
- ModelLoader getModelLoader();
+ StructuralStateManager getStructuralStateManager();
}
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.presentation.test.model;
-import org.jboss.portal.presentation.model.state.ModelLoader;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
import java.util.ArrayList;
import java.util.HashMap;
@@ -34,7 +34,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class MockModel implements ModelLoader
+public class MockModel implements StructuralStateManager
{
/** . */
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockObject.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockObject.java 2007-11-27 15:39:52 UTC (rev 9127)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockObject.java 2007-11-27 16:28:30 UTC (rev 9128)
@@ -27,7 +27,7 @@
import org.jboss.portal.presentation.model.UIPage;
import org.jboss.portal.presentation.model.UIPortal;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
16 years, 7 months
JBoss Portal SVN: r9127 - in branches/presentation/presentation/src/main/org/jboss/portal/presentation/client: controller and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-27 10:39:52 -0500 (Tue, 27 Nov 2007)
New Revision: 9127
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/PresentationContext.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java
Log:
minor javadoc
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/PresentationContext.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/PresentationContext.java 2007-11-27 14:33:03 UTC (rev 9126)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/PresentationContext.java 2007-11-27 15:39:52 UTC (rev 9127)
@@ -47,12 +47,15 @@
/**
* Returns the root UI context provided by the portal.
+ *
+ * @return the ui context
*/
UIContext getUIContext();
/**
- *
- * @return
+ * Returns the servlet context dispatcher.
+ *
+ * @return the servlet context dispatcher
*/
ServletContextDispatcher getDispatcher();
}
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java 2007-11-27 14:33:03 UTC (rev 9126)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java 2007-11-27 15:39:52 UTC (rev 9127)
@@ -49,7 +49,6 @@
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.util.List;
-import java.util.Map;
/**
* The UIServer is responsible for generating the output that is sent back to the client based on the Portal state of a particular Portal Request
16 years, 7 months
JBoss Portal SVN: r9126 - in docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-27 09:33:03 -0500 (Tue, 27 Nov 2007)
New Revision: 9126
Added:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials/jsf_portlet/package_myfaces42.png
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/clustering.xml
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/sso.xml
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/wsrp.xml
Log:
- Removed references to JBoss AS 4.0.x
- Added full example for JSF portlet bundling MyFaces libs for JBoss AS 4.2
Added: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials/jsf_portlet/package_myfaces42.png
===================================================================
(Binary files differ)
Property changes on: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/tutorials/jsf_portlet/package_myfaces42.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/clustering.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/clustering.xml 2007-11-27 14:07:26 UTC (rev 9125)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/clustering.xml 2007-11-27 14:33:03 UTC (rev 9126)
@@ -178,12 +178,6 @@
uncomment the following valve:
<programlisting><![CDATA[<Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />]]></programlisting>
- <note>
- If you use JBoss 4.0.x, the files and valve are respectively:
- <literal>$JBOSS_HOME/server/all/deploy/jbossweb-tomcat55.sar/server.xml</literal>
- <programlisting><![CDATA[<Valve className="org.jboss.web.tomcat.tc5.sso.ClusteredSingleSignOn" />]]></programlisting>
- </note>
-
More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
</para>
</sect2>
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/sso.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/sso.xml 2007-11-27 14:07:26 UTC (rev 9125)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/sso.xml 2007-11-27 14:33:03 UTC (rev 9126)
@@ -29,17 +29,12 @@
using a valve. The Single Sign On Valve caches credentials on the server side, and then invisibly authenticate users when they
reach different web applications. Credentials are stored in a host-wide session which means that SSO will be effective throughout the session.
</para>
- <note>Below we will describe configuration using <emphasis>JBoss Application Server 4.0.5</emphasis>. For different versions it can be slightly different.</note>
<sect2>
<title>Enabling Tomcat SSO Valve</title>
<para>
To enable SSO valve in Tomcat you should uncomment the following line
<programlisting><![CDATA[<Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>]]></programlisting>
in the <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal> file.
- <note>
- On JBoss 4.0.x the configuration file is
- <literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml</literal>
- </note>
More information can be found <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
</para>
</sect2>
@@ -53,7 +48,7 @@
</para>
<orderedlist>
<listitem>
- <para>Take a clean install of <emphasis>JBoss Application Server 4.0.5.GA</emphasis></para>
+ <para>Take a clean install of <emphasis>JBoss Application Server</emphasis></para>
</listitem>
<listitem>
<para>Edit <emphasis>$JBOSS_HOME/server/default/deploy/jmx-console.war/WEB-INF/web.xml</emphasis> file and make sure it contains following content:</para>
@@ -134,10 +129,6 @@
Uncomment the following line
<programlisting><![CDATA[<Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>]]></programlisting>
in the <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal> file.
- <note>
- On JBoss 4.0.x the configuration file is
- <literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml</literal>
- </note>
More information can be found <ulink
url="http://www.jboss.org/wiki/Wiki.jsp?page=SingleSignOn">here</ulink>.
</para>
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2007-11-27 14:07:26 UTC (rev 9125)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2007-11-27 14:33:03 UTC (rev 9126)
@@ -745,7 +745,7 @@
</sect3>
</sect2>
<sect2 id="sunri_42x">
- <title>A simple Sun's JSF Reference Implementation (RI) portlet on JBoss AS 4.2.x</title>
+ <title>A simple Sun's JSF Reference Implementation (RI) portlet on JBoss AS 4.2</title>
<sect3>
<title>Introduction</title>
<para>This section will introduce the reader to deploying a simple JSF portlet in JBoss Portal, using
@@ -888,13 +888,7 @@
</itemizedlist>
</para>
</sect3>
- <!--
<sect3>
- <title>JSP files</title>
- <para>TODO!!</para>
- </sect3>
- -->
- <sect3>
<title>Building and deploying your portlet</title>
<para>If you have downloaded the sample, you can execute the build.xml with ant or inside your IDE.
Executing <literal>ant</literal> will compile all source files and produce a
@@ -968,14 +962,17 @@
</para>
</sect3>
</sect2>-->
- <sect2 id="myfaces_40x">
- <title>A simple MyFaces JSF Portlet on JBoss AS 4.0.5+</title>
+ <sect2 id="myfaces_42x">
+ <title>A simple MyFaces JSF Portlet on JBoss AS 4.2</title>
<sect3>
<title>Introduction</title>
<para>This section will introduce the reader to deploying a simple JSF portlet in JBoss Portal, using
- Apache's MyFaces JSF implementation on JBoss AS 4.0.5+. It requires you download the HelloWorldJSFMyFacesPortlet
+ Apache's MyFaces JSF implementation on JBoss AS 4.2. It requires you download the HelloWorldJSFMyFaces42Portlet
from PortletSwap.com, using this link:
- <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...">http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...</ulink>.
+ <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...">http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...</ulink>.
+ There are actually different ways to do it, one would be to use MyFaces globally for the whole server and replace the Sun RI
+ libraries by the myFaces ones, but in this section the portlet will not affect the application server and embed its
+ own libraries.
</para>
</sect3>
<sect3>
@@ -983,25 +980,17 @@
<para>
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/tutorials/jsf_portlet/package_myfaces.png" valign="middle"/>
+ <imagedata align="center" fileref="images/tutorials/jsf_portlet/package_myfaces42.png" valign="middle"/>
</imageobject>
</mediaobject>
Like a typical JSF application, we also package our faces-config.xml that defines our
managed-beans, converters, validators, navigation rules, etc...
- <note>JBoss Application Server version 4.0.x bundles Apache's MyFaces JSF implementation in
- <literal>JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/jsf-libs/</literal>. As a result,
- you do not need to package MyFaces' libraries with your portlet application.
- </note>
+ The <filename>WEB-INF/lib</filename> must contain the MyFaces libraries along with dependent libraries.
</para>
- <para>For the sake of brevity, we only discuss the <literal>portlet.xml</literal> and
+ <para>For the sake of brevity, we only discuss the <literal>portlet.xml</literal>, <literal>web.xml</literal> and
<literal>faces-config.xml</literal> descriptors here. For discussion on the other descriptors, please
view <xref linkend="first_portlet_descriptors"/> or the chapter on descriptors:
<xref linkend="descriptors_portlet"/>.
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/jsf_portlet/package_myfaces.png" valign="middle"/>
- </imageobject>
- </mediaobject>
<itemizedlist>
<listitem>
<para><literal>portlet.xml</literal>
@@ -1055,6 +1044,18 @@
</para>
</listitem>
<listitem>
+ <para><literal>web.xml</literal>
+<programlisting><![CDATA[<context-param>
+ <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+ <param-value>true</param-value>
+</context-param>]]></programlisting>
+ We need this extra parameter to let the application server know that the package embeds its own libraries.
+ It will avoid collision with the Sun RI JSF libraries bundled with JBoss AS.
+ More details on this procedure can be found at <ulink
+ url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFaces">http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFaces</ulink>.
+ </para>
+ </listitem>
+ <listitem>
<para><literal>faces-config.xml</literal>
<programlisting><![CDATA[<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
@@ -1083,31 +1084,15 @@
</itemizedlist>
</para>
</sect3>
- <!--
<sect3>
- <title>JSP files</title>
- <para>TODO!!</para>
- </sect3>
- -->
- <sect3>
<title>Building and deploying your portlet</title>
<para>If you have downloaded the sample, you can execute the build.xml with ant or inside your IDE.
Executing <literal>ant</literal> will compile all source files and produce a
<literal>helloworldjsfportlet.war</literal> file in a way similar to what we saw in
<xref linkend="first_portlet_build"/>.
</para>
- <!--
<para>
- The <literal>explode</literal> target will produce the following:
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/jsf_portlet/exploded.gif" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- -->
- <para>
- Deploying the portlet is as easy as copying/moving the <literal>helloworldjspportlet.war</literal> file
+ Deploying the portlet is as easy as copying/moving the <literal>helloworldjsfmyfacesportlet.war</literal> file
to the server <literal>deploy</literal> directory. We can then see our portlet on the Portal default
page (<ulink url="http://localhost:8080/portal/">http://localhost:8080/portal/</ulink>):
<mediaobject>
@@ -1118,7 +1103,7 @@
</para>
</sect3>
</sect2>
- <sect2>
+ <!-- sect2>
<title>Adapting MyFaces JSF Portlet to work on JBoss AS 4.2.x</title>
<para>We saw in <xref linkend="myfaces_40x"/> how to create a JSF-based portlet using Apache's MyFaces
JSF implementation on JBoss Application Server 4.0.x. Starting with version 4.2.0 of JBoss Application
@@ -1148,7 +1133,7 @@
</imageobject>
</mediaobject>
</para>
- </sect2>
+ </sect2-->
<!-- sect2 id="richfaces">
<title>Portal and RichFaces: A basic demonstration using Ajax4JSF and RichFaces components</title>
<sect3>
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/wsrp.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/wsrp.xml 2007-11-27 14:07:26 UTC (rev 9125)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/wsrp.xml 2007-11-27 14:33:03 UTC (rev 9126)
@@ -84,19 +84,6 @@
<emphasis>JBOSS_HOME/server/default/deploy</emphasis>.
</para>
- <sect2>
- <title>Considerations to use WSRP behind firewall</title>
- <para>WSRP is built upon the JBoss WS web service stack. There is a known issue with the version 1.0.0.GA of JBoss
- WS (bundled with JBoss Application Server 4.0.4.GA) that prevents the complete deployment of JBoss
- Portal's WSRP service if the user is not online or behind a firewall/proxy. For this reason, we recommend
- that you deploy Portal on JBoss Application Server 4.0.5.GA. Alternatively, you can also perform a manual
- upgrade of JBoss WS, in which case we recommend that you use JBoss WS version 1.2.1.GA (and later).
- Please follow the instructions on
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRP_UpdateJBossWS">how to upgrade JBoss WS</ulink>
- as found on <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossPortal">JBoss Portal's wiki</ulink>.
- </para>
- </sect2>
-
<sect2 id="wsrp-ports">
<title>Considerations to use WSRP when running Portal on a non-default port</title>
<para>If you have modified the port number on which Portal runs, you will also need
16 years, 7 months
JBoss Portal SVN: r9125 - in branches/JBoss_Portal_Branch_2_6/faces: src/main/org/jboss/portal/faces/component/portlet and 1 other directory.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-27 09:07:26 -0500 (Tue, 27 Nov 2007)
New Revision: 9125
Modified:
branches/JBoss_Portal_Branch_2_6/faces/build.xml
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
Log:
- use portlet error css class
- comment not needed targets in build.xml
Modified: branches/JBoss_Portal_Branch_2_6/faces/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/build.xml 2007-11-27 13:20:08 UTC (rev 9124)
+++ branches/JBoss_Portal_Branch_2_6/faces/build.xml 2007-11-27 14:07:26 UTC (rev 9125)
@@ -162,7 +162,8 @@
<fileset dir="${build.classes}" includes="org/jboss/portal/faces/loader/**"/>
</jar>
- <!-- portal-faces.war -->
+ <!-- portal-faces.war is not needed, because we only need the .jars -->
+ <!--
<mkdir dir="${build.resources}/portal-faces-war/WEB-INF/lib"/>
<copy todir="${build.resources}/portal-faces-war/WEB-INF/lib">
<fileset dir="${build.lib}" includes="portal-faces-lib.jar"/>
@@ -171,6 +172,7 @@
<jar jarfile="${build.lib}/portal-faces.war">
<fileset dir="${build.resources}/portal-faces-war"/>
</jar>
+ -->
</target>
<!-- generates artifacts used for tests, requires output to be previously run -->
@@ -209,6 +211,8 @@
<!-- Deployment -->
<!-- ================================================================== -->
+ <!-- Both targets are not used -->
+ <!--
<target name="deploy"
description="Deploy."
depends="output">
@@ -222,7 +226,7 @@
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-faces.war"/>
</target>
-
+ -->
<target name="tests" depends="compile">
<execute-tests>
<x-sysproperty>
Modified: branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-11-27 13:20:08 UTC (rev 9124)
+++ branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-11-27 14:07:26 UTC (rev 9125)
@@ -600,7 +600,7 @@
else if (pir instanceof InsufficientPrivilegesResponse){
ResponseWriter writer = faces.getResponseWriter();
writer.startElement("div", this);
- writer.write("<p style=\"color: red;\">You don't have the privileges to access this resource.</p>");
+ writer.write("<p class=\"portlet-msg-error\">You don't have the privileges to access this resource.</p>");
writer.endElement("div");
writer.flush();
}
16 years, 7 months
JBoss Portal SVN: r9124 - branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-27 08:20:08 -0500 (Tue, 27 Nov 2007)
New Revision: 9124
Modified:
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
Log:
JBPORTAL-1814: added message for insufficient privileges response
Modified: branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-11-27 10:59:43 UTC (rev 9123)
+++ branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-11-27 13:20:08 UTC (rev 9124)
@@ -33,6 +33,7 @@
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.impl.PortletRequestDecoder;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import javax.faces.component.UICommand;
@@ -596,6 +597,13 @@
}
writer.flush();
}
+ else if (pir instanceof InsufficientPrivilegesResponse){
+ ResponseWriter writer = faces.getResponseWriter();
+ writer.startElement("div", this);
+ writer.write("<p style=\"color: red;\">You don't have the privileges to access this resource.</p>");
+ writer.endElement("div");
+ writer.flush();
+ }
}
catch (PortletInvokerException e)
{
16 years, 7 months
JBoss Portal SVN: r9123 - in branches/JBoss_Portal_Branch_2_6/widget/src: main/org/jboss/portal/widget/exceptions and 3 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-27 05:59:43 -0500 (Tue, 27 Nov 2007)
New Revision: 9123
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/DirectoryResultFailure.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp
Log:
JBPORTAL-1534: default height param for NV widgets
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java 2007-11-27 10:57:31 UTC (rev 9122)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java 2007-11-27 10:59:43 UTC (rev 9123)
@@ -216,7 +216,6 @@
if (w.isExpired())
{
entries.remove(url);
- System.out.println("removing entry: " + url.toString());
}
}
}
@@ -235,7 +234,6 @@
if (e.isExpired())
{
queries.remove(query);
- System.out.println("removing query: " + query.toString());
}
}
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/DirectoryResultFailure.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/DirectoryResultFailure.java 2007-11-27 10:57:31 UTC (rev 9122)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/DirectoryResultFailure.java 2007-11-27 10:59:43 UTC (rev 9123)
@@ -73,7 +73,7 @@
public String getLocalizedErrorMessage(Locale locale)
{
- return "Directory lookup failed";
+ return "Directory lookup failed.";
}
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java 2007-11-27 10:57:31 UTC (rev 9122)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java 2007-11-27 10:59:43 UTC (rev 9123)
@@ -95,7 +95,7 @@
}
else
{
- return "Error getting widget: "+ urlString;
+ return "Error getting Widget: "+ urlString;
}
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java 2007-11-27 10:57:31 UTC (rev 9122)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java 2007-11-27 10:59:43 UTC (rev 9123)
@@ -49,7 +49,7 @@
private final String id;
/** The default widget height */
- private final static String defaultHeight = "250";
+ private String defaultHeight = "250";
/** The netvibes widget info */
private final NetvibesWidgetInfo widgetInfo;
@@ -63,6 +63,11 @@
this.widgetInfo = widgetInfo;
}
+ public void setDefaultHeight(int defaultHeight)
+ {
+ this.defaultHeight = String.valueOf(defaultHeight);
+ }
+
public LocalizedString getDescription()
{
return this.widgetInfo.getMetaData().getDescription();
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java 2007-11-27 10:57:31 UTC (rev 9122)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java 2007-11-27 10:59:43 UTC (rev 9123)
@@ -30,6 +30,7 @@
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.PortletSecurityException;
@@ -52,6 +53,12 @@
/** . */
private NetvibesProvider provider = new NetvibesProvider();
+
+ /** . */
+ private static final String INIT_PARAM_DEFAULT_HEIGHT = "defaultHeight";
+
+ /** . */
+ private int defaultHeight = 0;
protected WidgetProvider getProvider()
@@ -59,6 +66,27 @@
return provider;
}
+ @Override
+ public void init() throws PortletException
+ {
+ super.init();
+ PortletConfig config = getPortletConfig();
+ //
+ String height = config.getInitParameter(INIT_PARAM_DEFAULT_HEIGHT);
+ if (height != null && height.length() > 0)
+ {
+ try
+ {
+ this.defaultHeight = Integer.parseInt(height);
+ }
+ catch(NumberFormatException e)
+ {
+ log.error("Error parsing defaultHeight parameter", e);
+ }
+ }
+
+ }
+
public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
if (req.getParameter("content.action.select") != null)
@@ -134,7 +162,11 @@
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
String uri = req.getParameter("uri");
- Widget widget = provider.getWidget(uri);
+ NetvibesWidget widget = (NetvibesWidget) provider.getWidget(uri);
+ if ( defaultHeight > 0)
+ {
+ widget.setDefaultHeight(defaultHeight);
+ }
if (widget != null)
{
if (widget.getTitle() != null)
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml 2007-11-27 10:57:31 UTC (rev 9122)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml 2007-11-27 10:59:43 UTC (rev 9123)
@@ -52,6 +52,11 @@
<name>fetchWidgetsOnDirectoryLookup</name>
<value>false</value>
</init-param>
+ <init-param>
+ <description>The default height of the widget if no height attribute is defined by the widget itself.</description>
+ <name>defaultHeight</name>
+ <value>250</value>
+ </init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp 2007-11-27 10:57:31 UTC (rev 9122)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp 2007-11-27 10:59:43 UTC (rev 9123)
@@ -380,10 +380,10 @@
<%
break;
} // endof switch
- } // endof if != hidden
%>
</tr>
<%
+ } // endof if != hidden
} // for preferences
%>
<tr>
16 years, 7 months
JBoss Portal SVN: r9122 - in docs/trunk/referenceGuide/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-27 05:57:31 -0500 (Tue, 27 Nov 2007)
New Revision: 9122
Added:
docs/trunk/referenceGuide/en/modules/widgetintegration.xml
Modified:
docs/trunk/referenceGuide/en/master.xml
Log:
two words about widget integration and configuration
Modified: docs/trunk/referenceGuide/en/master.xml
===================================================================
--- docs/trunk/referenceGuide/en/master.xml 2007-11-27 10:41:30 UTC (rev 9121)
+++ docs/trunk/referenceGuide/en/master.xml 2007-11-27 10:57:31 UTC (rev 9122)
@@ -27,6 +27,7 @@
<!ENTITY security SYSTEM "modules/security.xml">
<!ENTITY troubleshooting SYSTEM "modules/troubleshooting.xml">
<!ENTITY contentintegration SYSTEM "modules/contentintegration.xml">
+ <!ENTITY widgetintegration SYSTEM "modules/widgetintegration.xml">
<!ENTITY portalapi SYSTEM "modules/portalapi.xml">
<!ENTITY errorhandling SYSTEM "modules/errorhandling.xml">
<!ENTITY portletmodes SYSTEM "modules/portletmodes.xml">
@@ -77,6 +78,7 @@
<!-- Understanding urls --> &urls;
<!-- Error handling --> &errorhandling;
<!-- Content integration --> &contentintegration;
+ <!-- Widget integration --> &widgetintegration;
<!-- Portlet modes --> &portletmodes;
<!-- Portal API --> &portalapi;
<!-- Clustering configuration --> &clustering;
Added: docs/trunk/referenceGuide/en/modules/widgetintegration.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/widgetintegration.xml (rev 0)
+++ docs/trunk/referenceGuide/en/modules/widgetintegration.xml 2007-11-27 10:57:31 UTC (rev 9122)
@@ -0,0 +1,86 @@
+<chapter id="widgets">
+ <chapterinfo>
+ <author>
+ <firstname>Emanuel</firstname>
+ <surname>Muckenhuber</surname>
+ <email>emuckenh(a)redhat.com</email>
+ </author>
+ </chapterinfo>
+ <title>Widget Integration</title>
+ <sect1>
+ <title>Introduction</title>
+ <para>JBoss Portal supports the integration of Google gadgets and Netvibes (<ulink url="http://dev.netvibes.com/doc/uwa_specification">UWA</ulink> compatible)
+ widgets out of the box. This integration allows you to display the content of the widget within a portlet.
+ Both types can be added in the administration interface by editing the 'Page Layout' of a page or in the configuration of the users dashboard
+ when selecting the appropriate 'Content type'.
+ </para>
+ </sect1>
+ <sect1>
+ <title>Widget portlet configuration</title>
+ <para>It is possible to modify certain behavior of caching and fetching widgets by changing the init-param of the portlets.</para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <emphasis role="bold">connectionTimeout</emphasis>
+ <para>
+ Connection timeout for the directory lookup in milliseconds.
+ </para>
+ </listitem>
+ <listitem>
+ <emphasis role="bold">widgetExpiration</emphasis>
+ <para>
+ Time in minutes for which a widget should be cached. After this time the widget will be fetched again.
+ </para>
+ </listitem>
+ <listitem>
+ <emphasis role="bold">queryExpiration</emphasis>
+ <para>
+ Times in minutes for which a directory query should be cached. After this time the query will be performed again.
+ </para>
+ </listitem>
+ <listitem>
+ <emphasis role="bold">fetchWidgetsOnDirectoryLookup</emphasis>
+ <para>
+ This parameter defines if all widgets from a directory lookup should be fetched at the time of the query or not.
+ The default values is false. This means that widgets are only fetched on demand - when the information is really needed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ The parameter can be changed for both widget types identically in either:
+ <itemizedlist>
+ <listitem><emphasis>jboss-portal.sar/portal-widget.war/WEB-INF/portlet.xml</emphasis> (for google gadgets)</listitem>
+ <listitem>or <emphasis>jboss-portal.sar/portal-widget-netvibes.war/WEB-INF/portlet.xml</emphasis> (for netvibes widgets).</listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <programlisting><![CDATA[...
+ <portlet>
+ ...
+ <init-param>
+ <name>connectionTimeout</name>
+ <value>5000</value>
+ </init-param>
+ <init-param>
+ <name>widgetExpiration</name>
+ <value>360</value>
+ </init-param>
+ <init-param>
+ <name>queryExpiration</name>
+ <value>60</value>
+ </init-param>
+ <init-param>
+ <name>fetchWidgetsOnDirectoryLookup</name>
+ <value>false</value>
+ </init-param>
+ ...
+ </portlet>
+...]]></programlisting>
+ </para>
+ <para>
+ For Netvibes widgets it is also possible to define a init-param called <emphasis role="bold">defaultHeight</emphasis> to set a specific
+ default height if no height is defined by the widget itself. The default value is 250.
+ </para>
+ </sect1>
+</chapter>
16 years, 7 months
JBoss Portal SVN: r9121 - branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-27 05:41:30 -0500 (Tue, 27 Nov 2007)
New Revision: 9121
Added:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java
Log:
JBPORTAL-1805: Let a user define multiple display-name for a portal object in the admin portlet
Draft for Wesley
Added: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java 2007-11-27 10:41:30 UTC (rev 9121)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.admin.ui.actions;
+
+import java.util.Locale;
+import java.util.Map;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.core.model.portal.PortalObject;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class PortalObjectDisplayNameAction
+{
+
+ private PortalObject selectedObject;
+
+ private Locale newLocale;
+
+ private String newText;
+
+ public void addDisplayName()
+ {
+ LocalizedString localizedString = selectedObject.getDisplayName();
+ Map map = localizedString.getValues();
+ map.put(newLocale, new LocalizedString.Value(newLocale, newText));
+ LocalizedString newLocalizedString = new LocalizedString(map, Locale.ENGLISH);
+ selectedObject.setDisplayName(newLocalizedString);
+ }
+
+
+}
+
16 years, 7 months
JBoss Portal SVN: r9120 - in branches/JBoss_Portal_Branch_2_6/core-wsrp/src: main/org/jboss/portal/wsrp/admin/ui and 4 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-26 22:07:34 -0500 (Mon, 26 Nov 2007)
New Revision: 9120
Added:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/bin/portal-wsrp-admin-war/img/msgIcon_Warning.gif
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/confirmPropDeletion.xhtml
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
Log:
- JBPORTAL-1715:
+ Added possibility to cancel modifications.
+ Added removal of registration property.
+ Made requiring registration immediate for better usability.
- JBPORTAL-1818: Added confirmation dialogs for registration property, consumer and local registration deletions.
Copied: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/bin/portal-wsrp-admin-war/img/msgIcon_Warning.gif (from rev 8951, branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/msgIcon_Warning.gif)
===================================================================
(Binary files differ)
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-11-27 01:39:35 UTC (rev 9119)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-11-27 03:07:34 UTC (rev 9120)
@@ -29,6 +29,7 @@
import org.jboss.portal.wsrp.consumer.RefreshResult;
import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
@@ -270,6 +271,12 @@
return INDEX;
}
+ public void selectConsumer(ActionEvent actionEvent)
+ {
+ refreshConsumerId();
+ setConsumerIdInSession(false);
+ }
+
private String refreshConsumerId()
{
selectedId = beanContext.getParameter("id");
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-11-27 01:39:35 UTC (rev 9119)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-11-27 03:07:34 UTC (rev 9120)
@@ -30,6 +30,9 @@
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import java.util.ArrayList;
import java.util.Collections;
@@ -50,6 +53,7 @@
private static final String PROPERTY = "property";
private static int counter = 0;
private static final String PRODUCER = "producer";
+ private String selectedProp;
public ProducerConfigurationService getConfigurationService()
{
@@ -149,6 +153,11 @@
return Collections.singletonList(new SelectItem("xsd:string"));
}
+ public String getSelectedPropertyName()
+ {
+ return selectedProp;
+ }
+
public String save()
{
try
@@ -167,9 +176,42 @@
return PRODUCER;
}
+ public String reloadConfiguration()
+ {
+ try
+ {
+ configurationService.reloadConfiguration();
+ }
+ catch (Exception e)
+ {
+ log.debug(e);
+ beanContext.createErrorMessage("status", "Couldn't reload producer configuration. Cause: " + e.getLocalizedMessage());
+ }
+ return PRODUCER;
+ }
+
public String addRegistrationProperty()
{
getRegRequirements().addEmptyRegistrationProperty(PROPERTY + counter++);
return PRODUCER;
}
+
+ public String deleteRegistrationProperty()
+ {
+ getRegRequirements().removeRegistrationProperty(selectedProp);
+ return PRODUCER;
+ }
+
+ public void requireRegistrationListener(ValueChangeEvent event)
+ {
+ setRegistrationRequired((Boolean)event.getNewValue());
+
+ // bypass the rest of the life cycle and re-display page
+ FacesContext.getCurrentInstance().renderResponse();
+ }
+
+ public void selectProperty(ActionEvent event)
+ {
+ selectedProp = beanContext.getParameter("propName");
+ }
}
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-11-27 01:39:35 UTC (rev 9119)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-11-27 03:07:34 UTC (rev 9120)
@@ -87,7 +87,7 @@
<managed-bean>
<managed-bean-name>producer</managed-bean-name>
<managed-bean-class>org.jboss.portal.wsrp.admin.ui.ProducerBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>configurationService</property-name>
<property-class>org.jboss.portal.wsrp.producer.config.ProducerConfigurationService</property-class>
@@ -113,5 +113,17 @@
<from-outcome>producer</from-outcome>
<to-view-id>/WEB-INF/jsf/producer/producer.xhtml</to-view-id>
</navigation-case>
+ <navigation-case>
+ <from-outcome>confirmPropDeletion</from-outcome>
+ <to-view-id>/WEB-INF/jsf/producer/confirmPropDeletion.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>confirmEraseRegistration</from-outcome>
+ <to-view-id>/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>confirmDeleteConsumer</from-outcome>
+ <to-view-id>/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml</to-view-id>
+ </navigation-case>
</navigation-rule>
</faces-config>
Added: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml 2007-11-27 03:07:34 UTC (rev 9120)
@@ -0,0 +1,35 @@
+<ui:decorate template="consumerTemplate.xhtml" xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:jbp="http://www.jboss.org/portal"
+ xmlns:c="http://java.sun.com/jstl/core">
+
+ <ui:param name="title" value=""/>
+ <ui:define name="content">
+
+ <div class="portlet-msg">
+ <div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
+ <div class="portlet-msg-body">
+ <h3>Delete '#{consumersMgr.selectedConsumer.producerId}' consumer?</h3>
+
+ <p class="portlet-msg-alert">
+ You are about to delete the '#{consumersMgr.selectedConsumer.producerId}' consumer!
+ </p>
+
+ <p class="portlet-class">Are you sure you want to proceed?</p>
+
+ <h:form>
+ <h:commandLink value="Delete consumer" action="#{consumersMgr.destroyConsumer}"
+ styleClass="portlet-form-button portlet-section-buttonrow">
+ <f:param name="id" value="#{consumersMgr.selectedConsumer.producerId}"/>
+ </h:commandLink>
+ <h:commandButton value="Cancel" action="#{consumersMgr.listConsumers}"
+ styleClass="portlet-form-button portlet-section-buttonrow"/>
+ </h:form>
+ </div>
+ </div>
+
+ </ui:define>
+
+</ui:decorate>
\ No newline at end of file
Added: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml 2007-11-27 03:07:34 UTC (rev 9120)
@@ -0,0 +1,39 @@
+<ui:decorate template="consumerTemplate.xhtml" xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:jbp="http://www.jboss.org/portal"
+ xmlns:c="http://java.sun.com/jstl/core">
+
+ <ui:param name="title" value=""/>
+ <ui:define name="content">
+
+ <div class="portlet-msg">
+ <div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
+ <div class="portlet-msg-body">
+ <h3>Delete local registration for '#{consumer.id}' consumer?</h3>
+
+ <p class="portlet-msg-alert">
+ You are about to delete the local registration information for the '#{consumer.id}' consumer!
+ This is only needed if this consumer had previously registered with the remote producer and this producer
+ has been modified to not require registration anymore.<br/><br/>
+
+ Only erase local registration information if you experience errors with the producer due to this
+ particular situation. Erasing local registration when not required might lead to inability to work with
+ this producer anymore.
+ </p>
+
+ <p class="portlet-class">Are you sure you want to proceed?</p>
+
+ <h:form>
+ <h:commandButton value="Erase local registration" action="#{consumer.eraseLocalRegistration}"
+ styleClass="portlet-form-button portlet-section-buttonrow"/>
+ <h:commandButton value="Cancel" action="configureConsumer"
+ styleClass="portlet-form-button portlet-section-buttonrow"/>
+ </h:form>
+ </div>
+ </div>
+
+ </ui:define>
+
+</ui:decorate>
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-11-27 01:39:35 UTC (rev 9119)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-11-27 03:07:34 UTC (rev 9120)
@@ -63,7 +63,8 @@
<f:param name="register" value="#{!consumer.producerInfo.registered}"/>
<h:outputText value="#{consumer.producerInfo.registered ? 'Deregister' : 'Register'}"/>
</h:commandLink>
- </c:if> | <h:commandLink action="#{consumersMgr.destroyConsumer}" styleClass="actionDelete">
+ </c:if> | <h:commandLink action="confirmDeleteConsumer" styleClass="actionDelete"
+ actionListener="#{consumersMgr.selectConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
<h:outputText value="Delete"/>
</h:commandLink>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-11-27 01:39:35 UTC (rev 9119)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-11-27 03:07:34 UTC (rev 9120)
@@ -117,7 +117,7 @@
<th>Registration context:</th>
<td id="handle">
Handle: <h:outputText value="#{consumer.producerInfo.registrationInfo.registrationHandle}"/>
- <h:commandLink action="#{consumer.eraseLocalRegistration}" value="Erase local registration"
+ <h:commandLink action="confirmEraseRegistration" value="Erase local registration"
title="Erase local registration information (potentially dangerous!)"
styleClass="portlet-form-button"/>
</td>
Added: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/confirmPropDeletion.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/confirmPropDeletion.xhtml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/confirmPropDeletion.xhtml 2007-11-27 03:07:34 UTC (rev 9120)
@@ -0,0 +1,35 @@
+<ui:decorate template="producerTemplate.xhtml" xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:jbp="http://www.jboss.org/portal"
+ xmlns:c="http://java.sun.com/jstl/core">
+
+ <ui:param name="title" value=""/>
+ <ui:define name="content">
+
+ <div class="portlet-msg">
+ <div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
+ <div class="portlet-msg-body">
+ <h3>Delete '#{producer.selectedPropertyName}' registration property description?</h3>
+
+ <p class="portlet-msg-alert">
+ You are about to delete the '#{producer.selectedPropertyName}' registration property description!
+ This will trigger invalidation of consumer registrations which will have to modify their registration
+ information.
+ </p>
+
+ <p class="portlet-class">Are you sure you want to proceed?</p>
+
+ <h:form>
+ <h:commandButton value="Delete" action="#{producer.deleteRegistrationProperty}"
+ styleClass="portlet-form-button portlet-section-buttonrow"/>
+ <h:commandButton value="Cancel" action="producer"
+ styleClass="portlet-form-button portlet-section-buttonrow"/>
+ </h:form>
+ </div>
+ </div>
+
+ </ui:define>
+
+</ui:decorate>
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2007-11-27 01:39:35 UTC (rev 9119)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2007-11-27 03:07:34 UTC (rev 9120)
@@ -12,12 +12,15 @@
<h:selectBooleanCheckbox value="#{producer.registrationRequiredForFullDescription}"/>
<h:outputText value="Access to full service description requires consumers to be registered."/>
- <h:selectBooleanCheckbox value="#{producer.registrationRequired}"/>
- <h:outputText value="Requires registration."/>
+ <h:selectBooleanCheckbox value="#{producer.registrationRequired}" immediate="true"
+ onchange="this.form.submit()"
+ valueChangeListener="#{producer.requireRegistrationListener}"/>
+ <h:outputText
+ value="Requires registration. Modifying this information will trigger invalidation of consumer registrations."/>
<h:outputText value=" " rendered="#{producer.registrationRequired}"/>
- <h:panelGroup>
- <h:panelGrid columns="2" rendered="#{producer.registrationRequired}" width="100%">
+ <h:panelGroup rendered="#{producer.registrationRequired}">
+ <h:panelGrid columns="2" width="100%">
<h:outputLabel value="Registration policy class name:" for="registrationPolicy"/>
<h:inputText id="registrationPolicy" value="#{producer.registrationPolicyClassName}" size="80"/>
@@ -57,6 +60,14 @@
<f:facet name="header">Hint</f:facet>
<h:inputText value="#{property.hint}" size="50"/>
</h:column>
+ <h:column>
+ <f:facet name="header">Action</f:facet>
+ <h:commandLink action="confirmPropDeletion" value="Remove"
+ styleClass="portlet-form-button"
+ actionListener="#{producer.selectProperty}">
+ <f:param name="propName" value="#{property.nameAsString}"/>
+ </h:commandLink>
+ </h:column>
</h:dataTable>
</c:when>
<c:otherwise>
@@ -69,7 +80,11 @@
</h:panelGroup>
<h:outputText value=" "/>
- <h:commandButton action="#{producer.save}" value="Save" styleClass="portlet-form-button"/>
+ <h:panelGroup styleClass="portlet-section-buttonrow">
+ <h:commandButton action="#{producer.save}" value="Save" styleClass="portlet-form-button"/>
+ <h:commandButton action="#{producer.reloadConfiguration}" value="Cancel"
+ styleClass="portlet-form-button"/>
+ </h:panelGroup>
</h:panelGrid>
</h:form>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-11-27 01:39:35 UTC (rev 9119)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-11-27 03:07:34 UTC (rev 9120)
@@ -321,4 +321,18 @@
padding: 4px;
margin: 0;
display: block;
-}
\ No newline at end of file
+}
+
+.wsrp-consumers-ui .portlet-msg {
+ border: 1px solid #bbb;
+ margin: 2em auto;
+ padding: 1em;
+ width: 60%;
+}
+
+.wsrp-consumers-ui .portlet-msg-body {
+ position: relative;
+ top: -3em;
+ left: 3em;
+ width: 95%;
+}
16 years, 7 months
JBoss Portal SVN: r9119 - in branches/presentation/presentation/src/main/org/jboss/portal/presentation: model and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-26 20:39:35 -0500 (Mon, 26 Nov 2007)
New Revision: 9119
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIObject.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/ModelTestCase.java
Log:
basic test of get/set property on model
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2007-11-27 01:26:52 UTC (rev 9118)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2007-11-27 01:39:35 UTC (rev 9119)
@@ -147,6 +147,11 @@
return safeCast(map.get(propertyName), propertyType);
}
+ public Object getProperty(StateScopeType scopeType, String propertyName)
+ {
+ return getProperty(scopeType, propertyName, Object.class);
+ }
+
public <T> void setProperty(StateScopeType scopeType, String propertyName, T propertyValue)
{
Map map;
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIObject.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIObject.java 2007-11-27 01:26:52 UTC (rev 9118)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIObject.java 2007-11-27 01:39:35 UTC (rev 9119)
@@ -52,6 +52,16 @@
<T> T getProperty(StateScopeType scopeType, String propertyName, Class<T> propertyType);
+ /**
+ * Equivalent to call <code>getProperty(StateScopeType,String,Class)</code> with the <code>Object.class</code>
+ * literal.
+ *
+ * @param scopeType
+ * @param propertyName
+ * @return
+ */
+ Object getProperty(StateScopeType scopeType, String propertyName);
+
<T> void setProperty(StateScopeType scopeType, String propertyName, T propertyValue);
/**
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java 2007-11-27 01:26:52 UTC (rev 9118)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java 2007-11-27 01:39:35 UTC (rev 9119)
@@ -169,11 +169,11 @@
}
if (value != null)
{
- properties.remove(name);
+ properties.put(name, value);
}
else
{
- properties.put(name, value);
+ properties.remove(name);
}
}
}
Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/ModelTestCase.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/ModelTestCase.java 2007-11-27 01:26:52 UTC (rev 9118)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/ModelTestCase.java 2007-11-27 01:39:35 UTC (rev 9119)
@@ -25,6 +25,7 @@
import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.jboss.portal.presentation.impl.model.UIContextImpl;
+import org.jboss.portal.presentation.model.StateScopeType;
import org.jboss.portal.presentation.model.UIContext;
import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.model.UIPage;
@@ -184,4 +185,55 @@
assertEquals(defaultPortal.getName(), "defaultPortal");
assertEquals(mockDefaultPortal.getId(), defaultPortal.getId());
}
+
+ public void testProperty()
+ {
+ MockObject mockFoo = model.getContext().addChild("foo", MockObject.Type.PORTAL);
+ mockFoo.setProperty("foo_name", "foo_value");
+ UIContext context = new UIContextImpl(model);
+
+ //
+ UIPortal foo = (UIPortal)context.getObject(mockFoo.getId());
+ assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT, "foo_name", String.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT, "foo_name", Object.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.PERSISTENT, "foo_name", Float.class));
+ assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name", Object.class));
+ assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name", Float.class));
+ assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name", Object.class));
+ assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name", Float.class));
+
+ //
+ foo.setProperty(StateScopeType.NAVIGATIONAL, "foo_name", 0);
+ assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT, "foo_name", String.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT, "foo_name", Object.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.PERSISTENT, "foo_name", Float.class));
+ assertEquals(0, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name", Object.class));
+ assertEquals(new Integer(0), foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name", Integer.class));
+ assertEquals(0, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name", Float.class));
+ assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name", Object.class));
+ assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name", Float.class));
+
+ //
+ foo.setProperty(StateScopeType.TRANSIENT, "foo_name", true);
+ assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT, "foo_name", String.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT, "foo_name", Object.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.PERSISTENT, "foo_name", Float.class));
+ assertEquals(0, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name", Object.class));
+ assertEquals(new Integer(0), foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name", Integer.class));
+ assertEquals(0, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name", Float.class));
+ assertEquals(true, foo.getProperty(StateScopeType.TRANSIENT, "foo_name", Object.class));
+ assertEquals(true, foo.getProperty(StateScopeType.TRANSIENT, "foo_name"));
+ assertEquals(Boolean.TRUE, foo.getProperty(StateScopeType.TRANSIENT, "foo_name", Boolean.class));
+ assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name", Float.class));
+
+ //
+ }
}
16 years, 7 months