JBoss Portal SVN: r6094 - trunk/identity/src/main/org/jboss/portal/test/identity/ldap.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-01-24 19:22:24 -0500 (Wed, 24 Jan 2007)
New Revision: 6094
Modified:
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java
Log:
- correct ldap DNs assertions in testcases to be not case sensitive
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java 2007-01-24 23:57:02 UTC (rev 6093)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java 2007-01-25 00:22:24 UTC (rev 6094)
@@ -93,11 +93,11 @@
for (Iterator iterator = users.iterator(); iterator.hasNext();)
{
LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn());
+ names.add(user.getDn().toLowerCase());
}
- assertTrue(names.contains("uid=jduke1,ou=People," + suffix));
- assertTrue(names.contains("uid=jduke3,ou=People," + suffix));
- assertTrue(names.contains("uid=jduke4,ou=People," + suffix));
+ assertTrue(names.contains(("uid=jduke1,ou=People," + suffix).toLowerCase()));
+ assertTrue(names.contains(("uid=jduke3,ou=People," + suffix).toLowerCase()));
+ assertTrue(names.contains(("uid=jduke4,ou=People," + suffix).toLowerCase()));
}
//TODO:extend this
@@ -112,9 +112,9 @@
for (Iterator iterator = roles.iterator(); iterator.hasNext();)
{
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn());
+ roleNames.add(role.getDn().toLowerCase());
}
- assertTrue(roleNames.contains("cn=Echo,ou=Roles," + suffix));
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
user = (LDAPUserImpl)userModule.findUserByUserName("jduke3");
roles = membershipModule.getRoles(user);
@@ -125,10 +125,10 @@
for (Iterator iterator = roles.iterator(); iterator.hasNext();)
{
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn());
+ roleNames.add(role.getDn().toLowerCase());
}
- assertTrue(roleNames.contains("cn=Echo,ou=Roles," + suffix));
- assertTrue(roleNames.contains("cn=Echo1,ou=Roles," + suffix));
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
}
@@ -151,11 +151,11 @@
for (Iterator iterator = users.iterator(); iterator.hasNext();)
{
LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn());
+ names.add(user.getDn().toLowerCase());
}
- assertTrue(names.contains("uid=jduke1,ou=People," + suffix));
- assertTrue(names.contains("uid=jduke4,ou=People," + suffix));
+ assertTrue(names.contains(("uid=jduke1,ou=People," + suffix).toLowerCase()));
+ assertTrue(names.contains(("uid=jduke4,ou=People," + suffix).toLowerCase()));
}
@@ -177,11 +177,11 @@
for (Iterator iterator = users.iterator(); iterator.hasNext();)
{
LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn());
+ names.add(user.getDn().toLowerCase());
}
- assertTrue(names.contains("uid=jduke3,ou=People," + suffix));
- assertTrue(names.contains("uid=jduke4,ou=People," + suffix));
+ assertTrue(names.contains(("uid=jduke3,ou=People," + suffix).toLowerCase()));
+ assertTrue(names.contains(("uid=jduke4,ou=People," + suffix).toLowerCase()));
/*membershipModule.assignUsers(role,new HashSet());
users = membershipModule.getUsers(role);
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java 2007-01-24 23:57:02 UTC (rev 6093)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java 2007-01-25 00:22:24 UTC (rev 6094)
@@ -117,11 +117,11 @@
for (Iterator iterator = users.iterator(); iterator.hasNext();)
{
LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn());
+ names.add(user.getDn().toLowerCase());
}
- assertTrue(names.contains("uid=jduke,ou=People,o=example2," + suffix));
- assertTrue(names.contains("uid=jduke1,ou=People,o=example2," + suffix));
- assertTrue(names.contains("uid=jduke2,ou=People,o=example2," + suffix));
+ assertTrue(names.contains(("uid=jduke,ou=People,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains(("uid=jduke1,ou=People,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains(("uid=jduke2,ou=People,o=example2," + suffix).toLowerCase()));
role = (LDAPRoleImpl)roleModule.findRoleByName("Echo1");
users = membershipModule.getUsers(role);
@@ -132,10 +132,10 @@
for (Iterator iterator = users.iterator(); iterator.hasNext();)
{
LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn());
+ names.add(user.getDn().toLowerCase());
}
- assertTrue(names.contains("uid=jduke1,ou=People,o=example2," + suffix));
- assertTrue(names.contains("uid=jduke2,ou=People,o=example2," + suffix));
+ assertTrue(names.contains(("uid=jduke1,ou=People,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains(("uid=jduke2,ou=People,o=example2," + suffix).toLowerCase()));
role = (LDAPRoleImpl)roleModule.findRoleByName("TheDuke");
users = membershipModule.getUsers(role);
@@ -146,9 +146,9 @@
for (Iterator iterator = users.iterator(); iterator.hasNext();)
{
LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn());
+ names.add(user.getDn().toLowerCase());
}
- assertTrue(names.contains("uid=jduke2,ou=People,o=example2," + suffix));
+ assertTrue(names.contains(("uid=jduke2,ou=People,o=example2," + suffix).toLowerCase()));
role = (LDAPRoleImpl)roleModule.findRoleByName("EmptyRole");
users = membershipModule.getUsers(role);
@@ -168,9 +168,9 @@
for (Iterator iterator = roles.iterator(); iterator.hasNext();)
{
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn());
+ roleNames.add(role.getDn().toLowerCase());
}
- assertTrue(roleNames.contains("cn=Echo,ou=Roles,o=example2," + suffix));
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
user = (LDAPUserImpl)userModule.findUserByUserName("jduke1");
roles = membershipModule.getRoles(user);
@@ -181,10 +181,10 @@
for (Iterator iterator = roles.iterator(); iterator.hasNext();)
{
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn());
+ roleNames.add(role.getDn().toLowerCase());
}
- assertTrue(roleNames.contains("cn=Echo,ou=Roles,o=example2," + suffix));
- assertTrue(roleNames.contains("cn=Echo1,ou=Roles,o=example2," + suffix));
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles,o=example2," + suffix).toLowerCase()));
user = (LDAPUserImpl)userModule.findUserByUserName("jduke2");
roles = membershipModule.getRoles(user);
@@ -197,9 +197,9 @@
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
roleNames.add(role.getDn());
}
- assertTrue(roleNames.contains("cn=Echo,ou=Roles,o=example2," + suffix));
- assertTrue(roleNames.contains("cn=Echo1,ou=Roles,o=example2," + suffix));
- assertTrue(roleNames.contains("cn=TheDuke,ou=Roles,o=example2," + suffix));
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=TheDuke,ou=Roles,o=example2," + suffix).toLowerCase()));
user = (LDAPUserImpl)userModule.findUserByUserName("jduke3");
roles = membershipModule.getRoles(user);
@@ -228,11 +228,11 @@
for (Iterator iterator = roles.iterator(); iterator.hasNext();)
{
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- names.add(role.getDn());
+ names.add(role.getDn().toLowerCase());
}
- assertTrue(names.contains("cn=Echo,ou=Roles,o=example2," + suffix));
- assertTrue(names.contains("cn=TheDuke,ou=Roles,o=example2," + suffix));
+ assertTrue(names.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains(("cn=TheDuke,ou=Roles,o=example2," + suffix).toLowerCase()));
roles = membershipModule.getRoles(user1);
@@ -243,11 +243,11 @@
for (Iterator iterator = roles.iterator(); iterator.hasNext();)
{
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- names.add(role.getDn());
+ names.add(role.getDn().toLowerCase());
}
- assertTrue(names.contains("cn=Echo,ou=Roles,o=example2," + suffix));
- assertTrue(names.contains("cn=TheDuke,ou=Roles,o=example2," + suffix));
+ assertTrue(names.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains(("cn=TheDuke,ou=Roles,o=example2," + suffix).toLowerCase()));
membershipModule.assignRoles(user1,new HashSet());
roles = membershipModule.getRoles(user1);
@@ -275,11 +275,11 @@
for (Iterator iterator = users.iterator(); iterator.hasNext();)
{
LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn());
+ names.add(user.getDn().toLowerCase());
}
- assertTrue(names.contains("uid=jduke3,ou=People,o=example2," + suffix));
- assertTrue(names.contains("uid=jduke4,ou=People,o=example2," + suffix));
+ assertTrue(names.contains(("uid=jduke3,ou=People,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains(("uid=jduke4,ou=People,o=example2," + suffix).toLowerCase()));
membershipModule.assignUsers(role,new HashSet());
users = membershipModule.getUsers(role);
17 years, 4 months
JBoss Portal SVN: r6093 - in trunk: core/src/resources/portal-core-sar/conf/identity and 6 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-01-24 18:57:02 -0500 (Wed, 24 Jan 2007)
New Revision: 6093
Modified:
trunk/core/src/resources/portal-core-sar/conf/identity/ldap_identity-config.xml
trunk/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml
trunk/core/src/resources/portal-core-sar/conf/login-config.xml
trunk/identity/build.xml
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java
trunk/identity/src/resources/test/config/msad-config.xml
trunk/identity/src/resources/test/config/opends-config.xml
trunk/identity/src/resources/test/config/openldap-config.xml
trunk/identity/src/resources/test/config/rhds-config.xml
trunk/identity/src/resources/test/config/standardidentity-config.xml
trunk/test/src/etc/directories.xml
trunk/test/src/etc/ldap/ldif/initial-tests-qa-msad.ldif
Log:
- added MSAD into testsuite (still not all tests pass)
- minor bugs correction
Modified: trunk/core/src/resources/portal-core-sar/conf/identity/ldap_identity-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/identity/ldap_identity-config.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/core/src/resources/portal-core-sar/conf/identity/ldap_identity-config.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -125,5 +125,19 @@
<value>none</value>
</option>
</option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+ <value>uid=dummynonexistinguser,ou=People,dc=jboss,dc=org</value>
+ </option>
+ </option-group>
</options>
</identity-configuration>
\ No newline at end of file
Modified: trunk/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -333,7 +333,7 @@
<value>ou=People,dc=example,dc=com</value>
</option>
<option>
- <name>uidAttributeId</name>
+ <name>uidAttributeID</name>
<value>uid</value>
</option>
<option>
@@ -371,10 +371,10 @@
<value>inetUser</value>
</option>
<!--Schema requires those to have initial value-->
- <option>
+ <!--<option>
<name>cn</name>
<value>none</value>
- </option>
+ </option>-->
<option>
<name>sn</name>
<value>none</value>
@@ -388,16 +388,16 @@
<value>groupOfNames</value>
</option>
<!--Schema requires those to have initial value-->
- <option>
+ <!--<option>
<name>cn</name>
<value>none</value>
- </option>
+ </option>-->
<!--Some directory servers require this attribute to be valid DN-->
<!--For safety reasons point to the admin user here-->
- <option>
+ <!--<option>
<name>member</name>
<value>uid=dummynonexistinguser,ou=People,dc=jboss,dc=org</value>
- </option>
+ </option>-->
</option-group>
</options>
</identity-configuration>
\ No newline at end of file
Modified: trunk/core/src/resources/portal-core-sar/conf/login-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/login-config.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/core/src/resources/portal-core-sar/conf/login-config.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -41,14 +41,14 @@
that are not mapped as attribute you may have LDAP user synchronized into DB with no password set.
Please see HibernateUserProfileImpl module options "synchronizeNonExistingUsers", "acceptOtherImplementations"
"defaultSynchronizePassword" or "randomSynchronizePassword" to manage this behaviour-->
- <login-module code = "org.jboss.portal.identity.auth.DBIdentityLoginModule" flag="sufficient">
+ <!--<login-module code = "org.jboss.portal.identity.auth.DBIdentityLoginModule" flag="sufficient">
<module-option name="dsJndiName">java:/PortalDS</module-option>
<module-option name="principalsQuery">SELECT jbp_password FROM jbp_users WHERE jbp_uname=?</module-option>
<module-option name="rolesQuery">SELECT jbp_roles.jbp_name, 'Roles' FROM jbp_role_membership INNER JOIN jbp_roles ON jbp_role_membership.jbp_rid = jbp_roles.jbp_rid INNER JOIN jbp_users ON jbp_role_membership.jbp_uid = jbp_users.jbp_uid WHERE jbp_users.jbp_uname=?</module-option>
<module-option name="hashAlgorithm">MD5</module-option>
<module-option name="hashEncoding">HEX</module-option>
<module-option name="additionalRole">Authenticated</module-option>
- </login-module>
+ </login-module>-->
<login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">
<module-option name="unauthenticatedIdentity">guest</module-option>
Modified: trunk/identity/build.xml
===================================================================
--- trunk/identity/build.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/build.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -455,9 +455,9 @@
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.UserProtoTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ConfigurationTestCase"/>-->
<!--<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.LDAPSimpleRoleModuleTestCase"/>
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticGroupMembershipModuleTestCase"/>-->
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticRoleMembershipModuleTestCase"/>
+ <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticRoleMembershipModuleTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPUserProfileModuleTestCase"/>-->
</x-test>
<x-classpath>
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java 2007-01-24 23:57:02 UTC (rev 6093)
@@ -89,7 +89,7 @@
try
{
- log.debug("Attributes: " + attrs);
+ //log.debug("Attributes: " + attrs);
//role name
Attribute uida = attrs.get(getRidAttributeID());
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java 2007-01-24 23:57:02 UTC (rev 6093)
@@ -118,7 +118,7 @@
LDAPUserImpl ldapu = null;
try
{
- log.debug("Search result attributes: " + attrs);
+ //log.debug("Search result attributes: " + attrs);
Attribute uida = attrs.get(getUidAttributeID());
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java 2007-01-24 23:57:02 UTC (rev 6093)
@@ -100,14 +100,14 @@
public void testFindRoleByName() throws Exception
{
LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleById("Echo");
- assertEquals(ldapr.getDn(), "cn=Echo,ou=Roles," + suffix);
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
assertEquals(ldapr.getName(), "Echo");
}
public void testRemoveRole() throws Exception
{
LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleById("Echo");
- assertEquals(ldapr.getDn(), "cn=Echo,ou=Roles," + suffix);
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
assertEquals(ldapr.getName(), "Echo");
roleModule.removeRole("Echo");
try
@@ -136,8 +136,8 @@
try
{
- ldapr = (LDAPRoleImpl)roleModule.findRoleById("testRole");
- fail("");
+ roleModule.findRoleById("testRole");
+ fail("shouldn reach this");
}
catch (Exception e)
{
@@ -150,7 +150,7 @@
public void testgetRoleCount() throws Exception
{
LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleById("Echo");
- assertEquals(ldapr.getDn(), "cn=Echo,ou=Roles," + suffix);
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
assertEquals(ldapr.getName(), "Echo");
int count = roleModule.getRolesCount();
@@ -168,9 +168,9 @@
for (Iterator iterator = roles.iterator(); iterator.hasNext();)
{
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn());
+ roleNames.add(role.getDn().toLowerCase());
}
- assertTrue(roleNames.contains("cn=Echo,ou=Roles," + suffix));
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
//
@@ -183,10 +183,10 @@
for (Iterator iterator = roles.iterator(); iterator.hasNext();)
{
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn());
+ roleNames.add(role.getDn().toLowerCase());
}
- assertTrue(roleNames.contains("cn=Echo,ou=Roles," + suffix));
- assertTrue(roleNames.contains("cn=Echo1,ou=Roles," + suffix));
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
//
roles = roleModule.findRolesByNames(new String[] {"Echo", "Echo1", "TheDuke"});
@@ -198,10 +198,10 @@
for (Iterator iterator = roles.iterator(); iterator.hasNext();)
{
LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn());
+ roleNames.add(role.getDn().toLowerCase());
}
- assertTrue(roleNames.contains("cn=Echo,ou=Roles," + suffix));
- assertTrue(roleNames.contains("cn=Echo1,ou=Roles," + suffix));
- assertTrue(roleNames.contains("cn=TheDuke,ou=Roles," + suffix));
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=TheDuke,ou=Roles," + suffix).toLowerCase()));
}
}
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java 2007-01-24 23:57:02 UTC (rev 6093)
@@ -26,6 +26,7 @@
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.identity.ldap.LDAPUserImpl;
import org.jboss.portal.identity.ldap.LDAPRoleImpl;
+import org.jboss.portal.identity.ldap.LDAPUserModuleImpl;
import org.jboss.portal.identity.IdentityServiceControllerImpl;
import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.User;
@@ -34,6 +35,7 @@
import org.jboss.portal.identity.UserProfileModule;
import org.jboss.portal.identity.Role;
import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.IdentityConfiguration;
import org.jboss.portal.test.identity.ldap.LDAPTestCase;
import java.util.Set;
@@ -65,6 +67,8 @@
private String suffix;
+ private String userPrefix;
+
public void setUp() throws Exception
{
super.setUp();
@@ -105,6 +109,7 @@
suffix = getDirectoryServerConfigParameter().getCleanUpDN();
+ userPrefix = ((IdentityConfiguration)controller.getIdentityContext().getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION)).getValue(IdentityConfiguration.USER_UID_ATTRIBUTE_ID);
populate();
}
@@ -118,7 +123,7 @@
public void testFindUserByName() throws Exception
{
LDAPUserImpl ldapu = (LDAPUserImpl)userModule.findUserById("jduke");
- assertEquals(ldapu.getDn(), "uid=jduke,ou=People," + suffix);
+ assertEquals(ldapu.getDn().toLowerCase(), (userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
assertEquals(ldapu.getUserName(), "jduke");
}
@@ -126,11 +131,11 @@
{
LDAPUserImpl ldapu = (LDAPUserImpl)userModule.findUserById("jduke");
assertNotNull(ldapu);
- assertEquals(ldapu.getDn(), "uid=jduke,ou=People," + suffix);
+ assertEquals(ldapu.getDn().toLowerCase(), (userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
userModule.removeUser("jduke");
try
{
- ldapu = (LDAPUserImpl)userModule.findUserById("jduke");
+ userModule.findUserById("jduke");
fail();
}
catch (IdentityException e)
@@ -166,7 +171,7 @@
public void testgetUserCount() throws Exception
{
LDAPUserImpl ldapu = (LDAPUserImpl)userModule.findUserById("jduke");
- assertEquals(ldapu.getDn(), "uid=jduke,ou=People," + suffix);
+ assertEquals(ldapu.getDn().toLowerCase(),(userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
assertEquals(ldapu.getUserName(), "jduke");
int count = userModule.getUserCount();
Modified: trunk/identity/src/resources/test/config/msad-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/msad-config.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/src/resources/test/config/msad-config.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -98,12 +98,16 @@
<option-group>
<group-name>common</group-name>
<option>
+ <name>uidAttributeID</name>
+ <value>cn</value>
+ </option>
+ <option>
<name>userContainerDN</name>
- <value>ou=People,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ <value>ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test</value>
</option>
<option>
<name>roleContainerDN</name>
- <value>ou=Roles,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ <value>ou=Roles,ou=testsuite,ou=portal,dc=jboss,dc=test</value>
</option>
</option-group>
<option-group>
@@ -114,16 +118,32 @@
<value>top</value>
<value>person</value>
<value>inetOrgPerson</value>
+ <value>organizationalPerson</value>
+ <value>user</value>
</option>
+ <!--<option>
+ <name>sAMAccountName</name>
+ <value>toto</value>
+ </option>-->
<!--Schema requires those to have initial value-->
- <option>
+ <!--<option>
<name>cn</name>
<value>none</value>
- </option>
+ </option>-->
<option>
<name>sn</name>
<value>none</value>
</option>
</option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+ <!--<value>cn=Administrator,cd=Users,dc=jboss,dc=test</value>-->
+ <value>cn=jduke,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test</value>
+ </option>
+ </option-group>
</options>
</identity-configuration>
\ No newline at end of file
Modified: trunk/identity/src/resources/test/config/opends-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/opends-config.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/src/resources/test/config/opends-config.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -125,5 +125,19 @@
<value>none</value>
</option>
</option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+ <value>uid=dummynonexistinguser,ou=People,dc=jboss,dc=org</value>
+ </option>
+ </option-group>
</options>
</identity-configuration>
\ No newline at end of file
Modified: trunk/identity/src/resources/test/config/openldap-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/openldap-config.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/src/resources/test/config/openldap-config.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -125,5 +125,19 @@
<value>none</value>
</option>
</option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+ <value>uid=dummynonexistinguser,ou=People,dc=jboss,dc=org</value>
+ </option>
+ </option-group>
</options>
</identity-configuration>
\ No newline at end of file
Modified: trunk/identity/src/resources/test/config/rhds-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/rhds-config.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/src/resources/test/config/rhds-config.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -125,5 +125,19 @@
<value>none</value>
</option>
</option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+ <value>uid=dummynonexistinguser,ou=People,dc=jboss,dc=org</value>
+ </option>
+ </option-group>
</options>
</identity-configuration>
\ No newline at end of file
Modified: trunk/identity/src/resources/test/config/standardidentity-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/standardidentity-config.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/identity/src/resources/test/config/standardidentity-config.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -331,7 +331,7 @@
<value>ou=People,dc=example,dc=com</value>
</option>
<option>
- <name>uidAttributeId</name>
+ <name>uidAttributeID</name>
<value>uid</value>
</option>
<option>
@@ -343,7 +343,7 @@
<value>ou=Roles,dc=example,dc=com</value>
</option>
<option>
- <name>ridAttributeId</name>
+ <name>ridAttributeID</name>
<value>cn</value>
</option>
<option>
@@ -369,10 +369,10 @@
<value>inetUser</value>
</option>
<!--Schema requires those to have initial value-->
- <option>
+ <!--<option>
<name>cn</name>
<value>none</value>
- </option>
+ </option>-->
<option>
<name>sn</name>
<value>none</value>
@@ -386,16 +386,16 @@
<value>groupOfNames</value>
</option>
<!--Schema requires those to have initial value-->
- <option>
+ <!--<option>
<name>cn</name>
<value>none</value>
- </option>
+ </option>-->
<!--Some directory servers require this attribute to be valid DN-->
<!--For safety reasons point to the admin user here-->
- <option>
+ <!--<option>
<name>member</name>
<value>uid=dummynonexistinguser,ou=People,dc=jboss,dc=org</value>
- </option>
+ </option>-->
</option-group>
</options>
</identity-configuration>
Modified: trunk/test/src/etc/directories.xml
===================================================================
--- trunk/test/src/etc/directories.xml 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/test/src/etc/directories.xml 2007-01-24 23:57:02 UTC (rev 6093)
@@ -52,7 +52,7 @@
<cleanup-dn>dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</cleanup-dn>
</directory>
- <!--<directory>
+ <directory>
<directory-name>MSAD</directory-name>
<description>Microsoft Active Directory in QA Labs (need vpn access)</description>
@@ -65,9 +65,9 @@
<populate-ldif>ldap/ldif/initial-tests-qa-msad.ldif</populate-ldif>
- <cleanup-dn>dc=testsuite,ou=portal,dc=jboss,dc=com</cleanup-dn>
- </directory>-->
- <directory>
+ <cleanup-dn>ou=testsuite,ou=portal,dc=jboss,dc=test</cleanup-dn>
+ </directory>
+ <directory>
<directory-name>OpenLDAP</directory-name>
<description>OpenLDAP Directory in QA Labs (need vpn access)</description>
@@ -81,5 +81,5 @@
<populate-ldif>ldap/ldif/initial-tests-qa-openldap.ldif</populate-ldif>
<cleanup-dn>dc=testsuite,dc=portal,dc=my-domain,dc=com</cleanup-dn>
- </directory>
+ </directory>
</directories>
Modified: trunk/test/src/etc/ldap/ldif/initial-tests-qa-msad.ldif
===================================================================
--- trunk/test/src/etc/ldap/ldif/initial-tests-qa-msad.ldif 2007-01-24 23:48:11 UTC (rev 6092)
+++ trunk/test/src/etc/ldap/ldif/initial-tests-qa-msad.ldif 2007-01-24 23:57:02 UTC (rev 6093)
@@ -138,37 +138,40 @@
sn: Duke
userPassword: theduke
mail: email(a)email.com
-member: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+#member: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
dn: cn=jduke1,ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
objectclass: top
-objectclass: inetOrgPerson
-objectclass: inetUser
+objectclass: person
+objectclass: organizationalPerson
+objectclass: user
cn: jduke1
#cn: Java Duke1
sn: Duke1
userPassword: theduke
mail: email(a)email.com
-member: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
-member: cn=Echo1,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+#memberOf: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+#memberOf: cn=Echo1,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
dn: cn=jduke2,ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
objectclass: top
-objectclass: inetOrgPerson
-objectclass: inetUser
+objectclass: person
+objectclass: organizationalPerson
+objectclass: user
cn: jduke2
#cn: Java Duke2
sn: Duke2
userPassword: theduke
mail: email(a)email.com
-member: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
-member: cn=Echo1,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
-member: cn=TheDuke,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+#memberOf: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+#memberOf: cn=Echo1,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+#memberOf: cn=TheDuke,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
dn: cn=jduke3,ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
objectclass: top
-objectclass: inetOrgPerson
-objectclass: inetUser
+objectclass: person
+objectclass: organizationalPerson
+objectclass: user
cn: jduke3
#cn: Java Duke3
sn: Duke3
@@ -177,8 +180,9 @@
dn: cn=jduke4,ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
objectclass: top
-objectclass: inetOrgPerson
-objectclass: inetUser
+objectclass: person
+objectclass: organizationalPerson
+objectclass: user
cn: jduke4
#cn: Java Duke4
sn: Duke4
17 years, 4 months
JBoss Portal SVN: r6092 - in trunk: core-samples and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-24 18:48:11 -0500 (Wed, 24 Jan 2007)
New Revision: 6092
Modified:
trunk/core-samples/build.xml
trunk/core/build.xml
Log:
put back samples jar in core instead of core-samples, probably will need to move the JSPPortlet into core
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-01-24 23:44:25 UTC (rev 6091)
+++ trunk/core/build.xml 2007-01-24 23:48:11 UTC (rev 6092)
@@ -330,6 +330,7 @@
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
<fileset dir="${jboss.portal-identity.root}/lib" includes="portal-identity-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib" includes="portal-registration-lib.jar"/>
+ <fileset dir="${jboss.portal-samples.root}/lib" includes="portal-samples-lib.jar"/>
<fileset dir="${ehcache.ehcache.lib}" includes="ehcache.jar"/>
<fileset dir="${apache.collections.lib}" includes="commons-collections.jar"/>
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
Modified: trunk/core-samples/build.xml
===================================================================
--- trunk/core-samples/build.xml 2007-01-24 23:44:25 UTC (rev 6091)
+++ trunk/core-samples/build.xml 2007-01-24 23:48:11 UTC (rev 6092)
@@ -212,7 +212,6 @@
<!-- hibernate configuration for identity -->
<copy todir="${build.resources}/portal-samples/lib">
<fileset dir="${build.lib}" includes="portal-core-samples-lib.jar"/>
- <fileset dir="${jboss.portal-samples.root}/lib" includes="portal-samples-lib.jar"/>
</copy>
</target>
17 years, 4 months
JBoss Portal SVN: r6091 - in trunk: common/src/main/org/jboss/portal/common/util and 10 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-24 18:44:25 -0500 (Wed, 24 Jan 2007)
New Revision: 6091
Added:
trunk/common/src/main/org/jboss/portal/common/xml/
trunk/common/src/main/org/jboss/portal/common/xml/NullEntityResolver.java
trunk/core/src/resources/portal-core-sar/dtd/
trunk/core/src/resources/portal-core-sar/dtd/jboss-app_2_6.dtd
trunk/core/src/resources/portal-core-sar/dtd/jboss-portlet_2_6.dtd
trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
Removed:
trunk/core/src/resources/dtd/jboss-app_2_6.dtd
trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
trunk/core/src/resources/dtd/portal-object_2_6.dtd
trunk/core/src/resources/dtd/portlet-instances_2_6.dtd
Modified:
trunk/common/src/main/org/jboss/portal/common/util/LoaderResource.java
trunk/common/src/main/org/jboss/portal/common/util/XML.java
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml
trunk/core/src/main/org/jboss/portal/core/deployment/jboss/ObjectDeployment.java
trunk/core/src/main/org/jboss/portal/core/deployment/jboss/ObjectDeploymentFactory.java
trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java
trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeploymentFactory.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebApp.java
trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebAppFactory.java
trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat4App.java
trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java
trunk/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java
Log:
- added configurable entity resolver service
- inject the entity resolver service in the various deployers
- fix the dtds so they are correct
Modified: trunk/common/src/main/org/jboss/portal/common/util/LoaderResource.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/LoaderResource.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/common/src/main/org/jboss/portal/common/util/LoaderResource.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -114,22 +114,16 @@
try
{
in = Tools.safeBufferedWrapper(asInputStream());
- Properties props = new Properties();
+ Properties props;
if (xml)
{
DocumentBuilder builder = XML.getDocumentBuilderFactory().newDocumentBuilder();
Document doc = asDocument(builder);
- Element propertiesElt = doc.getDocumentElement();
- for (Iterator i = XML.getChildren(propertiesElt, "entry").iterator(); i.hasNext();)
- {
- Element entryElt = (Element)i.next();
- String key = entryElt.getAttribute("key");
- String value = XML.asString(entryElt);
- props.put(key, value);
- }
+ props = XML.loadXMLProperties(doc);
}
else
{
+ props = new Properties();
props.load(in);
}
log.debug("Finished loading resource: " + location);
Modified: trunk/common/src/main/org/jboss/portal/common/util/XML.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/XML.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/common/src/main/org/jboss/portal/common/util/XML.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -379,4 +379,31 @@
}
return result;
}
+
+ public static Properties loadXMLProperties(Element propertiesElt)
+ {
+ if (propertiesElt == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ Properties props = new Properties();
+ for (Iterator i = XML.getChildren(propertiesElt, "entry").iterator(); i.hasNext();)
+ {
+ Element entryElt = (Element)i.next();
+ String key = entryElt.getAttribute("key");
+ String value = XML.asString(entryElt);
+ props.put(key, value);
+ }
+ return props;
+ }
+
+ public static Properties loadXMLProperties(Document doc)
+ {
+ if (doc == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return loadXMLProperties(doc.getDocumentElement());
+ }
+
}
Added: trunk/common/src/main/org/jboss/portal/common/xml/NullEntityResolver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/xml/NullEntityResolver.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/xml/NullEntityResolver.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.xml;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NullEntityResolver implements EntityResolver
+{
+ public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
+ {
+ return null;
+ }
+}
Modified: trunk/core/src/main/org/jboss/portal/core/deployment/jboss/ObjectDeployment.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/deployment/jboss/ObjectDeployment.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/main/org/jboss/portal/core/deployment/jboss/ObjectDeployment.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -27,6 +27,7 @@
import org.jboss.portal.common.metadata.MetaData;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.XML;
+import org.jboss.portal.common.xml.NullEntityResolver;
import org.jboss.portal.core.model.portal.metadata.PortalObjectMetaData;
import org.jboss.portal.core.model.portal.metadata.BuildContext;
import org.jboss.portal.core.model.portal.PortalObject;
@@ -38,6 +39,7 @@
import org.jboss.portal.server.deployment.jboss.Deployment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.xml.sax.EntityResolver;
import javax.management.MBeanServer;
import javax.transaction.TransactionManager;
@@ -108,6 +110,17 @@
log.debug("Loading portal metadata from " + url);
in = Tools.safeBufferedWrapper(url.openStream());
DocumentBuilder builder = XML.getDocumentBuilderFactory().newDocumentBuilder();
+ EntityResolver entityResolver = factory.getPortalObjectEntityResolver();
+ if (entityResolver == null)
+ {
+ log.debug("Coult not obtain entity resolver for " + url);
+ entityResolver = new NullEntityResolver();
+ }
+ else
+ {
+ log.debug("Obtained entity resolver " + entityResolver + " for " + url);
+ }
+ builder.setEntityResolver(entityResolver);
Document doc = builder.parse(in);
Element deploymentsElt = doc.getDocumentElement();
Modified: trunk/core/src/main/org/jboss/portal/core/deployment/jboss/ObjectDeploymentFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/deployment/jboss/ObjectDeploymentFactory.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/main/org/jboss/portal/core/deployment/jboss/ObjectDeploymentFactory.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -29,6 +29,7 @@
import org.jboss.portal.server.deployment.PortalWebApp;
import org.jboss.portal.server.deployment.jboss.AbstractDeploymentFactory;
import org.jboss.portal.server.deployment.jboss.Deployment;
+import org.xml.sax.EntityResolver;
import javax.management.MBeanServer;
import javax.transaction.TransactionManager;
@@ -54,6 +55,9 @@
/** . */
protected ContentHandlerRegistry contentHandlerRegistry;
+ /** . */
+ protected EntityResolver portalObjectEntityResolver;
+
public boolean acceptFile(URL url)
{
String urlAsFile = url.getFile();
@@ -74,6 +78,16 @@
}
}
+ public EntityResolver getPortalObjectEntityResolver()
+ {
+ return portalObjectEntityResolver;
+ }
+
+ public void setPortalObjectEntityResolver(EntityResolver portalObjectEntityResolver)
+ {
+ this.portalObjectEntityResolver = portalObjectEntityResolver;
+ }
+
public PortalObjectContainer getPortalObjectContainer()
{
return portalObjectContainer;
Modified: trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -30,6 +30,7 @@
import org.jboss.portal.common.util.XML;
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.common.value.Value;
+import org.jboss.portal.common.xml.NullEntityResolver;
import org.jboss.portal.core.model.instance.metadata.InstanceMetaData;
import org.jboss.portal.core.model.instance.metadata.PreferencesMetaData;
import org.jboss.portal.core.metadata.ServiceMetaData;
@@ -50,6 +51,7 @@
import org.jboss.portal.server.deployment.PortalWebApp;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.xml.sax.EntityResolver;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -143,8 +145,6 @@
// Read portlet-instances.xml
try
{
- final DocumentBuilder builder = XML.getDocumentBuilderFactory().newDocumentBuilder();
-
// All the meta data gathered
final ArrayList metaDataCtxs = new ArrayList();
@@ -174,6 +174,7 @@
try
{
in = Tools.safeBufferedWrapper(url.openStream());
+ DocumentBuilder builder = XML.getDocumentBuilderFactory().newDocumentBuilder();
Document doc = builder.parse(in);
Element deploymentsElt = doc.getDocumentElement();
for (Iterator i = XML.getChildrenIterator(deploymentsElt, "deployment"); i.hasNext();)
@@ -224,6 +225,7 @@
// Output legacy file on the console
if (metaDataCtxs.size() > 0)
{
+ DocumentBuilder builder = XML.getDocumentBuilderFactory().newDocumentBuilder();
Document doc = builder.newDocument();
Element deployments = (Element)doc.appendChild(doc.createElement("deployments"));
for (int i = 0; i < metaDataCtxs.size(); i++)
@@ -248,6 +250,18 @@
in = Tools.safeBufferedWrapper(pwa.getServletContext().getResourceAsStream("/WEB-INF/portlet-instances.xml"));
if (in != null)
{
+ DocumentBuilder builder = XML.getDocumentBuilderFactory().newDocumentBuilder();
+ EntityResolver entityResolver = factory.getPortletInstancesEntityResolver();
+ if (entityResolver == null)
+ {
+ log.debug("Coult not obtain entity resolver for portlet-instances.xml");
+ entityResolver = new NullEntityResolver();
+ }
+ else
+ {
+ log.debug("Obtained entity resolver " + entityResolver + " for portlet-instances.xml");
+ }
+ builder.setEntityResolver(entityResolver);
Document doc = builder.parse(in);
//
Modified: trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeploymentFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeploymentFactory.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeploymentFactory.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -27,6 +27,7 @@
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.server.deployment.PortalWebApp;
import org.jboss.portal.server.deployment.jboss.Deployment;
+import org.xml.sax.EntityResolver;
import javax.management.MBeanServer;
import java.net.URL;
@@ -42,13 +43,26 @@
protected InstanceContainer instanceContainer;
/** . */
- private boolean createInstances;
+ protected boolean createInstances;
+ /** . */
+ protected EntityResolver portletInstancesEntityResolver;
+
public Deployment newInstance(URL url, PortalWebApp pwa, MBeanServer mbeanServer) throws DeploymentException
{
return new PortletAppDeployment(url, pwa, mbeanServer, this);
}
+ public EntityResolver getPortletInstancesEntityResolver()
+ {
+ return portletInstancesEntityResolver;
+ }
+
+ public void setPortletInstancesEntityResolver(EntityResolver portletInstancesEntityResolver)
+ {
+ this.portletInstancesEntityResolver = portletInstancesEntityResolver;
+ }
+
public InstanceContainer getInstanceContainer()
{
return instanceContainer;
Deleted: trunk/core/src/resources/dtd/jboss-app_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/jboss-app_2_6.dtd 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/resources/dtd/jboss-app_2_6.dtd 2007-01-24 23:44:25 UTC (rev 6091)
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!--
-<!DOCTYPE jboss-app PUBLIC
- "-//JBoss Portal//DTD JBoss Web Application 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-app_2_6.dtd">
--->
-
-<!ELEMENT jboss-app (app-name?)>
-
-<!--
-When a web application is deployed, the context path under wich it is deployed is taken as application
-name. The application name value in this descriptor is used to override it. When a component references a
-references a portlet, it needs to reference the application too and if the portlet application war file is renammed
-the reference is not valid anymore. Therefore this tag is used to have an application name that does not depend
-upon the context path under which the application is deployed.
--->
-<!ELEMENT app-name (#PCDATA)>
\ No newline at end of file
Deleted: trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-24 23:44:25 UTC (rev 6091)
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!-- The additional configuration elements of the JBoss portlet container.
-
-<!DOCTYPE portlet-app PUBLIC
- "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
- "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
--->
-
-<!--
-The remotable element is used to configure the default behavior of the portlets with respect to WSRP
-exposure.
-
-For each portlet defined in portlet.xml, it is possible to configure specific settings
-of the portlet container.
-
-It is also possible to inject services in the portlet context of the application using the service elements.
--->
-<!ELEMENT portlet-app (remotable?,portlet*,service*)>
-
-<!--
-Additional configuration for a portlet.
-
-The portlet-name defines the name of the portlet. It must match a portlet defined already in portlet.xml
-of the same web application.
-
-The remotable element configures the portlet exposure to WSRP. If no value is present then the value considered
-is either the value defined globally at the portlet application level or false.
-
-The trans-attribute value specifies the behavior of the portlet when it is invoked at runtime with
-respect to the transactionnal context. According to how the portlet is invoked a transaction may exist or not
-before the portlet is invoked. Usually in the local context the portal transaction could be present.
-By default the value considered is NotSupported which means that the portal transaction will be suspended
-for the duration of the portlet invocation.
-
-Example :
-
-<portlet>
- <portlet-name>MyPortlet</portlet-name>
- <remotable>true</remotable>
- <trans-attribute>Required</trans-attribute>
-</portlet>
-
--->
-<!ELEMENT portlet (portlet-name,remotable?,session-config?,transaction?,header-content?)>
-
-<!--
-The portlet name.
--->
-<!ELEMENT portlet-name (#PCDATA)>
-
-<!--
-The remotable value is used for WSRP exposure. The accepted values are the litterals true of false.
--->
-<!ELEMENT remotable (#PCDATA)>
-
-<!--
-todo
--->
-<!ELEMENT session-config (distributed)>
-
-<!--
-todo
--->
-<!ELEMENT distributed (#PCDATA)>
-
-<!--
-todo
--->
-<!ELEMENT transaction (trans-attribute)>
-
-<!--
-The trans-attribute value defines the transactionnal behavior. The accepted values are Required,
-Mandatory, Never, Supports, NotSupported and RequiresNew.
--->
-<!ELEMENT trans-attribute (#PCDATA)>
-
-<!--
-Specify content which should be included in the portal aggregated page when the portlet is present
-on that page. This setting only applies when the portlet is used in the local mode.
--->
-<!ELEMENT header-content (link|script|meta)*>
-
-<!--
-todo
--->
-<!ELEMENT link>
-
-<!--
-todo
--->
-<!ATTLIST link
- rel CDATA #IMPLIED
- href CDATA #IMPLIED
- title CDATA #IMPLIED
- type CDATA #IMPLIED
- media CDATA #IMPLIED>
-
-<!--
-todo
--->
-<!ELEMENT script>
-
-<!--
-todo
--->
-<!ATTLIST script
- src CDATA #IMPLIED
- type CDATA #IMPLIED
- language CDATA #IMPLIED>
-
-<!--
-todo
--->
-<!ELEMENT meta>
-
-<!--
-todo
--->
-<!ATTLIST meta
- name CDATA #IMPLIED
- content CDATA #REQUIRED>
-
-<!--
-Declare a service that will be injected by the portlet container as an attribute of the portlet context.
-
-Example :
-
-<service>
- <service-name>UserModule</service-name>
- <service-class>org.jboss.portal.identity.UserModule</service-class>
- <service-ref>:service=Module,type=User</service-ref>
-</service>
-
-In the portlet it is then possible to use it by doing a lookup on the service name, for example in the
-init() lifecycle method :
-
-public void init()
-{
- UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
-}
-
--->
-<!ELEMENT service (service-name,service-class,service-ref)>
-
-<!--
-The service name that will be used to bind the service as a portlet context attribute.
--->
-<!ELEMENT service-name (#PCDATA)>
-
-<!--
-The full qualified name of the interface that the service implements.
--->
-<!ELEMENT service-class (#PCDATA)>
-
-<!--
-The reference to the service. In the JMX Microkernel environment it consist of the JMX name of the service MBean.
-For an MBean reference if the domain is left out, then the current domain of the portal will be used.
--->
-<!ELEMENT service-ref (#PCDATA)>
Deleted: trunk/core/src/resources/dtd/portal-object_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/portal-object_2_6.dtd 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/resources/dtd/portal-object_2_6.dtd 2007-01-24 23:44:25 UTC (rev 6091)
@@ -1,160 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!--
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
--->
-
-<!--
-The deployements element is a container for deployment elements.
--->
-<!ELEMENT deployments (deployment*)>
-
-<!--
-The deployment is a container for an instance element.
--->
-<!ELEMENT deployment (parent-ref,if-exists?,(context|portal|page|window)*)>
-
-<!--
--->
-<!ELEMENT parent-ref #PCDATA>
-
-<!--
--->
-<!ELEMENT if-exists #PCDATA>
-
-<!--
--->
-<!ELEMENT context (context-name,properties?,portal*,listener?,security-constraint?)>
-
-<!--
--->
-<!ELEMENT context-name #PCDATA>
-
-<!--
--->
-<!ELEMENT portal (portal-name,properties?,supported-modes?,supported-window-states?,(page|window)*,listener?,security-constraint?)>
-
-<!--
--->
-<!ELEMENT supported-modes (mode*)>
-
-<!--
--->
-<!ELEMENT mode #PCDATA>
-
-<!--
--->
-<!ELEMENT supported-window-states (window-state*)>
-
-<!--
--->
-<!ELEMENT window-state #PCDATA>
-
-<!--
--->
-<!ELEMENT portal-name #PCDATA>
-
-<!--
--->
-<!ELEMENT page (page-name,properties?,(page|window)*,listener?,security-constraint?)>
-
-<!--
--->
-<!ELEMENT listener #PCDATA>
-
-<!--
--->
-<!ELEMENT page-name #PCDATA>
-
-<!--
--->
-<!ELEMENT window (window-name,(instance-ref|content),properties?,region,height,listener?)>
-
-<!--
--->
-<!ELEMENT window-name #PCDATA>
-
-<!--
--->
-<!ELEMENT instance-ref #PCDATA>
-
-<!--
--->
-<!ELEMENT content (content-type,content-uri)>
-
-<!--
--->
-<!ELEMENT content-type #PCDATA>
-
-<!--
--->
-<!ELEMENT content-uri #PCDATA>
-
-<!--
--->
-<!ELEMENT region #PCDATA>
-
-<!--
--->
-<!ELEMENT height #PCDATA>
-
-<!--
--->
-<!ELEMENT properties (property*)>
-
-<!--
--->
-<!ELEMENT property (name,value)>
-
-<!--
--->
-<!ELEMENT name #PCDATA>
-
-<!--
--->
-<!ELEMENT value #PCDATA>
-
-<!--
--->
-<!ELEMENT security-constraint (policy-permission)>
-
-<!--
--->
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
-
-<!--
--->
-<!ELEMENT action-name #PCDATA>
-
-<!--
--->
-<!ELEMENT unchecked EMPTY>
-
-<!--
--->
-<!ELEMENT role-name #PCDATA>
Deleted: trunk/core/src/resources/dtd/portlet-instances_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/portlet-instances_2_6.dtd 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/resources/dtd/portlet-instances_2_6.dtd 2007-01-24 23:44:25 UTC (rev 6091)
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!--
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
- "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
--->
-
-<!--
-The deployements element is a container for deployment elements.
--->
-<!ELEMENT deployments (deployment*)>
-
-<!--
-The deployment is a container for an instance element.
--->
-<!ELEMENT deployment (if-exists?,instance)>
-
-<!--
--->
-<!ELEMENT if-exists #PCDATA>
-
-<!--
-The instance element is used to create an instance of a portlet from the portlet application of the same
-war file containing the portlet-instances.xml file. The portlet will be created and configured only
-if the portlet is present and an instance with such a name does not already exist.
-
-Example :
-
-<instance>
- <instance-id>MyPortletInstance</instance-id>
- <portlet-ref>MyPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>abc</name>
- <value>def</value>
- </preference>
- </preferences>
- <security-constraint>
- <policy-permission>
- <role-name>User</role-name>
- <action-name>view</action-name>
- </policy-permission>
- </security-constraint>
-</instance>
-
--->
-<!ELEMENT instance (instance-id,portlet-ref,preferences?security-constraint?)>
-
-<!--
-The identifier of the instance.
--->
-<!ELEMENT instance-id #PCDATA>
-
-<!--
-The reference to the portlet which is its portlet name.
--->
-<!ELEMENT portlet-ref #PCDATA>
-
-<!--
-The preferences element configures the instance with a specific set of preferences.
--->
-<!ELEMENT preferences (preference)>
-
-<!--
-The preference configure one preference of a set of preferences.
--->
-<!ELEMENT preference (name,value)>
-
-<!--
-A name.
--->
-<!ELEMENT name #PCDATA>
-
-<!--
-A string value.
--->
-<!ELEMENT value #PCDATA>
-
-<!--
-todo
--->
-<!ELEMENT security-constraint (policy-permission)>
-
-<!--
-todo
--->
-<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
-
-<!--
-todo
--->
-<!ELEMENT action-name #PCDATA>
-
-<!--
-todo
--->
-<!ELEMENT unchecked EMPTY>
-
-<!--
-todo
--->
-<!ELEMENT role-name #PCDATA>
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-01-24 23:44:25 UTC (rev 6091)
@@ -34,6 +34,22 @@
<attribute name="ConfigLocation">conf/config.xml</attribute>
</mbean>
+ <mbean
+ code="org.jboss.portal.server.impl.xml.EntityResolverService"
+ name="portal:service=EntityResolver"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="DTDMapping">
+ <properties>
+ <entry key="-//JBoss Portal//DTD JBoss Portlet 2.6//EN">dtd/jboss-portlet_2_6.dtd</entry>
+ <entry key="-//JBoss Portal//DTD JBoss App 2.6//EN">dtd/jboss-app_2_6.dtd</entry>
+ <entry key="-//JBoss Portal//DTD Portal Object 2.6//EN">dtd/portal-object_2_6.dtd</entry>
+ <entry key="-//JBoss Portal//DTD Portlet Instances 2.6//EN">dtd/portlet-instances_2_6.dtd</entry>
+ </properties>
+ </attribute>
+ </mbean>
+
<!-- Portal security services-->
<mbean
code="org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl"
@@ -978,6 +994,9 @@
<depends
optional-attribute-name="ContentHandlerRegistry"
proxy-type="attribute">portal:container=PortalObject</depends>
+ <depends
+ optional-attribute-name="PortalObjectEntityResolver"
+ proxy-type="attribute">portal:service=EntityResolver</depends>
<attribute name="SetupLocation">conf/data/default-object.xml</attribute>
<!-- Set to false in clustered mode, otherwise set to true -->
<attribute name="RegistrationControlledByService">@portal.single@</attribute>
@@ -1027,6 +1046,12 @@
<depends
optional-attribute-name="InstanceContainer"
proxy-type="attribute">portal:container=Instance</depends>
+ <depends
+ optional-attribute-name="JBossPortletEntityResolver"
+ proxy-type="attribute">portal:service=EntityResolver</depends>
+ <depends
+ optional-attribute-name="PortletInstancesEntityResolver"
+ proxy-type="attribute">portal:service=EntityResolver</depends>
<attribute name="StandardJBossApplicationMetaDataLocation">conf/standardjboss-portlet.xml</attribute>
<attribute name="APIFactoryClassName">org.jboss.portlet.JBossAPIFactory</attribute>
<!-- Set to false in clustered mode, otherwise set to true -->
@@ -1082,6 +1107,9 @@
<depends
optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
+ <depends
+ optional-attribute-name="JBossAppEntityResolver"
+ proxy-type="attribute">portal:service=EntityResolver</depends>
</mbean>
<mbean
Added: trunk/core/src/resources/portal-core-sar/dtd/jboss-app_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/jboss-app_2_6.dtd (rev 0)
+++ trunk/core/src/resources/portal-core-sar/dtd/jboss-app_2_6.dtd 2007-01-24 23:44:25 UTC (rev 6091)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!--
+<!DOCTYPE jboss-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Web Application 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-app_2_6.dtd">
+-->
+
+<!ELEMENT jboss-app (app-name?)>
+
+<!--
+When a web application is deployed, the context path under wich it is deployed is taken as application
+name. The application name value in this descriptor is used to override it. When a component references a
+references a portlet, it needs to reference the application too and if the portlet application war file is renammed
+the reference is not valid anymore. Therefore this tag is used to have an application name that does not depend
+upon the context path under which the application is deployed.
+-->
+<!ELEMENT app-name (#PCDATA)>
\ No newline at end of file
Added: trunk/core/src/resources/portal-core-sar/dtd/jboss-portlet_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/jboss-portlet_2_6.dtd (rev 0)
+++ trunk/core/src/resources/portal-core-sar/dtd/jboss-portlet_2_6.dtd 2007-01-24 23:44:25 UTC (rev 6091)
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!-- The additional configuration elements of the JBoss portlet container.
+
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+-->
+
+<!--
+The remotable element is used to configure the default behavior of the portlets with respect to WSRP
+exposure.
+
+For each portlet defined in portlet.xml, it is possible to configure specific settings
+of the portlet container.
+
+It is also possible to inject services in the portlet context of the application using the service elements.
+-->
+<!ELEMENT portlet-app (remotable?,portlet*,service*)>
+
+<!--
+Additional configuration for a portlet.
+
+The portlet-name defines the name of the portlet. It must match a portlet defined already in portlet.xml
+of the same web application.
+
+The remotable element configures the portlet exposure to WSRP. If no value is present then the value considered
+is either the value defined globally at the portlet application level or false.
+
+The trans-attribute value specifies the behavior of the portlet when it is invoked at runtime with
+respect to the transactionnal context. According to how the portlet is invoked a transaction may exist or not
+before the portlet is invoked. Usually in the local context the portal transaction could be present.
+By default the value considered is NotSupported which means that the portal transaction will be suspended
+for the duration of the portlet invocation.
+
+Example :
+
+<portlet>
+ <portlet-name>MyPortlet</portlet-name>
+ <remotable>true</remotable>
+ <trans-attribute>Required</trans-attribute>
+</portlet>
+
+-->
+<!ELEMENT portlet (portlet-name,remotable?,session-config?,transaction?,header-content?)>
+
+<!--
+The portlet name.
+-->
+<!ELEMENT portlet-name (#PCDATA)>
+
+<!--
+The remotable value is used for WSRP exposure. The accepted values are the litterals true of false.
+-->
+<!ELEMENT remotable (#PCDATA)>
+
+<!--
+todo
+-->
+<!ELEMENT session-config (distributed)>
+
+<!--
+todo
+-->
+<!ELEMENT distributed (#PCDATA)>
+
+<!--
+todo
+-->
+<!ELEMENT transaction (trans-attribute)>
+
+<!--
+The trans-attribute value defines the transactionnal behavior. The accepted values are Required,
+Mandatory, Never, Supports, NotSupported and RequiresNew.
+-->
+<!ELEMENT trans-attribute (#PCDATA)>
+
+<!--
+Specify content which should be included in the portal aggregated page when the portlet is present
+on that page. This setting only applies when the portlet is used in the local mode.
+-->
+<!ELEMENT header-content (link|script|meta)*>
+
+<!--
+todo + check if ANY cannot be restricted
+-->
+<!ELEMENT link ANY>
+
+<!--
+todo
+-->
+<!ATTLIST link
+ rel CDATA #IMPLIED
+ href CDATA #IMPLIED
+ title CDATA #IMPLIED
+ type CDATA #IMPLIED
+ media CDATA #IMPLIED>
+
+<!--
+todo + check if ANY cannot be restricted
+-->
+<!ELEMENT script ANY>
+
+<!--
+todo
+-->
+<!ATTLIST script
+ src CDATA #IMPLIED
+ type CDATA #IMPLIED
+ language CDATA #IMPLIED>
+
+<!--
+todo + check if ANY cannot be restricted
+-->
+<!ELEMENT meta ANY>
+
+<!--
+todo
+-->
+<!ATTLIST meta
+ name CDATA #IMPLIED
+ content CDATA #REQUIRED>
+
+<!--
+Declare a service that will be injected by the portlet container as an attribute of the portlet context.
+
+Example :
+
+<service>
+ <service-name>UserModule</service-name>
+ <service-class>org.jboss.portal.identity.UserModule</service-class>
+ <service-ref>:service=Module,type=User</service-ref>
+</service>
+
+In the portlet it is then possible to use it by doing a lookup on the service name, for example in the
+init() lifecycle method :
+
+public void init()
+{
+ UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
+}
+
+-->
+<!ELEMENT service (service-name,service-class,service-ref)>
+
+<!--
+The service name that will be used to bind the service as a portlet context attribute.
+-->
+<!ELEMENT service-name (#PCDATA)>
+
+<!--
+The full qualified name of the interface that the service implements.
+-->
+<!ELEMENT service-class (#PCDATA)>
+
+<!--
+The reference to the service. In the JMX Microkernel environment it consist of the JMX name of the service MBean.
+For an MBean reference if the domain is left out, then the current domain of the portal will be used.
+-->
+<!ELEMENT service-ref (#PCDATA)>
Added: trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd (rev 0)
+++ trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-01-24 23:44:25 UTC (rev 6091)
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!--
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+-->
+
+<!--
+The deployements element is a container for deployment elements.
+-->
+<!ELEMENT deployments (deployment*)>
+
+<!--
+The deployment is a container for an instance element.
+-->
+<!ELEMENT deployment (parent-ref,if-exists?,(context|portal|page|window)*)>
+
+<!--
+-->
+<!ELEMENT parent-ref (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT if-exists (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT context (context-name,properties?,portal*,listener?,security-constraint?)>
+
+<!--
+-->
+<!ELEMENT context-name (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT portal (portal-name,properties?,supported-modes?,supported-window-states?,(page|window)*,listener?,security-constraint?)>
+
+<!--
+-->
+<!ELEMENT supported-modes (mode*)>
+
+<!--
+-->
+<!ELEMENT mode (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT supported-window-states (window-state*)>
+
+<!--
+-->
+<!ELEMENT window-state (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT portal-name (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT page (page-name,properties?,(page|window)*,listener?,security-constraint?)>
+
+<!--
+-->
+<!ELEMENT listener (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT page-name (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT window (window-name,(instance-ref|content),properties?,region,height,listener?)>
+
+<!--
+-->
+<!ELEMENT window-name (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT instance-ref (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT content (content-type,content-uri)>
+
+<!--
+-->
+<!ELEMENT content-type (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT content-uri (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT region (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT height (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT properties (property*)>
+
+<!--
+-->
+<!ELEMENT property (name,value)>
+
+<!--
+-->
+<!ELEMENT name (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT value (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT security-constraint (policy-permission)>
+
+<!--
+-->
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
+
+<!--
+-->
+<!ELEMENT action-name (#PCDATA)>
+
+<!--
+-->
+<!ELEMENT unchecked EMPTY>
+
+<!--
+-->
+<!ELEMENT role-name (#PCDATA)>
Added: trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd (rev 0)
+++ trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-01-24 23:44:25 UTC (rev 6091)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!--
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+-->
+
+<!--
+The deployements element is a container for deployment elements.
+-->
+<!ELEMENT deployments (deployment*)>
+
+<!--
+The deployment is a container for an instance element.
+-->
+<!ELEMENT deployment (if-exists?,instance)>
+
+<!--
+-->
+<!ELEMENT if-exists (#PCDATA)>
+
+<!--
+The instance element is used to create an instance of a portlet from the portlet application of the same
+war file containing the portlet-instances.xml file. The portlet will be created and configured only
+if the portlet is present and an instance with such a name does not already exist.
+
+Example :
+
+<instance>
+ <instance-id>MyPortletInstance</instance-id>
+ <portlet-ref>MyPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>abc</name>
+ <value>def</value>
+ </preference>
+ </preferences>
+ <security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+ </security-constraint>
+</instance>
+
+-->
+<!ELEMENT instance (instance-id,portlet-ref,preferences?,security-constraint?)>
+
+<!--
+The identifier of the instance.
+-->
+<!ELEMENT instance-id (#PCDATA)>
+
+<!--
+The reference to the portlet which is its portlet name.
+-->
+<!ELEMENT portlet-ref (#PCDATA)>
+
+<!--
+The preferences element configures the instance with a specific set of preferences.
+-->
+<!ELEMENT preferences (preference)>
+
+<!--
+The preference configure one preference of a set of preferences.
+-->
+<!ELEMENT preference (name,value)>
+
+<!--
+A name.
+-->
+<!ELEMENT name (#PCDATA)>
+
+<!--
+A string value.
+-->
+<!ELEMENT value (#PCDATA)>
+
+<!--
+todo
+-->
+<!ELEMENT security-constraint (policy-permission)>
+
+<!--
+todo
+-->
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
+
+<!--
+todo
+-->
+<!ELEMENT action-name (#PCDATA)>
+
+<!--
+todo
+-->
+<!ELEMENT unchecked EMPTY>
+
+<!--
+todo
+-->
+<!ELEMENT role-name (#PCDATA)>
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml 2007-01-24 23:44:25 UTC (rev 6091)
@@ -34,6 +34,9 @@
</portlet>
<portlet>
<portlet-name>RolePortlet</portlet-name>
+ <transaction>
+ <trans-attribute>Required</trans-attribute>
+ </transaction>
<header-content>
<script type="text/javascript" language="javascript">
function hideShow(id)
@@ -47,9 +50,6 @@
}
</script>
</header-content>
- <transaction>
- <trans-attribute>Required</trans-attribute>
- </transaction>
</portlet>
<portlet>
<portlet-name>CatalogPortlet</portlet-name>
@@ -59,12 +59,12 @@
</portlet>
<portlet>
<portlet-name>ManagementPortlet</portlet-name>
+ <transaction>
+ <trans-attribute>Required</trans-attribute>
+ </transaction>
<header-content>
<link rel="stylesheet" type="text/css" href="/images/management/management.css" title="" media="screen"/>
</header-content>
- <transaction>
- <trans-attribute>Required</trans-attribute>
- </transaction>
</portlet>
<portlet>
<portlet-name>ConfiguratorPortlet</portlet-name>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml 2007-01-24 23:44:25 UTC (rev 6091)
@@ -28,12 +28,12 @@
<portlet-app>
<portlet>
<portlet-name>CMSAdminPortlet</portlet-name>
+ <transaction>
+ <trans-attribute>Required</trans-attribute>
+ </transaction>
<header-content>
<link rel="stylesheet" type="text/css" href="/images/cms/admin/style.css" title="" media="screen"/>
</header-content>
- <transaction>
- <trans-attribute>Required</trans-attribute>
- </transaction>
</portlet>
<!-- Service injected in the portlet context. -->
<service>
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -32,6 +32,7 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.xml.NullEntityResolver;
import org.jboss.portal.portlet.container.PortletApplicationContextImpl;
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
import org.jboss.portal.portlet.container.PortletContainerAdapter;
@@ -54,6 +55,7 @@
import org.jboss.portal.server.deployment.jboss.Deployment;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
+import org.xml.sax.EntityResolver;
import javax.management.MBeanServer;
import javax.servlet.ServletContext;
@@ -368,6 +370,17 @@
//
JBossApplicationMetaDataFactory factory = this.factory.createJBossApplicationMetaDataFactory();
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ EntityResolver entityResolver = this.factory.getJBossPortletEntityResolver();
+ if (entityResolver == null)
+ {
+ log.debug("Coult not obtain entity resolver for jboss-portlet.xml");
+ entityResolver = new NullEntityResolver();
+ }
+ else
+ {
+ log.debug("Obtained entity resolver " + entityResolver + " for jboss-portlet.xml");
+ }
+ unmarshaller.setEntityResolver(entityResolver);
jbossAppMD = (JBossApplicationMetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter(factory), null);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -36,6 +36,7 @@
import org.jboss.portal.server.deployment.jboss.Deployment;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
+import org.xml.sax.EntityResolver;
import javax.management.MBeanServer;
import java.io.InputStream;
@@ -76,6 +77,19 @@
/** . */
protected JBossApplicationMetaData standardJBossApplicationMetaData;
+ /** . */
+ protected EntityResolver jbossPortletEntityResolver;
+
+ public EntityResolver getJBossPortletEntityResolver()
+ {
+ return jbossPortletEntityResolver;
+ }
+
+ public void setJBossPortletEntityResolver(EntityResolver jbossPortletEntityResolver)
+ {
+ this.jbossPortletEntityResolver = jbossPortletEntityResolver;
+ }
+
public ServerConfig getConfig()
{
return config;
Modified: trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebApp.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebApp.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebApp.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -25,12 +25,15 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.XML;
+import org.jboss.portal.common.xml.NullEntityResolver;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
+import org.xml.sax.EntityResolver;
import javax.servlet.ServletContext;
import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.DocumentBuilder;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -170,7 +173,12 @@
return done;
}
- protected final void init(ServletContext servletContext, URL url, ClassLoader loader, String contextPath) throws CannotCreatePortletWebAppException
+ protected final void init(
+ ServletContext servletContext,
+ URL url,
+ ClassLoader loader,
+ String contextPath,
+ EntityResolver jbossAppEntityResolver) throws CannotCreatePortletWebAppException
{
this.servletContext = servletContext;
this.url = url;
@@ -179,7 +187,7 @@
this.id = contextPath;
//
- readJBossAppDescriptor();
+ readJBossAppDescriptor(jbossAppEntityResolver);
// Override the id if not null
if (descriptor != null)
@@ -199,7 +207,7 @@
*
* @return the app id or null if it does not exists
*/
- private void readJBossAppDescriptor()
+ private void readJBossAppDescriptor(EntityResolver jbossAppEntityResolver)
{
// Look for jboss-app.xml override
InputStream in = null;
@@ -208,7 +216,18 @@
in = Tools.safeBufferedWrapper(getServletContext().getResourceAsStream("/WEB-INF/jboss-app.xml"));
if (in != null)
{
- descriptor = XML.getDocumentBuilderFactory().newDocumentBuilder().parse(in);
+ DocumentBuilder builder = XML.getDocumentBuilderFactory().newDocumentBuilder();
+ if (jbossAppEntityResolver == null)
+ {
+ log.debug("Coult not obtain entity resolver for jboss-app.xml");
+ jbossAppEntityResolver = new NullEntityResolver();
+ }
+ else
+ {
+ log.debug("Obtained entity resolver " + jbossAppEntityResolver + " for jboss-app.xml");
+ }
+ builder.setEntityResolver(jbossAppEntityResolver);
+ descriptor = builder.parse(in);
}
}
catch (IOException e)
Modified: trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebAppFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebAppFactory.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebAppFactory.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -24,6 +24,7 @@
import org.apache.log4j.Logger;
import org.jboss.web.WebApplication;
+import org.xml.sax.EntityResolver;
import javax.management.MBeanServer;
import java.lang.reflect.Method;
@@ -59,18 +60,18 @@
*
* @return the portal web app or null if it cannot be created.
*/
- public PortalWebApp create(WebApplication webApp) throws CannotCreatePortletWebAppException
+ public PortalWebApp create(WebApplication webApp, EntityResolver jbossAppEntityResolver) throws CannotCreatePortletWebAppException
{
int version = getVersion();
switch (version)
{
case TOMCAT4:
- return new PortalWebTomcat4App(webApp);
+ return new PortalWebTomcat4App(webApp, jbossAppEntityResolver);
case TOMCAT5:
- return new PortalWebTomcat5App(webApp, server);
+ return new PortalWebTomcat5App(webApp, server, jbossAppEntityResolver);
case TOMCAT6:
// For now trying to build TC6 with TC5 web app
- return new PortalWebTomcat5App(webApp, server);
+ return new PortalWebTomcat5App(webApp, server, jbossAppEntityResolver);
default:
throw new CannotCreatePortletWebAppException("JBossWeb cannot handle it : " + version);
}
Modified: trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat4App.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat4App.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat4App.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -24,6 +24,7 @@
import org.jboss.portal.server.servlet.CommandServlet;
import org.jboss.web.WebApplication;
+import org.xml.sax.EntityResolver;
import javax.servlet.ServletContext;
import java.lang.reflect.Array;
@@ -43,7 +44,7 @@
private final WebApplication webApp;
- public PortalWebTomcat4App(WebApplication webApp) throws CannotCreatePortletWebAppException
+ public PortalWebTomcat4App(WebApplication webApp, EntityResolver jbossAppEntityResolver) throws CannotCreatePortletWebAppException
{
try
{
@@ -56,7 +57,7 @@
URL url = webApp.getURL();
//
- init(servletContext, url, null, contextPath);
+ init(servletContext, url, null, contextPath, jbossAppEntityResolver);
}
catch (Exception e)
{
Modified: trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -25,6 +25,7 @@
import org.jboss.portal.server.servlet.CommandFilter;
import org.jboss.portal.server.servlet.CommandServlet;
import org.jboss.web.WebApplication;
+import org.xml.sax.EntityResolver;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -47,7 +48,7 @@
private final Object standardContext;
private final WebApplication webApp;
- public PortalWebTomcat5App(WebApplication webApp, MBeanServer server) throws CannotCreatePortletWebAppException
+ public PortalWebTomcat5App(WebApplication webApp, MBeanServer server, EntityResolver jbossAppEntityResolver) throws CannotCreatePortletWebAppException
{
try
{
@@ -64,7 +65,7 @@
URL url = webApp.getURL();
//
- init(servletContext, url, loader, contextPath);
+ init(servletContext, url, loader, contextPath, jbossAppEntityResolver);
}
catch (Exception e)
{
Modified: trunk/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java 2007-01-24 22:24:36 UTC (rev 6090)
+++ trunk/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java 2007-01-24 23:44:25 UTC (rev 6091)
@@ -26,6 +26,7 @@
import org.jboss.deployment.SubDeployer;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.web.WebApplication;
+import org.xml.sax.EntityResolver;
import javax.management.Notification;
import javax.management.NotificationListener;
@@ -69,15 +70,25 @@
/** The right classloader for fixing the issue with the fact that the classloader is not good on event notifications. */
private ClassLoader classLoader;
- /**
- *
- */
+ /** The entity resolver for jboss-app.xml. */
+ private EntityResolver jbossAppEntityResolver;
+
public WebAppIntercepter()
{
deployments = Collections.synchronizedMap(new HashMap());
classLoader = Thread.currentThread().getContextClassLoader();
}
+ public EntityResolver getJBossAppEntityResolver()
+ {
+ return jbossAppEntityResolver;
+ }
+
+ public void setJBossAppEntityResolver(EntityResolver jbossAppEntityResolver)
+ {
+ this.jbossAppEntityResolver = jbossAppEntityResolver;
+ }
+
/** Set the deployer on this service. */
public void setInterceptedDeployer(ObjectName interceptedDeployer)
{
@@ -143,7 +154,7 @@
if (start)
{
WebApplication webApp = findWebApp(info);
- PortalWebApp pwa = factory.create(webApp);
+ PortalWebApp pwa = factory.create(webApp, jbossAppEntityResolver);
deployments.put(keyURL, pwa);
log.debug("Seen URL " + keyURL + " about to deploy");
deploy(pwa);
@@ -197,7 +208,7 @@
URL keyURL = webApp.getDeploymentInfo().url;
if (!deployments.containsKey(keyURL))
{
- PortalWebApp pwa = factory.create(webApp);
+ PortalWebApp pwa = factory.create(webApp, jbossAppEntityResolver);
deployments.put(keyURL, pwa);
log.debug("Seen URL " + keyURL + " about to deploy");
deploy(pwa);
17 years, 4 months
JBoss Portal SVN: r6090 - in trunk: cms/src/main/org/jboss/portal/cms/impl/interceptors and 12 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-01-24 17:24:36 -0500 (Wed, 24 Jan 2007)
New Revision: 6090
Added:
trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationManager.java
trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationManagerImpl.java
trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
trunk/cms/src/main/org/jboss/portal/cms/security/CMSPermission.java
trunk/cms/src/main/org/jboss/portal/cms/security/PortalCMSSecurityContext.java
trunk/core/src/resources/portal-cms-sar/
trunk/core/src/resources/portal-cms-sar/META-INF/
Removed:
trunk/cms/src/main/org/jboss/portal/cms/security/PermissionManager.java
trunk/cms/src/main/org/jboss/portal/cms/security/PortalSecurityContext.java
trunk/cms/src/main/org/jboss/portal/cms/security/SecurityContext.java
Modified:
trunk/cms/build.xml
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProvider.java
trunk/cms/src/main/org/jboss/portal/cms/security/Permission.java
trunk/cms/src/main/org/jboss/portal/test/cms/commands/SecureCommandTestCase.java
trunk/core-cms/
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
trunk/core-management/
trunk/core-samples/
trunk/registration/
trunk/workflow/
Log:
Integrate the CMS Fine Grained Security Infrastructure with the Portal Security SPI - JBPORTAL-1150
Modified: trunk/cms/build.xml
===================================================================
--- trunk/cms/build.xml 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/cms/build.xml 2007-01-24 22:24:36 UTC (rev 6090)
@@ -111,7 +111,7 @@
<path refid="jgroups.jgroups.classpath"/>
<path refid="sun.servlet.classpath"/>
<!-- jbpm integration -->
- <path refid="jbpm.jbpm.classpath"/>
+ <path refid="jbpm.jbpm.classpath"/>
</path>
@@ -131,6 +131,7 @@
<path refid="jboss.portal-test.classpath"/>
<!-- fine grained security integration -->
<path refid="jboss.portal-identity.classpath"/>
+ <path refid="jboss.portal-security.classpath"/>
<!-- clustered testcases related -->
<path refid="jboss.portal-portlet.classpath"/>
<path refid="jboss.portlet-api.classpath"/>
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -31,10 +31,14 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.portal.security.PortalPermission;
+
import org.jboss.portal.cms.CMSException;
import org.jboss.portal.cms.CMSInterceptor;
import org.jboss.portal.cms.impl.jcr.JCRCommand;
@@ -53,7 +57,6 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.db.HibernateRoleImpl;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.AnnonymousRole;
@@ -65,13 +68,8 @@
*
*/
public class ACLInterceptor extends CMSInterceptor
-{
+{
/**
- *
- */
- private AuthorizationProvider authorizationProvider = null;
-
- /**
* default security policy that the cms service should be booted with
*/
private String defaultPolicy = null;
@@ -88,38 +86,30 @@
/**
*
+ */
+ private AuthorizationManager authorizationManager = null;
+
+
+
+ /**
+ *
* @return
*/
- public String getAuthorizationProviderClass()
+ public AuthorizationManager getAuthorizationManager()
{
- String authorizationProviderStr = null;
- if(this.authorizationProvider!=null)
- {
- authorizationProviderStr = authorizationProvider.getClass().getName();
- }
- return authorizationProviderStr;
+ return this.authorizationManager;
}
/**
*
- * @param authorizationProviderStr
+ * @param authorizationManager
*/
- public void setAuthorizationProviderClass(String authorizationProviderStr)
+ public void setAuthorizationManager(AuthorizationManager authorizationManager)
{
- try
- {
- this.authorizationProvider = (AuthorizationProvider)Thread.currentThread().
- getContextClassLoader().loadClass(authorizationProviderStr).newInstance();
- }
- catch(Exception e)
- {
- this.authorizationProvider = null;
- this.stop();
- throw new RuntimeException(e);
- }
+ this.authorizationManager = authorizationManager;
}
- /**
+ /**
*
* @return
*/
@@ -189,12 +179,13 @@
//setup the security context with enough information for the authorization provider
//to be able to make an enforcement decision
- PortalSecurityContext securityContext = new PortalSecurityContext(user);
+ PortalCMSSecurityContext securityContext = new PortalCMSSecurityContext(user);
securityContext.setAttribute("command",invocation);
//perform access check
- boolean allowAccess = this.authorizationProvider.hasAccess(securityContext);
+ PortalPermission cmsPermission = new CMSPermission(securityContext);
+ boolean allowAccess = this.authorizationManager.checkPermission(cmsPermission);
tx.commit();
Tools.closeSession(session);
@@ -226,7 +217,7 @@
* @param response
* @return
*/
- private Object applyFilter(Object response,PortalSecurityContext securityContext)
+ private Object applyFilter(Object response,PortalCMSSecurityContext securityContext)
{
Session session = Tools.getOpenSession();
Transaction tx = session.beginTransaction();
@@ -245,8 +236,9 @@
for(Iterator itr=folder.getFolders().iterator();itr.hasNext();)
{
Folder cour = (Folder)itr.next();
- securityContext.setAttribute("applyFilter",cour.getBasePath());
- boolean allow = this.authorizationProvider.hasAccess(securityContext);
+ securityContext.setAttribute("applyFilter",cour.getBasePath());
+ PortalPermission cmsPermission = new CMSPermission(securityContext);
+ boolean allow = this.authorizationManager.checkPermission(cmsPermission);
if(allow)
{
filteredFolders.add(cour);
@@ -256,7 +248,8 @@
{
File cour = (File)itr.next();
securityContext.setAttribute("applyFilter",cour.getBasePath());
- boolean allow = this.authorizationProvider.hasAccess(securityContext);
+ PortalPermission cmsPermission = new CMSPermission(securityContext);
+ boolean allow = this.authorizationManager.checkPermission(cmsPermission);
if(allow)
{
filteredFiles.add(cour);
@@ -286,6 +279,8 @@
{
super.startService();
+ log.info("AuthorizationManager initialized="+this.authorizationManager);
+
Tools.init(this.jndiName);
try
@@ -336,8 +331,10 @@
for(Iterator itr=parsedPermissions.iterator();itr.hasNext();)
{
Permission permission = (Permission)itr.next();
- permission.addCriteria(new Criteria(name,value));
- PermissionManager.getInstance().store(permission);
+ permission.addCriteria(new Criteria(name,value));
+ Set securityBinding = new HashSet();
+ securityBinding.add(permission);
+ this.authorizationManager.getProvider().setSecurityBindings(null,securityBinding);
}
tx.commit();
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -30,12 +30,11 @@
import org.jboss.portal.cms.impl.jcr.JCRCommand;
import org.jboss.portal.cms.impl.jcr.composite.NewFileCommand;
import org.jboss.portal.cms.impl.jcr.composite.UpdateFileCommand;
-import org.jboss.portal.cms.security.AuthorizationProvider;
-import org.jboss.portal.cms.security.PortalSecurityContext;
-import org.jboss.portal.cms.security.SecurityContext;
+import org.jboss.portal.cms.security.PortalCMSSecurityContext;
import org.jboss.portal.cms.security.Permission;
-import org.jboss.portal.cms.security.PermissionManager;
import org.jboss.portal.cms.security.Criteria;
+import org.jboss.portal.cms.security.AuthorizationManager;
+
import org.jboss.portal.identity.User;
/**
@@ -45,7 +44,7 @@
* @author Sohil Shah - sohil.shah(a)jboss.com - Nov 28, 2006
*
*/
-public class ACLEnforcer implements AuthorizationProvider
+public class ACLEnforcer
{
private Collection readCommands = new ArrayList(); //a list of commands that perform read action on the cms
private Collection writeCommands = new ArrayList();//a list of commands that perform write action on the cms
@@ -55,14 +54,17 @@
private static final int write = 1;
private static final int manage = 2;
+ private AuthorizationManager authorizationManager = null;
+
/**
*
*
*/
- public ACLEnforcer()
+ public ACLEnforcer(AuthorizationManager authorizationManager)
{
super();
+ this.authorizationManager = authorizationManager;
String packageName = "org.jboss.portal.cms.impl.jcr.command.";
@@ -96,12 +98,11 @@
* @param securityContext
* @return
*/
- public boolean hasAccess(SecurityContext context)
+ public boolean hasAccess(PortalCMSSecurityContext cmsSecurityContext)
{
- boolean hasAccess = true;
- PortalSecurityContext portalSecurityContext = (PortalSecurityContext)context;
- User loggedInUser = (User)portalSecurityContext.getIdentity();
- JCRCommand command = (JCRCommand)portalSecurityContext.getAttribute("command");
+ boolean hasAccess = true;
+ User loggedInUser = (User)cmsSecurityContext.getIdentity();
+ JCRCommand command = (JCRCommand)cmsSecurityContext.getAttribute("command");
int actionCode = -1;
if(command != null)
@@ -125,9 +126,9 @@
default:
//check if a filter needs to be applied here......
//only show resources that the user has write or more access to
- if(context.getAttribute("applyFilter")!=null)
+ if(cmsSecurityContext.getAttribute("applyFilter")!=null)
{
- String path = (String)context.getAttribute("applyFilter");
+ String path = (String)cmsSecurityContext.getAttribute("applyFilter");
hasAccess = this.computeToolAccess(loggedInUser,path);
}
break;
@@ -375,7 +376,9 @@
for(Iterator itr2=userPermissions.iterator();itr2.hasNext();)
{
Permission userPermission = (Permission)itr2.next();
- if(userPermission.getService().equals("cms") && userPermission.getAction().equals(action))
+ if( userPermission.getService().equals("cms") &&
+ this.isActionImplied(userPermission.getAction(),action)
+ )
{
String pathCriteria = userPermission.findCriteriaValue("path");
if(pathCriteria.equals(currentNode))
@@ -496,16 +499,19 @@
{
Collection permissions = null;
long userId = 0;
+
if(user!=null)
{
//this is not an anonymous access
userId = ((Long)user.getId()).longValue();
- permissions = PermissionManager.getInstance().findPermissionsByUser(userId);
+ String uri = this.authorizationManager.getProvider().getUserURI(String.valueOf(userId));
+ permissions = this.authorizationManager.getProvider().getSecurityBindings(uri);
}
else
{
//this is an anonymous access
- permissions = PermissionManager.getInstance().findPermissionsByRole(0);
+ String uri = this.authorizationManager.getProvider().getRoleURI(String.valueOf(0));
+ permissions = this.authorizationManager.getProvider().getSecurityBindings(uri);
}
return permissions;
}
@@ -518,7 +524,11 @@
private Collection getPermissions(String path)
{
Criteria criteria = new Criteria("path",path);
- return PermissionManager.getInstance().findPermissionsByCriteria(criteria);
+
+ String uri = this.authorizationManager.getProvider().
+ getCriteriaURI(criteria.getName(), criteria.getValue());
+
+ return this.authorizationManager.getProvider().getSecurityBindings(uri);
}
/**
@@ -618,4 +628,39 @@
return match;
}
+
+ /**
+ *
+ * @param action
+ * @param impliedTarget
+ * @return
+ */
+ private boolean isActionImplied(String action,String impliedTarget)
+ {
+ boolean implied = false;
+
+ if(impliedTarget.equalsIgnoreCase("read"))
+ {
+ if(action.equalsIgnoreCase("read") || action.equalsIgnoreCase("write") || action.equalsIgnoreCase("manage"))
+ {
+ implied = true;
+ }
+ }
+ else if(impliedTarget.equalsIgnoreCase("write"))
+ {
+ if(action.equalsIgnoreCase("write") || action.equalsIgnoreCase("manage"))
+ {
+ implied = true;
+ }
+ }
+ else if(impliedTarget.equalsIgnoreCase("manage"))
+ {
+ if(action.equalsIgnoreCase("manage"))
+ {
+ implied = true;
+ }
+ }
+
+ return implied;
+ }
}
Added: trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationManager.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationManager.java (rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationManager.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
+
+/**
+ * Created on : Jan 24, 2007
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ *
+ */
+public interface AuthorizationManager extends
+PortalAuthorizationManagerFactory,
+PortalAuthorizationManager
+{
+ /**
+ *
+ * @return
+ */
+ public AuthorizationProvider getProvider();
+}
Added: trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationManagerImpl.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationManagerImpl.java (rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationManagerImpl.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -0,0 +1,137 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import javax.security.auth.Subject;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import org.jboss.portal.security.PortalPermission;
+import org.jboss.portal.security.PortalSecurityException;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+
+import org.jboss.portal.cms.impl.jcr.command.ACLEnforcer;
+import org.jboss.portal.common.util.JNDI;
+
+/**
+ * Created on : Jan 23, 2007
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ *
+ */
+public class AuthorizationManagerImpl extends AbstractJBossService implements AuthorizationManager
+{
+ /**
+ *
+ */
+ private ACLEnforcer enforcer = null;
+
+ /**
+ *
+ */
+ private AuthorizationProvider provider = null;
+
+ /**
+ *
+ */
+ private String jndiName = null;
+ private JNDI.Binding jndiBinding = null;
+
+ /**
+ *
+ * @return
+ */
+ public AuthorizationProvider getProvider()
+ {
+ return provider;
+ }
+
+ /**
+ *
+ * @param provider
+ */
+ public void setProvider(AuthorizationProvider provider)
+ {
+ this.provider = provider;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getJNDIName()
+ {
+ return this.jndiName;
+ }
+
+ /**
+ *
+ * @param jndiName
+ */
+ public void setJNDIName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ /**
+ *
+ */
+ public void startService() throws Exception
+ {
+ super.startService();
+
+ //perform jndi registration for this service
+ if (this.jndiName != null)
+ {
+ jndiBinding = new JNDI.Binding(jndiName, this);
+ jndiBinding.bind();
+ }
+
+ //initialize the authorization/policy enforcer
+ enforcer = new ACLEnforcer(this);
+ }
+
+ //---PortalAuthorizationManagerFactory implementation-----------------------------------------------
+ /**
+ *
+ */
+ public PortalAuthorizationManager getManager() throws PortalSecurityException
+ {
+ return this;
+ }
+ //---PortalAuthorizationManager implementation-------------------------------------------------------
+ /**
+ *
+ */
+ public boolean checkPermission(PortalPermission permission) throws PortalSecurityException
+ {
+ return this.enforcer.hasAccess(((CMSPermission)permission).getSecurityContext());
+ }
+
+ /**
+ *
+ */
+ public boolean checkPermission(Subject checkedSubject, PortalPermission permission) throws PortalSecurityException
+ {
+ return this.checkPermission(permission);
+ }
+}
Modified: trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProvider.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProvider.java 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProvider.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -1,39 +1,58 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.
-*/
+/******************************************************************************
+ * 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.cms.security;
+import org.jboss.portal.security.spi.provider.AuthorizationDomain;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+
/**
- *
- * @author Sohil Shah - sohil.shah(a)jboss.com - Nov 27, 2006
+ * Created on : Jan 24, 2007
+ * @author Sohil Shah - sohil.shah(a)jboss.com
*
*/
-public interface AuthorizationProvider
+public interface AuthorizationProvider extends
+AuthorizationDomain,
+DomainConfigurator
{
- /**
- * Checks if the currently logged in user has the necessary privileges to access the resources
- * encapsulated within the securityContext
- *
- * @param context security context containing the information used to enforce access control
- * @return true - access should be granted, false - access should not be granted
- */
- public boolean hasAccess(SecurityContext context);
+ /**
+ *
+ * @param userId
+ * @return
+ */
+ public String getUserURI(String userId);
+
+ /**
+ *
+ * @param roleId
+ * @return
+ */
+ public String getRoleURI(String roleId);
+
+ /**
+ *
+ * @param name
+ * @param value
+ * @return
+ */
+ public String getCriteriaURI(String name,String value);
}
Added: trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java (rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -0,0 +1,358 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.Iterator;
+import java.util.HashSet;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.jboss.portal.cms.hibernate.state.Tools;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.security.spi.provider.PermissionFactory;
+import org.jboss.portal.security.spi.provider.PermissionRepository;
+import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
+
+/**
+ * Created on : Jan 23, 2007
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ *
+ */
+public class AuthorizationProviderImpl extends AbstractJBossService implements AuthorizationProvider
+{
+ /**
+ *
+ */
+ public void startService() throws Exception
+ {
+ super.startService();
+ }
+
+ //------AuthorizationDomain impl-----------------------------------------------------------------
+ /**
+ *
+ */
+ public DomainConfigurator getConfigurator()
+ {
+ return this;
+ }
+
+ /**
+ *
+ */
+ public PermissionFactory getPermissionFactory()
+ {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public PermissionRepository getPermissionRepository()
+ {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public String getType()
+ {
+ return this.getClass().getName();
+ }
+ //------DomainConfigurator impl------------------------------------------------------------------
+ /**
+ *
+ */
+ public void setSecurityBindings(String uri, Set securityBindings) throws SecurityConfigurationException
+ {
+ if(securityBindings != null)
+ {
+ for(Iterator itr=securityBindings.iterator();itr.hasNext();)
+ {
+ Permission securityBinding = (Permission)itr.next();
+ if(securityBinding.getRoles()!=null || securityBinding.getUsers()!=null)
+ {
+ this.store(securityBinding,securityBinding.getRoles(),securityBinding.getUsers());
+ }
+ else
+ {
+ this.store(securityBinding);
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ public void removeSecurityBindings(String uri) throws SecurityConfigurationException
+ {
+ Set permissions = this.getSecurityBindings(uri);
+ this.remove(permissions);
+ }
+
+ /**
+ *
+ */
+ public Set getSecurityBindings(String uri)
+ {
+ Set permissions = new HashSet();
+
+ if(uri.startsWith("user://"))
+ {
+ String userId = uri.substring("user://".length());
+ Collection cour = this.findPermissionsByUser(Long.parseLong(userId));
+ if(cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+ else if(uri.startsWith("role://"))
+ {
+ String roleId = uri.substring("role://".length());
+ Collection cour = this.findPermissionsByRole(Long.parseLong(roleId));
+ if(cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+ else if(uri.startsWith("criteria://"))
+ {
+ String criteria = uri.substring("criteria://".length());
+ int index = criteria.indexOf('/');
+ String name = criteria.substring(0,index);
+ String value = criteria.substring(index+1);
+ Criteria input = new Criteria(name,value);
+ Collection cour = this.findPermissionsByCriteria(input);
+ if(cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+
+ return permissions;
+ }
+ //---------URIFactory impl-----------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ public String getUserURI(String userId)
+ {
+ return "user://"+userId;
+ }
+
+ /**
+ *
+ * @param roleId
+ * @return
+ */
+ public String getRoleURI(String roleId)
+ {
+ return "role://"+roleId;
+ }
+
+ /**
+ *
+ * @param name
+ * @param value
+ * @return
+ */
+ public String getCriteriaURI(String name,String value)
+ {
+ return "criteria://"+name+"/"+value;
+ }
+ //--------------------------------------------------------------------------------------------------------------
+ /**
+ * Stores a permission and its associations into peristent storage
+ *
+ * @param permission - Permission to be persisted
+ * @param roles - Roles associated with this permission
+ * @param users - Individual users associated with this permission
+ */
+ private void store(Permission permission,Collection roles,Collection users)
+ {
+ //setup the role association
+ if(roles != null)
+ {
+ Set roleAssoc = new HashSet();
+ for(Iterator itr=roles.iterator();itr.hasNext();)
+ {
+ Role role = (Role)itr.next();
+ PermRoleAssoc cour = new PermRoleAssoc();
+ if(role.getId()!=null)
+ {
+ cour.setRoleId(((Long)role.getId()).longValue());
+ }
+ roleAssoc.add(cour);
+ }
+ permission.setRoleAssoc(roleAssoc);
+ }
+ else
+ {
+ permission.setRoleAssoc(null);
+ }
+
+
+ //setup the user association
+ if(users != null)
+ {
+ Set userAssoc = new HashSet();
+ for(Iterator itr=users.iterator();itr.hasNext();)
+ {
+ User user = (User)itr.next();
+ PermUserAssoc cour = new PermUserAssoc();
+ cour.setUserId(((Long)user.getId()).longValue());
+ userAssoc.add(cour);
+ }
+ permission.setUserAssoc(userAssoc);
+ }
+ else
+ {
+ permission.setUserAssoc(null);
+ }
+
+ //persist this into the database
+ this.store(permission);
+ }
+
+ /**
+ * Stores a permission and its associations into peristent storage
+ *
+ * @param permission - Permission to be persisted
+ */
+ private void store(Permission permission)
+ {
+ //persist this into the database
+ Session session = Tools.getCurrentSession();
+ session.saveOrUpdate(permission);
+ }
+
+ /**
+ * Deletes the specified permissions from the database
+ *
+ * @param permissions
+ */
+ private void remove(Collection permissions)
+ {
+ Session session = Tools.getCurrentSession();
+ if(permissions!=null)
+ {
+ for(Iterator itr=permissions.iterator();itr.hasNext();)
+ {
+ Permission permission = (Permission)itr.next();
+ session.delete(permission);
+ }
+ }
+ }
+
+
+ /**
+ * Returns all permissions associated with the specified user
+ *
+ * @param user
+ * @return
+ */
+ private Collection findPermissionsByUser(long userId)
+ {
+ Collection permissions = new HashSet();
+
+ String lookupByUser = "SELECT permission from Permission permission JOIN permission.userAssoc user WHERE user.userId=?";
+ String lookupByRole = "SELECT * from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m WHERE " +
+ "p.id=r.cms_perm_id AND " +
+ "r.role_id=m.jbp_rid AND " +
+ "m.jbp_uid=?";
+
+ Session session = Tools.getCurrentSession();
+
+ //perform lookup by explicitly specified users
+ Query userQuery = session.createQuery(lookupByUser);
+ userQuery.setLong(0,userId);
+ userQuery.setCacheable(true);
+ permissions.addAll(userQuery.list());
+
+
+ //perform lookup based on role membership
+ Query roleQuery = session.createSQLQuery(lookupByRole).addEntity(Permission.class);
+ roleQuery.setLong(0,userId);
+ roleQuery.setCacheable(true);
+ permissions.addAll(roleQuery.list());
+
+ return permissions;
+ }
+
+ /**
+ * Returns all permissions associated with the specified role
+ *
+ * @param role
+ * @return
+ */
+ private Collection findPermissionsByRole(long roleId)
+ {
+ Collection permissions = new HashSet();
+
+ String lookupByRole = "SELECT permission from Permission permission JOIN permission.roleAssoc role WHERE role.roleId=?";
+
+ Session session = Tools.getCurrentSession();
+
+ //perform lookup by explicitly specified users
+ Query roleQuery = session.createQuery(lookupByRole);
+ roleQuery.setLong(0,roleId);
+ roleQuery.setCacheable(true);
+ permissions.addAll(roleQuery.list());
+
+
+ return permissions;
+ }
+
+ /**
+ * Return all permissions that match the specified criteria
+ *
+ * @param criteria
+ * @return
+ */
+ private Collection findPermissionsByCriteria(Criteria criteria)
+ {
+ Collection permissions = new HashSet();
+
+ String lookupByCriteria = "SELECT permission from Permission permission JOIN permission.criteria criteria WHERE criteria.name=? AND criteria.value=?";
+
+ Session session = Tools.getCurrentSession();
+
+ //perform lookup by explicitly specified users
+ Query criteriaQuery = session.createQuery(lookupByCriteria);
+ criteriaQuery.setString(0,criteria.getName());
+ criteriaQuery.setString(1,criteria.getValue());
+ criteriaQuery.setCacheable(true);
+ permissions.addAll(criteriaQuery.list());
+
+
+ return permissions;
+ }
+}
Added: trunk/cms/src/main/org/jboss/portal/cms/security/CMSPermission.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/CMSPermission.java (rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/CMSPermission.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * 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.cms.security;
+
+
+import javax.security.auth.Subject;
+
+import org.jboss.portal.security.PortalPermission;
+import org.jboss.portal.security.PortalSecurityException;
+import org.jboss.portal.security.spi.provider.PermissionRepository;
+
+/**
+ * Created on : Jan 23, 2007
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ *
+ */
+public class CMSPermission extends PortalPermission
+{
+ private PortalCMSSecurityContext securityContext = null;
+
+ /**
+ *
+ */
+ public CMSPermission(String name, String uri)
+ {
+ super(name,uri);
+ }
+
+ /**
+ *
+ * @param wrappedPermission
+ */
+ public CMSPermission(PortalCMSSecurityContext securityContext)
+ {
+ super("","");
+ this.securityContext = securityContext;
+ }
+
+ //--------PortalPermission implementation------------------------------------------------------------
+ /**
+ *
+ */
+ public String getType()
+ {
+ return this.getClass().getName();
+ }
+
+ /**
+ *
+ */
+ public boolean implies(PermissionRepository repository, Subject caller,
+ String roleName, PortalPermission permission)
+ throws PortalSecurityException
+ {
+ return false;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public PortalCMSSecurityContext getSecurityContext()
+ {
+ return this.securityContext;
+ }
+ //-------Permission implementation------------------------------------------------------------------
+ /**
+ *
+ */
+ public boolean equals(Object obj)
+ {
+ return false;
+ }
+
+ /**
+ *
+ */
+ public String getActions()
+ {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public int hashCode()
+ {
+ return 0;
+ }
+
+ /**
+ *
+ */
+ public boolean implies(java.security.Permission permission)
+ {
+ return false;
+ }
+}
Modified: trunk/cms/src/main/org/jboss/portal/cms/security/Permission.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/Permission.java 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/Permission.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -37,8 +37,8 @@
*
*/
private long id = 0; //unique id for this permission object in the storage (typically database)
- private String service = null;
- private String action = null;
+ private String service = null; //portal service that this permission applies to like cms etc
+ private String action = null; //action on the service that needs to be protected
private boolean isNegated = false;
/**
@@ -50,6 +50,12 @@
/**
*
+ */
+ private Set roles = null; //these are information carrying fields, they are not persisted in the database
+ private Set users = null; //these are information carrying fields, they are not persisted in the database
+
+ /**
+ *
*
*/
public Permission()
@@ -306,11 +312,47 @@
}
return ids;
}
-
/**
*
+ * @return
*/
+ public Set getRoles()
+ {
+ return roles;
+ }
+
+ /**
+ *
+ * @param roles
+ */
+ public void setRoles(Set roles)
+ {
+ this.roles = roles;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Set getUsers()
+ {
+ return users;
+ }
+
+ /**
+ *
+ * @param users
+ */
+ public void setUsers(Set users)
+ {
+ this.users = users;
+ }
+
+
+ /**
+ *
+ */
public String toString()
{
StringBuffer buffer = new StringBuffer();
Deleted: trunk/cms/src/main/org/jboss/portal/cms/security/PermissionManager.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/PermissionManager.java 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/PermissionManager.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -1,240 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.cms.security;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.HashSet;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-
-
-import org.jboss.portal.cms.hibernate.state.Tools;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.Role;
-
-/**
- * PermissionManager is used to manage (create,read,update,delete) permissions stored in the database
- *
- * @author Sohil Shah - sohil.shah(a)jboss.com - Dec 1, 2006
- *
- */
-public class PermissionManager
-{
- /**
- * the singleton instance. This is a stateless component
- */
- private static PermissionManager singleton = null;
-
- /**
- *
- *
- */
- private PermissionManager()
- {
- super();
- }
-
- /**
- *
- * @return
- */
- public static PermissionManager getInstance()
- {
- if(PermissionManager.singleton==null)
- {
- PermissionManager.singleton = new PermissionManager();
- }
- return PermissionManager.singleton;
- }
-
-
- //PermissionManager API--------------------------------------------------------------------------------------------------------------
- /**
- * Stores a permission and its associations into peristent storage
- *
- * @param permission - Permission to be persisted
- * @param roles - Roles associated with this permission
- * @param users - Individual users associated with this permission
- */
- public void store(Permission permission,Collection roles,Collection users)
- {
- //setup the role association
- if(roles != null)
- {
- Set roleAssoc = new HashSet();
- for(Iterator itr=roles.iterator();itr.hasNext();)
- {
- Role role = (Role)itr.next();
- PermRoleAssoc cour = new PermRoleAssoc();
- if(role.getId()!=null)
- {
- cour.setRoleId(((Long)role.getId()).longValue());
- }
- roleAssoc.add(cour);
- }
- permission.setRoleAssoc(roleAssoc);
- }
- else
- {
- permission.setRoleAssoc(null);
- }
-
-
- //setup the user association
- if(users != null)
- {
- Set userAssoc = new HashSet();
- for(Iterator itr=users.iterator();itr.hasNext();)
- {
- User user = (User)itr.next();
- PermUserAssoc cour = new PermUserAssoc();
- cour.setUserId(((Long)user.getId()).longValue());
- userAssoc.add(cour);
- }
- permission.setUserAssoc(userAssoc);
- }
- else
- {
- permission.setUserAssoc(null);
- }
-
- //persist this into the database
- this.store(permission);
- }
-
- /**
- * Stores a permission and its associations into peristent storage
- *
- * @param permission - Permission to be persisted
- */
- public void store(Permission permission)
- {
- //persist this into the database
- Session session = Tools.getCurrentSession();
- session.saveOrUpdate(permission);
- }
-
- /**
- * Deletes the specified permissions from the database
- *
- * @param permissions
- */
- public void remove(Collection permissions)
- {
- Session session = Tools.getCurrentSession();
- if(permissions!=null)
- {
- for(Iterator itr=permissions.iterator();itr.hasNext();)
- {
- Permission permission = (Permission)itr.next();
- session.delete(permission);
- }
- }
- }
-
-
- /**
- * Returns all permissions associated with the specified user
- *
- * @param user
- * @return
- */
- public Collection findPermissionsByUser(long userId)
- {
- Collection permissions = new HashSet();
-
- String lookupByUser = "SELECT permission from Permission permission JOIN permission.userAssoc user WHERE user.userId=?";
- String lookupByRole = "SELECT * from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m WHERE " +
- "p.id=r.cms_perm_id AND " +
- "r.role_id=m.jbp_rid AND " +
- "m.jbp_uid=?";
-
- Session session = Tools.getCurrentSession();
-
- //perform lookup by explicitly specified users
- Query userQuery = session.createQuery(lookupByUser);
- userQuery.setLong(0,userId);
- userQuery.setCacheable(true);
- permissions.addAll(userQuery.list());
-
-
- //perform lookup based on role membership
- Query roleQuery = session.createSQLQuery(lookupByRole).addEntity(Permission.class);
- roleQuery.setLong(0,userId);
- roleQuery.setCacheable(true);
- permissions.addAll(roleQuery.list());
-
- return permissions;
- }
-
- /**
- * Returns all permissions associated with the specified role
- *
- * @param role
- * @return
- */
- public Collection findPermissionsByRole(long roleId)
- {
- Collection permissions = new HashSet();
-
- String lookupByRole = "SELECT permission from Permission permission JOIN permission.roleAssoc role WHERE role.roleId=?";
-
- Session session = Tools.getCurrentSession();
-
- //perform lookup by explicitly specified users
- Query roleQuery = session.createQuery(lookupByRole);
- roleQuery.setLong(0,roleId);
- roleQuery.setCacheable(true);
- permissions.addAll(roleQuery.list());
-
-
- return permissions;
- }
-
- /**
- * Return all permissions that match the specified criteria
- *
- * @param criteria
- * @return
- */
- public Collection findPermissionsByCriteria(Criteria criteria)
- {
- Collection permissions = new HashSet();
-
- String lookupByCriteria = "SELECT permission from Permission permission JOIN permission.criteria criteria WHERE criteria.name=? AND criteria.value=?";
-
- Session session = Tools.getCurrentSession();
-
- //perform lookup by explicitly specified users
- Query criteriaQuery = session.createQuery(lookupByCriteria);
- criteriaQuery.setString(0,criteria.getName());
- criteriaQuery.setString(1,criteria.getValue());
- criteriaQuery.setCacheable(true);
- permissions.addAll(criteriaQuery.list());
-
-
- return permissions;
- }
-}
Added: trunk/cms/src/main/org/jboss/portal/cms/security/PortalCMSSecurityContext.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/PortalCMSSecurityContext.java (rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/PortalCMSSecurityContext.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -0,0 +1,109 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.cms.security;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.portal.identity.User;
+
+/**
+ * An implementation of SecurityContext for the core Portal Engine
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com - Nov 27, 2006
+ *
+ */
+public class PortalCMSSecurityContext implements Serializable
+{
+ private Map contextMap = null;
+
+ /**
+ * signifies the user currently logged in to the system
+ */
+ private User portalUser = null;
+
+
+ /**
+ *
+ *
+ */
+ public PortalCMSSecurityContext(User portalUser)
+ {
+ super();
+ this.portalUser = portalUser;
+ this.contextMap = new HashMap();
+ }
+
+ /**
+ * This method returns the Identity of the user logged into the portal. The return value is of type
+ * org.jboss.portal.identity.User
+ *
+ * @return Identity related information associated with the user logged into the portal
+ */
+ public Object getIdentity()
+ {
+ return this.portalUser;
+ }
+
+ /**
+ * Returns value corresponding to the specified attribute name
+ *
+ * @param name
+ * @return
+ */
+ public Object getAttribute(String name)
+ {
+ return this.contextMap.get(name);
+ }
+
+ /**
+ * Sets a specified value corresponding to the specified name in the context
+ *
+ * @param name
+ * @param value
+ */
+ public void setAttribute(String name,Object value)
+ {
+ this.contextMap.put(name,value);
+ }
+
+ /**
+ * Removes the specified attribute
+ *
+ * @param name
+ */
+ public void removeAttribute(String name)
+ {
+ this.contextMap.remove(name);
+ }
+
+ /**
+ * Returns an array of Strings consisting of all keys/names stored in the context
+ *
+ * @return
+ */
+ public String[] getAttributeNames()
+ {
+ return (String[])this.contextMap.keySet().toArray();
+ }
+}
Deleted: trunk/cms/src/main/org/jboss/portal/cms/security/PortalSecurityContext.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/PortalSecurityContext.java 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/PortalSecurityContext.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -1,108 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.cms.security;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.portal.identity.User;
-
-/**
- * An implementation of SecurityContext for the core Portal Engine
- *
- * @author Sohil Shah - sohil.shah(a)jboss.com - Nov 27, 2006
- *
- */
-public class PortalSecurityContext implements SecurityContext
-{
- private Map contextMap = null;
-
- /**
- * signifies the user currently logged in to the system
- */
- private User portalUser = null;
-
-
- /**
- *
- *
- */
- public PortalSecurityContext(User portalUser)
- {
- super();
- this.portalUser = portalUser;
- this.contextMap = new HashMap();
- }
-
- /**
- * This method returns the Identity of the user logged into the portal. The return value is of type
- * org.jboss.portal.identity.User
- *
- * @return Identity related information associated with the user logged into the portal
- */
- public Object getIdentity()
- {
- return this.portalUser;
- }
-
- /**
- * Returns value corresponding to the specified attribute name
- *
- * @param name
- * @return
- */
- public Object getAttribute(String name)
- {
- return this.contextMap.get(name);
- }
-
- /**
- * Sets a specified value corresponding to the specified name in the context
- *
- * @param name
- * @param value
- */
- public void setAttribute(String name,Object value)
- {
- this.contextMap.put(name,value);
- }
-
- /**
- * Removes the specified attribute
- *
- * @param name
- */
- public void removeAttribute(String name)
- {
- this.contextMap.remove(name);
- }
-
- /**
- * Returns an array of Strings consisting of all keys/names stored in the context
- *
- * @return
- */
- public String[] getAttributeNames()
- {
- return (String[])this.contextMap.keySet().toArray();
- }
-}
Deleted: trunk/cms/src/main/org/jboss/portal/cms/security/SecurityContext.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/SecurityContext.java 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/SecurityContext.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -1,69 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.cms.security;
-
-/**
- *
- * @author Sohil Shah - sohil.shah(a)jboss.com - Nov 27, 2006
- *
- */
-public interface SecurityContext
-{
- /**
- * This method returns the Identity of the user logged into the portal.
- *
- * @return Identity related information associated with the user logged into the portal
- */
- public Object getIdentity();
-
- /**
- * Returns value corresponding to the specified attribute name
- *
- * @param name
- * @return
- */
- public Object getAttribute(String name);
-
-
- /**
- * Sets a specified value corresponding to the specified name in the context
- *
- * @param name
- * @param value
- */
- public void setAttribute(String name,Object value);
-
- /**
- * Removes the specified attribute
- *
- * @param name
- */
- public void removeAttribute(String name);
-
-
- /**
- * Returns an array of Strings consisting of all keys/names stored in the context
- *
- * @return
- */
- public String[] getAttributeNames();
-}
Modified: trunk/cms/src/main/org/jboss/portal/test/cms/commands/SecureCommandTestCase.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/commands/SecureCommandTestCase.java 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/commands/SecureCommandTestCase.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -51,7 +51,6 @@
//setup the interceptor stack
CMSInterceptorStackFactory stackFactory = new CMSInterceptorStackFactory();
ACLInterceptor aclInterceptor = new ACLInterceptor();
- aclInterceptor.setAuthorizationProviderClass("org.jboss.portal.cms.impl.jcr.command.ACLEnforcer");
Interceptor[] interceptors = new Interceptor[1];
interceptors[0] = aclInterceptor;
JBossInterceptorStack stack = new JBossInterceptorStack(interceptors);
Property changes on: trunk/core-cms
___________________________________________________________________
Name: svn:ignore
- bin
+ bin
*.log
output
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-01-24 22:24:36 UTC (rev 6090)
@@ -37,7 +37,7 @@
import org.jboss.portal.cms.model.Folder;
import org.jboss.portal.cms.security.Criteria;
import org.jboss.portal.cms.security.Permission;
-import org.jboss.portal.cms.security.PermissionManager;
+import org.jboss.portal.cms.security.AuthorizationManager;
import org.jboss.portal.cms.util.FileUtil;
import org.jboss.portal.cms.util.NodeUtil;
import org.jboss.portal.core.cms.command.StreamContentCommand;
@@ -89,6 +89,7 @@
private RoleModule roleModule;
private MembershipModule membershipModule;
private ApprovePublish approvePublish;
+ private AuthorizationManager authorizationManager;
public void init() throws PortletException
{
@@ -96,6 +97,7 @@
userModule = (UserModule)getPortletContext().getAttribute("UserModule");
roleModule = (RoleModule)getPortletContext().getAttribute("RoleModule");
membershipModule = (MembershipModule)getPortletContext().getAttribute("MembershipModule");
+ this.initializeAuthorizationManager();
if (CMSService == null)
{
@@ -113,8 +115,12 @@
{
throw new PortletException("No membership module");
}
+ if(this.authorizationManager == null)
+ {
+ throw new PortletException("Authorization Service not found");
+ }
- this.initializeApprovePublishWorkflow();
+ this.initializeApprovePublishWorkflow();
}
protected void doView(final JBossRenderRequest rReq, final JBossRenderResponse rRes)
@@ -471,8 +477,9 @@
roleSet = roleModule.findRoles();
userSet = userModule.findUsers(0, 1000);
- Collection permissions = PermissionManager.getInstance().
- findPermissionsByCriteria(new Criteria("path", sPath));
+ String uri = this.authorizationManager.getProvider().getCriteriaURI("path", sPath);
+ Collection permissions = this.authorizationManager.getProvider().
+ getSecurityBindings(uri);
readRoleSet = this.processRolePermissions(permissions, "read");
readUserSet = this.processUserPermissions(permissions, "read");
@@ -1164,15 +1171,15 @@
(manageUsers == null || manageUsers.length == 0)
)
{
- //remove all direct permissions on this node
- Collection oldPermissions = PermissionManager.getInstance().findPermissionsByCriteria(new Criteria("path", path));
- PermissionManager.getInstance().remove(oldPermissions);
+ //remove all direct permissions on this node
+ String uri = this.authorizationManager.getProvider().getCriteriaURI("path", path);
+ this.authorizationManager.getProvider().removeSecurityBindings(uri);
return;
}
- //cleanup the old permissions on this node, before new ones are created
- Collection oldPermissions = PermissionManager.getInstance().findPermissionsByCriteria(new Criteria("path", path));
- PermissionManager.getInstance().remove(oldPermissions);
+ //cleanup the old permissions on this node, before new ones are created
+ String uri = this.authorizationManager.getProvider().getCriteriaURI("path", path);
+ this.authorizationManager.getProvider().removeSecurityBindings(uri);
//setup the read permission on this node
this.storePermission("read", path, readRoles, readUsers);
@@ -1227,7 +1234,11 @@
}
}
- PermissionManager.getInstance().store(permission, rolesSet, usersSet);
+ permission.setRoles(rolesSet);
+ permission.setUsers(usersSet);
+ Set securityBinding = new HashSet();
+ securityBinding.add(permission);
+ this.authorizationManager.getProvider().setSecurityBindings(null,securityBinding);
}
/**
@@ -1291,7 +1302,8 @@
if (portletRequest.getUserPrincipal() != null)
{
User user = this.userModule.findUserByUserName(portletRequest.getUserPrincipal().getName());
- Collection permissions = PermissionManager.getInstance().findPermissionsByUser(((Long)user.getId()).longValue());
+ String uri = this.authorizationManager.getProvider().getUserURI(((Long)user.getId()).toString());
+ Collection permissions = this.authorizationManager.getProvider().getSecurityBindings(uri);
if (permissions != null)
{
for (Iterator itr = permissions.iterator(); itr.hasNext();)
@@ -1378,4 +1390,21 @@
{
this.approvePublish = approvePublish;
}
+
+ /**
+ *
+ *
+ */
+ private void initializeAuthorizationManager()
+ {
+ try
+ {
+ InitialContext context = new InitialContext();
+ this.authorizationManager = (AuthorizationManager)context.lookup("java:portal/cms/AuthorizationManager");
+ }
+ catch (Exception e)
+ {
+ this.setApprovePublish(null);
+ }
+ }
}
\ No newline at end of file
Modified: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-01-24 16:55:18 UTC (rev 6089)
+++ trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-01-24 22:24:36 UTC (rev 6090)
@@ -422,8 +422,7 @@
<attribute name="CacheLoaderFetchPersistentState">false</attribute>
<attribute name="CacheLoaderAsynchronous">false</attribute-->
</mbean>
-
-
+
<!-- interceptor factory where all cms interceptors are registered -->
<mbean
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
@@ -434,6 +433,26 @@
<depends-list optional-attribute-name="InterceptorNames">
<depends-list-element>portal:service=Interceptor,type=Cms,name=ACL</depends-list-element>
</depends-list>
+ </mbean>
+
+ <!-- CMS Authorization Security Service -->
+ <mbean
+ code="org.jboss.portal.cms.security.AuthorizationManagerImpl"
+ name="portal:service=AuthorizationManager,type=cms"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="JNDIName">java:portal/cms/AuthorizationManager</attribute>
+ <depends optional-attribute-name="Provider" proxy-type="attribute">
+ portal:service=AuthorizationProvider,type=cms
+ </depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
+ name="portal:service=AuthorizationProvider,type=cms"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
</mbean>
<!-- ACL Security Interceptor -->
@@ -444,7 +463,6 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<attribute name="JNDIName">java:portal/cms/CMSSessionFactory</attribute>
- <attribute name="AuthorizationProviderClass">org.jboss.portal.cms.impl.jcr.command.ACLEnforcer</attribute>
<attribute name="DefaultPolicy">
<![CDATA[
<policy>
@@ -481,13 +499,13 @@
</policy>
]]>
</attribute>
+ <depends optional-attribute-name="AuthorizationManager" proxy-type="attribute">
+ portal:service=AuthorizationManager,type=cms
+ </depends>
<depends>portal:service=Hibernate,type=CMS</depends>
- <depends>portal:service=Module,type=IdentityServiceController</depends>
- <!--<depends optional-attribute-name="RoleModule" proxy-type="attribute">
- portal:service=Module,type=Role
- </depends>-->
+ <depends>portal:service=Module,type=IdentityServiceController</depends>
</mbean>
-
+
<!-- logging interceptor -->
<!--mbean
code="org.jboss.portal.cms.impl.interceptors.LogInterceptor"
@@ -637,5 +655,5 @@
optional-attribute-name="CMS"
proxy-type="attribute">portal:service=CMS</depends>
<attribute name="ContentType">cms</attribute>
- </mbean>
+ </mbean>
</server>
Property changes on: trunk/core-management
___________________________________________________________________
Name: svn:ignore
- bin
+ bin
output
Property changes on: trunk/core-samples
___________________________________________________________________
Name: svn:ignore
+ output
Property changes on: trunk/registration
___________________________________________________________________
Name: svn:ignore
+ output
Property changes on: trunk/workflow
___________________________________________________________________
Name: svn:ignore
+ output
17 years, 4 months
JBoss Portal SVN: r6089 - in trunk: identity and 6 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-01-24 11:55:18 -0500 (Wed, 24 Jan 2007)
New Revision: 6089
Added:
trunk/identity/src/resources/test/config/msad-config.xml
trunk/identity/src/resources/test/config/openldap-config.xml
trunk/test/src/etc/ldap/ldif/initial-tests-qa-msad.ldif
trunk/test/src/etc/ldap/ldif/initial-tests-qa-openldap.ldif
Modified:
trunk/core/src/resources/portal-core-sar/conf/login-config.xml
trunk/identity/build.xml
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java
trunk/test/src/etc/directories.xml
trunk/test/src/etc/opends/config/schema/05-other.ldif
Log:
- added OpenLDAP into testsuite
- small corrections in tests
Modified: trunk/core/src/resources/portal-core-sar/conf/login-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/login-config.xml 2007-01-24 12:09:26 UTC (rev 6088)
+++ trunk/core/src/resources/portal-core-sar/conf/login-config.xml 2007-01-24 16:55:18 UTC (rev 6089)
@@ -41,14 +41,14 @@
that are not mapped as attribute you may have LDAP user synchronized into DB with no password set.
Please see HibernateUserProfileImpl module options "synchronizeNonExistingUsers", "acceptOtherImplementations"
"defaultSynchronizePassword" or "randomSynchronizePassword" to manage this behaviour-->
- <!--<login-module code = "org.jboss.portal.identity.auth.DBIdentityLoginModule" flag="sufficient">
+ <login-module code = "org.jboss.portal.identity.auth.DBIdentityLoginModule" flag="sufficient">
<module-option name="dsJndiName">java:/PortalDS</module-option>
<module-option name="principalsQuery">SELECT jbp_password FROM jbp_users WHERE jbp_uname=?</module-option>
<module-option name="rolesQuery">SELECT jbp_roles.jbp_name, 'Roles' FROM jbp_role_membership INNER JOIN jbp_roles ON jbp_role_membership.jbp_rid = jbp_roles.jbp_rid INNER JOIN jbp_users ON jbp_role_membership.jbp_uid = jbp_users.jbp_uid WHERE jbp_users.jbp_uname=?</module-option>
<module-option name="hashAlgorithm">MD5</module-option>
<module-option name="hashEncoding">HEX</module-option>
<module-option name="additionalRole">Authenticated</module-option>
- </login-module>-->
+ </login-module>
<login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">
<module-option name="unauthenticatedIdentity">guest</module-option>
Modified: trunk/identity/build.xml
===================================================================
--- trunk/identity/build.xml 2007-01-24 12:09:26 UTC (rev 6088)
+++ trunk/identity/build.xml 2007-01-24 16:55:18 UTC (rev 6089)
@@ -454,10 +454,10 @@
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.db.DBIdentityTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.UserProtoTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ConfigurationTestCase"/>-->
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTestCase"/>
+ <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleRoleModuleTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticGroupMembershipModuleTestCase"/>-->
- <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticRoleMembershipModuleTestCase"/>-->
+ <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticRoleMembershipModuleTestCase"/>
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPUserProfileModuleTestCase"/>-->
</x-test>
<x-classpath>
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java 2007-01-24 12:09:26 UTC (rev 6088)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java 2007-01-24 16:55:18 UTC (rev 6089)
@@ -157,7 +157,7 @@
try
{
- log.debug("getUsers(): user DN = " + ldapRole.getDn());
+ log.debug("getUsers(): role DN = " + ldapRole.getDn());
String memberOfName = "";
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java 2007-01-24 12:09:26 UTC (rev 6088)
+++ trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java 2007-01-24 16:55:18 UTC (rev 6089)
@@ -85,21 +85,23 @@
roleModule = (RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
membershipModule = (MembershipModule)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
+ suffix = getDirectoryServerConfigParameter().getCleanUpDN();
+
IdentityConfiguration configuration = (IdentityConfiguration)identityContext.getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION);
Set values = new HashSet();
- values.add("ou=Roles,o=example2,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com");
+ values.add("ou=Roles,o=example2," + suffix);
configuration.setValues(IdentityConfiguration.GROUP_COMMON,IdentityConfiguration.ROLE_CONTAINER_DN, values);
values = new HashSet();
- values.add("ou=People,o=example2,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com");
+ values.add("ou=People,o=example2," + suffix);
configuration.setValues(IdentityConfiguration.GROUP_COMMON, IdentityConfiguration.USER_CONTAINER_DN, values);
values = new HashSet();
values.add("memberOf");
configuration.setValues(IdentityConfiguration.GROUP_COMMON,IdentityConfiguration.MEMBERSHIP_ATTRIBUTE_ID, values);
- suffix = getDirectoryServerConfigParameter().getCleanUpDN();
+
populate();
}
Added: trunk/identity/src/resources/test/config/msad-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/msad-config.xml (rev 0)
+++ trunk/identity/src/resources/test/config/msad-config.xml 2007-01-24 16:55:18 UTC (rev 6089)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+ <!--<!DOCTYPE identity-configuration PUBLIC
+ "-//JBoss Portal//DTD JBoss Identity Configuration 1.0//EN"
+ "http://www.jboss.org/portal/dtd/identity-config_1_0.dtd">-->
+
+<identity-configuration>
+ <datasources>
+ <datasource>
+ <name>LDAP</name>
+ <config>
+ <option>
+ <name>host</name>
+ <value>dev44.qa.atl.jboss.com</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>JBOSS\jbossqa</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>jboss42</value>
+ </option>
+ </config>
+ </datasource>
+ </datasources>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Role</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Membership</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+
+ <module>
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+ <config>
+ <option>
+ <name>profileConfigFile</name>
+ <value>test/config/profile-config.xml</value>
+ </option>
+ <option>
+ <name>ldapModuleJNDIName</name>
+ <value>java:/portal/LDAPUserProfileModule</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>DBDelegateUserProfile</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>LDAPDelegateUserProfile</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ </modules>
+
+ <options>
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userContainerDN</name>
+ <value>ou=People,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ </option>
+ <option>
+ <name>roleContainerDN</name>
+ <value>ou=Roles,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <!--This objectclasses should work with Red Hat Directory-->
+ <value>top</value>
+ <value>person</value>
+ <value>inetOrgPerson</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+ </option-group>
+ </options>
+</identity-configuration>
\ No newline at end of file
Added: trunk/identity/src/resources/test/config/openldap-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/openldap-config.xml (rev 0)
+++ trunk/identity/src/resources/test/config/openldap-config.xml 2007-01-24 16:55:18 UTC (rev 6089)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+ <!--<!DOCTYPE identity-configuration PUBLIC
+ "-//JBoss Portal//DTD JBoss Identity Configuration 1.0//EN"
+ "http://www.jboss.org/portal/dtd/identity-config_1_0.dtd">-->
+
+<identity-configuration>
+ <datasources>
+ <datasource>
+ <name>LDAP</name>
+ <config>
+ <option>
+ <name>host</name>
+ <value>dev09.qa.atl.jboss.com</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Manager,dc=my-domain,dc=com</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>jbossqa</value>
+ </option>
+ </config>
+ </datasource>
+ </datasources>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Role</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>Membership</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+
+ <module>
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+ <config>
+ <option>
+ <name>profileConfigFile</name>
+ <value>test/config/profile-config.xml</value>
+ </option>
+ <option>
+ <name>ldapModuleJNDIName</name>
+ <value>java:/portal/LDAPUserProfileModule</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>DBDelegateUserProfile</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ <module>
+ <type>LDAPDelegateUserProfile</type>
+ <implementation>LDAP</implementation>
+ <config/>
+ </module>
+ </modules>
+
+ <options>
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userContainerDN</name>
+ <value>ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com</value>
+ </option>
+ <option>
+ <name>roleContainerDN</name>
+ <value>ou=Roles,dc=testsuite,dc=portal,dc=my-domain,dc=com</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <!--This objectclasses should work with Red Hat Directory-->
+ <value>top</value>
+ <value>person</value>
+ <value>inetOrgPerson</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+ </option-group>
+ </options>
+</identity-configuration>
\ No newline at end of file
Modified: trunk/test/src/etc/directories.xml
===================================================================
--- trunk/test/src/etc/directories.xml 2007-01-24 12:09:26 UTC (rev 6088)
+++ trunk/test/src/etc/directories.xml 2007-01-24 16:55:18 UTC (rev 6089)
@@ -52,4 +52,34 @@
<cleanup-dn>dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</cleanup-dn>
</directory>
+ <!--<directory>
+ <directory-name>MSAD</directory-name>
+ <description>Microsoft Active Directory in QA Labs (need vpn access)</description>
+
+ <config-file>test/config/msad-config.xml</config-file>
+ <host>dev44.qa.atl.jboss.com</host>
+ <port>389</port>
+ <context-factory>com.sun.jndi.ldap.LdapCtxFactory</context-factory>
+ <admin-dn>JBOSS\jbossqa</admin-dn>
+ <admin-password>jboss42</admin-password>
+
+ <populate-ldif>ldap/ldif/initial-tests-qa-msad.ldif</populate-ldif>
+
+ <cleanup-dn>dc=testsuite,ou=portal,dc=jboss,dc=com</cleanup-dn>
+ </directory>-->
+ <directory>
+ <directory-name>OpenLDAP</directory-name>
+ <description>OpenLDAP Directory in QA Labs (need vpn access)</description>
+
+ <config-file>test/config/openldap-config.xml</config-file>
+ <host>dev09.qa.atl.jboss.com</host>
+ <port>389</port>
+ <context-factory>com.sun.jndi.ldap.LdapCtxFactory</context-factory>
+ <admin-dn>cn=Manager,dc=my-domain,dc=com</admin-dn>
+ <admin-password>jbossqa</admin-password>
+
+ <populate-ldif>ldap/ldif/initial-tests-qa-openldap.ldif</populate-ldif>
+
+ <cleanup-dn>dc=testsuite,dc=portal,dc=my-domain,dc=com</cleanup-dn>
+ </directory>
</directories>
Added: trunk/test/src/etc/ldap/ldif/initial-tests-qa-msad.ldif
===================================================================
--- trunk/test/src/etc/ldap/ldif/initial-tests-qa-msad.ldif (rev 0)
+++ trunk/test/src/etc/ldap/ldif/initial-tests-qa-msad.ldif 2007-01-24 16:55:18 UTC (rev 6089)
@@ -0,0 +1,188 @@
+dn: ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: organizationalUnit
+ou: testsuite
+
+dn: ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: organizationalUnit
+ou: People
+
+dn: cn=jduke,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+#uid: jduke
+cn: jduke
+sn: Duke
+userPassword: theduke
+mail: email(a)email.com
+
+dn: cn=jduke1,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+cn: jduke1
+#cn: Java Duke1
+sn: Duke1
+userPassword: theduke
+mail: email(a)email.com
+
+dn: cn=jduke2,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+cn: jduke2
+#cn: Java Duke2
+sn: Duke2
+userPassword: theduke
+mail: email(a)email.com
+
+dn: cn=jduke3,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+cn: jduke3
+#cn: Java Duke3
+sn: Duke3
+userPassword: theduke
+mail: email(a)email.com
+
+dn: cn=jduke4,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+cn: jduke4
+#cn: Java Duke4
+sn: Duke4
+userPassword: theduke
+mail: email(a)email.com
+
+dn: ou=Roles,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles
+
+dn: cn=Echo,ou=Roles,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectClass: top
+objectClass: groupOfNames
+cn: Echo
+description: the JBossAdmin group
+member: cn=jduke1,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+member: cn=jduke3,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+member: cn=jduke4,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+
+dn: cn=Echo1,ou=Roles,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectClass: top
+objectClass: groupOfNames
+cn: Echo1
+description: the JBossAdmin group 2
+member: cn=jduke2,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+member: cn=jduke3,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+member: cn=jduke,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+
+dn: cn=TheDuke,ou=Roles,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectClass: groupOfNames
+objectClass: top
+cn: TheDuke
+description: TheDuke role context
+member: cn=jduke,ou=People,ou=testsuite,ou=portal,dc=jboss,dc=test
+
+# tree2
+dn: ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: organizationalUnit
+ou: example2
+
+dn: ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles
+
+dn: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectClass: top
+objectClass: organizationalRole
+cn: Echo
+description: the JBossAdmin group
+
+dn: cn=Echo1,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectClass: top
+objectClass: organizationalRole
+cn: Echo1
+description: the JBossAdmin group 2
+
+dn: cn=TheDuke,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectClass: top
+objectClass: organizationalRole
+cn: TheDuke
+description: TheDuke role context
+
+dn: cn=EmptyRole,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectClass: top
+objectClass: organizationalRole
+cn: EmptyRole
+description: EmptyRole role context
+
+dn: ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: organizationalUnit
+ou: People
+
+dn: cn=jduke,ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: user
+cn: jduke
+#cn: Java Duke
+sn: Duke
+userPassword: theduke
+mail: email(a)email.com
+member: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+
+dn: cn=jduke1,ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+cn: jduke1
+#cn: Java Duke1
+sn: Duke1
+userPassword: theduke
+mail: email(a)email.com
+member: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+member: cn=Echo1,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+
+dn: cn=jduke2,ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+cn: jduke2
+#cn: Java Duke2
+sn: Duke2
+userPassword: theduke
+mail: email(a)email.com
+member: cn=Echo,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+member: cn=Echo1,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+member: cn=TheDuke,ou=Roles,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+
+dn: cn=jduke3,ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+cn: jduke3
+#cn: Java Duke3
+sn: Duke3
+userPassword: theduke
+mail: email(a)email.com
+
+dn: cn=jduke4,ou=People,ou=example2,ou=testsuite,ou=portal,dc=jboss,dc=test
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+cn: jduke4
+#cn: Java Duke4
+sn: Duke4
+userPassword: theduke
+mail: email(a)email.com
+
+
Added: trunk/test/src/etc/ldap/ldif/initial-tests-qa-openldap.ldif
===================================================================
--- trunk/test/src/etc/ldap/ldif/initial-tests-qa-openldap.ldif (rev 0)
+++ trunk/test/src/etc/ldap/ldif/initial-tests-qa-openldap.ldif 2007-01-24 16:55:18 UTC (rev 6089)
@@ -0,0 +1,194 @@
+dn: dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: dcObject
+objectclass: organization
+dc: testsuite
+o: testsuite
+
+dn: ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: People
+
+dn: uid=jduke,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke
+cn: Java Duke
+sn: Duke
+userPassword: theduke
+mail: email(a)email.com
+
+dn: uid=jduke1,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke1
+cn: Java Duke1
+sn: Duke1
+userPassword: theduke
+mail: email(a)email.com
+
+
+dn: uid=jduke2,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke2
+cn: Java Duke2
+sn: Duke2
+userPassword: theduke
+mail: email(a)email.com
+
+dn: uid=jduke3,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke3
+cn: Java Duke3
+sn: Duke3
+userPassword: theduke
+mail: email(a)email.com
+
+dn: uid=jduke4,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke4
+cn: Java Duke4
+sn: Duke4
+userPassword: theduke
+mail: email(a)email.com
+
+dn: ou=Roles,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles
+
+dn: cn=Echo,ou=Roles,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: Echo
+description: the JBossAdmin group
+member: uid=jduke1,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+member: uid=jduke3,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+member: uid=jduke4,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+
+dn: cn=Echo1,ou=Roles,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: Echo1
+description: the JBossAdmin group 2
+member: uid=jduke2,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+member: uid=jduke3,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+member: uid=jduke5,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+
+dn: cn=TheDuke,ou=Roles,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectClass: groupOfNames
+objectClass: top
+cn: TheDuke
+description: TheDuke role context
+member: uid=jduke,ou=People,dc=testsuite,dc=portal,dc=my-domain,dc=com
+
+
+# tree2
+dn: o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: organization
+o: example2
+
+dn: ou=People,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: People
+
+dn: uid=jduke,ou=People,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+uid: jduke
+cn: Java Duke
+sn: Duke
+userPassword: theduke
+mail: email(a)email.com
+memberOf: cn=Echo,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+
+dn: uid=jduke1,ou=People,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+uid: jduke1
+cn: Java Duke1
+sn: Duke1
+userPassword: theduke
+mail: email(a)email.com
+memberOf: cn=Echo,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+memberOf: cn=Echo1,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+
+
+dn: uid=jduke2,ou=People,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+uid: jduke2
+cn: Java Duke2
+sn: Duke2
+userPassword: theduke
+mail: email(a)email.com
+memberOf: cn=Echo,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+memberOf: cn=Echo1,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+memberOf: cn=TheDuke,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+
+
+dn: uid=jduke3,ou=People,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+uid: jduke3
+cn: Java Duke3
+sn: Duke3
+userPassword: theduke
+mail: email(a)email.com
+
+dn: uid=jduke4,ou=People,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: inetUser
+uid: jduke4
+cn: Java Duke4
+sn: Duke4
+userPassword: theduke
+mail: email(a)email.com
+
+dn: ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles
+
+dn: cn=Echo,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: organizationalRole
+cn: Echo
+description: the JBossAdmin group
+
+dn: cn=Echo1,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: organizationalRole
+cn: Echo1
+description: the JBossAdmin group 2
+
+
+dn: cn=TheDuke,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: organizationalRole
+cn: TheDuke
+description: TheDuke role context
+
+dn: cn=EmptyRole,ou=Roles,o=example2,dc=testsuite,dc=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: organizationalRole
+cn: EmptyRole
+description: EmptyRole role context
+
+
Modified: trunk/test/src/etc/opends/config/schema/05-other.ldif
===================================================================
--- trunk/test/src/etc/opends/config/schema/05-other.ldif 2007-01-24 12:09:26 UTC (rev 6088)
+++ trunk/test/src/etc/opends/config/schema/05-other.ldif 2007-01-24 16:55:18 UTC (rev 6089)
@@ -1,26 +1,3 @@
-#--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# ~ 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. ~
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-#
# Some schema parts that were missing in standard set
#
#
17 years, 4 months
JBoss Portal SVN: r6088 - in trunk: core/src/resources/portal-core-war/WEB-INF and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-24 07:09:26 -0500 (Wed, 24 Jan 2007)
New Revision: 6088
Modified:
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/portlet-instances.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-portlet.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml
trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
trunk/core/src/resources/dtd/portlet-instances_2_6.dtd
trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml
trunk/core/src/resources/portal-core-war/WEB-INF/portlet-instances.xml
Log:
- added if-exists in dtd for instances
- updated the doctype of portlet-instances.xml files
- improved the dtd for jboss-portlet
- use the doctype jboss-portlet on jboss.portlet.xml files
Modified: trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 18:19:10 UTC (rev 6087)
+++ trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-24 12:09:26 UTC (rev 6088)
@@ -65,7 +65,7 @@
</portlet>
-->
-<!ELEMENT portlet (portlet-name,remotable?,trans-attribute?,header-content?)>
+<!ELEMENT portlet (portlet-name,remotable?,session-config?,transaction?,header-content?)>
<!--
The portlet name.
@@ -78,6 +78,21 @@
<!ELEMENT remotable (#PCDATA)>
<!--
+todo
+-->
+<!ELEMENT session-config (distributed)>
+
+<!--
+todo
+-->
+<!ELEMENT distributed (#PCDATA)>
+
+<!--
+todo
+-->
+<!ELEMENT transaction (trans-attribute)>
+
+<!--
The trans-attribute value defines the transactionnal behavior. The accepted values are Required,
Mandatory, Never, Supports, NotSupported and RequiresNew.
-->
@@ -97,7 +112,12 @@
<!--
todo
-->
-<!ATTLIST link href title type media ref CDATA #IMPLIED>
+<!ATTLIST link
+ rel CDATA #IMPLIED
+ href CDATA #IMPLIED
+ title CDATA #IMPLIED
+ type CDATA #IMPLIED
+ media CDATA #IMPLIED>
<!--
todo
@@ -107,7 +127,10 @@
<!--
todo
-->
-<!ATTLIST script src type CDATA #IMPLIED>
+<!ATTLIST script
+ src CDATA #IMPLIED
+ type CDATA #IMPLIED
+ language CDATA #IMPLIED>
<!--
todo
@@ -117,7 +140,9 @@
<!--
todo
-->
-<!ATTLIST meta name content CDATA #REQUIRED>
+<!ATTLIST meta
+ name CDATA #IMPLIED
+ content CDATA #REQUIRED>
<!--
Declare a service that will be injected by the portlet container as an attribute of the portlet context.
Modified: trunk/core/src/resources/dtd/portlet-instances_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/portlet-instances_2_6.dtd 2007-01-23 18:19:10 UTC (rev 6087)
+++ trunk/core/src/resources/dtd/portlet-instances_2_6.dtd 2007-01-24 12:09:26 UTC (rev 6088)
@@ -37,9 +37,13 @@
<!--
The deployment is a container for an instance element.
-->
-<!ELEMENT deployment (instance)>
+<!ELEMENT deployment (if-exists?,instance)>
<!--
+-->
+<!ELEMENT if-exists #PCDATA>
+
+<!--
The instance element is used to create an instance of a portlet from the portlet application of the same
war file containing the portlet-instances.xml file. The portlet will be created and configured only
if the portlet is present and an instance with such a name does not already exist.
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml 2007-01-23 18:19:10 UTC (rev 6087)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml 2007-01-24 12:09:26 UTC (rev 6088)
@@ -21,6 +21,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+
<portlet-app>
<portlet>
<portlet-name>UserPortlet</portlet-name>
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/portlet-instances.xml 2007-01-23 18:19:10 UTC (rev 6087)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/portlet-instances.xml 2007-01-24 12:09:26 UTC (rev 6088)
@@ -22,6 +22,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
<deployments>
<deployment>
<instance>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml 2007-01-23 18:19:10 UTC (rev 6087)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml 2007-01-24 12:09:26 UTC (rev 6088)
@@ -21,6 +21,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+
<portlet-app>
<portlet>
<portlet-name>CMSAdminPortlet</portlet-name>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/portlet-instances.xml 2007-01-23 18:19:10 UTC (rev 6087)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/portlet-instances.xml 2007-01-24 12:09:26 UTC (rev 6088)
@@ -22,6 +22,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
<deployments>
<deployment>
<instance>
Modified: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-portlet.xml 2007-01-23 18:19:10 UTC (rev 6087)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-portlet.xml 2007-01-24 12:09:26 UTC (rev 6088)
@@ -21,6 +21,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+
<portlet-app>
<remotable>true</remotable>
<portlet>
Modified: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml 2007-01-23 18:19:10 UTC (rev 6087)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml 2007-01-24 12:09:26 UTC (rev 6088)
@@ -22,6 +22,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
<deployments>
<deployment>
<instance>
17 years, 4 months
JBoss Portal SVN: r6087 - trunk/core-cms/src/resources/portal-cms-sar/META-INF.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-01-23 13:19:10 -0500 (Tue, 23 Jan 2007)
New Revision: 6087
Modified:
trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
Log:
rollback workflow activation
Modified: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-01-23 18:18:21 UTC (rev 6086)
+++ trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-01-23 18:19:10 UTC (rev 6087)
@@ -59,7 +59,7 @@
<depends>portal:service=Hibernate,type=CMS</depends>
<depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
<!-- Add this to activate publish/approval workflow integration -->
- <depends optional-attribute-name="ApprovePublishWorkflow" proxy-type="attribute">portal:service=ApprovePublish,type=Workflow</depends>
+ <!--<depends optional-attribute-name="ApprovePublishWorkflow" proxy-type="attribute">portal:service=ApprovePublish,type=Workflow</depends>-->
<depends optional-attribute-name="StackFactory" proxy-type="attribute">portal:service=InterceptorStackFactory,type=Cms</depends>
<attribute name="DoChecking">true</attribute>
<attribute name="DefaultContentLocation">portal/cms/conf/default-content/default/</attribute>
17 years, 4 months
JBoss Portal SVN: r6086 - in trunk/core-cms/src: resources/portal-cms-sar/META-INF and 1 other directories.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-01-23 13:18:21 -0500 (Tue, 23 Jan 2007)
New Revision: 6086
Modified:
trunk/core-cms/src/bin/portal-cms-war/images/cms/admin/style.css
trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
Log:
JBPORTAL-1202 - fixed css dropdown submenus not showing in css nav in ie6
Modified: trunk/core-cms/src/bin/portal-cms-war/images/cms/admin/style.css
===================================================================
--- trunk/core-cms/src/bin/portal-cms-war/images/cms/admin/style.css 2007-01-23 18:06:26 UTC (rev 6085)
+++ trunk/core-cms/src/bin/portal-cms-war/images/cms/admin/style.css 2007-01-23 18:18:21 UTC (rev 6086)
@@ -14,6 +14,7 @@
.menu ul ul {
width: 150px;
+ list-style-type: none;
}
/* float the list to make it horizontal and a relative positon so that you can control the dropdown menu positon */
@@ -36,18 +37,15 @@
line-height: 20px;
}
-/* a hack so that IE5.5 faulty box model is corrected */
* html .menu a, * html .menu a:visited {
width: 150px;
w\idth: 139px;
}
-/* style the second level background */
.menu ul ul a.drop, .menu ul ul a.drop:visited {
background: #DFE8ED;
}
-/* style the second level hover */
.menu ul ul a.drop:hover {
background: #C0D3DC;
}
@@ -56,7 +54,6 @@
background: #C0D3DC;
}
-/* hide the sub levels and give them a positon absolute so that they take up no room */
.menu ul ul {
visibility: hidden;
position: absolute;
@@ -66,26 +63,24 @@
width: 150px;
}
-/* another hack for IE5.5 */
* html .menu ul ul {
top: 20px;
t\op: 20px;
}
-/* style the table so that it takes no ppart in the layout - required for IE to work */
+/* not used */
.menu table {
position: absolute;
top: 0;
left: 0;
}
-/* style the second level links */
.menu ul ul a, .menu ul ul a:visited {
background: #DFE8ED;
height: auto;
line-height: 20px;
padding: 5px 10px;
- width: 129px /* yet another hack for IE5.5 */
+ width: 129px
}
* html .menu ul ul a {
@@ -93,15 +88,14 @@
w\idth: 129px;
}
-/* style the top level hover */
.menu a:hover, .menu ul ul a:hover {
+ visibility: visible;
}
.menu :hover > a, .menu ul ul :hover > a {
background: #C0D3DC;
}
-/* make the second level visible when hover on first level list OR link */
.menu ul li:hover ul,
.menu ul a:hover ul {
visibility: visible;
Modified: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-01-23 18:06:26 UTC (rev 6085)
+++ trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-01-23 18:18:21 UTC (rev 6086)
@@ -59,10 +59,8 @@
<depends>portal:service=Hibernate,type=CMS</depends>
<depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
<!-- Add this to activate publish/approval workflow integration -->
- <!--
<depends optional-attribute-name="ApprovePublishWorkflow" proxy-type="attribute">portal:service=ApprovePublish,type=Workflow</depends>
- -->
- <depends optional-attribute-name="StackFactory" proxy-type="attribute">portal:service=InterceptorStackFactory,type=Cms</depends>
+ <depends optional-attribute-name="StackFactory" proxy-type="attribute">portal:service=InterceptorStackFactory,type=Cms</depends>
<attribute name="DoChecking">true</attribute>
<attribute name="DefaultContentLocation">portal/cms/conf/default-content/default/</attribute>
<attribute name="DefaultLocale">en</attribute>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2007-01-23 18:06:26 UTC (rev 6085)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2007-01-23 18:18:21 UTC (rev 6086)
@@ -67,7 +67,9 @@
<ul>
<li><a href="#">Select Action <img
src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/downarrow.gif"
- border="0"></a>
+ border="0">
+ <!--[if IE 7]><!--></a><!--<![endif]-->
+ <!--[if lte IE 6]><table><tr><td><![endif]-->
<ul>
<li><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_CONFIRM_CREATE_COLLECTION %>"/>
@@ -118,6 +120,7 @@
</portlet:renderURL>">${n:i18n("CMS_DELETE")}</a></li>
<% } %>
</ul>
+ <!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>
</div>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2007-01-23 18:06:26 UTC (rev 6085)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2007-01-23 18:18:21 UTC (rev 6086)
@@ -83,7 +83,9 @@
<ul>
<li><a href="#">Select Action <img
src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/downarrow.gif"
- border="0"></a>
+ border="0">
+ <!--[if IE 7]><!--></a><!--<![endif]-->
+ <!--[if lte IE 6]><table><tr><td><![endif]-->
<ul>
<%
if (sType.equals("text/html") || sType.equals("text/plain"))
@@ -129,6 +131,7 @@
<portlet:param name="path" value="<%= sCurrPath %>"/>
</portlet:renderURL>">${n:i18n("CMS_APPROVAL")}</a></li>
</ul>
+ <!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>
</div>
17 years, 4 months
JBoss Portal SVN: r6085 - in trunk/core/src: main/org/jboss/portal/core/aspects/controller and 1 other directory.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-01-23 13:06:26 -0500 (Tue, 23 Jan 2007)
New Revision: 6085
Modified:
trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
Log:
JBPORTAL-1202 - fixed css dropdown submenus not showing in main nav in ie6
Modified: trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
===================================================================
--- trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-01-23 17:53:38 UTC (rev 6084)
+++ trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-01-23 18:06:26 UTC (rev 6085)
@@ -100,8 +100,7 @@
#content-container {
height: 100%;
- text-align: left;
- /*width: 100%;*/
+ text-align: left; /*width: 100%;*/
min-width: 770px;
position: absolute;
top: 70px;
@@ -343,7 +342,8 @@
color: #5078aa;
}
-UL#tabsHeader li:hover ul {
+UL#tabsHeader li:hover ul,
+ UL#tabsHeader a:hover ul {
visibility: visible;
}
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-01-23 17:53:38 UTC (rev 6084)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-01-23 18:06:26 UTC (rev 6085)
@@ -25,12 +25,13 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.api.node.PortalNode;
+import org.jboss.portal.core.controller.Controller;
import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.ControllerInterceptor;
-import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.core.controller.Controller;
import org.jboss.portal.core.controller.command.SignOutCommand;
import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
+import org.jboss.portal.core.model.CustomizationManager;
import org.jboss.portal.core.model.instance.command.InvokePortletInstanceRenderCommand;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Portal;
@@ -39,10 +40,9 @@
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectPermission;
import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.command.ImportPageToDashboardCommand;
import org.jboss.portal.core.model.portal.command.RenderPageCommand;
import org.jboss.portal.core.model.portal.command.ViewDashboardCommand;
-import org.jboss.portal.core.model.portal.command.ImportPageToDashboardCommand;
-import org.jboss.portal.core.model.CustomizationManager;
import org.jboss.portal.identity.User;
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.security.PortalSecurityException;
@@ -215,7 +215,6 @@
label = "My Dashboard";
}
-
// Link to admin/default portal
String showadminURL = null;
@@ -351,8 +350,19 @@
{
html.append(" id=\"current\"");
}
- html.append(" onmouseover=\"this.className='hoverOn'\" onmouseout=\"this.className='hoverOff'\"><a href='").append(childURL).append("'>").append(name).append("</a>");
+ html.append(" onmouseover=\"this.className='hoverOn'\" onmouseout=\"this.className='hoverOff'\"><a href='").append(childURL).append("'>").append(name);
+ // ie 6 hack
+ if (hasChildPages(navElement))
+ {
+ html.append("<!--[if IE 7]><!--></a><!--<![endif]-->");
+ html.append("<!--[if lte IE 6]><table><tr><td><![endif]-->");
+ }
+ else
+ {
+ html.append("</a>");
+ }
+
// Submenu logic
if (hasChildPages(navElement))
{
@@ -369,6 +379,7 @@
}
}
html.append("</ul>");
+ html.append("<!--[if lte IE 6]></td></tr></table></a><![endif]-->");
}
html.append("</li>");
}
17 years, 4 months