[JBoss JIRA] Created: (EJBTHREE-789) build.xml and component-info.xml - version numbers and imports need to be updated
by Vladimir Ralev (JIRA)
build.xml and component-info.xml - version numbers and imports need to be updated
---------------------------------------------------------------------------------
Key: EJBTHREE-789
URL: http://jira.jboss.com/jira/browse/EJBTHREE-789
Project: EJB 3.0
Issue Type: Bug
Affects Versions: EJB 3.0 RC9 - FD
Reporter: Vladimir Ralev
Priority: Critical
The repository-zip target's comp-version, like this (use appropriate version string):
<target name="repository-zip" depends="jars"
description="Create the repository.jboss.com jboss/ejb3 component contents">
<!-- The binary component version -->
<property name="comp-version" value="1.0.0.CR9-jboss4.0.5" />
<!-- Pack the ejb3.deployer -->
<zip destfile="${build.lib}/ejb3-deployer.zip">
<zipfileset dir="${build.lib}">
<include name="ejb3.deployer/**" />
</zipfileset>
</zip>
<!-- Create a zip file with the component structure -->
<zip destfile="${build.lib}/jboss-ejb3-repo.zip">
<!-- The component-info.xml -->
<zipfileset dir="${build.etc}" prefix="${comp-version}">
<include name="component-info.xml" />
</zipfileset>
<!-- The bin/ejb3.deployer -->
<zipfileset dir="${build.lib}" fullpath="${comp-version}/bin/ejb3.deployer">
<include name="ejb3-deployer.zip" />
</zipfileset>
<!-- The lib client jars -->
<zipfileset dir="${build.lib}" prefix="${comp-version}/lib">
<include name="hibernate-client.jar" />
<include name="jboss-ejb3-client.jar" />
</zipfileset>
<!-- The resources deploy descriptors -->
<zipfileset dir="${build.lib}" prefix="${comp-version}/resources">
<include name="ejb3-clustered-sfsbcache-service.xml" />
<include name="ejb3-entity-cache-service.xml" />
<include name="ejb3-interceptors-aop.xml" />
</zipfileset>
</zip>
</target>
and ejb3\src\etc\component-info.xml (the version attribute):
<project name="jboss/ejb3-component-info">
<component id="jboss/ejb3"
licenseType="lgpl"
version="1.0.0.CR9-jboss4.0.5"
description="The EJB3 deployer for integration with jboss-4.0.x">
<artifact id="ejb3-clustered-sfsbcache-service.xml"/>
<artifact id="ejb3-entity-cache-service.xml"/>
<artifact id="ejb3-interceptors-aop.xml"/>
<artifact id="ejb3.deployer" />
<artifact id="hibernate-client.jar"/>
<artifact id="jboss-ejb3-client.jar"/>
<import componentref="javassist">
<compatible version="3.2.0.CR1"/>
<compatible version="3.2.0.CR2"/>
</import>
<import componentref="hibernate-annotations">
<compatible version="3.2.0.GA"/>
</import>
<import componentref="hibernate-entitymanager">
<compatible version="3.2.0.GA"/>
</import>
<import componentref="jboss/remoting">
<compatible version="1.4.1_final"/>
<compatible version="1.4.2.GA"/>
</import>
<import componentref="jboss/aop">
<compatible version="1.5.1.GA"/>
<compatible version="1.5.2.GA"/> <--------------- IS 1.5.2.GA COMPATIBLE?
</import>
<export>
<include input="hibernate-client.jar"/>
<include input="jboss-ejb3-client.jar"/>
</export>
</component>
</project>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 10 months
[JBoss JIRA] Created: (JBPORTAL-1707) New UserModule/RoleModule finders
by Andrew Oliver (JIRA)
New UserModule/RoleModule finders
---------------------------------
Key: JBPORTAL-1707
URL: http://jira.jboss.com/jira/browse/JBPORTAL-1707
Project: JBoss Portal
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Portal Security
Affects Versions: 2.6.1 Final
Reporter: Andrew Oliver
Assigned To: Julien Viet
While working with clients using the portal API some efficiency issues with regards to finders have become apparent:
It is presently possible to find users having a role by calling MembershipModule.getUsers(role). However it is not possible to get a list of users with a set of roles, a list of users who do NOT have a role or set of roles. (there are ways in both HQL and LDAP to construct each type of query). I suggest something similar to hibernate conditions.
MembershipModule.getUsers().addCondition(
Condition.and(
Condition.not(roleSet), Condition.with(roleSet)
)
)
this would result in roughly:
from Users where roles in (:roleSet) and roles not in (:roleSet2)
and something like
(& (|(role=roleName)(role=roleName) )
(&(!role=roleName)(!role=roleName) )
)
in LDAP
the attribute name can be based on the type. As it stands you have to do something like:
try {
Role roleApproved = rolemodule.findRoleByName("approved");
Role roleUsers = rolemodule.findRoleByName("User");
//todo create transient wrapper set.
Set users = membership.getUsers(roleUsers);
dirtyStinkyHackToGetAroundPortalAPIBugACO(users);
System.err.println("Total number of users with User Role : " + users.size() );
Set temp = new HashSet();
temp = dirtyStinkyHackToGetAroundPortalAPIBugACO(users); //because the hibernate set doesn't have removeall
users = temp;
Set usersApproved = membership.getUsers(roleApproved);
System.err.println("number of users with approved role: "+usersApproved.size());
users.removeAll(usersApproved);
System.err.println("Total number of users with User Role and NO approved role : " + users.size() );
Map profiles = profiles(users);
response.setRenderParameter("op", "new");
request.getPortletSession().setAttribute("users", users);
request.getPortletSession().setAttribute("profiles", profiles);
} catch (IdentityException e) {
//todo type this and catch it up higher to make a
//smarter error message
throw new RuntimeException(e);
}
private Map profiles(Set users) throws IdentityException {
Iterator i = users.iterator();
Map retval = new HashMap();
while(i.hasNext()) {
User user = (User) i.next();
retval.put(user, profileModule.getProperties(user));
}
return retval;
}
private Set dirtyStinkyHackToGetAroundPortalAPIBugACO(Set users) {
Iterator i = users.iterator();
Set retval = new HashSet();
while(i.hasNext()) {
User u = (User)i.next();
u.getUserName();
retval.add(u);
}
return retval;
}
Just to get the list of users who DONT have the "approved" role. For our immediate needs:
UserModule.getUsersWithout(role) would work...until next time.
-Andy
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years
[JBoss JIRA] Created: (JBPORTAL-1708) Identity APIs should invalidate cache on update/change of role membership
by Andrew Oliver (JIRA)
Identity APIs should invalidate cache on update/change of role membership
-------------------------------------------------------------------------
Key: JBPORTAL-1708
URL: http://jira.jboss.com/jira/browse/JBPORTAL-1708
Project: JBoss Portal
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Portal Identity
Affects Versions: 2.6.1 Final
Reporter: Andrew Oliver
Consider this code:
String username = request.getParameter("username");
User user= usermodule.findUserByUserName(username);
System.err.println("user was equal to "+(user == null ? "null" : user.getUserName()));
Role role = rolemodule.findRoleByName("approved");
Set users = new HashSet();
users.add(user);
membership.assignUsers(role, users);
And this code:
Role roleApproved = rolemodule.findRoleByName("approved");
Set usersApproved = membership.getUsers(roleApproved);
With the default Hibernate settings for identity in server\default\deploy\jboss-portal.sar\conf\hibernate\user\hibernate.cfg.xml:
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
The second bit of code doesn't see changes by the first bit of code until the portal is restarted (it seems).
Switching these to false solves the problem. It is likely that this is due to the HibernateMembershipModuleImpl and the <set
name="roles"
table="jbp_role_membership"
lazy="false"
inverse="false"
cascade="none"
sort="unsorted">
<cache usage="read-write"/>
<key column="jbp_uid"/>
<many-to-many
class="org.jboss.portal.identity.db.HibernateRoleImpl"
column="jbp_rid"
outer-join="true"/>
</set>
which specifies a cached collection and in http://viewvc.jboss.org/cgi-bin/viewvc.cgi/portal/branches/JBoss_Portal_B...
public void assignRoles(User user, Set roles) throws IdentityException
{
//throw new UnsupportedOperationException("Not yet implemented");
if (!(user instanceof HibernateUserImpl))
{
throw new IllegalArgumentException("User is not a HibernateUserImpl user");
}
// We make a defensive copy with unwrapped maps and update with a new set
Set copy = new HashSet();
for (Iterator i = roles.iterator(); i.hasNext();)
{
Object o = i.next();
if (o instanceof HibernateRoleImpl)
{
copy.add(o);
}
else
{
throw new IllegalArgumentException("Only HibernateRoleImpl roles can be accepted");
}
}
// Assign new roles
HibernateUserImpl ui = (HibernateUserImpl)user;
ui.setRoles(copy);
}
The defensive copy which avoids the hibernate collection probably prevents triggering of the cache invalidation logic in the many-many relationship (not 100% sure that this is how hibernate works for collection caching but it seems logical).
The hibernate membership module's usage of hibernate is a bit odd and probably needs review anyhow.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years