JBoss Portal SVN: r7510 - trunk/faces/src/main/org/jboss/portal/faces/portlet.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-06-21 18:13:14 -0400 (Thu, 21 Jun 2007)
New Revision: 7510
Added:
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeException.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/MyFacesJSFBridge.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/SunRIJSFBridge.java
Modified:
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridge.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFacesContextFactoryImpl.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFactory.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeLifecycleFactoryImpl.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeViewHandlerImpl.java
Log:
Since it works, let's make it a bit more OO
Modified: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridge.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridge.java 2007-06-21 22:12:43 UTC (rev 7509)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridge.java 2007-06-21 22:13:14 UTC (rev 7510)
@@ -22,28 +22,19 @@
******************************************************************************/
package org.jboss.portal.faces.portlet;
+import javax.faces.application.ViewHandler;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.lifecycle.LifecycleFactory;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision: 1.1 $
*/
-public class JSFMetaBridge
+public abstract class JSFMetaBridge
{
/** . */
- static final JSFMetaBridge SUN_JSF = new JSFMetaBridge(
- "jsfportletbridge",
- "com.sun.faces.portlet.FacesPortlet",
- "com.sun.faces.portlet.INIT_VIEW"
- );
-
- /** . */
- static final JSFMetaBridge MYFACES_JSF = new JSFMetaBridge(
- "myfaces",
- "org.apache.myfaces.portlet.MyFacesGenericPortlet",
- "default-view"
- );
-
- /** . */
private final String name;
/** . */
@@ -51,12 +42,23 @@
/** . */
private final String initParamViewName;
+
+ protected FacesContextFactory facesContextFactory;
+ protected LifecycleFactory lifecycleFactory;
+
+ protected ViewHandler viewHandler;
+
public JSFMetaBridge(String name, String portletClassName, String initParamViewName)
{
this.name = name;
this.portletClassName = portletClassName;
this.initParamViewName = initParamViewName;
+ try {
+ init();
+ } catch (JSFMetaBridgeException e) {
+ e.printStackTrace();
+ }
}
public String getName()
@@ -73,4 +75,29 @@
{
return initParamViewName;
}
+
+ protected abstract void init() throws JSFMetaBridgeException;
+
+ public FacesContextFactory getFacesContextFactory()
+ {
+ return facesContextFactory;
+ }
+
+ public LifecycleFactory getLifecycleFactory()
+ {
+ return lifecycleFactory;
+ }
+
+ public ViewHandler getViewHandler()
+ {
+ return viewHandler;
+ }
+
+ protected Object getInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
+ {
+ Class clazz;
+ clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
+ return clazz.newInstance();
+ }
+
}
Added: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeException.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeException.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeException.java 2007-06-21 22:13:14 UTC (rev 7510)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.faces.portlet;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 1.1 $
+ */
+public class JSFMetaBridgeException extends Exception
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3083908834311924353L;
+
+ public JSFMetaBridgeException(String string, Exception e)
+ {
+ super(string, e);
+ }
+
+}
Modified: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFacesContextFactoryImpl.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFacesContextFactoryImpl.java 2007-06-21 22:12:43 UTC (rev 7509)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFacesContextFactoryImpl.java 2007-06-21 22:13:14 UTC (rev 7510)
@@ -39,44 +39,7 @@
public JSFMetaBridgeFacesContextFactoryImpl()
{
JSFMetaBridge metaBridge = JSFMetaBridgeFactory.getMetaBridge();
- if (metaBridge.getPortletClassName().equals(JSFMetaBridge.SUN_JSF.getPortletClassName()))
- {
- Class clazz;
- try
- {
- clazz = Thread.currentThread().getContextClassLoader().loadClass("com.sun.faces.portlet.FacesContextFactoryImpl");
- facesContextFactory = (FacesContextFactory) clazz.newInstance();
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- else if (metaBridge.getPortletClassName().equals(JSFMetaBridge.MYFACES_JSF.getPortletClassName()))
- {
- Class clazz;
- try
- {
- clazz = Thread.currentThread().getContextClassLoader().loadClass("org.apache.myfaces.context.FacesContextFactoryImpl");
- facesContextFactory = (FacesContextFactory) clazz.newInstance();
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-
+ facesContextFactory = metaBridge.getFacesContextFactory();
}
public FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException
Modified: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFactory.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFactory.java 2007-06-21 22:12:43 UTC (rev 7509)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFactory.java 2007-06-21 22:13:14 UTC (rev 7510)
@@ -44,11 +44,11 @@
String className = FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY).getClass().getName();
if ("com.sun.faces.application.ApplicationFactoryImpl".equals(className))
{
- metaBridge = JSFMetaBridge.SUN_JSF;
+ metaBridge = new SunRIJSFBridge();
}
else if ("org.apache.myfaces.application.ApplicationFactoryImpl".equals(className))
{
- metaBridge = JSFMetaBridge.MYFACES_JSF;
+ metaBridge = new MyFacesJSFBridge();
}
//
Modified: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeLifecycleFactoryImpl.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeLifecycleFactoryImpl.java 2007-06-21 22:12:43 UTC (rev 7509)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeLifecycleFactoryImpl.java 2007-06-21 22:13:14 UTC (rev 7510)
@@ -39,50 +39,12 @@
public JSFMetaBridgeLifecycleFactoryImpl()
{
JSFMetaBridge metaBridge = JSFMetaBridgeFactory.getMetaBridge();
- if (metaBridge.getPortletClassName().equals(JSFMetaBridge.SUN_JSF.getPortletClassName()))
- {
- Class clazz;
- try
- {
- clazz = Thread.currentThread().getContextClassLoader().loadClass("com.sun.faces.portlet.LifecycleFactoryImpl");
- lifecycleFactory = (LifecycleFactory) clazz.newInstance();
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- else if (metaBridge.getPortletClassName().equals(JSFMetaBridge.MYFACES_JSF.getPortletClassName()))
- {
- Class clazz;
- try
- {
- clazz = Thread.currentThread().getContextClassLoader().loadClass("org.apache.myfaces.lifecycle.LifecycleFactoryImpl");
- lifecycleFactory = (LifecycleFactory) clazz.newInstance();
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-
+ lifecycleFactory = metaBridge.getLifecycleFactory();
}
public void addLifecycle(String lifecycleId, Lifecycle lifecycle)
{
lifecycleFactory.addLifecycle(lifecycleId, lifecycle);
-
}
public Lifecycle getLifecycle(String lifecycleId)
Modified: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeViewHandlerImpl.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeViewHandlerImpl.java 2007-06-21 22:12:43 UTC (rev 7509)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeViewHandlerImpl.java 2007-06-21 22:13:14 UTC (rev 7510)
@@ -23,14 +23,9 @@
package org.jboss.portal.faces.portlet;
import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
import java.util.Locale;
import javax.faces.FacesException;
-import javax.faces.FactoryFinder;
-import javax.faces.application.Application;
-import javax.faces.application.ApplicationFactory;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
@@ -47,66 +42,7 @@
public JSFMetaBridgeViewHandlerImpl()
{
JSFMetaBridge metaBridge = JSFMetaBridgeFactory.getMetaBridge();
- if (metaBridge.getPortletClassName().equals(JSFMetaBridge.SUN_JSF.getPortletClassName()))
- {
- Application application = ((ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication();
- ViewHandler oldViewHandler = application.getViewHandler();
-
- Class clazz;
- try
- {
- Class[] parameterTypes = new Class[] { ViewHandler.class };
- clazz = Thread.currentThread().getContextClassLoader().loadClass("com.sun.faces.portlet.ViewHandlerImpl");
- Constructor constructor = clazz.getConstructor(parameterTypes);
- viewHandler = (ViewHandler) constructor.newInstance(new Object[] { oldViewHandler });
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
- else if (metaBridge.getPortletClassName().equals(JSFMetaBridge.MYFACES_JSF.getPortletClassName()))
- {
- Application application = ((ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication();
- viewHandler = application.getViewHandler();
-/*
- Class clazz;
- try
- {
- clazz = Thread.currentThread().getContextClassLoader().loadClass("org.apache.myfaces.application.jsp.JspViewHandlerImpl");
- viewHandler = (ViewHandler) clazz.newInstance();
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-*/
- }
-
-
+ viewHandler = metaBridge.getViewHandler();
}
public Locale calculateLocale(FacesContext context)
Added: trunk/faces/src/main/org/jboss/portal/faces/portlet/MyFacesJSFBridge.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/MyFacesJSFBridge.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/MyFacesJSFBridge.java 2007-06-21 22:13:14 UTC (rev 7510)
@@ -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.faces.portlet;
+
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+import javax.faces.application.ViewHandler;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.lifecycle.LifecycleFactory;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 1.1 $
+ */
+public class MyFacesJSFBridge extends JSFMetaBridge
+{
+
+ private ViewHandler viewHandler;
+
+ public MyFacesJSFBridge()
+ {
+ super("myfaces", "org.apache.myfaces.portlet.MyFacesGenericPortlet",
+ "default-view");
+ }
+
+ protected void init() throws JSFMetaBridgeException
+ {
+ try
+ {
+ lifecycleFactory = (LifecycleFactory) getInstance("org.apache.myfaces.lifecycle.LifecycleFactoryImpl");
+ }
+ catch (Exception e)
+ {
+ throw new JSFMetaBridgeException(
+ "Cannot create the JSF lifecycle Factory", e);
+ }
+
+ try
+ {
+ facesContextFactory = (FacesContextFactory) getInstance("org.apache.myfaces.context.FacesContextFactoryImpl");
+ }
+ catch (Exception e)
+ {
+ throw new JSFMetaBridgeException(
+ "Cannot create the JSF Faces Context Factory", e);
+ }
+
+ Application application = ((ApplicationFactory) FactoryFinder
+ .getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication();
+ viewHandler = application.getViewHandler();
+ }
+
+ public ViewHandler getViewHandler()
+ {
+ if (viewHandler == null)
+ {
+ Application application = ((ApplicationFactory) FactoryFinder
+ .getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication();
+ viewHandler = application.getViewHandler();
+ }
+ return viewHandler;
+
+ }
+
+}
Added: trunk/faces/src/main/org/jboss/portal/faces/portlet/SunRIJSFBridge.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/SunRIJSFBridge.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/SunRIJSFBridge.java 2007-06-21 22:13:14 UTC (rev 7510)
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * 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.faces.portlet;
+
+import java.lang.reflect.Constructor;
+
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+import javax.faces.application.ViewHandler;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.lifecycle.LifecycleFactory;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 1.1 $
+ */
+public class SunRIJSFBridge extends JSFMetaBridge
+{
+
+ public SunRIJSFBridge()
+ {
+ super("jsfportletbridge", "com.sun.faces.portlet.FacesPortlet",
+ "com.sun.faces.portlet.INIT_VIEW");
+ }
+
+ protected void init() throws JSFMetaBridgeException
+ {
+ try
+ {
+ lifecycleFactory = (LifecycleFactory) getInstance("com.sun.faces.portlet.LifecycleFactoryImpl");
+ }
+ catch (Exception e)
+ {
+ throw new JSFMetaBridgeException("Cannot create the JSF lifecycle Factory", e);
+ }
+
+ try
+ {
+ facesContextFactory = (FacesContextFactory) getInstance("com.sun.faces.portlet.FacesContextFactoryImpl");
+ }
+ catch (Exception e)
+ {
+ throw new JSFMetaBridgeException("Cannot create the JSF Faces Context Factory", e);
+ }
+ }
+
+ public ViewHandler getViewHandler()
+ {
+ if (viewHandler == null)
+ {
+ try
+ {
+ Application application = ((ApplicationFactory) FactoryFinder
+ .getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication();
+ ViewHandler oldViewHandler = application.getViewHandler();
+
+ Class[] parameterTypes = new Class[] { ViewHandler.class };
+ Class clazz = Thread.currentThread().getContextClassLoader()
+ .loadClass("com.sun.faces.portlet.ViewHandlerImpl");
+ Constructor constructor = clazz.getConstructor(parameterTypes);
+ viewHandler = (ViewHandler) constructor
+ .newInstance(new Object[] { oldViewHandler });
+ }
+ catch (Exception e)
+ {
+ Exception e1 = new JSFMetaBridgeException("Cannot create the JSF View Handler",e);
+ e1.printStackTrace();
+ }
+ }
+ return viewHandler;
+ }
+}
18 years, 10 months
JBoss Portal SVN: r7509 - in trunk/wsrp: src/main/org/jboss/portal/test/wsrp/framework/support and 3 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-06-21 18:12:43 -0400 (Thu, 21 Jun 2007)
New Revision: 7509
Added:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ConsumerBeanTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/BeanContext.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/JSFBeanContext.java
Modified:
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml
Log:
- Delegated error handling and parameter retrieval methods from ConsumerBean to new BeanContext class to allow behavior to be JSF-independent. This allows for testing of JSF managed beans outside of a JSF environment.
- Improved ConsumerBean handling of modified state. Correct handling will require a new value change event listener which might not be the right way to go (i.e. is that level of complexity required in terms of 80/20).
- Added JSFBeanContext to implement BeanContext in a JSF context.
- Updated faces-config to use BeanContext.
- Added ConsumerBeanTestCase.
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-06-21 18:09:48 UTC (rev 7508)
+++ trunk/wsrp/build.xml 2007-06-21 22:12:43 UTC (rev 7509)
@@ -821,7 +821,8 @@
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.UserContextConverterTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.wsrp.other.RegistrationPropertyDescriptionTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.handler.RequestHeaderClientHandlerTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.handler.RequestHeaderClientHandlerTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.ConsumerBeanTestCase"/>
</x-test>
<x-sysproperty>
<!--<jvmarg value="-Xdebug"/>
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2007-06-21 18:09:48 UTC (rev 7508)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2007-06-21 22:12:43 UTC (rev 7509)
@@ -45,16 +45,23 @@
private Map consumers = new HashMap(3);
public static final String MOCK_SERVICE_DESCRIPTION = "mock-service-description";
public static final String MOCK_MARKUP = "mock-markup";
+ public static final String CONSUMER1 = "inDB";
+ public static final String CONSUMER2 = "inDB2";
+ /**
+ * Creates a ConsumerRegistry containing 2 consumers with id '{@link #CONSUMER1}' and '{@link #CONSUMER2}'
+ * respectively. CONSUMER2 is active and has a service description URL set to {@link #MOCK_SERVICE_DESCRIPTION} and a
+ * markup URL set to {@link #MOCK_MARKUP}
+ */
public MockConsumerRegistry()
{
- consumers.put("inDB", new MockWSRPConsumer("inDB"));
- MockWSRPConsumer consumer = new MockWSRPConsumer("inDB2");
+ consumers.put(CONSUMER1, new MockWSRPConsumer(CONSUMER1));
+ MockWSRPConsumer consumer = new MockWSRPConsumer(CONSUMER2);
consumer.getProducerInfo().setActive(true);
EndpointConfigurationInfo info = consumer.getProducerInfo().getEndpointConfigurationInfo();
info.setServiceDescriptionURL(MOCK_SERVICE_DESCRIPTION);
info.setMarkupURL(MOCK_MARKUP);
- consumers.put("inDB2", consumer);
+ consumers.put(CONSUMER2, consumer);
}
public Collection getConfiguredConsumers()
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ConsumerBeanTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ConsumerBeanTestCase.java (rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ConsumerBeanTestCase.java 2007-06-21 22:12:43 UTC (rev 7509)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, 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.test.wsrp.other;
+
+import junit.framework.TestCase;
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.test.wsrp.framework.support.MockConsumerRegistry;
+import org.jboss.portal.wsrp.admin.ui.BeanContext;
+import org.jboss.portal.wsrp.admin.ui.ConsumerBean;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class ConsumerBeanTestCase extends TestCase
+{
+ private ConsumerBean bean;
+
+ protected void setUp() throws Exception
+ {
+ bean = new ConsumerBean();
+ bean.setRegistry(new MockConsumerRegistry());
+
+ // consumer associated with bean is null at this point so it should be loaded from the registry
+ bean.setId(MockConsumerRegistry.CONSUMER2);
+ }
+
+ public void testInitialState()
+ {
+ assertEquals(MockConsumerRegistry.CONSUMER2, bean.getId());
+ assertEquals(MockConsumerRegistry.MOCK_MARKUP, bean.getMarkup());
+ assertEquals(MockConsumerRegistry.MOCK_SERVICE_DESCRIPTION, bean.getServiceDescription());
+ assertFalse(bean.isModified());
+ }
+
+ public void testSetId()
+ {
+ String newId = "newId";
+ bean.setId(newId);
+ assertEquals(newId, bean.getId());
+ assertTrue(bean.isModified());
+ }
+
+ public void testSetCache()
+ {
+ bean.setCache(new Integer(300));
+ assertEquals(300, bean.getCache().intValue());
+ assertTrue(bean.isModified());
+ }
+
+ private static class TestBeanContext extends BeanContext
+ {
+ protected String getParameter(String key)
+ {
+ throw new NotYetImplemented();
+ }
+
+ protected void createMessage(String target, String message, Object severity)
+ {
+ // ignore for tests
+ }
+
+ protected Object getErrorSeverity()
+ {
+ return null;
+ }
+
+ protected Object getInfoSeverity()
+ {
+ return null;
+ }
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ConsumerBeanTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/BeanContext.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/BeanContext.java (rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/BeanContext.java 2007-06-21 22:12:43 UTC (rev 7509)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, 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.wsrp.admin.ui;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public abstract class BeanContext
+{
+ protected abstract String getParameter(String key);
+
+ protected abstract void createMessage(String target, String message, Object severity);
+
+ protected abstract Object getErrorSeverity();
+
+ protected abstract Object getInfoSeverity();
+
+ protected void createErrorMessage(String message)
+ {
+ createMessage(null, message, getErrorSeverity());
+ }
+
+ protected void createErrorMessage(String target, String message)
+ {
+ createMessage(target, message, getErrorSeverity());
+ }
+
+ protected void createErrorMessageFrom(Exception e)
+ {
+ createErrorMessageFrom(null, e);
+ }
+
+ protected void createErrorMessageFrom(String target, Exception e)
+ {
+ Throwable cause = e.getCause();
+ String localizedMessage = getLocalizedMessageOrExceptionName(e);
+ String message = localizedMessage + (cause != null ? "\nCause: " + getLocalizedMessageOrExceptionName(cause) : "");
+ createErrorMessage(target, message);
+ }
+
+ private String getLocalizedMessageOrExceptionName(Throwable e)
+ {
+ String localizedMessage = e.getLocalizedMessage();
+ if (localizedMessage == null)
+ {
+ localizedMessage = "An unexpected error occured: " + e.getClass().getName();
+ }
+ return localizedMessage;
+ }
+
+ protected void createInfoMessage(String target, String message)
+ {
+ createMessage(target, message, getInfoSeverity());
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/BeanContext.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-06-21 18:09:48 UTC (rev 7508)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-06-21 22:12:43 UTC (rev 7509)
@@ -67,7 +67,7 @@
public boolean isModified()
{
- return modified;
+ return modified || registrationModified;
}
public boolean isUseWSDL()
@@ -99,16 +99,19 @@
{
if (consumer != null)
{
- getProducerInfo().setId(id);
+ ProducerInfo info = getProducerInfo();
+ String oldId = info.getId();
+ info.setId((String)modifyIfNeeded(oldId, id, "id", false));
}
else
{
consumer = registry.getConsumer(id);
- serviceDescription = getProducerInfo().getEndpointConfigurationInfo().getServiceDescriptionURL();
- markup = getProducerInfo().getEndpointConfigurationInfo().getMarkupURL();
- portletManagement = getProducerInfo().getEndpointConfigurationInfo().getPortletManagementURL();
- registration = getProducerInfo().getEndpointConfigurationInfo().getRegistrationURL();
- wsdl = getProducerInfo().getEndpointConfigurationInfo().getWsdlDefinitionURL();
+ EndpointConfigurationInfo endpoint = getProducerInfo().getEndpointConfigurationInfo();
+ serviceDescription = endpoint.getServiceDescriptionURL();
+ markup = endpoint.getMarkupURL();
+ portletManagement = endpoint.getPortletManagementURL();
+ registration = endpoint.getRegistrationURL();
+ wsdl = endpoint.getWsdlDefinitionURL();
}
}
@@ -119,7 +122,7 @@
public void setCache(Integer cache)
{
- getProducerInfo().setExpirationCacheSeconds(cache);
+ getProducerInfo().setExpirationCacheSeconds((Integer)modifyIfNeeded(getCache(), cache, "cache", false));
}
public String getServiceDescription()
@@ -129,7 +132,7 @@
public void setServiceDescription(String sdURL)
{
- serviceDescription = modifyIfNeeded(serviceDescription, sdURL, "sd");
+ serviceDescription = (String)modifyIfNeeded(serviceDescription, sdURL, "sd", true);
}
public String getMarkup()
@@ -139,7 +142,7 @@
public void setMarkup(String markupURL)
{
- markup = modifyIfNeeded(markup, markupURL, "m");
+ markup = (String)modifyIfNeeded(markup, markupURL, "m", true);
}
public String getPortletManagement()
@@ -149,7 +152,7 @@
public void setPortletManagement(String pmURL)
{
- portletManagement = modifyIfNeeded(portletManagement, pmURL, "pm");
+ portletManagement = (String)modifyIfNeeded(portletManagement, pmURL, "pm", true);
}
public String getRegistration()
@@ -159,7 +162,7 @@
public void setRegistration(String rURL)
{
- registration = modifyIfNeeded(registration, rURL, "r");
+ registration = (String)modifyIfNeeded(registration, rURL, "r", true);
}
public String getWsdl()
@@ -169,7 +172,7 @@
public void setWsdl(String wsdlURL)
{
- wsdl = modifyIfNeeded(wsdl, wsdlURL, "wsdl");
+ wsdl = (String)modifyIfNeeded(wsdl, wsdlURL, "wsdl", true);
}
private void internalSetWsdl(String wsdlURL)
@@ -181,7 +184,7 @@
catch (Exception e)
{
registry.deactivateConsumerWith(getId());
- createErrorMessageFrom("wsdl", e);
+ beanContext.createErrorMessageFrom("wsdl", e);
}
}
@@ -269,14 +272,14 @@
}
catch (Exception e)
{
- createErrorMessageFrom(e);
+ beanContext.createErrorMessageFrom(e);
return null;
}
return manager.listConsumers();
}
- createErrorMessage("Couldn't update Consumer!");
+ beanContext.createErrorMessage("Couldn't update Consumer!");
return null;
}
@@ -298,31 +301,31 @@
{
if (consumer != null)
{
- String param = getParameter("mergeLocalInfo");
+ String param = beanContext.getParameter("mergeLocalInfo");
boolean mergeLocalInfo = Boolean.valueOf(param).booleanValue();
try
{
RefreshResult result = getProducerInfo().refreshRegistrationInfo(mergeLocalInfo);
if (result.hasIssues())
{
- createErrorMessage(result.getStatus());
+ beanContext.createErrorMessage(result.getStatus());
}
else
{
- createInfoMessage(null, result.getStatus());
+ beanContext.createInfoMessage(null, result.getStatus());
}
registrationModified = false;
}
catch (Exception e)
{
- createErrorMessageFrom(e);
+ beanContext.createErrorMessageFrom(e);
return null;
}
return null;
}
- createErrorMessage("Couldn't refresh Registration info!");
+ beanContext.createErrorMessage("Couldn't refresh Registration info!");
return null;
}
@@ -333,42 +336,40 @@
try
{
getProducerInfo().modifyRegistration();
- createInfoMessage(null, "Successfully modified Registration!");
+ beanContext.createInfoMessage(null, "Successfully modified Registration!");
registrationModified = false;
}
catch (Exception e)
{
- createErrorMessageFrom(e);
+ beanContext.createErrorMessageFrom(e);
return null;
}
return null;
}
- createErrorMessage("Couldn't modify Registration!");
+ beanContext.createErrorMessage("Couldn't modify Registration!");
return null;
}
- private String modifyIfNeeded(String oldValue, String newValue, String target)
+ private Object modifyIfNeeded(Object oldValue, Object newValue, String target, boolean checkURL)
{
if ((oldValue != null && !oldValue.equals(newValue)) || (oldValue == null && newValue != null))
{
- URL url;
- try
+ if (checkURL)
{
- // check that the new value is a valid URL
- url = new URL(newValue);
+ try
+ {
+ // check that the new value is a valid URL
+ new URL(newValue.toString());
+ }
+ catch (MalformedURLException e)
+ {
+ beanContext.createErrorMessage(target, "'" + newValue + "' is not a valid URL: " + e.getLocalizedMessage());
+ }
+ }
- oldValue = newValue;
- modified = true;
- }
- catch (MalformedURLException e)
- {
- createErrorMessage(target, "'" + newValue + "' is not a valid URL: " + e.getLocalizedMessage());
- }
- finally
- {
- url = null;
- }
+ oldValue = newValue;
+ modified = true;
}
return oldValue;
@@ -378,7 +379,7 @@
public void useWSDLListener(ValueChangeEvent event)
{
- useWSDL = (Boolean)event.getNewValue();
+ useWSDL = (Boolean)modifyIfNeeded(useWSDL, event.getNewValue(), "wsdl", false);
// bypass the rest of the life cycle and re-display page
FacesContext.getCurrentInstance().renderResponse();
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-06-21 18:09:48 UTC (rev 7508)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-06-21 22:12:43 UTC (rev 7509)
@@ -82,7 +82,7 @@
{
if (refreshConsumerId() != null)
{
- boolean activate = Boolean.valueOf(getParameter("activate")).booleanValue();
+ boolean activate = Boolean.valueOf(beanContext.getParameter("activate")).booleanValue();
try
{
if (activate)
@@ -108,7 +108,7 @@
}
catch (Exception e)
{
- createErrorMessageFrom(e);
+ beanContext.createErrorMessageFrom(e);
}
return listConsumers();
@@ -124,7 +124,7 @@
{
if (refreshConsumerId() != null)
{
- boolean register = Boolean.valueOf(getParameter("register")).booleanValue();
+ boolean register = Boolean.valueOf(beanContext.getParameter("register")).booleanValue();
try
{
@@ -135,7 +135,7 @@
}
catch (Exception e)
{
- createErrorMessageFrom(e);
+ beanContext.createErrorMessageFrom(e);
return null;
}
}
@@ -158,13 +158,13 @@
}
catch (Exception e)
{
- createErrorMessageFrom(e);
+ beanContext.createErrorMessageFrom(e);
return null;
}
}
else
{
- createErrorMessage("Need a non-null, non-empty name for the new Consumer");
+ beanContext.createErrorMessage("Need a non-null, non-empty name for the new Consumer");
return null;
}
}
@@ -180,7 +180,7 @@
}
catch (Exception e)
{
- createErrorMessageFrom(e);
+ beanContext.createErrorMessageFrom(e);
return null;
}
}
@@ -227,17 +227,17 @@
RefreshResult result = consumer.refresh(true);
if (result.hasIssues())
{
- createErrorMessage(result.getStatus());
+ beanContext.createErrorMessage(result.getStatus());
}
else
{
- createInfoMessage(null, result.getStatus());
+ beanContext.createInfoMessage(null, result.getStatus());
}
return result;
}
catch (PortletInvokerException e)
{
- createErrorMessageFrom(e);
+ beanContext.createErrorMessageFrom(e);
return null;
}
}
@@ -251,7 +251,7 @@
private String refreshConsumerId()
{
- selectedId = getParameter("id");
+ selectedId = beanContext.getParameter("id");
return selectedId;
}
@@ -273,6 +273,6 @@
private void noSelectedConsumerError()
{
- createErrorMessage("No Consumer was selected!");
+ beanContext.createErrorMessage("No Consumer was selected!");
}
}
\ No newline at end of file
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/JSFBeanContext.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/JSFBeanContext.java (rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/JSFBeanContext.java 2007-06-21 22:12:43 UTC (rev 7509)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, 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.wsrp.admin.ui;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class JSFBeanContext extends BeanContext
+{
+ protected String getParameter(String key)
+ {
+ Map pmap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ return (String)pmap.get(key);
+ }
+
+ protected void createMessage(String target, String message, Object severity)
+ {
+ FacesMessage.Severity jsfSeverity;
+ if (severity instanceof FacesMessage.Severity)
+ {
+ jsfSeverity = (FacesMessage.Severity)severity;
+ }
+ else
+ {
+ jsfSeverity = FacesMessage.SEVERITY_ERROR;
+ }
+
+ FacesMessage msg = new FacesMessage(jsfSeverity, message, message);
+ FacesContext.getCurrentInstance().addMessage(target, msg);
+ }
+
+ protected Object getErrorSeverity()
+ {
+ return FacesMessage.SEVERITY_ERROR;
+ }
+
+ protected Object getInfoSeverity()
+ {
+ return FacesMessage.SEVERITY_INFO;
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/JSFBeanContext.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java 2007-06-21 18:09:48 UTC (rev 7508)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java 2007-06-21 22:12:43 UTC (rev 7509)
@@ -23,10 +23,6 @@
package org.jboss.portal.wsrp.admin.ui;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import java.util.Map;
-
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -34,53 +30,10 @@
*/
public class ManagedBean
{
- protected String getParameter(String key)
- {
- Map pmap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- return (String)pmap.get(key);
- }
+ protected BeanContext beanContext;
- protected void createErrorMessage(String message)
+ public void setBeanContext(BeanContext beanContext)
{
- createMessage(null, message, FacesMessage.SEVERITY_ERROR);
+ this.beanContext = beanContext;
}
-
- protected void createErrorMessage(String target, String message)
- {
- createMessage(target, message, FacesMessage.SEVERITY_ERROR);
- }
-
- protected void createMessage(String target, String message, FacesMessage.Severity severity)
- {
- FacesMessage msg = new FacesMessage(severity, message, message);
- FacesContext.getCurrentInstance().addMessage(target, msg);
- }
-
- protected void createErrorMessageFrom(Exception e)
- {
- createErrorMessageFrom(null, e);
- }
-
- protected void createErrorMessageFrom(String target, Exception e)
- {
- Throwable cause = e.getCause();
- String localizedMessage = getLocalizedMessageOrExceptionName(e);
- String message = localizedMessage + (cause != null ? "\nCause: " + getLocalizedMessageOrExceptionName(cause) : "");
- createErrorMessage(target, message);
- }
-
- private String getLocalizedMessageOrExceptionName(Throwable e)
- {
- String localizedMessage = e.getLocalizedMessage();
- if (localizedMessage == null)
- {
- localizedMessage = "An unexpected error occured: " + e.getClass().getName();
- }
- return localizedMessage;
- }
-
- protected void createInfoMessage(String target, String message)
- {
- createMessage(target, message, FacesMessage.SEVERITY_INFO);
- }
}
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml 2007-06-21 18:09:48 UTC (rev 7508)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml 2007-06-21 22:12:43 UTC (rev 7509)
@@ -33,6 +33,11 @@
</application>
<managed-bean>
+ <managed-bean-name>beanContext</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.wsrp.admin.ui.JSFBeanContext</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>consumersMgr</managed-bean-name>
<managed-bean-class>org.jboss.portal.wsrp.admin.ui.ConsumerManagerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
@@ -41,6 +46,11 @@
<property-class>org.jboss.portal.wsrp.consumer.ConsumerRegistry</property-class>
<value>#{applicationScope.ConsumerRegistry}</value>
</managed-property>
+ <managed-property>
+ <property-name>beanContext</property-name>
+ <property-class>org.jboss.portal.wsrp.admin.ui.BeanContext</property-class>
+ <value>#{beanContext}</value>
+ </managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>consumer</managed-bean-name>
@@ -59,6 +69,11 @@
<property-name>manager</property-name>
<value>#{consumersMgr}</value>
</managed-property>
+ <managed-property>
+ <property-name>beanContext</property-name>
+ <property-class>org.jboss.portal.wsrp.admin.ui.BeanContext</property-class>
+ <value>#{beanContext}</value>
+ </managed-property>
</managed-bean>
<navigation-rule>
18 years, 10 months
JBoss Portal SVN: r7508 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-06-21 14:09:48 -0400 (Thu, 21 Jun 2007)
New Revision: 7508
Modified:
docs/trunk/referenceGuide/en/modules/installation.xml
Log:
- Added link to wiki module list and a note to explain that deploy only deploys a bare portal.
Modified: docs/trunk/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/installation.xml 2007-06-21 15:48:23 UTC (rev 7507)
+++ docs/trunk/referenceGuide/en/modules/installation.xml 2007-06-21 18:09:48 UTC (rev 7508)
@@ -473,6 +473,14 @@
or
<emphasis>admin/admin</emphasis>
.
+ <note>
+ This installs a bare version of Portal. In previous versions, several additional modules were deployed as
+ well but this has since been modularized to provide greater flexibility. You might want to deploy
+ additional modules to augment Portal (see
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalModules">Portal's module list</ulink> for more
+ information). You can also deploy all the modules all at once using <command>build deploy-all</command>
+ in the <filename>build</filename> directory.
+ </note>
</para>
</sect2>
</sect1>
@@ -585,4 +593,4 @@
</para>
</sect2>
</sect1>
-</chapter>
\ No newline at end of file
+</chapter>
\ No newline at end of file
18 years, 10 months
JBoss Portal SVN: r7507 - tags/JBoss_Portal_2_6_0_CR3/core/src/main/org/jboss/portal/core/model/portal/command/view.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-21 11:48:23 -0400 (Thu, 21 Jun 2007)
New Revision: 7507
Modified:
tags/JBoss_Portal_2_6_0_CR3/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java
Log:
when default page of a portal is not found, return an unavailable response
Modified: tags/JBoss_Portal_2_6_0_CR3/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java
===================================================================
--- tags/JBoss_Portal_2_6_0_CR3/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java 2007-06-21 15:46:42 UTC (rev 7506)
+++ tags/JBoss_Portal_2_6_0_CR3/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java 2007-06-21 15:48:23 UTC (rev 7507)
@@ -26,6 +26,7 @@
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.controller.command.info.CommandInfo;
import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
+import org.jboss.portal.core.controller.command.response.UnavailableResourceResponse;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.command.PortalCommand;
@@ -64,7 +65,7 @@
}
else
{
- throw new ControllerException("No default page has been defined for portal " + portal.getName());
+ return new UnavailableResourceResponse(portal.getId().toString(), false);
}
}
}
18 years, 10 months
JBoss Portal SVN: r7506 - trunk/core/src/main/org/jboss/portal/core/model/portal/command/view.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-21 11:46:42 -0400 (Thu, 21 Jun 2007)
New Revision: 7506
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java
Log:
when default page of a portal is not found, return an unavailable response
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java 2007-06-21 14:41:03 UTC (rev 7505)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java 2007-06-21 15:46:42 UTC (rev 7506)
@@ -26,6 +26,7 @@
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.controller.command.info.CommandInfo;
import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
+import org.jboss.portal.core.controller.command.response.UnavailableResourceResponse;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.command.PortalCommand;
@@ -64,7 +65,7 @@
}
else
{
- throw new ControllerException("No default page has been defined for portal " + portal.getName());
+ return new UnavailableResourceResponse(portal.getId().toString(), false);
}
}
}
18 years, 10 months
JBoss Portal SVN: r7505 - branches.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-06-21 10:41:03 -0400 (Thu, 21 Jun 2007)
New Revision: 7505
Removed:
branches/JBoss_Portal_2_4_1_SP1_Intuit/
Log:
removing
18 years, 10 months
JBoss Portal SVN: r7504 - branches.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-06-21 10:35:06 -0400 (Thu, 21 Jun 2007)
New Revision: 7504
Added:
branches/JBoss_Portal_2_4_1_SP1_SecurityPatch/
Log:
Renaming
Copied: branches/JBoss_Portal_2_4_1_SP1_SecurityPatch (from rev 7503, branches/JBoss_Portal_2_4_1_SP1_Intuit)
18 years, 10 months
JBoss Portal SVN: r7503 - in trunk/core-admin/src: resources/portal-admin-war/WEB-INF and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-21 09:15:18 -0400 (Thu, 21 Jun 2007)
New Revision: 7503
Added:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editErrorHandling.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
Log:
- improved implementation of control properties by leveraging OO inheritence to avoid duplicate code
- allow to edit properties of root context since it owns now state
- added inheritable state on PropertyBean to describe if a property can inherit or not the value based on the presence or not of a parent which allow to set the inheritable boolean checkbox to unchecked+disabled
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-06-21 13:15:18 UTC (rev 7503)
@@ -63,6 +63,7 @@
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Collections;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -221,7 +222,17 @@
public Object getValue(Object bean)
{
PortalObject object = (PortalObject)bean;
- return getChildren(object, PortalObject.PORTAL_MASK);
+ PortalObjectId id = object.getId();
+
+ // We don't want to iterate the potentially large collection of dashboard portals
+ if ("dashboard".equals(id.getNamespace()))
+ {
+ return Collections.EMPTY_LIST;
+ }
+ else
+ {
+ return getChildren(object, PortalObject.PORTAL_MASK);
+ }
}
});
setProperty("pages", new AbstractPropertyDecorator(PortalObject.class)
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2007-06-21 13:15:18 UTC (rev 7503)
@@ -33,11 +33,13 @@
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
* @version $Revision: 0.1 $
*/
-public class ControlPropertiesBean
+public class ControlPropertiesBean extends PropertyBeanContainer
{
+ /** . */
private List portalSelectItems;
+ /** . */
private List pageSelectItems;
/** . */
@@ -91,12 +93,12 @@
PropertiesInfo info = new PropertiesInfo(object);
+ boolean inheritable = object.getType() != PortalObject.TYPE_CONTEXT;
boolean inherited = !object.getDeclaredProperties().containsKey(name);
String value = object.getProperty(name);
- return new ControlPropertyBean(this, info.getPropertyInfo(name), inherited, value);
+ return new ControlPropertyBean(this, info.getPropertyInfo(name), inherited, inheritable, value);
}
-
public ControlPropertyBean getPageControlAccessDenied()
{
return grabProperty(ControlConstants.PAGE_ACCESS_DENIED_CONTROL_KEY);
@@ -156,4 +158,9 @@
{
return grabProperty(ControlConstants.PORTAL_RESOURCE_URI_CONTROL_KEY);
}
+
+ protected PortalObject getRelatedObject()
+ {
+ return pomgr.getSelectedObject();
+ }
}
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2007-06-21 13:15:18 UTC (rev 7503)
@@ -23,7 +23,6 @@
package org.jboss.portal.core.admin.ui;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
import javax.faces.event.ValueChangeEvent;
@@ -33,54 +32,19 @@
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public class ControlPropertyBean implements Comparable
+public class ControlPropertyBean extends PropertyBean
{
/** . */
- private String value;
-
- /** . */
private final ControlPropertiesBean container;
- /** . */
- private final PropertyInfo info;
-
- /** . */
- private boolean inherited;
-
- public ControlPropertyBean(ControlPropertiesBean container, PropertyInfo info, boolean inherited, String value)
+ public ControlPropertyBean(ControlPropertiesBean container, PropertyInfo info, boolean inherited, boolean inheritable, String value)
{
+ super(container, info, inherited, inheritable, value);
+ //
this.container = container;
- this.info = info;
- this.inherited = inherited;
- this.value = value;
}
- public String getName()
- {
- return info.getName();
- }
-
- public boolean isReadOnly()
- {
- return info.getAccessMode() == PropertyInfo.READ_ONLY_ACCESS_MODE;
- }
-
- public String getDescription()
- {
- return info.getDescription().getDefaultString();
- }
-
- public String getDisplayName()
- {
- return info.getDisplayName().getDefaultString();
- }
-
- public boolean isInherited()
- {
- return inherited;
- }
-
public void setInherited(boolean inherited)
{
this.inherited = inherited;
@@ -88,8 +52,12 @@
public void inherit(ValueChangeEvent event)
{
+ PortalObject portalObject = container.getRelatedObject();
- PortalObject portalObject = container.pomgr.getSelectedObject();
+ //
+
+
+ //
if (event.getNewValue().toString().equalsIgnoreCase("true"))
{
portalObject.setDeclaredProperty(getName(), null);
@@ -100,18 +68,6 @@
}
}
- public Object getValue()
- {
- if (info.getType().equals("java.lang.Boolean"))
- {
- return Boolean.valueOf(value);
- }
- else
- {
- return value;
- }
- }
-
public void setValue(Object value)
{
if (!inherited)
@@ -125,17 +81,6 @@
}
- public int compareTo(Object o)
- {
- ControlPropertyBean that = (ControlPropertyBean)o;
- return info.getName().compareTo(that.getName());
- }
-
- public String getType()
- {
- return info.getType();
- }
-
public boolean isControlProperty()
{
return PropertiesInfo.isControlProperty(info.getName());
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-06-21 13:15:18 UTC (rev 7503)
@@ -70,8 +70,14 @@
/** The serialVersionUID */
private static final long serialVersionUID = -8923517554726982622L;
+ /** . */
private static final String CONTENT_URI = "content.uri";
+ // Configuration
+
+ /** . */
+ private String namespace;
+
// Wired services
/** . */
@@ -143,6 +149,16 @@
// Wired services
+ public String getNamespace()
+ {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace)
+ {
+ this.namespace = namespace;
+ }
+
public List getAvailableContentTypes()
{
LinkedList types = new LinkedList();
@@ -422,7 +438,7 @@
public void selectRootObject(ActionEvent ae)
{
- PortalObject root = portalObjectContainer.getContext();
+ PortalObject root = portalObjectContainer.getContext(namespace);
selectObject(root);
}
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-06-21 13:15:18 UTC (rev 7503)
@@ -37,7 +37,7 @@
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public class PropertiesBean
+public class PropertiesBean extends PropertyBeanContainer
{
/** . */
@@ -58,9 +58,6 @@
/** . */
private List items;
-
-
-
public PropertiesBean(PortalObjectManagerBean pomgr)
{
// Get the selected object
@@ -73,32 +70,24 @@
List entryList = new ArrayList(info.getNames().size());
Map entryMap = new HashMap(info.getNames().size());
+ //
+ boolean inheritable = selectedObject.getType() != PortalObject.TYPE_CONTEXT;
+ //
for (Iterator i = selectedObject.getProperties().keySet().iterator();i.hasNext();)
{
-
-
String propertyName = (String)i.next();
-
String propertyValue = selectedObject.getProperty(propertyName);
-
- //
PropertyInfo propertyInfo = info.getPropertyInfo(propertyName);
-
- //
boolean inherited = !selectedObject.getDeclaredProperties().containsKey(propertyName);
// If null it is probably an inherited property that does not have meaning for that particular object
// Filter, keep only public properties
if (propertyInfo != null && propertyInfo.getScope() == PropertyInfo.PUBLIC_SCOPE)
{
- //don't add control properties - managed in separate view
- if (!PropertiesInfo.isControlProperty(propertyName))
- {
- PropertyBean propertyBean = new PropertyBean(this, propertyInfo, inherited, propertyValue);
- entryList.add(propertyBean);
- entryMap.put(propertyName, propertyBean);
- }
+ PropertyBean propertyBean = new PropertyBean(this, propertyInfo, inherited, inheritable, propertyValue);
+ entryList.add(propertyBean);
+ entryMap.put(propertyName, propertyBean);
}
}
@@ -176,4 +165,9 @@
//
return (SelectItem[])items.toArray(new SelectItem[items.size()]);
}
+
+ protected PortalObject getRelatedObject()
+ {
+ return pomgr.getSelectedObject();
+ }
}
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-06-21 13:15:18 UTC (rev 7503)
@@ -62,21 +62,23 @@
//
- public static final PropertyInfo CONTROL_POLICY_PAGE_ACCESS_DENIED = new PropertyInfo(ControlConstants.PAGE_ACCESS_DENIED_CONTROL_KEY, new LocalizedString("When access to the window is denied"), new LocalizedString("When access to the window is denied"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_UNAVAILABLE = new PropertyInfo(ControlConstants.PAGE_UNAVAILABLE_CONTROL_KEY, new LocalizedString("When the window is unavailable"), new LocalizedString("When the window is unavailable"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_ERROR = new PropertyInfo(ControlConstants.PAGE_ERROR_CONTROL_KEY, new LocalizedString("When there is an error on the window"), new LocalizedString("When there is an error on the window"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_INTERNAL_ERROR = new PropertyInfo(ControlConstants.PAGE_INTERNAL_ERROR_CONTROL_KEY, new LocalizedString("When there is an error within the window"), new LocalizedString("When there is an error within the window"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_NOT_FOUND = new PropertyInfo(ControlConstants.PAGE_NOT_FOUND_CONTROL_KEY, new LocalizedString("When the window is not found"), new LocalizedString("When the window is not found"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_RESOURCE_URI = new PropertyInfo(ControlConstants.PAGE_RESOURCE_URI_CONTROL_KEY, new LocalizedString("On error redirect to this resource"), new LocalizedString("On error redirect to this resource"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_ACCESS_DENIED = new PropertyInfo(ControlConstants.PAGE_ACCESS_DENIED_CONTROL_KEY, new LocalizedString("When access to the window is denied"), new LocalizedString("When access to the window is denied"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_UNAVAILABLE = new PropertyInfo(ControlConstants.PAGE_UNAVAILABLE_CONTROL_KEY, new LocalizedString("When the window is unavailable"), new LocalizedString("When the window is unavailable"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_ERROR = new PropertyInfo(ControlConstants.PAGE_ERROR_CONTROL_KEY, new LocalizedString("When there is an error on the window"), new LocalizedString("When there is an error on the window"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_INTERNAL_ERROR = new PropertyInfo(ControlConstants.PAGE_INTERNAL_ERROR_CONTROL_KEY, new LocalizedString("When there is an error within the window"), new LocalizedString("When there is an error within the window"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_NOT_FOUND = new PropertyInfo(ControlConstants.PAGE_NOT_FOUND_CONTROL_KEY, new LocalizedString("When the window is not found"), new LocalizedString("When the window is not found"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_RESOURCE_URI = new PropertyInfo(ControlConstants.PAGE_RESOURCE_URI_CONTROL_KEY, new LocalizedString("On error redirect to this resource"), new LocalizedString("On error redirect to this resource"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_ACCESS_DENIED = new PropertyInfo(ControlConstants.PORTAL_ACCESS_DENIED_CONTROL_KEY, new LocalizedString("When access to the page is denied"), new LocalizedString("When access to the page is denied"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_UNAVAILABLE = new PropertyInfo(ControlConstants.PORTAL_UNAVAILABLE_CONTROL_KEY, new LocalizedString("When the page is unavailable"), new LocalizedString("When the page is unavailable"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_ERROR = new PropertyInfo(ControlConstants.PORTAL_ERROR_CONTROL_KEY, new LocalizedString("When there is an error on the page"), new LocalizedString("When there is an error on the page"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_INTERNAL_ERROR = new PropertyInfo(ControlConstants.PORTAL_INTERNAL_ERROR_CONTROL_KEY, new LocalizedString("When there is an error within the page"), new LocalizedString("When there is an error within the page"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_NOT_FOUND = new PropertyInfo(ControlConstants.PORTAL_NOT_FOUND_CONTROL_KEY, new LocalizedString("When the page is not found"), new LocalizedString("When the page is not found"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_RESOURCE_URI = new PropertyInfo(ControlConstants.PORTAL_RESOURCE_URI_CONTROL_KEY, new LocalizedString("On error redirect to this resource"), new LocalizedString("On error redirect to this resource"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
+ //
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_ACCESS_DENIED = new PropertyInfo(ControlConstants.PORTAL_ACCESS_DENIED_CONTROL_KEY, new LocalizedString("When access to the page is denied"), new LocalizedString("When access to the page is denied"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_UNAVAILABLE = new PropertyInfo(ControlConstants.PORTAL_UNAVAILABLE_CONTROL_KEY, new LocalizedString("When the page is unavailable"), new LocalizedString("When the page is unavailable"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_ERROR = new PropertyInfo(ControlConstants.PORTAL_ERROR_CONTROL_KEY, new LocalizedString("When there is an error on the page"), new LocalizedString("When there is an error on the page"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_INTERNAL_ERROR = new PropertyInfo(ControlConstants.PORTAL_INTERNAL_ERROR_CONTROL_KEY, new LocalizedString("When there is an error within the page"), new LocalizedString("When there is an error within the page"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_NOT_FOUND = new PropertyInfo(ControlConstants.PORTAL_NOT_FOUND_CONTROL_KEY, new LocalizedString("When the page is not found"), new LocalizedString("When the page is not found"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_RESOURCE_URI = new PropertyInfo(ControlConstants.PORTAL_RESOURCE_URI_CONTROL_KEY, new LocalizedString("On error redirect to this resource"), new LocalizedString("On error redirect to this resource"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+
/** . */
private static final Map CONTEXT_PROPERTIES = new HashMap();
@@ -103,6 +105,20 @@
static
{
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_ACCESS_DENIED.getName(), CONTROL_POLICY_PORTAL_ACCESS_DENIED);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_UNAVAILABLE.getName(), CONTROL_POLICY_PORTAL_UNAVAILABLE);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_ERROR.getName(), CONTROL_POLICY_PORTAL_ERROR);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_INTERNAL_ERROR.getName(), CONTROL_POLICY_PORTAL_INTERNAL_ERROR);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_NOT_FOUND.getName(), CONTROL_POLICY_PORTAL_NOT_FOUND);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_RESOURCE_URI.getName(), CONTROL_POLICY_PORTAL_RESOURCE_URI);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_ACCESS_DENIED.getName(), CONTROL_POLICY_PAGE_ACCESS_DENIED);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_UNAVAILABLE.getName(), CONTROL_POLICY_PAGE_UNAVAILABLE);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_ERROR.getName(), CONTROL_POLICY_PAGE_ERROR);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_INTERNAL_ERROR.getName(), CONTROL_POLICY_PAGE_INTERNAL_ERROR);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_NOT_FOUND.getName(), CONTROL_POLICY_PAGE_NOT_FOUND);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_RESOURCE_URI.getName(), CONTROL_POLICY_PAGE_RESOURCE_URI);
+
+ //
PORTAL_PROPERTIES.put(THEME_LAYOUT_ID.getName(), THEME_LAYOUT_ID);
PORTAL_PROPERTIES.put(THEME_THEME_ID.getName(), THEME_THEME_ID);
PORTAL_PROPERTIES.put(THEME_RENDER_SET_ID.getName(), THEME_RENDER_SET_ID);
@@ -157,8 +173,8 @@
CONTROL_PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_RESOURCE_URI.getName(), CONTROL_POLICY_PORTAL_RESOURCE_URI);
//
+ CONTROL_PROPERTIES.putAll(CONTROL_PORTAL_PROPERTIES);
CONTROL_PROPERTIES.putAll(CONTROL_PAGE_PROPERTIES);
- CONTROL_PROPERTIES.putAll(CONTROL_PORTAL_PROPERTIES);
//
ALL_PROPERTIES.putAll(CONTEXT_PROPERTIES);
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2007-06-21 13:15:18 UTC (rev 7503)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui;
-import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.core.model.portal.PortalObject;
/**
@@ -35,25 +34,34 @@
{
/** . */
- private String value;
+ protected String value;
/** . */
- private final PropertiesBean container;
+ private final PropertyBeanContainer container;
/** . */
- private final PropertyInfo info;
+ protected final PropertyInfo info;
/** . */
- private final boolean inherited;
-
- public PropertyBean(PropertiesBean container, PropertyInfo info, boolean inherited, String value)
+ protected boolean inherited;
+
+ /** . */
+ protected boolean inheritable;
+
+ public PropertyBean(PropertyBeanContainer container, PropertyInfo info, boolean inherited, boolean inheritable, String value)
{
this.container = container;
this.info = info;
this.inherited = inherited;
+ this.inheritable = inheritable;
this.value = value;
}
-
+
+ public boolean isInheritable()
+ {
+ return inheritable;
+ }
+
public String getName()
{
return info.getName();
@@ -96,7 +104,7 @@
this.value = value.toString();
// Need to use the container as it will contain the refreshed object
- PortalObject portalObject = container.pomgr.getSelectedObject();
+ PortalObject portalObject = container.getRelatedObject();
//if value is inherited check if updated value is the same - if yes, don't update to keep inheritance
if (isInherited())
Added: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java 2007-06-21 13:15:18 UTC (rev 7503)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.core.model.portal.PortalObject;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class PropertyBeanContainer
+{
+
+ protected abstract PortalObject getRelatedObject();
+
+}
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-06-21 13:15:18 UTC (rev 7503)
@@ -48,6 +48,10 @@
<managed-bean-class>org.jboss.portal.core.admin.ui.PortalObjectManagerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
+ <property-name>namespace</property-name>
+ <value></value>
+ </managed-property>
+ <managed-property>
<property-name>roleModule</property-name>
<value>#{applicationScope.RoleModule}</value>
</managed-property>
@@ -117,7 +121,6 @@
</managed-property>
</managed-bean>
-
<!-- The instance manager managed bean -->
<managed-bean>
<managed-bean-name>instancemgr</managed-bean-name>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editErrorHandling.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editErrorHandling.xhtml 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editErrorHandling.xhtml 2007-06-21 13:15:18 UTC (rev 7503)
@@ -6,7 +6,7 @@
xmlns:c="http://java.sun.com/jstl/core">
- <f:subview id="errorHandlingView" rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL}">
+ <f:subview id="errorHandlingView" rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_CONTEXT or portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL}">
<!-- Separation -->
<hr/>
@@ -29,7 +29,7 @@
<h:outputText value="#{properties.portalControlAccessDenied.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlAccessDenied.inherit}" value="#{properties.portalControlAccessDenied.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.portalControlAccessDenied.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlAccessDenied.inherit}" value="#{properties.portalControlAccessDenied.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.portalControlAccessDenied.value}" disabled="#{properties.portalControlAccessDenied.inherited}" onchange="submit();">
@@ -42,7 +42,7 @@
<h:outputText value="#{properties.portalControlUnavailable.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlUnavailable.inherit}" value="#{properties.portalControlUnavailable.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.portalControlUnavailable.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlUnavailable.inherit}" value="#{properties.portalControlUnavailable.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.portalControlUnavailable.value}" disabled="#{properties.portalControlUnavailable.inherited}" onchange="submit();">
@@ -55,7 +55,7 @@
<h:outputText value="#{properties.portalControlError.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlError.inherit}" value="#{properties.portalControlError.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.portalControlError.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlError.inherit}" value="#{properties.portalControlError.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.portalControlError.value}" disabled="#{properties.portalControlError.inherited}" onchange="submit();">
@@ -68,7 +68,7 @@
<h:outputText value="#{properties.portalControlInternalError.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlInternalError.inherit}" value="#{properties.portalControlInternalError.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.portalControlInternalError.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlInternalError.inherit}" value="#{properties.portalControlInternalError.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.portalControlInternalError.value}" disabled="#{properties.portalControlInternalError.inherited}" onchange="submit();">
@@ -81,7 +81,7 @@
<h:outputText value="#{properties.portalControlNotFound.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlNotFound.inherit}" value="#{properties.portalControlNotFound.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.portalControlNotFound.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlNotFound.inherit}" value="#{properties.portalControlNotFound.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.portalControlNotFound.value}" disabled="#{properties.portalControlNotFound.inherited}" onchange="submit();">
@@ -94,7 +94,7 @@
<h:outputText value="#{properties.portalControlResourceURI.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlResourceURI.inherit}" value="#{properties.portalControlResourceURI.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.portalControlResourceURI.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.portalControlResourceURI.inherit}" value="#{properties.portalControlResourceURI.inherited}"/>inherit action from parent
</td>
<td>
<h:inputText value="#{properties.portalControlResourceURI.value}" disabled="#{properties.portalControlResourceURI.inherited}"/>
@@ -129,7 +129,7 @@
<h:outputText value="#{properties.pageControlAccessDenied.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlAccessDenied.inherit}" value="#{properties.pageControlAccessDenied.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.pageControlAccessDenied.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlAccessDenied.inherit}" value="#{properties.pageControlAccessDenied.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.pageControlAccessDenied.value}" disabled="#{properties.pageControlAccessDenied.inherited}" onchange="submit();">
@@ -142,7 +142,7 @@
<h:outputText value="#{properties.pageControlUnavailable.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlUnavailable.inherit}" value="#{properties.pageControlUnavailable.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.pageControlUnavailable.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlUnavailable.inherit}" value="#{properties.pageControlUnavailable.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.pageControlUnavailable.value}" disabled="#{properties.pageControlUnavailable.inherited}" onchange="submit();">
@@ -155,7 +155,7 @@
<h:outputText value="#{properties.pageControlError.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlError.inherit}" value="#{properties.pageControlError.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.pageControlError.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlError.inherit}" value="#{properties.pageControlError.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.pageControlError.value}" disabled="#{properties.pageControlError.inherited}" onchange="submit();">
@@ -168,7 +168,7 @@
<h:outputText value="#{properties.pageControlInternalError.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlInternalError.inherit}" value="#{properties.pageControlInternalError.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.pageControlInternalError.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlInternalError.inherit}" value="#{properties.pageControlInternalError.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.pageControlInternalError.value}" disabled="#{properties.pageControlInternalError.inherited}" onchange="submit();">
@@ -181,7 +181,7 @@
<h:outputText value="#{properties.pageControlNotFound.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlNotFound.inherit}" value="#{properties.pageControlNotFound.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.pageControlNotFound.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlNotFound.inherit}" value="#{properties.pageControlNotFound.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu value="#{properties.pageControlNotFound.value}" disabled="#{properties.pageControlNotFound.inherited}" onchange="submit();">
@@ -194,7 +194,7 @@
<h:outputText value="#{properties.pageControlResourceURI.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlResourceURI.inherit}" value="#{properties.pageControlResourceURI.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox disabled="#{!properties.pageControlResourceURI.inheritable}" styleClass="portlet-form-button" onchange="submit();" valueChangeListener="#{properties.pageControlResourceURI.inherit}" value="#{properties.pageControlResourceURI.inherited}"/>inherit action from parent
</td>
<td>
<h:inputText value="#{properties.pageControlResourceURI.value}" disabled="#{properties.pageControlResourceURI.inherited}"/>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-06-21 13:15:18 UTC (rev 7503)
@@ -1,5 +1,6 @@
<div
xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
@@ -7,6 +8,13 @@
<ui:define name="content">
+ <h:form>
+ <h:commandLink action="editProperties" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink>
+ </h:form>
+
<!-- Sub page addition -->
<div style="padding:1em 0 0 0">
<h:form id="portal_form">
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-06-21 13:15:18 UTC (rev 7503)
@@ -30,8 +30,6 @@
</h:commandLink>
</h:form>
-
-
<!-- Sub page addition -->
<div style="padding:1em 0 0 0">
<table>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-06-21 11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-06-21 13:15:18 UTC (rev 7503)
@@ -16,6 +16,9 @@
<li>
<h:commandLink value="Portlet Definitions" action="portlets"/>
</li>
+ <li>
+ <h:commandLink value="Dashboard" action="dashboard"/>
+ </li>
</ul>
</h:form>
18 years, 10 months
JBoss Portal SVN: r7502 - in trunk/core-admin/src: main/org/jboss/portal/core/admin/ui/conversion and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-21 07:58:51 -0400 (Thu, 21 Jun 2007)
New Revision: 7502
Added:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java
Removed:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ContentTypeConverter.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectIdConverter.java
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
Log:
moved converters in a conversion package
Deleted: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ContentTypeConverter.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ContentTypeConverter.java 2007-06-21 10:40:41 UTC (rev 7501)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ContentTypeConverter.java 2007-06-21 11:58:51 UTC (rev 7502)
@@ -1,47 +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.core.admin.ui;
-
-import org.jboss.portal.core.model.content.ContentType;
-
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.context.FacesContext;
-import javax.faces.component.UIComponent;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ContentTypeConverter implements Converter
-{
- public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException
- {
- return string == null ? null : ContentType.create(string);
- }
-
- public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException
- {
- return object == null ? null : object.toString();
- }
-}
Deleted: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectIdConverter.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectIdConverter.java 2007-06-21 10:40:41 UTC (rev 7501)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectIdConverter.java 2007-06-21 11:58:51 UTC (rev 7502)
@@ -1,48 +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.core.admin.ui;
-
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.PortalObjectPath;
-
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortalObjectIdConverter implements Converter
-{
- public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException
- {
- return string == null ? null : PortalObjectId.parse(string, PortalObjectPath.LEGACY_BASE64_FORMAT);
- }
-
- public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException
- {
- return object == null ? null : ((PortalObjectId)object).toString(PortalObjectPath.LEGACY_BASE64_FORMAT);
- }
-}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java (from rev 7501, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ContentTypeConverter.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java 2007-06-21 11:58:51 UTC (rev 7502)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.conversion;
+
+import org.jboss.portal.core.model.content.ContentType;
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentTypeConverter implements Converter
+{
+ public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException
+ {
+ return string == null ? null : ContentType.create(string);
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException
+ {
+ return object == null ? null : object.toString();
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java (from rev 7501, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectIdConverter.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java 2007-06-21 11:58:51 UTC (rev 7502)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.conversion;
+
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortalObjectIdConverter implements Converter
+{
+ public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException
+ {
+ return string == null ? null : PortalObjectId.parse(string, PortalObjectPath.LEGACY_BASE64_FORMAT);
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException
+ {
+ return object == null ? null : ((PortalObjectId)object).toString(PortalObjectPath.LEGACY_BASE64_FORMAT);
+ }
+}
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-06-21 10:40:41 UTC (rev 7501)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-06-21 11:58:51 UTC (rev 7502)
@@ -34,12 +34,12 @@
<converter>
<converter-for-class>org.jboss.portal.core.model.content.ContentType</converter-for-class>
- <converter-class>org.jboss.portal.core.admin.ui.ContentTypeConverter</converter-class>
+ <converter-class>org.jboss.portal.core.admin.ui.conversion.ContentTypeConverter</converter-class>
</converter>
<converter>
<converter-for-class>org.jboss.portal.core.model.portal.PortalObjectId</converter-for-class>
- <converter-class>org.jboss.portal.core.admin.ui.PortalObjectIdConverter</converter-class>
+ <converter-class>org.jboss.portal.core.admin.ui.conversion.PortalObjectIdConverter</converter-class>
</converter>
<!-- The portal object manager bean -->
18 years, 10 months
JBoss Portal SVN: r7501 - trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-21 06:40:41 -0400 (Thu, 21 Jun 2007)
New Revision: 7501
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
Log:
removed System.out
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-06-21 09:48:46 UTC (rev 7500)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-06-21 10:40:41 UTC (rev 7501)
@@ -328,8 +328,6 @@
PortletActionEvent actionEvent = (PortletActionEvent)event;
Map actionParams = actionEvent.getParameterMap();
- System.out.println("actionParams = " + actionParams);
-
// Keep window name and region defined
setWindowName(((String[])actionParams.get("windowName"))[0]);
18 years, 10 months