JBoss Portal SVN: r9088 - branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-23 11:16:29 -0500 (Fri, 23 Nov 2007)
New Revision: 9088
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
Log:
always append a random number to generated name of ContentPortlets
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-11-23 15:10:13 UTC (rev 9087)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-11-23 16:16:29 UTC (rev 9088)
@@ -181,6 +181,9 @@
}
else
{
+ // Always append a random number for content portlets
+ // e.g. a widget with the same name is not refreshed until the session is destroyed although the content.uri changed
+ appendNumber = true;
windowName = instanceName;
}
16 years, 7 months
JBoss Portal SVN: r9087 - branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-23 10:10:13 -0500 (Fri, 23 Nov 2007)
New Revision: 9087
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java
Log:
fixed renameAction
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java 2007-11-23 15:03:00 UTC (rev 9086)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java 2007-11-23 15:10:13 UTC (rev 9087)
@@ -44,7 +44,7 @@
private String newName;
/** The page container that will create the child. */
- public PageContainer pageContainer;
+ public PortalObject pageContainer;
private DomainConfigurator domainConfigurator;
@@ -75,12 +75,12 @@
this.domainConfigurator = domainConfigurator;
}
- public PageContainer getPageContainer()
+ public PortalObject getPageContainer()
{
return pageContainer;
}
- public void setPageContainer(PageContainer pageContainer)
+ public void setPageContainer(PortalObject pageContainer)
{
this.pageContainer = pageContainer;
}
16 years, 7 months
JBoss Portal SVN: r9086 - branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-23 10:03:00 -0500 (Fri, 23 Nov 2007)
New Revision: 9086
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
Log:
Update DTDs
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-11-23 14:30:55 UTC (rev 9085)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-11-23 15:03:00 UTC (rev 9086)
@@ -93,7 +93,7 @@
does not have a visual representation. It can exist only under the root. A context can
only have children with the portal type.
-->
-<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*)>
+<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*, (display-name* | (resource-bundle, supported-locale+)))>
<!--
The context name value.
@@ -108,7 +108,7 @@
(view,edit,help) and (normal,minimized,maximized).
-->
<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,
- listener?,security-constraint?,page*)>
+ listener?,security-constraint?,page*, (display-name* | (resource-bundle, supported-locale+)))>
<!--
The portal name value.
@@ -158,7 +158,7 @@
type page and window. The children windows are the windows of the page and the children
pages are the subpages of this page.
-->
-<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page|window)*)>
+<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page|window)*, (display-name* | (resource-bundle, supported-locale+)))>
<!ELEMENT display-name (#PCDATA)>
<!ATTLIST display-name
@@ -185,7 +185,7 @@
The region and height defines how the window is placed in the page.
-->
-<!ELEMENT window (window-name,(instance-ref|content),region,height,initial-window-state?,initial-mode?,properties?,listener?)>
+<!ELEMENT window (window-name,(instance-ref|content),region,height,initial-window-state?,initial-mode?,properties?,listener?, (display-name* | (resource-bundle, supported-locale+)))>
<!--
The window name value.
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-11-23 14:30:55 UTC (rev 9085)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-11-23 15:03:00 UTC (rev 9086)
@@ -74,8 +74,18 @@
</instance>
-->
-<!ELEMENT instance (instance-id,portlet-ref,display-name*,preferences?,security-constraint?)>
+<!ELEMENT instance (instance-id,portlet-ref,display-name*,preferences?,security-constraint?, (display-name* | (resource-bundle, supported-locale+)))>
+<!ELEMENT display-name (#PCDATA)>
+<!ATTLIST display-name
+ xml:lang NMTOKEN #IMPLIED
+>
+
+<!ELEMENT resource-bundle (#PCDATA)>
+
+<!ELEMENT supported-locale (#PCDATA)>
+
+
<!--
The identifier of the instance.
-->
16 years, 7 months
JBoss Portal SVN: r9085 - in branches/JBoss_Portal_Branch_2_6/widget: src/main/org/jboss/portal/widget and 4 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-23 09:30:55 -0500 (Fri, 23 Nov 2007)
New Revision: 9085
Modified:
branches/JBoss_Portal_Branch_2_6/widget/build.xml
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetPortlet.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetPortlet.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesPreferencesInfo.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
Log:
minor
Modified: branches/JBoss_Portal_Branch_2_6/widget/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-11-23 14:28:56 UTC (rev 9084)
+++ branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-11-23 14:30:55 UTC (rev 9085)
@@ -259,7 +259,7 @@
depends="init">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-widget.war"/>
- <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-widget-netvibes.war"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-widget-netvibes.war"/>
</target>
<target name="package-tests" depends="init, output">
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetPortlet.java 2007-11-23 14:28:56 UTC (rev 9084)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetPortlet.java 2007-11-23 14:30:55 UTC (rev 9085)
@@ -42,7 +42,7 @@
public final static String INIT_PARAM_CONNECTION_TIMEOUT = "connectionTimeout";
/** .*/
- public final static String INIT_PARAM_ENTRY_EXPIRATION = "entryExpiration";
+ public final static String INIT_PARAM_ENTRY_EXPIRATION = "widgetExpiration";
/** . */
public final static String INIT_PARAM_QUERY_EXPIRATION = "queryExpiration";
@@ -110,7 +110,7 @@
String fetchWidgetsOnDirectoryLookup = config.getInitParameter(INIT_PARAM_FETCH_WIDGETS_ON_LOOKUP);
if(fetchWidgetsOnDirectoryLookup != null && fetchWidgetsOnDirectoryLookup.length() > 0)
{
- provider.setFetchWidgetsOnDirectoryLookup(Boolean.getBoolean(fetchWidgetsOnDirectoryLookup));
+ provider.setFetchWidgetsOnDirectoryLookup(Boolean.parseBoolean(fetchWidgetsOnDirectoryLookup));
}
// Finally start widget provider
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java 2007-11-23 14:28:56 UTC (rev 9084)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java 2007-11-23 14:30:55 UTC (rev 9085)
@@ -75,7 +75,7 @@
public void start()
{
- executor = new ThreadPoolExecutor(4, 4, 0, TimeUnit.SECONDS, new LinkedBlockingQueue());
+ executor = new ThreadPoolExecutor(4, 6, 0, TimeUnit.SECONDS, new LinkedBlockingQueue());
scheduledExecutor = new ScheduledThreadPoolExecutor(2);
scheduledExecutor.scheduleAtFixedRate(new EntryEvictionThread(), timing, timing, TimeUnit.MILLISECONDS);
@@ -177,6 +177,7 @@
catch (Exception e)
{
log.debug("Failed to retreive widget directory information", e);
+ queries.remove(query);
return new DirectoryResultFailure(e);
}
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetPortlet.java 2007-11-23 14:28:56 UTC (rev 9084)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetPortlet.java 2007-11-23 14:30:55 UTC (rev 9085)
@@ -133,12 +133,10 @@
Widget widget = provider.getWidget(uri);
if (widget != null)
{
- /** breaks the portlet-titlebar if too long
if (widget.getTitle() != null)
{
- resp.setTitle(widget.getTitle().getDefaultString() + " (Google Widget)");
+ resp.setTitle(widget.getTitle().getString(req.getLocale(), true));
}
- */
writer.print(widget.render(req.getParameterMap(), req.getLocale()));
}
else
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesPreferencesInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesPreferencesInfo.java 2007-11-23 14:28:56 UTC (rev 9084)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesPreferencesInfo.java 2007-11-23 14:30:55 UTC (rev 9085)
@@ -25,6 +25,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
/**
@@ -37,7 +38,7 @@
/** The preferences */
private Map<String, NetvibesPreferenceInfo> preferences;
- public NetvibesPreferencesInfo(Collection<NetvibesPreferenceInfo> preferences)
+ public NetvibesPreferencesInfo(List<NetvibesPreferenceInfo> preferences)
{
if ( preferences == null)
{
@@ -63,6 +64,4 @@
}
return this.preferences == null ? null : (NetvibesPreferenceInfo) this.preferences.get(key);
}
-
}
-
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java 2007-11-23 14:28:56 UTC (rev 9084)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java 2007-11-23 14:30:55 UTC (rev 9085)
@@ -118,7 +118,10 @@
{
tempHeight = value;
}
- frameUrl.append("&" + FastURLEncoder.getUTF8Instance().encode(name) + "=" + FastURLEncoder.getUTF8Instance().encode(value));
+ if (! value.equals(info.getDefaultValue()))
+ {
+ frameUrl.append("&" + FastURLEncoder.getUTF8Instance().encode(name) + "=" + FastURLEncoder.getUTF8Instance().encode(value));
+ }
}
}
}
@@ -126,7 +129,8 @@
String actualHeight = tempHeight != null ? String.valueOf(Integer.valueOf(tempHeight).intValue() + 50) : defaultHeight;
StringBuffer output = new StringBuffer();
- output.append("<iframe id=\"frame_"+ id +"\" frameborder=\"0\" width=\"100%\" height=\""+ actualHeight +"\" ");
+
+ output.append("<iframe id=\"frame_"+ id +"\" name=\"frame_"+ id +"\" frameborder=\"0\" width=\"100%\" height=\""+ actualHeight +"\" ");
output.append("src=\"");
output.append(frameUrl);
output.append("\"></iframe>");
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java 2007-11-23 14:28:56 UTC (rev 9084)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java 2007-11-23 14:30:55 UTC (rev 9085)
@@ -137,12 +137,10 @@
Widget widget = provider.getWidget(uri);
if (widget != null)
{
- /** breaks the portlet-titlebar if too long
- if( widget.getTitle() != null)
+ if (widget.getTitle() != null)
{
- resp.setTitle(widget.getTitle().getDefaultString() + " (Netvibes Widget)");
+ resp.setTitle(widget.getTitle().getString(req.getLocale(), true));
}
- */
writer.print(widget.render(req.getParameterMap(), req.getLocale()));
}
else
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml 2007-11-23 14:28:56 UTC (rev 9084)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml 2007-11-23 14:30:55 UTC (rev 9085)
@@ -39,7 +39,7 @@
</init-param>
<init-param>
<description>Time until a Widget expires and gets refreshed (in minutes). Default value is 6 hours.</description>
- <name>entryExpiration</name>
+ <name>widgetExpiration</name>
<value>360</value>
</init-param>
<init-param>
@@ -47,6 +47,11 @@
<name>queryExpiration</name>
<value>60</value>
</init-param>
+ <init-param>
+ <description>This value defines if all widgets should be fetched when performing the directory search.</description>
+ <name>fetchWidgetsOnDirectoryLookup</name>
+ <value>false</value>
+ </init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml 2007-11-23 14:28:56 UTC (rev 9084)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml 2007-11-23 14:30:55 UTC (rev 9085)
@@ -39,7 +39,7 @@
</init-param>
<init-param>
<description>Time until a Widget expires and gets refreshed (in minutes). Default value is 6 hours.</description>
- <name>entryExpiration</name>
+ <name>widgetExpiration</name>
<value>360</value>
</init-param>
<init-param>
@@ -47,6 +47,11 @@
<name>queryExpiration</name>
<value>60</value>
</init-param>
+ <init-param>
+ <description>This value defines if all widgets should be fetched when performing the directory search.</description>
+ <name>fetchWidgetsOnDirectoryLookup</name>
+ <value>false</value>
+ </init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
16 years, 7 months
JBoss Portal SVN: r9084 - branches/JBoss_Portal_Branch_2_6/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-23 09:28:56 -0500 (Fri, 23 Nov 2007)
New Revision: 9084
Modified:
branches/JBoss_Portal_Branch_2_6/build/build.xml
branches/JBoss_Portal_Branch_2_6/build/distrib.xml
Log:
Integrate netvibes widgets
Modified: branches/JBoss_Portal_Branch_2_6/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-11-23 14:13:26 UTC (rev 9083)
+++ branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-11-23 14:28:56 UTC (rev 9084)
@@ -302,6 +302,7 @@
<copy file="../core-samples/output/lib/portal-users-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<!--<copy file="../core-search/output/lib/portal-search.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>-->
<copy file="../widget/output/lib/portal-widget.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="../widget/output/lib/portal-widget-netvibes.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../wsrp/output/lib/portal-wsrp.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
</target>
@@ -322,6 +323,7 @@
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-users-samples.sar"/>
<!--<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-search.sar"/>-->
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-widget.war"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-widget-netvibes.war"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-wsrp.sar"/>
</target>
Modified: branches/JBoss_Portal_Branch_2_6/build/distrib.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/distrib.xml 2007-11-23 14:13:26 UTC (rev 9083)
+++ branches/JBoss_Portal_Branch_2_6/build/distrib.xml 2007-11-23 14:28:56 UTC (rev 9084)
@@ -248,6 +248,7 @@
<copy todir="${portal.build.normal.bin}/jboss-portal.sar">
<fileset dir="${source.dir}/workflow/output/resources" includes="portal-workflow.sar/**"/>
<fileset dir="${source.dir}/widget/output/resources" includes="portal-widget.war/**"/>
+ <fileset dir="${source.dir}/widget/output/resources" includes="portal-widget-netvibes.war/**"/>
<fileset dir="${source.dir}/core-management/output/resources" includes="portal-management.sar/**"/>
<fileset dir="${source.dir}/core-admin/output/resources" includes="portal-admin.sar/**"/>
<fileset dir="${source.dir}/core-identity/output/resources" includes="portal-identity.sar/**"/>
@@ -281,6 +282,7 @@
<copy todir="${portal.build.ha.bin}/jboss-portal-ha.sar">
<fileset dir="${source.dir}/workflow/output/resources" includes="portal-workflow.sar/**"/>
<fileset dir="${source.dir}/widget/output/resources" includes="portal-widget.war/**"/>
+ <fileset dir="${source.dir}/widget/output/resources" includes="portal-widget-netvibes.war/**"/>
<fileset dir="${source.dir}/core-management/output/resources" includes="portal-management.sar/**"/>
<fileset dir="${source.dir}/core-admin/output/resources" includes="portal-admin.sar/**"/>
<fileset dir="${source.dir}/core-identity/output/resources" includes="portal-identity.sar/**"/>
16 years, 7 months
JBoss Portal SVN: r9083 - branches/JBoss_Portal_Branch_2_6/core-cms.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-23 09:13:26 -0500 (Fri, 23 Nov 2007)
New Revision: 9083
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/build.xml
Log:
typo
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/build.xml 2007-11-23 12:55:40 UTC (rev 9082)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/build.xml 2007-11-23 14:13:26 UTC (rev 9083)
@@ -390,7 +390,7 @@
description="Undeploy."
depends="init">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <delete file="${jboss.home}/server/${portal.deploy.dir}/portam-cms.sar"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-cms.sar"/>
</target>
<target name="undeploy-ha"
16 years, 7 months
JBoss Portal SVN: r9082 - in branches/JBoss_Portal_Branch_2_6: core/src/main/org/jboss/portal/core/impl/model/instance/persistent and 7 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-23 07:55:40 -0500 (Fri, 23 Nov 2007)
New Revision: 9082
Added:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/MetaDataResourceBundleFactory.java
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource_fr.properties
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet-instances.xml
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceDefinition.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/instance/metadata/InstanceMetaData.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/deployment/PortletInstancesMetaDataFactoryTestCase.java
Log:
- Let instances display-names be set in Resource bundles
- Improved portal object display-name i18n code
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java 2007-11-23 12:07:22 UTC (rev 9081)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java 2007-11-23 12:55:40 UTC (rev 9082)
@@ -22,6 +22,17 @@
******************************************************************************/
package org.jboss.portal.core.deployment.jboss;
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.parsers.DocumentBuilder;
+
import org.jboss.deployment.DeploymentException;
import org.jboss.mx.util.MBeanProxyExt;
import org.jboss.portal.common.io.IOTools;
@@ -54,16 +65,6 @@
import org.w3c.dom.Element;
import org.xml.sax.EntityResolver;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.xml.parsers.DocumentBuilder;
-import java.io.File;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
@@ -286,7 +287,7 @@
Element instanceElt = XMLTools.getUniqueChild(deploymentElt, "instance", true);
//
- InstanceMetaData metaData = InstanceMetaData.buildMetaData(instanceElt);
+ InstanceMetaData metaData = InstanceMetaData.buildMetaData(instanceElt, pwa);
//
Element ifExistsElt = XMLTools.getUniqueChild(deploymentElt, "if-exists", false);
@@ -455,7 +456,8 @@
// Configure
configureInstance(instance, metaData);
}
-
+
+
private String resolvePortletRef(String ref)
{
return "local." + pwa.getId() + "." + ref;
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceDefinition.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceDefinition.java 2007-11-23 12:07:22 UTC (rev 9081)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceDefinition.java 2007-11-23 12:55:40 UTC (rev 9082)
@@ -88,14 +88,13 @@
this.mutable = false;
this.portletRef = instanceMD.getPortletRef();
this.instanceId = instanceMD.getId();
- this.displayNames = setDisplayNames(instanceMD.getDisplayName());
+ this.displayNames = getDisplayNamesMap(instanceMD.getDisplayName());
this.relatedSecurityBindings = new HashMap();
this.relatedCustomizations = new HashMap();
- this.displayNames = new HashMap();
this.state = null;
}
- private Map setDisplayNames(LocalizedStringMetaData displayName)
+ private Map getDisplayNamesMap(LocalizedStringMetaData displayName)
{
Map map = new HashMap();
if (displayName == null)
Added: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/MetaDataResourceBundleFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/MetaDataResourceBundleFactory.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/MetaDataResourceBundleFactory.java 2007-11-23 12:55:40 UTC (rev 9082)
@@ -0,0 +1,101 @@
+/******************************************************************************
+ * 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.model;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.common.i18n.ResourceBundleFactory;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.common.util.EmptyResourceBundle;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class MetaDataResourceBundleFactory implements ResourceBundleFactory
+{
+
+ private Logger logger = Logger.getLogger(MetaDataResourceBundleFactory.class);
+
+ public static ResourceBundleManager createResourceBundleManager(ClassLoader classLoader, List supportedLocales, String baseName)
+ {
+ if (classLoader == null)
+ {
+ throw new IllegalArgumentException("Need a non null classloader");
+ }
+ if (supportedLocales == null)
+ {
+ throw new IllegalArgumentException("Supported locales cannot be null");
+ }
+
+ // Create factory
+ MetaDataResourceBundleFactory factory = new MetaDataResourceBundleFactory(classLoader, baseName);
+
+ // Create manager
+ ResourceBundleManager manager = new ResourceBundleManager(EmptyResourceBundle.INSTANCE, factory);
+
+ // Preload declared locales
+ for (Iterator i = supportedLocales.iterator();i.hasNext();)
+ {
+ Locale locale = (Locale)i.next();
+ manager.getResourceBundle(locale);
+ }
+
+ //
+ return manager;
+ }
+
+ private ClassLoader classLoader;
+ private String baseName;
+
+ public MetaDataResourceBundleFactory(ClassLoader classLoader, String baseName)
+ {
+ this.classLoader = classLoader;
+ this.baseName = baseName;
+ }
+
+ public ResourceBundle getBundle(Locale locale) throws IllegalArgumentException
+ {
+ if (locale == null)
+ {
+ throw new IllegalArgumentException("Locale cannot be null");
+ }
+
+ try
+ {
+ return ResourceBundle.getBundle(baseName, locale, classLoader);
+ }
+ catch (MissingResourceException e)
+ {
+ logger.warn("Could not find resource bundle: " + baseName + " for locale: " + locale);
+ }
+ return EmptyResourceBundle.INSTANCE;
+ }
+
+}
+
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/instance/metadata/InstanceMetaData.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/instance/metadata/InstanceMetaData.java 2007-11-23 12:07:22 UTC (rev 9081)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/instance/metadata/InstanceMetaData.java 2007-11-23 12:55:40 UTC (rev 9082)
@@ -24,14 +24,19 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.i18n.LocaleFormat;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
import org.jboss.portal.common.util.ConversionException;
import org.jboss.portal.common.xml.XMLTools;
+import org.jboss.portal.core.model.MetaDataResourceBundleFactory;
import org.jboss.portal.portlet.impl.jsr168.metadata.DisplayNameMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.LocalizedStringMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.PreferenceMetaData;
import org.jboss.portal.security.metadata.SecurityConstraintsMetaData;
+import org.jboss.portal.server.deployment.PortalWebApp;
import org.w3c.dom.Element;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -62,7 +67,14 @@
/** The security constraints. */
private SecurityConstraintsMetaData securityConstraints;
+ /** Localized display name */
private LocalizedStringMetaData displayName;
+
+ /** Resource bundle name */
+ private String resourceBundle;
+
+ /** Supported locales */
+ private List supportedLocales;
public InstanceMetaData()
{
@@ -118,10 +130,16 @@
this.securityConstraints = securityConstraints;
}
- public static InstanceMetaData buildMetaData(Element instanceElt)
+ public static InstanceMetaData buildMetaData(Element instanceElt, PortalWebApp pwa)
{
String instanceName = XMLTools.asString(XMLTools.getUniqueChild(instanceElt, "instance-id", true));
String componentRef = XMLTools.asString(XMLTools.getUniqueChild(instanceElt, "portlet-ref", true));
+ Element resourceBundleElement = XMLTools.getUniqueChild(instanceElt, "resource-bundle", false);
+ String resourceBundle = null;
+ if (resourceBundleElement != null)
+ {
+ resourceBundle = XMLTools.asString(resourceBundleElement);
+ }
Iterator displayNamesIt = XMLTools.getChildrenIterator(instanceElt, "display-name");
// Configure preferences override
@@ -157,13 +175,40 @@
}
}
+ Iterator supportedLocalesIt = XMLTools.getChildrenIterator(instanceElt, "supported-locale");
+ List supportedLocales = new ArrayList();
+ while (supportedLocalesIt.hasNext())
+ {
+ String localeName = ((Element)supportedLocalesIt.next()).getTextContent();
+ supportedLocales.add(new Locale(localeName));
+ }
+
+ // Set display name
+ if (pwa != null)
+ {
+ ResourceBundleManager bundleMgr = MetaDataResourceBundleFactory.createResourceBundleManager(pwa.getClassLoader(), supportedLocales, resourceBundle);
+ LocalizedString localizedString = bundleMgr.getLocalizedValue("org.jboss.portal.instance.name." + instanceName, instanceName);
+ Map map = localizedString.getValues();
+ Iterator localeIt = map.values().iterator();
+ while (localeIt.hasNext())
+ {
+ LocalizedString.Value value = (LocalizedString.Value)localeIt.next();
+ DisplayNameMetaData displayNameMD = new DisplayNameMetaData();
+ displayNameMD.setLocale(value.getLocale());
+ displayNameMD.setValue(value.getString());
+ localizedStringMD.getValues().add(displayNameMD);
+ }
+ }
+
// Create the meta data
InstanceMetaData instanceMD = new InstanceMetaData();
instanceMD.setId(instanceName);
instanceMD.setPortletRef(componentRef);
instanceMD.setPreferences(preferencesMD);
instanceMD.setDisplayName(localizedStringMD);
-
+ instanceMD.setResourceBundle(resourceBundle);
+ instanceMD.setSupportedLocales(supportedLocales);
+
// Add the security constraints
Element securityConstraintElt = XMLTools.getUniqueChild(instanceElt, "security-constraint", false);
if (securityConstraintElt != null)
@@ -300,4 +345,24 @@
preferenceMD.setValues(values);
return preferenceMD;
}
+
+ public String getResourceBundle()
+ {
+ return resourceBundle;
+ }
+
+ public void setResourceBundle(String resourceBundle)
+ {
+ this.resourceBundle = resourceBundle;
+ }
+
+ public List getSupportedLocales()
+ {
+ return supportedLocales;
+ }
+
+ public void setSupportedLocales(List supportedLocales)
+ {
+ this.supportedLocales = supportedLocales;
+ }
}
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-11-23 12:07:22 UTC (rev 9081)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-11-23 12:55:40 UTC (rev 9082)
@@ -36,13 +36,12 @@
import org.jboss.portal.common.util.ConversionException;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.xml.XMLTools;
+import org.jboss.portal.core.model.MetaDataResourceBundleFactory;
import org.jboss.portal.core.model.content.spi.ContentProviderRegistry;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectPath;
import org.jboss.portal.core.model.portal.PortalObjectPermission;
-import org.jboss.portal.portlet.impl.jsr168.PortletResourceBundleFactory;
-import org.jboss.portal.portlet.impl.jsr168.metadata.LanguagesMetaData;
import org.jboss.portal.security.RoleSecurityBinding;
import org.jboss.portal.security.SecurityConstants;
import org.jboss.portal.security.metadata.SecurityConstraintsMetaData;
@@ -186,16 +185,7 @@
if (resourceBundle != null)
{
- LanguagesMetaData md = new LanguagesMetaData();
- md.setResourceBundle(resourceBundle);
- Iterator it = supportedLocales.iterator();
- while (it.hasNext())
- {
- Locale locale = (Locale)it.next();
- md.getSupportedLocales().add(locale);
- }
-
- ResourceBundleManager bundleMgr = PortletResourceBundleFactory.createResourceBundleManager(buildContext.getPortalWebApp().getClassLoader(), md);
+ ResourceBundleManager bundleMgr = MetaDataResourceBundleFactory.createResourceBundleManager(buildContext.getPortalWebApp().getClassLoader(), supportedLocales, resourceBundle);
object.setDisplayName(bundleMgr.getLocalizedValue("org.jboss.portal.object.name." + object.getId().getPath().toString(PortalObjectPath.LEGACY_FORMAT), object.getName()));
}
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/deployment/PortletInstancesMetaDataFactoryTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/deployment/PortletInstancesMetaDataFactoryTestCase.java 2007-11-23 12:07:22 UTC (rev 9081)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/deployment/PortletInstancesMetaDataFactoryTestCase.java 2007-11-23 12:55:40 UTC (rev 9082)
@@ -88,7 +88,7 @@
Element instanceElt = XMLTools.getUniqueChild(deploymentElt, "instance", true);
//
- InstanceMetaData metaData = InstanceMetaData.buildMetaData(instanceElt);
+ InstanceMetaData metaData = InstanceMetaData.buildMetaData(instanceElt, null);
instancesMetadata.add(metaData);
}
}
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-11-23 12:07:22 UTC (rev 9081)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-11-23 12:55:40 UTC (rev 9082)
@@ -15,6 +15,7 @@
<table id="instancesTable2" width="100%">
<thead class="portlet-section-header">
<tr>
+ <th>Id</th>
<th>Name</th>
<th>Actions</th>
</tr>
@@ -25,11 +26,14 @@
class="#{instance.id == instancemgr.selectedId ? 'portlet-section-selected' : (status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate')}">
<td>
<h:commandLink action="#{instancemgr.selectInstance}">
- <h:outputText value="#{instance.displayName}" title="#{instance.id}"/>
+ <h:outputText value="#{instance.id}"/>
<f:param name="id" value="#{instance.id}"/>
<f:param name="plugin" value="info"/>
</h:commandLink>
</td>
+ <td>
+ <h:outputText value="#{instance.displayName}"/>
+ </td>
<td><h:commandLink action="#{instancemgr.selectInstance}" styleClass="actionSecurity">
<f:param name="id" value="#{instance.id}"/>
<f:param name="plugin" value="security"/>
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource_fr.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource_fr.properties 2007-11-23 12:07:22 UTC (rev 9081)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource_fr.properties 2007-11-23 12:55:40 UTC (rev 9082)
@@ -23,4 +23,5 @@
javax.portlet.preference.name.RssXml=URL du flux RSS
javax.portlet.preference.name.expires=Temps d'expiration
-org.jboss.portal.object.name.default.Weather=M\u00E9t\u00E9o
\ No newline at end of file
+org.jboss.portal.object.name.default.Weather=M\u00E9t\u00E9o
+org.jboss.portal.instance.name.WeatherPortletInstance=Portlet M\u00E9t\u00E9o
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet-instances.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet-instances.xml 2007-11-23 12:07:22 UTC (rev 9081)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet-instances.xml 2007-11-23 12:55:40 UTC (rev 9082)
@@ -28,9 +28,11 @@
<deployments>
<deployment>
+ <if-exists>overwrite</if-exists>
<instance>
- <display-name xml:lang="en">Weather portlet</display-name>
- <display-name xml:lang="fr">Portlet météo</display-name>
+ <resource-bundle>WeatherResource</resource-bundle>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>en</supported-locale>
<instance-id>WeatherPortletInstance</instance-id>
<portlet-ref>WeatherPortlet</portlet-ref>
</instance>
16 years, 7 months
JBoss Portal SVN: r9081 - in branches/JBoss_Portal_Branch_2_6: core/src/main/org/jboss/portal/core/model/portal and 2 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-11-23 07:07:22 -0500 (Fri, 23 Nov 2007)
New Revision: 9081
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/resources/test/standardidentity-config.xml
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPermission.java
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/login-config.xml
branches/JBoss_Portal_Branch_2_6/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java
Log:
- Dashboard permission check bug - not handling properly custom Principal classes
- Update login-config.xml with new SynchronizingLoginModule option
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/resources/test/standardidentity-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/resources/test/standardidentity-config.xml 2007-11-23 11:32:48 UTC (rev 9080)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/resources/test/standardidentity-config.xml 2007-11-23 12:07:22 UTC (rev 9081)
@@ -74,7 +74,7 @@
</config>
</datasource>
</datasources>
- <modules>
+ <modules>
<module>
<!--type used to correctly map in IdentityContext registry-->
<type>User</type>
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPermission.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPermission.java 2007-11-23 11:32:48 UTC (rev 9080)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPermission.java 2007-11-23 12:07:22 UTC (rev 9081)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.model.portal;
-import org.jboss.portal.identity.auth.UserPrincipal;
import org.jboss.portal.security.PortalPermission;
import org.jboss.portal.security.PortalPermissionCollection;
import org.jboss.portal.security.PortalSecurityException;
@@ -30,6 +29,7 @@
import javax.security.auth.Subject;
import java.security.Permission;
+import java.security.Principal;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
@@ -273,7 +273,7 @@
caller != null &&
thisPath.getLength() < thatPath.getLength())
{
- Set tmp = caller.getPrincipals(UserPrincipal.class);
+ Set tmp = caller.getPrincipals();
if (tmp.size() > 0)
{
Iterator i1 = thisPath.names();
@@ -292,7 +292,7 @@
//
Iterator i = tmp.iterator();
- UserPrincipal user = (UserPrincipal)i.next();
+ Principal user = (Principal)i.next();
String userName = user.getName();
//
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/login-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/login-config.xml 2007-11-23 11:32:48 UTC (rev 9080)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/login-config.xml 2007-11-23 12:07:22 UTC (rev 9081)
@@ -61,6 +61,7 @@
<!--<login-module code="org.jboss.portal.identity.auth.SynchronizingLDAPExtLoginModule" flag="required">
<module-option name="synchronizeIdentity">true</module-option>
<module-option name="synchronizeRoles">true</module-option>
+ <module-option name="preserveRoles">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>
@@ -90,6 +91,7 @@
<!--<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="preserveRoles">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>
Modified: branches/JBoss_Portal_Branch_2_6/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java 2007-11-23 11:32:48 UTC (rev 9080)
+++ branches/JBoss_Portal_Branch_2_6/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java 2007-11-23 12:07:22 UTC (rev 9081)
@@ -241,6 +241,11 @@
{
Principal role = (Principal)i.next();
checkRoleConfig(contextID, role.getName());
+
+ if (trace)
+ {
+ log.trace("Internal check. Contains role: " + role.getName());
+ }
}
}
principals = pp.getPrincipals();
@@ -277,6 +282,15 @@
// Set the subject for later use in that layer
checkedSubjectLocal.set(checkedSubject);
+
+ if (trace && checkedSubject != null)
+ {
+ for (Principal principal : checkedSubject.getPrincipals())
+ {
+ log.trace("Principal name: " + principal.getName());
+ }
+
+ }
//
if (trace)
{
16 years, 7 months
JBoss Portal SVN: r9080 - in modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0: tools/etc/buildfragments and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-11-23 06:32:48 -0500 (Fri, 23 Nov 2007)
New Revision: 9080
Modified:
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/identity/src/main/org/jboss/portal/identity/auth/SynchronizingLoginModule.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/tools/etc/buildfragments/defaults.ent
Log:
SynchronizingLoginModule not injecting Principal objects for all the synchronized roles
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/identity/src/main/org/jboss/portal/identity/auth/SynchronizingLoginModule.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/identity/src/main/org/jboss/portal/identity/auth/SynchronizingLoginModule.java 2007-11-23 09:05:27 UTC (rev 9079)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/identity/src/main/org/jboss/portal/identity/auth/SynchronizingLoginModule.java 2007-11-23 11:32:48 UTC (rev 9080)
@@ -65,8 +65,11 @@
protected String userProfileModuleJNDIName;
protected String preserveRoles;
+ private transient SimpleGroup userRoles = new SimpleGroup("Roles");
+ private transient String password;
+
private UserModule userModule;
private RoleModule roleModule;
private MembershipModule membershipModule;
@@ -76,6 +79,7 @@
{
super.initialize(subject, callbackHandler, sharedState, options);
+ password = null;
userModuleJNDIName = (String)options.get("userModuleJNDIName");
roleModuleJNDIName = (String)options.get("roleModuleJNDIName");
@@ -159,24 +163,26 @@
}
/**
- * We must implement this - just return "" - it's ok as we override validatePassword
+ * We must implement this
* @return
* @throws LoginException
*/
protected String getUsersPassword() throws LoginException
{
- return "";
+ return password;
}
/**
* This always returns true - so this module always pass.
- * @param string
+ * @param inputPassword
* @param string1
* @return
*/
- protected boolean validatePassword(String string, String string1)
+ protected boolean validatePassword(String inputPassword, String string1)
{
+ // Save the password for the synchro stuff
+ password = inputPassword;
return true;
}
@@ -188,12 +194,12 @@
protected Group[] getRoleSets() throws LoginException
{
- Group group = new SimpleGroup("Roles");
+ //Group group = new SimpleGroup("Roles");
if (additionalRole != null)
{
try
{
- group.addMember(createIdentity(additionalRole));
+ userRoles.addMember(createIdentity(additionalRole));
}
catch (Exception e)
{
@@ -201,7 +207,9 @@
log.error("Error when adding additional role: ", e);
}
}
- return new Group[]{group};
+
+ Group[] roleSets = {userRoles};
+ return roleSets;
}
@@ -237,8 +245,6 @@
{
try
{
-
-
User user = null;
//check if user exist
try
@@ -337,6 +343,7 @@
}
rolesToAssign.add(role);
+ userRoles.addMember(createIdentity(role.getName()));
}
}
}
@@ -346,6 +353,7 @@
try
{
rolesToAssign.add(getRoleModule().findRoleByName(defaultAssignedRole));
+ userRoles.addMember(createIdentity(defaultAssignedRole));
}
catch(Exception e)
{
@@ -363,6 +371,10 @@
if (presentRoles != null)
{
rolesToAssign.addAll(presentRoles);
+ for (Object presentRole : presentRoles)
+ {
+ userRoles.addMember(createIdentity(((Role)presentRole).getName()));
+ }
}
}
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/tools/etc/buildfragments/defaults.ent
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/tools/etc/buildfragments/defaults.ent 2007-11-23 09:05:27 UTC (rev 9079)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/tools/etc/buildfragments/defaults.ent 2007-11-23 11:32:48 UTC (rev 9080)
@@ -118,8 +118,8 @@
<property name="javac.depend.cachedir" value="${build.cache}/depends"/>
- <property name="javac.source" value="1.4"/>
- <property name="javac.target" value="1.4"/>
+ <property name="javac.source" value="1.5"/>
+ <property name="javac.target" value="1.5"/>
<property name="rmic.stubVersion" value="1.2"/>
<!-- classpath and local.classpath must have a value using with a path -->
16 years, 7 months
JBoss Portal SVN: r9079 - branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-23 04:05:27 -0500 (Fri, 23 Nov 2007)
New Revision: 9079
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
Log:
improved generated window name
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-11-22 23:45:10 UTC (rev 9078)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-11-23 09:05:27 UTC (rev 9079)
@@ -22,10 +22,12 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui.common;
+import org.jboss.portal.Mode;
import org.jboss.portal.core.admin.ui.actions.WindowComparator;
import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
@@ -166,9 +168,45 @@
}
}
- protected String createWindowName()
+ protected String createWindowName(String contentType, String contentURI, boolean appendNumber)
{
- return "" + (int)(100 * Math.random());
+ String windowName = null;
+ ContentProvider contentProvider = ContentProviderRegistryService.getInstance().getContentProvider(ContentType.create(contentType));
+ String instanceName = contentProvider.getPortletInfo().getPortletName(Mode.VIEW);
+
+ if(instanceName == null)
+ {
+ // Content type portlet: use URI (PortletInstance)
+ windowName = contentURI;
+ }
+ else
+ {
+ windowName = instanceName;
+ }
+
+ //
+ if(windowName.indexOf("Instance") != -1)
+ {
+ // Replace the instance with window
+ windowName = windowName.replace("Instance", "Window");
+ }
+ else
+ {
+ // Or just append window
+ windowName = windowName + "Window";
+ }
+
+ //
+ if (appendNumber)
+ {
+ // if the window already exists add a random number
+ return windowName + "_" + (int)(100 * Math.random());
+ }
+ else
+ {
+ // Just the window without any number
+ return windowName;
+ }
}
public void assignWindows(ActionEvent event)
@@ -176,7 +214,7 @@
String id = event.getComponent().getId();
char direction = id.charAt(0);
String regionName = id.substring(2);
-
+
// Contains the names selected window in the UI
List selectedWindows = (List)assignedWindows.values.get(regionName);
@@ -228,10 +266,10 @@
String windowName = (String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("blah");
if (windowName.trim().length() == 0)
{
- windowName = createWindowName();
+ windowName = createWindowName(selectedContentType.toString(), selectedContentURI, false);
while (page.getWindow(windowName) != null)
{
- windowName = "" + createWindowName();
+ windowName = createWindowName(selectedContentType.toString(), selectedContentURI, true);
}
}
16 years, 7 months