JBoss Portal SVN: r6284 - trunk/identity/src/main/org/jboss/portal/identity/ldap.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-02-14 18:00:54 -0500 (Wed, 14 Feb 2007)
New Revision: 6284
Modified:
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
Log:
- make some dummy implementation of offset/limit searches in ldap user module
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2007-02-14 21:49:58 UTC (rev 6283)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2007-02-14 23:00:54 UTC (rev 6284)
@@ -37,6 +37,7 @@
import java.util.NoSuchElementException;
import java.util.HashSet;
import java.util.Collections;
+import java.util.LinkedList;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -115,7 +116,7 @@
public Set findUsersFilteredByUserName(String filter, int offset, int limit) throws IdentityException, IllegalArgumentException
{
- Set uf = new HashSet();
+ List uf = new LinkedList();
try
{
log.debug("findUserFilteredByUserName(): filter = " + filter);
@@ -162,7 +163,29 @@
{
throw new IdentityException("User search failed.", e);
}
- return uf;
+ //this is not very cool. No easy way to do this using JNDI so we apply offset/limit on all returned results
+ //TODO: make it more efficient and apply sort before createUserInstance invocation;
+
+ int size = uf.size();
+
+ if (offset == 0 && size <= (offset+limit))
+ {
+ return Tools.toSet(uf.iterator());
+ }
+ else if (offset >= size)
+ {
+ return new HashSet();
+ }
+ else if (offset + limit > size)
+ {
+ limit = size;
+ }
+
+ Collections.sort(uf, new LDAPUserImpl.LDAPUserComparator());
+
+
+
+ return Tools.toSet(uf.subList(offset, offset + limit).iterator());
}
public int getUserCount() throws IdentityException, IllegalArgumentException
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleImpl.java 2007-02-14 21:49:58 UTC (rev 6283)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleImpl.java 2007-02-14 23:00:54 UTC (rev 6284)
@@ -25,7 +25,10 @@
import org.jboss.portal.identity.Role;
import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.User;
+import java.util.Comparator;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
@@ -164,4 +167,20 @@
{
return id;
}
+
+ public static class LDAPRoleComparator implements Comparator
+ {
+
+
+ public int compare(Object o1, Object o2)
+ {
+ Role r1 = (Role)o1;
+ Role r2 = (Role)o2;
+
+ String name1 = r1.getName();
+ String name2 = r2.getName();
+
+ return name1.compareToIgnoreCase(name2);
+ }
+ }
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java 2007-02-14 21:49:58 UTC (rev 6283)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java 2007-02-14 23:00:54 UTC (rev 6284)
@@ -30,6 +30,7 @@
import org.jboss.portal.common.util.Tools;
import java.security.NoSuchAlgorithmException;
+import java.util.Comparator;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -200,4 +201,20 @@
return userModule;
}
+ public static class LDAPUserComparator implements Comparator
+ {
+
+
+ public int compare(Object o1, Object o2)
+ {
+ User u1 = (User)o1;
+ User u2 = (User)o2;
+
+ String name1 = u1.getUserName();
+ String name2 = u2.getUserName();
+
+ return name1.compareToIgnoreCase(name2);
+ }
+ }
+
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2007-02-14 21:49:58 UTC (rev 6283)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2007-02-14 23:00:54 UTC (rev 6284)
@@ -43,6 +43,8 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Collections;
import java.security.NoSuchAlgorithmException;
/**
@@ -223,7 +225,7 @@
public Set findUsers(int offset, int limit) throws IdentityException, IllegalArgumentException
{
- return findUsersFilteredByUserName("*",0,0);
+ return findUsersFilteredByUserName("*",offset, limit);
}
@@ -236,10 +238,14 @@
throw new IllegalArgumentException("Null user name filter");
}
- log.info("Current implementation of findUsersFilteredByUserName returns all users and is not \"offset\" and \"limit\" sensitive ");
+ //log.info("Current implementation of findUsersFilteredByUserName returns all users and is not \"offset\" and \"limit\" sensitive ");
+ if (limit == 0)
+ {
+ throw new IdentityException("Search limit shouldn't be set to 0");
+ }
- Set uf = new HashSet();
+ List uf = new LinkedList();
@@ -267,6 +273,9 @@
String dn = ctx.getNameInNamespace();
uf.add(createUserInstance(res.getAttributes(), dn));
}
+
+
+
}
catch (NoSuchElementException e)
{
@@ -276,8 +285,31 @@
{
throw new IdentityException("User search failed.", e);
}
- return uf;
+ //this is not very cool. No easy way to do this using JNDI so we apply offset/limit on all returned results
+ //TODO: make it more efficient and apply sort before createUserInstance invocation;
+
+ int size = uf.size();
+
+ if (offset == 0 && size <= (offset+limit))
+ {
+ return Tools.toSet(uf.iterator());
+ }
+ else if (offset >= size)
+ {
+ return new HashSet();
+ }
+ else if (offset + limit > size)
+ {
+ limit = size;
+ }
+
+ Collections.sort(uf, new LDAPUserImpl.LDAPUserComparator());
+
+
+
+ return Tools.toSet(uf.subList(offset, offset + limit).iterator());
+
}
public int getUserCount() throws IdentityException, IllegalArgumentException
19 years, 2 months
JBoss Portal SVN: r6283 - in trunk/portlet/src/main/org/jboss/portal/portlet: state and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-14 16:49:58 -0500 (Wed, 14 Feb 2007)
New Revision: 6283
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletPreferencesImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
Log:
don't use the InstanceContext.getAccessMode() during render as this value cannot be passed in WSRP
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletPreferencesImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletPreferencesImpl.java 2007-02-14 20:27:24 UTC (rev 6282)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletPreferencesImpl.java 2007-02-14 21:49:58 UTC (rev 6283)
@@ -134,7 +134,7 @@
value = prefs.getValue(key);
// If does not exist or read only use what the default one
- if (value == null || prefs.isPortletReadOnly(key))
+ if (value == null || isReadOnly(key))
{
value = prefs.getPortletValue(key);
}
@@ -182,7 +182,17 @@
{
throw new IllegalArgumentException("key must not be null");
}
- return prefs.isReadOnly() || prefs.isPortletReadOnly(key);
+ if (mode == ACTION)
+ {
+ // The accurate value is to combine what the portlet developer and the consumer specifies
+ return prefs.isReadOnly() || prefs.isReadOnly(key);
+ }
+ else
+ {
+ // During render we cannot be aware of the consumer
+ // intent with respect to the access mode of the current state
+ return prefs.isReadOnly(key);
+ }
}
public void reset(String key) throws IllegalArgumentException, ReadOnlyException
@@ -238,18 +248,21 @@
throw new IllegalStateException("Store must be called within the scope of an action request");
}
+ // Copy the transient set to the persistent set if the consumer allows it
+ if (prefs.isReadOnly())
+ {
+ throw new IOException("Should not happen");
+ }
+
// If the optional validator is present validate
if (validator != null)
{
validator.validate(this);
}
- // Copy the transient set to the persistent set if possible
- if (prefs.isReadOnly() == false)
- {
- PropertyChange[] changes = (PropertyChange[])updates.values().toArray(new PropertyChange[updates.size()]);
- prefs.update(changes);
- }
+ //
+ PropertyChange[] changes = (PropertyChange[])updates.values().toArray(new PropertyChange[updates.size()]);
+ prefs.update(changes);
// Clear the updates
updates.clear();
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java 2007-02-14 20:27:24 UTC (rev 6282)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java 2007-02-14 21:49:58 UTC (rev 6283)
@@ -144,7 +144,7 @@
return null;
}
- public boolean isPortletReadOnly(String key) throws IllegalArgumentException
+ public boolean isReadOnly(String key) throws IllegalArgumentException
{
PreferenceInfo pref = portletPrefs.getPreference(key);
if (pref != null)
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java 2007-02-14 20:27:24 UTC (rev 6282)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java 2007-02-14 21:49:58 UTC (rev 6283)
@@ -51,7 +51,9 @@
Value getValue(String key) throws IllegalArgumentException;
/**
- * Return true if the preferences are read only.
+ * Return true if the preferences are globally read only. The value returned by
+ * this method is valid only during the action request. Any call to this method
+ * during the render request will produce a non accurate value.
*
* @return true if the preferences are read only
*/
@@ -83,11 +85,11 @@
Value getPortletValue(String key) throws IllegalArgumentException;
/**
- * Say if the key is marked as read only or not.
+ * Say if the property key is marked as read only or not.
*
* @param key the requested key
* @return the read only value
* @throws IllegalArgumentException if the key or the array is null
*/
- boolean isPortletReadOnly(String key) throws IllegalArgumentException;
+ boolean isReadOnly(String key) throws IllegalArgumentException;
}
19 years, 2 months
JBoss Portal SVN: r6282 - in docs/trunk/quickstartuser/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-02-14 15:27:24 -0500 (Wed, 14 Feb 2007)
New Revision: 6282
Modified:
docs/trunk/quickstartuser/en/images/image012.jpg
docs/trunk/quickstartuser/en/images/image013.jpg
docs/trunk/quickstartuser/en/images/image014.jpg
docs/trunk/quickstartuser/en/images/image015.jpg
docs/trunk/quickstartuser/en/images/image016.jpg
docs/trunk/quickstartuser/en/images/image019.jpg
docs/trunk/quickstartuser/en/images/image022.jpg
docs/trunk/quickstartuser/en/images/image023.jpg
docs/trunk/quickstartuser/en/images/image024.jpg
docs/trunk/quickstartuser/en/modules/interaction.xml
Log:
JBPORTAL-1114 - updating quickstart guide
Modified: docs/trunk/quickstartuser/en/images/image012.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image013.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image014.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image015.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image016.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image019.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image022.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image023.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image024.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/modules/interaction.xml
===================================================================
--- docs/trunk/quickstartuser/en/modules/interaction.xml 2007-02-14 19:37:02 UTC (rev 6281)
+++ docs/trunk/quickstartuser/en/modules/interaction.xml 2007-02-14 20:27:24 UTC (rev 6282)
@@ -27,7 +27,8 @@
<caption>
<para>Figure 5. Default page with portlet
- minimized.</para>
+ minimized.
+ </para>
</caption>
</mediaobject>
Click on the maximize button for that same portlet, and
@@ -41,7 +42,8 @@
<caption>
<para>Figure 6. Portal with portlet
- maximized.</para>
+ maximized.
+ </para>
</caption>
</mediaobject>
</para>
@@ -63,7 +65,8 @@
<caption>
<para>Figure 10. The Create user view in the user
- portlet.</para>
+ portlet.
+ </para>
</caption>
</mediaobject>
<mediaobject>
@@ -103,7 +106,8 @@
<caption>
<para>Figure 13. default portal page for
- administrator.</para>
+ administrator.
+ </para>
</caption>
</mediaobject>
</para>
@@ -161,7 +165,8 @@
<caption>
<para>Figure 16. Choose file to batch
- upload.</para>
+ upload.
+ </para>
</caption>
</mediaobject>
Click on the quickstart.zip that you downloaded
@@ -177,7 +182,8 @@
<caption>
<para>Figure 17. New quickstart directory shows in content
- management repository.</para>
+ management repository.
+ </para>
</caption>
</mediaobject>
</para>
@@ -185,7 +191,8 @@
<para>Click on the quickstart link to see the HTML files and
sub-directories that were uploaded (Figure 18). Click on the "home" symbol
to return to the top of the content manager repository (back to Figure
- 17).</para>
+ 17).
+ </para>
<para>
<mediaobject>
@@ -197,7 +204,8 @@
<caption>
<para>Figure 18. HTML files and sub-directories that were
uploaded intoquickstart directory shows in content management
- repository.</para>
+ repository.
+ </para>
</caption>
</mediaobject>
</para>
@@ -227,10 +235,11 @@
<caption>
<para>Figure 20. Version view for
- index.html.</para>
+ index.html.
+ </para>
</caption>
</mediaobject>
- To edit this HTML file, click on the edit icon. The
+ To edit this HTML file, click on the "text/html" link. The
WYSIWYG editor view will appear (Figures 21 and 22). Note: The WYSIWYG
editor is dependent on browser. Some browsers show a box to enter HTML.
<mediaobject>
@@ -240,47 +249,24 @@
</imageobject>
<caption>
- <para>Figure 21. Content editor view (top).</para>
+ <para>Figure 21. Content editor view.</para>
</caption>
</mediaobject>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/image017.jpg" format="JPG"
- valign="middle"/>
- </imageobject>
-
- <caption>
- <para>Figure 22. Content editor view
- (bottom).</para>
- </caption>
- </mediaobject>
</para>
<para>HTML pages can be edited through this view. Let's change this page
to point to our uploaded pages. Change the title next to the lightning
bolt from "Project Information" to "Quickstart Guide" and change the text
following the link below that to "to see the Quickstart guide for JBoss
- Portal.". The updated text is in Figures 23 and 24.
+ Portal.". The updated text is in Figure 24.
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/image018.jpg" format="JPG"
- valign="middle"/>
- </imageobject>
-
- <caption>
- <para>Figure 23. Updated heading text in HTML
- page.</para>
- </caption>
- </mediaobject>
- <mediaobject>
- <imageobject>
<imagedata align="center" fileref="images/image019.jpg" format="JPG"
valign="middle"/>
</imageobject>
<caption>
- <para>Figure 24. Updated heading text in HTML
- page.</para>
+ <para>Figure 24. Updated text in HTML page.</para>
</caption>
</mediaobject>
</para>
@@ -298,7 +284,8 @@
<caption>
<para>Figure 25. Insert/edit link window with updated link
- URL</para>
+ URL
+ </para>
</caption>
</mediaobject>
Click Insert to save the updated link. Click Create to
@@ -313,10 +300,11 @@
<caption>
<para>Figure 26. File browser with new version of
- index.html.</para>
+ index.html.
+ </para>
</caption>
</mediaobject>
- Click on the default portal page to see the changes we
+ Click on the "Main" link to see the changes we
have made. The content view portlet shows the update page for the portal
documentation (Figure 27).
<mediaobject>
@@ -327,7 +315,8 @@
<caption>
<para>Figure 27. Content view portlet with the updated
- default page.</para>
+ default page.
+ </para>
</caption>
</mediaobject>
Click on the "Click here" link that was updated to go to
@@ -340,7 +329,8 @@
<caption>
<para>Figure 28. Content view portlet with docs page
- shown.</para>
+ shown.
+ </para>
</caption>
</mediaobject>
The links on the docs HTML page will go to other pages
@@ -374,7 +364,8 @@
<caption>
<para>Figure 30. User portlet with user list
- view.</para>
+ view.
+ </para>
</caption>
</mediaobject>
The starter user we created is shown in the list. Click
@@ -388,7 +379,8 @@
<caption>
<para>Figure 31. User portlet with available roles
- view.</para>
+ view.
+ </para>
</caption>
</mediaobject>
Select the Administrators role and click the "Assign
@@ -430,7 +422,8 @@
<caption>
<para>Figure 34. Management portal page default
- view.</para>
+ view.
+ </para>
</caption>
</mediaobject>
Now, let's explore the management portlet. This portlet
@@ -448,7 +441,8 @@
<caption>
<para>Figure 35. Management portlet with tree
- expanded.</para>
+ expanded.
+ </para>
</caption>
</mediaobject>
Using the arrows next to the portlet instance names, we
@@ -464,7 +458,8 @@
<caption>
<para>Figure 36. Role portlet is moved on the management
- portlet page.</para>
+ portlet page.
+ </para>
</caption>
</mediaobject>
Let's create a new portal page. Click on the "default"
@@ -477,7 +472,8 @@
<caption>
<para>Figure 37. Management portlet add page
- view.</para>
+ view.
+ </para>
</caption>
</mediaobject>
Enter "Starter" as the page name and click the "Add page"
@@ -491,7 +487,8 @@
<caption>
<para>Figure 38. Starter portal page has been
- added.</para>
+ added.
+ </para>
</caption>
</mediaobject>
Now let's add some portlet instances to the portal page.
@@ -505,7 +502,8 @@
<caption>
<para>Figure 39. Management portlet for Starter portal
- page.</para>
+ page.
+ </para>
</caption>
</mediaobject>
First, let's add a navigation portlet. Choose the
@@ -518,7 +516,8 @@
<caption>
<para>Figure 40. Choosing the Navigation portlet instance
- from the dropdown.</para>
+ from the dropdown.
+ </para>
</caption>
</mediaobject>
Type in the name you want to give this portlet instance
@@ -532,7 +531,8 @@
<caption>
<para>Figure 41. Nav portlet instance is
- added.</para>
+ added.
+ </para>
</caption>
</mediaobject>
Click on the "nav" link to go into the details for that
@@ -545,7 +545,8 @@
<caption>
<para>Figure 42. Details for the nav portlet
- instance.</para>
+ instance.
+ </para>
</caption>
</mediaobject>
Click on the "Theme" link to update the theme for this
@@ -560,7 +561,8 @@
<caption>
<para>Figure 43. Theme details for the nav portlet
- instance.</para>
+ instance.
+ </para>
</caption>
</mediaobject>
Click the "Update" button, then click the Starter portal
@@ -578,7 +580,8 @@
<caption>
<para>Figure 44. Starter page detail with portlet instances
- added.</para>
+ added.
+ </para>
</caption>
</mediaobject>
Finally, let's take a look at security in the management
@@ -592,7 +595,8 @@
<caption>
<para>Figure 45. Security for the Starter portal
- page.</para>
+ page.
+ </para>
</caption>
</mediaobject>
Let's take a look at the Starter portal page we created.
19 years, 2 months
JBoss Portal SVN: r6281 - in docs/trunk/quickstartuser/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-02-14 14:37:02 -0500 (Wed, 14 Feb 2007)
New Revision: 6281
Modified:
docs/trunk/quickstartuser/en/images/image080.jpg
docs/trunk/quickstartuser/en/images/image081.jpg
docs/trunk/quickstartuser/en/images/image082.jpg
docs/trunk/quickstartuser/en/modules/interaction.xml
Log:
JBPORTAL-1114 - updating quickstart guide
Modified: docs/trunk/quickstartuser/en/images/image080.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image081.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image082.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/modules/interaction.xml
===================================================================
--- docs/trunk/quickstartuser/en/modules/interaction.xml 2007-02-14 19:24:58 UTC (rev 6280)
+++ docs/trunk/quickstartuser/en/modules/interaction.xml 2007-02-14 19:37:02 UTC (rev 6281)
@@ -94,8 +94,7 @@
<para>Figure 12. Portal login page.</para>
</caption>
</mediaobject>
- Click "Login", and the portal will now show us the
- portlets and portal pages for the administrator (Figure 13).
+ Click "Login", and the portal will now show us a link to the Admin portal (top-right) (Figure 13).
<mediaobject>
<imageobject>
<imagedata align="left" fileref="images/image080.jpg" format="png"
@@ -114,8 +113,8 @@
<title>Content Management</title>
<para>Now that we are logged in, there is a portal page available for the
- content management and portal administration. Click on the "Admin" tab.
- The Admin portal page displays(Figure 14).
+ content management and portal administration. Click on the "Admin" link, and then on the "CMS" tab.
+ The CMS Admin portal page displays(Figure 14).
<mediaobject>
<imageobject>
<imagedata align="left" fileref="images/image081.jpg" format="png"
@@ -123,7 +122,7 @@
</imageobject>
<caption>
- <para>Figure 14. Admin portal page.</para>
+ <para>Figure 14. CMS Admin portal page.</para>
</caption>
</mediaobject>
The content management portlet allows users to
@@ -133,7 +132,7 @@
in the CMS. Different groups or departments in an organization can have
their own area (directory structure) for the files/HTML pages they want to
share on the Portal. Let's batch upload a set of HTML pages with images
- and style sheets. Click on the upload archive file icon on the page. The
+ and style sheets. Mouse-over the "Select Action" dropdown menu, and click on the upload archive link. The
upload archive view shows (Figure 15).
<mediaobject>
<imageobject>
19 years, 2 months
JBoss Portal SVN: r6280 - in trunk: core/src/resources/portal-core-sar/conf/identity and 9 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-02-14 14:24:58 -0500 (Wed, 14 Feb 2007)
New Revision: 6280
Removed:
trunk/identity/src/main/org/jboss/portal/identity/experimental/
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml
trunk/identity/build.xml
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/config/info/PropertyInfoSupport.java
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/db/ProfileMapImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserProfileModuleImpl.java
trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTest.java
trunk/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/db/DBTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPIdentityTestCase.java
trunk/identity/src/resources/test/config/profile-config.xml
trunk/identity/src/resources/test/config/standardidentity-config.xml
Log:
- make UserProfile modules handle <type> of objects from profile configuration
- correct test cases
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -29,6 +29,7 @@
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Set;
+import java.util.Date;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
@@ -693,7 +694,22 @@
//user.setFakeEmail(fakeEmail);
setProperty(user,User.INFO_USER_EMAIL_FAKE, fakeEmail);
- //user.setRegistrationDate(new Date());
+ //TODO: set registration date
+
+ String type = userProfileModule.getProfileInfo().getPropertyInfo(User.INFO_USER_REGISTRATION_DATE).getType();
+ if (type.equals("java.util.Date"))
+ {
+ putNonEmptyProperty(user, User.INFO_USER_REGISTRATION_DATE, new Date());
+ }
+ else if (type.equals("java.lang.String"))
+ {
+ putNonEmptyProperty(user, User.INFO_USER_REGISTRATION_DATE, new Date().toString());
+ }
+ else
+ {
+ log.warn(User.INFO_USER_REGISTRATION_DATE + " property is mapped in not supported type: " + type);
+ }
+
String subscriptionMode = getPortletConfig().getInitParameter(UserPortletConstants.SUBSCRIPTIONMODE);
if (subscriptionMode == null)
{
@@ -1183,10 +1199,16 @@
}
}
- private void putNonEmptyProperty(User user, String key, String value)
+ private void putNonEmptyProperty(User user, String key, Object value)
{
- if ((value != null) && (value.trim().length() != 0))
+
+
+ if (value != null)
{
+ if (value instanceof String && !(((String)value).trim().length() != 0) )
+ {
+ return;
+ }
//user.getProfile().put(key, value);
try
{
Modified: trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml 2007-02-14 19:24:58 UTC (rev 6280)
@@ -103,8 +103,8 @@
</property>
<property>
<name>portal.user.registration-date</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
+ <type>java.util.Date</type>
+ <access-mode>read-only</access-mode>
<usage>mandatory</usage>
<display-name xml:lang="en">Registration date</display-name>
<description xml:lang="en">Registration date of user</description>
@@ -117,7 +117,7 @@
</property>
<property>
<name>portal.user.email.view-real</name>
- <type>java.lang.String</type>
+ <type>java.lang.Boolean</type>
<access-mode>read-write</access-mode>
<usage>mandatory</usage>
<display-name xml:lang="en">View real email</display-name>
@@ -131,7 +131,7 @@
</property>
<property>
<name>portal.user.enabled</name>
- <type>java.lang.String</type>
+ <type>java.lang.Boolean</type>
<access-mode>read-write</access-mode>
<usage>mandatory</usage>
<display-name xml:lang="en">Enabled</display-name>
Modified: trunk/identity/build.xml
===================================================================
--- trunk/identity/build.xml 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/build.xml 2007-02-14 19:24:58 UTC (rev 6280)
@@ -452,8 +452,8 @@
<x-test>
+ <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.db.DBIdentityTestCase"/>
<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"/>
Modified: trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -87,18 +87,18 @@
else if (property.isMappedDB())
{
log.debug("Delegating to DB module");
- Object o = getDBModule().getProperty(user, propertyName);
+ return getDBModule().getProperty(user, propertyName);
//if property is column it may be some Object - just convert to String for now
- if(o != null && !(o instanceof String))
+ /*if(o != null && !(o instanceof String))
{
return o.toString();
}
else
{
return o;
- }
+ }*/
}
throw new IdentityException("Cannot process property - incorrect profile or module configuration");
@@ -130,7 +130,7 @@
log.debug("Delegating to DB module");
- Object val = propertyValue.toString();
+ //Object val = propertyValue;
//if property is dynamic convert value to String first
// if(property.getMappingDBType().equals(PropertyInfo.MAPPING_DB_TYPE_DYNAMIC))
// {
@@ -142,7 +142,7 @@
// }
- getDBModule().setProperty(user, name, val);
+ getDBModule().setProperty(user, name, propertyValue);
return;
}
throw new IdentityException("Cannot process property - incorrect profile or module configuration");
Modified: trunk/identity/src/main/org/jboss/portal/identity/config/info/PropertyInfoSupport.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/config/info/PropertyInfoSupport.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/identity/config/info/PropertyInfoSupport.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -64,7 +64,19 @@
name = meta.getName();
type = meta.getType();
accessMode = meta.getAccessMode();
+ if (!accessMode.equals(PropertyInfo.ACCESS_MODE_READ_ONLY) && !accessMode.equals(PropertyInfo.ACCESS_MODE_READ_WRITE))
+ {
+ throw new IdentityException("Wrong value in user profile configuration for access-mode: " + accessMode);
+ }
usage = meta.getUsage();
+
+ if (!usage.equals(PropertyInfo.USAGE_MANDATORY) && !usage.equals(PropertyInfo.USAGE_OPTIONAL))
+ {
+ throw new IdentityException("Wrong value in user profile configuration for usage: " + usage);
+ }
+
+
+
//mappingType = meta.getMapping().getType();
//mappingValue = meta.getMapping().getValue();
@@ -96,6 +108,10 @@
{
mappedDB = true;
mappingDBType = meta.getMapping().getMappingDatabase().getType();
+ if (!mappingDBType.equals(PropertyInfo.MAPPING_DB_TYPE_COLUMN) && !mappingDBType.equals(PropertyInfo.MAPPING_DB_TYPE_DYNAMIC))
+ {
+ throw new IdentityException("Wrong value in user profile configuration for database mapping type: " + mappingDBType);
+ }
mappingDBValue = meta.getMapping().getMappingDatabase().getValue();
}
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -384,22 +384,29 @@
/**
* @param instance the user instance
- * @param string the value
+ * @param value the value
* @throws IllegalArgumentException if the string cannot be converted to an object
*/
- public void set(Object instance, String string) throws IllegalArgumentException
+ public void set(Object instance, Object value) throws IllegalArgumentException
{
try
{
- if (string == null)
+ if (value == null)
{
field.set(instance, null);
}
- else
+
+ if (value instanceof String)
{
- Object object = toObject(string);
+
+ Object object = toObject((String)value);
field.set(instance, object);
+
}
+ else
+ {
+ field.set(instance,value);
+ }
}
catch (IllegalAccessException e)
{
@@ -412,7 +419,7 @@
* @return the converted value
* @throws IllegalArgumentException if the object cannot be converted to a string
*/
- public String get(Object instance) throws IllegalArgumentException
+ public Object get(Object instance) throws IllegalArgumentException
{
try
{
@@ -501,6 +508,21 @@
{
return value.toString();
}
+
+ //workaround to return Date object
+ public Object get(Object instance) throws IllegalArgumentException
+ {
+ try
+ {
+ return field.get(instance);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new Error(e);
+ }
+ }
+
+
}
static class DatePropertyAccessor extends PropertyAccessor
@@ -538,5 +560,19 @@
DateFormat format = (DateFormat)HibernateUserImpl.DatePropertyAccessor.formatLocal.get();
return format.format(date);
}
+
+ //workaround to return Date object
+ public Object get(Object instance) throws IllegalArgumentException
+ {
+ try
+ {
+ return field.get(instance);
+
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new Error(e);
+ }
+ }
}
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -41,6 +41,7 @@
import java.util.Iterator;
import java.util.HashMap;
import java.util.Random;
+import java.util.Collections;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -144,6 +145,11 @@
throw new IdentityException("Property is not allowed for write access: " + propertyName);
}
+ if (!pi.getType().equals(propertyValue.getClass().getName()))
+ {
+ throw new IdentityException("Wrong property type. Must be: " + pi.getType() + "; and found: " + propertyValue.getClass().getName());
+ }
+
//if value is null reset property
dbUser.getProfileMap().put(propertyName, propertyValue);
@@ -169,7 +175,7 @@
String key = (String)iterator.next();
props.put(key, profile.get(key));
}
- return props;
+ return Collections.unmodifiableMap(props);
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/ProfileMapImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/ProfileMapImpl.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/ProfileMapImpl.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -171,7 +171,14 @@
else
{
Object oldValue = accessor.get(user);
- accessor.set(user, (String)newValue);
+ if (newValue != null)
+ {
+ accessor.set(user, newValue);
+ }
+ else
+ {
+ accessor.set(user, null);
+ }
return oldValue;
}
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserProfileModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserProfileModuleImpl.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserProfileModuleImpl.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -38,6 +38,8 @@
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Collection;
+import java.util.Collections;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
@@ -70,7 +72,7 @@
}
String attributeName = resolveAttributeName(propertyName);
- String propertyValue = null;
+ Object propertyValue = null;
if (attributeName == null)
{
@@ -86,7 +88,7 @@
if (attr != null)
{
- propertyValue = (String)attr.get();
+ propertyValue = attr.get();
}
else
{
@@ -98,6 +100,15 @@
throw new IdentityException("Cannot get user property value.", e);
}
+ PropertyInfo pi = getProfileInfo().getPropertyInfo(propertyName);
+
+
+ if (propertyValue != null && !pi.getType().equals(propertyValue.getClass().getName()))
+ {
+ log.error("Error on processing property:" + propertyName);
+ log.error("Wrong property type retreived from LDAP. Should be: " + pi.getType() + "; and found: " + propertyValue.getClass().getName());
+ }
+
return propertyValue;
}
@@ -126,9 +137,21 @@
String attributeName = resolveAttributeName(propertyName);
+ PropertyInfo pi = getProfileInfo().getPropertyInfo(propertyName);
+ if (pi.getAccessMode().equals(PropertyInfo.ACCESS_MODE_READ_ONLY))
+ {
+ throw new IdentityException("Property has read only access - cannot set: " + propertyName);
+ }
+
+ if (!pi.getType().equals(property.getClass().getName()))
+ {
+ throw new IdentityException("Wrong property type. Must be: " + pi.getType() + "; and found: " + property.getClass().getName());
+ }
+
+
//TODO: check the type and log.info that this can only be a String if not such
- String propertyValue = property.toString();
+ //String propertyValue = property.toString();
if (attributeName == null)
{
@@ -142,7 +165,7 @@
Attributes attrs = new BasicAttributes(true);
Attribute attr = new BasicAttribute(attributeName);
- attr.add(propertyValue);
+ attr.add(property);
attrs.put(attr);
getConnectionContext().createInitialContext().modifyAttributes(ldapUser.getDn(), DirContext.REPLACE_ATTRIBUTE,attrs);
@@ -177,6 +200,7 @@
try
{
Map mappings = resolveAttributesMappingMap();
+
Set props = mappings.keySet();
Attributes attrs = getConnectionContext().createInitialContext().getAttributes(ldapUser.getDn());
@@ -189,7 +213,13 @@
if (attr != null)
{
- propertyMap.put(name,(String)attr.get());
+ propertyMap.put(name,attr.get());
+ PropertyInfo pi = getProfileInfo().getPropertyInfo(name);
+ if (attr.get() != null && !pi.getType().equals(attr.get().getClass().getName()))
+ {
+ log.error("Error on processing property:" + name);
+ log.error("Wrong property type retreived from LDAP. Should be: " + pi.getType() + "; and found: " + attr.get().getClass().getName());
+ }
}
else
{
@@ -202,7 +232,7 @@
throw new IdentityException("Cannot get user property value.", e);
}
- return propertyMap;
+ return Collections.unmodifiableMap(propertyMap);
}
private String resolveAttributeName(String propertyName) throws IdentityException
@@ -276,4 +306,6 @@
return profileInfo;
}
+
+
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTest.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTest.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTest.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -8,6 +8,7 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.Role;
import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.ProfileMap;
import org.jboss.portal.common.util.CollectionBuilder;
import org.jboss.portal.common.p3p.P3PConstants;
@@ -17,6 +18,8 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
+import java.util.Date;
+import java.text.SimpleDateFormat;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -377,7 +380,7 @@
public void testDynamicProperty() throws Exception
{
ctx.begin();
- User user = userModule.createUser("testname", "testpassword");
+ /*User user = userModule.createUser("testname", "testpassword");
Map map = userProfileModule.getProperties(user);
assertNull(map.get("foo"));
//assertFalse(map.isReadOnly("foo"));
@@ -390,7 +393,7 @@
user = userModule.findUserByUserName("testname");
map = userProfileModule.getProperties(user);
assertEquals("value", map.get("foo"));
- //assertFalse(map.isReadOnly("foo"));
+ //assertFalse(map.isReadOnly("foo"));*/
ctx.commit();
}
@@ -401,71 +404,100 @@
//
User user = userModule.createUser("testname", "testpassword");
Map map = userProfileModule.getProperties(user);
- assertEquals("testname", map.get(P3PConstants.INFO_USER_NAME_NICKNAME));
+ //assertEquals("testname", map.get(P3PConstants.INFO_USER_NAME_NICKNAME));
- // Test cannot remove a static property
+ // Test cannot remove property
try
{
map.remove(P3PConstants.INFO_USER_NAME_GIVEN);
- fail("Should not be capable to remove static property");
+ fail("Should not be able to remove property from a map");
}
- catch (IllegalArgumentException expected)
+ catch (Exception expected)
{
}
- // Test read only property
+ /*// Test read only property
//assertTrue(map.isReadOnly(P3PConstants.INFO_USER_NAME_NICKNAME));
try
{
- map.put(P3PConstants.INFO_USER_NAME_NICKNAME, "anothername");
+ .put(P3PConstants.INFO_USER_NAME_NICKNAME, "anothername");
fail("Should not be capable to modify a read only static property");
}
catch (IllegalArgumentException expected)
{
- }
+ }*/
// Test non nullable and writable property
- try
+ /*try
{
map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, null);
fail("Should not be capable to nullify a non nullable static property");
}
catch (NullPointerException expected)
{
- }
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
- assertEquals("true", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
+ }*/
+ //map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
+ userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
+ assertEquals(Boolean.TRUE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
// Test boolean property
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "false");
- assertEquals("false", map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
- assertEquals("false", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
+ userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.FALSE);
+ //assertEquals(Boolean.FALSE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+ assertEquals(Boolean.FALSE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
- assertEquals("true", map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
- assertEquals("true", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
+ userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
+ //assertEquals(Boolean.TRUE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+ assertEquals(Boolean.TRUE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "false");
- assertEquals("false", map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
- assertEquals("false", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
+ userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.FALSE);
+ //assertEquals(Boolean.FALSE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+ assertEquals(Boolean.FALSE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
- assertEquals("true", map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
- assertEquals("true", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
+ userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
+ //assertEquals(Boolean.TRUE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+ assertEquals(Boolean.TRUE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
try
{
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "truee");
+ userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
fail("Should not be capable to set a bad value to boolean property");
}
- catch (IllegalArgumentException expected)
+ catch (Exception expected)
{
}
// Test date
- /*Date date = ((HibernateUserImpl)user).getRegistrationDate();
- SimpleDateFormat sdf = new SimpleDateFormat();
- assertEquals(sdf.format(date), map.get(User.INFO_USER_REGISTRATION_DATE));*/
+ //Date date = ((HibernateUserImpl)user.getRegistrationDate();
+ Date date = (Date)userProfileModule.getProperty(user, User.INFO_USER_REGISTRATION_DATE);
+
+ // property mapped as java.util.Date \
+ try
+ {
+ userProfileModule.setProperty(user, User.INFO_USER_REGISTRATION_DATE, new Date());
+ fail();
+ }
+ catch (IdentityException e)
+ {
+ // should fail on read-only property
+ }
+ //just to check the cast...
+ date = (Date)userProfileModule.getProperty(user, User.INFO_USER_REGISTRATION_DATE);
+
+ // properties mapped in ldap (if ldap module present and delegated)
+ userProfileModule.setProperty(user, User.INFO_USER_OCCUPATION, "portal developer");
+ String occup = (String)userProfileModule.getProperty(user, User.INFO_USER_OCCUPATION);
+ assertEquals("portal developer", occup);
+
+ userProfileModule.setProperty(user, User.INFO_USER_EMAIL_REAL, "dev(a)portal.com");
+ String email = (String)userProfileModule.getProperty(user, User.INFO_USER_EMAIL_REAL);
+ assertEquals("dev(a)portal.com", email);
+
+ //property mapped as java.lang.Boolean
+ userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
+
+ Boolean view = (Boolean)userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL);
+ assertEquals(Boolean.TRUE.toString(),view.toString());
+
ctx.commit();
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -28,6 +28,7 @@
import org.jboss.portal.identity.service.MembershipModuleService;
import org.jboss.portal.identity.service.RoleModuleService;
import org.jboss.portal.test.identity.UserTest;
+import org.jboss.portal.test.identity.IdentityTest;
import org.jboss.portal.common.p3p.P3PConstants;
import junit.framework.TestSuite;
@@ -82,10 +83,11 @@
this.userProfileModule = (UserProfileModuleService)identityContext.getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
//
- utc = new UserTest();
+ utc = new IdentityTest();
utc.setUserModule(userModule);
utc.setRoleModule(roleModule);
utc.setMembershipModule(membershipModule);
+ utc.setUserProfileModule(userProfileModule);
utc.setContext(this);
utc.populate();
}
@@ -184,76 +186,6 @@
public void testStaticProperty() throws Exception
{
- begin();
-
- //
- User user = userModule.createUser("testname", "testpassword");
- ProfileMap map = ((HibernateUserImpl)user).getProfileMap();
- assertEquals("testname", map.get(P3PConstants.INFO_USER_NAME_NICKNAME));
-
- // Test cannot remove a static property
- try
- {
- map.remove(P3PConstants.INFO_USER_NAME_GIVEN);
- fail("Should not be capable to remove static property");
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- // Test read only property
- assertTrue(map.isReadOnly(P3PConstants.INFO_USER_NAME_NICKNAME));
- try
- {
- map.put(P3PConstants.INFO_USER_NAME_NICKNAME, "anothername");
- fail("Should not be capable to modify a read only static property");
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- // Test non nullable and writable property
- try
- {
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, null);
- fail("Should not be capable to nullify a non nullable static property");
- }
- catch (NullPointerException expected)
- {
- }
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
- assertEquals("true", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
-
- // Test boolean property
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "false");
- assertEquals("false", map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
- assertEquals("false", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
-
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
- assertEquals("true", map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
- assertEquals("true", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
-
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "false");
- assertEquals("false", map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
- assertEquals("false", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
-
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
- assertEquals("true", map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
- assertEquals("true", userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL));
- try
- {
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "truee");
- fail("Should not be capable to set a bad value to boolean property");
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- // Test date
- Date date = ((HibernateUserImpl)user).getRegistrationDate();
- SimpleDateFormat sdf = new SimpleDateFormat();
- assertEquals(sdf.format(date), map.get(User.INFO_USER_REGISTRATION_DATE));
-
- commit();
+ utc.testStaticProperty();
}
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/db/DBTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/db/DBTestCase.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/db/DBTestCase.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -25,6 +25,7 @@
import org.jboss.portal.test.framework.embedded.HibernateSupport;
import org.jboss.portal.test.framework.TestRuntimeContext;
import org.jboss.portal.test.identity.UserTest;
+import org.jboss.portal.test.identity.IdentityTest;
import org.jboss.portal.common.test.junit.POJOJUnitTest;
import org.jboss.portal.common.test.junit.JUnitAdapter;
import org.jboss.portal.identity.IdentityContext;
@@ -47,7 +48,7 @@
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public abstract class DBTestCase extends junit.framework.TestCase implements UserTest.Context
+public abstract class DBTestCase extends junit.framework.TestCase implements IdentityTest.Context
{
static
@@ -93,7 +94,7 @@
protected IdentityContext identityContext;
/** . */
- protected UserTest utc;
+ protected IdentityTest utc;
/**
* .
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPIdentityTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPIdentityTestCase.java 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPIdentityTestCase.java 2007-02-14 19:24:58 UTC (rev 6280)
@@ -163,7 +163,7 @@
utc.testFindRoleMembers();
}
- /*public void testDynamicProperty() throws Exception
+ public void testDynamicProperty() throws Exception
{
utc.testDynamicProperty();
}
@@ -171,5 +171,5 @@
public void testStaticProperty() throws Exception
{
utc.testStaticProperty();
- }*/
+ }
}
Modified: trunk/identity/src/resources/test/config/profile-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/profile-config.xml 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/resources/test/config/profile-config.xml 2007-02-14 19:24:58 UTC (rev 6280)
@@ -103,8 +103,8 @@
</property>
<property>
<name>portal.user.registration-date</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
+ <type>java.util.Date</type>
+ <access-mode>read-only</access-mode>
<usage>mandatory</usage>
<display-name xml:lang="en">Registration date</display-name>
<description xml:lang="en">Registration date of user</description>
@@ -117,7 +117,7 @@
</property>
<property>
<name>portal.user.email.view-real</name>
- <type>java.lang.String</type>
+ <type>java.lang.Boolean</type>
<access-mode>read-write</access-mode>
<usage>mandatory</usage>
<display-name xml:lang="en">View real email</display-name>
@@ -131,7 +131,7 @@
</property>
<property>
<name>portal.user.enabled</name>
- <type>java.lang.String</type>
+ <type>java.lang.Boolean</type>
<access-mode>read-write</access-mode>
<usage>mandatory</usage>
<display-name xml:lang="en">Enabled</display-name>
@@ -196,7 +196,7 @@
<access-mode>read-write</access-mode>
<usage>optional</usage>
<display-name xml:lang="en">Signature</display-name>
- <description xml:lang="en">The user signature</description>
+ <description xml:lang="en">The user signature</description>
<mapping>
<database>
<type>dynamic</type>
Modified: trunk/identity/src/resources/test/config/standardidentity-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/standardidentity-config.xml 2007-02-14 19:16:55 UTC (rev 6279)
+++ trunk/identity/src/resources/test/config/standardidentity-config.xml 2007-02-14 19:24:58 UTC (rev 6280)
@@ -210,7 +210,7 @@
<option>
<name>sessionFactoryJNDIName</name>
<value>java:/portal/IdentitySessionFactory</value>
- </option> opends-config.xml
+ </option>
<option>
<name>jndiName</name>
<value>java:/portal/DBUserProfileModule</value>
19 years, 2 months
JBoss Portal SVN: r6279 - in docs/trunk/quickstartuser/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-02-14 14:16:55 -0500 (Wed, 14 Feb 2007)
New Revision: 6279
Modified:
docs/trunk/quickstartuser/en/images/image075.jpg
docs/trunk/quickstartuser/en/images/image076.jpg
docs/trunk/quickstartuser/en/images/image077.jpg
docs/trunk/quickstartuser/en/images/image078.jpg
docs/trunk/quickstartuser/en/images/image079.jpg
docs/trunk/quickstartuser/en/modules/interaction.xml
Log:
JBPORTAL-1114 - updating quickstart guide
Modified: docs/trunk/quickstartuser/en/images/image075.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image076.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image077.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image078.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image079.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/modules/interaction.xml
===================================================================
--- docs/trunk/quickstartuser/en/modules/interaction.xml 2007-02-14 17:51:19 UTC (rev 6278)
+++ docs/trunk/quickstartuser/en/modules/interaction.xml 2007-02-14 19:16:55 UTC (rev 6279)
@@ -17,7 +17,7 @@
<para>Each portlet in the portal page can be interacted with individually.
Let's interact with a couple of portlets, and see the results. Click on
- the minimize icon on the "Select a Portal Theme" portlet. The portlet is
+ the minimize icon on the "Greeting" portlet. The portlet is
then minimized (Figure 5):
<mediaobject>
<imageobject>
@@ -50,7 +50,7 @@
<sect1>
<title>User Creation</title>
- <para>Let's create a user for the portal. Click on the "create one" link
+ <para>Let's create a user for the portal. Click on the "You can create a new user" link
in the user portlet. The create user view now shows in the user portlet.
Enter the information as shown in Figure 10 (password is starter). Once
you have clicked "create new user", the default view will show (Figure
@@ -73,8 +73,7 @@
</imageobject>
<caption>
- <para>Figure 11. The default view in the user portlet
- maximized.</para>
+ <para>Figure 11. The default view after registering a new user.</para>
</caption>
</mediaobject>
</para>
@@ -83,8 +82,7 @@
<sect1>
<title>Administrator Login</title>
- <para>Click on the resize button to make the user portlet shrink back to
- normal size. Now, click "Standard login". The login page will show (Figure
+ <para>Now, click "Login". The login page will show (Figure
12). Log in with username and password of "admin"
<mediaobject>
<imageobject>
19 years, 2 months
JBoss Portal SVN: r6277 - in docs/trunk/quickstartuser/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-02-14 12:12:30 -0500 (Wed, 14 Feb 2007)
New Revision: 6277
Modified:
docs/trunk/quickstartuser/en/images/default_ss.gif
docs/trunk/quickstartuser/en/images/image006.jpg
docs/trunk/quickstartuser/en/modules/deployportlet.xml
docs/trunk/quickstartuser/en/modules/forward.xml
docs/trunk/quickstartuser/en/modules/installation.xml
docs/trunk/quickstartuser/en/modules/interaction.xml
Log:
JBPORTAL-1114 - updating quickstart guide
Modified: docs/trunk/quickstartuser/en/images/default_ss.gif
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/images/image006.jpg
===================================================================
(Binary files differ)
Modified: docs/trunk/quickstartuser/en/modules/deployportlet.xml
===================================================================
--- docs/trunk/quickstartuser/en/modules/deployportlet.xml 2007-02-14 16:19:54 UTC (rev 6276)
+++ docs/trunk/quickstartuser/en/modules/deployportlet.xml 2007-02-14 17:12:30 UTC (rev 6277)
@@ -50,7 +50,7 @@
<caption><para>Figure 50. Download dialog.</para></caption>
</mediaobject> This zip file contains both the binary and the source for
the portlet. Open the zip and extract the flash.war file. Place this file in
- the jboss-portal-2.4\server\default\deploy directory. The console for the
+ the $JBOSS_HOME\server\default\deploy directory. The console for the
JBoss Portal will show the portlet being deployed (Figure 51). <mediaobject>
<imageobject>
<imagedata align="center" fileref="images/image066.jpg" format="JPG"
Modified: docs/trunk/quickstartuser/en/modules/forward.xml
===================================================================
--- docs/trunk/quickstartuser/en/modules/forward.xml 2007-02-14 16:19:54 UTC (rev 6276)
+++ docs/trunk/quickstartuser/en/modules/forward.xml 2007-02-14 17:12:30 UTC (rev 6277)
@@ -55,7 +55,7 @@
</listitem>
<listitem>
- This guide was created with JBoss Portal 2.4. This guide is expected to be forward compatible with future versions of Portal (although the screenshots may vary slightly).
+ This guide was created with JBoss Portal 2.6. This guide is expected to be forward compatible with future versions of Portal (although the screenshots may vary slightly).
</listitem>
<listitem>
Modified: docs/trunk/quickstartuser/en/modules/installation.xml
===================================================================
--- docs/trunk/quickstartuser/en/modules/installation.xml 2007-02-14 16:19:54 UTC (rev 6276)
+++ docs/trunk/quickstartuser/en/modules/installation.xml 2007-02-14 17:12:30 UTC (rev 6277)
@@ -31,7 +31,7 @@
to get it: <ulink
url="http://sourceforge.net/projects/sevenzip/">http://sourceforge.net/projects/sevenzip</ulink>
). Once you have unzipped it, you should have a directory structure with
- the following folders under, jboss-portal-2.4-bundled: <itemizedlist>
+ the following folders under, jboss-portal-2.6-bundled: <itemizedlist>
<listitem>
Modified: docs/trunk/quickstartuser/en/modules/interaction.xml
===================================================================
--- docs/trunk/quickstartuser/en/modules/interaction.xml 2007-02-14 16:19:54 UTC (rev 6276)
+++ docs/trunk/quickstartuser/en/modules/interaction.xml 2007-02-14 17:12:30 UTC (rev 6277)
@@ -149,7 +149,7 @@
</mediaobject>
<note>
Please use the quickstart.zip for the batch upload. You may also download it from
- <ulink url="http://docs.jboss.org/jbportal/v2.4/quickstartuser/en/quickstart.zip">here</ulink>
+ <ulink url="http://docs.jboss.org/jbportal/v2.6/quickstartuser/en/quickstart.zip">here</ulink>
.
</note>
We can choose the destination folder for the upload (the current
19 years, 2 months
JBoss Portal SVN: r6276 - in docs/trunk: referenceGuide/en and 1 other directories.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-02-14 11:19:54 -0500 (Wed, 14 Feb 2007)
New Revision: 6276
Modified:
docs/trunk/quickstartuser/en/master.xml
docs/trunk/referenceGuide/en/master.xml
docs/trunk/userGuide/en/master.xml
Log:
version change
Modified: docs/trunk/quickstartuser/en/master.xml
===================================================================
--- docs/trunk/quickstartuser/en/master.xml 2007-02-14 15:14:11 UTC (rev 6275)
+++ docs/trunk/quickstartuser/en/master.xml 2007-02-14 16:19:54 UTC (rev 6276)
@@ -1,58 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../docbook-support/support/docbook-dtd/docbookx.dtd" [
-<!ENTITY overview SYSTEM "modules/overview.xml">
-<!ENTITY forward SYSTEM "modules/forward.xml">
-<!ENTITY installation SYSTEM "modules/installation.xml">
-<!ENTITY portalterminology SYSTEM "modules/portalterminology.xml">
-<!ENTITY interaction SYSTEM "modules/interaction.xml">
-<!ENTITY deployportlet SYSTEM "modules/deployportlet.xml">
-<!ENTITY fin SYSTEM "modules/fin.xml">
-]>
+ "../../docbook-support/support/docbook-dtd/docbookx.dtd" [
+ <!ENTITY overview SYSTEM "modules/overview.xml">
+ <!ENTITY forward SYSTEM "modules/forward.xml">
+ <!ENTITY installation SYSTEM "modules/installation.xml">
+ <!ENTITY portalterminology SYSTEM "modules/portalterminology.xml">
+ <!ENTITY interaction SYSTEM "modules/interaction.xml">
+ <!ENTITY deployportlet SYSTEM "modules/deployportlet.xml">
+ <!ENTITY fin SYSTEM "modules/fin.xml">
+ ]>
<book lang="en">
- <bookinfo>
- <title>JBoss Portal 2.4</title>
+ <bookinfo>
+ <title>JBoss Portal 2.6Beta1</title>
- <subtitle>Quickstart User Guide</subtitle>
+ <subtitle>Quickstart User Guide</subtitle>
- <releaseinfo></releaseinfo>
+ <releaseinfo>Release 2.6Beta1 "Ninja"</releaseinfo>
+ <releaseinfo>February 2007</releaseinfo>
- <author>
- <firstname>Kevin</firstname>
+ <author>
+ <firstname>Kevin</firstname>
- <surname>Barfield</surname>
+ <surname>Barfield</surname>
- <email>kevin.barfield(a)jboss.com</email>
- </author>
- </bookinfo>
+ <email>kevin.barfield(a)jboss.com</email>
+ </author>
+ </bookinfo>
- <toc></toc>
+ <toc></toc>
- <!-- portal overview - marketing stuff -->
+ <!-- portal overview - marketing stuff -->
- &overview;
+ &overview;
- <!-- forward -->
+ <!-- forward -->
- &forward;
+ &forward;
- <!-- installation -->
+ <!-- installation -->
- &installation;
+ &installation;
- <!-- Portal terminology -->
+ <!-- Portal terminology -->
- &portalterminology;
+ &portalterminology;
- <!-- Interacting with the portal -->
+ <!-- Interacting with the portal -->
- &interaction;
+ &interaction;
- <!-- portletswap deployment -->
+ <!-- portletswap deployment -->
- &deployportlet;
+ &deployportlet;
- <!-- end -->
+ <!-- end -->
- &fin;
+ &fin;
</book>
\ No newline at end of file
Modified: docs/trunk/referenceGuide/en/master.xml
===================================================================
--- docs/trunk/referenceGuide/en/master.xml 2007-02-14 15:14:11 UTC (rev 6275)
+++ docs/trunk/referenceGuide/en/master.xml 2007-02-14 16:19:54 UTC (rev 6276)
@@ -26,9 +26,9 @@
]>
<book lang="en">
<bookinfo>
- <title>JBoss Portal 2.6Alpha2</title>
+ <title>JBoss Portal 2.6Beta1</title>
<subtitle>Reference Guide</subtitle>
- <releaseinfo>Release 2.6Alpha2 "Ninja"</releaseinfo>
+ <releaseinfo>Release 2.6Beta1 "Ninja"</releaseinfo>
<releaseinfo>February 2007</releaseinfo>
<author>
<firstname>Thomas</firstname>
Modified: docs/trunk/userGuide/en/master.xml
===================================================================
--- docs/trunk/userGuide/en/master.xml 2007-02-14 15:14:11 UTC (rev 6275)
+++ docs/trunk/userGuide/en/master.xml 2007-02-14 16:19:54 UTC (rev 6276)
@@ -13,9 +13,9 @@
]>
<book lang="en">
<bookinfo>
- <title>JBoss Portal 2.6Alpha2</title>
+ <title>JBoss Portal 2.6Beta1</title>
<subtitle>User Guide</subtitle>
- <releaseinfo>Release 2.6Alpha2 "Ninja"</releaseinfo>
+ <releaseinfo>Release 2.6Beta1 "Ninja"</releaseinfo>
<releaseinfo>February 2007</releaseinfo>
<author>
<firstname>Roy</firstname>
19 years, 2 months
JBoss Portal SVN: r6275 - branches/JBoss_Portal_Branch_2_4/server/src/main/org/jboss/portal/server/deployment.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-14 10:14:11 -0500 (Wed, 14 Feb 2007)
New Revision: 6275
Modified:
branches/JBoss_Portal_Branch_2_4/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java
Log:
JBPORTAL-1214 : Use the same URL key for the map of web app to deployed portlet applications
Modified: branches/JBoss_Portal_Branch_2_4/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java 2007-02-14 15:14:02 UTC (rev 6274)
+++ branches/JBoss_Portal_Branch_2_4/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java 2007-02-14 15:14:11 UTC (rev 6275)
@@ -96,6 +96,23 @@
return new ArrayList(deployments.keySet());
}
+ private WebApplication findWebApp(DeploymentInfo info) throws Exception
+ {
+ // Get all the deployed web applications, our must be among these
+ Iterator iterator = (Iterator)server.getAttribute(interceptedDeployer, "DeployedApplications");
+ while (iterator.hasNext())
+ {
+ WebApplication webApp = (WebApplication)iterator.next();
+ if (info == webApp.getDeploymentInfo())
+ {
+ return webApp;
+ }
+ }
+
+ // Not found
+ return null;
+ }
+
/** Only take care of start notifications. */
public void handleNotification(Notification notification, Object handback)
{
@@ -118,31 +135,27 @@
// Create the portal web app
DeploymentInfo info = (DeploymentInfo)notification.getUserData();
+ //
+ URL keyURL = info.url;
+
+ //
if (start)
{
- // Get all the deployed web applications, our must be among these
- Iterator iterator = (Iterator)server.getAttribute(interceptedDeployer, "DeployedApplications");
- while (iterator.hasNext())
- {
- WebApplication webApp = (WebApplication)iterator.next();
- if (info == webApp.getDeploymentInfo())
- {
- PortalWebApp pwa = factory.create(webApp);
- URL url = info.url;
- deployments.put(url, pwa);
- log.debug("Seen URL " + url + " about to deploy");
- deploy(pwa);
- }
- }
+ WebApplication webApp = findWebApp(info);
+ PortalWebApp pwa = factory.create(webApp);
+ deployments.put(keyURL, pwa);
+ log.debug("Seen URL " + keyURL + " about to deploy");
+ deploy(pwa);
}
if (stop)
{
// Look if we have something for that url
- PortalWebApp pwa = (PortalWebApp)deployments.remove(info.url);
+ PortalWebApp pwa = (PortalWebApp)deployments.remove(keyURL);
// Notify
if (pwa != null)
{
+ log.debug("Undeploying URL " + keyURL);
undeploy(pwa);
}
}
@@ -180,11 +193,12 @@
while (iterator.hasNext())
{
WebApplication webApp = (WebApplication)iterator.next();
- if (!deployments.containsKey(webApp.getURL()))
+ URL keyURL = webApp.getDeploymentInfo().url;
+ if (!deployments.containsKey(keyURL))
{
PortalWebApp pwa = factory.create(webApp);
- deployments.put(pwa.getURL(), pwa);
- log.debug("Seen URL " + pwa.getURL() + " about to deploy");
+ deployments.put(keyURL, pwa);
+ log.debug("Seen URL " + keyURL + " about to deploy");
deploy(pwa);
}
}
@@ -202,11 +216,13 @@
if (currentInterceptedDeployer != null)
{
// Remove all previously deployed applications
- for (Iterator i = deployments.values().iterator(); i.hasNext();)
+ for (Iterator i = deployments.entrySet().iterator(); i.hasNext();)
{
- PortalWebApp pwa = (PortalWebApp)i.next();
+ Map.Entry entry = (Map.Entry)i.next();
+ URL keyURL = (URL)entry.getKey();
+ PortalWebApp pwa = (PortalWebApp)entry.getValue();
i.remove();
- log.debug("Removing URL " + pwa.getURL());
+ log.debug("Removing URL " + keyURL);
undeploy(pwa);
}
19 years, 2 months
JBoss Portal SVN: r6274 - trunk/core/src/bin/portal-core-war/themes/maple.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-14 10:14:02 -0500 (Wed, 14 Feb 2007)
New Revision: 6274
Modified:
trunk/core/src/bin/portal-core-war/themes/maple/portal_style.css
Log:
King of CSS:
* Fixed: Theme Maple contains image that removes dashboard navigation links [JBPORTAL-1236]
* Fixed, sub-navigation pages are now just below the page name...
(more to fix, the content background doesn't fill up all the height of the page on Firefox at least)
Modified: trunk/core/src/bin/portal-core-war/themes/maple/portal_style.css
===================================================================
--- trunk/core/src/bin/portal-core-war/themes/maple/portal_style.css 2007-02-14 14:59:51 UTC (rev 6273)
+++ trunk/core/src/bin/portal-core-war/themes/maple/portal_style.css 2007-02-14 15:14:02 UTC (rev 6274)
@@ -76,6 +76,7 @@
/* wrapper for entire portal. starts/ends after/before body tag */
#portal-container {
+ height: 100%;
margin: 4px 9% 0 9%; /* part of below IE hack to preserve min-width for portlet regions */
padding: 0 400px 0 400px;
}
@@ -85,11 +86,13 @@
margin: 0 -400px 0 -400px;
position: relative;
min-width: 804px;
+ height: 100%;
}
/* min width hack for IE */
#sizer {
width: 100%;
+ height: 100%;
}
/* IE Hack \*/
@@ -240,14 +243,20 @@
}
UL#tabsHeader li {
+ display: inline;
list-style: none;
float: left;
margin-left: 0px;
margin-top: 100px;
margin-right: 0px;
+ position: relative;
+ top: 0px;
padding-left: 5px;
padding-right: 5px;
+ white-space: nowrap;
+}
+UL#tabsHeader li {
}
UL#tabsHeader li:hover {
@@ -299,6 +308,7 @@
background-repeat: no-repeat;
}
+
/* Begin Submenu selectors */
/* hide the sub levels and give them a positon absolute so that they take up no room */
@@ -383,9 +393,9 @@
*****************************/
#dashboardnav {
- float: right;
- font-size: 10px;
- padding: 6px 12px 0px 0px;
+ float: left;
+ font-size: 12px;
+ padding: 6px 12px;
color: #FFFFFF;
z-index: 20;
}
19 years, 2 months