JBoss Portal SVN: r6695 - in docs/trunk/referenceGuide/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-03-15 16:07:47 -0400 (Thu, 15 Mar 2007)
New Revision: 6695
Modified:
docs/trunk/referenceGuide/en/master.xml
docs/trunk/referenceGuide/en/modules/authentication.xml
docs/trunk/referenceGuide/en/modules/identity.xml
docs/trunk/referenceGuide/en/modules/ldap.xml
Log:
doc update
Modified: docs/trunk/referenceGuide/en/master.xml
===================================================================
--- docs/trunk/referenceGuide/en/master.xml 2007-03-15 19:58:37 UTC (rev 6694)
+++ docs/trunk/referenceGuide/en/master.xml 2007-03-15 20:07:47 UTC (rev 6695)
@@ -63,13 +63,13 @@
<!-- clustering configuration --> &clustering;
<!-- WSRP --> &wsrp;
<!-- security administration --> &security;
- <!-- CMS --> &CMS;
- <!-- NavTabs --> &navtabs;
- <!-- theme/layout api --> &themeandlayouts;
<!-- Identity --> &identity;
<!-- Authentication --> &authentication;
<!-- LDAP --> &ldap;
<!-- SSO --> &sso;
+ <!-- CMS --> &CMS;
+ <!-- NavTabs --> &navtabs;
+ <!-- theme/layout api --> &themeandlayouts;
<!-- troubleshooting FAQ--> &troubleshooting;
</book>
Modified: docs/trunk/referenceGuide/en/modules/authentication.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/authentication.xml 2007-03-15 19:58:37 UTC (rev 6694)
+++ docs/trunk/referenceGuide/en/modules/authentication.xml 2007-03-15 20:07:47 UTC (rev 6695)
@@ -6,16 +6,32 @@
<email>boleslaw dot dawidowicz at redhat dot com</email>
</author>
</chapterinfo>
- <title>Authentication</title>
+ <title>Authentication and Authorization</title>
<para>This chapter describes authentication mechanisms in JBoss Portal</para>
<sect1 id="authentication_in_portal">
<title>Authentication in JBoss Portal</title>
- <para>TODO</para>
- <para>To understand authentication mechanisms in JBoss Portal better please refer to <link linkend="security.security_authentication">Security</link> chapter</para>
+ <para>JBoss Portal is heavily standard based so it leverages <emphasis>Java Authentication and Authorization Service (JAAS)</emphasis>
+ in JBoss Application Server. Because of this it can be very flexibly configured, and other
+ authentication solutions can be plugged in really easily.
+ To better understand authentication mechanisms in JBoss Portal please refer to
+ <link linkend="security.security_authentication">Security</link> chapter.
+ To learn more about JAAS look for proper documentation on
+ <ulink url="http://java.sun.com/javase/6/docs/technotes/guides/security/">Java security</ulink> website.
+ To learn more about security in JBoss Application Server please read
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossSX">JBossSX</ulink> documentation.
+ </para>
<sect2 id="configuration">
<title>Configuration</title>
- <para>You can configure JAAS authentication stack in <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis></para>
- <para>TODO</para>
+ <para>You can configure JAAS authentication stack in <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>.
+ What is very important to remember is that authorisation in portal starts in JAAS level -
+ configured <emphasis>LoginModule</emphasis>s apply proper <emphasis>Principal</emphasis> objects representing
+ roles to authenticated user. Like you can see in <emphasis>jboss-portal.sar/portal-server.war/WEB-INF/web.xml</emphasis> portal
+ servlet is secured with specified role ("<emphasis>Authenticated</emphasis>"). In default portal configuration
+ this role is dynamically added by <emphasis>IdentityLoginModule</emphasis>. If you reconfigure default JAAS authentication
+ chain with other <emphasis>LoginModule</emphasis> implementations, please remember you must fit in this
+ security constraints to be able to access portal. For example if you place only one <emphasis>LoginModule</emphasis>
+ that will authenticate users against LDAP server you may consider adding all users in your LDAP tree to such role.
+ </para>
</sect2>
</sect1>
<sect1 id="portal_login_modules">
@@ -170,9 +186,9 @@
<module-option name="java.naming.security.authentication">simple</module-option>
<module-option name="bindDN">cn=Directory Manager</module-option>
<module-option name="bindCredential">secret</module-option>
- <module-option name="baseCtxDN">ou=People,o=test,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</module-option>
+ <module-option name="baseCtxDN">ou=People,dc=example,dc=com</module-option>
<module-option name="baseFilter">(uid={0})</module-option>
- <module-option name="rolesCtxDN">ou=Roles,o=test,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</module-option>
+ <module-option name="rolesCtxDN">ou=Roles,dc=example,dc=com</module-option>
<module-option name="roleFilter">(member={1})</module-option>
<module-option name="roleAttributeID">cn</module-option>
<module-option name="roleRecursion">-1</module-option>
@@ -228,6 +244,7 @@
portal role with such name to the authenticated user. If such role doesn't exist in portal, module will try to create it.
</listitem>
</itemizedlist>
+ <note>Example of usage in LDAP authentication can be found in <link linkend="ldap.synchronizing">next</link> chapter.</note>
</para>
</sect2>
</sect1>
Modified: docs/trunk/referenceGuide/en/modules/identity.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/identity.xml 2007-03-15 19:58:37 UTC (rev 6694)
+++ docs/trunk/referenceGuide/en/modules/identity.xml 2007-03-15 20:07:47 UTC (rev 6695)
@@ -818,7 +818,7 @@
<para>Delegating UserProfileModule implementation has very specific role. When we use storage mechanism like LDAP we may not be able to map all
user properties into LDAP attributes because of schema limitations. To solve this problem we use database to store such not mapped properties.
Delegating user profile module will recognize if property is mapped as <emphasis role="bold">ldap</emphasis> or <emphasis role="bold">database</emphasis>
- end delegate <emphasis>setProperty()/getProperty()</emphasis> method invocation to proper module implementation. This is implemented in
+ and delegate <emphasis>setProperty()/getProperty()</emphasis> method invocation to proper module implementation. This is implemented in
<emphasis role="bold">org.jboss.portal.identity.DelegatingUserProfileModuleImpl</emphasis>. If property is mapped either as
<emphasis role="bold">ldap</emphasis> and <emphasis role="bold">database</emphasis> the <emphasis role="bold">ldap</emphasis> mapping will
have higher priority.
Modified: docs/trunk/referenceGuide/en/modules/ldap.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/ldap.xml 2007-03-15 19:58:37 UTC (rev 6694)
+++ docs/trunk/referenceGuide/en/modules/ldap.xml 2007-03-15 20:07:47 UTC (rev 6695)
@@ -12,7 +12,7 @@
<link linkend="authentication">Authentication</link> chapters before</note>
<sect1>
<title>How to enable LDAP usage in JBoss Portal</title>
- <para>We'll describe here the simple steps that you'll need to enable LDAP support in JBoss Portal.
+ <para>We'll describe here the simple steps that you'll need to perform to enable LDAP support in JBoss Portal.
For additional information you need to study more about configuration of identity and specific implementations of identity modules</para>
<para>There are two ways to achieve this:</para>
<itemizedlist>
@@ -494,7 +494,7 @@
]]>
</programlisting>
Pagination support is not widely implemented in LDAP servers. Because <emphasis>UserModule</emphasis>
- implementations rely on JNDI and are targetted to be LDAP server agnostic those methods are very effecient.
+ implementations rely on JNDI and are targetted to be LDAP server agnostic those methods aren't very effecient.
As long as you don't rely on portal user management and use dedicated tools for user provisioning it
shouldn't bother you. Otherwise you should consider extending the implementation and providing
solution dedicated to your LDAP server.
@@ -668,18 +668,20 @@
<title>LDAP server tree shapes</title>
<para>JBoss Portal supports full user/role management for simple LDAP tree shapes. Some more flexible
trees can be supported by <emphasis>LdapExtUserModuleImpl</emphasis> and <emphasis>LdapExtRoleModuleImpl</emphasis>
- - but without user/role creation, removal capabilities.
+ - but without user/role creation and removal capabilities.
However if you have complex LDAP tree you should consider using
<link linkend="authentication.synchronizing_login_module">SynchronizingLoginModule</link> described in
<link linkend="authentication">Authentication</link> chapter along with dedicated tools for user
provisioning provided with LDAP server.</para>
<para>
- In following subsections we will describe two base LDAP tree shapes along with example ldifs and portal
- identity modules configurations.
+ In following subsections we will describe two base LDAP tree shapes along with example LDIFs and portal
+ identity modules configurations. Those two examples differ only by using different <emphasis>MembershipModule</emphasis>
+ implementations and describe only tree shapes with supported user/role creation and removal capabilities.
</para>
<sect2>
<title>Keeping users membership in role entries</title>
- <para>TODO:</para>
+ <para>In this example, information about users/roles assignment is stored in roles entries using LDAP
+ "<emphasis>member</emphasis>". Of course any other attribute that comes with schema can be used for this.</para>
<para>Example tree shape in LDAP browser
<mediaobject>
<imageobject>
@@ -857,13 +859,8 @@
</sect2>
<sect2>
<title>Keeping users membership in user entries</title>
- <!--<para>Tree:
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/ldap/tree2-1.png"/>
- </imageobject>
- </mediaobject>
- </para>-->
+ <para>In this example, information about users/roles assignment is stored in user entries using LDAP
+ "<emphasis>memberOf</emphasis>". Of course any other attribute that comes with schema can be used for this.</para>
<para>Example tree shape in LDAP browser
<mediaobject>
<imageobject>
@@ -1046,19 +1043,95 @@
</programlisting>
</para>
</sect3>
-
-
</sect2>
</sect1>
- <sect1>
+ <sect1 id="ldap.synchronizing">
<title>Synchronizing LDAP configuration</title>
<para>
- TODO:
+ Like it was described in previous section, you can meet some limitations in identity modules support for more
+ complex LDAP tree shapes. To workaround this you can use identity synchronization on JAAS level. JBoss Portal comes with
+ <link linkend="authentication.synchronizing_login_module">SynchronizingLoginModule</link> that can be easily
+ configured with other authentication solutions that support JAAS framework. Here we want to provide a simple
+ example on how it can be integrated with
+ <emphasis><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=LdapExtLoginModule">LdapExtLoginModule</ulink>
+ from <emphasis>JBossSX</emphasis> framework.</emphasis>
</para>
+ <para>
+ First of all portal identity modules should be configured to work with portal database - default configuration.
+ This is important as we will leverage them, and we want to synchronize users identity into default portal storage
+ mechanism. So lets look at simple configuration that should take place in
+ <emphasis>jboss-portal.sar/conf/login-config.xml</emphasis>
+ <programlisting>
+ <![CDATA[
+<policy>
+ <!-- For the JCR CMS -->
+ <application-policy name="cms">
+ <authentication>
+ <login-module code="org.apache.jackrabbit.core.security.SimpleLoginModule" flag="required"/>
+ </authentication>
+ </application-policy>
+
+ <application-policy name="portal">
+ <authentication>
+
+ <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required">
+ <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
+ <module-option name="java.naming.provider.url">ldap://example.com:10389/</module-option>
+ <module-option name="java.naming.security.authentication">simple</module-option>
+ <module-option name="bindDN">cn=Directory Manager</module-option>
+ <module-option name="bindCredential">lolo</module-option>
+ <module-option name="baseCtxDN">ou=People,dc=example,dc=com</module-option>
+ <module-option name="baseFilter">(uid={0})</module-option>
+ <module-option name="rolesCtxDN">ou=Roles,dc=example,dc=com</module-option>
+ <module-option name="roleFilter">(member={1})</module-option>
+ <module-option name="roleAttributeID">cn</module-option>
+ <module-option name="roleRecursion">-1</module-option>
+ <module-option name="searchTimeLimit">10000</module-option>
+ <module-option name="searchScope">SUBTREE_SCOPE</module-option>
+ <module-option name="allowEmptyPasswords">false</module-option>
+ </login-module>
+
+ <login-module code="org.jboss.portal.identity.auth.SynchronizingLoginModule" flag="optional">
+ <module-option name="synchronizeIdentity">true</module-option>
+ <module-option name="synchronizeRoles">true</module-option>
+ <module-option name="additionalRole">Authenticated</module-option>
+ <module-option name="defaultAssignedRole">User</module-option>
+ <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
+ <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
+ <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule</module-option>
+ <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule</module-option>
+ </login-module>
+
+ </authentication>
+ </application-policy>
+</policy>
+ ]]>
+ </programlisting>
+ </para>
+ <para>
+ Few things are important in this configuration:
+ <itemizedlist>
+ <listitem><emphasis>LdapExtLoginModule</emphasis> has <emphasis>flag="required"</emphasis> set
+ which means that if this single <emphasis>LoginModule</emphasis> return <emphasis>fail</emphasis>
+ from authentication request whole process will fail. <emphasis>SynchronizingLoginModule</emphasis>
+ has <emphasis>flag="optional"</emphasis>. Such combination is critical as
+ <emphasis>SynchronizingLoginModule</emphasis> always authenticates user sucessfully no matter what
+ credentials were provided. You always must have at least one <emphasis>LoginModule</emphasis> that you
+ will rely on.
+ </listitem>
+ <listitem>
+ <emphasis>SynchronizingLoginModule</emphasis> is always the <emphasis>last</emphasis> one in whole
+ authentication chain. This is because in <emphasis>commit</emphasis> phase it will take users
+ <emphasis>Subject</emphasis> and its <emphasis>Principals</emphasis> (roles) assigned by previous
+ <emphasis>LoginModule</emphasis>s and try to synchronize them. Roles assigned to authenticated user by
+ <emphasis>LoginModule</emphasis>s after it won't be handled.
+ </listitem>
+ </itemizedlist>
+ </para>
</sect1>
<sect1>
<title>Supported LDAP servers</title>
- <para>LDAP servers support depends on few conditions. In most cases thy differ in schema support - various objectClass
+ <para>LDAP servers support depends on few conditions. In most cases they differ in schema support - various objectClass
objects are not present by default in server schema. Sometimes it can be workarounded by manually
extending schema.</para>
<para>
17 years, 5 months
JBoss Portal SVN: r6694 - in trunk/wsrp/src: main/org/jboss/portal/wsrp/consumer and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-15 15:58:37 -0400 (Thu, 15 Mar 2007)
New Revision: 6694
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
Log:
- More consumer configuration GUI: fixed de/activate and back button on consumer configuration page.
- Fixed ConsumerRegistryService.startOrStopConsumer.
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-03-15 19:25:36 UTC (rev 6693)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-03-15 19:58:37 UTC (rev 6694)
@@ -75,13 +75,15 @@
{
registry.deactivateConsumerWith(selectedId);
}
+
+ return listConsumers();
}
else
{
// todo: error message
}
- return "index";
+ return null;
}
public String registerConsumer()
@@ -118,6 +120,11 @@
return null;
}
+ public String listConsumers()
+ {
+ return "index";
+ }
+
private String refreshConsumerId()
{
selectedId = getParameter("id");
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-15 19:25:36 UTC (rev 6693)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-15 19:58:37 UTC (rev 6694)
@@ -28,7 +28,9 @@
import org.hibernate.SessionFactory;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.deployment.WSRPConsumerService;
@@ -259,26 +261,45 @@
private void startOrStopConsumer(String id, boolean start)
{
- WSRPConsumer consumer = getConsumer(id);
+ WSRPConsumer consumer;
- if (consumer == null)
- {
- throw new ConsumerException("Consumer with id '" + id + "' doesn't exist!");
- }
-
- WSRPConsumerService service = new WSRPConsumerService();
- service.setConsumer(consumer);
- service.setFederatingPortletInvoker(federatingPortletInvoker);
-
try
{
if (start)
{
+ consumer = getConsumer(id);
+
+ if (consumer == null)
+ {
+ throw new IllegalArgumentException("Consumer with id '" + id + "' doesn't exist!");
+ }
+
+ WSRPConsumerService service = new WSRPConsumerService();
+ service.setConsumer(consumer);
+ service.setFederatingPortletInvoker(federatingPortletInvoker);
service.start();
}
else
{
- service.stop();
+ FederatedPortletInvoker fedInvoker = federatingPortletInvoker.getFederatedInvoker(id);
+ if (fedInvoker != null)
+ {
+ PortletInvoker invoker = fedInvoker.getPortletInvoker();
+ if (invoker instanceof WSRPConsumer)
+ {
+ consumer = (WSRPConsumer)invoker;
+ federatingPortletInvoker.unregisterInvoker(id);
+ consumer.stop();
+ }
+ else
+ {
+ throw new IllegalArgumentException("PortletInvoker with id '" + id + "' is not a WSRPConsumer!");
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException("There is no registered PortletInvoker with id '" + id + "'");
+ }
}
}
catch (Exception e)
@@ -287,6 +308,6 @@
}
// update ProducerInfo
- updateProducerInfo(service.getConsumer().getProducerInfo());
+ updateProducerInfo(consumer.getProducerInfo());
}
}
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-03-15 19:25:36 UTC (rev 6693)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml 2007-03-15 19:58:37 UTC (rev 6694)
@@ -52,13 +52,5 @@
<from-outcome>configureConsumer</from-outcome>
<to-view-id>/WEB-INF/jsf/consumers/editConsumer.xhtml</to-view-id>
</navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <from-view-id>/WEB-INF/jsf/consumers/editConsumer.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>index</from-outcome>
- <to-view-id>/WEB-INF/jsf/consumers/consumers.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
+ </navigation-rule>
</faces-config>
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-03-15 19:25:36 UTC (rev 6693)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-03-15 19:58:37 UTC (rev 6694)
@@ -39,7 +39,7 @@
</h:commandLink> | <h:commandLink action="#{consumersMgr.activateConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
<f:param name="activate" value="#{!consumer.producerInfo.active}"/>
- <h:outputText value='#{consumer.producerInfo.active ? "Deactivate" : "Activate"}'/>
+ <h:outputText value="#{consumer.producerInfo.active ? 'Deactivate' : 'Activate'}"/>
</h:commandLink>
<c:if test="#{consumer.producerInfo.active}"> | <h:commandLink
action="#{consumersMgr.registerConsumer}">
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-03-15 19:25:36 UTC (rev 6693)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-03-15 19:58:37 UTC (rev 6694)
@@ -101,7 +101,7 @@
</table>
<hr/>
+</h:form>
- <h:commandButton action="index" value="Back"/>
-</h:form>
+<h:form><h:commandButton action="#{consumersMgr.listConsumers}" value="Back"/></h:form>
</div>
\ No newline at end of file
17 years, 5 months
JBoss Portal SVN: r6693 - in trunk: portlet-federation/src/main/org/jboss/portal/portlet/federation and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-15 15:25:36 -0400 (Thu, 15 Mar 2007)
New Revision: 6693
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
Log:
- Added FederatingPortletInvoker.unregisterInvoker(id) method.
- Fixed javadoc and typos.
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java 2007-03-15 17:16:43 UTC (rev 6692)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java 2007-03-15 19:25:36 UTC (rev 6693)
@@ -30,7 +30,7 @@
import javax.faces.event.PhaseListener;
/**
- * Refresh the beans before JSR performs the render.
+ * Refresh the beans before JSF performs the render.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5448 $
Modified: trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java
===================================================================
--- trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java 2007-03-15 17:16:43 UTC (rev 6692)
+++ trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java 2007-03-15 19:25:36 UTC (rev 6693)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.federation;
+import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.federation.spi.PortletInvokerRegistration;
-import org.jboss.portal.portlet.PortletInvoker;
import java.util.Collection;
@@ -47,8 +47,8 @@
/**
* Unregister an invoker.
*
- * @param registration the invoker to register
- * @throws IllegalArgumentException if the invoker is null or already registered
+ * @param registration the invoker to unregister
+ * @throws IllegalArgumentException if invoker is null or not registered
*/
void unregisterInvoker(PortletInvokerRegistration registration) throws IllegalArgumentException;
@@ -67,4 +67,13 @@
* @return a collection that contains the portlet invokers
*/
Collection getFederatedInvokers();
+
+ /**
+ * Unregisters the invoker associated with the specified identifier.
+ *
+ * @param id the identifier of the invoker to unregister
+ * @throws IllegalArgumentException if the identifier is null or no invoker is registered with this identifier
+ * @since 2.6
+ */
+ void unregisterInvoker(String id);
}
Modified: trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
===================================================================
--- trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2007-03-15 17:16:43 UTC (rev 6692)
+++ trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2007-03-15 19:25:36 UTC (rev 6693)
@@ -22,15 +22,15 @@
******************************************************************************/
package org.jboss.portal.portlet.federation.impl;
-import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
-import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
-import org.jboss.portal.portlet.federation.spi.PortletInvokerRegistration;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.portlet.InvokerUnavailableException;
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.federation.spi.PortletInvokerRegistration;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.state.PropertyChange;
@@ -84,7 +84,11 @@
{
throw new IllegalArgumentException("No null invoker");
}
- String id = registration.getId();
+ unregisterInvoker(registration.getId());
+ }
+
+ public synchronized void unregisterInvoker(String id)
+ {
if (id == null)
{
throw new IllegalArgumentException("No null id accepted");
17 years, 5 months
JBoss Portal SVN: r6692 - in trunk: common/src/main/org/jboss/portal/common/invocation and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-15 13:16:43 -0400 (Thu, 15 Mar 2007)
New Revision: 6692
Modified:
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java
trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java
trunk/core/src/main/org/jboss/portal/core/controller/ControllerCommand.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
trunk/server/src/main/org/jboss/portal/server/ServerInvocation.java
Log:
define common scope in the Scope class as constants
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java 2007-03-15 17:08:49 UTC (rev 6691)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java 2007-03-15 17:16:43 UTC (rev 6692)
@@ -36,7 +36,7 @@
*/
public class JCRCommandContext extends AbstractInvocationContext
{
- public static final Scope scope = new Scope("Thread");
+ public static final Scope scope = Scope.THREAD_SCOPE;
private final Session session;
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java 2007-03-15 17:08:49 UTC (rev 6691)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java 2007-03-15 17:16:43 UTC (rev 6692)
@@ -31,6 +31,18 @@
public class Scope
{
+ /** Principal scope. */
+ public static final Scope PRINCIPAL_SCOPE = new Scope("principal");
+
+ /** Request scope. */
+ public static final Scope REQUEST_SCOPE = new Scope("request");
+
+ /** Thread scope. */
+ public static final Scope THREAD_SCOPE = new Scope("thread");
+
+ /** Session scope. */
+ public static final Scope SESSION_SCOPE = new Scope("session");
+
/** The value. */
private final String value;
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ControllerCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ControllerCommand.java 2007-03-15 17:08:49 UTC (rev 6691)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ControllerCommand.java 2007-03-15 17:16:43 UTC (rev 6692)
@@ -42,13 +42,13 @@
{
/** . */
- public static final Scope PRINCIPAL_SCOPE = new Scope("principal");
+ public static final Scope PRINCIPAL_SCOPE = Scope.PRINCIPAL_SCOPE;
/** . */
- public static final Scope SESSION_SCOPE = new Scope("session");
+ public static final Scope SESSION_SCOPE = Scope.SESSION_SCOPE;
/** . */
- public static final Scope REQUEST_SCOPE = new Scope("request");
+ public static final Scope REQUEST_SCOPE = Scope.REQUEST_SCOPE;
/** . */
public static final Scope NAVIGATIONAL_STATE_SCOPE = new Scope("navigationalstate");
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2007-03-15 17:08:49 UTC (rev 6691)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2007-03-15 17:16:43 UTC (rev 6692)
@@ -49,10 +49,10 @@
{
/** The portal principal scope. */
- public static final Scope PRINCIPAL_SCOPE = new Scope("principal");
+ public static final Scope PRINCIPAL_SCOPE = Scope.PRINCIPAL_SCOPE;
/** The request scope. */
- public static final Scope REQUEST_SCOPE = ServerInvocation.REQUEST_SCOPE;
+ public static final Scope REQUEST_SCOPE = Scope.REQUEST_SCOPE;
/** The request properties . */
public static final Scope REQUEST_PROPERTIES_SCOPE = new Scope("request_properties");
Modified: trunk/server/src/main/org/jboss/portal/server/ServerInvocation.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/ServerInvocation.java 2007-03-15 17:08:49 UTC (rev 6691)
+++ trunk/server/src/main/org/jboss/portal/server/ServerInvocation.java 2007-03-15 17:16:43 UTC (rev 6692)
@@ -34,13 +34,13 @@
{
/** . */
- public static final Scope PRINCIPAL_SCOPE = new Scope("principal");
+ public static final Scope PRINCIPAL_SCOPE = Scope.PRINCIPAL_SCOPE;
/** . */
- public static final Scope SESSION_SCOPE = new Scope("session");
+ public static final Scope SESSION_SCOPE = Scope.SESSION_SCOPE;
/** . */
- public static final Scope REQUEST_SCOPE = new Scope("request");
+ public static final Scope REQUEST_SCOPE = Scope.REQUEST_SCOPE;
/** . */
public static final Scope NAVIGATIONAL_STATE_SCOPE = new Scope("navigationalstate");
17 years, 5 months
JBoss Portal SVN: r6691 - in trunk: core/src/main/org/jboss/portal/core/model/instance and 18 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-15 13:08:49 -0400 (Thu, 15 Mar 2007)
New Revision: 6691
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java
trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java
Log:
moved the target of the portlet invocation as an portlet invocation attribute rather than an attribute of the request scope
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -41,7 +41,6 @@
import java.util.Arrays;
import java.util.Set;
import java.util.List;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -226,8 +225,8 @@
try
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.INSTANCE_ID_ATTRIBUTE, getInstanceId());
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletContext);
+ invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, INSTANCE_ID_ATTRIBUTE, getInstanceId());
+ invocation.setTarget(portletContext);
invocation.setInstanceContext(instanceContext);
// Perform invocation
@@ -273,8 +272,8 @@
finally
{
// Reset state before invocation
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.INSTANCE_ID_ATTRIBUTE);
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, INSTANCE_ID_ATTRIBUTE);
+ invocation.setTarget(null);
invocation.setInstanceContext(null);
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -39,6 +39,9 @@
*/
public interface Instance
{
+ /** The attribute name under which the instance id can be accessed. */
+ String INSTANCE_ID_ATTRIBUTE = "instanceid";
+
/**
* Return the id.
*
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -61,7 +61,7 @@
{
try
{
- String instanceid = (String)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.INSTANCE_ID_ATTRIBUTE);
+ String instanceid = (String)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, Instance.INSTANCE_ID_ATTRIBUTE);
PortalAuthorizationManager pam = pamf.getManager();
InstancePermission perm = new InstancePermission(instanceid, InstancePermission.VIEW_MASK);
boolean authorized = pam.checkPermission(perm);
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -64,6 +64,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.PropertyContext;
import org.jboss.portal.portlet.state.producer.ProducerPortletInvoker;
import org.jboss.portal.portlet.test.ActionContextImpl;
import org.jboss.portal.portlet.test.UserContextImpl;
@@ -142,7 +143,7 @@
public void setProperty(String key, String value) throws IllegalStateException
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate(key, new StringValue(value))});
}
}
Modified: trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -53,6 +53,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.PropertyContext;
import org.jboss.portal.portlet.state.producer.PortletState;
import org.jboss.portal.portlet.state.producer.PortletStateContext;
import org.jboss.portal.portlet.test.ActionContextImpl;
@@ -221,7 +222,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
return null;
}
@@ -232,7 +233,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
return null;
}
@@ -245,7 +246,7 @@
{
try
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
fail("Was expecting an IllegalStateException");
}
@@ -261,7 +262,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
throw new RuntimeException("custom_message");
}
@@ -496,7 +497,7 @@
{
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, PortletContext.createPortletContext("CloningPortlet"));
+ action.setTarget(PortletContext.createPortletContext("CloningPortlet"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever", AccessMode.CLONE_BEFORE_WRITE);
action.setInstanceContext(instanceContext);
@@ -528,10 +529,7 @@
{
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(
- PortletInvocation.REQUEST_SCOPE,
- PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
- PortletContext.createPortletContext("CloneFailedCloningPortlet"));
+ action.setTarget(PortletContext.createPortletContext("CloneFailedCloningPortlet"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever", AccessMode.READ_WRITE);
action.setInstanceContext(instanceContext);
@@ -549,8 +547,7 @@
{
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
- PortletContext.createPortletContext("CloneFailedCloningPortlet"));
+ action.setTarget(PortletContext.createPortletContext("CloneFailedCloningPortlet"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever", AccessMode.READ_ONLY);
action.setInstanceContext(instanceContext);
@@ -581,7 +578,7 @@
//
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, cloningPortletId);
+ action.setTarget(cloningPortletId);
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever", AccessMode.CLONE_BEFORE_WRITE);
action.setInstanceContext(instanceContext);
@@ -618,7 +615,7 @@
//
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, cloningPortletId);
+ action.setTarget(cloningPortletId);
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever", AccessMode.READ_WRITE);
action.setInstanceContext(instanceContext);
@@ -648,7 +645,7 @@
//
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, cloneFailedCloningPortletId);
+ action.setTarget(cloneFailedCloningPortletId);
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever", AccessMode.READ_ONLY);
action.setInstanceContext(instanceContext);
@@ -665,8 +662,7 @@
{
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
- PortletContext.createPortletContext("CloningPortletThrowingRuntimeException"));
+ action.setTarget(PortletContext.createPortletContext("CloningPortletThrowingRuntimeException"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever", AccessMode.CLONE_BEFORE_WRITE);
action.setInstanceContext(instanceContext);
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -98,7 +98,7 @@
{
throw new IllegalArgumentException();
}
- PortletContext portletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portletContext = invocation.getTarget();
if (portletContext == null)
{
throw new InvocationException("No portlet context provided");
Modified: trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -191,7 +191,7 @@
invocation.setWindowContext(windowContext);
//
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portlet.getContext());
+ invocation.setTarget(portlet.getContext());
PortletInvoker invoker = uiportlet.getPortletInvoker();
return invoker.invoke(invocation);
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -73,7 +73,7 @@
}
catch (NumberFormatException e)
{
- log.warn("Portlet " + invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE) +
+ log.warn("Portlet " + invocation.getTarget() +
" set a non integer cache value override during render " + portletValue, e);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -112,7 +112,7 @@
//
int mode = this instanceof RenderRequest ? PortletPreferencesImpl.RENDER : PortletPreferencesImpl.ACTION;
- PropertyContext prefs = (PropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ PropertyContext prefs = (PropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
PreferencesValidator validator = container.getPreferencesValidator();
ContainerPreferencesInfo containerPrefs = (ContainerPreferencesInfo)container.getInfo().getPreferences();
this.preferences = new PortletPreferencesImpl(prefs, containerPrefs, validator, mode);
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -33,6 +33,7 @@
import org.jboss.portal.portlet.spi.SecurityContext;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
+import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.server.ServerInvocation;
import javax.servlet.http.HttpServletRequest;
@@ -59,18 +60,9 @@
/** The response properties. */
public static final Scope RESPONSE_PROPERTIES_SCOPE = new Scope("response_properties");
- /** The attribute name under which the portlet id can be accessed. */
- public static final String PORTLET_CONTEXT_ATTRIBUTE = "portletcontext";
+ /** The target portlet. */
+ protected PortletContext target;
- /** The attribute name under which the registry can be accessed. */
- public static final String PORTLET_INVOKER = "portletinvoker";
-
- /** The attribute name under which the preferences can be accessed. */
- public static final String PREFERENCES_ATTRIBUTE = "preferences";
-
- /** The attribute name under which the instance id can be accessed. */
- public static final String INSTANCE_ID_ATTRIBUTE = "instanceid";
-
/** The portal context. */
protected PortalContext portalContext;
@@ -133,6 +125,16 @@
return ctx;
}
+ public PortletContext getTarget()
+ {
+ return target;
+ }
+
+ public void setTarget(PortletContext target)
+ {
+ this.target = target;
+ }
+
public Set getSupportedWindowStates()
{
return supportedWindowStates;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -46,7 +46,7 @@
// Correctness is not insured.
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletContext portlet = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portlet = invocation.getTarget();
String portletName = portlet.getId();
boolean error = false;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -34,6 +34,9 @@
*/
public interface PropertyContext
{
+ /** The attribute name under which the preferences can be accessed. */
+ String PREFERENCES_ATTRIBUTE = "preferences";
+
/**
* Return the key set.
*
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -139,7 +139,7 @@
throw new IllegalArgumentException();
}
- PortletContext portletContext = (PortletContext)resolver.getAttribute(PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portletContext = invocation.getTarget();
if (portletContext == null)
{
throw new IllegalArgumentException();
@@ -154,7 +154,7 @@
try
{
- resolver.setAttribute(PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, consumerContext.portletContext);
+ invocation.setTarget(consumerContext.portletContext);
invocation.setInstanceContext(pictx);
//
@@ -211,7 +211,7 @@
}
finally
{
- resolver.setAttribute(PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletContext);
+ invocation.setTarget(portletContext);
invocation.setInstanceContext(cictx);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -51,6 +51,7 @@
import org.jboss.portal.portlet.state.StateConversionException;
import org.jboss.portal.portlet.state.StateConverter;
import org.jboss.portal.portlet.state.StateManagementPolicy;
+import org.jboss.portal.portlet.state.PropertyContext;
import java.util.ArrayList;
import java.util.Iterator;
@@ -185,7 +186,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException, InvocationException
{
// Get the context of the portlet that the client want to use
- final PortletContext portletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ final PortletContext portletContext = invocation.getTarget();
if (portletContext == null)
{
throw new InvocationException("No portlet context provided");
@@ -220,8 +221,8 @@
PortletInvocationResponse response;
try
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, context.getPortletContext());
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE, prefs);
+ invocation.setTarget(context.getPortletContext());
+ invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE, prefs);
invocation.setInfo(info);
// Invoke
@@ -229,8 +230,8 @@
}
finally
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletContext);
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ invocation.setTarget(portletContext);
+ invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
invocation.setInfo(null);
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -152,7 +152,7 @@
decoder.getForm());
ActionInvocation action = createAction(invocation, actionContext);
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, ((InstanceContextImpl)action.getInstanceContext()).getPortletContext());
+ action.setTarget(((InstanceContextImpl)action.getInstanceContext()).getPortletContext());
PortletInvocationResponse response = portletInvoker.invoke(action);
if (response instanceof RenderResponse)
{
@@ -286,7 +286,7 @@
//
writer.write("<div>");
RenderInvocation render = createRender(invocation, renderContext);
- render.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, ((InstanceContextImpl)render.getInstanceContext()).getPortletContext());
+ render.setTarget(((InstanceContextImpl)render.getInstanceContext()).getPortletContext());
PortletInvocationResponse response = portletInvoker.invoke(render);
//
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -58,7 +58,7 @@
try
{
PortalAuthorizationManager authMgr = pamf.getManager();
- PortletContext portletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portletContext = invocation.getTarget();
String portletId = portletContext.getId();
PortletPermission perm = new PortletPermission(portletId, PortletPermission.VIEW_MASK);
boolean authorized = authMgr.checkPermission(perm);
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -123,7 +123,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
- PortletContext portletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portletContext = invocation.getTarget();
InternalPortlet portlet = internalGetPortlet(portletContext);
return portlet.support.invoke(invocation);
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -43,6 +43,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.PropertyContext;
import org.jboss.portal.portlet.test.ValueMapAssert;
import org.jboss.portal.portlet.test.support.PortletSupport;
@@ -714,7 +715,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc", new StringValue("_def"))});
return null;
}
@@ -748,7 +749,7 @@
{
try
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc", new StringValue("_def"))});
return null;
}
@@ -779,7 +780,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc", new StringValue("_def"))});
return null;
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -208,7 +208,7 @@
//
ActionInvocation action = new ActionInvocation(actionCtx);
action.setInstanceContext(instanceCtx);
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletRef);
+ action.setTarget(portletRef);
return action;
}
@@ -220,7 +220,7 @@
protected PortletContext getModifiedPortletRef(ActionInvocation action)
{
- return (PortletContext)action.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ return action.getTarget();
}
private Portlet getSinglePOP() throws PortletInvokerException
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -23,7 +23,6 @@
package org.jboss.portal.test.portlet.state;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.PortletContext;
/**
@@ -39,6 +38,6 @@
protected PortletContext getModifiedPortletRef(ActionInvocation action)
{
- return (PortletContext)action.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ return action.getTarget();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -200,7 +200,7 @@
//
ActionInvocation action = new ActionInvocation(actionCtx);
action.setInstanceContext(instanceCtx);
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletRef);
+ action.setTarget(portletRef);
return action;
}
Modified: trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
===================================================================
--- trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -138,18 +138,18 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws InvocationException, PortletInvokerException
{
- PortletContext compoundPortletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext compoundPortletContext = invocation.getTarget();
PortletContext portletContext = dereference(compoundPortletContext);
InstanceContext instanceContext = invocation.getInstanceContext();
try
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletContext);
+ invocation.setTarget(portletContext);
invocation.setInstanceContext(new FederatedInstanceContext(instanceContext));
return portletInvoker.invoke(invocation);
}
finally
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, compoundPortletContext);
+ invocation.setTarget(compoundPortletContext);
invocation.setInstanceContext(instanceContext);
}
}
Modified: trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
===================================================================
--- trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -144,7 +144,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
- PortletContext compoundPortletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext compoundPortletContext = invocation.getTarget();
FederatedPortletInvoker federated = getFederatedPortletInvokerFor(compoundPortletContext);
return federated.invoke(invocation);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -29,7 +29,6 @@
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
@@ -196,8 +195,7 @@
TestPortletInvocationContext rc = new TestPortletInvocationContext(mode, state, navigationalState);
RenderInvocation render = new RenderInvocation(rc);
- render.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
- PortletContext.createPortletContext(portletHandle));
+ render.setTarget(PortletContext.createPortletContext(portletHandle));
render.setInstanceContext(new BasicInstanceContext(portletHandle));
render.setSecurityContext(new BasicSecurityContext());
@@ -219,8 +217,7 @@
action.setInstanceContext(new BasicInstanceContext(portletHandle));
action.setSecurityContext(new BasicSecurityContext());
action.setUserContext(new BasicUserContext());
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
- PortletContext.createPortletContext(portletHandle));
+ action.setTarget(PortletContext.createPortletContext(portletHandle));
return action;
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -402,7 +402,7 @@
*/
static PortletContext getPortletContext(PortletInvocation invocation)
{
- return (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ return invocation.getTarget();
}
WSRPPortletInfo getPortletInfo(PortletInvocation invocation) throws PortletInvokerException
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -26,7 +26,6 @@
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.RenderResponse;
@@ -164,7 +163,7 @@
markupRequest.getCharacterSet(), markupRequest.getMimeType());
setInvocation(new ActionInvocation(actionContext));
actionContext.contextualize(invocation);
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portlet.getContext());
+ invocation.setTarget(portlet.getContext());
}
Object processResponse(PortletInvocationResponse response)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java 2007-03-15 16:23:28 UTC (rev 6690)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java 2007-03-15 17:08:49 UTC (rev 6691)
@@ -27,7 +27,6 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
import org.jboss.portal.portlet.info.CacheInfo;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -124,7 +123,7 @@
setInvocation(new RenderInvocation(renderContext));
renderContext.contextualize(invocation);
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portlet.getContext());
+ invocation.setTarget(portlet.getContext());
}
Object processResponse(PortletInvocationResponse response)
17 years, 5 months
JBoss Portal SVN: r6690 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-03-15 12:23:28 -0400 (Thu, 15 Mar 2007)
New Revision: 6690
Modified:
docs/trunk/referenceGuide/en/modules/ldap.xml
Log:
doco update
Modified: docs/trunk/referenceGuide/en/modules/ldap.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/ldap.xml 2007-03-15 14:36:24 UTC (rev 6689)
+++ docs/trunk/referenceGuide/en/modules/ldap.xml 2007-03-15 16:23:28 UTC (rev 6690)
@@ -679,24 +679,26 @@
</para>
<sect2>
<title>Keeping users membership in role entries</title>
- <para>TODO></para>
- <para>Tree:
+ <para>TODO:</para>
+ <para>Example tree shape in LDAP browser
<mediaobject>
<imageobject>
<imagedata align="center" valign="middle" fileref="images/ldap/tree1-1.png"/>
</imageobject>
</mediaobject>
</para>
- <para>Tree:
+ <para>
<mediaobject>
<imageobject>
<imagedata align="center" valign="middle" fileref="images/ldap/tree1-2.png"/>
</imageobject>
</mediaobject>
</para>
- <para>Example LDIF:
- <programlisting>
- <![CDATA[
+ <sect3>
+ <title>Example LDIF</title>
+ <para>
+ <programlisting>
+ <![CDATA[
dn: dc=example,dc=com
objectclass: top
objectclass: dcObject
@@ -719,6 +721,16 @@
userPassword: user
mail: email(a)email.com
+dn: uid=admin,ou=People,dc=example,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: admin
+cn: JBoss Portal admin
+sn: admin
+userPassword: admin
+mail: email(a)email.com
+
dn: ou=Roles,dc=example,dc=com
objectclass: top
objectclass: organizationalUnit
@@ -730,16 +742,118 @@
cn: User
description: the JBoss Portal user group
member: uid=user,ou=People,dc=example,dc=com
+
+dn: cn=Admin,ou=Roles,dc=example,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: Echo
+description: the JBoss Portal admin group
+member: uid=admin,ou=People,dc=example,dc=com
]]>
- </programlisting>
- </para>
- <para>Example identity configuration:
- <programlisting>
- <![CDATA[
+ </programlisting>
+ </para>
+ </sect3>
+ <sect3>
+ <title>Example identity configuration</title>
+ <para>
+ <programlisting>
+ <![CDATA[
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Role</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Membership</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+ <config>
+ <option>
+ <name>ldapModuleJNDIName</name>
+ <value>java:/portal/LDAPUserProfileModule</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>DBDelegateUserProfile</type>
+ <implementation>DB</implementation>
+ <config>
+ <option>
+ <name>randomSynchronizePassword</name>
+ <value>true</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>LDAPDelegateUserProfile</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ </modules>
+ <options>
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userCtxDN</name>
+ <value>ou=People,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>roleCtxDN</name>
+ <value>ou=Roles,dc=example,dc=com</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <!--This objectclasses should work with Red Hat Directory-->
+ <value>top</value>
+ <value>person</value>
+ <value>inetOrgPerson</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+ <value>uid=admin,ou=People,dc=example,dc=com</value>
+ </option>
+ </option-group>
+ </options>
+
]]>
- </programlisting>
- </para>
+ </programlisting>
+ </para>
+ </sect3>
+
</sect2>
<sect2>
<title>Keeping users membership in user entries</title>
@@ -750,23 +864,25 @@
</imageobject>
</mediaobject>
</para>-->
- <para>Tree:
+ <para>Example tree shape in LDAP browser
<mediaobject>
<imageobject>
<imagedata align="center" valign="middle" fileref="images/ldap/tree2-3.png"/>
</imageobject>
</mediaobject>
</para>
- <para>Tree:
+ <para>
<mediaobject>
<imageobject>
<imagedata align="center" valign="middle" fileref="images/ldap/tree2-4.png"/>
</imageobject>
</mediaobject>
</para>
- <para>Example LDIF:
- <programlisting>
- <![CDATA[
+ <sect3>
+ <title>Example LDIF</title>
+ <para>
+ <programlisting>
+ <![CDATA[
dn: dc=example,dc=com
objectclass: top
objectclass: dcObject
@@ -795,29 +911,152 @@
mail: email(a)email.com
memberOf: cn=Admin,ou=Roles,o=example2,dc=example,dc=com
+dn: uid=user,ou=People,o=example2,dc=example,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+uid: user
+cn: JBoss Portal user
+sn: user
+userPassword: user
+mail: email(a)email.com
+memberOf: cn=User,ou=Roles,o=example2,dc=example,dc=com
+
dn: ou=Roles,o=example2,dc=example,dc=com
objectclass: top
objectclass: organizationalUnit
ou: Roles
+dn: cn=User,ou=Roles,o=example2,dc=example,dc=com
+objectClass: top
+objectClass: organizationalRole
+cn: User
+description: the JBoss Portal user group
+
dn: cn=Admin,ou=Roles,o=example2,dc=example,dc=com
objectClass: top
objectClass: organizationalRole
cn: Echo
-description: the JBossAdmin group
+description: the JBoss Portal admin group
]]>
- </programlisting>
- </para>
- <para>Example identity configuration:
- <programlisting>
- <![CDATA[
+ </programlisting>
+ </para>
+ </sect3>
+ <sect3>
+ <title>Example identity configuration</title>
+ <para>
+ <programlisting>
+ <![CDATA[
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Role</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Membership</type>
+ <implementation>LDAP</implementation>
+ <class>org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl</class>
+ <config/>
+ </module>
+ <module>
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+ <config>
+ <option>
+ <name>ldapModuleJNDIName</name>
+ <value>java:/portal/LDAPUserProfileModule</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>DBDelegateUserProfile</type>
+ <implementation>DB</implementation>
+ <config>
+ <option>
+ <name>randomSynchronizePassword</name>
+ <value>true</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>LDAPDelegateUserProfile</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ </modules>
+ <options>
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userCtxDN</name>
+ <value>ou=People,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>roleCtxDN</name>
+ <value>ou=Roles,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>membershipAttributeID</name>
+ <value>memberOf</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <!--This objectclasses should work with Red Hat Directory-->
+ <value>top</value>
+ <value>person</value>
+ <value>inetOrgPerson</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+ <value>uid=admin,ou=People,dc=example,dc=com</value>
+ </option>
+ </option-group>
+ </options>
]]>
- </programlisting>
- </para>
+ </programlisting>
+ </para>
+ </sect3>
+
+
</sect2>
</sect1>
<sect1>
+ <title>Synchronizing LDAP configuration</title>
+ <para>
+ TODO:
+ </para>
+ </sect1>
+ <sect1>
<title>Supported LDAP servers</title>
<para>LDAP servers support depends on few conditions. In most cases thy differ in schema support - various objectClass
objects are not present by default in server schema. Sometimes it can be workarounded by manually
17 years, 5 months
JBoss Portal SVN: r6689 - in trunk/core-admin/src/main/org/jboss/portal/core/admin/ui: dashboard and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-15 10:36:24 -0400 (Thu, 15 Mar 2007)
New Revision: 6689
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java
Log:
better handling of themes&layout in the dashboard editor
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java 2007-03-15 14:13:44 UTC (rev 6688)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java 2007-03-15 14:36:24 UTC (rev 6689)
@@ -137,49 +137,20 @@
{
boolean successful = true;
- // Get actual values
- String layoutName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
- String themeName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
- String renderSetName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET);
- String windowRendererName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER);
- String decorationRendererName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER);
- String portletRendererName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER);
-
//
switch(portalObject.getType())
{
case PortalObject.TYPE_PORTAL:
case PortalObject.TYPE_PAGE:
- if (this.layoutName == null || !this.layoutName.equals(layoutName))
- {
- this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT, this.layoutName);
- }
- if (this.themeName == null || !this.themeName.equals(themeName))
- {
- this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME, this.themeName);
- }
- if (this.renderSetName == null || !this.renderSetName.equals(renderSetName))
- {
- this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET, this.renderSetName);
- }
- if (this.windowRendererName == null || !this.windowRendererName.equals(windowRendererName))
- {
- this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_STRATEGY, this.windowRendererName);
- }
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT, this.layoutName);
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME, this.themeName);
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET, this.renderSetName);
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_STRATEGY, this.windowRendererName);
break;
case PortalObject.TYPE_WINDOW:
- if (this.windowRendererName == null || !this.windowRendererName.equals(windowRendererName))
- {
- this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER, this.windowRendererName);
- }
- if (this.decorationRendererName == null || !this.decorationRendererName.equals(decorationRendererName))
- {
- this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER, this.decorationRendererName);
- }
- if (this.portletRendererName == null || !this.portletRendererName.equals(portletRendererName))
- {
- this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER, this.portletRendererName);
- }
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER, this.windowRendererName);
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER, this.decorationRendererName);
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER, this.portletRendererName);
break;
default:
successful = false;
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2007-03-15 14:13:44 UTC (rev 6688)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2007-03-15 14:36:24 UTC (rev 6689)
@@ -159,26 +159,28 @@
refresh();
//
- selectedPageTheme = pageManager.page.getProperty(ThemeConstants.PORTAL_PROP_THEME);
- selectedPageLayout = pageManager.page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ selectedPageTheme = userPortal.getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
+ if (selectedPageTheme == null)
+ {
+ selectedPageTheme = "";
+ }
+
+ //
+ selectedPageLayout = userPortal.getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ if (selectedPageLayout == null)
+ {
+ selectedPageLayout = "";
+ }
}
public void updateTheme()
{
- String previousTheme = userPortal.getProperty(ThemeConstants.PORTAL_PROP_THEME);
- if (!selectedPageTheme.equals(previousTheme))
- {
- userPortal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME, selectedPageTheme);
- }
+ userPortal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME, "".equals(selectedPageTheme) ? null : selectedPageTheme);
}
public void updateLayout()
{
- String previousLayout = userPortal.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
- if (!selectedPageLayout.equals(previousLayout))
- {
- userPortal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT, selectedPageLayout);
- }
+ userPortal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT, "".equals(selectedPageLayout) ? null : selectedPageLayout);
}
public void destroyPage()
17 years, 5 months
JBoss Portal SVN: r6688 - in trunk/core-admin/src: main/org/jboss/portal/core/admin/ui/actions and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-15 10:13:44 -0400 (Thu, 15 Mar 2007)
New Revision: 6688
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/PortalObjectManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.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/editTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml
Log:
simplified theme code in admin UI
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-03-15 13:50:51 UTC (rev 6687)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-03-15 14:13:44 UTC (rev 6688)
@@ -31,6 +31,7 @@
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.common.util.LocalizedString;
import org.jboss.portal.common.util.IteratorStatus;
+import org.jboss.portal.common.MediaType;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.info.MetaInfo;
@@ -46,6 +47,8 @@
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.ThemeService;
import org.jboss.portal.theme.PortalTheme;
+import org.jboss.portal.theme.ServerRegistrationID;
+import org.jboss.portal.theme.render.PortalRenderSet;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
@@ -55,6 +58,9 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Collection;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -285,7 +291,7 @@
{
LayoutService layoutService = (LayoutService)bean;
Collection layouts = layoutService.getLayouts();
- SelectItem[] items = new SelectItem[layouts.size()];
+ SelectItem[] items = new SelectItem[layouts.size() + 1];
for (IteratorStatus i = new IteratorStatus(layouts.iterator());i.hasNext();)
{
PortalLayout layout = (PortalLayout)i.next();
@@ -295,9 +301,36 @@
item.setLabel(layoutName);
items[i.getElementIndex()] = item;
}
+ items[items.length - 1] = new SelectItem("", "default");
return items;
}
});
+ layoutServiceDecorator.setProperty("renderSetItems", new AbstractPropertyDecorator(SelectItem[].class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ LayoutService layoutService = (LayoutService)bean;
+ Collection renderSets = layoutService.getRenderSets();
+ Map names = new HashMap();
+ for (Iterator i = renderSets.iterator(); i.hasNext();)
+ {
+ ServerRegistrationID renderSetId = (ServerRegistrationID)i.next();
+ PortalRenderSet renderSet = layoutService.getRenderSet(renderSetId, MediaType.HTML);
+ if (renderSet != null)
+ {
+ names.put(renderSet.getName(), renderSet.getName());
+ }
+ }
+ SelectItem[] items = new SelectItem[names.size() + 1];
+ for (IteratorStatus i = new IteratorStatus(names.keySet().iterator()); i.hasNext();)
+ {
+ String key = (String)i.next();
+ items[i.getElementIndex()] = new SelectItem(key, (String)names.get(key));
+ }
+ items[items.length - 1] = new SelectItem("", "default");
+ return items;
+ }
+ });
registerDecorator(LayoutService.class, layoutServiceDecorator);
//
@@ -308,7 +341,7 @@
{
ThemeService layoutService = (ThemeService)bean;
Collection themes = layoutService.getThemes();
- SelectItem[] items = new SelectItem[themes.size()];
+ SelectItem[] items = new SelectItem[themes.size() + 1];
for (IteratorStatus i = new IteratorStatus(themes.iterator());i.hasNext();)
{
PortalTheme name = (PortalTheme)i.next();
@@ -318,6 +351,7 @@
item.setLabel(themeName);
items[i.getElementIndex()] = item;
}
+ items[items.length - 1] = new SelectItem("", "default");
return items;
}
});
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-03-15 13:50:51 UTC (rev 6687)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-03-15 14:13:44 UTC (rev 6688)
@@ -38,7 +38,6 @@
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
-import org.jboss.portal.common.MediaType;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.model.portal.PortalObject;
@@ -55,19 +54,11 @@
import org.jboss.portal.core.impl.model.content.ContentEditorRegistry;
import org.jboss.portal.faces.component.portlet.PortletActionEvent;
import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.security.AuthorizationDomainRegistry;
import org.jboss.portal.security.RoleSecurityBinding;
import org.jboss.portal.security.SecurityConstants;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
import org.jboss.portal.security.spi.provider.DomainConfigurator;
import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.ServerRegistrationID;
-import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.render.PortalRenderSet;
-import org.jboss.portal.theme.strategy.LayoutStrategy;
import org.jboss.portal.portlet.PortletInvoker;
/** The portal object manager bean. */
@@ -120,9 +111,6 @@
// Runtime state
/** . */
- private final ThemeBean themes = new ThemeBean();
-
- /** . */
private final AbstractAuthorizationBean auth = new PortalObjectAuthorizationBean();
/** . */
@@ -306,11 +294,6 @@
return auth;
}
- public ThemeBean getThemes()
- {
- return themes;
- }
-
public SelectItem[] getInstanceItems()
{
return instanceItems;
@@ -631,150 +614,6 @@
}
}
- public final class ThemeBean
- {
- public String getLayoutName()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
- }
-
- public String getThemeName()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
- }
-
- public String getRenderSetName()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET);
- }
-
- public String getStrategyName()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_STRATEGY);
- }
-
- public String getWindowRenderer()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER);
- }
-
- public String getDecorationRenderer()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER);
- }
-
- public String getPortletRenderer()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER);
- }
-
- /**
- * Get the list of available layouts
- *
- * @return an array of the available layout names to pick a layout from
- */
- public SelectItem[] getLayoutNames()
- {
- Collection layouts = layoutService.getLayouts();
- SelectItem[] names = new SelectItem[layouts.size() + 1];
- int p = 0;
- for (Iterator i = layouts.iterator(); i.hasNext();)
- {
- PortalLayout layout = (PortalLayout)i.next();
- names[p++] = new SelectItem(layout.getLayoutInfo().getName(), layout.getLayoutInfo().getName());
- }
- names[p] = new SelectItem("", "default");
- return names;
- }
-
- /**
- * Get the list of available themes
- *
- * @return an array of the available theme names to pick a theme from
- */
- public SelectItem[] getThemeNames()
- {
- Collection themes = themeService.getThemes();
- SelectItem[] themeNames = new SelectItem[themes.size() + 1];
-
- int p = 0;
- for (Iterator i = themes.iterator(); i.hasNext();)
- {
- PortalTheme theme = (PortalTheme)i.next();
- themeNames[p++] = new SelectItem(theme.getThemeInfo().getName(), theme.getThemeInfo().getName());
- }
- themeNames[p] = new SelectItem("", "default");
-
- return themeNames;
- }
-
- /**
- * Get a list of available render sets
- *
- * @return and array of all available render set names to pick a render set from
- */
- public SelectItem[] getRenderSetNames()
- {
- Collection renderSets = layoutService.getRenderSets();
- Map names = new HashMap();
- for (Iterator i = renderSets.iterator(); i.hasNext();)
- {
- ServerRegistrationID renderSetId = (ServerRegistrationID)i.next();
- PortalRenderSet renderSet = layoutService.getRenderSet(renderSetId, MediaType.HTML);
- if (renderSet != null)
- {
- names.put(renderSet.getName(), renderSet.getName());
- }
- }
- SelectItem[] renderSetNames = new SelectItem[names.size() + 1];
- int i = 0;
- for (Iterator it = names.keySet().iterator(); it.hasNext();)
- {
- String key = (String)it.next();
- renderSetNames[i++] = new SelectItem(key, (String)names.get(key));
- }
- renderSetNames[i] = new SelectItem("", "default");
- return renderSetNames;
- }
-
- public SelectItem[] getStrategyNames()
- {
- Collection strategies = layoutService.getStrategies();
- Map names = new HashMap();
- for (Iterator i = strategies.iterator(); i.hasNext();)
- {
- ServerRegistrationID id = (ServerRegistrationID)i.next();
- LayoutStrategy strategy = layoutService.getStrategy(id, MediaType.HTML);
- if (strategy != null)
- {
- names.put(strategy.getName(), strategy.getName());
- }
- }
- SelectItem[] strategyNames = new SelectItem[names.size() + 1];
-
- int i = 0;
- for (Iterator it = names.keySet().iterator(); it.hasNext();)
- {
- String key = (String)it.next();
- strategyNames[i++] = new SelectItem(key, (String)names.get(key));
- }
- strategyNames[i] = new SelectItem("", "Default");
- return strategyNames;
- }
-
- private String getDeclaredProperty(String key)
- {
- String value = null;
- PortalObject po = getSelectedObject();
- if (po != null)
- {
- value = po.getDeclaredProperty(key);
- }
-
- return value;
- }
- }
-
public String getPreviewURL()
{
// try
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java 2007-03-15 13:50:51 UTC (rev 6687)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java 2007-03-15 14:13:44 UTC (rev 6688)
@@ -26,7 +26,6 @@
import javax.faces.context.FacesContext;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
import org.jboss.portal.theme.ThemeConstants;
/**
@@ -37,7 +36,7 @@
{
/** . */
- private PortalObjectManagerBean pomgr;
+ private PortalObject portalObject;
/** . */
private String layoutName;
@@ -49,9 +48,6 @@
private String renderSetName;
/** . */
- private String strategyName;
-
- /** . */
private String windowRendererName;
/** . */
@@ -60,22 +56,21 @@
/** . */
private String portletRendererName;
- public PortalObjectManagerBean getPortalObjectManager()
+
+ public PortalObject getPortalObject()
{
- return pomgr;
+ return portalObject;
}
- public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
+ public void setPortalObject(PortalObject portalObject)
{
- this.pomgr = portalObjectManager;
-
- layoutName = pomgr.getThemes().getLayoutName();
- themeName = pomgr.getThemes().getThemeName();
- renderSetName = pomgr.getThemes().getRenderSetName();
- strategyName = pomgr.getThemes().getStrategyName();
- windowRendererName = pomgr.getThemes().getWindowRenderer();
- decorationRendererName = pomgr.getThemes().getDecorationRenderer();
- portletRendererName = pomgr.getThemes().getPortletRenderer();
+ this.portalObject = portalObject;
+ this.layoutName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ this.themeName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
+ this.renderSetName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET);
+ this.windowRendererName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER);
+ this.decorationRendererName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER);
+ this.portletRendererName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER);
}
public String getLayoutName()
@@ -83,157 +78,144 @@
return layoutName;
}
- public void setLayoutName(String layoutName)
- {
- this.layoutName = ("".equals(layoutName) ? null : layoutName);
- }
-
public String getThemeName()
{
return themeName;
}
- public void setThemeName(String themeName)
- {
- this.themeName = ("".equals(themeName) ? null : themeName);
- }
-
public String getRenderSetName()
{
return renderSetName;
}
- public void setRenderSetName(String renderSetName)
+ public String getWindowRendererName()
{
- this.renderSetName = ("".equals(renderSetName) ? null : renderSetName);
+ return windowRendererName;
}
- public String getStrategyName()
+ public String getDecorationRendererName()
{
- return strategyName;
+ return decorationRendererName;
}
- public void setStrategyName(String strategyName)
+ public String getPortletRendererName()
{
- this.strategyName = ("".equals(strategyName) ? null : strategyName);
+ return portletRendererName;
}
- public String getWindowRendererName()
+ public void setLayoutName(String layoutName)
{
- return windowRendererName;
+ this.layoutName = "".equals(layoutName) ? null : layoutName;
}
- public void setWindowRendererName(String windowRendererName)
+ public void setThemeName(String themeName)
{
- this.windowRendererName = ("".equals(windowRendererName) ? null : windowRendererName);
+ this.themeName = "".equals(themeName) ? null : themeName;
}
- public String getDecorationRendererName()
+ public void setRenderSetName(String renderSetName)
{
- return decorationRendererName;
+ this.renderSetName = "".equals(renderSetName) ? null : renderSetName;
}
- public void setDecorationRendererName(String decorationRendererName)
+ public void setWindowRendererName(String windowRendererName)
{
- this.decorationRendererName = ("".equals(decorationRendererName) ? null : decorationRendererName);
+ this.windowRendererName = "".equals(windowRendererName) ? null : windowRendererName;
}
- public String getPortletRendererName()
+ public void setDecorationRendererName(String decorationRendererName)
{
- return portletRendererName;
+ this.decorationRendererName = "".equals(decorationRendererName) ? null : decorationRendererName;
}
public void setPortletRendererName(String portletRendererName)
{
- this.portletRendererName = ("".equals(portletRendererName) ? null : portletRendererName);
+ this.portletRendererName = "".equals(portletRendererName) ? null : portletRendererName;
}
public String execute()
{
- PortalObject po = pomgr.getSelectedObject();
-
boolean successful = true;
-
- if (po.getType() == PortalObject.TYPE_PORTAL || po.getType() == PortalObject.TYPE_PAGE)
+
+ // Get actual values
+ String layoutName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ String themeName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
+ String renderSetName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET);
+ String windowRendererName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER);
+ String decorationRendererName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER);
+ String portletRendererName = portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER);
+
+ //
+ switch(portalObject.getType())
{
- if (layoutName == null || !layoutName.equals(pomgr.getThemes().getLayoutName()))
- {
-// log.info("set layout to '" + layoutName + "' for " + po.getName());
- po.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT, layoutName);
- }
- if (themeName == null || !themeName.equals(pomgr.getThemes().getThemeName()))
- {
- if ("".equals(themeName))
+ case PortalObject.TYPE_PORTAL:
+ case PortalObject.TYPE_PAGE:
+ if (this.layoutName == null || !this.layoutName.equals(layoutName))
{
+ this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT, this.layoutName);
}
-// log.info("set theme to '" + themeName + "' for " + po.getName());
- po.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME, themeName);
- }
- if (renderSetName == null || !renderSetName.equals(pomgr.getThemes().getRenderSetName()))
- {
-// log.info("set renderSet to '" + renderSetName + "' for " + po.getName());
- po.setDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET, renderSetName);
- }
- if (strategyName == null || !strategyName.equals(pomgr.getThemes().getStrategyName()))
- {
-// log.info("set strategy to '" + strategyName + "' for " + po.getName());
- po.setDeclaredProperty(ThemeConstants.PORTAL_PROP_STRATEGY, strategyName);
- }
+ if (this.themeName == null || !this.themeName.equals(themeName))
+ {
+ this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME, this.themeName);
+ }
+ if (this.renderSetName == null || !this.renderSetName.equals(renderSetName))
+ {
+ this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET, this.renderSetName);
+ }
+ if (this.windowRendererName == null || !this.windowRendererName.equals(windowRendererName))
+ {
+ this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_STRATEGY, this.windowRendererName);
+ }
+ break;
+ case PortalObject.TYPE_WINDOW:
+ if (this.windowRendererName == null || !this.windowRendererName.equals(windowRendererName))
+ {
+ this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER, this.windowRendererName);
+ }
+ if (this.decorationRendererName == null || !this.decorationRendererName.equals(decorationRendererName))
+ {
+ this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER, this.decorationRendererName);
+ }
+ if (this.portletRendererName == null || !this.portletRendererName.equals(portletRendererName))
+ {
+ this.portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER, this.portletRendererName);
+ }
+ break;
+ default:
+ successful = false;
}
- else if (po.getType() == PortalObject.TYPE_WINDOW)
+
+ //
+ if (successful)
{
- if (windowRendererName == null || !windowRendererName.equals(pomgr.getThemes().getWindowRenderer()))
+ String stringMessage = null;
+ switch(this.portalObject.getType())
{
-// log.info("set window renderer to '" + windowRendererName + "' for " + po.getName());
- po.setDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER, windowRendererName);
+ case PortalObject.TYPE_PORTAL:
+ stringMessage = "Theme has been correctly updated on the portal named: " + portalObject.getName();
+ break;
+ case PortalObject.TYPE_PAGE:
+ stringMessage = "Theme has been correctly updated on the page named: " + portalObject.getName();
+ break;
+ case PortalObject.TYPE_WINDOW:
+ stringMessage = "Theme has been correctly updated on the window named: " + portalObject.getName();
+ break;
}
- if (decorationRendererName == null || !decorationRendererName.equals(pomgr.getThemes().getDecorationRenderer()))
+
+ //
+ if (stringMessage != null)
{
-// log.info("set decoration renderer to '" + decorationRendererName + "' for " + po.getName());
- po.setDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER, decorationRendererName);
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, stringMessage, stringMessage);
+ FacesContext.getCurrentInstance().addMessage("status", message);
}
- if (portletRendererName == null || !portletRendererName.equals(pomgr.getThemes().getPortletRenderer()))
- {
-// log.info("set portlet renderer to '" + portletRendererName + "' for " + po.getName());
- po.setDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER, portletRendererName);
- }
}
else
{
String stringMessage = "Unknown object type, please file a Jira issue: http://jira.jboss.org";
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, stringMessage, stringMessage);
FacesContext.getCurrentInstance().addMessage("error", message);
- successful = false;
}
- if (po.getType() == PortalObject.TYPE_PORTAL)
- {
- if (successful)
- {
- String stringMessage = "Theme has been correctly updated on the portal named: " + po.getName();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, stringMessage, stringMessage);
- FacesContext.getCurrentInstance().addMessage("status", message);
- }
- }
- else if (po.getType() == PortalObject.TYPE_PAGE)
- {
- if (successful)
- {
- String stringMessage = "Theme has been correctly updated on the page named: " + po.getName();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, stringMessage, stringMessage);
- FacesContext.getCurrentInstance().addMessage("status", message);
- }
- }
- else if (po.getType() == PortalObject.TYPE_WINDOW)
- {
- if (successful)
- {
- String stringMessage = "Theme has been correctly updated on the window named: " + po.getName();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, stringMessage, stringMessage);
- FacesContext.getCurrentInstance().addMessage("status", message);
- }
- }
-
return "objects";
}
}
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-03-15 13:50:51 UTC (rev 6687)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-03-15 14:13:44 UTC (rev 6688)
@@ -103,8 +103,8 @@
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.ThemePropertyAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
- <property-name>portalObjectManager</property-name>
- <value>#{sessionScope.portalobjectmgr}</value>
+ <property-name>portalObject</property-name>
+ <value>#{sessionScope.portalobjectmgr.selectedObject}</value>
</managed-property>
</managed-bean>
<managed-bean>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml 2007-03-15 13:50:51 UTC (rev 6687)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml 2007-03-15 14:13:44 UTC (rev 6688)
@@ -16,7 +16,7 @@
</td>
<td>
<h:selectOneMenu id="layout" styleClass="portlet-form-field" value="#{themePropertyAction.layoutName}">
- <f:selectItems value="#{portalobjectmgr.themes.layoutNames}"/>
+ <f:selectItems value="#{applicationScope.LayoutService.layoutItems}"/>
</h:selectOneMenu>
</td>
</tr>
@@ -26,7 +26,7 @@
</td>
<td>
<h:selectOneMenu id="theme" styleClass="portlet-form-field" value="#{themePropertyAction.themeName}">
- <f:selectItems value="#{portalobjectmgr.themes.themeNames}"/>
+ <f:selectItems value="#{applicationScope.ThemeService.themeItems}"/>
</h:selectOneMenu>
</td>
</tr>
@@ -36,7 +36,7 @@
</td>
<td>
<h:selectOneMenu id="renderSet" styleClass="portlet-form-field" value="#{themePropertyAction.renderSetName}">
- <f:selectItems value="#{portalobjectmgr.themes.renderSetNames}"/>
+ <f:selectItems value="#{applicationScope.LayoutService.renderSetItems}"/>
</h:selectOneMenu>
</td>
</tr>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml 2007-03-15 13:50:51 UTC (rev 6687)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml 2007-03-15 14:13:44 UTC (rev 6688)
@@ -15,7 +15,7 @@
</td>
<td>
<h:selectOneMenu styleClass="portlet-form-field" value="#{themePropertyAction.windowRendererName}">
- <f:selectItems value="#{portalobjectmgr.themes.renderSetNames}"/>
+ <f:selectItems value="#{applicationScope.LayoutService.renderSetItems}"/>
</h:selectOneMenu>
</td>
</tr>
@@ -24,7 +24,7 @@
</td>
<td>
<h:selectOneMenu styleClass="portlet-form-field" value="#{themePropertyAction.decorationRendererName}">
- <f:selectItems value="#{portalobjectmgr.themes.renderSetNames}"/>
+ <f:selectItems value="#{applicationScope.LayoutService.renderSetItems}"/>
</h:selectOneMenu>
</td>
</tr>
@@ -33,7 +33,7 @@
</td>
<td>
<h:selectOneMenu styleClass="portlet-form-field" value="#{themePropertyAction.portletRendererName}">
- <f:selectItems value="#{portalobjectmgr.themes.renderSetNames}"/>
+ <f:selectItems value="#{applicationScope.LayoutService.renderSetItems}"/>
</h:selectOneMenu>
</td>
</tr>
17 years, 5 months
JBoss Portal SVN: r6687 - in trunk: common/src/main/org/jboss/portal/test/common and 3 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-03-15 09:50:51 -0400 (Thu, 15 Mar 2007)
New Revision: 6687
Modified:
trunk/common/src/main/org/jboss/portal/common/mx/JavaBeanModelMBeanBuilder.java
trunk/common/src/main/org/jboss/portal/test/common/JavaBeanModelMBeanBuilderTestCase.java
trunk/identity/build.xml
trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java
trunk/identity/src/main/org/jboss/portal/identity/MembershipModule.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java
Log:
- some minor code cleanup
- JavaBeanModelMBeanBuilder fix to handle overriden methods properly + testcase
Modified: trunk/common/src/main/org/jboss/portal/common/mx/JavaBeanModelMBeanBuilder.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/mx/JavaBeanModelMBeanBuilder.java 2007-03-15 13:39:19 UTC (rev 6686)
+++ trunk/common/src/main/org/jboss/portal/common/mx/JavaBeanModelMBeanBuilder.java 2007-03-15 13:50:51 UTC (rev 6687)
@@ -87,6 +87,9 @@
//
for (Class c = from;c != null && !c.equals(to);c = c.getSuperclass())
{
+ Map currentClassGetters = new HashMap();
+ Map currentClassSetters = new HashMap();
+
Method[] methods = c.getDeclaredMethods();
for (int i = 0; i < methods.length; i++)
{
@@ -105,20 +108,23 @@
methodName.length() > 3)
{
String propertyName = methodName.substring(3);
- Method beanSetter = (Method)beanSetters.get(propertyName);
+ Map setters = new HashMap();
+ setters.putAll(beanSetters);
+ setters.putAll(currentClassSetters);
+ Method beanSetter = (Method)setters.get(propertyName);
if (beanSetter != null && !beanSetter.getParameterTypes()[0].equals(returnType))
{
throw new IllegalArgumentException("Property " + propertyName + " has a setter" +
" type " + beanSetter.getParameterTypes()[0] + " different from the corresponding" +
" getter type " + returnType);
}
- Method beanGetter = (Method)beanGetters.get(propertyName);
+ Method beanGetter = (Method)currentClassGetters.get(propertyName);
if (beanGetter != null)
{
throw new IllegalArgumentException("Property " + propertyName + " has two getters " +
beanGetter + " and " + method);
}
- beanGetters.put(propertyName, method);
+ currentClassGetters.put(propertyName, method);
}
else if (methodName.startsWith("is") &&
!void.class.equals(returnType) &&
@@ -126,7 +132,10 @@
methodName.length() > 2)
{
String propertyName = methodName.substring(2);
- Method beanSetter = (Method)beanSetters.get(propertyName);
+ Map setters = new HashMap();
+ setters.putAll(beanSetters);
+ setters.putAll(currentClassSetters);
+ Method beanSetter = (Method)setters.get(propertyName);
if (beanSetter != null && !beanSetter.getParameterTypes()[0].equals(returnType))
{
throw new IllegalArgumentException("Property " + propertyName + " has a setter" +
@@ -139,7 +148,7 @@
throw new IllegalArgumentException("Property " + propertyName + " has two getters " +
beanGetter + " and " + method);
}
- beanGetters.put(propertyName, method);
+ currentClassGetters.put(propertyName, method);
}
else if (methodName.startsWith("set") &&
void.class.equals(returnType) &&
@@ -147,7 +156,11 @@
methodName.length() > 3)
{
String propertyName = methodName.substring(3);
- Method beanGetter = (Method)beanGetters.get(propertyName);
+ Map getters = new HashMap();
+ getters.putAll(beanGetters);
+ getters.putAll(currentClassGetters);
+ Method beanGetter = (Method)getters.get(propertyName);
+
if (beanGetter != null && !beanGetter.getReturnType().equals(parameterTypes[0]))
{
throw new IllegalArgumentException("Property " + propertyName + " has a setter" +
@@ -161,12 +174,15 @@
beanSetter + " and " + method);
}
beanSetters.put(propertyName, method);
+ currentClassSetters.put(propertyName, method);
}
//
beanMethods.add(method);
}
}
+ beanGetters.putAll(currentClassGetters);
+ beanSetters.putAll(currentClassSetters);
}
// Keep track of property accessors methods
Modified: trunk/common/src/main/org/jboss/portal/test/common/JavaBeanModelMBeanBuilderTestCase.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/JavaBeanModelMBeanBuilderTestCase.java 2007-03-15 13:39:19 UTC (rev 6686)
+++ trunk/common/src/main/org/jboss/portal/test/common/JavaBeanModelMBeanBuilderTestCase.java 2007-03-15 13:50:51 UTC (rev 6687)
@@ -120,6 +120,11 @@
}
}
+ public void testGetterOverride() throws Exception
+ {
+ JavaBeanModelMBeanBuilder builder = new JavaBeanModelMBeanBuilder(TestOverridenExtend.class, Object.class);
+ }
+
public void testAttributesAreNotCached() throws Exception
{
AttributesAreNotCached aanc = new AttributesAreNotCached();
@@ -418,4 +423,24 @@
return tmp.toString();
}
}
+
+ public class TestOverridenBase
+ {
+ public Set getTest()
+ {
+ //nothing
+ return new HashSet();
+ }
+
+
+ }
+
+ public class TestOverridenExtend extends TestOverridenBase
+ {
+ public Set getTest()
+ {
+ //nothing
+ return new HashSet();
+ }
+ }
}
Modified: trunk/identity/build.xml
===================================================================
--- trunk/identity/build.xml 2007-03-15 13:39:19 UTC (rev 6686)
+++ trunk/identity/build.xml 2007-03-15 13:50:51 UTC (rev 6687)
@@ -439,7 +439,7 @@
- <target name="tests-dev" depends="init" if="HAVE_JDK_1.5">
+ <target name="tests-dev" depends="init, package-tests" if="HAVE_JDK_1.5">
<property name="proto-libs" value="${project.root}/proto-libs"/>
<execute-tests>
<!--
@@ -452,15 +452,15 @@
<x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.db.DBIdentityTestCase"/>
+ <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.db.DBIdentityTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPIdentityTestCase"/>-->
- <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTestCase"/>-->
- <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleRoleModuleTestCase"/>
+ <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleRoleModuleTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticGroupMembershipModuleTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticRoleMembershipModuleTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPUserProfileModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPExtUserModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPExtRoleModuleTestCase"/>-->
+ <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPExtUserModuleTestCase"/>-->
+ <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPExtRoleModuleTestCase"/>
</x-test>
<x-classpath>
<pathelement location="${build.lib}/portal-identity-lib.jar"/>
Modified: trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java 2007-03-15 13:39:19 UTC (rev 6686)
+++ trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java 2007-03-15 13:50:51 UTC (rev 6687)
@@ -109,8 +109,6 @@
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
- //TODO: make a dtd for config files.
-
//parse config files
IdentityConfigurationMetaData meta = ConfigurationParser.parseIdentityConfiguration(configFile);
IdentityConfigurationMetaData defaultMeta = ConfigurationParser.parseIdentityConfiguration(defaultConfigFile);
@@ -156,8 +154,6 @@
}
- //TODO:update meta options using defaultMeta options
-
//create detault modules set
//Map[implementation] --> Map[Type] --> ModuleMetaData
@@ -237,7 +233,6 @@
updateDatasourceWithDefaults(ds, defaultDatasources);
//generate initial options
- //TODO:presence of config tag should be forced in dtd
Map configOptions = ds.getConfig().getOptions();
Map optionMap = new HashMap();
for (Iterator iterator1 = configOptions.keySet().iterator(); iterator1.hasNext();)
Modified: trunk/identity/src/main/org/jboss/portal/identity/MembershipModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/MembershipModule.java 2007-03-15 13:39:19 UTC (rev 6686)
+++ trunk/identity/src/main/org/jboss/portal/identity/MembershipModule.java 2007-03-15 13:50:51 UTC (rev 6687)
@@ -36,8 +36,6 @@
public interface MembershipModule
{
- //TODO: add isUserInRole method - it could gain better performance
-
/**
* Return the set of role objects that a given user has.
*
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2007-03-15 13:39:19 UTC (rev 6686)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2007-03-15 13:50:51 UTC (rev 6687)
@@ -107,8 +107,6 @@
throw new UnsupportedOperationException("User management is not supported in this implementation of UserModule");
}
-
- //TODO: offset limit
public Set findUsers(int offset, int limit) throws IdentityException, IllegalArgumentException
{
return findUsersFilteredByUserName("*", offset, limit);
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java 2007-03-15 13:39:19 UTC (rev 6686)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java 2007-03-15 13:50:51 UTC (rev 6687)
@@ -380,7 +380,7 @@
}
- //TODO: Implement usage of conditions!
+ //TODO: Implement usage of conditions
public Set findRoleMembers(String roleName, int offset, int limit, String userNameFilter) throws IdentityException
{
//throw new UnsupportedOperationException("Not yet implemented");
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java 2007-03-15 13:39:19 UTC (rev 6686)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java 2007-03-15 13:50:51 UTC (rev 6687)
@@ -41,9 +41,7 @@
{
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPUserImpl.class);
- //TODO: make setters to update the state of the entry
-
- //TODO:this is to enable user act like a fasade to identity modules calls
+ //this is to enable user act like a fasade to identity modules calls
IdentityContext identityContext;
private UserProfileModule userProfileModule;
17 years, 5 months
JBoss Portal SVN: r6686 - 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-03-15 09:39:19 -0400 (Thu, 15 Mar 2007)
New Revision: 6686
Added:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
Removed:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/BeanDecorators.java
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.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/PortletManagerBean.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java
trunk/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java
Log:
- made the DelegatingPropertyResolver configuration not static
- now have a subclass of DelegatingPropertyResolver to configure it and registered as the application property resolver
- simplified the security domain configurator bean wiring with other beans
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java (from rev 6671, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/BeanDecorators.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-03-15 13:39:19 UTC (rev 6686)
@@ -0,0 +1,327 @@
+/******************************************************************************
+ * 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.faces.el.decorator.SimpleBeanDecorator;
+import org.jboss.portal.faces.el.decorator.AbstractPropertyDecorator;
+import org.jboss.portal.faces.el.decorator.AbstractBeanDecorator;
+import org.jboss.portal.faces.el.decorator.PropertyDecorator;
+import org.jboss.portal.faces.el.DelegatingPropertyResolver;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.util.IteratorStatus;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.impl.model.content.ContentEditorRegistry;
+import org.jboss.portal.security.AuthorizationDomainRegistry;
+import org.jboss.portal.security.spi.provider.AuthorizationDomain;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.ThemeService;
+import org.jboss.portal.theme.PortalTheme;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import javax.faces.el.PropertyResolver;
+import java.util.Set;
+import java.util.Locale;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AdminPropertyResolver extends DelegatingPropertyResolver
+{
+
+ public AdminPropertyResolver()
+ {
+ init();
+ }
+
+ public AdminPropertyResolver(PropertyResolver delegate)
+ {
+ super(delegate);
+
+ //
+ init();
+ }
+
+ private void init()
+ {
+ SimpleBeanDecorator roleModuleDecorator = new SimpleBeanDecorator();
+ roleModuleDecorator.setProperty("roles", new AbstractPropertyDecorator(Set.class)
+ {
+ public Object getValue(Object bean)
+ {
+ try
+ {
+ RoleModule module = (RoleModule)bean;
+ return module.findRoles();
+ }
+ catch (IdentityException e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+ }
+ });
+ registerDecorator(RoleModule.class, roleModuleDecorator);
+
+ //
+ SimpleBeanDecorator localizedStringDecorator = new SimpleBeanDecorator();
+ localizedStringDecorator.setProperty("value", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean)
+ {
+ LocalizedString string = (LocalizedString)bean;
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ Locale locale = ctx.getExternalContext().getRequestLocale();
+ return string.getString(locale, true);
+ }
+ });
+ registerDecorator(LocalizedString.class, localizedStringDecorator);
+
+ //
+ SimpleBeanDecorator portletDecorator = new SimpleBeanDecorator();
+ portletDecorator.setProperty("name", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+ }
+ });
+ portletDecorator.setProperty("description", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
+ }
+ });
+ portletDecorator.setProperty("keywords", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getMeta().getMetaValue(MetaInfo.KEYWORDS);
+ }
+ });
+ portletDecorator.setProperty("title", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getMeta().getMetaValue(MetaInfo.TITLE);
+ }
+ });
+ portletDecorator.setProperty("remotable", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ PortletInfo info = portlet.getInfo();
+ return info.isRemotable();
+ }
+ });
+ portletDecorator.setProperty("modes", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getCapabilities().getModes("text/html");
+ }
+ });
+ portletDecorator.setProperty("windowStates", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getCapabilities().getWindowStates("text/html");
+ }
+ });
+ portletDecorator.setProperty("locales", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return new ArrayList(portlet.getInfo().getCapabilities().getAllLocales());
+ }
+ });
+ registerDecorator(Portlet.class, portletDecorator);
+
+ //
+ SimpleBeanDecorator instanceDecorator = new SimpleBeanDecorator();
+ instanceDecorator.setProperty("portlet", new AbstractPropertyDecorator(Portlet.class)
+ {
+ public Object getValue(Object bean)
+ {
+ Instance instance = (Instance)bean;
+ try
+ {
+ return instance.getPortlet();
+ }
+ catch (PortletInvokerException e)
+ {
+ // If the portlet is not available we want to avoid the stack trace and rather return null
+ return null;
+ }
+ }
+ });
+ registerDecorator(Instance.class, instanceDecorator);
+
+ //
+ SimpleBeanDecorator portalObjectDecorator = new SimpleBeanDecorator()
+ {
+ private List getChildren(PortalObject object, int mask)
+ {
+ return new ArrayList(object.getChildren(mask));
+ }
+ {
+ setProperty("portals", new AbstractPropertyDecorator(PortalObject.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+ return getChildren(object, PortalObject.PORTAL_MASK);
+ }
+ });
+ setProperty("pages", new AbstractPropertyDecorator(PortalObject.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+ return getChildren(object, PortalObject.PAGE_MASK);
+ }
+ });
+ setProperty("windows", new AbstractPropertyDecorator(PortalObject.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+ return getChildren(object, PortalObject.WINDOW_MASK);
+ }
+ });
+ }
+ };
+ portalObjectDecorator.setProperty("id", new AbstractPropertyDecorator(PortalObject.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+ PortalObjectId id = object.getId();
+ return id.toString(PortalObjectId.LEGACY_BASE64_FORMAT);
+ }
+ });
+ registerDecorator(PortalObject.class, portalObjectDecorator);
+
+ //
+ registerDecorator(ContentEditorRegistry.class, new AbstractBeanDecorator()
+ {
+ protected PropertyDecorator getProperty(Object propertyName)
+ {
+ ContentType contentType = ContentType.create((String)propertyName);
+ final String instanceName = ContentEditorRegistry.getInstance().getEditor(contentType);
+ return instanceName == null ? null : new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ return instanceName;
+ }
+ };
+ }
+ });
+
+ //
+ registerDecorator(AuthorizationDomainRegistry.class, new AbstractBeanDecorator()
+ {
+ protected PropertyDecorator getProperty(final Object propertyName)
+ {
+ return new AbstractPropertyDecorator(AuthorizationDomain.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ return ((AuthorizationDomainRegistry)bean).getDomain((String)propertyName);
+ }
+ };
+ }
+ });
+
+ //
+ SimpleBeanDecorator layoutServiceDecorator = new SimpleBeanDecorator();
+ layoutServiceDecorator.setProperty("layoutItems", new AbstractPropertyDecorator(SelectItem[].class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ LayoutService layoutService = (LayoutService)bean;
+ Collection layouts = layoutService.getLayouts();
+ SelectItem[] items = new SelectItem[layouts.size()];
+ for (IteratorStatus i = new IteratorStatus(layouts.iterator());i.hasNext();)
+ {
+ PortalLayout layout = (PortalLayout)i.next();
+ SelectItem item = new SelectItem();
+ String layoutName = layout.getLayoutInfo().getName();
+ item.setValue(layoutName);
+ item.setLabel(layoutName);
+ items[i.getElementIndex()] = item;
+ }
+ return items;
+ }
+ });
+ registerDecorator(LayoutService.class, layoutServiceDecorator);
+
+ //
+ SimpleBeanDecorator themeServiceDecorator = new SimpleBeanDecorator();
+ themeServiceDecorator.setProperty("themeItems", new AbstractPropertyDecorator(SelectItem[].class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ ThemeService layoutService = (ThemeService)bean;
+ Collection themes = layoutService.getThemes();
+ SelectItem[] items = new SelectItem[themes.size()];
+ for (IteratorStatus i = new IteratorStatus(themes.iterator());i.hasNext();)
+ {
+ PortalTheme name = (PortalTheme)i.next();
+ SelectItem item = new SelectItem();
+ String themeName = name.getThemeInfo().getName();
+ item.setValue(themeName);
+ item.setLabel(themeName);
+ items[i.getElementIndex()] = item;
+ }
+ return items;
+ }
+ });
+ registerDecorator(ThemeService.class, themeServiceDecorator);
+ }
+
+}
Deleted: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/BeanDecorators.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/BeanDecorators.java 2007-03-15 13:15:51 UTC (rev 6685)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/BeanDecorators.java 2007-03-15 13:39:19 UTC (rev 6686)
@@ -1,313 +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.faces.el.decorator.SimpleBeanDecorator;
-import org.jboss.portal.faces.el.decorator.AbstractPropertyDecorator;
-import org.jboss.portal.faces.el.decorator.AbstractBeanDecorator;
-import org.jboss.portal.faces.el.decorator.PropertyDecorator;
-import org.jboss.portal.faces.el.DelegatingPropertyResolver;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.common.util.LocalizedString;
-import org.jboss.portal.common.util.IteratorStatus;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.info.MetaInfo;
-import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.impl.model.content.ContentEditorRegistry;
-import org.jboss.portal.security.AuthorizationDomainRegistry;
-import org.jboss.portal.security.spi.provider.AuthorizationDomain;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.PortalTheme;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.SelectItem;
-import java.util.Set;
-import java.util.Locale;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class BeanDecorators
-{
-
- static
- {
- SimpleBeanDecorator roleModuleDecorator = new SimpleBeanDecorator();
- roleModuleDecorator.setProperty("roles", new AbstractPropertyDecorator(Set.class)
- {
- public Object getValue(Object bean)
- {
- try
- {
- RoleModule module = (RoleModule)bean;
- return module.findRoles();
- }
- catch (IdentityException e)
- {
- e.printStackTrace();
- return null;
- }
- }
- });
- DelegatingPropertyResolver.registerDecorator(RoleModule.class, roleModuleDecorator);
-
- //
- SimpleBeanDecorator localizedStringDecorator = new SimpleBeanDecorator();
- localizedStringDecorator.setProperty("value", new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean)
- {
- LocalizedString string = (LocalizedString)bean;
- FacesContext ctx = FacesContext.getCurrentInstance();
- Locale locale = ctx.getExternalContext().getRequestLocale();
- return string.getString(locale, true);
- }
- });
- DelegatingPropertyResolver.registerDecorator(LocalizedString.class, localizedStringDecorator);
-
- //
- SimpleBeanDecorator portletDecorator = new SimpleBeanDecorator();
- portletDecorator.setProperty("name", new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- Portlet portlet = (Portlet)bean;
- return portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
- }
- });
- portletDecorator.setProperty("description", new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- Portlet portlet = (Portlet)bean;
- return portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
- }
- });
- portletDecorator.setProperty("keywords", new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- Portlet portlet = (Portlet)bean;
- return portlet.getInfo().getMeta().getMetaValue(MetaInfo.KEYWORDS);
- }
- });
- portletDecorator.setProperty("title", new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- Portlet portlet = (Portlet)bean;
- return portlet.getInfo().getMeta().getMetaValue(MetaInfo.TITLE);
- }
- });
- portletDecorator.setProperty("remotable", new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- Portlet portlet = (Portlet)bean;
- PortletInfo info = portlet.getInfo();
- return info.isRemotable();
- }
- });
- portletDecorator.setProperty("modes", new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- Portlet portlet = (Portlet)bean;
- return portlet.getInfo().getCapabilities().getModes("text/html");
- }
- });
- portletDecorator.setProperty("windowStates", new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- Portlet portlet = (Portlet)bean;
- return portlet.getInfo().getCapabilities().getWindowStates("text/html");
- }
- });
- portletDecorator.setProperty("locales", new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- Portlet portlet = (Portlet)bean;
- return new ArrayList(portlet.getInfo().getCapabilities().getAllLocales());
- }
- });
- DelegatingPropertyResolver.registerDecorator(Portlet.class, portletDecorator);
-
- //
- SimpleBeanDecorator instanceDecorator = new SimpleBeanDecorator();
- instanceDecorator.setProperty("portlet", new AbstractPropertyDecorator(Portlet.class)
- {
- public Object getValue(Object bean)
- {
- Instance instance = (Instance)bean;
- try
- {
- return instance.getPortlet();
- }
- catch (PortletInvokerException e)
- {
- // If the portlet is not available we want to avoid the stack trace and rather return null
- return null;
- }
- }
- });
- DelegatingPropertyResolver.registerDecorator(Instance.class, instanceDecorator);
-
- //
- SimpleBeanDecorator portalObjectDecorator = new SimpleBeanDecorator()
- {
- private List getChildren(PortalObject object, int mask)
- {
- return new ArrayList(object.getChildren(mask));
- }
- {
- setProperty("portals", new AbstractPropertyDecorator(PortalObject.class)
- {
- public Object getValue(Object bean)
- {
- PortalObject object = (PortalObject)bean;
- return getChildren(object, PortalObject.PORTAL_MASK);
- }
- });
- setProperty("pages", new AbstractPropertyDecorator(PortalObject.class)
- {
- public Object getValue(Object bean)
- {
- PortalObject object = (PortalObject)bean;
- return getChildren(object, PortalObject.PAGE_MASK);
- }
- });
- setProperty("windows", new AbstractPropertyDecorator(PortalObject.class)
- {
- public Object getValue(Object bean)
- {
- PortalObject object = (PortalObject)bean;
- return getChildren(object, PortalObject.WINDOW_MASK);
- }
- });
- }
- };
- portalObjectDecorator.setProperty("id", new AbstractPropertyDecorator(PortalObject.class)
- {
- public Object getValue(Object bean)
- {
- PortalObject object = (PortalObject)bean;
- PortalObjectId id = object.getId();
- return id.toString(PortalObjectId.LEGACY_BASE64_FORMAT);
- }
- });
- DelegatingPropertyResolver.registerDecorator(PortalObject.class, portalObjectDecorator);
-
- //
- DelegatingPropertyResolver.registerDecorator(ContentEditorRegistry.class, new AbstractBeanDecorator()
- {
- protected PropertyDecorator getProperty(Object propertyName)
- {
- ContentType contentType = ContentType.create((String)propertyName);
- final String instanceName = ContentEditorRegistry.getInstance().getEditor(contentType);
- return instanceName == null ? null : new AbstractPropertyDecorator(String.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- return instanceName;
- }
- };
- }
- });
-
- //
- DelegatingPropertyResolver.registerDecorator(AuthorizationDomainRegistry.class, new AbstractBeanDecorator()
- {
- protected PropertyDecorator getProperty(final Object propertyName)
- {
- return new AbstractPropertyDecorator(AuthorizationDomain.class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- return ((AuthorizationDomainRegistry)bean).getDomain((String)propertyName);
- }
- };
- }
- });
-
- //
- SimpleBeanDecorator layoutServiceDecorator = new SimpleBeanDecorator();
- layoutServiceDecorator.setProperty("layoutItems", new AbstractPropertyDecorator(SelectItem[].class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- LayoutService layoutService = (LayoutService)bean;
- Collection layouts = layoutService.getLayouts();
- SelectItem[] items = new SelectItem[layouts.size()];
- for (IteratorStatus i = new IteratorStatus(layouts.iterator());i.hasNext();)
- {
- PortalLayout layout = (PortalLayout)i.next();
- SelectItem item = new SelectItem();
- String layoutName = layout.getLayoutInfo().getName();
- item.setValue(layoutName);
- item.setLabel(layoutName);
- items[i.getElementIndex()] = item;
- }
- return items;
- }
- });
- DelegatingPropertyResolver.registerDecorator(LayoutService.class, layoutServiceDecorator);
-
- //
- SimpleBeanDecorator themeServiceDecorator = new SimpleBeanDecorator();
- themeServiceDecorator.setProperty("themeItems", new AbstractPropertyDecorator(SelectItem[].class)
- {
- public Object getValue(Object bean) throws IllegalArgumentException
- {
- ThemeService layoutService = (ThemeService)bean;
- Collection themes = layoutService.getThemes();
- SelectItem[] items = new SelectItem[themes.size()];
- for (IteratorStatus i = new IteratorStatus(themes.iterator());i.hasNext();)
- {
- PortalTheme name = (PortalTheme)i.next();
- SelectItem item = new SelectItem();
- String themeName = name.getThemeInfo().getName();
- item.setValue(themeName);
- item.setLabel(themeName);
- items[i.getElementIndex()] = item;
- }
- return items;
- }
- });
- DelegatingPropertyResolver.registerDecorator(ThemeService.class, themeServiceDecorator);
- }
-}
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-03-15 13:15:51 UTC (rev 6685)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-03-15 13:39:19 UTC (rev 6686)
@@ -67,10 +67,10 @@
private InstanceContainer instanceContainer;
/** . */
- private AuthorizationDomainRegistry authorizationDomainRegistry;
+ private RoleModule roleModule;
/** . */
- private RoleModule roleModule;
+ private DomainConfigurator domainConfigurator;
// Navigational state of the user
@@ -105,16 +105,6 @@
// Services accessors
- public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
- {
- return authorizationDomainRegistry;
- }
-
- public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry authorizationDomainRegistry)
- {
- this.authorizationDomainRegistry = authorizationDomainRegistry;
- }
-
public RoleModule getRoleModule()
{
return roleModule;
@@ -135,6 +125,16 @@
this.instanceContainer = instanceContainer;
}
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return domainConfigurator;
+ }
+
+ public void setDomainConfigurator(DomainConfigurator domainConfigurator)
+ {
+ this.domainConfigurator = domainConfigurator;
+ }
+
// Navigational state accessor
public int getPaginationSize()
@@ -184,11 +184,6 @@
// Runtime fields
- public DomainConfigurator getDomainConfigurator()
- {
- return authorizationDomainRegistry.getDomain("instance").getConfigurator();
- }
-
public Instance getSelectedInstance()
{
if (selectedInstance == null && selectedId != null)
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-03-15 13:15:51 UTC (rev 6685)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-03-15 13:39:19 UTC (rev 6686)
@@ -92,12 +92,9 @@
private ThemeService themeService;
/** . */
- private AuthorizationDomainRegistry authorizationDomainRegistry;
+ private DomainConfigurator domainConfigurator;
/** . */
- private PortalAuthorizationManagerFactory portalAuthorizationManagerFactory;
-
- /** . */
private RoleModule roleModule;
// Navigational state
@@ -186,16 +183,6 @@
return null;
}
- public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
- {
- return portalAuthorizationManagerFactory;
- }
-
- public void setPortalAuthorizationManagerFactory(PortalAuthorizationManagerFactory portalAuthorizationManagerFactory)
- {
- this.portalAuthorizationManagerFactory = portalAuthorizationManagerFactory;
- }
-
public RoleModule getRoleModule()
{
return roleModule;
@@ -247,16 +234,6 @@
this.themeService = themeService;
}
- public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
- {
- return authorizationDomainRegistry;
- }
-
- public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry authorizationDomainRegistry)
- {
- this.authorizationDomainRegistry = authorizationDomainRegistry;
- }
-
public ContentType getSelectedContentType()
{
return selectedContentType;
@@ -307,6 +284,16 @@
this.selectedContentParameters = selectedContentParameters;
}
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return domainConfigurator;
+ }
+
+ public void setDomainConfigurator(DomainConfigurator domainConfigurator)
+ {
+ this.domainConfigurator = domainConfigurator;
+ }
+
// Runtime state
public PortletInvoker getPortletDefinitionInvoker()
@@ -324,11 +311,6 @@
return themes;
}
- public DomainConfigurator getDomainConfigurator()
- {
- return authorizationDomainRegistry.getDomain("portalobject").getConfigurator();
- }
-
public SelectItem[] getInstanceItems()
{
return instanceItems;
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-03-15 13:15:51 UTC (rev 6685)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-03-15 13:39:19 UTC (rev 6686)
@@ -62,7 +62,7 @@
static
{
// For the loading of the class that will load the decorators
- Class clazz = BeanDecorators.class;
+ Class clazz = AdminPropertyResolver.class;
log.debug("Loaded bean decorator class " + clazz.getName());
}
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-03-15 13:15:51 UTC (rev 6685)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-03-15 13:39:19 UTC (rev 6686)
@@ -28,7 +28,7 @@
<faces-config>
<application>
- <property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver>
+ <property-resolver>org.jboss.portal.core.admin.ui.AdminPropertyResolver</property-resolver>
<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
</application>
@@ -68,13 +68,9 @@
<value>#{applicationScope.ThemeService}</value>
</managed-property>
<managed-property>
- <property-name>authorizationDomainRegistry</property-name>
- <value>#{applicationScope.AuthorizationDomainRegistry}</value>
+ <property-name>domainConfigurator</property-name>
+ <value>#{applicationScope.AuthorizationDomainRegistry.portalobject.configurator}</value>
</managed-property>
- <managed-property>
- <property-name>portalAuthorizationManagerFactory</property-name>
- <value>#{applicationScope.PortalAuthorizationManagerFactory}</value>
- </managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>portalAction</managed-bean-name>
@@ -135,8 +131,8 @@
<value>#{applicationScope.InstanceContainer}</value>
</managed-property>
<managed-property>
- <property-name>authorizationDomainRegistry</property-name>
- <value>#{applicationScope.AuthorizationDomainRegistry}</value>
+ <property-name>domainConfigurator</property-name>
+ <value>#{applicationScope.AuthorizationDomainRegistry.instance.configurator}</value>
</managed-property>
</managed-bean>
Modified: trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java 2007-03-15 13:15:51 UTC (rev 6685)
+++ trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java 2007-03-15 13:39:19 UTC (rev 6686)
@@ -50,24 +50,8 @@
private final PropertyResolver delegate;
/** . */
- private static volatile Map decoratorMap = new HashMap();
+ private volatile Map decoratorMap = new HashMap();
- public static synchronized void registerDecorator(Class clazz, BeanDecorator decorator)
- {
- if (clazz == null)
- {
- throw new IllegalArgumentException();
- }
- if (decorator == null)
- {
- throw new IllegalArgumentException();
- }
- Map copy = new HashMap(decoratorMap);
- copy.put(clazz.getName(), decorator);
- decoratorMap = copy;
- log.debug("Added bean decorator " + clazz.getName() + " in resolver map");
- }
-
public DelegatingPropertyResolver(PropertyResolver delegate)
{
this.delegate = delegate;
@@ -284,6 +268,22 @@
throw createPNFE(base, index);
}
+ public final synchronized void registerDecorator(Class clazz, BeanDecorator decorator)
+ {
+ if (clazz == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (decorator == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ Map copy = new HashMap(decoratorMap);
+ copy.put(clazz.getName(), decorator);
+ decoratorMap = copy;
+ log.debug("Added bean decorator " + clazz.getName() + " in resolver map");
+ }
+
private static interface BeanAction
{
boolean execute(BeanDecorator decorator);
@@ -390,5 +390,4 @@
{
return new PropertyNotFoundException("Property " + propertyName + " on object " + base + " was not found");
}
-
}
Modified: trunk/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java 2007-03-15 13:15:51 UTC (rev 6685)
+++ trunk/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java 2007-03-15 13:39:19 UTC (rev 6686)
@@ -66,9 +66,14 @@
testBeanDecorator = new TestBeanDecorator(testBean.property);
testBeanInterfaceDecorator = new TestBeanDecorator(testBean.interfaceProperty);
testBeanInterfaceSuperInterfaceDecorator = new TestBeanDecorator(testBean.interfaceSuperInterfaceProperty);
- DelegatingPropertyResolver.registerDecorator(TestBean.class, testBeanDecorator);
- DelegatingPropertyResolver.registerDecorator(TestBeanInterface.class, testBeanInterfaceDecorator);
- DelegatingPropertyResolver.registerDecorator(TestBeanInterfaceSuperInterface.class, testBeanInterfaceSuperInterfaceDecorator);
+ resolver = new DelegatingPropertyResolver()
+ {
+ {
+ registerDecorator(TestBean.class, testBeanDecorator);
+ registerDecorator(TestBeanInterface.class, testBeanInterfaceDecorator);
+ registerDecorator(TestBeanInterfaceSuperInterface.class, testBeanInterfaceSuperInterfaceDecorator);
+ }
+ };
testDynamicBean = new TestDynamicBean();
resolver = new DelegatingPropertyResolver();
}
17 years, 5 months