[
https://issues.jboss.org/browse/GTNPORTAL-3075?page=com.atlassian.jira.pl...
]
Trong Tran resolved GTNPORTAL-3075.
-----------------------------------
Assignee: Hai Nguyen
Fix Version/s: 3.5.5.Final
3.6.0.Final
Resolution: Done
'override' parameter of NewPortalConfigListener is not taken
in account
-----------------------------------------------------------------------
Key: GTNPORTAL-3075
URL:
https://issues.jboss.org/browse/GTNPORTAL-3075
Project: GateIn Portal
Issue Type: Enhancement
Security Level: Public(Everyone can see)
Reporter: Hai Nguyen
Assignee: Hai Nguyen
Priority: Minor
Fix For: 3.5.5.Final, 3.6.0.Final
The 'override' init param of
org.exoplatform.portal.config.NewPortalConfigListener is only taken in account in the
first declared component-plugin of the component
org.exoplatform.portal.config.UserPortalConfigService. For example :
{code}
<component>
<key>org.exoplatform.portal.config.UserPortalConfigService</key>
<type>org.exoplatform.portal.config.UserPortalConfigService</type>
<component-plugins>
<component-plugin>
<name>new.portal.config.user.listener</name>
<set-method>initListener</set-method>
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
<description>this listener init the portal
configuration</description>
<init-params>
<value-param>
<name>default.portal</name>
<description>The default portal for checking db is empty or
not</description>
<value>classic</value>
</value-param>
<value-param>
<name>page.templates.location</name>
<description>the path to the location that contains Page
templates</description>
<value>war:/conf/portal/template/pages</value>
</value-param>
<value-param>
<name>override</name>
<description>The flag parameter to decide if portal metadata is
overriden on restarting server</description>
<value>false</value>
</value-param>
<object-param>
<name>site.templates.location</name>
<description>description</description>
<object
type="org.exoplatform.portal.config.SiteConfigTemplates">
<field name="location">
<string>war:/conf/portal</string>
</field>
<field name="portalTemplates">
<collection type="java.util.HashSet">
<value>
<string>basic</string>
</value>
<value>
<string>classic</string>
</value>
</collection>
</field>
<field name="groupTemplates">
<collection type="java.util.HashSet">
<value>
<string>group</string>
</value>
</collection>
</field>
<field name="userTemplates">
<collection type="java.util.HashSet">
<value>
<string>user</string>
</value>
</collection>
</field>
</object>
</object-param>
<object-param>
<name>portal.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value><string>classic</string></value>
</collection>
</field>
<field
name="ownerType"><string>portal</string></field>
<field
name="templateLocation"><string>war:/conf/portal/</string></field>
</object>
</object-param>
<object-param>
<name>group.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value><string>/platform/administrators</string></value>
<value><string>/platform/users</string></value>
<value><string>/platform/guests</string></value>
<value><string>/organization/management/executive-board</string></value>
</collection>
</field>
<field
name="ownerType"><string>group</string></field>
<field
name="templateLocation"><string>war:/conf/portal</string></field>
</object>
</object-param>
<object-param>
<name>user.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value><string>root</string></value>
</collection>
</field>
<field
name="ownerType"><string>user</string></field>
<field
name="templateLocation"><string>war:/conf/portal</string></field>
</object>
</object-param>
</init-params>
</component-plugin>
</component-plugins>
<init-params>
<value-param>
<name>create.user.portal</name>
<value>${gatein.portal.idm.createuserportal}</value>
</value-param>
<value-param>
<name>destroy.user.portal</name>
<value>${gatein.portal.idm.destroyserportal}</value>
</value-param>
<value-param>
<name>default.import.mode</name>
<value>merge</value>
</value-param>
</init-params>
</component>
{code}
When using an external-plugin, if a org.exoplatform.portal.config.NewPortalConfigListener
plugin has already been defined (this is the case in PLF), the 'override' init
params is not taken in account. Like in :
{code}
<external-component-plugins>
<!-- The full qualified name of the UserPortalConfigService -->
<target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
<component-plugin>
<!-- The name of the plugin -->
<name>new.portal.config.user.listener</name>
<!-- The name of the method to call on the UserPortalConfigService in order to
register the NewPortalConfigs -->
<set-method>initListener</set-method>
<!-- The full qualified name of the NewPortalConfigListener -->
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
<description>this listener init the portal configuration</description>
<init-params>
<value-param>
<name>override</name>
<description>The flag parameter to decide if portal metadata is
overriden on restarting server</description>
<value>true</value>
</value-param>
<object-param>
<name>portal.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>acme</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>portal</string>
</field>
<field name="templateLocation">
<string>war:/conf/acme-portal/portal</string>
</field>
</object>
</object-param>
<object-param>
<name>group.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>/platform/web-contributors</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>group</string>
</field>
<field name="templateLocation">
<string>war:/conf/acme-portal/portal</string>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
</external-component-plugins>
{code}
This is due to the
org.exoplatform.portal.config.NewPortalConfigListener.mergePlugin(NewPortalConfigListener)
method.
The 'override' param should either :
- be a param of org.exoplatform.portal.config.NewPortalConfigListener (one value for all
the portals)
- can be defined independently for each
org.exoplatform.portal.config.NewPortalConfigListener
This is also the case for 'default.portal'.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira