JBoss Portal SVN: r7328 - trunk/identity/src/resources/example.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-24 10:26:46 -0400 (Thu, 24 May 2007)
New Revision: 7328
Modified:
trunk/identity/src/resources/example/portal-sample-local2.ldif
Log:
updated ldif for tests
Modified: trunk/identity/src/resources/example/portal-sample-local2.ldif
===================================================================
--- trunk/identity/src/resources/example/portal-sample-local2.ldif 2007-05-24 14:21:31 UTC (rev 7327)
+++ trunk/identity/src/resources/example/portal-sample-local2.ldif 2007-05-24 14:26:46 UTC (rev 7328)
@@ -151,7 +151,7 @@
dn: ou=People2,o=test,dc=portal,dc=example,dc=com
objectclass: top
objectclass: organizationalUnit
-ou: People
+ou: People2
dn: uid=user21,ou=People2,o=test,dc=portal,dc=example,dc=com
objectclass: top
@@ -176,7 +176,7 @@
dn: ou=People3,o=test,dc=portal,dc=example,dc=com
objectclass: top
objectclass: organizationalUnit
-ou: People
+ou: People3
dn: uid=user31,ou=People3,o=test,dc=portal,dc=example,dc=com
objectclass: top
@@ -201,7 +201,7 @@
dn: ou=People4,o=test,dc=portal,dc=example,dc=com
objectclass: top
objectclass: organizationalUnit
-ou: People
+ou: People4
dn: uid=user41,ou=People4,o=test,dc=portal,dc=example,dc=com
objectclass: top
@@ -222,3 +222,70 @@
sn: Portal User
userPassword: user42
mail: email(a)email.com
+
+dn: ou=Roles2,o=test,dc=portal,dc=example,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles2
+
+dn: cn=User2,ou=Roles2,o=test,dc=portal,dc=example,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: User2
+description: Portal user role
+member: uid=admin,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=user,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke1,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke2,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke3,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke4,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=user21,ou=People2,o=test,dc=portal,dc=example,dc=com
+member: uid=user22,ou=People2,o=test,dc=portal,dc=example,dc=com
+member: uid=user31,ou=People3,o=test,dc=portal,dc=example,dc=com
+member: uid=user32,ou=People3,o=test,dc=portal,dc=example,dc=com
+
+dn: ou=Roles3,o=test,dc=portal,dc=example,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles3
+
+dn: cn=User3,ou=Roles3,o=test,dc=portal,dc=example,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: User3
+description: Portal user role
+member: uid=admin,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=user,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke1,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke2,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke3,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke4,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=user21,ou=People2,o=test,dc=portal,dc=example,dc=com
+member: uid=user22,ou=People2,o=test,dc=portal,dc=example,dc=com
+member: uid=user31,ou=People3,o=test,dc=portal,dc=example,dc=com
+member: uid=user32,ou=People3,o=test,dc=portal,dc=example,dc=com
+
+dn: ou=Roles4,o=test,dc=portal,dc=example,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles4
+
+dn: cn=User4,ou=Roles4,o=test,dc=portal,dc=example,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: User4
+description: Portal user role
+member: uid=admin,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=user,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke1,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke2,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke3,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=jduke4,ou=People,o=test,dc=portal,dc=example,dc=com
+member: uid=user21,ou=People2,o=test,dc=portal,dc=example,dc=com
+member: uid=user22,ou=People2,o=test,dc=portal,dc=example,dc=com
+member: uid=user31,ou=People3,o=test,dc=portal,dc=example,dc=com
+member: uid=user32,ou=People3,o=test,dc=portal,dc=example,dc=com
+
18 years, 11 months
JBoss Portal SVN: r7327 - trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-24 10:21:31 -0400 (Thu, 24 May 2007)
New Revision: 7327
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml
Log:
Alignement with other tables
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml 2007-05-24 14:09:20 UTC (rev 7326)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml 2007-05-24 14:21:31 UTC (rev 7327)
@@ -7,18 +7,23 @@
<h:form>
<table>
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Roles</th>
+ <th>Permissions</th>
+ </tr>
+ </thead>
<tbody>
<c:forEach items="#{auth.roles}" var="role" varStatus="status">
- <tr>
+ <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
<td>
<h:outputLabel for="cars_#{status.index}">
- <span class="portlet-form-field-label">Role <span>#{role == '__unchecked__' ? 'Unchecked' : (auth.roleDisplayNameMap[role] != null ? auth.roleDisplayNameMap[role] : role)}</span></span>:
+ Role #{role == '__unchecked__' ? 'Unchecked' : (auth.roleDisplayNameMap[role] != null ? auth.roleDisplayNameMap[role] : role)}:
</h:outputLabel>
</td>
<td>
<h:selectManyCheckbox
id="cars_#{status.index}"
- styleClass="portlet-form-field"
value="#{auth.forRole[role]}"
layout="lineDirection">
<f:selectItems value="#{auth.availableActions}"/>
18 years, 11 months
JBoss Portal SVN: r7326 - trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-24 10:09:20 -0400 (Thu, 24 May 2007)
New Revision: 7326
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
Log:
JBPORTAL-1410: The text box to create a page, and the drop-down list below it should be left aligned in the same column.
JBPORTAL-1411: The text box for creating a nested page, and the drop-down list for the default page should be left aligned in the same column.
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-05-24 13:46:12 UTC (rev 7325)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-05-24 14:09:20 UTC (rev 7326)
@@ -30,31 +30,46 @@
</h:commandLink>
</h:form>
+
+
<!-- Sub page addition -->
<div style="padding:1em 0 0 0">
- <h:form id="addPageForm">
- <span class="portlet-font">Create a page:</span>
- <span style="padding:1em 0 1em 0">
- <h:inputText id="pageName" value="#{addPageAction.pageName}" styleClass="portlet-form-input-field" required="true"/>
- <h:commandButton action="#{addPageAction.execute}" value="Add" styleClass="portlet-form-button"/>
- <h:message for="pageName" errorClass="portlet-msg-error"/>
- </span>
- </h:form>
+ <table>
+ <tr>
+ <h:form>
+ <td>
+ <span class="portlet-font">Create a page:</span>
+ </td>
+ <td>
+ <h:inputText id="pageName" value="#{addPageAction.pageName}" styleClass="portlet-form-input-field" required="true"/>
+ </td>
+ <td>
+ <h:commandButton action="#{addPageAction.execute}" value="Add" styleClass="portlet-form-button"/>
+ </td>
+ <td>
+ <h:message for="pageName" errorClass="portlet-msg-error"/>
+ </td>
+ </h:form>
+ </tr>
+ <!-- Default page -->
+ <tr>
+ <h:form>
+ <td>
+ <span class="portlet-font">Default page:</span>
+ </td>
+ <td>
+ <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultPageName}">
+ <f:selectItems value="#{portalobjectmgr.portalPageItems}" />
+ </h:selectOneMenu>
+ </td>
+ <td colspan="2">
+ <h:commandButton styleClass="portlet-form-button" value="Update" action="objects"/>
+ </td>
+ </h:form>
+ </tr>
+ </table>
</div>
- <!-- Default page -->
- <div style="padding:1em 0 0 0">
- <h:form>
- <span class="portlet-font">Default page:</span>
- <span style="padding:1em 0 1em 0">
- <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultPageName}">
- <f:selectItems value="#{portalobjectmgr.portalPageItems}" />
- </h:selectOneMenu>
- <h:commandButton styleClass="portlet-form-button" value="Update" action="objects"/>
- </span>
- </h:form>
- </div>
-
18 years, 11 months
JBoss Portal SVN: r7325 - trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-24 09:46:12 -0400 (Thu, 24 May 2007)
New Revision: 7325
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
Log:
JBPORTAL-1445: The "Destroy" screen should show the tabs similar to the other screens in the management portlet.
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-05-24 13:17:54 UTC (rev 7324)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-05-24 13:46:12 UTC (rev 7325)
@@ -7,29 +7,13 @@
xmlns:c="http://java.sun.com/jstl/core"
class="admin-ui">
- <p class="portlet-msg-alert">WARNING ! You are about to delete the following element of the portal:</p>
- <ul class="objectpath">
- <c:forEach items="#{portalobjectmgr.selectedObjectPath}" var="node">
- <li>
- >
- </li>
- <c:choose>
- <c:when test="#{node.id == portalobjectmgr.selectedObject.id}">
- <li class="selected">
- <c:if test="#{node.name == ''}">root</c:if>
- <c:if test="#{node.name != ''}">#{node.name}</c:if>
- </li>
- </c:when>
- <c:otherwise>
- <li>
- <c:if test="#{node.name == ''}">root</c:if>
- <c:if test="#{node.name != ''}">#{node.name}</c:if>
- </li>
- </c:otherwise>
- </c:choose>
- </c:forEach>
- </ul>
+ <ui:composition template="../objectTemplate.xhtml">
+ <ui:define name="content">
+
+
+ <p class="portlet-msg-alert">WARNING ! You are about to delete this element from the portal !</p>
+
<p class="portlet-class">Are you sure ?</p>
<h:form>
@@ -38,4 +22,9 @@
</h:commandButton>
<h:commandButton value="No" action="objects" actionListener="objects" styleClass="portlet-form-button"/>
</h:form>
+
+ </ui:define>
+
+ </ui:composition>
+
</div>
\ No newline at end of file
18 years, 11 months
JBoss Portal SVN: r7324 - trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-24 09:17:54 -0400 (Thu, 24 May 2007)
New Revision: 7324
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
Log:
JBPORTAL-1425: In Step 2 "Select Portal", the "Previous" button should have the same padding as the "Next" button.
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2007-05-24 13:07:28 UTC (rev 7323)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2007-05-24 13:17:54 UTC (rev 7324)
@@ -161,7 +161,7 @@
<h:form>
<h:commandButton rendered="#{newWindowWizard.currentStep gt 0}" value="Previous"
action="#{newWindowWizard.previous}" styleClass="portlet-form-button"/>
- <h:commandButton disabled="#{!newWindowWizard.enabled[newWindowWizard.currentStep + 1]}" rendered="#{newWindowWizard.currentStep lt 4}"
+ <h:commandButton rendered="#{newWindowWizard.currentStep lt 4 and newWindowWizard.enabled[newWindowWizard.currentStep + 1]}"
value="Next" action="#{newWindowWizard.next}" styleClass="portlet-form-button"/>
</h:form>
</div>
18 years, 11 months
JBoss Portal SVN: r7323 - trunk/identity/src/main/org/jboss/portal/identity/ldap.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-24 09:07:28 -0400 (Thu, 24 May 2007)
New Revision: 7323
Modified:
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticGroupMembershipModuleImpl.java
Log:
added multiply search contexts for LDAPExtRoleModuleImpl
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java 2007-05-24 12:54:26 UTC (rev 7322)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java 2007-05-24 13:07:28 UTC (rev 7323)
@@ -24,6 +24,7 @@
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.IdentityConfiguration;
import org.jboss.portal.common.util.Tools;
import javax.naming.NamingEnumeration;
@@ -36,6 +37,8 @@
import java.util.NoSuchElementException;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.Enumeration;
+import java.util.LinkedList;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -62,8 +65,8 @@
Object[] filterArgs = {name};
- NamingEnumeration results = searchRoles(filter, filterArgs);
- List sr = Tools.toList(results);
+
+ List sr = searchRoles(filter, filterArgs);
if (sr.size() > 1)
{
throw new IdentityException("Found more than one role with id: " + name + "" +
@@ -110,8 +113,8 @@
}
filter.append(")");
- NamingEnumeration results = searchRoles(filter.toString(), null);
- List sr = Tools.toList(results);
+ List sr = searchRoles(filter.toString(), null);
+
log.debug("Roles found: " + sr.size());
for (Iterator iterator = sr.iterator(); iterator.hasNext();)
{
@@ -149,8 +152,7 @@
filter = filter.replaceAll("\\{0\\}", "*");
log.debug("Search filter: " + filter);
- NamingEnumeration results = searchRoles(filter, null);
- List sr = Tools.toList(results);
+ List sr = searchRoles(filter, null);
return sr.size();
@@ -177,10 +179,11 @@
filter = filter.replaceAll("\\{0\\}", "*");
log.debug("Search filter: " + filter);
- NamingEnumeration results = searchRoles(filter, null);
- while (results.hasMoreElements())
+ List results = searchRoles(filter, null);
+ Iterator iter = results.iterator();
+ while (iter.hasNext())
{
- SearchResult res = (SearchResult)results.nextElement();
+ SearchResult res = (SearchResult)iter.next();
DirContext ctx = (DirContext)res.getObject();
rf.add(createRoleInstance(res.getAttributes(),ctx.getNameInNamespace()));
}
@@ -203,7 +206,7 @@
* @param filter that will be concatenated with proper user search filter from the module
* @return
*/
- public NamingEnumeration searchRoles(String filter, Object[] filterArgs) throws NamingException, IdentityException
+ public List searchRoles(String filter, Object[] filterArgs) throws NamingException, IdentityException
{
SearchControls controls = new SearchControls();
controls.setSearchScope(getSearchScope());
@@ -221,13 +224,57 @@
}
log.debug("Search ctx: " + getRoleCtxDN());
- if (filterArgs == null)
+ Set roleCtxs = getRoleSearchCtxDNs();
+
+ if (roleCtxs.size() == 1)
{
- return getConnectionContext().createInitialContext().search(getRoleCtxDN(), filter, controls);
+ Enumeration results = null;
+ if (filterArgs == null)
+ {
+ results = getConnectionContext().createInitialContext().search(getRoleCtxDN(), filter, controls);
+ }
+ else
+ {
+ results = getConnectionContext().createInitialContext().search(getRoleCtxDN(), filter, filterArgs, controls);
+ }
+ return Tools.toList(results);
+
+
}
else
{
- return getConnectionContext().createInitialContext().search(getRoleCtxDN(), filter, filterArgs, controls);
+ List merged = new LinkedList();
+
+ for (Iterator iterator = roleCtxs.iterator(); iterator.hasNext();)
+ {
+ String roleCtx = (String)iterator.next();
+ Enumeration results = null;
+ if (filterArgs == null)
+ {
+ results = getConnectionContext().createInitialContext().search(roleCtx, filter, controls);
+ }
+ else
+ {
+ results = getConnectionContext().createInitialContext().search(roleCtx, filter, filterArgs, controls);
+ }
+ merged.addAll(Tools.toList(results));
+ }
+
+ return merged;
}
}
+
+
+ protected Set getRoleSearchCtxDNs() throws IdentityException
+ {
+ Set searchCtx = getIdentityConfiguration().getValues(IdentityConfiguration.GROUP_COMMON, IdentityConfiguration.ROLE_CONTEXT_DN);
+ if (searchCtx == null || searchCtx.size() == 0)
+ {
+ throw new IdentityException(IdentityConfiguration.USER_CONTEXT_DN + " missing in configuration");
+ }
+ else
+ {
+ return searchCtx;
+ }
+ }
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java 2007-05-24 12:54:26 UTC (rev 7322)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java 2007-05-24 13:07:28 UTC (rev 7323)
@@ -36,6 +36,7 @@
import javax.naming.NamingEnumeration;
import javax.naming.InitialContext;
import java.util.NoSuchElementException;
+import java.util.List;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
@@ -165,7 +166,7 @@
* @param filter that will be concatenated with proper role search filter from the module
* @return
*/
- public abstract NamingEnumeration searchRoles(String filter, Object[] filterArgs) throws NamingException, IdentityException;
+ public abstract List searchRoles(String filter, Object[] filterArgs) throws NamingException, IdentityException;
//**************************
//*** Getter and Setters
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java 2007-05-24 12:54:26 UTC (rev 7322)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java 2007-05-24 13:07:28 UTC (rev 7323)
@@ -46,6 +46,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Iterator;
+import java.util.Enumeration;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -70,9 +71,7 @@
String filter = "(".concat(getRidAttributeID()).concat("=").concat(name).concat(")");
log.debug("Search filter: " + filter);
-
- NamingEnumeration results = searchRoles(filter, null);
- List sr = Tools.toList(results);
+ List sr = searchRoles(filter, null);
if (sr.size() > 1)
{
throw new IdentityException("Found more than one role with id: " + name + "" +
@@ -117,8 +116,7 @@
}
filter.append(")");
- NamingEnumeration results = searchRoles(filter.toString(), null);
- List sr = Tools.toList(results);
+ List sr = searchRoles(filter.toString(), null);
log.debug("Roles found: " + sr.size());
for (Iterator iterator = sr.iterator(); iterator.hasNext();)
{
@@ -248,8 +246,7 @@
String filter = getRidAttributeID().concat("=").concat("*");
log.debug("Search filter: " + filter);
- NamingEnumeration results = searchRoles(filter, null);
- List sr = Tools.toList(results);
+ List sr = searchRoles(filter, null);
return sr.size();
@@ -274,10 +271,11 @@
String filter = "(".concat(getRidAttributeID()).concat("=").concat("*").concat(")");
log.debug("Search filter: " + filter);
- NamingEnumeration results = searchRoles(filter, null);
- while (results.hasMoreElements())
+ List results = searchRoles(filter, null);
+ Iterator iter = results.iterator();
+ while (iter.hasNext())
{
- SearchResult res = (SearchResult)results.nextElement();
+ SearchResult res = (SearchResult)iter.next();
DirContext ctx = (DirContext)res.getObject();
rf.add(createRoleInstance(res.getAttributes(),ctx.getNameInNamespace()));
}
@@ -300,7 +298,7 @@
* @param filter that will be concatenated with proper role search filter from the module
* @return
*/
- public NamingEnumeration searchRoles(String filter, Object[] filterArgs) throws NamingException, IdentityException
+ public List searchRoles(String filter, Object[] filterArgs) throws NamingException, IdentityException
{
SearchControls controls = new SearchControls();
controls.setSearchScope(SearchControls.ONELEVEL_SCOPE);
@@ -309,14 +307,16 @@
//String filter = getUidAttributeID().concat("=").concat(userName);
log.debug("Search filter: " + filter);
+ Enumeration results = null;
if (filterArgs == null)
{
- return getConnectionContext().createInitialContext().search(getContainerDN(), filter, controls);
+ results = getConnectionContext().createInitialContext().search(getContainerDN(), filter, controls);
}
else
{
- return getConnectionContext().createInitialContext().search(getContainerDN(), filter, filterArgs, controls);
+ results = getConnectionContext().createInitialContext().search(getContainerDN(), filter, filterArgs, controls);
}
+ return Tools.toList(results);
}
private Map getAttributesToAdd() throws IdentityException
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticGroupMembershipModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticGroupMembershipModuleImpl.java 2007-05-24 12:54:26 UTC (rev 7322)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticGroupMembershipModuleImpl.java 2007-05-24 13:07:28 UTC (rev 7323)
@@ -92,8 +92,7 @@
String filter = getMemberAttributeID().concat("=").concat(memberName);
log.debug("Search filter: " + filter);
- NamingEnumeration results = getRoleModule().searchRoles(filter, null);
- List sr = Tools.toList(results);
+ List sr = getRoleModule().searchRoles(filter, null);
for (Iterator iterator = sr.iterator(); iterator.hasNext();)
@@ -331,8 +330,7 @@
String filter = getMemberAttributeID().concat("=").concat(memberName);
log.debug("Search filter: " + filter);
- NamingEnumeration results = getRoleModule().searchRoles(filter, null);
- List sr = Tools.toList(results);
+ List sr = getRoleModule().searchRoles(filter, null);
//iterate over roles that contain a user
for (Iterator iterator = sr.iterator(); iterator.hasNext();)
{
18 years, 11 months
JBoss Portal SVN: r7322 - in trunk: core/src/main/org/jboss/portal/core/aspects/controller and 11 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-24 08:54:26 -0400 (Thu, 24 May 2007)
New Revision: 7322
Added:
trunk/common/src/main/org/jboss/portal/common/util/CollectionMap.java
trunk/common/src/main/org/jboss/portal/common/util/ListMap.java
Modified:
trunk/common/src/main/org/jboss/portal/common/util/SetMap.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/render/RenderPortletInstanceCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/MoveWindowCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
trunk/theme/src/main/org/jboss/portal/test/theme/DynaTestContext.java
trunk/theme/src/main/org/jboss/portal/test/theme/model/WindowObject.java
trunk/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java
trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyRegionRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java
trunk/theme/src/main/org/jboss/portal/theme/page/Region.java
trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRendererContext.java
Log:
JBPORTAL-1463 : Dashboard window moving is inconsistent
Added: trunk/common/src/main/org/jboss/portal/common/util/CollectionMap.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/CollectionMap.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/util/CollectionMap.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -0,0 +1,181 @@
+/******************************************************************************
+ * 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.common.util;
+
+import java.util.Map;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Set;
+import java.io.Serializable;
+
+/**
+ * A map of collections.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class CollectionMap implements Serializable
+{
+
+ /** The underlying map. */
+ protected Map map;
+
+ public CollectionMap()
+ {
+ init(null);
+ }
+
+ public CollectionMap(SetMap other) throws IllegalArgumentException
+ {
+ if (other == null)
+ {
+ throw new IllegalArgumentException("Cannot copy null argument");
+ }
+ init(other);
+ }
+
+ /**
+ * Add an object in the set keyed under the specified key.
+ */
+ public void put(Object key, Object o)
+ {
+ Collection collection = (Collection)map.get(key);
+ if (collection == null)
+ {
+ collection = newCollection();
+ map.put(key, collection);
+ }
+ add(collection, o);
+ }
+
+ /**
+ * Return the set of keys.
+ */
+ public Set keySet()
+ {
+ return map.keySet();
+ }
+
+ /**
+ * Remove the entire set of objects specified by the key.
+ */
+ public void remove(Object key)
+ {
+ map.remove(key);
+ }
+
+ /**
+ * Remove an object in the set keyed under the specified key.
+ */
+ public void remove(Object key, Object o)
+ {
+ Collection collection = (Collection)map.get(key);
+ if (collection != null)
+ {
+ remove(collection, o);
+ if (collection.isEmpty())
+ {
+ map.remove(key);
+ }
+ }
+ }
+
+ /**
+ * Return true if the specified set contains the object o.
+ */
+ public boolean contains(Object key, Object o)
+ {
+ Collection collection = (Collection)map.get(key);
+ if (collection == null)
+ {
+ return false;
+ }
+ else
+ {
+ return collection.contains(o);
+ }
+ }
+
+ /**
+ * Return an iterator over the values in the set specified by the key.
+ */
+ public Iterator iterator(final Object key)
+ {
+ Collection set = (Collection)map.get(key);
+ if (set == null)
+ {
+ return Collections.EMPTY_SET.iterator();
+ }
+ else
+ {
+ final Iterator iterator = set.iterator();
+ return new Iterator()
+ {
+ public boolean hasNext()
+ {
+ return iterator.hasNext();
+ }
+ public Object next()
+ {
+ return iterator.next();
+ }
+ public void remove()
+ {
+ iterator.remove();
+ if (!iterator.hasNext())
+ {
+ map.remove(key);
+ }
+ }
+ };
+ }
+ }
+
+ private void init(CollectionMap other)
+ {
+ //
+ this.map = new HashMap();
+
+ //
+ if (other != null)
+ {
+ for (Iterator i = other.map.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ Object key = entry.getKey();
+ Collection value = (Collection)entry.getValue();
+ map.put(key, newCollection(value));
+ }
+ }
+ }
+
+ protected abstract void add(Collection c, Object o);
+
+ protected abstract void remove(Collection c, Object o);
+
+ protected abstract Collection newCollection();
+
+ protected abstract Collection newCollection(Collection other);
+}
Added: trunk/common/src/main/org/jboss/portal/common/util/ListMap.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/ListMap.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/util/ListMap.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -0,0 +1,109 @@
+/******************************************************************************
+ * 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.common.util;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ListMap extends CollectionMap
+{
+
+ /** An optional comparator. */
+ protected Comparator comparator;
+
+ public ListMap()
+ {
+ }
+
+ public ListMap(SetMap other) throws IllegalArgumentException
+ {
+ super(other);
+ }
+
+ public ListMap(SetMap other, Comparator comparator) throws IllegalArgumentException
+ {
+ super(other);
+
+ //
+ if (comparator == null)
+ {
+ throw new IllegalArgumentException("No null comparator allowed");
+ }
+
+ //
+ this.comparator = comparator;
+ }
+
+ public ListMap(Comparator comparator)
+ {
+ super();
+
+ //
+ if (comparator == null)
+ {
+ throw new IllegalArgumentException("No null comparator allowed");
+ }
+
+ //
+ this.comparator = comparator;
+ }
+
+ protected void add(Collection c, Object o)
+ {
+ c.add(o);
+
+ //
+ if (comparator != null)
+ {
+ Collections.sort((List)c, comparator);
+ }
+ }
+
+ protected void remove(Collection c, Object o)
+ {
+ c.remove(o);
+
+ //
+ if (comparator != null)
+ {
+ Collections.sort((List)c, comparator);
+ }
+ }
+
+ protected Collection newCollection()
+ {
+ return new ArrayList();
+ }
+
+ protected Collection newCollection(Collection other)
+ {
+ return new ArrayList(other);
+ }
+}
Modified: trunk/common/src/main/org/jboss/portal/common/util/SetMap.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/SetMap.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/common/src/main/org/jboss/portal/common/util/SetMap.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -22,16 +22,12 @@
******************************************************************************/
package org.jboss.portal.common.util;
-import java.util.Collections;
-import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
import java.util.Set;
import java.util.Comparator;
import java.util.TreeSet;
import java.util.SortedSet;
-import java.io.Serializable;
+import java.util.Collection;
/**
* A map of set. This object does not handle synchronization and use HashMap and HashSet
@@ -40,122 +36,53 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class SetMap implements Serializable
+public class SetMap extends CollectionMap
{
/** Version. */
static final long serialVersionUID = -7239767000556095977L;
- /** The underlying map. */
- protected Map map;
-
/** An optional comparator. */
protected Comparator comparator;
public SetMap()
{
- init(null, null);
}
public SetMap(SetMap other) throws IllegalArgumentException
{
- if (other == null)
- {
- throw new IllegalArgumentException("Cannot copy null argument");
- }
- init(other, null);
+ super(other);
}
- /**
- * Copy constructor.
- *
- * @throws IllegalArgumentException if the argument is null
- */
public SetMap(SetMap other, Comparator comparator) throws IllegalArgumentException
{
- if (other == null)
- {
- throw new IllegalArgumentException("Cannot copy null argument");
- }
+ super(other);
+
+ //
if (comparator == null)
{
throw new IllegalArgumentException("No null comparator allowed");
}
- init(other, comparator);
+
+ //
+ this.comparator = comparator;
}
public SetMap(Comparator comparator)
{
+ super();
+
+ //
if (comparator == null)
{
throw new IllegalArgumentException("No null comparator allowed");
}
- init(null, comparator);
- }
- /**
- * Add an object in the set keyed under the specified key.
- */
- public void put(Object key, Object o)
- {
- Set set = (Set)map.get(key);
- if (set == null)
- {
- set = newSet();
- map.put(key, set);
- }
- set.add(o);
+ //
+ this.comparator = comparator;
}
/**
- * Return the set of keys.
- */
- public Set keySet()
- {
- return map.keySet();
- }
-
- /**
- * Remove the entire set of objects specified by the key.
- */
- public void remove(Object key)
- {
- map.remove(key);
- }
-
- /**
- * Remove an object in the set keyed under the specified key.
- */
- public void remove(Object key, Object o)
- {
- Set set = (Set)map.get(key);
- if (set != null)
- {
- set.remove(o);
- if (set.isEmpty())
- {
- map.remove(key);
- }
- }
- }
-
- /**
- * Return true if the specified set contains the object o.
- */
- public boolean contains(Object key, Object o)
- {
- Set set = (Set)map.get(key);
- if (set == null)
- {
- return false;
- }
- else
- {
- return set.contains(o);
- }
- }
-
- /**
* Return the set specified by the key.
*/
public Set get(Object key)
@@ -163,61 +90,17 @@
return (Set)map.get(key);
}
- /**
- * Return an iterator over the values in the set specified by the key.
- */
- public Iterator iterator(final Object key)
+ protected void add(Collection c, Object o)
{
- Set set = (Set)map.get(key);
- if (set == null)
- {
- return Collections.EMPTY_SET.iterator();
- }
- else
- {
- final Iterator iterator = set.iterator();
- return new Iterator()
- {
- public boolean hasNext()
- {
- return iterator.hasNext();
- }
- public Object next()
- {
- return iterator.next();
- }
- public void remove()
- {
- iterator.remove();
- if (!iterator.hasNext())
- {
- map.remove(key);
- }
- }
- };
- }
+ c.add(o);
}
- private void init(SetMap other, Comparator comparator)
+ protected void remove(Collection c, Object o)
{
- //
- this.map = new HashMap();
- this.comparator = comparator;
-
- //
- if (other != null)
- {
- for (Iterator i = other.map.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- Object key = entry.getKey();
- Set value = (Set)entry.getValue();
- map.put(key, newSet(value));
- }
- }
+ c.remove(o);
}
- private Set newSet()
+ protected Collection newCollection()
{
if (comparator == null)
{
@@ -229,7 +112,7 @@
}
}
- private Set newSet(Set other)
+ protected Collection newCollection(Collection other)
{
if (comparator == null)
{
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -139,7 +139,7 @@
windowProps.put(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER, "emptyRenderer");
windowProps.put(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER, "emptyRenderer");
WindowResult res = new WindowResult("", tabbedNav, Collections.EMPTY_MAP, windowProps, null, WindowState.NORMAL, Mode.VIEW);
- WindowContext blah = new WindowContext("BLAH", "navigation", 0, res);
+ WindowContext blah = new WindowContext("BLAH", "navigation", "0", res);
rendition.getPageResult().addWindowContext(blah);
//
@@ -157,7 +157,7 @@
windowProps.put(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER, "emptyRenderer");
windowProps.put(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER, "emptyRenderer");
WindowResult res = new WindowResult("", dashboardNav, Collections.EMPTY_MAP, windowProps, null, WindowState.NORMAL, Mode.VIEW);
- WindowContext bluh = new WindowContext("BLUH", "dashboardnav", 0, res);
+ WindowContext bluh = new WindowContext("BLUH", "dashboardnav", "0", res);
rendition.getPageResult().addWindowContext(bluh);
//
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -301,7 +301,7 @@
WindowContext wc = new WindowContext(
_window.getId().toString(PortalObjectPath.LEGACY_BASE64_FORMAT),
_window.getProperty(ThemeConstants.PORTAL_PROP_REGION),
- 0,
+ "0",
windowResult);
//
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/command/render/RenderPortletInstanceCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/command/render/RenderPortletInstanceCommand.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/command/render/RenderPortletInstanceCommand.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -114,7 +114,7 @@
//
WindowResult res = new WindowResult("", content, Collections.EMPTY_MAP, windowProps, header, WindowState.MAXIMIZED, Mode.VIEW);
- WindowContext blah = new WindowContext("BILTO", "maximized", 0, res);
+ WindowContext blah = new WindowContext("BILTO", "maximized", "0", res);
result.addWindowContext(blah);
//
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/MoveWindowCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/MoveWindowCommand.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/MoveWindowCommand.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -31,8 +31,11 @@
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.command.WindowCommand;
import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.ThemeTools;
+import org.jboss.portal.common.util.ListMap;
import java.util.Iterator;
+import java.util.Comparator;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -73,72 +76,100 @@
public ControllerResponse execute() throws ControllerException
{
-
- // For now just update the navigational state of the page
-// PageNavigationalState pns = (PageNavigationalState)getContext().getAttribute(NAVIGATIONAL_STATE_SCOPE, page.getId());
-
- //
-/*
- for (Iterator i = pns.getWindowContexts().iterator(); i.hasNext();)
+ if (isDashboard())
{
- WindowContext windowCtx = (WindowContext)i.next();
- String windowRegion = windowCtx.getRegionName();
- if (targetId.equals(windowCtx.getId()))
+ // First relayout all windows correctly except the target window
+ ListMap blah = new ListMap(tmp);
+ for (Iterator i = page.getChildren(PortalObject.WINDOW_MASK).iterator(); i.hasNext();)
{
- windowCtx.setRegionName(toRegion);
- windowCtx.setOrder(toPos);
+ Window window = (Window)i.next();
+ if (window != target)
+ {
+ String region = window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION);
+ if (region != null)
+ {
+ blah.put(region, window);
+ }
+ }
}
- else if (fromRegion.equals(windowRegion) && fromPos < windowCtx.getOrder())
+
+ //
+ for (Iterator i = blah.keySet().iterator();i.hasNext();)
{
- windowCtx.setOrder(windowCtx.getOrder() - 1);
- }
- else if (toRegion.equals(windowRegion) && toPos <= windowCtx.getOrder())
- {
- windowCtx.setOrder(windowCtx.getOrder() + 1);
- }
- }
-*/
+ String key = (String)i.next();
- //
- if (isDashboard())
- {
- for (Iterator i = page.getChildren().iterator(); i.hasNext();)
- {
- PortalObject child = (PortalObject)i.next();
- if (child.getType() == PortalObject.TYPE_WINDOW)
+ //
+ boolean processFrom = key.equals(fromRegion);
+ boolean processTo = key.equals(toRegion);
+
+ //
+ if (!processFrom && !processTo)
{
- Window window = (Window)child;
- PortalObjectId windowId = window.getId();
- String regionId = window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION);
- String posAsString = window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER);
- if (regionId != null && posAsString != null)
+ int order = 0;
+ for (Iterator j = blah.iterator(key);j.hasNext();)
{
- try
+ Window window = (Window)j.next();
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, Integer.toString(order++));
+ }
+ }
+ else
+ {
+ if (processFrom)
+ {
+ int order = 0;
+ for (Iterator j = blah.iterator(key);j.hasNext();)
{
- int pos = Integer.parseInt(posAsString);
- if (targetId.equals(windowId))
+ Window window = (Window)j.next();
+
+ //
+ if (window == target)
{
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, toRegion);
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, Integer.toString(toPos));
+ order --;
}
- else if (fromRegion.equals(regionId) && fromPos < pos)
+ else
{
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, Integer.toString(toPos - 1));
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, Integer.toString(order++));
}
- else if (toRegion.equals(regionId) && toPos <= pos)
+ }
+ }
+ if (processTo)
+ {
+ int order = 0;
+ for (Iterator j = blah.iterator(key);j.hasNext();)
+ {
+ Window window = (Window)j.next();
+
+ //
+ if (order == toPos)
{
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, Integer.toString(toPos + 1));
+ order++;
}
+
+ //
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, Integer.toString(order++));
}
- catch (NumberFormatException e)
- {
- }
}
}
}
+
+ //
+ target.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, toRegion);
+ target.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, Integer.toString(toPos));
}
//
return null;
}
+
+ private static final Comparator tmp = new Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ Window window1 = (Window)o1;
+ Window window2 = (Window)o2;
+ String order1 = window1.getDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER);
+ String order2 = window2.getDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER);
+ return ThemeTools.compareWindowOrder(order1, window1.getName(), order2, window2.getName());
+ }
+ };
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -218,7 +218,7 @@
WindowContext wc = new WindowContext(
window.getId().toString(PortalObjectPath.LEGACY_BASE64_FORMAT),
region,
- Integer.parseInt(order),
+ order,
result);
pageResult.addWindowContext(wc);
}
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/DynaTestContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/DynaTestContext.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/DynaTestContext.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -336,7 +336,7 @@
"",
wrc.getWindowState(),
wrc.getMode());
- WindowContext wc = new WindowContext(wrc.getId(), rrc.getId(), j.getIndex(), wr);
+ WindowContext wc = new WindowContext(wrc.getId(), rrc.getId(), Integer.toString(j.getIndex()), wr);
result.addWindowContext(wc);
}
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/model/WindowObject.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/model/WindowObject.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/model/WindowObject.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.test.theme.model;
-import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
import org.jboss.portal.theme.render.renderer.PortletRendererContext;
@@ -109,13 +108,13 @@
return id;
}
- public int getOrder()
+ public String getOrder()
{
for (IteratorStatus i = new IteratorStatus(region.windows.values().iterator());i.hasNext();)
{
if (this == i.next())
{
- return i.getIndex();
+ return Integer.toString(i.getIndex());
}
}
throw new IllegalStateException("Should not happen");
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -148,7 +148,7 @@
String title = "WindowA_" + i + " Title";
String content = "<p>WindowA_" + i + " Content</p>";
- WindowContext wCtx = new WindowContext("WindowA_" + i, "left", i, createWindowMarkup(title, content));
+ WindowContext wCtx = new WindowContext("WindowA_" + i, "left", "" + i, createWindowMarkup(title, content));
pageResult.addWindowContext(wCtx);
markupResult = createWindowMarkup(title, content);
@@ -161,7 +161,7 @@
String title = "WindowB_" + i + " Title";
String content = "<p>WindowB_" + i + " Content</p>";
- WindowContext wCtx = new WindowContext("WindowB_" + i, "center", i, createWindowMarkup(title, content));
+ WindowContext wCtx = new WindowContext("WindowB_" + i, "center", "" + i, createWindowMarkup(title, content));
pageResult.addWindowContext(wCtx);
markupResult = createWindowMarkup(title, content);
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -133,7 +133,7 @@
//
pageResult.setLayoutState("maximized");
wc.setRegionName("maximized");
- wc.setOrder(0);
+ wc.setOrder("0");
// Yes it is ugly
pageResult.rebuild();
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyRegionRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyRegionRenderer.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/empty/EmptyRegionRenderer.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -31,8 +31,6 @@
import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
/**
* Implementation of a Region renderer that creates no markup, and only passes control to the Portlet renderer of the
@@ -61,18 +59,8 @@
/** @see RegionRenderer#renderBody */
public void renderBody(RendererContext rendererContext, RegionRendererContext rrc) throws RenderException
{
- Map orderedItems = new TreeMap();
-
- //
for (Iterator i = rrc.getWindows().iterator(); i.hasNext();)
{
- WindowRendererContext window = (WindowRendererContext)i.next();
- orderedItems.put(new Integer(window.getOrder()), window);
- }
-
- //
- for (Iterator i = orderedItems.values().iterator(); i.hasNext();)
- {
WindowRendererContext wrc = (WindowRendererContext)i.next();
rendererContext.render(wrc);
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -31,7 +31,6 @@
import java.util.Set;
import java.util.Collection;
import java.util.Iterator;
-import java.util.Collections;
/**
* Interface to represent the read only information of a rendered portal page. <p>The page result allows access to all
@@ -168,23 +167,6 @@
region.addWindowContext(windowContext);
}
- public WindowContext addWindow(String regionName, String windowId, String windowName, WindowResult window)
- {
- int order = 0;
-
- //
- Region region = getRegion2(regionName);
- if (region != null)
- {
- order = region.getWindows().size();
- }
-
- //
- WindowContext windowCtx = new WindowContext(windowId, regionName, order, window);
- addWindowContext(windowCtx);
- return windowCtx;
- }
-
// PageRenderContext implementation *********************************************************************************
public String getProperty(String name)
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/Region.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/Region.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/Region.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -25,12 +25,12 @@
import org.jboss.portal.theme.render.renderer.RegionRendererContext;
import org.jboss.portal.theme.Orientation;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.Collection;
+import java.util.List;
+import java.util.ArrayList;
/**
* A region on a page. <p>A region wraps one or more portlets to allow them to act as one unit inside the layout of a
@@ -49,12 +49,9 @@
private final PageResult page;
/** . */
- private boolean sorted;
+ final List windows;
/** . */
- final ArrayList windows;
-
- /** . */
private Map properties;
/**
@@ -68,7 +65,6 @@
this.page = page;
this.name = name;
this.windows = new ArrayList();
- this.sorted = false;
this.properties = new HashMap();
}
@@ -80,7 +76,7 @@
/** @return if there are any portlet windows in this region */
public boolean isEmpty()
{
- return windows == null || windows.isEmpty();
+ return windows.isEmpty();
}
/**
@@ -90,8 +86,8 @@
*/
void addWindowContext(WindowContext windowContext)
{
- sorted = false;
windows.add(windowContext);
+ Collections.sort(windows);
}
public String toString()
@@ -118,15 +114,10 @@
public Collection getWindows()
{
- if (windows == null)
+ if (windows.isEmpty())
{
return Collections.EMPTY_LIST;
}
- if (!sorted)
- {
- Collections.sort(windows);
- sorted = true;
- }
return Collections.unmodifiableList(windows);
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -25,6 +25,7 @@
import org.jboss.portal.theme.render.renderer.WindowRendererContext;
import org.jboss.portal.theme.render.renderer.DecorationRendererContext;
import org.jboss.portal.theme.render.renderer.PortletRendererContext;
+import org.jboss.portal.theme.ThemeTools;
import org.jboss.portal.WindowState;
import org.jboss.portal.Mode;
@@ -61,12 +62,12 @@
private String regionName;
/** . */
- private int order;
+ private String order;
/** . */
final WindowResult result;
- public WindowContext(String id, String regionName, int order, WindowResult result)
+ public WindowContext(String id, String regionName, String order, WindowResult result)
{
this.id = id;
this.regionName = regionName;
@@ -79,7 +80,7 @@
return id;
}
- public int getOrder()
+ public String getOrder()
{
return order;
}
@@ -124,7 +125,7 @@
this.regionName = regionName;
}
- public void setOrder(int order)
+ public void setOrder(String order)
{
this.order = order;
}
@@ -136,7 +137,8 @@
public int compareTo(Object o)
{
- return order - ((WindowContext)o).order;
+ WindowContext that = (WindowContext)o;
+ return ThemeTools.compareWindowOrder(this.order, this.id, that.order, that.id);
}
public boolean equals(Object o)
Modified: trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRendererContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRendererContext.java 2007-05-24 12:41:21 UTC (rev 7321)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/renderer/WindowRendererContext.java 2007-05-24 12:54:26 UTC (rev 7322)
@@ -35,7 +35,7 @@
String getId();
- int getOrder();
+ String getOrder();
WindowState getWindowState();
18 years, 11 months
JBoss Portal SVN: r7321 - trunk/identity/src/main/org/jboss/portal/identity/ldap.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-24 08:41:21 -0400 (Thu, 24 May 2007)
New Revision: 7321
Modified:
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
Log:
small code cleanup
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2007-05-24 12:23:33 UTC (rev 7320)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2007-05-24 12:41:21 UTC (rev 7321)
@@ -242,13 +242,12 @@
if (filterArgs == null)
{
results = getConnectionContext().createInitialContext().search(getUserSearchCtxDN(), filter, controls);
- return Tools.toList(results);
}
else
{
results = getConnectionContext().createInitialContext().search(getUserSearchCtxDN(), filter, filterArgs, controls);
- return Tools.toList(results);
}
+ return Tools.toList(results);
}
@@ -263,14 +262,12 @@
if (filterArgs == null)
{
results = getConnectionContext().createInitialContext().search(userCtx, filter, controls);
- merged.addAll(Tools.toList(results));
-
}
else
{
results = getConnectionContext().createInitialContext().search(userCtx, filter, filterArgs, controls);
- merged.addAll(Tools.toList(results));
}
+ merged.addAll(Tools.toList(results));
}
return merged;
18 years, 11 months
JBoss Portal SVN: r7320 - trunk/core-admin/src/main/org/jboss/portal/core/admin/ui.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-24 08:23:33 -0400 (Thu, 24 May 2007)
New Revision: 7320
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
Log:
JBPORTAL-1414: Clicking the "Select" button should change the screen back to the Portlet Window List screen.
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-05-24 10:01:38 UTC (rev 7319)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-05-24 12:23:33 UTC (rev 7320)
@@ -22,6 +22,22 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+
import org.jboss.portal.core.admin.ui.actions.AddPageAction;
import org.jboss.portal.core.admin.ui.common.PageManagerBean;
import org.jboss.portal.core.admin.ui.portlet.PortletDefinitionInvoker;
@@ -35,9 +51,9 @@
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
import org.jboss.portal.core.model.portal.PortalObjectPermission;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.PortalObjectPath;
import org.jboss.portal.faces.component.portlet.PortletActionEvent;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.portlet.PortletInvoker;
@@ -47,21 +63,6 @@
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.ThemeService;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-import javax.faces.model.SelectItem;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
/** The portal object manager bean. */
public class PortalObjectManagerBean implements Serializable, AddPageAction.Listener
{
@@ -543,6 +544,7 @@
{
Window window = (Window)po;
window.getContent().setURI(uri);
+ selectParentObject();
break;
}
}
18 years, 11 months
JBoss Portal SVN: r7319 - trunk/core/src/main/org/jboss/portlet/content.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-24 06:01:38 -0400 (Thu, 24 May 2007)
New Revision: 7319
Modified:
trunk/core/src/main/org/jboss/portlet/content/ContentTypeRegistration.java
Log:
Cleaning
Modified: trunk/core/src/main/org/jboss/portlet/content/ContentTypeRegistration.java
===================================================================
--- trunk/core/src/main/org/jboss/portlet/content/ContentTypeRegistration.java 2007-05-24 08:56:01 UTC (rev 7318)
+++ trunk/core/src/main/org/jboss/portlet/content/ContentTypeRegistration.java 2007-05-24 10:01:38 UTC (rev 7319)
@@ -26,12 +26,8 @@
import java.util.List;
import javax.management.Attribute;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-import javax.management.ReflectionException;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
@@ -41,7 +37,6 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.portal.Mode;
import org.jboss.portal.core.impl.model.content.InternalContentProviderRegistry;
-import org.jboss.portal.core.impl.model.content.generic.GenericContentProviderRegistry;
import org.jboss.portal.core.impl.model.content.generic.InternalGenericContentProvider;
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
18 years, 11 months