gatein SVN: r7158 - in epp/portal/branches/EPP_5_2_Branch: portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component and 2 other directories.
by do-not-reply@jboss.org
Author: bdaw
Date: 2011-08-16 10:20:00 -0400 (Tue, 16 Aug 2011)
New Revision: 7158
Modified:
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInGroup.java
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObject.hbm.xml
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObjectAttribute.hbm.xml
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObject.hbm.xml
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObjectAttribute.hbm.xml
Log:
JBEPP-901 Login time of user "root" depends on number of users in DB
JBEPP-903 Performance issue when showing OrganizationManagementPortlet when there are many users in IDM DB
JBEPP-908 Inefficient search by atrributes (email) when create or update user
JBEPP-948 IDMUserListAccess.getSize() needs to call query for obtain all users from table "jbid_io"
JBEPP-1064 Stale cache problem when deleting user
JBEPP-1059 Optimalization of criterias for finding single user in HibernateIdentityStoreImpl
JBEPP-1058 Optimalization in call to persistenceManager.findUser called from UserDAOImpl.getPopulatedUser
Modified: epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-08-16 14:20:00 UTC (rev 7158)
@@ -235,6 +235,9 @@
try
{
+
+ orgService.flush();
+
jbidGroup =
getIdentitySession().getPersistenceManager().
findGroup(plGroupName, orgService.getConfiguration().getGroupType(group.getParentId()));
@@ -253,6 +256,8 @@
try
{
+ orgService.flush();
+
Collection<org.picketlink.idm.api.Group> oneLevelChilds =
getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, true, false);
@@ -308,6 +313,8 @@
try
{
+ orgService.flush();
+
allRoles = getIdentitySession().getRoleManager().findRoles(userName, membershipType);
}
catch (Exception e)
@@ -333,6 +340,8 @@
try
{
+ orgService.flush();
+
groups = getIdentitySession().getRelationshipManager().findAssociatedGroups(userName, null);
}
catch (Exception e)
@@ -462,6 +471,8 @@
try
{
+ orgService.flush();
+
plGroups.addAll(getIdentitySession().getRelationshipManager().
findAssociatedGroups(jbidGroup, null, true, false));
}
@@ -591,6 +602,8 @@
try
{
+ orgService.flush();
+
allGroups = getIdentitySession().getRelationshipManager().findRelatedGroups(user, null, null);
}
catch (Exception e)
@@ -638,6 +651,9 @@
try
{
+
+ orgService.flush();
+
plGroups
.addAll(getIdentitySession().getRelationshipManager().findAssociatedGroups(getRootGroup(), null, true, true));
}
@@ -746,6 +762,8 @@
try
{
+ orgService.flush();
+
attrs = getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
}
catch (Exception e)
@@ -869,6 +887,8 @@
try
{
+ orgService.flush();
+
parents = getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, false, false);
}
catch (Exception e)
Modified: epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-08-16 14:20:00 UTC (rev 7158)
@@ -21,6 +21,8 @@
import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.impl.UserImpl;
+
import org.gatein.common.logging.LogLevel;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
@@ -29,12 +31,13 @@
import org.picketlink.idm.api.query.UserQueryBuilder;
+import java.io.Serializable;
import java.util.List;
/*
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
*/
-public class IDMUserListAccess implements ListAccess<User>
+public class IDMUserListAccess implements ListAccess<User>, Serializable
{
private static Logger log = LoggerFactory.getLogger(IDMUserListAccess.class);
@@ -48,6 +51,10 @@
private final boolean countAll;
+ private List<org.picketlink.idm.api.User> fullResults;
+
+ private int size = -1;
+
public IDMUserListAccess(UserDAOImpl userDAO, PicketLinkIDMService idmService, UserQueryBuilder userQueryBuilder,
int pageSize, boolean countAll)
{
@@ -73,17 +80,30 @@
);
}
- userQueryBuilder.page(index, length);
- UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
- List<org.picketlink.idm.api.User> users = idmService.getIdentitySession().list(query);
+ List<org.picketlink.idm.api.User> users = null;
+ if (fullResults == null)
+ {
+ userDAO.getOrgService().flush();
+
+ userQueryBuilder.page(index, length);
+ UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
+ users = idmService.getIdentitySession().list(query);
+ }
+ else
+ {
+ users = fullResults.subList(index, index + length);
+ }
+
User[] exoUsers = new User[users.size()];
for (int i = 0; i < users.size(); i++)
{
org.picketlink.idm.api.User user = users.get(i);
- exoUsers[i] = UserDAOImpl.getPopulatedUser(user.getId(), idmService.getIdentitySession());
+ User gtnUser = new UserImpl(user.getId());
+ userDAO.populateUser(gtnUser, idmService.getIdentitySession());
+ exoUsers[i] = gtnUser;
}
if (log.isTraceEnabled())
@@ -111,22 +131,39 @@
);
}
+ userDAO.getOrgService().flush();
+
int result;
- if (countAll)
+ if (size < 0)
{
- result = idmService.getIdentitySession().getPersistenceManager().getUserCount();
+
+ if (fullResults != null)
+ {
+ result = fullResults.size();
+ }
+ else if (countAll)
+ {
+ result = idmService.getIdentitySession().getPersistenceManager().getUserCount();
+ }
+ else
+ {
+ userQueryBuilder.page(0, 0);
+ UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
+ fullResults = idmService.getIdentitySession().list(query);
+ result = fullResults.size();
+ }
+
+ size = result;
}
else
{
- userQueryBuilder.page(0, 0);
- UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
- result = idmService.getIdentitySession().execute(query).size();
+ result = size;
}
if (log.isTraceEnabled())
{
- Tools.logMethodOut(
+ Tools.logMethodOut(
log,
LogLevel.TRACE,
"getSize",
Modified: epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java 2011-08-16 14:20:00 UTC (rev 7158)
@@ -1,11 +1,17 @@
package org.exoplatform.services.organization.idm;
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.services.organization.Query;
+
import org.jboss.cache.Cache;
import org.jboss.cache.CacheFactory;
import org.jboss.cache.CacheStatus;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
+import org.jboss.cache.eviction.ExpirationConfiguration;
+
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.User;
@@ -51,10 +57,14 @@
public static final String NULL_NS_NODE = "GTN_IC_COMMON_NS";
+ public static final String USER_QUERY_NODE = "GTN_USER_QUERY_LAZY_LIST";
+
public static final String MAIN_ROOT = "NODE_GTN_ORG_SERVICE_INT_CACHE_MAIN_ROOT";
public static final String NODE_OBJECT_KEY = "object";
+ private int expiration = -1;
+
private Fqn getRootNode()
{
return Fqn.fromString("/" + MAIN_ROOT);
@@ -152,6 +162,7 @@
if (ioNode != null)
{
ioNode.put(NODE_OBJECT_KEY, id);
+ setExpiration(ioNode);
if (log.isLoggable(Level.FINER))
{
@@ -192,7 +203,61 @@
}
+ /**
+ * Store IDMUserListAccess
+ * @param ns
+ * @param query
+ * @param list
+ */
+ void putGtnUserLazyPageList(String ns, Query query, IDMUserListAccess list)
+ {
+ Fqn nodeFqn = getFqn(ns, USER_QUERY_NODE, getQueryKey(query));
+
+ Node ioNode = getCache().getRoot().addChild(nodeFqn);
+
+ if (ioNode != null)
+ {
+ ioNode.put(NODE_OBJECT_KEY, list);
+ setExpiration(ioNode);
+
+ if (log.isLoggable(Level.FINER))
+ {
+
+ log.finer(this.toString() + "GateIn user query list cached. Query: " + getQueryKey(query) + ";namespace=" + ns);
+ }
+ }
+ }
+
/**
+ * Retrieve IDMUserListAccess
+ * @param ns
+ * @param query
+ * @return LazyPageList
+ */
+ IDMUserListAccess getGtnUserLazyPageList(String ns, Query query)
+ {
+
+ Fqn nodeFqn = getFqn(ns, USER_QUERY_NODE, getQueryKey(query));
+
+ Node node = getCache().getRoot().getChild(nodeFqn);
+
+ if (node != null)
+ {
+ IDMUserListAccess list = (IDMUserListAccess)node.get(NODE_OBJECT_KEY);
+
+ if (log.isLoggable(Level.FINER) && list != null)
+ {
+ log.finer(this.toString() + "GateIn user query list found in cache. Query: " + getQueryKey(query) + ";namespace=" + ns);
+ }
+
+ return list;
+ }
+
+ return null;
+
+ }
+
+ /**
* Store PLIDM root group
* @param ns
* @param rootGroup
@@ -205,6 +270,7 @@
if (ioNode != null)
{
+ setExpiration(ioNode);
ioNode.put(NODE_OBJECT_KEY, rootGroup);
if (log.isLoggable(Level.FINER))
@@ -242,4 +308,37 @@
}
+ public void setExpiration(Node node)
+ {
+ if (expiration != -1 && expiration > 0)
+ {
+ Long future = new Long(System.currentTimeMillis() + expiration);
+ node.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, future);
+ }
+ }
+
+ public int getExpiration()
+ {
+ return expiration;
+ }
+
+ public void setExpiration(int expiration)
+ {
+ this.expiration = expiration;
+ }
+
+ String getQueryKey(Query query)
+ {
+ StringBuilder sb = new StringBuilder();
+ String SEP = ":::";
+
+ sb.append(query.getEmail()).append(SEP)
+ .append(query.getFirstName()).append(SEP)
+ .append(query.getLastName()).append(SEP)
+ .append(query.getUserName()).append(SEP)
+ .append(query.getFromLoginDate()).append(SEP)
+ .append(query.getToLoginDate()).append(SEP);
+
+ return sb.toString();
+ }
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-08-16 14:20:00 UTC (rev 7158)
@@ -120,6 +120,8 @@
);
}
+ orgService.flush();
+
if (g == null)
{
throw new InvalidNameException("Can not create membership record for " + user.getUserName()
@@ -197,6 +199,7 @@
);
}
+ orgService.flush();
String plGroupName = getPLIDMGroupName(getGroupNameFromId(m.getGroupId()));
@@ -278,6 +281,7 @@
);
}
+ orgService.flush();
Membership m = new MembershipImpl(id);
@@ -377,6 +381,7 @@
);
}
+ orgService.flush();
Collection<Role> roles = new HashSet();
@@ -473,6 +478,7 @@
);
}
+ orgService.flush();
String plGroupName = getPLIDMGroupName(getGroupNameFromId(groupId));
@@ -565,6 +571,8 @@
);
}
+ orgService.flush();
+
if (userName == null)
{
// julien fix : if user name is null, need to check if we do need to return a special group
@@ -667,6 +675,7 @@
);
}
+ orgService.flush();
Collection<Role> roles = new HashSet();
@@ -759,6 +768,8 @@
);
}
+ orgService.flush();
+
String plGroupName = getPLIDMGroupName(getGroupNameFromId(groupId));
String gid =
@@ -780,12 +791,13 @@
HashSet<MembershipImpl> memberships = new HashSet<MembershipImpl>();
+ Group g = orgService.getGroupHandler().findGroupById(groupId);
+
for (Role role : roles)
{
if (isCreateMembership(role.getRoleType().getName()))
{
MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
m.setGroupId(g.getId());
m.setUserName(role.getUser().getId());
m.setMembershipType(role.getRoleType().getName());
@@ -856,6 +868,8 @@
);
}
+ orgService.flush();
+
Membership m = new MembershipImpl(id);
String plGroupName = getPLIDMGroupName(getGroupNameFromId(m.getGroupId()));
Modified: epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2011-08-16 14:20:00 UTC (rev 7158)
@@ -45,7 +45,7 @@
// We may have several portal containers thus we need one PicketLinkIDMService per portal container
// private static PicketLinkIDMService jbidmService_;
- private PicketLinkIDMService idmService_;
+ private PicketLinkIDMServiceImpl idmService_;
public static final String CONFIGURATION_OPTION = "configuration";
@@ -60,7 +60,7 @@
membershipDAO_ = new MembershipDAOImpl(this, idmService);
membershipTypeDAO_ = new MembershipTypeDAOImpl(this, idmService);
- idmService_ = idmService;
+ idmService_ = (PicketLinkIDMServiceImpl)idmService;
if (params != null)
{
@@ -152,6 +152,7 @@
}
else
{
+
if (!idmService_.getIdentitySession().getTransaction().isActive())
{
idmService_.getIdentitySession().beginTransaction();
@@ -164,6 +165,44 @@
}
}
+
+ public void flush()
+ {
+ try
+ {
+
+
+ if (configuration.isUseJTA())
+ {
+ UserTransaction tx = (UserTransaction)new InitialContext().lookup("java:comp/UserTransaction");
+
+ if (tx.getStatus() != Status.STATUS_NO_TRANSACTION)
+ {
+ tx.commit();
+ }
+
+ if (tx.getStatus() == Status.STATUS_NO_TRANSACTION)
+ {
+ tx.begin();
+ }
+ }
+ else
+ {
+ if (idmService_.getIdentitySession().getTransaction().isActive())
+ {
+ idmService_.getIdentitySession().save();
+ }
+ }
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+
+
public void endRequest(ExoContainer container)
{
try
Modified: epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2011-08-16 14:20:00 UTC (rev 7158)
@@ -29,6 +29,8 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheFactory;
import org.jboss.cache.DefaultCacheFactory;
+
+import org.jgroups.JChannelFactory;
import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.IdentitySessionFactory;
import org.picketlink.idm.api.cfg.IdentityConfiguration;
@@ -52,7 +54,7 @@
public class PicketLinkIDMServiceImpl implements PicketLinkIDMService, Startable
{
- private static Log log_ = ExoLogger.getLogger(PicketLinkIDMServiceImpl.class);
+ private static Log log = ExoLogger.getLogger(PicketLinkIDMServiceImpl.class);
public static final String PARAM_CONFIG_OPTION = "config";
@@ -70,6 +72,12 @@
public static final String CACHE_CONFIG_STORE_OPTION = "storeCacheConfig";
+ public static final String JGROUPS_CONFIG = "jgroups-configuration";
+
+ public static final String JGROUPS_MUX_ENABLED = "jgroups-multiplexer-stack";
+
+ public static final String CACHE_EXPIRATION = "cacheExpiration";
+
private IdentitySessionFactory identitySessionFactory;
private String config;
@@ -80,6 +88,10 @@
private IntegrationCache integrationCache;
+ private static final JChannelFactory CHANNEL_FACTORY = new JChannelFactory();
+
+ private HibernateService hibernateService;
+
private PicketLinkIDMServiceImpl()
{
}
@@ -96,7 +108,12 @@
ValueParam realmName = initParams.getValueParam(REALM_NAME_OPTION);
ValueParam apiCacheConfig = initParams.getValueParam(CACHE_CONFIG_API_OPTION);
ValueParam storeCacheConfig = initParams.getValueParam(CACHE_CONFIG_STORE_OPTION);
+ ValueParam jgroupsStack = initParams.getValueParam(JGROUPS_MUX_ENABLED);
+ ValueParam jgroupsConfig = initParams.getValueParam(JGROUPS_CONFIG);
+ ValueParam cacheExpirationParam = initParams.getValueParam(CACHE_EXPIRATION);
+ this.hibernateService = hibernateService;
+
if (config == null && jndiName == null)
{
throw new IllegalStateException("Either '" + PARAM_CONFIG_OPTION + "' or '" + PARAM_JNDI_NAME_OPTION
@@ -126,11 +143,20 @@
identityConfiguration.getIdentityConfigurationRegistry().register(hibernateService.getSessionFactory(), "hibernateSessionFactory");
+ int expiration = -1;
+
+ if (cacheExpirationParam != null &&
+ cacheExpirationParam.getValue() != null &&
+ cacheExpirationParam.getValue().length() > 0)
+ {
+ expiration = Integer.decode(cacheExpirationParam.getValue());
+ }
+
if (apiCacheConfig != null)
{
+
InputStream configStream = confManager.getInputStream(apiCacheConfig.getValue());
- // Create common JBoss Cache instance
CacheFactory factory = new DefaultCacheFactory();
if (configStream == null)
@@ -140,6 +166,8 @@
Cache cache = factory.createCache(configStream);
+ applyJGroupsConfig(cache, confManager, jgroupsStack, jgroupsConfig);
+
cache.create();
cache.start();
@@ -147,22 +175,43 @@
// PLIDM API cache
JBossCacheAPICacheProviderImpl apiCacheProvider = new JBossCacheAPICacheProviderImpl();
+ apiCacheProvider.setExpiration(expiration);
apiCacheProvider.initialize(cache);
picketLinkIDMCache.register(apiCacheProvider);
identityConfiguration.getIdentityConfigurationRegistry().register(apiCacheProvider, "apiCacheProvider");
//Integration cache
integrationCache = new IntegrationCache();
+ integrationCache.setExpiration(expiration);
integrationCache.initialize(cache);
picketLinkIDMCache.register(integrationCache);
}
+
+
if (storeCacheConfig != null)
{
InputStream configStream = confManager.getInputStream(storeCacheConfig.getValue());
+ CacheFactory factory = new DefaultCacheFactory();
+
+ if (configStream == null)
+ {
+ throw new IllegalArgumentException("JBoss Cache configuration InputStream is null");
+ }
+
+ Cache cache = factory.createCache(configStream);
+
+ applyJGroupsConfig(cache, confManager, jgroupsStack, jgroupsConfig);
+
+ cache.create();
+ cache.start();
+
+ configStream.close();
+
JBossCacheIdentityStoreCacheProviderImpl storeCacheProvider = new JBossCacheIdentityStoreCacheProviderImpl();
- storeCacheProvider.initialize(configStream);
+ storeCacheProvider.setExpiration(expiration);
+ storeCacheProvider.initialize(cache);
picketLinkIDMCache.register(storeCacheProvider);
identityConfiguration.getIdentityConfigurationRegistry().register(storeCacheProvider, "storeCacheProvider");
@@ -225,4 +274,66 @@
{
return realmName;
}
+
+ /**
+ * Applying JGroups configuration for JBossCache.
+ * Code forked from org.exoplatform.services.jcr.jbosscacheExoJBossCacheFactory
+ *
+ * @param cache
+ * @param configurationManager
+ * @param jgroupsEnabledParam
+ * @param jgroupsConfigurationParam
+ */
+ private void applyJGroupsConfig(Cache cache,
+ ConfigurationManager configurationManager,
+ ValueParam jgroupsEnabledParam,
+ ValueParam jgroupsConfigurationParam)
+ {
+
+ String jgroupsEnabled = jgroupsEnabledParam != null ? jgroupsEnabledParam.getValue() : null;
+ String jgroupsConfiguration = jgroupsConfigurationParam != null ? jgroupsConfigurationParam.getValue() : null;
+
+ // JGroups multiplexer configuration if enabled
+ if (jgroupsEnabled != null && jgroupsEnabled.equalsIgnoreCase("true"))
+ {
+ try
+ {
+ if (jgroupsConfiguration != null)
+ {
+ // Create and inject multiplexer factory
+ CHANNEL_FACTORY.setMultiplexerConfig(configurationManager.getResource(jgroupsConfiguration));
+ cache.getConfiguration().getRuntimeConfig().setMuxChannelFactory(CHANNEL_FACTORY);
+ log.info("Multiplexer stack successfully enabled for the cache.");
+ }
+ }
+ catch (Exception e)
+ {
+ // exception occurred setting mux factory
+ throw new IllegalStateException("Error setting multiplexer configuration.", e);
+ }
+ }
+ else
+ {
+ // Multiplexer is not enabled. If jGroups configuration preset it is applied
+ if (jgroupsConfiguration != null)
+ {
+ try
+ {
+ cache.getConfiguration().setJgroupsConfigFile(
+ configurationManager.getResource(jgroupsConfiguration));
+ log.info("Custom JGroups configuration set:"
+ + configurationManager.getResource(jgroupsConfiguration));
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error setting JGroups configuration.", e);
+ }
+ }
+ }
+ }
+
+ public HibernateService getHibernateService()
+ {
+ return hibernateService;
+ }
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-08-16 14:20:00 UTC (rev 7158)
@@ -21,8 +21,6 @@
import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.commons.utils.ListAccess;
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.cache.ExoCache;
import org.exoplatform.services.organization.Query;
import org.exoplatform.services.organization.User;
import org.exoplatform.services.organization.UserEventListener;
@@ -37,6 +35,7 @@
import org.picketlink.idm.api.query.UserQueryBuilder;
import org.picketlink.idm.common.exception.IdentityException;
import org.picketlink.idm.impl.api.SimpleAttribute;
+import org.picketlink.idm.impl.api.model.SimpleUser;
import java.text.DateFormat;
import java.text.ParseException;
@@ -145,6 +144,8 @@
try
{
+ orgService.flush();
+
session.getPersistenceManager().createUser(user.getUserName());
}
catch (IdentityException e)
@@ -214,6 +215,8 @@
try
{
+ orgService.flush();
+
foundUser = session.getPersistenceManager().findUser(userName);
}
catch (IdentityException e)
@@ -256,6 +259,11 @@
}
+ if (getIntegrationCache() != null)
+ {
+ getIntegrationCache().invalidateAll();
+ }
+
if (broadcast)
{
postDelete(exoUser);
@@ -361,6 +369,8 @@
{
try
{
+ orgService.flush();
+
IdentitySession session = service_.getIdentitySession();
org.picketlink.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());
@@ -407,7 +417,64 @@
);
}
+ // if only condition is email which is unique then delegate to other method as it will be more efficient
+ if (q.getUserName() == null &&
+ q.getEmail() != null &&
+ q.getFirstName() == null &&
+ q.getLastName() == null)
+ {
+ final User uniqueUser = findUserByEmail(q.getEmail());
+ if (uniqueUser != null)
+ {
+ return new LazyPageList<User>( new ListAccess<User>()
+ {
+ public User[] load(int index, int length) throws Exception, IllegalArgumentException
+ {
+ return new User[]{uniqueUser};
+ }
+
+ public int getSize() throws Exception
+ {
+ return 1;
+ }
+ }, 1);
+ }
+ else
+ {
+ return new LazyPageList<User>( new ListAccess<User>()
+ {
+ public User[] load(int index, int length) throws Exception, IllegalArgumentException
+ {
+ return new User[0];
+ }
+
+ public int getSize() throws Exception
+ {
+ return 0;
+ }
+ }, 1);
+ }
+ }
+
+
+ // otherwise use PLIDM queries
+
+ IDMUserListAccess list;
+
+ IntegrationCache cache = getIntegrationCache();
+
+ if (cache != null)
+ {
+ list = cache.getGtnUserLazyPageList(getCacheNS(), q);
+ if (list != null)
+ {
+ return new LazyPageList(list, 20);
+ }
+ }
+
+ orgService.flush();
+
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
if (q.getUserName() != null)
@@ -430,7 +497,26 @@
qb.attributeValuesFilter(UserDAOImpl.USER_LAST_NAME, new String[]{q.getLastName()});
}
- return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
+
+
+ if (q.getUserName() == null &&
+ q.getEmail() == null &&
+ q.getFirstName() == null &&
+ q.getLastName() == null)
+ {
+ list = new IDMUserListAccess(this, service_, qb, 20, true);
+ }
+ else
+ {
+ list = new IDMUserListAccess(this, service_, qb, 20, false);
+ }
+
+ if (cache != null)
+ {
+ cache.putGtnUserLazyPageList(getCacheNS(), q, list);
+ }
+
+ return new LazyPageList(list, 20);
}
//
@@ -494,6 +580,8 @@
try
{
+ orgService.flush();
+
plUser = session.getAttributesManager().findUserByUniqueAttribute(USER_EMAIL, email);
}
catch (IdentityException e)
@@ -565,6 +653,7 @@
public void persistUserInfo(User user, IdentitySession session) throws Exception
{
+ orgService.flush();
AttributesManager am = session.getAttributesManager();
@@ -629,10 +718,12 @@
}
- public static User getPopulatedUser(String userName, IdentitySession session) throws Exception
+ public User getPopulatedUser(String userName, IdentitySession session) throws Exception
{
Object u = null;
+ orgService.flush();
+
try
{
u = session.getPersistenceManager().findUser(userName);
@@ -656,8 +747,9 @@
}
- public static void populateUser(User user, IdentitySession session) throws Exception
+ public void populateUser(User user, IdentitySession session) throws Exception
{
+ orgService.flush();
AttributesManager am = session.getAttributesManager();
@@ -665,7 +757,7 @@
try
{
- attrs = am.getAttributes(user.getUserName());
+ attrs = am.getAttributes(new SimpleUser(user.getUserName()));
}
catch (IdentityException e)
{
@@ -754,4 +846,26 @@
}
}
+ public PicketLinkIDMOrganizationServiceImpl getOrgService()
+ {
+ return orgService;
+ }
+
+ private IntegrationCache getIntegrationCache()
+ {
+ // TODO: refactor to remove cast. For now to avoid adding new config option and share existing cache instannce
+ // TODO: it should be there.
+ return ((PicketLinkIDMServiceImpl)service_).getIntegrationCache();
+ }
+
+ /**
+ * Returns namespace to be used with integration cache
+ * @return
+ */
+ private String getCacheNS()
+ {
+ // TODO: refactor to remove cast. For now to avoid adding new config option and share existing cache instannce
+ // TODO: it should be there.
+ return ((PicketLinkIDMServiceImpl)service_).getRealmName();
+ }
}
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInGroup.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInGroup.java 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInGroup.java 2011-08-16 14:20:00 UTC (rev 7158)
@@ -133,7 +133,6 @@
{
OrganizationService service = getApplicationComponent(OrganizationService.class);
MembershipHandler handler = service.getMembershipHandler();
- List<?> memberships = (List<?>)handler.findMembershipsByGroup(group);
pageList = new FindMembershipByGroupPageList(group.getId(), 10);
}
UIGridUser uiGrid = getChild(UIGridUser.class);
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObject.hbm.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObject.hbm.xml 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObject.hbm.xml 2011-08-16 14:20:00 UTC (rev 7158)
@@ -12,6 +12,7 @@
<generator class="native"/>
</id>
<set name="attributes"
+ batch-size="20"
inverse="true"
cascade="all, delete-orphan"
lazy="extra"
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObjectAttribute.hbm.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObjectAttribute.hbm.xml 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObjectAttribute.hbm.xml 2011-08-16 14:20:00 UTC (rev 7158)
@@ -35,8 +35,9 @@
table="jbid_io_attr_text_values"
cascade="all, delete-orphan"
access="field"
- lazy="extra"
- fetch="subselect">
+ lazy="false"
+ fetch="join"
+ batch-size="20">
<cache usage="transactional"/>
<key column="TEXT_ATTR_VALUE_ID"/>
<element type="string"
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObject.hbm.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObject.hbm.xml 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObject.hbm.xml 2011-08-16 14:20:00 UTC (rev 7158)
@@ -12,6 +12,7 @@
<generator class="native"/>
</id>
<set name="attributes"
+ batch-size="20"
inverse="true"
cascade="all, delete-orphan"
lazy="extra"
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObjectAttribute.hbm.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObjectAttribute.hbm.xml 2011-08-16 14:10:49 UTC (rev 7157)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObjectAttribute.hbm.xml 2011-08-16 14:20:00 UTC (rev 7158)
@@ -35,8 +35,9 @@
table="jbid_io_attr_text_values"
cascade="all, delete-orphan"
access="field"
- lazy="extra"
- fetch="subselect">
+ lazy="false"
+ fetch="join"
+ batch-size="20">
<cache usage="transactional"/>
<key column="TEXT_ATTR_VALUE_ID"/>
<element type="string"
13 years, 5 months
gatein SVN: r7157 - in epp/portal/branches/EPP_5_2_Branch: distribution/jboss-epp/serverAddon/src and 1 other directories.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-08-16 10:10:49 -0400 (Tue, 16 Aug 2011)
New Revision: 7157
Added:
epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/main/resources/conf/gatein/configuration.xml
Modified:
epp/portal/branches/EPP_5_2_Branch/component/common/src/main/java/conf/configuration.xml
epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/assemble.xml
Log:
JBEPP-998 Error is thrown from UsersRolesLoginModule during every logout
Modified: epp/portal/branches/EPP_5_2_Branch/component/common/src/main/java/conf/configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/common/src/main/java/conf/configuration.xml 2011-08-16 12:45:21 UTC (rev 7156)
+++ epp/portal/branches/EPP_5_2_Branch/component/common/src/main/java/conf/configuration.xml 2011-08-16 14:10:49 UTC (rev 7157)
@@ -2,17 +2,17 @@
<!--
Copyright (C) 2009 eXo Platform SAS.
-
+
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
@@ -25,67 +25,15 @@
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
- <component>
+ <component>
<key>org.exoplatform.container.PropertyConfigurator</key>
<type>org.exoplatform.container.PropertyConfigurator</type>
<init-params>
- <!-- The name of the default portal container -->
<value-param>
<name>properties.url</name>
<value>configuration.properties</value>
</value-param>
- <!-- The name of the default rest ServletContext -->
- <value-param>
- <name>default.rest.context</name>
- <value>rest</value>
- </value-param>
- <!-- The name of the default realm -->
- <value-param>
- <name>default.realm.name</name>
- <value>gatein-domain</value>
- </value-param>
- <!-- The default portal container definition -->
- <!-- It cans be used to avoid duplicating configuration -->
- <object-param>
- <name>default.portal.definition</name>
- <object type="org.exoplatform.container.definition.PortalContainerDefinition">
- <!-- The path to the external properties file -->
- <field name="externalSettingsPath">
- <string>configuration.properties</string>
- </field>
- <field name="dependencies">
- <collection type="java.util.ArrayList">
- <value>
- <string>eXoResources</string>
- </value>
- <value>
- <string>portal</string>
- </value>
- <value>
- <string>dashboard</string>
- </value>
- <value>
- <string>exoadmin</string>
- </value>
- <value>
- <string>eXoGadgets</string>
- </value>
- <value>
- <string>eXoGadgetServer</string>
- </value>
- <value>
- <string>rest</string>
- </value>
- <value>
- <string>wsrp-producer</string>
- </value>
- <value>
- <string>web</string>
- </value>
- </collection>
- </field>
- </object>
- </object-param>
</init-params>
</component>
+
</configuration>
Modified: epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/assemble.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/assemble.xml 2011-08-16 12:45:21 UTC (rev 7156)
+++ epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/assemble.xml 2011-08-16 14:10:49 UTC (rev 7157)
@@ -17,10 +17,10 @@
<destName>configuration.properties</destName>
<outputDirectory>conf/gatein</outputDirectory>
</file>
- <file>
- <source>../../../component/common/src/main/java/conf/configuration.xml</source>
- <outputDirectory>conf/gatein</outputDirectory>
- </file>
+ <!--<file>-->
+ <!--<source>../../../component/common/src/main/java/conf/configuration.xml</source>-->
+ <!--<outputDirectory>conf/gatein</outputDirectory>-->
+ <!--</file>-->
</files>
<fileSets>
Added: epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/main/resources/conf/gatein/configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/main/resources/conf/gatein/configuration.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/main/resources/conf/gatein/configuration.xml 2011-08-16 14:10:49 UTC (rev 7157)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+ <component>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>portal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>rest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>gatein-domain</value>
+ </value-param>
+ <!-- The default portal container definition -->
+ <!-- It cans be used to avoid duplicating configuration -->
+ <object-param>
+ <name>default.portal.definition</name>
+ <object type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The path to the external properties file -->
+ <field name="externalSettingsPath">
+ <string>configuration.properties</string>
+ </field>
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>eXoResources</string>
+ </value>
+ <value>
+ <string>portal</string>
+ </value>
+ <value>
+ <string>dashboard</string>
+ </value>
+ <value>
+ <string>exoadmin</string>
+ </value>
+ <value>
+ <string>eXoGadgets</string>
+ </value>
+ <value>
+ <string>eXoGadgetServer</string>
+ </value>
+ <value>
+ <string>rest</string>
+ </value>
+ <value>
+ <string>wsrp-producer</string>
+ </value>
+ <value>
+ <string>web</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
13 years, 5 months
gatein SVN: r7156 - in epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp: serverAddon/src/main/resources/deploy and 1 other directory.
by do-not-reply@jboss.org
Author: theute
Date: 2011-08-16 08:45:21 -0400 (Tue, 16 Aug 2011)
New Revision: 7156
Modified:
epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/examples/src/main/resources/gatein-sample-portal-ds.xml
epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/main/resources/deploy/gatein-ds.xml
Log:
JBEPP-1077
Use local-tx-datasource
Modified: epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/examples/src/main/resources/gatein-sample-portal-ds.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/examples/src/main/resources/gatein-sample-portal-ds.xml 2011-08-16 12:43:16 UTC (rev 7155)
+++ epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/examples/src/main/resources/gatein-sample-portal-ds.xml 2011-08-16 12:45:21 UTC (rev 7156)
@@ -23,7 +23,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<datasources>
- <no-tx-datasource>
+ <local-tx-datasource>
<jndi-name>gatein-jcr_sample-portal</jndi-name>
<connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}sample-portal-localDB</connection-url>
<driver-class>org.hsqldb.jdbcDriver</driver-class>
@@ -34,9 +34,9 @@
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
- </no-tx-datasource>
+ </local-tx-datasource>
- <no-tx-datasource>
+ <local-tx-datasource>
<jndi-name>gatein-idm_sample-portal</jndi-name>
<connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}sample-portal-idm-localDB</connection-url>
<driver-class>org.hsqldb.jdbcDriver</driver-class>
@@ -47,6 +47,6 @@
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
- </no-tx-datasource>
+ </local-tx-datasource>
</datasources>
Modified: epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/main/resources/deploy/gatein-ds.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/main/resources/deploy/gatein-ds.xml 2011-08-16 12:43:16 UTC (rev 7155)
+++ epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/serverAddon/src/main/resources/deploy/gatein-ds.xml 2011-08-16 12:45:21 UTC (rev 7156)
@@ -23,7 +23,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<datasources>
- <no-tx-datasource>
+ <local-tx-datasource>
<jndi-name>gatein-idm</jndi-name>
<connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}gatein${/}hypersonic${/}gatein-idm-localDB</connection-url>
<driver-class>org.hsqldb.jdbcDriver</driver-class>
@@ -34,9 +34,9 @@
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
- </no-tx-datasource>
+ </local-tx-datasource>
- <no-tx-datasource>
+ <local-tx-datasource>
<jndi-name>gatein-jcr</jndi-name>
<connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}gatein${/}hypersonic${/}gatein-jcr-localDB</connection-url>
<driver-class>org.hsqldb.jdbcDriver</driver-class>
@@ -47,5 +47,5 @@
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
- </no-tx-datasource>
+ </local-tx-datasource>
</datasources>
13 years, 5 months
gatein SVN: r7155 - in epp/portal/branches/EPP_5_2_Branch: component/test/jcr/src/main/resources/conf and 1 other directories.
by do-not-reply@jboss.org
Author: theute
Date: 2011-08-16 08:43:16 -0400 (Tue, 16 Aug 2011)
New Revision: 7155
Modified:
epp/portal/branches/EPP_5_2_Branch/component/test/jcr/src/main/resources/conf/exo.portal.component.test.jcr-configuration.xml
epp/portal/branches/EPP_5_2_Branch/pom.xml
epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java
Log:
JBEPP-1076
Upgrade eXo JCR to 1.14.0-CR2 (and dependencies)
Modified: epp/portal/branches/EPP_5_2_Branch/component/test/jcr/src/main/resources/conf/exo.portal.component.test.jcr-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/test/jcr/src/main/resources/conf/exo.portal.component.test.jcr-configuration.xml 2011-08-16 12:36:32 UTC (rev 7154)
+++ epp/portal/branches/EPP_5_2_Branch/component/test/jcr/src/main/resources/conf/exo.portal.component.test.jcr-configuration.xml 2011-08-16 12:43:16 UTC (rev 7155)
@@ -33,6 +33,11 @@
</component>
<component>
+ <key>org.exoplatform.services.jdbc.DataSourceProvider</key>
+ <type>org.exoplatform.services.jdbc.impl.DataSourceProviderImpl</type>
+ </component>
+
+ <component>
<key>org.exoplatform.services.document.DocumentReaderService</key>
<type>org.exoplatform.services.document.impl.DocumentReaderServiceImpl</type>
<component-plugins>
Modified: epp/portal/branches/EPP_5_2_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-08-16 12:36:32 UTC (rev 7154)
+++ epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-08-16 12:43:16 UTC (rev 7155)
@@ -37,10 +37,10 @@
<name>EPP GateIn - Portal - ${project.version}</name>
<properties>
- <org.exoplatform.kernel.version>2.3.0-CR2</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.4.0-CR2</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.2.0-CR2</org.exoplatform.ws.version>
- <org.exoplatform.jcr.version>1.14.0-CR2</org.exoplatform.jcr.version>
+ <org.exoplatform.kernel.version>2.3.0-CR4-CP01</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.4.0-CR4</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.2.0-CR4</org.exoplatform.ws.version>
+ <org.exoplatform.jcr.version>1.14.0-CR4-CP01</org.exoplatform.jcr.version>
<org.jibx.version>1.2.1</org.jibx.version>
<org.shindig.version>1.0-r790473-Patch06</org.shindig.version>
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java 2011-08-16 12:36:32 UTC (rev 7154)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/core/UIPortletApplication.java 2011-08-16 12:43:16 UTC (rev 7155)
@@ -26,7 +26,6 @@
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
import javax.portlet.WindowState;
-import javax.resource.spi.IllegalStateException;
import org.apache.commons.collections.map.HashedMap;
import org.exoplatform.commons.serialization.api.annotations.Serialized;
@@ -160,4 +159,4 @@
throw new IllegalStateException("serveSource can only be called in portlet context");
}
}
-}
\ No newline at end of file
+}
13 years, 5 months
gatein SVN: r7154 - in portal/branches/api/component/api-impl/src: test/java/org/gatein/portal/api/impl/portal and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-08-16 08:36:32 -0400 (Tue, 16 Aug 2011)
New Revision: 7154
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
Log:
more work
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-08-16 11:45:05 UTC (rev 7153)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-08-16 12:36:32 UTC (rev 7154)
@@ -256,12 +256,6 @@
}
}
- public Portal getPortal(Site.Id portalId)
- {
- PortalData portalData = getPortalDataFor(portalId);
- return new PortalImpl(portalData, this);
- }
-
public Portal getDefaultPortal()
{
return getPortal(Site.Id.createPortal("classic")); // todo: check
@@ -364,19 +358,6 @@
}
}
- public Site getGroupSite(String... names)
- {
- StringBuilder sb = new StringBuilder();
- for (String name : names)
- {
- sb.append("/").append(name);
- }
- String groupId = sb.toString();
- Site.Id siteId = Site.Id.createGroup(groupId);
-
- return new GroupSiteImpl(siteId, this);
- }
-
public IterableIdentifiableCollection<Site> getGroupSites(String userId)
{
final GroupHandler groupHandler = getOrganizationService().getGroupHandler();
@@ -477,13 +458,6 @@
}
}
- public Site getDashboard(String userId)
- {
- Site.Id siteId = Site.Id.createDashboard(userId);
-
- return new DashboardSiteImpl(siteId, this);
- }
-
public <T extends Identifiable<T>> T get(Id<T> id)
{
Class<T> type = id.getIdentifiableType();
@@ -561,20 +535,44 @@
return type.cast(result);
}
+ public Portal getPortal(Site.Id portalId)
+ {
+ return (Portal)getSite(portalId);
+ }
+
+ public Site getGroupSite(String... names)
+ {
+ StringBuilder sb = new StringBuilder();
+ for (String name : names)
+ {
+ sb.append("/").append(name);
+ }
+ String groupId = sb.toString();
+ Site.Id siteId = Site.Id.createGroup(groupId);
+ return getSite(siteId);
+ }
+
+ public Site getDashboard(String userId)
+ {
+ Site.Id siteId = Site.Id.createDashboard(userId);
+ return getSite(siteId);
+ }
+
public Site getSite(Site.Id siteId)
{
Type<Site> siteType = siteId.getType();
+ PortalData data = getPortalDataFor(siteId);
if (Site.PORTAL == siteType)
{
- return getPortal(siteId);
+ return new PortalImpl(data, this);
}
else if (Site.GROUP == siteType)
{
- return getGroupSite(siteId.getName());
+ return new GroupSiteImpl(siteId, this);
}
else if (Site.DASHBOARD == siteType)
{
- return getDashboard(siteId.getName());
+ return new DashboardSiteImpl(siteId, this);
}
else
{
@@ -698,19 +696,19 @@
return portletInvoker;
}
- private PortalData getPortalDataFor(Site.Id portalId)
+ private PortalData getPortalDataFor(Site.Id siteId)
{
- ParameterValidation.throwIllegalArgExceptionIfNull(portalId, "Portal Id");
+ ParameterValidation.throwIllegalArgExceptionIfNull(siteId, "Portal Id");
try
{
begin();
String type;
- if (portalId.getType() == Site.PORTAL)
+ if (siteId.getType() == Site.PORTAL)
{
type = "portal";
}
- else if (portalId.getType() == Site.GROUP)
+ else if (siteId.getType() == Site.GROUP)
{
type = "group";
}
@@ -719,7 +717,7 @@
type = "user";
}
- return dataStorage.getPortalConfig(new PortalKey(type, portalId.getName()));
+ return dataStorage.getPortalConfig(new PortalKey(type, siteId.getName()));
}
catch (Exception e)
{
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java 2011-08-16 11:45:05 UTC (rev 7153)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java 2011-08-16 12:36:32 UTC (rev 7154)
@@ -1,5 +1,6 @@
package org.gatein.portal.api.impl.portal;
+import junit.framework.AssertionFailedError;
import org.exoplatform.component.test.ConfigurationUnit;
import org.exoplatform.component.test.ConfiguredBy;
import org.exoplatform.component.test.ContainerScope;
@@ -7,6 +8,7 @@
import org.exoplatform.portal.AbstractPortalTest;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.mop.navigation.NavigationContext;
import org.exoplatform.portal.mop.navigation.NavigationService;
import org.exoplatform.portal.mop.navigation.NavigationState;
@@ -42,10 +44,10 @@
protected NavigationService navService;
/** . */
- protected GateIn gatein;
+ protected ModelDataStorage storage;
/** . */
- protected NodeContext root;
+ protected GateIn gatein;
@Override
protected void setUp() throws Exception
@@ -68,22 +70,34 @@
this.gatein = gatein;
this.mgr = mgr;
this.navService = navService;
+ this.storage = (ModelDataStorage)container.getComponentInstanceOfType(ModelDataStorage.class);
//
begin();
//
- ModelDataStorage storage = (ModelDataStorage)container.getComponentInstanceOfType(ModelDataStorage.class);
- storage.create(new PortalConfig("portal", "classic").build());
- NavigationContext nav = new NavigationContext(SiteKey.portal("classic"), new NavigationState(0));
- navService.saveNavigation(nav);
- root = navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ RequestContext.setCurrentInstance(new SimpleRequestContext(null));
+ }
- //
- storage.create(new org.exoplatform.portal.config.model.Page("portal", "classic", "homepage").build());
+ private NodeContext createSite(SiteType type, String name)
+ {
+ try
+ {
+ storage.create(new PortalConfig(type.getName(), name).build());
+ NavigationContext nav = new NavigationContext(new SiteKey(type, name), new NavigationState(0));
+ navService.saveNavigation(nav);
+ //
+ storage.create(new org.exoplatform.portal.config.model.Page(type.getName(), name, "homepage").build());
- //
- RequestContext.setCurrentInstance(new SimpleRequestContext(null));
+ //
+ return navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ }
+ catch (Exception e)
+ {
+ AssertionFailedError afe = new AssertionFailedError();
+ afe.initCause(e);
+ throw afe;
+ }
}
@Override
@@ -94,6 +108,9 @@
public void testEmptyNavigation()
{
+ createSite(SiteType.PORTAL, "classic");
+
+ //
Site site = gatein.getPortal(Site.Id.createPortal("classic"));
assertNotNull(site);
Site.Id id = site.getId();
@@ -110,6 +127,7 @@
public void testSingleNavigation()
{
+ NodeContext<?> root = createSite(SiteType.PORTAL, "classic");
root.add(null, "home");
navService.saveNode(root, null);
@@ -128,6 +146,7 @@
public void testPage()
{
+ NodeContext<?> root = createSite(SiteType.PORTAL, "classic");
root.add(null, "home");
navService.saveNode(root, null);
@@ -147,4 +166,18 @@
homeNav.setTargetPage(null);
assertNull(null, homeNav.getTargetPage());
}
+
+ public void testGroupSite()
+ {
+ createSite(SiteType.GROUP, "/platform/users");
+ Site site = gatein.getGroupSite("platform", "administrator");
+ assertNotNull(site);
+ }
+
+ public void testDashboardSite()
+ {
+ createSite(SiteType.USER, "root");
+ Site site = gatein.getDashboard("root");
+ assertNotNull(site);
+ }
}
13 years, 5 months
gatein SVN: r7153 - epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm.
by do-not-reply@jboss.org
Author: bdaw
Date: 2011-08-16 07:45:05 -0400 (Tue, 16 Aug 2011)
New Revision: 7153
Modified:
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
Log:
JBEPP-1032 CustomMembershipLoginModule should end lifecycle in case of an error
Modified: epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-16 10:52:15 UTC (rev 7152)
+++ epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-16 11:45:05 UTC (rev 7153)
@@ -146,15 +146,14 @@
*/
private void addUserToPlatformUsers(String userId) throws Exception
{
+ OrganizationService orgService = (OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
try
{
- OrganizationService orgService = (OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
begin(orgService);
User user = orgService.getUserHandler().findUserByName(userId);
MembershipType memberType = orgService.getMembershipTypeHandler().findMembershipType(membershipType);
Group platformUsersGroup = orgService.getGroupHandler().findGroupById(groupId);
orgService.getMembershipHandler().linkMembership(user, platformUsersGroup, memberType, true);
- end(orgService);
}
catch (Exception e)
{
@@ -162,6 +161,10 @@
// don't rethrow login exception in case of failure.
// throw e;
}
+ finally
+ {
+ end(orgService);
+ }
}
private void begin(OrganizationService orgService) throws Exception
{
13 years, 5 months
gatein SVN: r7152 - portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm.
by do-not-reply@jboss.org
Author: bdaw
Date: 2011-08-16 06:52:15 -0400 (Tue, 16 Aug 2011)
New Revision: 7152
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
Log:
IDM performance - use hibernate flush instead of commit/begin
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-08-16 10:25:46 UTC (rev 7151)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-08-16 10:52:15 UTC (rev 7152)
@@ -236,7 +236,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
jbidGroup =
getIdentitySession().getPersistenceManager().
@@ -256,7 +256,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
Collection<org.picketlink.idm.api.Group> oneLevelChilds =
getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, true, false);
@@ -313,7 +313,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
allRoles = getIdentitySession().getRoleManager().findRoles(userName, membershipType);
}
@@ -340,7 +340,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
groups = getIdentitySession().getRelationshipManager().findAssociatedGroups(userName, null);
}
@@ -471,7 +471,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
plGroups.addAll(getIdentitySession().getRelationshipManager().
findAssociatedGroups(jbidGroup, null, true, false));
@@ -602,7 +602,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
allGroups = getIdentitySession().getRelationshipManager().findRelatedGroups(user, null, null);
}
@@ -652,7 +652,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
plGroups
.addAll(getIdentitySession().getRelationshipManager().findAssociatedGroups(getRootGroup(), null, true, true));
@@ -762,7 +762,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
attrs = getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
}
@@ -887,7 +887,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
parents = getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, false, false);
}
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-08-16 10:25:46 UTC (rev 7151)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-08-16 10:52:15 UTC (rev 7152)
@@ -84,7 +84,7 @@
if (fullResults == null)
{
- userDAO.getOrgService().commitTransaction();
+ userDAO.getOrgService().flush();
userQueryBuilder.page(index, length);
UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
@@ -131,7 +131,7 @@
);
}
- userDAO.getOrgService().commitTransaction();
+ userDAO.getOrgService().flush();
int result;
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-08-16 10:25:46 UTC (rev 7151)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-08-16 10:52:15 UTC (rev 7152)
@@ -120,7 +120,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
if (g == null)
{
@@ -199,7 +199,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
String plGroupName = getPLIDMGroupName(getGroupNameFromId(m.getGroupId()));
@@ -281,7 +281,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
Membership m = new MembershipImpl(id);
@@ -381,7 +381,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
Collection<Role> roles = new HashSet();
@@ -478,7 +478,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
String plGroupName = getPLIDMGroupName(getGroupNameFromId(groupId));
@@ -571,7 +571,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
if (userName == null)
{
@@ -675,7 +675,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
Collection<Role> roles = new HashSet();
@@ -768,7 +768,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
String plGroupName = getPLIDMGroupName(getGroupNameFromId(groupId));
@@ -868,7 +868,7 @@
);
}
- orgService.commitTransaction();
+ orgService.flush();
Membership m = new MembershipImpl(id);
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2011-08-16 10:25:46 UTC (rev 7151)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2011-08-16 10:52:15 UTC (rev 7152)
@@ -166,7 +166,7 @@
}
- public void commitTransaction()
+ public void flush()
{
try
{
@@ -188,16 +188,10 @@
}
else
{
-
if (idmService_.getIdentitySession().getTransaction().isActive())
{
- idmService_.getIdentitySession().getTransaction().commit();
+ idmService_.getIdentitySession().save();
}
-
- if (!idmService_.getIdentitySession().getTransaction().isActive())
- {
- idmService_.getIdentitySession().beginTransaction();
- }
}
}
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-08-16 10:25:46 UTC (rev 7151)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-08-16 10:52:15 UTC (rev 7152)
@@ -144,7 +144,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
session.getPersistenceManager().createUser(user.getUserName());
}
@@ -215,7 +215,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
foundUser = session.getPersistenceManager().findUser(userName);
}
@@ -369,7 +369,7 @@
{
try
{
- orgService.commitTransaction();
+ orgService.flush();
IdentitySession session = service_.getIdentitySession();
org.picketlink.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());
@@ -473,7 +473,7 @@
}
}
- orgService.commitTransaction();
+ orgService.flush();
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
@@ -580,7 +580,7 @@
try
{
- orgService.commitTransaction();
+ orgService.flush();
plUser = session.getAttributesManager().findUserByUniqueAttribute(USER_EMAIL, email);
}
@@ -653,7 +653,7 @@
public void persistUserInfo(User user, IdentitySession session) throws Exception
{
- orgService.commitTransaction();
+ orgService.flush();
AttributesManager am = session.getAttributesManager();
@@ -722,7 +722,7 @@
{
Object u = null;
- orgService.commitTransaction();
+ orgService.flush();
try
{
@@ -749,7 +749,7 @@
public void populateUser(User user, IdentitySession session) throws Exception
{
- orgService.commitTransaction();
+ orgService.flush();
AttributesManager am = session.getAttributesManager();
13 years, 5 months
gatein SVN: r7151 - in portal/trunk: component/application-registry/src/main/java/org/exoplatform/application/gadget/impl and 8 other directories.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-08-16 06:25:46 -0400 (Tue, 16 Aug 2011)
New Revision: 7151
Added:
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/images/
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/images/Calculator.gif
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/images/
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/images/Calendar.gif
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/images/
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/images/Todo.gif
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/images/
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/images/rssAggregator.png
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetImporter.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegistryService.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/RemoteImporter.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/ServletLocalImporter.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/Calculator.xml
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/Calendar.xml
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml
Log:
GTNPORTAL-2025 Could not display local gadget thumbnail properly
Re-organize gadget resources
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java 2011-08-16 10:25:46 UTC (rev 7151)
@@ -132,7 +132,8 @@
importer = new ServletLocalImporter(
gadgetName,
path,
- scontext);
+ scontext,
+ gadgetRegistryService);
}
else
{
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetImporter.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetImporter.java 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetImporter.java 2011-08-16 10:25:46 UTC (rev 7151)
@@ -65,7 +65,7 @@
protected abstract byte[] getGadgetBytes(String gadgetURI) throws IOException;
- protected abstract String getGadgetURL(String gadgetURI) throws Exception;
+ protected abstract String getGadgetURL() throws Exception;
protected abstract void process(String gadgetURI, GadgetDefinition def) throws Exception;
@@ -92,6 +92,9 @@
log.error("Cannot import gadget " + gadgetURI + " because its data could not be found");
return;
}
+
+ //
+ process(gadgetURI, def);
// Get encoding
String encoding = EncodingDetector.detect(new ByteArrayInputStream(bytes));
@@ -100,7 +103,7 @@
String gadget = new String(bytes, encoding);
//
- String gadgetURL = getGadgetURL(gadgetURI);
+ String gadgetURL = getGadgetURL();
GadgetSpec spec = new GadgetSpec(Uri.parse(gadgetURL), gadget);
ModulePrefs prefs = spec.getModulePrefs();
@@ -117,12 +120,9 @@
//
def.setDescription(description);
- def.setThumbnail(thumbnail); // Do something better than that
+ def.setThumbnail(thumbnail);
def.setTitle(title);
def.setReferenceURL(referenceURL);
-
- //
- process(gadgetURI, def);
}
@Override
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegistryService.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegistryService.java 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegistryService.java 2011-08-16 10:25:46 UTC (rev 7151)
@@ -19,6 +19,8 @@
package org.exoplatform.application.gadget;
+import org.exoplatform.application.gadget.impl.GadgetDefinition;
+
import java.util.Comparator;
import java.util.List;
@@ -100,4 +102,17 @@
public String getModuleId();
public String getHostName();
+
+ /**
+ * Get the URL of gadget from gadget definition. There are 2 kind of gadget:
+ * <p>
+ * <ul>
+ * <li>Local gadget: Gadget definition and resource are stored in JCR workspace. This gadget content can be also accessed by WebDAV
+ * <li>Remote gadget: An absolute link to gadget definition
+ * </ul>
+ *
+ * @param gadgetName
+ * @return link to local gadget definition stored in JCR or URL to remote gadget
+ */
+ public String getGadgetURL(String gadgetName);
}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/RemoteImporter.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/RemoteImporter.java 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/RemoteImporter.java 2011-08-16 10:25:46 UTC (rev 7151)
@@ -46,9 +46,9 @@
}
@Override
- protected String getGadgetURL(String gadgetURI) throws Exception
+ protected String getGadgetURL() throws Exception
{
- return "http://www.gatein.org";
+ return getGadgetURI();
}
@Override
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/ServletLocalImporter.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/ServletLocalImporter.java 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/ServletLocalImporter.java 2011-08-16 10:25:46 UTC (rev 7151)
@@ -47,16 +47,20 @@
/** Used temporarily when importing resources. */
private NTFolder folder;
+
+ private GadgetRegistryService gadgetService;
public ServletLocalImporter(
String name,
String gadgetPath,
- ServletContext servletContext)
+ ServletContext servletContext,
+ GadgetRegistryService gadgetRegistryService)
{
super(name, gadgetPath);
//
this.servletContext = servletContext;
+ this.gadgetService = gadgetRegistryService;
}
@Override
@@ -66,13 +70,13 @@
}
@Override
- protected String getGadgetURL(String gadgetURI) throws Exception
+ protected String getGadgetURL() throws Exception
{
- return gadgetURI;
+ return gadgetService.getGadgetURL(getGadgetName());
}
@Override
- protected void process(String gadgetURI, GadgetDefinition def) throws Exception
+ protected void process(String gadgetPath, GadgetDefinition def) throws Exception
{
def.setLocal(true);
@@ -80,13 +84,13 @@
LocalGadgetData data = (LocalGadgetData)def.getData();
//
- String fileName = getName(gadgetURI);
+ String fileName = getName(gadgetPath);
data.setFileName(fileName);
// Import resource
folder = data.getResources();
- String folderPath = getParent(gadgetURI);
- visitChildren(gadgetURI, folderPath);
+ String folderPath = getParent(gadgetPath);
+ visitChildren(gadgetPath, folderPath);
folder = null;
}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java 2011-08-16 10:25:46 UTC (rev 7151)
@@ -28,6 +28,7 @@
import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
import org.exoplatform.commons.chromattic.ChromatticManager;
import org.exoplatform.commons.utils.PropertyManager;
+import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.PropertiesParam;
import org.exoplatform.container.xml.ValueParam;
@@ -235,6 +236,34 @@
//
registry.removeGadget(name);
}
+
+ public String getGadgetURL(String gadgetName)
+ {
+ String url;
+ GadgetData data = this.getRegistry().getGadget(gadgetName).getData();
+ if (data instanceof LocalGadgetData)
+ {
+ LocalGadgetData localData = (LocalGadgetData) data;
+ url = "/" + PortalContainer.getCurrentRestContextName() + "/" + getJCRGadgetURL(localData);
+ }
+ else if (data instanceof RemoteGadgetData)
+ {
+ RemoteGadgetData remoteData = (RemoteGadgetData)data;
+ url = remoteData.getURL();
+ }
+ else
+ {
+ throw new IllegalStateException("Gadget has to be instance of LocalGadgetData or RemoteGadgetData");
+ }
+
+ return url;
+ }
+
+ private String getJCRGadgetURL(LocalGadgetData data)
+ {
+ return "jcr/" + chromatticLifeCycle.getRepositoryName() + "/" + chromatticLifeCycle.getWorkspaceName()
+ + data.getPath() + "/app:resources/" + data.getFileName();
+ }
private void saveGadget(GadgetDefinition def, Gadget gadget)
{
@@ -253,10 +282,7 @@
if (data instanceof LocalGadgetData)
{
LocalGadgetData localData = (LocalGadgetData)data;
- url =
- "jcr/" + chromatticLifeCycle.getRepositoryName() + "/" +
- chromatticLifeCycle.getWorkspaceName() + "/production/app:gadgets/app:" + def.getName() +
- "/app:data/app:resources/" + localData.getFileName();
+ url = getJCRGadgetURL(localData);
}
else
{
@@ -308,7 +334,7 @@
/** . */
private final GadgetImporter importer;
-
+
private DeployTask(GadgetImporter importer)
{
this.importer = importer;
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2011-08-16 10:25:46 UTC (rev 7151)
@@ -62,6 +62,9 @@
protected abstract void setResources(NTFolder resources);
+ @Path
+ public abstract String getPath();
+
private NTFile getGadgetContent() {
String fileName = getFileName();
NTFolder resources = getResources();
Modified: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/Calculator.xml
===================================================================
--- portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/Calculator.xml 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/Calculator.xml 2011-08-16 10:25:46 UTC (rev 7151)
@@ -34,7 +34,7 @@
directory_title="Calculator"
title_url="http://www.exoplatform.org"
description="This simple and useful calculator lets you perform most of the basic arithmetic operations."
- thumbnail="http://localhost:8080/eXoGadgets/skin/DefaultSkin/portletIcons/Calculator..."
+ thumbnail="images/Calculator.gif"
height="227">
<Locale lang="ar" language_direction="rtl"/>
</ModulePrefs>
Added: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/images/Calculator.gif
===================================================================
(Binary files differ)
Property changes on: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/images/Calculator.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/Calendar.xml
===================================================================
--- portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/Calendar.xml 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/Calendar.xml 2011-08-16 10:25:46 UTC (rev 7151)
@@ -34,7 +34,7 @@
directory_title="Calendar"
title_url="http://www.exoplatform.org"
description="What date is it? Use this cool calendar to keep track of the date in style. You can switch easily between daily, monthly or yearly view."
- thumbnail="http://localhost:8080/eXoGadgets/skin/DefaultSkin/portletIcons/Calendar.png"
+ thumbnail="images/Calendar.gif"
height="205">
<Locale lang="ar" language_direction="rtl"/>
</ModulePrefs>
Added: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/images/Calendar.gif
===================================================================
(Binary files differ)
Property changes on: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/images/Calendar.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
===================================================================
--- portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml 2011-08-16 10:25:46 UTC (rev 7151)
@@ -34,7 +34,7 @@
directory_title="Todo"
title_url="http://www.exoplatform.org"
description="ToDo Gadget, easily manage and track your daily to-do list."
- thumbnail="http://localhost:8080/eXoGadgets/skin/DefaultSkin/portletIcons/Todo.png"
+ thumbnail="images/Todo.gif"
height="235">
<Locale messages="locale/ALL_ALL.xml" />
<Locale lang="ar" messages="locale/ar_ALL.xml" language_direction="rtl"/>
Added: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/images/Todo.gif
===================================================================
(Binary files differ)
Property changes on: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/images/Todo.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/images/rssAggregator.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/images/rssAggregator.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml
===================================================================
--- portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml 2011-08-16 10:05:35 UTC (rev 7150)
+++ portal/trunk/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml 2011-08-16 10:25:46 UTC (rev 7151)
@@ -23,7 +23,7 @@
<Module>
<ModulePrefs title="RSS Reader" title_url="http://www.exoplatform.com" directory_title="RSS Reader"
description="RSS Reader"
- thumbnail="/eXoGadgets/skin/DefaultSkin/portletIcons/rssAggregator.png">
+ thumbnail="images/rssAggregator.png">
<Require feature="dynamic-height" />
<Require feature="setprefs"/>
<Require feature="settitle"/>
13 years, 5 months
gatein SVN: r7150 - portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm.
by do-not-reply@jboss.org
Author: bdaw
Date: 2011-08-16 06:05:35 -0400 (Tue, 16 Aug 2011)
New Revision: 7150
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
Log:
GTNPORTAL-2026 CustomMembershipLoginModule should end lifecycle in case of an error
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-16 09:58:06 UTC (rev 7149)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-16 10:05:35 UTC (rev 7150)
@@ -146,15 +146,14 @@
*/
private void addUserToPlatformUsers(String userId) throws Exception
{
+ OrganizationService orgService = (OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
try
{
- OrganizationService orgService = (OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
begin(orgService);
User user = orgService.getUserHandler().findUserByName(userId);
MembershipType memberType = orgService.getMembershipTypeHandler().findMembershipType(membershipType);
Group platformUsersGroup = orgService.getGroupHandler().findGroupById(groupId);
orgService.getMembershipHandler().linkMembership(user, platformUsersGroup, memberType, true);
- end(orgService);
}
catch (Exception e)
{
@@ -162,6 +161,10 @@
// don't rethrow login exception in case of failure.
// throw e;
}
+ finally
+ {
+ end(orgService);
+ }
}
private void begin(OrganizationService orgService) throws Exception
{
13 years, 5 months
gatein SVN: r7149 - portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm.
by do-not-reply@jboss.org
Author: bdaw
Date: 2011-08-16 05:58:06 -0400 (Tue, 16 Aug 2011)
New Revision: 7149
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
Log:
GTNPORTAL-1920 Stale cache problem when deleting user
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-08-16 09:51:44 UTC (rev 7148)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-08-16 09:58:06 UTC (rev 7149)
@@ -259,6 +259,11 @@
}
+ if (getIntegrationCache() != null)
+ {
+ getIntegrationCache().invalidateAll();
+ }
+
if (broadcast)
{
postDelete(exoUser);
13 years, 5 months