gatein SVN: r5736 - exo/portal/branches/3.1.x.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-01-12 09:37:46 -0500 (Wed, 12 Jan 2011)
New Revision: 5736
Modified:
exo/portal/branches/3.1.x/pom.xml
Log:
EXOGTN-216 Align dependencies with EPP 5.1
Modified: exo/portal/branches/3.1.x/pom.xml
===================================================================
--- exo/portal/branches/3.1.x/pom.xml 2011-01-12 14:26:07 UTC (rev 5735)
+++ exo/portal/branches/3.1.x/pom.xml 2011-01-12 14:37:46 UTC (rev 5736)
@@ -44,8 +44,8 @@
<org.jibx.version>1.2.1</org.jibx.version>
<org.shindig.version>1.0-r790473-Patch04</org.shindig.version>
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
- <org.gatein.common.version>2.0.2-GA</org.gatein.common.version>
- <org.gatein.wci.version>2.0.1-GA</org.gatein.wci.version>
+ <org.gatein.common.version>2.0.3-GA</org.gatein.common.version>
+ <org.gatein.wci.version>2.0.2-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.1.1-GA</org.gatein.pc.version>
<org.picketlink.idm>1.1.7.GA</org.picketlink.idm>
<org.gatein.wsrp.version>1.1.1-GA</org.gatein.wsrp.version>
14 years, 8 months
gatein SVN: r5735 - in exo/portal/branches/3.1.x: component/identity/src/main/java/org/exoplatform/services/organization/idm and 1 other directory.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-01-12 09:26:07 -0500 (Wed, 12 Jan 2011)
New Revision: 5735
Added:
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/Tools.java
Modified:
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMCacheService.java
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
exo/portal/branches/3.1.x/pom.xml
Log:
EXOGTN-205 Port lastest IDM changes
Modified: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -22,6 +22,9 @@
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.GroupEventListener;
import org.exoplatform.services.organization.GroupHandler;
+import org.gatein.common.logging.LogLevel;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import org.picketlink.idm.api.Attribute;
import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.impl.api.SimpleAttribute;
@@ -35,10 +38,10 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+
/*
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
*/
@@ -57,6 +60,8 @@
private PicketLinkIDMOrganizationServiceImpl orgService;
+ private static final String CYCLIC_ID = "org.gatein.portal.identity.LOOPED_GROUP_ID";
+
public GroupDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
{
service_ = service;
@@ -71,16 +76,50 @@
final public Group createGroupInstance()
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "createGroupInstance",
+ null
+ );
+ }
return new ExtGroup();
}
public void createGroup(Group group, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "createGroup",
+ new Object[]{
+ "broadcast", broadcast
+ }
+ );
+ }
addChild(null, group, broadcast);
}
public void addChild(Group parent, Group child, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "addChild",
+ new Object[]{
+ "parent", parent,
+ "child", child,
+ "broadcast", broadcast
+ }
+ );
+ }
+
org.picketlink.idm.api.Group parentGroup = null;
String childPLGroupName = getPLIDMGroupName(child.getGroupName());
@@ -146,6 +185,19 @@
public void saveGroup(Group group, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "saveGroup",
+ new Object[]{
+ "group", group,
+ "broadcast", broadcast
+ }
+ );
+ }
+
if (broadcast)
{
preSave(group, false);
@@ -159,6 +211,19 @@
public Group removeGroup(Group group, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "removeGroup",
+ new Object[]{
+ "group", group,
+ "broadcast", broadcast
+ }
+ );
+ }
+
if (broadcast)
{
preDelete(group);
@@ -210,6 +275,7 @@
try
{
getIdentitySession().getPersistenceManager().removeGroup(jbidGroup, true);
+
}
catch (Exception e)
{
@@ -225,6 +291,19 @@
public Collection findGroupByMembership(String userName, String membershipType) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findGroupsByMembership",
+ new Object[]{
+ "userName", membershipType
+ }
+ );
+ }
+
+
Collection<org.picketlink.idm.api.Role> allRoles = new HashSet();
try
@@ -269,25 +348,84 @@
}
// UI has hardcoded casts to List
- return new LinkedList<Group>(exoGroups);
+ Collection result = new LinkedList<Group>(exoGroups);
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findGroupByMembership",
+ result
+ );
+ }
+
+ return result;
}
//
public Group findGroupById(String groupId) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findGroupById",
+ new Object[]{
+ "groupId", groupId
+ }
+ );
+ }
+
org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
if (jbidGroup == null)
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findGroupById",
+ null
+ );
+ }
+
return null;
}
- return convertGroup(jbidGroup);
+ Group result = convertGroup(jbidGroup);
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findGroupById",
+ result
+ );
+ }
+
+ return result;
+
}
public Collection findGroups(Group parent) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findGroups",
+ new Object[]{
+ "parent", parent
+ }
+ );
+ }
+
org.picketlink.idm.api.Group jbidGroup = null;
if (parent == null)
@@ -370,7 +508,8 @@
{
String id = g.getParentId();
if ((parent == null && id == null)
- || (id != null && id.equals(parent.getId())))
+ || (parent != null && id != null && id.equals(parent.getId()))
+ || (parent == null && id != null && id.equals("/")))
{
exoGroups.add(g);
continue;
@@ -392,6 +531,16 @@
Collections.sort(results);
}
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findGroups",
+ results
+ );
+ }
+
return results;
}
@@ -399,6 +548,19 @@
public Collection findGroupsOfUser(String user) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findGroupsOfUser",
+ new Object[]{
+ "user", user
+ }
+ );
+ }
+
+
if (user == null)
{
// julien : integration bug
@@ -411,6 +573,17 @@
// at org.exoplatform.organization.webui.component.GroupManagement.isMemberOfGroup(GroupManagement.java:72)
// at org.exoplatform.organization.webui.component.GroupManagement.isAdministrator(GroupManagement.java:125)
// at org.exoplatform.organization.webui.component.UIGroupExplorer.<init>(UIGroupExplorer.java:57)
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findGroupsOfUser",
+ Collections.emptyList()
+ );
+ }
+
return Collections.emptyList();
}
@@ -435,12 +608,32 @@
}
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findGroupsOfUser",
+ exoGroups
+ );
+ }
+
return exoGroups;
}
public Collection getAllGroups() throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "getAllGroups",
+ null
+ );
+ }
+
Set<org.picketlink.idm.api.Group> plGroups = new HashSet<org.picketlink.idm.api.Group>();
try
@@ -486,7 +679,19 @@
}
// UI has hardcoded casts to List
- return new LinkedList<Group>(exoGroups);
+ Collection result = new LinkedList<Group>(exoGroups);
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "getAllGroups",
+ result
+ );
+ }
+
+ return result;
}
@@ -525,6 +730,18 @@
protected Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "convertGroup",
+ new Object[]{
+ "jbidGroup", jbidGroup
+ }
+ );
+ }
+
Map<String, Attribute> attrs = new HashMap();
try
@@ -556,8 +773,18 @@
}
// Resolve full ID
- String id = getGroupId(jbidGroup);
+ String id = getGroupId(jbidGroup, null);
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "getGroupId",
+ id
+ );
+ }
+
exoGroup.setId(id);
// child of root
@@ -571,16 +798,71 @@
exoGroup.setParentId(id.substring(0, id.lastIndexOf("/")));
}
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "convertGroup",
+ exoGroup
+ );
+ }
+
return exoGroup;
}
- private String getGroupId(org.picketlink.idm.api.Group jbidGroup) throws Exception
+ /**
+ * Calculates group id by checking all parents up to the root group or group type mapping from the configuration.
+ *
+ * @param jbidGroup
+ * @param processed
+ * @return
+ * @throws Exception
+ */
+ private String getGroupId(org.picketlink.idm.api.Group jbidGroup,
+ List<org.picketlink.idm.api.Group> processed) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "getGroupId",
+ new Object[]{
+ "jbidGroup", jbidGroup,
+ "processed", processed
+ }
+ );
+ }
+
+
+ // Check in cache
+ if (getIntegrationCache() != null)
+ {
+ String cachedId = getIntegrationCache().getGtnGroupId(getCacheNS(), jbidGroup.getKey());
+ if (cachedId != null)
+ {
+ return cachedId;
+ }
+ }
+
if (jbidGroup.equals(getRootGroup()))
{
- return "";
+ String calculatedId = "";
+
+ if (getIntegrationCache() != null)
+ {
+ getIntegrationCache().putGtnGroupId(getCacheNS(), jbidGroup.getKey(), calculatedId);
+ }
+
+ return calculatedId;
}
+ if (processed == null)
+ {
+ processed = new LinkedList<org.picketlink.idm.api.Group>();
+ }
+
Collection<org.picketlink.idm.api.Group> parents = new HashSet();
String gtnGroupName = getGtnGroupName(jbidGroup.getName());
@@ -595,7 +877,17 @@
log.info("Identity operation error: ", e);
}
-
+ // Check if there is cross reference so we ended in a loop and break the process.
+ if (parents.size() > 0 && processed.contains(parents.iterator().next()))
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace("Detected looped relationship between groups!!!");
+ }
+ processed.remove(processed.size() - 1);
+ return CYCLIC_ID;
+ }
+ // If there are no parents or more then one parent
if (parents.size() == 0 || parents.size() > 1)
{
@@ -605,34 +897,86 @@
"defined by type mappings or just place it under root /");
}
+ String calculatedId = obtainMappedId(jbidGroup, gtnGroupName);
- String id = orgService.getConfiguration().getParentId(jbidGroup.getGroupType());
+ if (getIntegrationCache() != null)
+ {
+ getIntegrationCache().putGtnGroupId(getCacheNS(), jbidGroup.getKey(), calculatedId);
+ }
+ return calculatedId;
- if (id != null && orgService.getConfiguration().isForceMembershipOfMappedTypes())
+ }
+
+ processed.add(jbidGroup);
+ String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()),processed);
+
+ // Check if loop occured
+ if (parentGroupId.equals(CYCLIC_ID))
+ {
+ // if there are still processed groups in the list we are in nested call so remove last one and go back
+ if (processed.size() > 0)
{
- if (id.endsWith("/*"))
+ processed.remove(processed.size() - 1);
+ return parentGroupId;
+ }
+ // if we finally reached the first group from the looped ones then just return id calculated from
+ // mappings or connect it to the root
+ else
+ {
+ String calculatedId = obtainMappedId(jbidGroup, gtnGroupName);
+
+ if (getIntegrationCache() != null)
{
- id = id.substring(0, id.length() - 2);
+ getIntegrationCache().putGtnGroupId(getCacheNS(), jbidGroup.getKey(), calculatedId);
}
- return id + "/" + gtnGroupName;
+ return calculatedId;
}
+ }
- // All groups not connected to the root should be just below the root
- return "/" + gtnGroupName;
+ String calculatedId = parentGroupId + "/" + gtnGroupName;
- //TODO: make it configurable
- // throw new IllegalStateException("Group present that is not connected to the root: " + jbidGroup.getName());
+ if (getIntegrationCache() != null)
+ {
+ getIntegrationCache().putGtnGroupId(getCacheNS(), jbidGroup.getKey(), calculatedId);
+ }
+ return calculatedId;
+
+ }
+
+ /**
+ * Obtain group id based on groupType mapping from configuration or if this fails just place it under root /
+ *
+ * @param jbidGroup
+ * @param gtnGroupName
+ * @return
+ */
+ private String obtainMappedId(org.picketlink.idm.api.Group jbidGroup, String gtnGroupName)
+ {
+ String id = orgService.getConfiguration().getParentId(jbidGroup.getGroupType());
+
+
+
+ if (id != null && orgService.getConfiguration().isForceMembershipOfMappedTypes())
+ {
+ if (id.endsWith("/*"))
+ {
+ id = id.substring(0, id.length() - 2);
+ }
+
+ return id + "/" + gtnGroupName;
}
- String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()));
- return parentGroupId + "/" + gtnGroupName;
+ // All groups not connected to the root should be just below the root
+ return "/" + gtnGroupName;
+ //TODO: make it configurable
+ // throw new IllegalStateException("Group present that is not connected to the root: " + jbidGroup.getName());
}
private org.picketlink.idm.api.Group persistGroup(Group exoGroup) throws Exception
@@ -708,8 +1052,61 @@
return service_.getIdentitySession();
}
- private org.picketlink.idm.api.Group getRootGroup() throws Exception
+ 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();
+ }
+
+
+ /**
+ * Returns mock of PLIDM group representing "/" group. This method uses cache and delegates to obtainRootGroup().
+ *
+ * @return
+ * @throws Exception
+ */
+ protected org.picketlink.idm.api.Group getRootGroup() throws Exception
+ {
+ org.picketlink.idm.api.Group rootGroup = null;
+
+ if (getIntegrationCache() != null)
+ {
+ rootGroup = getIntegrationCache().getRootGroup(getCacheNS());
+ }
+
+ if (rootGroup == null)
+ {
+ rootGroup = obtainRootGroup();
+
+ if (getIntegrationCache() != null)
+ {
+ getIntegrationCache().putRootGroup(getCacheNS(), rootGroup);
+ }
+ }
+
+ return rootGroup;
+
+ }
+
+ /**
+ * Obtains PLIDM group representing "/" group. If such group doens't exist it creates one.
+ * @return
+ * @throws Exception
+ */
+ protected org.picketlink.idm.api.Group obtainRootGroup() throws Exception
+ {
org.picketlink.idm.api.Group rootGroup = null;
try
{
Modified: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -21,10 +21,14 @@
import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.services.organization.User;
+import org.gatein.common.logging.LogLevel;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import org.picketlink.idm.api.SortOrder;
import org.picketlink.idm.api.query.UserQuery;
import org.picketlink.idm.api.query.UserQueryBuilder;
+
import java.util.List;
/*
@@ -32,6 +36,8 @@
*/
public class IDMUserListAccess implements ListAccess<User>
{
+ private static Logger log = LoggerFactory.getLogger(IDMUserListAccess.class);
+
private final UserDAOImpl userDAO;
private final PicketLinkIDMService idmService;
@@ -54,6 +60,19 @@
public User[] load(int index, int length) throws Exception, IllegalArgumentException
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "load",
+ new Object[]{
+ "index", index,
+ "length", length
+ }
+ );
+ }
+
userQueryBuilder.page(index, length);
UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
List<org.picketlink.idm.api.User> users = idmService.getIdentitySession().list(query);
@@ -67,21 +86,55 @@
exoUsers[i] = UserDAOImpl.getPopulatedUser(user.getId(), idmService.getIdentitySession());
}
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "load",
+ exoUsers
+ );
+ }
+
return exoUsers;
}
public int getSize() throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "getSize",
+ null
+ );
+ }
+
+ int result;
+
if (countAll)
{
- return idmService.getIdentitySession().getPersistenceManager().getUserCount();
+ result = idmService.getIdentitySession().getPersistenceManager().getUserCount();
}
else
{
userQueryBuilder.page(0, 0);
UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
- return idmService.getIdentitySession().execute(query).size();
+ result = idmService.getIdentitySession().execute(query).size();
}
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "getSize",
+ result
+ );
+ }
+
+ return result;
+
}
}
Copied: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java (from rev 5221, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java)
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java (rev 0)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -0,0 +1,245 @@
+package org.exoplatform.services.organization.idm;
+
+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.picketlink.idm.api.Group;
+import org.picketlink.idm.api.User;
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/*
+* JBoss, a division of Red Hat
+* Copyright 2010, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+/**
+ * Provides cache for some data used in integration layer between PicketLink IDM and GateIn
+ */
+public class IntegrationCache
+{
+ private static Logger log = Logger.getLogger(IntegrationCache.class.getName());
+
+ private Cache cache;
+
+ public static final String NODE_GTN_GROUP_ID = "NODE_GTN_GROUP_ID";
+
+ public static final String NODE_PLIDM_ROOT_GROUP = "NODE_PLIDM_ROOT_GROUP";
+
+ public static final String NULL_NS_NODE = "GTN_IC_COMMON_NS";
+
+ public static final String MAIN_ROOT = "NODE_GTN_ORG_SERVICE_INT_CACHE_MAIN_ROOT";
+
+ public static final String NODE_OBJECT_KEY = "object";
+
+ private Fqn getRootNode()
+ {
+ return Fqn.fromString("/" + MAIN_ROOT);
+ }
+
+ private Fqn getNamespacedFqn(String ns)
+ {
+ String namespace = ns != null ? ns : NULL_NS_NODE;
+ namespace = namespace.replaceAll("/", "_");
+ return Fqn.fromString(getRootNode() + "/" + namespace);
+ }
+
+ private Fqn getFqn(String ns, String node, Object o)
+ {
+ return Fqn.fromString(getNamespacedFqn(ns) + "/" + node + "/" + o);
+ }
+
+ private Fqn getFqn(String ns, String node)
+ {
+ return Fqn.fromString(getNamespacedFqn(ns) + "/" + node);
+ }
+
+ public void initialize(InputStream jbossCacheConfiguration)
+ {
+ CacheFactory factory = new DefaultCacheFactory();
+
+ if (jbossCacheConfiguration == null)
+ {
+ throw new IllegalArgumentException("JBoss Cache configuration InputStream is null");
+ }
+
+ this.cache = factory.createCache(jbossCacheConfiguration);
+
+ this.cache.create();
+ this.cache.start();
+
+ }
+
+ public void initialize(Cache cache)
+ {
+ this.cache = cache;
+
+ CacheStatus status = cache.getCacheStatus();
+
+ if (status.createAllowed())
+ {
+ this.cache.create();
+ }
+ if (status.startAllowed())
+ {
+ this.cache.start();
+ }
+
+ }
+
+ Cache getCache()
+ {
+ return cache;
+ }
+
+
+ public void invalidate(String ns)
+ {
+
+ boolean success = cache.getRoot().removeChild(getNamespacedFqn(ns));
+
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating namespace:" + ns + "; success=" + success);
+ }
+ }
+
+ public void invalidateAll()
+ {
+ boolean success = cache.getRoot().removeChild(getRootNode());
+
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating whole cache - success=" + success);
+ }
+ }
+
+ /**
+ * Store gatein group id
+ * @param ns
+ * @param pLIDMId
+ * @param id
+ */
+ void putGtnGroupId(String ns, String pLIDMId, String id)
+ {
+ Fqn nodeFqn = getFqn(ns, NODE_GTN_GROUP_ID, pLIDMId);
+
+ Node ioNode = getCache().getRoot().addChild(nodeFqn);
+
+ if (ioNode != null)
+ {
+ ioNode.put(NODE_OBJECT_KEY, id);
+
+ if (log.isLoggable(Level.FINER))
+ {
+
+ log.finer(this.toString() + "GateIn group id cached. PLIDM group id: " + pLIDMId +
+ "GateIn group id: " + id + ";namespace=" + ns);
+ }
+ }
+ }
+
+ /**
+ * Retrieve gatein group id
+ * @param ns
+ * @param pLIDMId
+ * @return
+ */
+ String getGtnGroupId(String ns, String pLIDMId)
+ {
+
+ Fqn nodeFqn = getFqn(ns, NODE_GTN_GROUP_ID, pLIDMId);
+
+ Node node = getCache().getRoot().getChild(nodeFqn);
+
+ if (node != null)
+ {
+ String id = (String)node.get(NODE_OBJECT_KEY);
+
+ if (log.isLoggable(Level.FINER) && id != null)
+ {
+ log.finer(this.toString() + "GateIn group id found in cache. PLIDM group id: " + pLIDMId +
+ "GateIn group id: " + id + ";namespace=" + ns);
+ }
+
+ return id;
+ }
+
+ return null;
+
+ }
+
+ /**
+ * Store PLIDM root group
+ * @param ns
+ * @param rootGroup
+ */
+ void putRootGroup(String ns, Group rootGroup)
+ {
+ Fqn nodeFqn = getFqn(ns, NODE_PLIDM_ROOT_GROUP);
+
+ Node ioNode = getCache().getRoot().addChild(nodeFqn);
+
+ if (ioNode != null)
+ {
+ ioNode.put(NODE_OBJECT_KEY, rootGroup);
+
+ if (log.isLoggable(Level.FINER))
+ {
+
+ log.finer(this.toString() + "GateIn root group stored in cache" + ";namespace=" + ns);
+ }
+ }
+ }
+
+ /**
+ * Retrieve PLIDM root group
+ * @param ns
+ * @return
+ */
+ Group getRootGroup(String ns)
+ {
+ Fqn nodeFqn = getFqn(ns, NODE_PLIDM_ROOT_GROUP);
+
+ Node node = getCache().getRoot().getChild(nodeFqn);
+
+ if (node != null)
+ {
+ Group rootGroup = (Group)node.get(NODE_OBJECT_KEY);
+
+ if (log.isLoggable(Level.FINER) && rootGroup != null)
+ {
+ log.finer(this.toString() + "GateIn root group found in cache" + ";namespace=" + ns);
+ }
+
+ return rootGroup;
+ }
+
+ return null;
+
+ }
+
+}
Modified: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -26,12 +26,14 @@
import org.exoplatform.services.organization.MembershipHandler;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.User;
+import org.gatein.common.logging.LogLevel;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.Role;
import org.picketlink.idm.api.RoleType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -74,6 +76,19 @@
public void createMembership(Membership m, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "createMembership",
+ new Object[]{
+ "membership", m,
+ "broadcast", broadcast,
+ }
+ );
+ }
+
if (broadcast)
{
preSave(m, true);
@@ -90,6 +105,21 @@
public void linkMembership(User user, Group g, MembershipType mt, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "linkMembership",
+ new Object[]{
+ "user", user,
+ "group", g,
+ "membershipType", mt,
+ "broadcast", broadcast
+ }
+ );
+ }
+
if (g == null)
{
throw new InvalidNameException("Can not create membership record for " + user.getUserName()
@@ -154,7 +184,20 @@
public void saveMembership(Membership m, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "saveMembership",
+ new Object[]{
+ "membership", m,
+ "broadcast", broadcast
+ }
+ );
+ }
+
String plGroupName = getPLIDMGroupName(getGroupNameFromId(m.getGroupId()));
String groupId =
@@ -222,7 +265,20 @@
public Membership removeMembership(String id, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "removeMembership",
+ new Object[]{
+ "id", id,
+ "broadcast", broadcast
+ }
+ );
+ }
+
Membership m = new MembershipImpl(id);
String plGroupName = getPLIDMGroupName(getGroupNameFromId(m.getGroupId()));
@@ -308,6 +364,20 @@
public Collection removeMembershipByUser(String userName, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "removeMembershipByUser",
+ new Object[]{
+ "userName", userName,
+ "broadcast", broadcast
+ }
+ );
+ }
+
+
Collection<Role> roles = new HashSet();
try
@@ -388,6 +458,22 @@
public Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
{
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findMembershipByUserAndType",
+ new Object[]{
+ "userName", userName,
+ "groupId", groupId,
+ "type", type,
+ }
+ );
+ }
+
+
String plGroupName = getPLIDMGroupName(getGroupNameFromId(groupId));
String gid =
@@ -437,6 +523,8 @@
hasMembership = true;
}
+ Membership result = null;
+
if (hasMembership)
{
@@ -446,16 +534,51 @@
m.setUserName(userName);
m.setMembershipType(type);
- return m;
+ result = m;
}
- return null;
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembershipByUserGroupAndType",
+ result
+ );
+ }
+
+ return result;
}
public Collection findMembershipsByUserAndGroup(String userName, String groupId) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findMembershipByUserAndGroup",
+ new Object[]{
+ "userName", userName,
+ "groupId", groupId,
+ }
+ );
+ }
+
if (userName == null)
{
// julien fix : if user name is null, need to check if we do need to return a special group
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembershipByUserAndGroup",
+ Collections.emptyList()
+ );
+ }
+
return Collections.emptyList();
}
@@ -515,11 +638,36 @@
}
//TODO: Exo UI has hardcoded casts to List
- return new LinkedList(memberships);
+ Collection result = new LinkedList(memberships);
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembershipByUserAndGroup",
+ result
+ );
+ }
+
+ return result;
}
public Collection findMembershipsByUser(String userName) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findMembershipsByUser",
+ new Object[]{
+ "userName", userName
+ }
+ );
+ }
+
+
Collection<Role> roles = new HashSet();
try
@@ -577,7 +725,19 @@
}
- return new LinkedList(memberships);
+ Collection result = new LinkedList(memberships);
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembershipsByUser",
+ result
+ );
+ }
+
+ return result;
}
public Collection findMembershipsByGroup(Group group) throws Exception
@@ -587,6 +747,18 @@
public Collection findMembershipsByGroupId(String groupId) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findMembershipsByGroup",
+ new Object[]{
+ "groupId", groupId
+ }
+ );
+ }
+
String plGroupName = getPLIDMGroupName(getGroupNameFromId(groupId));
String gid =
@@ -656,11 +828,34 @@
Collections.sort(results);
}
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembershipsByGroupId",
+ results
+ );
+ }
+
return results;
}
public Membership findMembership(String id) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findMembership",
+ new Object[]{
+ "id", id
+ }
+ );
+ }
+
Membership m = new MembershipImpl(id);
String plGroupName = getPLIDMGroupName(getGroupNameFromId(m.getGroupId()));
@@ -675,6 +870,15 @@
if (isCreateMembership(m.getMembershipType()) &&
getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembership",
+ m
+ );
+ }
return m;
}
}
@@ -690,6 +894,16 @@
if (isAssociationMapped() && getAssociationMapping().equals(m.getMembershipType()) &&
getIdentitySession().getRelationshipManager().isAssociatedByKeys(groupId, m.getUserName()))
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembership",
+ m
+ );
+ }
+
return m;
}
}
@@ -700,6 +914,15 @@
}
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembership",
+ null
+ );
+ }
return null;
}
Modified: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -157,4 +157,14 @@
return userName.compareTo(m.getUserName());
}
+
+ @Override
+ public String toString()
+ {
+ return "MembershipImpl{" +
+ "membershipType='" + membershipType + '\'' +
+ ", userName='" + userName + '\'' +
+ ", groupId='" + groupId + '\'' +
+ '}';
+ }
}
Modified: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -22,6 +22,7 @@
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.MembershipTypeHandler;
import org.exoplatform.services.organization.impl.MembershipTypeImpl;
+import org.gatein.common.logging.LogLevel;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
import org.picketlink.idm.api.IdentitySession;
@@ -71,6 +72,20 @@
public MembershipType createMembershipType(MembershipType mt, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "createMembershipType",
+ new Object[]{
+ "membershipType", mt,
+ "broadcast", broadcast
+ }
+ );
+ }
+
+
Date now = new Date();
mt.setCreatedDate(now);
mt.setModifiedDate(now);
@@ -83,6 +98,18 @@
public MembershipType saveMembershipType(MembershipType mt, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "saveMembershipType",
+ new Object[]{
+ "membershipType", mt,
+ "broadcast", broadcast
+ }
+ );
+ }
Date now = new Date();
mt.setModifiedDate(now);
updateMembershipType(mt);
@@ -91,6 +118,18 @@
public MembershipType findMembershipType(String name) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findMembershipType",
+ new Object[]{
+ "name", name
+ }
+ );
+ }
+
RoleType rt = getIdentitySession().getRoleManager().getRoleType(name);
MembershipType mt = null;
@@ -101,11 +140,35 @@
populateMembershipType(mt);
}
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembershipType",
+ mt
+ );
+ }
+
return mt;
}
public MembershipType removeMembershipType(String name, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "removeMembershipType",
+ new Object[]{
+ "name", name,
+ "broadcast", broadcast
+ }
+ );
+ }
+
+
MembershipType mt = findMembershipType(name);
if (mt != null)
@@ -119,6 +182,15 @@
public Collection findMembershipTypes() throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findMembershipTypes",
+ null
+ );
+ }
Collection<RoleType> rts = getIdentitySession().getRoleManager().findRoleTypes();
@@ -131,6 +203,16 @@
mts.add(mt);
}
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findMembershipTypes",
+ mts
+ );
+ }
+
return mts;
}
Modified: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMCacheService.java
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMCacheService.java 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMCacheService.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -51,6 +51,8 @@
public class PicketLinkIDMCacheService
{
+ private final List<IntegrationCache> integrationCache = new LinkedList<IntegrationCache>();
+
private final List<APICacheProvider> apiCacheProviders = new LinkedList<APICacheProvider>();
private final List<IdentityStoreCacheProvider> storeCacheProviders = new LinkedList<IdentityStoreCacheProvider>();
@@ -59,6 +61,16 @@
{
}
+ public void register(IntegrationCache cacheProvider)
+ {
+
+ if (cacheProvider != null)
+ {
+ integrationCache.add(cacheProvider);
+ }
+
+ }
+
public void register(APICacheProvider cacheProvider)
{
@@ -101,6 +113,11 @@
@Impact(ImpactType.WRITE)
public void invalidateAll()
{
+ for (IntegrationCache cacheProvider : integrationCache)
+ {
+ cacheProvider.invalidateAll();
+ }
+
for (APICacheProvider cacheProvider : apiCacheProviders)
{
cacheProvider.invalidateAll();
Modified: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -76,7 +76,7 @@
}
- public final org.picketlink.idm.api.Group getJBIDMGroup(String groupId) throws Exception
+ public final org.picketlink.idm.api.Group getJBIDMGroup(String groupId) throws Exception
{
String[] ids = groupId.split("/");
String name = ids[ids.length - 1];
Modified: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -26,6 +26,9 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.services.database.HibernateService;
import org.exoplatform.services.naming.InitialContextInitializer;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.DefaultCacheFactory;
import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.IdentitySessionFactory;
import org.picketlink.idm.api.cfg.IdentityConfiguration;
@@ -75,6 +78,8 @@
private IdentityConfiguration identityConfiguration;
+ private IntegrationCache integrationCache;
+
private PicketLinkIDMServiceImpl()
{
}
@@ -125,13 +130,31 @@
{
InputStream configStream = confManager.getInputStream(apiCacheConfig.getValue());
+ // Create common JBoss Cache instance
+ CacheFactory factory = new DefaultCacheFactory();
+ if (configStream == null)
+ {
+ throw new IllegalArgumentException("JBoss Cache configuration InputStream is null");
+ }
+
+ Cache cache = factory.createCache(configStream);
+
+ cache.create();
+ cache.start();
+
+ configStream.close();
+
+ // PLIDM API cache
JBossCacheAPICacheProviderImpl apiCacheProvider = new JBossCacheAPICacheProviderImpl();
- apiCacheProvider.initialize(configStream);
+ apiCacheProvider.initialize(cache);
picketLinkIDMCache.register(apiCacheProvider);
identityConfiguration.getIdentityConfigurationRegistry().register(apiCacheProvider, "apiCacheProvider");
- configStream.close();
+ //Integration cache
+ integrationCache = new IntegrationCache();
+ integrationCache.initialize(cache);
+ picketLinkIDMCache.register(apiCacheProvider);
}
if (storeCacheConfig != null)
@@ -192,4 +215,14 @@
}
return getIdentitySessionFactory().getCurrentIdentitySession(realm);
}
+
+ public IntegrationCache getIntegrationCache()
+ {
+ return integrationCache;
+ }
+
+ public String getRealmName()
+ {
+ return realmName;
+ }
}
Copied: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/Tools.java (from rev 5282, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/Tools.java)
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/Tools.java (rev 0)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/Tools.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -0,0 +1,106 @@
+package org.exoplatform.services.organization.idm;
+
+import org.gatein.common.logging.LogLevel;
+import org.gatein.common.logging.Logger;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+/*
+* JBoss, a division of Red Hat
+* Copyright 2010, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+/**
+ * Some helper methods
+ */
+public class Tools
+{
+ public static void logMethodIn(Logger log, LogLevel level, String methodName, Object[] args)
+ {
+ try
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Method '")
+ .append(methodName)
+ .append("' called with arguments: ");
+
+ if (args != null)
+ {
+ for (Object arg : args)
+ {
+ if (arg != null && arg instanceof Object[])
+ {
+ sb.append(Arrays.toString((Object[])arg))
+ .append("; ");
+ }
+ else
+ {
+ sb.append(arg)
+ .append("; ");
+ }
+ }
+ }
+ else
+ {
+ sb.append(args);
+ }
+
+ log.log(level, sb.toString());
+ }
+ catch (Throwable t)
+ {
+ log.log(level, "Error in logging code block (not related to application code): ", t);
+ }
+
+ }
+
+ public static void logMethodOut(Logger log, LogLevel level, String methodName, Object result)
+ {
+ try
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Method '")
+ .append(methodName)
+ .append("' returning object: ");
+
+ if (result != null && result instanceof Collection)
+ {
+ sb.append("Collection of size: ").append(((Collection)result).size());
+ }
+ else
+ {
+ if (result != null)
+ {
+ sb.append("[").append(result.getClass().getCanonicalName()).append("]");
+ }
+ sb.append(result);
+ }
+
+ log.log(level, sb.toString());
+
+ }
+ catch (Throwable t)
+ {
+ log.log(level, "Error in logging code block (not related to application code): ", t);
+ }
+ }
+
+}
Modified: exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
--- exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-01-12 14:26:07 UTC (rev 5735)
@@ -28,6 +28,7 @@
import org.exoplatform.services.organization.UserEventListener;
import org.exoplatform.services.organization.UserHandler;
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;
import org.picketlink.idm.api.Attribute;
@@ -122,6 +123,20 @@
public void createUser(User user, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "createUser",
+ new Object[]{
+ "user", user,
+ "broadcast", broadcast
+ }
+ );
+ }
+
+
IdentitySession session = service_.getIdentitySession();
if (broadcast)
{
@@ -149,6 +164,20 @@
public void saveUser(User user, boolean broadcast) throws Exception
{
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "saveUser",
+ new Object[]{
+ "user", user,
+ "broadcast", broadcast
+ }
+ );
+ }
+
IdentitySession session = service_.getIdentitySession();
if (broadcast)
{
@@ -165,6 +194,20 @@
public User removeUser(String userName, boolean broadcast) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "removeUser",
+ new Object[]{
+ "userName", userName,
+ "broadcast", broadcast
+ }
+ );
+ }
+
+
IdentitySession session = service_.getIdentitySession();
org.picketlink.idm.api.User foundUser = null;
@@ -223,15 +266,49 @@
//
public User findUserByName(String userName) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findUserByName",
+ new Object[]{
+ "userName", userName,
+ }
+ );
+ }
+
IdentitySession session = service_.getIdentitySession();
User user = getPopulatedUser(userName, session);
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findUserByName",
+ user
+ );
+ }
+
return user;
}
public LazyPageList getUserPageList(int pageSize) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "getUserPagetList",
+ new Object[]{
+ "pageSize", pageSize
+ }
+ );
+ }
+
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
return new LazyPageList(new IDMUserListAccess(this, service_, qb, pageSize, true), pageSize);
@@ -245,9 +322,32 @@
//
public boolean authenticate(String username, String password) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "authenticate",
+ new Object[]{
+ "userName", username,
+ "password", "****"
+ }
+ );
+ }
+
User user = findUserByName(username);
if (user == null)
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "authenticate",
+ false
+ );
+ }
+
return false;
}
@@ -279,12 +379,35 @@
userImpl.setLastLoginTime(Calendar.getInstance().getTime());
saveUser(userImpl, false);
}
+
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "authenticate",
+ authenticated
+ );
+ }
+
return authenticated;
}
public LazyPageList findUsers(Query q) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findUsers",
+ new Object[]{
+ "q", q
+ }
+ );
+ }
+
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
if (q.getUserName() != null)
@@ -319,6 +442,19 @@
public LazyPageList findUsersByGroup(String groupId) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findUsersByGroup",
+ new Object[]{
+ "groupId", groupId
+ }
+ );
+ }
+
+
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
org.picketlink.idm.api.Group jbidGroup = null;
@@ -339,6 +475,18 @@
public User findUserByEmail(String email) throws Exception
{
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findUserByEmail",
+ new Object[]{
+ "findUserByEmail", email
+ }
+ );
+ }
+
IdentitySession session = service_.getIdentitySession();
@@ -363,6 +511,16 @@
}
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodOut(
+ log,
+ LogLevel.TRACE,
+ "findUserByEmail",
+ user
+ );
+ }
+
return user;
}
Modified: exo/portal/branches/3.1.x/pom.xml
===================================================================
--- exo/portal/branches/3.1.x/pom.xml 2011-01-12 11:04:03 UTC (rev 5734)
+++ exo/portal/branches/3.1.x/pom.xml 2011-01-12 14:26:07 UTC (rev 5735)
@@ -47,7 +47,7 @@
<org.gatein.common.version>2.0.2-GA</org.gatein.common.version>
<org.gatein.wci.version>2.0.1-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.1.1-GA</org.gatein.pc.version>
- <org.picketlink.idm>1.1.6.GA</org.picketlink.idm>
+ <org.picketlink.idm>1.1.7.GA</org.picketlink.idm>
<org.gatein.wsrp.version>1.1.1-GA</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.4-GA</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
14 years, 8 months
gatein SVN: r5734 - exo/portal/branches/3.1.x/component/dashboard/src/main/resources/groovy/dashboard/webui/component.
by do-not-reply@jboss.org
Author: kien_nguyen
Date: 2011-01-12 06:04:03 -0500 (Wed, 12 Jan 2011)
New Revision: 5734
Modified:
exo/portal/branches/3.1.x/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardSelectContainer.gtmpl
Log:
EXOGTN-231 IE7: Need to resize Dashboard form after remove some gadget
Modified: exo/portal/branches/3.1.x/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardSelectContainer.gtmpl
===================================================================
--- exo/portal/branches/3.1.x/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardSelectContainer.gtmpl 2011-01-12 11:02:51 UTC (rev 5733)
+++ exo/portal/branches/3.1.x/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardSelectContainer.gtmpl 2011-01-12 11:04:03 UTC (rev 5734)
@@ -36,8 +36,8 @@
<%
List lstGadgets = uicomponent.getGadgetsOfCategory(category);
if(lstGadgets != null){
- if(lstGadgets.size() >= 20)
- uiPopup.setWindowSize(-1, 600);
+// if(lstGadgets.size() >= 20)
+// uiPopup.setWindowSize(-1, 600);
for(gadget in lstGadgets){
%>
14 years, 8 months
gatein SVN: r5733 - exo/portal/branches/3.1.x/portlet/exoadmin/src/main/webapp/WEB-INF.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-01-12 06:02:51 -0500 (Wed, 12 Jan 2011)
New Revision: 5733
Modified:
exo/portal/branches/3.1.x/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
Log:
EXOGTN-239 Support producing the event when NewAccountAdded event is raised
Modified: exo/portal/branches/3.1.x/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- exo/portal/branches/3.1.x/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2011-01-12 07:53:18 UTC (rev 5732)
+++ exo/portal/branches/3.1.x/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2011-01-12 11:02:51 UTC (rev 5733)
@@ -79,6 +79,9 @@
<short-title>Account Portlet</short-title>
<keywords>Administration</keywords>
</portlet-info>
+ <supported-publishing-event>
+ <name>NewAccountAdded</name>
+ </supported-publishing-event>
</portlet>
<portlet>
14 years, 8 months
gatein SVN: r5732 - in exo/portal/branches/3.1.x/testsuite: jmeter and 1 other directory.
by do-not-reply@jboss.org
Author: arthurpeltier
Date: 2011-01-12 02:53:18 -0500 (Wed, 12 Jan 2011)
New Revision: 5732
Added:
exo/portal/branches/3.1.x/testsuite/jmeter/
exo/portal/branches/3.1.x/testsuite/jmeter/PLF_PERF_05_Login-EXOGTN224.jmx
Log:
TESTVN-2330 : Perf test to validate EXOGTN-224 patch improvements
Added: exo/portal/branches/3.1.x/testsuite/jmeter/PLF_PERF_05_Login-EXOGTN224.jmx
===================================================================
--- exo/portal/branches/3.1.x/testsuite/jmeter/PLF_PERF_05_Login-EXOGTN224.jmx (rev 0)
+++ exo/portal/branches/3.1.x/testsuite/jmeter/PLF_PERF_05_Login-EXOGTN224.jmx 2011-01-12 07:53:18 UTC (rev 5732)
@@ -0,0 +1,670 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jmeterTestPlan version="1.2" properties="2.1">
+ <hashTree>
+ <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="PLF_PERF_05_Login-EXOGTN-224" enabled="true">
+ <stringProp name="TestPlan.comments">Recorded with exo gatein r5713, to run this test please dump at least 100 users with id=testuser<xxxx> and password =gtn</stringProp>
+ <boolProp name="TestPlan.functional_mode">false</boolProp>
+ <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
+ <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+ <collectionProp name="Arguments.arguments">
+ <elementProp name="ThreadCount" elementType="Argument">
+ <stringProp name="Argument.name">ThreadCount</stringProp>
+ <stringProp name="Argument.value">${__P(expThreadCount,1)}</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ </elementProp>
+ <elementProp name="LoopCount" elementType="Argument">
+ <stringProp name="Argument.name">LoopCount</stringProp>
+ <stringProp name="Argument.value">${__P(expLoopCount,10000000)}</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ </elementProp>
+ <elementProp name="Duration" elementType="Argument">
+ <stringProp name="Argument.name">Duration</stringProp>
+ <stringProp name="Argument.value">${__P(expDuration,3600)}</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ </elementProp>
+ <elementProp name="Server" elementType="Argument">
+ <stringProp name="Argument.name">Server</stringProp>
+ <stringProp name="Argument.value">${__P(expHost,mercury.testlab.exoplatform.vn)}</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ </elementProp>
+ <elementProp name="Port" elementType="Argument">
+ <stringProp name="Argument.name">Port</stringProp>
+ <stringProp name="Argument.value">${__P(expPort,8080)}</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ </elementProp>
+ <elementProp name="RampUpPeriod" elementType="Argument">
+ <stringProp name="Argument.name">RampUpPeriod</stringProp>
+ <stringProp name="Argument.value">${__P(expRampup,0)}</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ </elementProp>
+ <elementProp name="ImportanceAssertionHighlightString" elementType="Argument">
+ <stringProp name="Argument.name">ImportanceAssertionHighlightString</stringProp>
+ <stringProp name="Argument.value">STOP-TEST-IF-FAIL</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ </elementProp>
+ <elementProp name="StartupDelayTimeForIteration" elementType="Argument">
+ <stringProp name="Argument.name">StartupDelayTimeForIteration</stringProp>
+ <stringProp name="Argument.value">0</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ </elementProp>
+ </collectionProp>
+ </elementProp>
+ <stringProp name="TestPlan.user_define_classpath"></stringProp>
+ </TestPlan>
+ <hashTree>
+ <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="VUser" enabled="true">
+ <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
+ <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+ <boolProp name="LoopController.continue_forever">false</boolProp>
+ <stringProp name="LoopController.loops">${LoopCount}</stringProp>
+ </elementProp>
+ <stringProp name="ThreadGroup.num_threads">${ThreadCount}</stringProp>
+ <stringProp name="ThreadGroup.ramp_time">${RampUpPeriod}</stringProp>
+ <longProp name="ThreadGroup.start_time">1290047883000</longProp>
+ <longProp name="ThreadGroup.end_time">1290047883000</longProp>
+ <boolProp name="ThreadGroup.scheduler">true</boolProp>
+ <stringProp name="ThreadGroup.duration">${Duration}</stringProp>
+ <stringProp name="ThreadGroup.delay">${StartupDelayTimeForIteration}</stringProp>
+ <stringProp name="TestPlan.comments">to run with maven: mvn clean verify -Pverify,EXOGTN-224,2VUs -Dest-duration=180 -Dtest-host=mercury.testlab.exoplatform.vn</stringProp>
+ </ThreadGroup>
+ <hashTree>
+ <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+ <collectionProp name="Arguments.arguments">
+ <elementProp name="continue" elementType="Argument">
+ <stringProp name="Argument.name">continue</stringProp>
+ <stringProp name="Argument.value">true</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ </elementProp>
+ </collectionProp>
+ </Arguments>
+ <hashTree/>
+ <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
+ <stringProp name="HTTPSampler.domain">${Server}</stringProp>
+ <stringProp name="HTTPSampler.port">${Port}</stringProp>
+ <stringProp name="HTTPSampler.connect_timeout"></stringProp>
+ <stringProp name="HTTPSampler.response_timeout"></stringProp>
+ <stringProp name="HTTPSampler.protocol">http</stringProp>
+ <stringProp name="HTTPSampler.contentEncoding"></stringProp>
+ <stringProp name="HTTPSampler.path"></stringProp>
+ </ConfigTestElement>
+ <hashTree/>
+ <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Control the startup time and log information" enabled="true"/>
+ <hashTree>
+ <UniformRandomTimer guiclass="UniformRandomTimerGui" testclass="UniformRandomTimer" testname="Uniform Random Timer" enabled="true">
+ <stringProp name="ConstantTimer.delay">1000</stringProp>
+ <stringProp name="RandomTimer.range">4000.0</stringProp>
+ </UniformRandomTimer>
+ <hashTree/>
+ <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="BeanShell Startup Controller" enabled="true">
+ <stringProp name="BeanShellSampler.query">vars.put("continue","true");
+
+ResponseCode=2*100;
+ResponseMessage="initialize continue variable";
+log.info("Thread [" +ctx.getThread().getThreadName() + "] start iteration number: " + vars.get("IterationCounter")+ " - use UserId=testuser" + vars.get("UserId")) ;
+
+return "continue variable=true";
+
+
+</stringProp>
+ <stringProp name="BeanShellSampler.filename"></stringProp>
+ <stringProp name="BeanShellSampler.parameters"></stringProp>
+ <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp>
+ </BeanShellSampler>
+ <hashTree/>
+ </hashTree>
+ <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="Goto portal home page (/portal/public/classic/)" enabled="true">
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
+ <stringProp name="HTTPSampler.domain"></stringProp>
+ <stringProp name="HTTPSampler.port"></stringProp>
+ <stringProp name="HTTPSampler.connect_timeout"></stringProp>
+ <stringProp name="HTTPSampler.response_timeout"></stringProp>
+ <stringProp name="HTTPSampler.protocol"></stringProp>
+ <stringProp name="HTTPSampler.contentEncoding"></stringProp>
+ <stringProp name="HTTPSampler.path">/portal/public/classic/</stringProp>
+ <stringProp name="HTTPSampler.method">GET</stringProp>
+ <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+ <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+ <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+ <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
+ <boolProp name="HTTPSampler.monitor">false</boolProp>
+ <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
+ </HTTPSampler>
+ <hashTree>
+ <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
+ <collectionProp name="HeaderManager.headers">
+ <elementProp name="Accept-Language" elementType="Header">
+ <stringProp name="Header.name">Accept-Language</stringProp>
+ <stringProp name="Header.value">en-us,en;q=0.5</stringProp>
+ </elementProp>
+ <elementProp name="Accept" elementType="Header">
+ <stringProp name="Header.name">Accept</stringProp>
+ <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp>
+ </elementProp>
+ <elementProp name="Keep-Alive" elementType="Header">
+ <stringProp name="Header.name">Keep-Alive</stringProp>
+ <stringProp name="Header.value">115</stringProp>
+ </elementProp>
+ <elementProp name="User-Agent" elementType="Header">
+ <stringProp name="Header.name">User-Agent</stringProp>
+ <stringProp name="Header.value">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Encoding" elementType="Header">
+ <stringProp name="Header.name">Accept-Encoding</stringProp>
+ <stringProp name="Header.value">gzip,deflate</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Charset" elementType="Header">
+ <stringProp name="Header.name">Accept-Charset</stringProp>
+ <stringProp name="Header.value">ISO-8859-1,utf-8;q=0.7,*;q=0.7</stringProp>
+ </elementProp>
+ </collectionProp>
+ </HeaderManager>
+ <hashTree/>
+ <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion - User information${ImportanceAssertionHighlightString}" enabled="true">
+ <collectionProp name="Asserion.test_strings">
+ <stringProp name="-1926363754">\<a .*href=".*username=root.*password=gtn.*"\>Administrator\</a\></stringProp>
+ <stringProp name="-854512033">\<a .*href=".*username=john.*password=gtn.*"\>Manager\</a\></stringProp>
+ <stringProp name="1897349297">\<a .*href=".*username=mary.*password=gtn.*"\>User\</a\></stringProp>
+ <stringProp name="28321473">\<a .*href=".*username=demo.*password=gtn.*"\>Demo\</a\></stringProp>
+ </collectionProp>
+ <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
+ <boolProp name="Assertion.assume_success">false</boolProp>
+ <intProp name="Assertion.test_type">2</intProp>
+ <stringProp name="Scope.variable">SecureToken</stringProp>
+ </ResponseAssertion>
+ <hashTree/>
+ <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion - Menu${ImportanceAssertionHighlightString}" enabled="true">
+ <collectionProp name="Asserion.test_strings">
+ <stringProp name="2131272253">\<a .*onclick=".*ShowLoginForm.*\>Sign in\</a\></stringProp>
+ <stringProp name="-476933776">\<a .*href=".*/home"\>Home\</a\></stringProp>
+ <stringProp name="-1248977646">\<a .*href=".*/sitemap"\>SiteMap\</a\></stringProp>
+ </collectionProp>
+ <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
+ <boolProp name="Assertion.assume_success">false</boolProp>
+ <intProp name="Assertion.test_type">2</intProp>
+ <stringProp name="Scope.variable">SecureToken</stringProp>
+ </ResponseAssertion>
+ <hashTree/>
+ <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="BeanShell Assertion" enabled="true">
+ <stringProp name="BeanShellAssertion.query">//log.info(new String(ResponseData));
+org.apache.jmeter.assertions.AssertionResult[] assertionResults = SampleResult.getAssertionResults();
+ if ((assertionResults != null) && (assertionResults.length > 0))
+ {
+ for (int i = 0; i < assertionResults.length; i++)
+ {
+ if ((assertionResults[i].isFailure() || assertionResults[i].isError())
+ && assertionResults[i].getName().indexOf(vars.get("ImportanceAssertionHighlightString")) > -1)
+ {
+ Failure =true ;
+ FailureMessage=assertionResults[i].getFailureMessage();
+ vars.put("continue","false");
+ break;
+ }
+ }
+ break;
+ }
+</stringProp>
+ <stringProp name="BeanShellAssertion.filename"></stringProp>
+ <stringProp name="BeanShellAssertion.parameters"></stringProp>
+ <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp>
+ </BeanShellAssertion>
+ <hashTree/>
+ </hashTree>
+ <IfController guiclass="IfControllerPanel" testclass="IfController" testname="Control to run [Show login form (/portal/public/classic/)]" enabled="true">
+ <stringProp name="IfController.condition">"${continue}"=="true"</stringProp>
+ <boolProp name="IfController.evaluateAll">false</boolProp>
+ </IfController>
+ <hashTree>
+ <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="Show login form (/portal/public/classic/)" enabled="true">
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
+ <collectionProp name="Arguments.arguments">
+ <elementProp name="portal:componentId" elementType="HTTPArgument">
+ <boolProp name="HTTPArgument.always_encode">true</boolProp>
+ <stringProp name="Argument.name">portal:componentId</stringProp>
+ <stringProp name="Argument.value">UIPortal</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ <boolProp name="HTTPArgument.use_equals">true</boolProp>
+ </elementProp>
+ <elementProp name="portal:action" elementType="HTTPArgument">
+ <boolProp name="HTTPArgument.always_encode">true</boolProp>
+ <stringProp name="Argument.name">portal:action</stringProp>
+ <stringProp name="Argument.value">ShowLoginForm</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ <boolProp name="HTTPArgument.use_equals">true</boolProp>
+ </elementProp>
+ <elementProp name="ajaxRequest" elementType="HTTPArgument">
+ <boolProp name="HTTPArgument.always_encode">false</boolProp>
+ <stringProp name="Argument.name">ajaxRequest</stringProp>
+ <stringProp name="Argument.value">true</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ <boolProp name="HTTPArgument.use_equals">true</boolProp>
+ </elementProp>
+ </collectionProp>
+ </elementProp>
+ <stringProp name="HTTPSampler.domain"></stringProp>
+ <stringProp name="HTTPSampler.port"></stringProp>
+ <stringProp name="HTTPSampler.connect_timeout"></stringProp>
+ <stringProp name="HTTPSampler.response_timeout"></stringProp>
+ <stringProp name="HTTPSampler.protocol"></stringProp>
+ <stringProp name="HTTPSampler.contentEncoding">UTF-8</stringProp>
+ <stringProp name="HTTPSampler.path">/portal/public/classic/</stringProp>
+ <stringProp name="HTTPSampler.method">GET</stringProp>
+ <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+ <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+ <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+ <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
+ <boolProp name="HTTPSampler.monitor">false</boolProp>
+ <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
+ </HTTPSampler>
+ <hashTree>
+ <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
+ <collectionProp name="HeaderManager.headers">
+ <elementProp name="Content-Type" elementType="Header">
+ <stringProp name="Header.name">Content-Type</stringProp>
+ <stringProp name="Header.value">text/plain;charset=UTF-8</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Language" elementType="Header">
+ <stringProp name="Header.name">Accept-Language</stringProp>
+ <stringProp name="Header.value">en-us,en;q=0.5</stringProp>
+ </elementProp>
+ <elementProp name="Accept" elementType="Header">
+ <stringProp name="Header.name">Accept</stringProp>
+ <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp>
+ </elementProp>
+ <elementProp name="Keep-Alive" elementType="Header">
+ <stringProp name="Header.name">Keep-Alive</stringProp>
+ <stringProp name="Header.value">115</stringProp>
+ </elementProp>
+ <elementProp name="User-Agent" elementType="Header">
+ <stringProp name="Header.name">User-Agent</stringProp>
+ <stringProp name="Header.value">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10</stringProp>
+ </elementProp>
+ <elementProp name="Referer" elementType="Header">
+ <stringProp name="Header.name">Referer</stringProp>
+ <stringProp name="Header.value">http://mercury.testlab.exoplatform.vn:8080/portal/public/classic/</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Encoding" elementType="Header">
+ <stringProp name="Header.name">Accept-Encoding</stringProp>
+ <stringProp name="Header.value">gzip,deflate</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Charset" elementType="Header">
+ <stringProp name="Header.name">Accept-Charset</stringProp>
+ <stringProp name="Header.value">ISO-8859-1,utf-8;q=0.7,*;q=0.7</stringProp>
+ </elementProp>
+ </collectionProp>
+ </HeaderManager>
+ <hashTree/>
+ <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion - Menu${ImportanceAssertionHighlightString}" enabled="true">
+ <collectionProp name="Asserion.test_strings">
+ <stringProp name="513506942">\<td class="FieldLabel"\>User name\</td\></stringProp>
+ <stringProp name="-2024380253">\<td\>\<input class="UserName" name="username"/\>\</td\></stringProp>
+ <stringProp name="-1725023383">\<td class="FieldLabel"\>Password\</td\></stringProp>
+ <stringProp name="-1416240543">\<td\>\<input class="Password" type="password" name="password"/\>\</td\></stringProp>
+ </collectionProp>
+ <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
+ <boolProp name="Assertion.assume_success">false</boolProp>
+ <intProp name="Assertion.test_type">2</intProp>
+ <stringProp name="Scope.variable">SecureToken</stringProp>
+ </ResponseAssertion>
+ <hashTree/>
+ <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="BeanShell Assertion" enabled="true">
+ <stringProp name="BeanShellAssertion.query">//log.info(new String(ResponseData));
+org.apache.jmeter.assertions.AssertionResult[] assertionResults = SampleResult.getAssertionResults();
+ if ((assertionResults != null) && (assertionResults.length > 0))
+ {
+ for (int i = 0; i < assertionResults.length; i++)
+ {
+ if ((assertionResults[i].isFailure() || assertionResults[i].isError())
+ && assertionResults[i].getName().indexOf(vars.get("ImportanceAssertionHighlightString")) > -1)
+ {
+ Failure =true ;
+ FailureMessage=assertionResults[i].getFailureMessage();
+ vars.put("continue","false");
+ break;
+ }
+ }
+ break;
+ }
+</stringProp>
+ <stringProp name="BeanShellAssertion.filename"></stringProp>
+ <stringProp name="BeanShellAssertion.parameters"></stringProp>
+ <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp>
+ </BeanShellAssertion>
+ <hashTree/>
+ </hashTree>
+ </hashTree>
+ <IfController guiclass="IfControllerPanel" testclass="IfController" testname="Control to run [Type password and login (/portal/login)]" enabled="true">
+ <stringProp name="IfController.condition">"${continue}"=="true"</stringProp>
+ <boolProp name="IfController.evaluateAll">false</boolProp>
+ </IfController>
+ <hashTree>
+ <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="Type password and login (/portal/login)" enabled="true">
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
+ <collectionProp name="Arguments.arguments">
+ <elementProp name="initialURI" elementType="HTTPArgument">
+ <boolProp name="HTTPArgument.always_encode">false</boolProp>
+ <stringProp name="Argument.name">initialURI</stringProp>
+ <stringProp name="Argument.value">%2Fportal%2Fprivate%2Fclassic</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ <boolProp name="HTTPArgument.use_equals">true</boolProp>
+ </elementProp>
+ <elementProp name="username" elementType="HTTPArgument">
+ <boolProp name="HTTPArgument.always_encode">false</boolProp>
+ <stringProp name="Argument.name">username</stringProp>
+ <stringProp name="Argument.value">testuser${UserId}</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ <boolProp name="HTTPArgument.use_equals">true</boolProp>
+ </elementProp>
+ <elementProp name="password" elementType="HTTPArgument">
+ <boolProp name="HTTPArgument.always_encode">false</boolProp>
+ <stringProp name="Argument.name">password</stringProp>
+ <stringProp name="Argument.value">gtn</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ <boolProp name="HTTPArgument.use_equals">true</boolProp>
+ </elementProp>
+ </collectionProp>
+ </elementProp>
+ <stringProp name="HTTPSampler.domain"></stringProp>
+ <stringProp name="HTTPSampler.port"></stringProp>
+ <stringProp name="HTTPSampler.connect_timeout"></stringProp>
+ <stringProp name="HTTPSampler.response_timeout"></stringProp>
+ <stringProp name="HTTPSampler.protocol"></stringProp>
+ <stringProp name="HTTPSampler.contentEncoding"></stringProp>
+ <stringProp name="HTTPSampler.path">/portal/login</stringProp>
+ <stringProp name="HTTPSampler.method">POST</stringProp>
+ <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+ <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+ <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+ <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
+ <boolProp name="HTTPSampler.monitor">false</boolProp>
+ <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
+ </HTTPSampler>
+ <hashTree>
+ <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
+ <collectionProp name="HeaderManager.headers">
+ <elementProp name="Content-Type" elementType="Header">
+ <stringProp name="Header.name">Content-Type</stringProp>
+ <stringProp name="Header.value">application/x-www-form-urlencoded</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Language" elementType="Header">
+ <stringProp name="Header.name">Accept-Language</stringProp>
+ <stringProp name="Header.value">en-us,en;q=0.5</stringProp>
+ </elementProp>
+ <elementProp name="Accept" elementType="Header">
+ <stringProp name="Header.name">Accept</stringProp>
+ <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp>
+ </elementProp>
+ <elementProp name="Keep-Alive" elementType="Header">
+ <stringProp name="Header.name">Keep-Alive</stringProp>
+ <stringProp name="Header.value">115</stringProp>
+ </elementProp>
+ <elementProp name="User-Agent" elementType="Header">
+ <stringProp name="Header.name">User-Agent</stringProp>
+ <stringProp name="Header.value">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10</stringProp>
+ </elementProp>
+ <elementProp name="Referer" elementType="Header">
+ <stringProp name="Header.name">Referer</stringProp>
+ <stringProp name="Header.value">http://mercury.testlab.exoplatform.vn:8080/portal/public/classic/</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Encoding" elementType="Header">
+ <stringProp name="Header.name">Accept-Encoding</stringProp>
+ <stringProp name="Header.value">gzip,deflate</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Charset" elementType="Header">
+ <stringProp name="Header.name">Accept-Charset</stringProp>
+ <stringProp name="Header.value">ISO-8859-1,utf-8;q=0.7,*;q=0.7</stringProp>
+ </elementProp>
+ </collectionProp>
+ </HeaderManager>
+ <hashTree/>
+ <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion - Menu${ImportanceAssertionHighlightString}" enabled="true">
+ <collectionProp name="Asserion.test_strings">
+ <stringProp name="-476933776">\<a .*href=".*/home"\>Home\</a\></stringProp>
+ <stringProp name="-1248977646">\<a .*href=".*/sitemap"\>SiteMap\</a\></stringProp>
+ </collectionProp>
+ <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
+ <boolProp name="Assertion.assume_success">false</boolProp>
+ <intProp name="Assertion.test_type">2</intProp>
+ <stringProp name="Scope.variable">SecureToken</stringProp>
+ </ResponseAssertion>
+ <hashTree/>
+ <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion - User information${ImportanceAssertionHighlightString}" enabled="true">
+ <collectionProp name="Asserion.test_strings">
+ <stringProp name="-1926363754">\<a .*href=".*username=root.*password=gtn.*"\>Administrator\</a\></stringProp>
+ <stringProp name="-854512033">\<a .*href=".*username=john.*password=gtn.*"\>Manager\</a\></stringProp>
+ <stringProp name="1897349297">\<a .*href=".*username=mary.*password=gtn.*"\>User\</a\></stringProp>
+ <stringProp name="28321473">\<a .*href=".*username=demo.*password=gtn.*"\>Demo\</a\></stringProp>
+ </collectionProp>
+ <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
+ <boolProp name="Assertion.assume_success">false</boolProp>
+ <intProp name="Assertion.test_type">2</intProp>
+ <stringProp name="Scope.variable">SecureToken</stringProp>
+ </ResponseAssertion>
+ <hashTree/>
+ <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="BeanShell Assertion" enabled="true">
+ <stringProp name="BeanShellAssertion.query">///log.info(new String(ResponseData));
+org.apache.jmeter.assertions.AssertionResult[] assertionResults = SampleResult.getAssertionResults();
+ if ((assertionResults != null) && (assertionResults.length > 0))
+ {
+ for (int i = 0; i < assertionResults.length; i++)
+ {
+ if ((assertionResults[i].isFailure() || assertionResults[i].isError())
+ && assertionResults[i].getName().indexOf(vars.get("ImportanceAssertionHighlightString")) > -1)
+ {
+ Failure =true ;
+ FailureMessage=assertionResults[i].getFailureMessage();
+ vars.put("continue","false");
+ break;
+ }
+ }
+ break;
+ }
+</stringProp>
+ <stringProp name="BeanShellAssertion.filename"></stringProp>
+ <stringProp name="BeanShellAssertion.parameters"></stringProp>
+ <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp>
+ </BeanShellAssertion>
+ <hashTree/>
+ </hashTree>
+ </hashTree>
+ <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="Sign out (/portal/private/classic)" enabled="false">
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
+ <collectionProp name="Arguments.arguments">
+ <elementProp name="portal:componentId" elementType="HTTPArgument">
+ <boolProp name="HTTPArgument.always_encode">true</boolProp>
+ <stringProp name="Argument.name">portal:componentId</stringProp>
+ <stringProp name="Argument.value">UIPortal</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ <boolProp name="HTTPArgument.use_equals">true</boolProp>
+ </elementProp>
+ <elementProp name="portal:action" elementType="HTTPArgument">
+ <boolProp name="HTTPArgument.always_encode">true</boolProp>
+ <stringProp name="Argument.name">portal:action</stringProp>
+ <stringProp name="Argument.value">Logout</stringProp>
+ <stringProp name="Argument.metadata">=</stringProp>
+ <boolProp name="HTTPArgument.use_equals">true</boolProp>
+ </elementProp>
+ </collectionProp>
+ </elementProp>
+ <stringProp name="HTTPSampler.domain">mercury.testlab.exoplatform.vn</stringProp>
+ <stringProp name="HTTPSampler.port"></stringProp>
+ <stringProp name="HTTPSampler.connect_timeout"></stringProp>
+ <stringProp name="HTTPSampler.response_timeout"></stringProp>
+ <stringProp name="HTTPSampler.protocol"></stringProp>
+ <stringProp name="HTTPSampler.contentEncoding">UTF-8</stringProp>
+ <stringProp name="HTTPSampler.path">/portal/private/classic</stringProp>
+ <stringProp name="HTTPSampler.method">GET</stringProp>
+ <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+ <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+ <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+ <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
+ <boolProp name="HTTPSampler.monitor">false</boolProp>
+ <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
+ </HTTPSampler>
+ <hashTree>
+ <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
+ <collectionProp name="HeaderManager.headers">
+ <elementProp name="Accept-Language" elementType="Header">
+ <stringProp name="Header.name">Accept-Language</stringProp>
+ <stringProp name="Header.value">en-us,en;q=0.5</stringProp>
+ </elementProp>
+ <elementProp name="Accept" elementType="Header">
+ <stringProp name="Header.name">Accept</stringProp>
+ <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp>
+ </elementProp>
+ <elementProp name="Keep-Alive" elementType="Header">
+ <stringProp name="Header.name">Keep-Alive</stringProp>
+ <stringProp name="Header.value">115</stringProp>
+ </elementProp>
+ <elementProp name="User-Agent" elementType="Header">
+ <stringProp name="Header.name">User-Agent</stringProp>
+ <stringProp name="Header.value">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10</stringProp>
+ </elementProp>
+ <elementProp name="Referer" elementType="Header">
+ <stringProp name="Header.name">Referer</stringProp>
+ <stringProp name="Header.value">http://mercury.testlab.exoplatform.vn:8080/portal/private/classic</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Encoding" elementType="Header">
+ <stringProp name="Header.name">Accept-Encoding</stringProp>
+ <stringProp name="Header.value">gzip,deflate</stringProp>
+ </elementProp>
+ <elementProp name="Accept-Charset" elementType="Header">
+ <stringProp name="Header.name">Accept-Charset</stringProp>
+ <stringProp name="Header.value">ISO-8859-1,utf-8;q=0.7,*;q=0.7</stringProp>
+ </elementProp>
+ </collectionProp>
+ </HeaderManager>
+ <hashTree/>
+ </hashTree>
+ </hashTree>
+ <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree for Error" enabled="true">
+ <boolProp name="ResultCollector.error_logging">false</boolProp>
+ <objProp>
+ <name>saveConfig</name>
+ <value class="SampleSaveConfiguration">
+ <time>true</time>
+ <latency>true</latency>
+ <timestamp>true</timestamp>
+ <success>true</success>
+ <label>true</label>
+ <code>true</code>
+ <message>true</message>
+ <threadName>true</threadName>
+ <dataType>true</dataType>
+ <encoding>false</encoding>
+ <assertions>true</assertions>
+ <subresults>true</subresults>
+ <responseData>false</responseData>
+ <samplerData>false</samplerData>
+ <xml>true</xml>
+ <fieldNames>false</fieldNames>
+ <responseHeaders>false</responseHeaders>
+ <requestHeaders>false</requestHeaders>
+ <responseDataOnError>false</responseDataOnError>
+ <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
+ <assertionsResultsToSave>0</assertionsResultsToSave>
+ <bytes>true</bytes>
+ </value>
+ </objProp>
+ <stringProp name="filename"></stringProp>
+ </ResultCollector>
+ <hashTree/>
+ <ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report" enabled="true">
+ <boolProp name="ResultCollector.error_logging">false</boolProp>
+ <objProp>
+ <name>saveConfig</name>
+ <value class="SampleSaveConfiguration">
+ <time>true</time>
+ <latency>true</latency>
+ <timestamp>true</timestamp>
+ <success>true</success>
+ <label>true</label>
+ <code>true</code>
+ <message>true</message>
+ <threadName>true</threadName>
+ <dataType>true</dataType>
+ <encoding>true</encoding>
+ <assertions>true</assertions>
+ <subresults>true</subresults>
+ <responseData>true</responseData>
+ <samplerData>true</samplerData>
+ <xml>true</xml>
+ <fieldNames>true</fieldNames>
+ <responseHeaders>true</responseHeaders>
+ <requestHeaders>true</requestHeaders>
+ <responseDataOnError>false</responseDataOnError>
+ <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
+ <assertionsResultsToSave>0</assertionsResultsToSave>
+ <bytes>true</bytes>
+ <url>true</url>
+ <fileName>true</fileName>
+ <hostname>true</hostname>
+ <threadCounts>true</threadCounts>
+ <sampleCount>true</sampleCount>
+ <idleTime>true</idleTime>
+ </value>
+ </objProp>
+ <stringProp name="filename"></stringProp>
+ <boolProp name="useGroupName">true</boolProp>
+ <stringProp name="TestPlan.comments"> </stringProp>
+ </ResultCollector>
+ <hashTree/>
+ <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
+ <stringProp name="HTTPSampler.domain">${Server}</stringProp>
+ <stringProp name="HTTPSampler.port">${Port}</stringProp>
+ <stringProp name="HTTPSampler.connect_timeout"></stringProp>
+ <stringProp name="HTTPSampler.response_timeout"></stringProp>
+ <stringProp name="HTTPSampler.protocol">http</stringProp>
+ <stringProp name="HTTPSampler.contentEncoding"></stringProp>
+ <stringProp name="HTTPSampler.path"></stringProp>
+ </ConfigTestElement>
+ <hashTree/>
+ <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Iteration Counter" enabled="true">
+ <stringProp name="CounterConfig.start">1</stringProp>
+ <stringProp name="CounterConfig.end"></stringProp>
+ <stringProp name="CounterConfig.incr">1</stringProp>
+ <stringProp name="CounterConfig.name">IterationCounter</stringProp>
+ <stringProp name="CounterConfig.format"></stringProp>
+ <boolProp name="CounterConfig.per_user">true</boolProp>
+ </CounterConfig>
+ <hashTree/>
+ <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true">
+ <stringProp name="CounterConfig.start">${__P(expCountStart,${__time(MMddHHmmss,CurrentDateTime)})}</stringProp>
+ <stringProp name="CounterConfig.end">9999999999</stringProp>
+ <stringProp name="CounterConfig.incr">5</stringProp>
+ <stringProp name="CounterConfig.name">UNIQUENUMBER</stringProp>
+ <stringProp name="CounterConfig.format"></stringProp>
+ <boolProp name="CounterConfig.per_user">false</boolProp>
+ <stringProp name="TestPlan.comments">Default value is current datetime</stringProp>
+ </CounterConfig>
+ <hashTree/>
+ <CacheManager guiclass="CacheManagerGui" testclass="CacheManager" testname="HTTP Cache Manager" enabled="true">
+ <boolProp name="clearEachIteration">true</boolProp>
+ <boolProp name="useExpires">false</boolProp>
+ </CacheManager>
+ <hashTree/>
+ <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">
+ <collectionProp name="CookieManager.cookies"/>
+ <boolProp name="CookieManager.clearEachIteration">true</boolProp>
+ <stringProp name="CookieManager.policy">rfc2109</stringProp>
+ </CookieManager>
+ <hashTree/>
+ <RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" testname="Random User Id" enabled="true">
+ <stringProp name="maximumValue">100</stringProp>
+ <stringProp name="minimumValue">1</stringProp>
+ <stringProp name="outputFormat"></stringProp>
+ <boolProp name="perThread">false</boolProp>
+ <stringProp name="randomSeed"></stringProp>
+ <stringProp name="variableName">UserId</stringProp>
+ </RandomVariableConfig>
+ <hashTree/>
+ </hashTree>
+ </hashTree>
+</jmeterTestPlan>
14 years, 8 months
gatein SVN: r5731 - in portal/branches/branch-GTNPORTAL-1745/component/resources: src/main/java/org/exoplatform/services/resources/impl and 1 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-01-12 02:12:46 -0500 (Wed, 12 Jan 2011)
New Revision: 5731
Modified:
portal/branches/branch-GTNPORTAL-1745/component/resources/pom.xml
portal/branches/branch-GTNPORTAL-1745/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
portal/branches/branch-GTNPORTAL-1745/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
Log:
GTNPORTAL-1741: Prevent to load concurrently several time the same ResourceBundle
Modified: portal/branches/branch-GTNPORTAL-1745/component/resources/pom.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1745/component/resources/pom.xml 2011-01-11 11:13:21 UTC (rev 5730)
+++ portal/branches/branch-GTNPORTAL-1745/component/resources/pom.xml 2011-01-12 07:12:46 UTC (rev 5731)
@@ -49,6 +49,10 @@
</dependency>
<dependency>
<groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.component.test.core</artifactId>
<scope>test</scope>
</dependency>
Modified: portal/branches/branch-GTNPORTAL-1745/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1745/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2011-01-11 11:13:21 UTC (rev 5730)
+++ portal/branches/branch-GTNPORTAL-1745/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2011-01-12 07:12:46 UTC (rev 5731)
@@ -19,6 +19,9 @@
package org.exoplatform.services.resources.impl;
+import org.exoplatform.commons.cache.future.FutureCache;
+import org.exoplatform.commons.cache.future.FutureExoCache;
+import org.exoplatform.commons.cache.future.Loader;
import org.exoplatform.commons.utils.IOUtil;
import org.exoplatform.commons.utils.MapResourceBundle;
import org.exoplatform.commons.utils.PageList;
@@ -64,6 +67,19 @@
protected ExoCache<String, ResourceBundle> cache_;
+ private volatile FutureCache<String, ResourceBundle, ResourceBundleContext> futureCache_;
+
+ private final Loader<String, ResourceBundle, ResourceBundleContext> loader_ = new Loader<String, ResourceBundle, ResourceBundleContext>()
+ {
+ /**
+ * {@inheritDoc}
+ */
+ public ResourceBundle retrieve(ResourceBundleContext context, String key) throws Exception
+ {
+ return context.get(key);
+ }
+ };
+
private volatile List<String> initResources_;
@SuppressWarnings("unchecked")
@@ -300,7 +316,7 @@
candidateFiles.add(baseName + "_" + language + "_" + country + ".properties");
}
- if (language != null && language.length() > 0 )
+ if (language != null && language.length() > 0)
{
candidateFiles.add(baseName + "_" + language + ".properties");
}
@@ -395,56 +411,35 @@
boolean isClasspathResource = isClasspathResource(name);
boolean isCacheable = !isClasspathResource || !PropertyManager.isDevelopping();
- if (isCacheable)
+ if (isCacheable && isClasspathResource)
{
- if (isClasspathResource)
- {
- // Avoid naming collision
- id += "_" + cl.getClass() + "_" + cl.hashCode();
- }
- try
- {
- ResourceBundle rb = cache_.get(id);
- if (rb != null)
- {
- return rb;
- }
- }
- catch (Exception ex)
- {
- }
+ // Avoid naming collision
+ id += "_" + cl.getClass() + "_" + System.identityHashCode(cl);
}
// Case 1: ResourceBundle of portlets, standard java API is used
if (isClasspathResource)
{
- ResourceBundle res = ResourceBundleLoader.load(name, locale, cl);
- //Cache classpath resource bundle while running portal in non-dev mode
+ // Cache classpath resource bundle while running portal in non-dev mode
if (isCacheable)
- cache_.put(id, res);
- return res;
+ {
+ ResourceBundleLoaderContext ctx = new ResourceBundleLoaderContext(name, locale, cl);
+ ResourceBundle result = getFutureCache().get(ctx, id);
+ if (ctx.e != null)
+ {
+ // Throw the RuntimeException if it occurs to remain compatible with the old behavior
+ throw ctx.e;
+ }
+ return result;
+ }
+ else
+ {
+ return ResourceBundleLoader.load(name, locale, cl);
+ }
}
// Case 2: ResourceBundle of portal
- try
- {
- ResourceBundle res = null;
- String rootId = name + "_" + localeService_.getDefaultLocaleConfig().getLanguage();
- ResourceBundle parent = getResourceBundleFromDb(rootId, null, locale);
- if (parent != null)
- {
- res = getResourceBundleFromDb(id, parent, locale);
- if (res == null)
- res = parent;
- cache_.put(id, res);
- return res;
- }
- }
- catch (Exception ex)
- {
- log_.error("Error: " + id, ex);
- }
- return null;
+ return getFutureCache().get(new GetResourceBundleFromDbContext(name, locale), id);
}
public ResourceBundle getResourceBundle(String[] name, Locale locale, ClassLoader cl)
@@ -458,34 +453,165 @@
idBuf.append(n).append("_");
idBuf.append(locale);
String id = idBuf.toString();
- try
+ return getFutureCache().get(new GetResourceBundleContext(name, locale, cl), id);
+ }
+
+ protected FutureCache<String, ResourceBundle, ResourceBundleContext> getFutureCache()
+ {
+ if (futureCache_ == null)
{
- ResourceBundle res = cache_.get(id);
- if (res != null)
- return res;
- MapResourceBundle outputBundled = new MapResourceBundle(locale);
- for (int i = 0; i < name.length; i++)
+ synchronized(this)
{
- ResourceBundle temp = getResourceBundle(name[i], locale, cl);
- if (temp != null)
+ if (futureCache_ == null)
{
- outputBundled.merge(temp);
- continue;
+ futureCache_ = new FutureExoCache<String, ResourceBundle, ResourceBundleContext>(loader_, cache_);
}
- log_.warn("Cannot load and merge the bundle: " + name[i]);
}
- outputBundled.resolveDependencies();
- cache_.put(id, outputBundled);
- return outputBundled;
}
- catch (Exception ex)
+ return futureCache_;
+ }
+
+ abstract protected ResourceBundle getResourceBundleFromDb(String id, ResourceBundle parent, Locale locale)
+ throws Exception;
+
+ /**
+ * Generic class defining a context needed to get a ResourceBundle
+ */
+ private static abstract class ResourceBundleContext
+ {
+ /**
+ * Get the resource bundle corresponding to the context
+ */
+ abstract ResourceBundle get(String id);
+ }
+
+ /**
+ * The class defining the context required to load a ResourceBundle thanks to the method
+ * <code>ResourceBundleLoader.load(String name, Locale locale, ClassLoader cl)</code>
+ */
+ private static class ResourceBundleLoaderContext extends ResourceBundleContext
+ {
+ private final String name;
+
+ private final Locale locale;
+
+ private final ClassLoader cl;
+
+ private RuntimeException e;
+
+ public ResourceBundleLoaderContext(String name, Locale locale, ClassLoader cl)
{
- log_.error("Cannot load and merge the bundle: " + id, ex);
+ this.name = name;
+ this.locale = locale;
+ this.cl = cl;
}
- return null;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ ResourceBundle get(String id)
+ {
+ try
+ {
+ return ResourceBundleLoader.load(name, locale, cl);
+ }
+ catch (RuntimeException e)
+ {
+ this.e = e;
+ }
+ return null;
+ }
}
- abstract protected ResourceBundle getResourceBundleFromDb(String id, ResourceBundle parent, Locale locale)
- throws Exception;
+ /**
+ * The class defining the context required to load a ResourceBundle thanks to the method
+ * <code>getResourceBundleFromDb(String id, ResourceBundle parent, Locale locale)</code>
+ */
+ private class GetResourceBundleFromDbContext extends ResourceBundleContext
+ {
+ private final String name;
-}
+ private final Locale locale;
+
+ public GetResourceBundleFromDbContext(String name, Locale locale)
+ {
+ this.name = name;
+ this.locale = locale;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ ResourceBundle get(String id)
+ {
+ ResourceBundle res = null;
+ try
+ {
+ String rootId = name + "_" + localeService_.getDefaultLocaleConfig().getLanguage();
+ ResourceBundle parent = getResourceBundleFromDb(rootId, null, locale);
+ if (parent != null)
+ {
+ res = getResourceBundleFromDb(id, parent, locale);
+ if (res == null)
+ res = parent;
+ }
+ }
+ catch (Exception ex)
+ {
+ log_.error("Error: " + id, ex);
+ }
+ return res;
+ }
+ }
+
+ /**
+ * The class defining the context required to load a ResourceBundle thanks to the method
+ * <code>getResourceBundle(String[] name, Locale locale, ClassLoader cl)</code>
+ */
+ private class GetResourceBundleContext extends ResourceBundleContext
+ {
+ private final String[] name;
+
+ private final Locale locale;
+
+ private final ClassLoader cl;
+
+ public GetResourceBundleContext(String[] name, Locale locale, ClassLoader cl)
+ {
+ this.name = name;
+ this.locale = locale;
+ this.cl = cl;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ ResourceBundle get(String id)
+ {
+ MapResourceBundle outputBundled = null;
+ try
+ {
+ outputBundled = new MapResourceBundle(locale);
+ for (int i = 0; i < name.length; i++)
+ {
+ ResourceBundle temp = getResourceBundle(name[i], locale, cl);
+ if (temp != null)
+ {
+ outputBundled.merge(temp);
+ continue;
+ }
+ log_.warn("Cannot load and merge the bundle: " + name[i]);
+ }
+ outputBundled.resolveDependencies();
+ }
+ catch (Exception ex)
+ {
+ log_.error("Cannot load and merge the bundle: " + id, ex);
+ }
+ return outputBundled;
+ }
+ }
+}
\ No newline at end of file
Modified: portal/branches/branch-GTNPORTAL-1745/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1745/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2011-01-11 11:13:21 UTC (rev 5730)
+++ portal/branches/branch-GTNPORTAL-1745/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2011-01-12 07:12:46 UTC (rev 5731)
@@ -211,5 +211,11 @@
{
return "MyClassLoader";
}
+
+ @Override
+ public int hashCode()
+ {
+ return 0;
+ }
}
}
14 years, 8 months
gatein SVN: r5730 - exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2011-01-11 06:13:21 -0500 (Tue, 11 Jan 2011)
New Revision: 5730
Modified:
exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
EXOGTN-199 Fix problem with MOPSessionManager cache configuration
Modified: exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
--- exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-01-11 11:02:12 UTC (rev 5729)
+++ exo/portal/branches/3.1.x/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-01-11 11:13:21 UTC (rev 5730)
@@ -311,8 +311,11 @@
<string>MOPSessionManager</string>
</field>
<field name="expirationTimeout">
- <long>600</long>
+ <long>600000</long>
</field>
+ <field name="maxNodes">
+ <int>5000</int>
+ </field>
<field name="distributed">
<boolean>true</boolean>
</field>
14 years, 8 months
gatein SVN: r5729 - in portal/branches/branch-GTNPORTAL-1745: web/portal/src/main/webapp/groovy/portal/webui/application and 1 other directories.
by do-not-reply@jboss.org
Author: kien_nguyen
Date: 2011-01-11 06:02:12 -0500 (Tue, 11 Jan 2011)
New Revision: 5729
Modified:
portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl
portal/branches/branch-GTNPORTAL-1745/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
GTNPORTAL-1751 Dashboard shouldnt hide the gadget removed from Application Registry
Modified: portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-01-11 10:48:36 UTC (rev 5728)
+++ portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-01-11 11:02:12 UTC (rev 5729)
@@ -1407,6 +1407,7 @@
UIGadget.tooltip.Unmaximize=Restore Down
UIGadget.tooltip.editGadget=Edit Gadget
UIGadget.tooltip.deleteGadget=Delete Gadget
+UIGadget.message.isLossData=This gadget may be deleted from database or there is database error that prevent to read content of gadget
UIListPermissionSelectorPopup.title.ListPermissionSelector=Select Permission
Modified: portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
===================================================================
--- portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2011-01-11 10:48:36 UTC (rev 5728)
+++ portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2011-01-11 11:02:12 UTC (rev 5729)
@@ -1342,6 +1342,7 @@
UIGadget.tooltip.Unmaximize=Thu nhỏ cửa sổ
UIGadget.tooltip.editGadget=Sửa Gadget
UIGadget.tooltip.deleteGadget=Xóa Gadget
+UIGadget.message.isLossData=Gadget này có thể đã bị xóa khỏi cơ sở dữ liệu hoặc việc đọc gadget từ cơ sở dữ liệu xảy ra lỗi
UIListPermissionSelectorPopup.title.ListPermissionSelector=Lựa chọn quyền
UIUserToolBarDashboard.page.ClickAndType=Nhấp chuột và điền tên trang
Modified: portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl 2011-01-11 10:48:36 UTC (rev 5728)
+++ portal/branches/branch-GTNPORTAL-1745/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl 2011-01-11 11:02:12 UTC (rev 5729)
@@ -2,25 +2,32 @@
import org.exoplatform.web.application.JavascriptManager;
import org.exoplatform.portal.webui.application.GadgetUtil;
- def rcontext = _ctx.getRequestContext();
- JavascriptManager jsmanager = rcontext.getJavascriptManager();
- def hostName = GadgetUtil.getRelGadgetServerUrl();
- def url = uicomponent.getUrl();
- def metadata = uicomponent.getMetadata();
- def posX = uicomponent.getProperties().getIntValue("locationX") + "px";
- def posY = uicomponent.getProperties().getIntValue("locationY") + "px";
- def zIndex = uicomponent.getProperties().getIntValue("zIndex");
- def id = uicomponent.getId();
- def isDev = uicomponent.isGadgetDeveloper();
- def noCache = uicomponent.isNoCache();
- def isDebug = uicomponent.isDebug();
- def view = uicomponent.getView();
- def userPref = uicomponent.getUserPref();
- jsmanager.importJavascript("eXo.gadget.UIGadget");
- rcontext.getJavascriptManager().addCustomizedOnLoadScript("eXo.gadget.UIGadget.confirmDeleteGadget = '" + _ctx.appRes("UIGadgetContainerManagement.confirm.DeleteGadget") + "';");
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.createGadget('$url','content-$id', $metadata, $userPref, '$view', '$hostName', " + (isDev ? 1 : 0)
- + ", " + (isDebug ? 1 : 0) + ", " + (noCache ? 1 : 0) + ");");
-
+ def rcontext = _ctx.getRequestContext();
+ JavascriptManager jsmanager = rcontext.getJavascriptManager();
+ def hostName = GadgetUtil.getRelGadgetServerUrl();
+ def url = null;
+ def metadata = "";
+ def posX = uicomponent.getProperties().getIntValue("locationX") + "px";
+ def posY = uicomponent.getProperties().getIntValue("locationY") + "px";
+ def zIndex = uicomponent.getProperties().getIntValue("zIndex");
+ def id = uicomponent.getId() != null ? uicomponent.getId() : "UIGadget";
+ def isDev = uicomponent.isGadgetDeveloper();
+ def noCache = uicomponent.isNoCache();
+ def isDebug = uicomponent.isDebug();
+ def view = uicomponent.getView();
+ def userPref = null;
+
+ def isLossData = uicomponent.isLossData();
+ if(!isLossData) {
+ url = uicomponent.getUrl();
+ metadata = uicomponent.getMetadata();
+ userPref = uicomponent.getUserPref();
+ jsmanager.importJavascript("eXo.gadget.UIGadget");
+ rcontext.getJavascriptManager().addCustomizedOnLoadScript("eXo.gadget.UIGadget.confirmDeleteGadget = '" + _ctx.appRes("UIGadgetContainerManagement.confirm.DeleteGadget") + "';");
+ jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.createGadget('$url','content-$id', $metadata, $userPref, '$view', '$hostName', " + (isDev ? 1 : 0)
+ + ", " + (isDebug ? 1 : 0) + ", " + (noCache ? 1 : 0) + ");");
+ }
+
boolean isMini = Boolean.parseBoolean(uicomponent.getProperties().get("minimized"));
String miniTitle = _ctx.appRes("UIGadget.tooltip.Minimize");
String unminiTitle = _ctx.appRes("UIGadget.tooltip.Unminimize");
@@ -43,7 +50,7 @@
<div class="EditGadget IconControl" onclick="eXo.gadget.UIGadget.editGadget('$id')" onmousedown="event.cancelBubble=true;" title="<%=_ctx.appRes("UIGadget.tooltip.editGadget")%>"><span></span></div>
<% } %>
<div class="GadgetDragHandleArea"><span></span></div>
- <div class="GadgetTitle" style="display: none; float: none; width: auto; margin-right: 75px"><%= uicomponent.getApplicationName() %></div>
+ <div class="GadgetTitle" style="display: <%=isLossData ? "block" : "none"; %> ; float: none; width: auto; margin-right: 75px"><%= uicomponent.getApplicationName() %></div>
</div>
</div>
</div>
@@ -57,8 +64,12 @@
</div>
<div class="MLGadget">
<div class="MRGadget">
- <div id="content-$id" class="MCGadget"></div>
- </div>
+ <% if(isLossData) {%>
+ <div id="content-$id" class="MCGadget"><%=_ctx.appRes("UIGadget.message.isLossData")%></div>
+ <% } else {%>
+ <div id="content-$id" class="MCGadget"></div>
+ <% } %>
+ </div>
</div>
<div class="BLGadget">
<div class="BRGadget">
Modified: portal/branches/branch-GTNPORTAL-1745/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1745/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2011-01-11 10:48:36 UTC (rev 5728)
+++ portal/branches/branch-GTNPORTAL-1745/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2011-01-11 11:02:12 UTC (rev 5729)
@@ -260,25 +260,6 @@
}
}
- @Override
- public boolean isRendered()
- {
- try
- {
- DataStorage service = getApplicationComponent(DataStorage.class);
- service.load(state, ApplicationType.GADGET);
- if (getApplication() == null)
- {
- throw new Exception();
- }
- }
- catch (Exception e)
- {
- return false;
- }
- return super.isRendered();
- }
-
public boolean isLossData()
{
try
14 years, 8 months
gatein SVN: r5728 - portal/branches/branch-GTNPORTAL-1745/webui/framework/src/main/java/org/exoplatform/webui/config.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-01-11 05:48:36 -0500 (Tue, 11 Jan 2011)
New Revision: 5728
Modified:
portal/branches/branch-GTNPORTAL-1745/webui/framework/src/main/java/org/exoplatform/webui/config/Param.java
Log:
GTNPORTAL-1742: Prevent to load concurrently the same webui parameter
Modified: portal/branches/branch-GTNPORTAL-1745/webui/framework/src/main/java/org/exoplatform/webui/config/Param.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1745/webui/framework/src/main/java/org/exoplatform/webui/config/Param.java 2011-01-11 09:56:11 UTC (rev 5727)
+++ portal/branches/branch-GTNPORTAL-1745/webui/framework/src/main/java/org/exoplatform/webui/config/Param.java 2011-01-11 10:48:36 UTC (rev 5728)
@@ -64,36 +64,41 @@
public Object getMapXMLObject(WebuiRequestContext context) throws Exception
{
- if (object != null)
- return object;
- ResourceResolver resolver = context.getResourceResolver(value);
- InputStream is = resolver.getInputStream(value);
- object = XMLObject.getObject(is);
- is.close();
+ if(object == null)
+ {
+ synchronized (this)
+ {
+ if(object == null)
+ {
+ ResourceResolver resolver = context.getResourceResolver(value);
+ InputStream is = resolver.getInputStream(value);
+ object = XMLObject.getObject(is);
+ is.close();
+ }
+ }
+ }
return object;
}
@SuppressWarnings("unchecked")
public Object getMapGroovyObject(WebuiRequestContext context) throws Exception
{
- try
+ if(object == null)
{
- if (object != null)
- return object;
- ResourceResolver resolver = context.getResourceResolver(value);
- InputStream is = resolver.getInputStream(value);
- //TODO if is == null throw an exception saying the it's impossible to find the file
- Binding binding = new Binding();
- GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader(), binding);
- object = shell.evaluate(is);
- is.close();
- return object;
+ synchronized (this)
+ {
+ if(object == null)
+ {
+ ResourceResolver resolver = context.getResourceResolver(value);
+ InputStream is = resolver.getInputStream(value);
+ Binding binding = new Binding();
+ GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader(), binding);
+ object = shell.evaluate(is);
+ is.close();
+ }
+ }
}
- catch (Exception e)
- {
- log.error("A problem in the groovy script : " + value, e);
- throw e;
- }
+ return object;
}
public Object getFreshObject(WebuiRequestContext context) throws Exception
14 years, 8 months
gatein SVN: r5727 - exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-01-11 04:56:11 -0500 (Tue, 11 Jan 2011)
New Revision: 5727
Modified:
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalNavigation.js
Log:
EXOGTN-233 Can't select page from menu bar when there're many page
Modified: exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalNavigation.js
===================================================================
--- exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalNavigation.js 2011-01-11 09:48:07 UTC (rev 5726)
+++ exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalNavigation.js 2011-01-11 09:56:11 UTC (rev 5727)
@@ -158,7 +158,8 @@
eXo.portal.UIPortalNavigation.toggleSubMenu(e, tab, menuItemContainer) ;
}
}
- eXo.portal.UIPortalNavigation.menuVisible = true ;
+ eXo.portal.UIPortalNavigation.cancelHideMenuContainer() ;
+ eXo.portal.UIPortalNavigation.menuVisible = true ;
} ;
UIPortalNavigation.prototype.setTabStyleOnMouseOut = function(e, src) {
@@ -327,7 +328,6 @@
subContainer.firstTime = true;
}
}
- eXo.portal.UIPortalNavigation.cancelHideMenuContainer() ;
};
/**
* Shows a sub menu, uses the methods from superClass (eXo.webui.UIPopupMenu)
14 years, 8 months