JBoss Portal SVN: r7500 - trunk/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-06-21 05:48:46 -0400 (Thu, 21 Jun 2007)
New Revision: 7500
Modified:
trunk/build/build-thirdparty.xml
Log:
Oups forgot to use the correct jsf-portlet lib
Modified: trunk/build/build-thirdparty.xml
===================================================================
--- trunk/build/build-thirdparty.xml 2007-06-21 08:53:27 UTC (rev 7499)
+++ trunk/build/build-thirdparty.xml 2007-06-21 09:48:46 UTC (rev 7500)
@@ -111,7 +111,7 @@
<componentref name="wutka-dtdparser" version="1.2.1"/>
<componentref name="portals-bridges" version="1.0"/>
<!-- patched jsf-portlet bridge -->
- <componentref name="portals-bridges/jsf-portlet" version="1.1.4-patched"/>
+ <componentref name="portals-bridges/jsf-portlet" version="1.2-patched"/>
</build>
<synchronizeinfo/>
18 years, 10 months
JBoss Portal SVN: r7499 - in trunk/faces/src: resources/portal-faces-lib-jar/META-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-06-21 04:53:27 -0400 (Thu, 21 Jun 2007)
New Revision: 7499
Added:
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFacesContextFactoryImpl.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeLifecycleFactoryImpl.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeViewHandlerImpl.java
trunk/faces/src/resources/portal-faces-lib-jar/META-INF/faces-config.xml
Log:
Trying to have JBoss Portal 2.6 running on JBoss AS 4.0.x and 4.2.x
Added: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFacesContextFactoryImpl.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFacesContextFactoryImpl.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeFacesContextFactoryImpl.java 2007-06-21 08:53:27 UTC (rev 7499)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * 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.FacesException;
+import javax.faces.context.FacesContext;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.lifecycle.Lifecycle;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 1.1 $
+ */
+public class JSFMetaBridgeFacesContextFactoryImpl extends FacesContextFactory
+{
+
+ private FacesContextFactory facesContextFactory;
+
+ 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();
+ }
+ }
+
+
+ }
+
+ public FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException
+ {
+ return facesContextFactory.getFacesContext(context, request, response, lifecycle);
+ }
+
+}
Added: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeLifecycleFactoryImpl.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeLifecycleFactoryImpl.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeLifecycleFactoryImpl.java 2007-06-21 08:53:27 UTC (rev 7499)
@@ -0,0 +1,98 @@
+/******************************************************************************
+ * 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.util.Iterator;
+
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.lifecycle.LifecycleFactory;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 1.1 $
+ */
+public class JSFMetaBridgeLifecycleFactoryImpl extends LifecycleFactory
+{
+
+ private LifecycleFactory lifecycleFactory;
+
+ 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();
+ }
+ }
+
+
+ }
+
+ public void addLifecycle(String lifecycleId, Lifecycle lifecycle)
+ {
+ lifecycleFactory.addLifecycle(lifecycleId, lifecycle);
+
+ }
+
+ public Lifecycle getLifecycle(String lifecycleId)
+ {
+ return lifecycleFactory.getLifecycle(lifecycleId);
+ }
+
+ public Iterator getLifecycleIds()
+ {
+ return lifecycleFactory.getLifecycleIds();
+ }
+
+}
Added: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeViewHandlerImpl.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeViewHandlerImpl.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgeViewHandlerImpl.java 2007-06-21 08:53:27 UTC (rev 7499)
@@ -0,0 +1,153 @@
+/******************************************************************************
+ * 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.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;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 1.1 $
+ */
+public class JSFMetaBridgeViewHandlerImpl extends ViewHandler
+{
+
+ private ViewHandler viewHandler;
+
+ 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();
+ }
+*/
+ }
+
+
+ }
+
+ public Locale calculateLocale(FacesContext context)
+ {
+ return viewHandler.calculateLocale(context);
+ }
+
+ public String calculateRenderKitId(FacesContext context)
+ {
+ return viewHandler.calculateRenderKitId(context);
+ }
+
+ public UIViewRoot createView(FacesContext context, String viewId)
+ {
+ return viewHandler.createView(context, viewId);
+ }
+
+ public String getActionURL(FacesContext context, String viewId)
+ {
+ return viewHandler.getActionURL(context, viewId);
+ }
+
+ public String getResourceURL(FacesContext context, String path)
+ {
+ return viewHandler.getResourceURL(context, path);
+ }
+
+ public void renderView(FacesContext context, UIViewRoot viewToRender) throws IOException, FacesException
+ {
+ viewHandler.renderView(context, viewToRender);
+ }
+
+ public UIViewRoot restoreView(FacesContext context, String viewId)
+ {
+ return viewHandler.restoreView(context, viewId);
+ }
+
+ public void writeState(FacesContext context) throws IOException
+ {
+ viewHandler.writeState(context);
+
+ }
+
+}
Added: trunk/faces/src/resources/portal-faces-lib-jar/META-INF/faces-config.xml
===================================================================
--- trunk/faces/src/resources/portal-faces-lib-jar/META-INF/faces-config.xml (rev 0)
+++ trunk/faces/src/resources/portal-faces-lib-jar/META-INF/faces-config.xml 2007-06-21 08:53:27 UTC (rev 7499)
@@ -0,0 +1,70 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+ The contents of this file are subject to the terms
+ of the Common Development and Distribution License
+ (the License). You may not use this file except in
+ compliance with the License.
+
+ You can obtain a copy of the License at
+ https://javaserverfaces.dev.java.net/CDDL.html or
+ legal/CDDLv1.0.txt.
+ See the License for the specific language governing
+ permission and limitations under the License.
+
+ When distributing Covered Code, include this CDDL
+ Header Notice in each file and include the License file
+ at legal/CDDLv1.0.txt.
+ If applicable, add the following below the CDDL Header,
+ with the fields enclosed by brackets [] replaced by
+ your own identifying information:
+ "Portions Copyrighted [year] [name of copyright owner]"
+
+ [Name of File] [ver.__] [Date]
+
+ Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+-->
+
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+
+<faces-config>
+
+
+ <!-- Install Replacement Factory Objects -->
+ <factory>
+ <faces-context-factory>
+ org.jboss.portal.faces.portlet.JSFMetaBridgeFacesContextFactoryImpl
+ </faces-context-factory>
+ <lifecycle-factory>
+ org.jboss.portal.faces.portlet.JSFMetaBridgeLifecycleFactoryImpl
+ </lifecycle-factory>
+ </factory>
+
+ <!-- Install Replacement Application Objects -->
+ <application>
+ <view-handler>
+ org.jboss.portal.faces.portlet.JSFMetaBridgeViewHandlerImpl
+ </view-handler>
+ </application>
+
+
+ <component>
+ <component-type>PortletComponent</component-type>
+ <component-class>com.sun.faces.portlet.PortletComponent</component-class>
+ <property>
+ <description>
+ ValueBinding Expression which evaluates to a PortletId for the Portlet
+ </description>
+ <property-name>portletId</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+
+ <component-extension>
+ <component-family>PortletComponent</component-family>
+ </component-extension>
+
+ </component>
+</faces-config>
18 years, 10 months
JBoss Portal SVN: r7498 - in branches/JBoss_Portal_2_4_1_SP1_Intuit: security/src/main/org/jboss/portal/security/impl/jacc and 1 other directory.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-06-20 23:56:03 -0400 (Wed, 20 Jun 2007)
New Revision: 7498
Added:
branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/Permissions.java
branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/SecurityContext.java
Modified:
branches/JBoss_Portal_2_4_1_SP1_Intuit/
branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java
branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManagerFactory.java
Log:
security patch to solve sync lock issue with Permissions object in JDK5
Property changes on: branches/JBoss_Portal_2_4_1_SP1_Intuit
___________________________________________________________________
Name: svn:ignore
- *.classpath
*.project
eclipseBin
thirdparty
+ *.classpath
*.project
eclipseBin
thirdparty
eclipse
Modified: branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java
===================================================================
--- branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java 2007-06-21 03:28:18 UTC (rev 7497)
+++ branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java 2007-06-21 03:56:03 UTC (rev 7498)
@@ -63,6 +63,21 @@
/** . */
private PolicyConfigurationFactory pcf;
+
+ /**
+ * JACC bypass
+ */
+ private SecurityContext securityContext = null;
+
+ /**
+ * JACC bypass
+ *
+ * @param securityContext
+ */
+ void setSecurityContext(SecurityContext securityContext)
+ {
+ this.securityContext = securityContext;
+ }
public JACCPortalAuthorizationManager(JACCPortalAuthorizationManagerFactory factory)
{
@@ -79,7 +94,7 @@
public void checkRoleConfig(String contextID, String roleName) throws Exception
{
- Map configuredRoles = factory.configuredRoles;
+ /*Map configuredRoles = factory.configuredRoles;
synchronized (configuredRoles)
{
// The policy configuration
@@ -104,11 +119,11 @@
if (SecurityConstants.UNCHECKED_ROLE_NAME.equals(roleName))
{
- pc.addToUncheckedPolicy(container);
+ pc.addToUncheckedPolicy(container);
}
else
{
- pc.addToRole(roleName, container);
+ pc.addToRole(roleName, container);
}
}
@@ -126,6 +141,36 @@
Policy.getPolicy().refresh();
}
}
+ }*/
+
+ /**
+ * JACC bypass
+ */
+ Map configuredRoles = factory.configuredRoles;
+ synchronized (configuredRoles)
+ {
+ if (!configuredRoles.containsKey(roleName))
+ {
+ // Iterate over all domains to add their container
+ Collection domains = factory.getAuthorizationDomainRegistry().getDomains();
+ for (Iterator j = domains.iterator(); j.hasNext();)
+ {
+ AuthorizationDomain domain = (AuthorizationDomain)j.next();
+ JACCPortalPermissionCollection collection = new JACCPortalPermissionCollection(roleName, domain);
+ PermissionFactory permissionFactory = domain.getPermissionFactory();
+ PortalPermission container = permissionFactory.createPermissionContainer(collection);
+
+ if (SecurityConstants.UNCHECKED_ROLE_NAME.equals(roleName))
+ {
+ this.securityContext.addToUncheckedPolicy(container);
+ }
+ else
+ {
+ this.securityContext.addToRole(roleName, container);
+ }
+ }
+ configuredRoles.put(roleName, roleName);
+ }
}
}
@@ -175,12 +220,24 @@
principals = new Principal[0];
}
- //
+ //Bypass the JACC layer and go straight to the portal security permission layer
+ /*
ProtectionDomain pd = new ProtectionDomain(null, null, null, principals);
Policy policy = Policy.getPolicy();
boolean implied = policy.implies(pd, permission);
+ */
+
+ /**
+ * alternately bypassing the call and not letting it go through the
+ * JACC system.
+ *
+ * There is not an issue with JBoss JACC implementation, but the Permissions object
+ * in JDK5 which is leveraged by JACC. The synchrnozied block inside Permissions object
+ * is causing performance bottleneck
+ */
+ ProtectionDomain pd = new ProtectionDomain(null, null, null, principals);
+ boolean implied = this.securityContext.implies(pd, permission);
- //
return implied;
}
Modified: branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManagerFactory.java
===================================================================
--- branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManagerFactory.java 2007-06-21 03:28:18 UTC (rev 7497)
+++ branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManagerFactory.java 2007-06-21 03:56:03 UTC (rev 7498)
@@ -48,6 +48,11 @@
/** The configured roles. */
final Map configuredRoles = new HashMap();
+
+ /**
+ * JACC bypass
+ */
+ private SecurityContext securityContext = null;
public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
{
@@ -61,7 +66,9 @@
public PortalAuthorizationManager getManager()
{
- return new JACCPortalAuthorizationManager(this);
+ JACCPortalAuthorizationManager manager = new JACCPortalAuthorizationManager(this);
+ manager.setSecurityContext(this.securityContext);
+ return manager;
}
/** Set the PolicyContext subject security handler and the delegating policy. */
@@ -92,5 +99,8 @@
// Refresh
policy.refresh();
+
+ //JACC bypass
+ this.securityContext = new SecurityContext();
}
}
Added: branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/Permissions.java
===================================================================
--- branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/Permissions.java (rev 0)
+++ branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/Permissions.java 2007-06-21 03:56:03 UTC (rev 7498)
@@ -0,0 +1,167 @@
+/******************************************************************************
+ * 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.security.impl.jacc;
+
+import java.util.Map;
+
+import java.security.Permission;
+import java.security.PermissionCollection;
+
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public final class Permissions
+{
+ /**
+ * Key is permissions Class, value is PermissionCollection for that class.
+ * Not serialized; see serialization section at end of class.
+ */
+ private transient Map permsMap = null;
+
+
+ /**
+ * Creates a new Permissions object containing no PermissionCollections.
+ */
+ public Permissions()
+ {
+ this.permsMap = new ConcurrentHashMap();
+ }
+
+ /**
+ * Adds a permission object to the PermissionCollection for the class the
+ * permission belongs to. For example, if <i>permission</i> is a
+ * FilePermission, it is added to the FilePermissionCollection stored in this
+ * Permissions object.
+ *
+ * This method creates a new PermissionCollection object (and adds the
+ * permission to it) if an appropriate collection does not yet exist.
+ * <p>
+ *
+ * @param permission
+ * the Permission object to add.
+ *
+ * @exception SecurityException
+ * if this Permissions object is marked as readonly.
+ *
+ * @see PermissionCollection#isReadOnly()
+ */
+ public void add(Permission permission)
+ {
+ PermissionCollection pc;
+ pc = getPermissionCollection(permission, true);
+ pc.add(permission);
+ }
+
+ /**
+ * Checks to see if this object's PermissionCollection for permissions of the
+ * specified permission's type implies the permissions expressed in the
+ * <i>permission</i> object. Returns true if the combination of permissions
+ * in the appropriate PermissionCollection (e.g., a FilePermissionCollection
+ * for a FilePermission) together imply the specified permission.
+ *
+ * <p>
+ * For example, suppose there is a FilePermissionCollection in this
+ * Permissions object, and it contains one FilePermission that specifies
+ * "read" access for all files in all subdirectories of the "/tmp" directory,
+ * and another FilePermission that specifies "write" access for all files in
+ * the "/tmp/scratch/foo" directory. Then if the <code>implies</code>
+ * method is called with a permission specifying both "read" and "write"
+ * access to files in the "/tmp/scratch/foo" directory, <code>true</code>
+ * is returned.
+ *
+ * <p>
+ * Additionally, if this PermissionCollection contains the AllPermission,
+ * this method will always return true.
+ * <p>
+ *
+ * @param permission
+ * the Permission object to check.
+ *
+ * @return true if "permission" is implied by the permissions in the
+ * PermissionCollection it belongs to, false if not.
+ */
+ public boolean implies(Permission permission)
+ {
+ PermissionCollection pc = getPermissionCollection(permission, false);
+ if (pc != null)
+ {
+ return pc.implies(permission);
+ }
+ else
+ {
+ // none found
+ return false;
+ }
+ }
+
+
+ /**
+ * Gets the PermissionCollection in this Permissions object for permissions
+ * whose type is the same as that of <i>p</i>. For example, if <i>p</i> is
+ * a FilePermission, the FilePermissionCollection stored in this Permissions
+ * object will be returned.
+ *
+ * If createEmpty is true, this method creates a new PermissionCollection
+ * object for the specified type of permission objects if one does not yet
+ * exist. To do so, it first calls the <code>newPermissionCollection</code>
+ * method on <i>p</i>. Subclasses of class Permission override that method
+ * if they need to store their permissions in a particular
+ * PermissionCollection object in order to provide the correct semantics when
+ * the <code>PermissionCollection.implies</code> method is called. If the
+ * call returns a PermissionCollection, that collection is stored in this
+ * Permissions object. If the call returns null and createEmpty is true, then
+ * this method instantiates and stores a default PermissionCollection that
+ * uses a hashtable to store its permission objects.
+ *
+ * createEmpty is ignored when creating empty PermissionCollection for
+ * unresolved permissions because of the overhead of determining the
+ * PermissionCollection to use.
+ *
+ * createEmpty should be set to false when this method is invoked from
+ * implies() because it incurs the additional overhead of creating and adding
+ * an empty PermissionCollection that will just return false. It should be
+ * set to true when invoked from add().
+ */
+ private PermissionCollection getPermissionCollection(Permission p,
+ boolean createEmpty)
+ {
+ Class c = p.getClass();
+
+ PermissionCollection pc = (PermissionCollection) permsMap.get(c);
+ if (!createEmpty)
+ {
+ return pc;
+ }
+ else if (pc == null)
+ {
+ pc = p.newPermissionCollection();
+ if (pc != null)
+ {
+ permsMap.put(c, pc);
+ }
+ }
+ return pc;
+ }
+}
\ No newline at end of file
Added: branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/SecurityContext.java
===================================================================
--- branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/SecurityContext.java (rev 0)
+++ branches/JBoss_Portal_2_4_1_SP1_Intuit/security/src/main/org/jboss/portal/security/impl/jacc/SecurityContext.java 2007-06-21 03:56:03 UTC (rev 7498)
@@ -0,0 +1,134 @@
+/******************************************************************************
+ * 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.security.impl.jacc;
+
+import java.security.Permission;
+import java.security.Principal;
+import java.security.ProtectionDomain;
+import java.security.acl.Group;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class SecurityContext
+{
+ private Permissions uncheckedPermissions = null;
+ private HashMap rolePermissions = null;
+
+ /**
+ *
+ *
+ */
+ SecurityContext()
+ {
+ this.uncheckedPermissions = new Permissions();
+ this.rolePermissions = new HashMap();
+ }
+
+ /**
+ *
+ * @param roleName
+ * @param permission
+ */
+ void addToRole(String roleName, Permission permission)
+ {
+ Permissions perms = (Permissions) this.rolePermissions.get(roleName);
+ if (perms == null)
+ {
+ perms = new Permissions();
+ this.rolePermissions.put(roleName, perms);
+ }
+ perms.add(permission);
+ }
+
+
+ /**
+ *
+ * @param permission
+ */
+ void addToUncheckedPolicy(Permission permission)
+ {
+ this.uncheckedPermissions.add(permission);
+ }
+
+ /**
+ *
+ * @param domain
+ * @param permission
+ * @return
+ */
+ boolean implies(ProtectionDomain domain, Permission permission)
+ {
+ boolean implied = false;
+
+ // Next see if this matches an unchecked permission
+ if( uncheckedPermissions.implies(permission) )
+ {
+ return true;
+ }
+
+ // Check principal to role permissions
+ Principal[] principals = domain.getPrincipals();
+ int length = principals != null ? principals.length : 0;
+ ArrayList princpalNames = new ArrayList();
+ for(int n = 0; n < length; n ++)
+ {
+ Principal p = principals[n];
+ if( p instanceof Group )
+ {
+ Group g = (Group) p;
+ Enumeration iter = g.members();
+ while( iter.hasMoreElements() )
+ {
+ p = (Principal) iter.nextElement();
+ String name = p.getName();
+ princpalNames.add(name);
+ }
+ }
+ else
+ {
+ String name = p.getName();
+ princpalNames.add(name);
+ }
+ }
+ if( princpalNames.size() > 0 )
+ {
+ for(int n = 0; implied == false && n < princpalNames.size(); n ++)
+ {
+ String name = (String) princpalNames.get(n);
+ Permissions perms = (Permissions) rolePermissions.get(name);
+
+ if( perms == null )
+ {
+ continue;
+ }
+ implied = perms.implies(permission);
+ }
+ }
+
+ return implied;
+ }
+}
18 years, 10 months
JBoss Portal SVN: r7497 - branches.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-06-20 23:28:18 -0400 (Wed, 20 Jun 2007)
New Revision: 7497
Added:
branches/JBoss_Portal_2_4_1_SP1_Intuit/
Log:
Creating a branch for Intuit which includes the security patch
Copied: branches/JBoss_Portal_2_4_1_SP1_Intuit (from rev 7496, tags/JBoss_Portal_2_4_1_SP1)
18 years, 10 months
JBoss Portal SVN: r7496 - tags/JBoss_Portal_2_6_0_CR3/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-06-20 19:44:35 -0400 (Wed, 20 Jun 2007)
New Revision: 7496
Modified:
tags/JBoss_Portal_2_6_0_CR3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
Log:
- JBPORTAL-1492: Check that the consumer is registered before trying to deregister.
Modified: tags/JBoss_Portal_2_6_0_CR3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- tags/JBoss_Portal_2_6_0_CR3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-06-20 23:40:58 UTC (rev 7495)
+++ tags/JBoss_Portal_2_6_0_CR3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-06-20 23:44:35 UTC (rev 7496)
@@ -120,7 +120,13 @@
{
log.debug("releaseSessions failed when attempting to destroy " + CONSUMER_WITH_ID + id + "'");
}
- registerOrDeregisterConsumerWith(id, false);
+
+ // if the consumer is registered, deregister it
+ if (info.isRegistered())
+ {
+ registerOrDeregisterConsumerWith(id, false);
+ }
+
deactivateConsumerWith(id);
consumers.remove(id);
18 years, 10 months
JBoss Portal SVN: r7495 - trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-06-20 19:40:58 -0400 (Wed, 20 Jun 2007)
New Revision: 7495
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
Log:
- JBPORTAL-1492: Check that the consumer is registered before trying to deregister.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-06-20 23:24:20 UTC (rev 7494)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-06-20 23:40:58 UTC (rev 7495)
@@ -120,7 +120,13 @@
{
log.debug("releaseSessions failed when attempting to destroy " + CONSUMER_WITH_ID + id + "'");
}
- registerOrDeregisterConsumerWith(id, false);
+
+ // if the consumer is registered, deregister it
+ if (info.isRegistered())
+ {
+ registerOrDeregisterConsumerWith(id, false);
+ }
+
deactivateConsumerWith(id);
consumers.remove(id);
18 years, 10 months
JBoss Portal SVN: r7494 - tags/JBoss_Portal_2_6_0_CR3/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-06-20 19:24:20 -0400 (Wed, 20 Jun 2007)
New Revision: 7494
Modified:
tags/JBoss_Portal_2_6_0_CR3/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
Log:
- JBPORTAL-1495: Save was checking if the configuration was modified. Disabled the check for now.
Modified: tags/JBoss_Portal_2_6_0_CR3/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- tags/JBoss_Portal_2_6_0_CR3/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-06-20 23:18:15 UTC (rev 7493)
+++ tags/JBoss_Portal_2_6_0_CR3/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-06-20 23:24:20 UTC (rev 7494)
@@ -160,11 +160,11 @@
</c:if>
<tr>
<td colspan="2" style="padding: 1em 1em 1em 0;">
- <h:commandButton action="#{consumer.update}" value="Save" disabled="#{!consumer.modified}"
- styleClass="portlet-form-button">
+ <h:commandButton action="#{consumer.update}" value="Save" title="" styleClass="portlet-form-button">
<f:param name="id" value="#{consumer.id}"/>
</h:commandButton>
- <h:commandLink action="#{consumer.refreshConsumer}" value="Refresh" title="Refresh information from Producer"
+ <h:commandLink action="#{consumer.refreshConsumer}" value="Save & Refresh"
+ title="Save changes and refresh information from Producer"
styleClass="portlet-form-button">
<f:param name="id" value="#{consumer.id}"/>
</h:commandLink>
18 years, 10 months
JBoss Portal SVN: r7493 - trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-06-20 19:18:15 -0400 (Wed, 20 Jun 2007)
New Revision: 7493
Modified:
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
Log:
- JBPORTAL-1495: Save was checking if the configuration was modified. Disabled the check for now.
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-06-20 22:59:34 UTC (rev 7492)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-06-20 23:18:15 UTC (rev 7493)
@@ -160,11 +160,11 @@
</c:if>
<tr>
<td colspan="2" style="padding: 1em 1em 1em 0;">
- <h:commandButton action="#{consumer.update}" value="Save" disabled="#{!consumer.modified}"
- styleClass="portlet-form-button">
+ <h:commandButton action="#{consumer.update}" value="Save" title="" styleClass="portlet-form-button">
<f:param name="id" value="#{consumer.id}"/>
</h:commandButton>
- <h:commandLink action="#{consumer.refreshConsumer}" value="Refresh" title="Refresh information from Producer"
+ <h:commandLink action="#{consumer.refreshConsumer}" value="Save & Refresh"
+ title="Save changes and refresh information from Producer"
styleClass="portlet-form-button">
<f:param name="id" value="#{consumer.id}"/>
</h:commandLink>
18 years, 10 months
JBoss Portal SVN: r7492 - trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-20 18:59:34 -0400 (Wed, 20 Jun 2007)
New Revision: 7492
Modified:
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
Log:
minor import opt
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp 2007-06-20 22:59:02 UTC (rev 7491)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp 2007-06-20 22:59:34 UTC (rev 7492)
@@ -1,7 +1,5 @@
<%@ page import="java.util.Collection" %>
<%@ page import="org.jboss.portal.core.model.instance.Instance" %>
-<%@ page import="java.util.Iterator" %>
-<%@ page import="javax.portlet.PortletURL" %>
<%@ page import="org.jboss.portal.common.util.IteratorStatus" %>
<%@ page import="org.jboss.portal.portlet.Portlet" %>
<%@ page import="org.jboss.portal.portlet.info.MetaInfo" %>
18 years, 10 months
JBoss Portal SVN: r7491 - in trunk/core/src: resources/portal-core-war/WEB-INF/jsp and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-06-20 18:59:02 -0400 (Wed, 20 Jun 2007)
New Revision: 7491
Added:
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content/
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
Modified:
trunk/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java
Log:
implementation of new portlet instance selector that requires one click. still a bit ugly but more usable
Modified: trunk/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java 2007-06-20 21:29:53 UTC (rev 7490)
+++ trunk/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java 2007-06-20 22:59:02 UTC (rev 7491)
@@ -37,6 +37,7 @@
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.PortletURL;
+import javax.portlet.PortletRequestDispatcher;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
@@ -128,71 +129,25 @@
};
Collections.sort(available_instances, simpleComparator);
- Instance selectedInstance = null;
-
- if (!newContent)
- {
- writer.print("<span class=\"portlet-font\">Portlet instance associated to this window:</span>");
- }
- else
- {
- writer.print("<span class=\"portlet-font\">Select a portlet instance to associate to this window:</span>");
- }
-
//
- writer.print("<form id=\"portlet_selection_form\" action=\"");
- writer.print(actionURL);
- writer.print("\" method=\"post\">\n");
- writer.println("<select name=\"content.uri\"size=\"20\">\n");
+ Instance selectedInstance = null;
for (int i = 0; i < available_instances.size(); i++)
{
Instance instance = (Instance)available_instances.get(i);
-
- //
- writer.print("<option value=\"");
- writer.print(instance.getId());
- writer.print("\"");
-
- //
if (instance.getId().equals(selectedURI))
{
selectedInstance = instance;
- writer.print(" selected=\"selected\"");
}
-
- //
- writer.print(">");
- writer.print(instance.getId());
- writer.println("</option>\n");
}
- writer.println("</select><br />");
- String buttonText = (newContent) ? "Select" : "Update";
- writer.println("<input type=\"submit\" name=\"content.action.select\" value=\"" + buttonText + "\" class=\"portlet-form-button\"/>");
- writer.print("</form>");
+ //
+ req.setAttribute("INSTANCES", available_instances);
+ req.setAttribute("SELECTED_INSTANCE", selectedInstance);
+ req.setAttribute("NEW_CONTENT", Boolean.valueOf(newContent));
//
- if (selectedInstance != null)
- {
- writer.print("<div class=\"portlet-font\" style=\"float:left\">");
- writer.print("<div><span class=\"portlet-form-field-label\">Portlet instance:</span>" + selectedURI + "</div>");
- try
- {
- Portlet portlet = selectedInstance.getPortlet();
- if (portlet != null)
- {
- MetaInfo metaInfo = portlet.getInfo().getMeta();
- writer.print("<div><span class=\"portlet-form-field-label\">Portlet name:</span>" + metaInfo.getMetaValue(MetaInfo.DISPLAY_NAME).getDefaultString() + "</div>");
- writer.print("<div><span class=\"portlet-form-field-label\">Portlet description:</span>" + metaInfo.getMetaValue(MetaInfo.DESCRIPTION).getDefaultString() + "</div>");
- writer.print("<div><span class=\"portlet-form-field-label\">Portlet title:</span>" + metaInfo.getMetaValue(MetaInfo.TITLE).getDefaultString() + "</div>");
- writer.print("<div><span class=\"portlet-form-field-label\">Portlet keywords:</span>" + metaInfo.getMetaValue(MetaInfo.KEYWORDS).getDefaultString() + "</div>");
- }
- }
- catch (PortletInvokerException e)
- {
- e.printStackTrace();
- }
- }
+ PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/content/portlet_editor.jsp");
+ dispatcher.include(req, resp);
//
writer.close();
Added: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp (rev 0)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp 2007-06-20 22:59:02 UTC (rev 7491)
@@ -0,0 +1,81 @@
+<%@ page import="java.util.Collection" %>
+<%@ page import="org.jboss.portal.core.model.instance.Instance" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="javax.portlet.PortletURL" %>
+<%@ page import="org.jboss.portal.common.util.IteratorStatus" %>
+<%@ page import="org.jboss.portal.portlet.Portlet" %>
+<%@ page import="org.jboss.portal.portlet.info.MetaInfo" %>
+<%@ page import="org.jboss.portal.portlet.PortletInvokerException" %>
+<%@ page language="java" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<%
+ Collection instances = (Collection)request.getAttribute("INSTANCES");
+ Instance selectedInstance = (Instance)request.getAttribute("SELECTED_INSTANCE");
+ boolean newContent = Boolean.TRUE == request.getAttribute("NEW_CONTENT");
+%>
+
+<%
+ if (newContent)
+ {
+%>
+ <span class="portlet-font">Portlet instance associated to this window:</span>
+<%
+ }
+ else
+ {
+%>
+ <span class="portlet-font">Portlet instance associated to this window:</span>
+<%
+ }
+%>
+
+<div style="height:300px; width:300px; overflow-y: scroll; overflow-x: none; border: 1px solid #333333;">
+ <table style="width:100%;" cellspacing="0" cellpadding="0">
+ <%
+ for (IteratorStatus i = new IteratorStatus(instances); i.hasNext();)
+ {
+ Instance instance = (Instance)i.next();
+ String rowClass = instance == selectedInstance ? "portlet-section-selected" : (i.getIndex() %2 == 0 ? "portlet-section-body" : "portlet-section-alternate");
+ %>
+ <portlet:actionURL var="url">
+ <portlet:param name="content.action.select" value="true"/>
+ <portlet:param name="content.uri" value="<%= instance.getId() %>"/>
+ </portlet:actionURL>
+ <tr class="<%= rowClass %>">
+ <td><a href="<%= url %>"><%= instance.getId() %></a></td>
+ </tr>
+ <%
+ }
+ %>
+ </table>
+</div>
+
+<%
+ if (selectedInstance != null)
+ {
+%>
+<div class="portlet-font">
+<div><span class="portlet-form-field-label">Portlet instance:</span><%= selectedInstance.getId() %></div>
+<%
+ Portlet portlet = null;
+ try
+ {
+ portlet = selectedInstance.getPortlet();
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+ if (portlet != null)
+ {
+ MetaInfo metaInfo = portlet.getInfo().getMeta();
+%>
+<div><span class="portlet-form-field-label">Portlet name:</span><%= metaInfo.getMetaValue(MetaInfo.DISPLAY_NAME).getDefaultString() %></div>
+<div><span class="portlet-form-field-label">Portlet description:</span><%= metaInfo.getMetaValue(MetaInfo.DESCRIPTION).getDefaultString() %></div>
+<div><span class="portlet-form-field-label">Portlet title:</span><%= metaInfo.getMetaValue(MetaInfo.TITLE).getDefaultString() %></div>
+<div><span class="portlet-form-field-label">Portlet keywords:</span><%= metaInfo.getMetaValue(MetaInfo.KEYWORDS).getDefaultString() %></div>
+<%
+ }
+ }
+%>
18 years, 10 months