gatein SVN: r1302 - in portal/trunk/webui/core/src: main/java/org/exoplatform/webui/application/replication/serial and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-14 14:52:25 -0500 (Thu, 14 Jan 2010)
New Revision: 1302
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A1.java
Log:
make factory initialize state
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java 2010-01-14 19:39:39 UTC (rev 1301)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java 2010-01-14 19:52:25 UTC (rev 1302)
@@ -19,17 +19,31 @@
package org.exoplatform.webui.application.replication.factory;
+import org.exoplatform.webui.application.replication.model.FieldModel;
+
+import java.util.Map;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
public final class DefaultObjectFactory extends ObjectFactory<Object>
{
- public <O> O create(Class<O> type) throws CreateException
+ @Override
+ public <S> S create(Class<S> type, Map<FieldModel, ?> state) throws CreateException
{
try
{
- return type.newInstance();
+ S instance = type.newInstance();
+
+ //
+ for (Map.Entry<FieldModel, ?> entry : state.entrySet())
+ {
+ entry.getKey().setValue(instance, entry.getValue());
+ }
+
+ //
+ return instance;
}
catch (Exception e)
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java 2010-01-14 19:39:39 UTC (rev 1301)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java 2010-01-14 19:52:25 UTC (rev 1302)
@@ -19,6 +19,10 @@
package org.exoplatform.webui.application.replication.factory;
+import org.exoplatform.webui.application.replication.model.FieldModel;
+
+import java.util.Map;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -31,10 +35,11 @@
* Instantiate an object based on the provided class.
*
* @param type the type
+ * @param state the state
* @param <S> the sub type of the base type
* @return the S instance
* @throws CreateException anything wrong that could happen during instance creation
*/
- public abstract <S extends B> S create(Class<S> type) throws CreateException;
+ public abstract <S extends B> S create(Class<S> type, Map<FieldModel, ?> state) throws CreateException;
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java 2010-01-14 19:39:39 UTC (rev 1301)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java 2010-01-14 19:52:25 UTC (rev 1302)
@@ -57,14 +57,14 @@
this.idToResolutions = new HashMap<Integer, List<Resolution>>();
}
- private <O> O instantiate(ClassTypeModel<O> typeModel) throws InvalidClassException
+ private <O> O instantiate(ClassTypeModel<O> typeModel, Map<FieldModel, ?> state) throws InvalidClassException
{
try
{
ObjectFactory<? super O> factory = context.getFactory(typeModel.getObjectType());
//
- return factory.create(typeModel.getObjectType());
+ return factory.create(typeModel.getObjectType(), state);
}
catch (Exception e)
{
@@ -100,13 +100,9 @@
ClassTypeModel<?> typeModel = (ClassTypeModel)context.getTypeDomain().getTypeModel(clazz);
//
- Object instance = instantiate(typeModel);
-
- //
- idToObject.put(id, instance);
-
- //
+ Map<FieldModel, Object> state = new HashMap<FieldModel, Object>();
ClassTypeModel<?> currentTypeModel = typeModel;
+ List<Bilto> biltos = new ArrayList<Bilto>();
while (true)
{
for (FieldModel fieldModel : (currentTypeModel).getFields())
@@ -114,29 +110,23 @@
switch (container.readInt())
{
case DataKind.NULL_VALUE:
- fieldModel.setValue(instance, null);
+ state.put(fieldModel, null);
break;
case DataKind.OBJECT_REF:
int refId = container.readInt();
Object refO = idToObject.get(refId);
if (refO != null)
{
- fieldModel.setValue(instance, refO);
+ state.put(fieldModel, refO);
}
else
{
- List<Resolution> resolutions = idToResolutions.get(refId);
- if (resolutions == null)
- {
- resolutions = new ArrayList<Resolution>();
- idToResolutions.put(refId, resolutions);
- }
- resolutions.add(new Resolution(instance, fieldModel));
+ biltos.add(new Bilto(refId, fieldModel));
}
break;
case DataKind.OBJECT:
Object o = container.readObject();
- fieldModel.setValue(instance, o);
+ state.put(fieldModel, o);
break;
}
@@ -157,6 +147,24 @@
}
//
+ Object instance = instantiate(typeModel, state);
+
+ //
+ for (Bilto bilto : biltos)
+ {
+ List<Resolution> resolutions = idToResolutions.get(bilto.ref);
+ if (resolutions == null)
+ {
+ resolutions = new ArrayList<Resolution>();
+ idToResolutions.put(bilto.ref, resolutions);
+ }
+ resolutions.add(new Resolution(instance, bilto.fieldModel));
+ }
+
+ //
+ idToObject.put(id, instance);
+
+ //
List<Resolution> resolutions = idToResolutions.remove(id);
if (resolutions != null)
{
@@ -178,6 +186,21 @@
}
}
+ private static class Bilto
+ {
+ /** . */
+ private final int ref;
+
+ /** . */
+ private final FieldModel fieldModel;
+
+ private Bilto(int ref, FieldModel fieldModel)
+ {
+ this.ref = ref;
+ this.fieldModel = fieldModel;
+ }
+ }
+
private static class Resolution
{
/** . */
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A1.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A1.java 2010-01-14 19:39:39 UTC (rev 1301)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A1.java 2010-01-14 19:52:25 UTC (rev 1302)
@@ -21,7 +21,10 @@
import org.exoplatform.webui.application.replication.factory.ObjectFactory;
import org.exoplatform.webui.application.replication.factory.CreateException;
+import org.exoplatform.webui.application.replication.model.FieldModel;
+import java.util.Map;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -32,7 +35,7 @@
static A2 instance = new A2();
@Override
- public <E extends A2> E create(Class<E> type) throws CreateException
+ public <S extends A2> S create(Class<S> type, Map<FieldModel, ?> state) throws CreateException
{
if (type == A2.class)
{
14 years, 11 months
gatein SVN: r1301 - in portal/trunk: component/identity/src/main/java/org/exoplatform/services/organization/idm and 5 other directories.
by do-not-reply@jboss.org
Author: bdaw
Date: 2010-01-14 14:39:39 -0500 (Thu, 14 Jan 2010)
New Revision: 1301
Added:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/Config.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/ExtGroup.java
Removed:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/default-ldap.ldif
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObjectRelationshipName.hbm.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationshipName.hbm.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-ldap-config.xml
Log:
- PicketLink IDM integration improvements
Added: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/Config.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/Config.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/Config.java 2010-01-14 19:39:39 UTC (rev 1301)
@@ -0,0 +1,230 @@
+package org.exoplatform.services.organization.idm;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/*
+* 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.
+*/
+public class Config
+{
+
+ private Map<String, String> groupTypeMappings = new HashMap<String, String>();
+
+ private boolean useParentIdAsGroupType = false;
+
+ private boolean passwordAsAttribute = false;
+
+ private String defaultGroupType = "GTN_GROUP_TYPE";
+
+ private String rootGroupName = "GTN_ROOT_GROUP";
+
+ private String pathSeparator = ".";
+
+ private boolean forceMembershipOfMappedTypes = false;
+
+ public Config()
+ {
+ }
+
+
+ public String getGroupType(String parentId)
+ {
+
+
+ if (parentId == null || parentId.length() == 0)
+ {
+ parentId = "/";
+ }
+
+
+
+ if (!useParentIdAsGroupType)
+ {
+ String type =_getGroupType(parentId, true, true, true);
+ if (type != null)
+ {
+ return type;
+ }
+ return getDefaultGroupType();
+ }
+
+
+ // Search for exact match in mappings
+ String type = _getGroupType(parentId, false, true, true);
+
+ // If not then check for inherited type
+ if (type == null)
+ {
+ type = _getGroupType(parentId, true, false, true);
+ }
+
+ // If not then prepare type from this id
+ if (type == null)
+ {
+ type = convertType(parentId);
+ }
+
+ return type;
+
+ }
+
+ private String _getGroupType(String parentId, boolean checkParents, boolean matchExact, boolean matchInherited)
+ {
+
+
+ if (matchExact && getGroupTypeMappings().keySet().contains(parentId))
+ {
+ return getGroupTypeMappings().get(parentId);
+ }
+
+ String id = !parentId.equals("/") ? parentId + "/*" : "/*";
+
+ if (matchInherited && getGroupTypeMappings().keySet().contains(id))
+ {
+ return getGroupTypeMappings().get(id);
+ }
+
+
+ if (checkParents && !parentId.equals("/") && parentId.contains("/"))
+ {
+ String newParentId = parentId.substring(0, parentId.lastIndexOf("/"));
+ return getGroupType(newParentId);
+ }
+
+ return null;
+ }
+
+ public String getParentId(String type)
+ {
+ for (Map.Entry<String, String> entry : groupTypeMappings.entrySet())
+ {
+ if (entry.getValue().equals(type))
+ {
+ return entry.getKey();
+ }
+ }
+
+ return null;
+ }
+
+ Set<String> getTypes(String id)
+ {
+ HashSet<String> types = new HashSet<String>();
+
+ for (String key : groupTypeMappings.keySet())
+ {
+ if (key.startsWith("id"))
+ {
+ types.add(groupTypeMappings.get(key));
+ }
+ }
+
+ return types;
+ }
+
+ Set<String> getAllTypes()
+ {
+ HashSet<String> types = new HashSet<String>(groupTypeMappings.values());
+
+ return types;
+
+ }
+
+ private String convertType(String type)
+ {
+
+ return type.replaceAll("/", pathSeparator);
+ }
+
+
+ public boolean isUseParentIdAsGroupType()
+ {
+ return useParentIdAsGroupType;
+ }
+
+ public void setUseParentIdAsGroupType(boolean useParentIdAsGroupType)
+ {
+ this.useParentIdAsGroupType = useParentIdAsGroupType;
+ }
+
+ public String getDefaultGroupType()
+ {
+ return defaultGroupType;
+ }
+
+ public void setDefaultGroupType(String defaultGroupType)
+ {
+ this.defaultGroupType = defaultGroupType;
+ }
+
+ public String getRootGroupName()
+ {
+ return rootGroupName;
+ }
+
+ public void setRootGroupName(String rootGroupName)
+ {
+ this.rootGroupName = rootGroupName;
+ }
+
+ public void setGroupTypeMappings(Map<String, String> groupTypeMappings)
+ {
+ this.groupTypeMappings = groupTypeMappings;
+ }
+
+ public Map<String, String> getGroupTypeMappings()
+ {
+ return groupTypeMappings;
+ }
+
+ public boolean isPasswordAsAttribute()
+ {
+ return passwordAsAttribute;
+ }
+
+ public void setPasswordAsAttribute(boolean passwordAsAttribute)
+ {
+ this.passwordAsAttribute = passwordAsAttribute;
+ }
+
+ public String getPathSeparator()
+ {
+ return pathSeparator;
+ }
+
+ public void setPathSeparator(String pathSeparator)
+ {
+ this.pathSeparator = pathSeparator;
+ }
+
+ public boolean isForceMembershipOfMappedTypes()
+ {
+ return forceMembershipOfMappedTypes;
+ }
+
+ public void setForceMembershipOfMappedTypes(boolean forceMembershipOfMappedTypes)
+ {
+ this.forceMembershipOfMappedTypes = forceMembershipOfMappedTypes;
+ }
+}
Added: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/ExtGroup.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/ExtGroup.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/ExtGroup.java 2010-01-14 19:39:39 UTC (rev 1301)
@@ -0,0 +1,153 @@
+/*
+* 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.
+*/
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.services.organization.Group;
+
+public class ExtGroup implements Group
+{
+ private String id;
+
+ private String parentId;
+
+ private String groupName;
+
+ private String label;
+
+ private String desc;
+
+ public ExtGroup()
+ {
+
+ }
+
+ public ExtGroup(String name)
+ {
+ groupName = name;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public String getParentId()
+ {
+ return parentId;
+ }
+
+ public void setParentId(String parentId)
+ {
+ this.parentId = parentId;
+ }
+
+ public String getGroupName()
+ {
+ return groupName;
+ }
+
+ public void setGroupName(String name)
+ {
+ this.groupName = name;
+ }
+
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public void setLabel(String s)
+ {
+ label = s;
+ }
+
+ public String getDescription()
+ {
+ return desc;
+ }
+
+ public void setDescription(String s)
+ {
+ desc = s;
+ }
+
+
+ public String toString()
+ {
+ return "Group[" + id + "|" + groupName + "]";
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (!(o instanceof ExtGroup))
+ {
+ return false;
+ }
+
+ ExtGroup extGroup = (ExtGroup)o;
+
+ if (desc != null ? !desc.equals(extGroup.desc) : extGroup.desc != null)
+ {
+ return false;
+ }
+ if (groupName != null ? !groupName.equals(extGroup.groupName) : extGroup.groupName != null)
+ {
+ return false;
+ }
+ if (id != null ? !id.equals(extGroup.id) : extGroup.id != null)
+ {
+ return false;
+ }
+ if (label != null ? !label.equals(extGroup.label) : extGroup.label != null)
+ {
+ return false;
+ }
+ if (parentId != null ? !parentId.equals(extGroup.parentId) : extGroup.parentId != null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = id != null ? id.hashCode() : 0;
+ result = 31 * result + (parentId != null ? parentId.hashCode() : 0);
+ result = 31 * result + (groupName != null ? groupName.hashCode() : 0);
+ result = 31 * result + (label != null ? label.hashCode() : 0);
+ result = 31 * result + (desc != null ? desc.hashCode() : 0);
+ return result;
+ }
+}
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2010-01-14 19:39:39 UTC (rev 1301)
@@ -22,7 +22,6 @@
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.GroupEventListener;
import org.exoplatform.services.organization.GroupHandler;
-import org.exoplatform.services.organization.impl.GroupImpl;
import org.picketlink.idm.api.Attribute;
import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.impl.api.SimpleAttribute;
@@ -63,7 +62,7 @@
final public Group createGroupInstance()
{
- return new GroupImpl();
+ return new ExtGroup();
}
public void createGroup(Group group, boolean broadcast) throws Exception
@@ -78,13 +77,14 @@
if (parent != null)
{
parentGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
- ((GroupImpl)child).setId(parent.getId() + "/" + child.getGroupName());
+ getIdentitySession().getPersistenceManager().
+ findGroup(parent.getGroupName(), orgService.getConfiguration().getGroupType(parent.getParentId()));
+ ((ExtGroup)child).setId(parent.getId() + "/" + child.getGroupName());
}
else
{
- ((GroupImpl)child).setId("/" + child.getGroupName());
+ ((ExtGroup)child).setId("/" + child.getGroupName());
}
if (broadcast)
@@ -92,12 +92,15 @@
preSave(child, true);
}
+ if (parentGroup != null)
+ {
+ ((ExtGroup)child).setParentId(parent.getId());
+ }
org.picketlink.idm.api.Group childGroup = persistGroup(child);
if (parentGroup != null)
{
getIdentitySession().getRelationshipManager().associateGroups(parentGroup, childGroup);
- ((GroupImpl)child).setParentId(parent.getId());
}
else
@@ -133,7 +136,8 @@
}
org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(group.getGroupName(), orgService.getGtnGroupType());
+ getIdentitySession().getPersistenceManager().
+ findGroup(group.getGroupName(), orgService.getConfiguration().getGroupType(group.getParentId()));
if (jbidGroup == null)
{
@@ -143,12 +147,10 @@
// MembershipDAOImpl.removeMembershipEntriesOfGroup(group, getIdentitySession());
Collection<org.picketlink.idm.api.Group> oneLevelChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- true, false);
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, true, false);
Collection<org.picketlink.idm.api.Group> allChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- true, true);
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, true, true);
getIdentitySession().getRelationshipManager().disassociateGroups(jbidGroup, oneLevelChilds);
@@ -180,7 +182,8 @@
}
- return exoGroups;
+ // UI has hardcoded casts to List
+ return new LinkedList<Group>(exoGroups);
}
//
@@ -208,7 +211,8 @@
else
{
jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
+ getIdentitySession().getPersistenceManager().
+ findGroup(parent.getGroupName(), orgService.getConfiguration().getGroupType(parent.getParentId()));
}
if (jbidGroup == null)
@@ -216,20 +220,39 @@
return Collections.emptyList();
}
- Collection<org.picketlink.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- true, false);
+ String parentId = parent == null ? null : parent.getParentId();
- List<Group> exoGroups = new LinkedList<Group>();
+ Set<org.picketlink.idm.api.Group> plGroups = new HashSet<org.picketlink.idm.api.Group>();
- for (org.picketlink.idm.api.Group group : allGroups)
+
+ plGroups.addAll(getIdentitySession().getRelationshipManager().
+ findAssociatedGroups(jbidGroup, null, true, false));
+
+ // Get members of all types mapped below the parent group id path.
+ if (orgService.getConfiguration().isForceMembershipOfMappedTypes())
{
+
+ String id = parent != null ? parent.getId() : "/";
+
+ for (String type : orgService.getConfiguration().getTypes(id))
+ {
+ plGroups
+ .addAll(getIdentitySession().getPersistenceManager().findGroup(type));
+ }
+ }
+
+ Set<Group> exoGroups = new HashSet<Group>();
+
+ for (org.picketlink.idm.api.Group group : plGroups)
+ {
exoGroups.add(convertGroup(group));
}
- return exoGroups;
+ // UI has hardcoded casts to List
+ return new LinkedList<Group>(exoGroups);
+
}
public Collection findGroupsOfUser(String user) throws Exception
@@ -251,7 +274,7 @@
}
Collection<org.picketlink.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findRelatedGroups(user, orgService.getGtnGroupType(), null);
+ getIdentitySession().getRelationshipManager().findRelatedGroups(user, null, null);
List<Group> exoGroups = new LinkedList<Group>();
@@ -266,22 +289,32 @@
public Collection getAllGroups() throws Exception
{
- Collection<org.picketlink.idm.api.Group> allGroups =
- getIdentitySession().getPersistenceManager().findGroup(orgService.getGtnGroupType());
- List<Group> exoGroups = new LinkedList<Group>();
+ Set<org.picketlink.idm.api.Group> plGroups = new HashSet<org.picketlink.idm.api.Group>();
- for (org.picketlink.idm.api.Group group : allGroups)
+ plGroups
+ .addAll(getIdentitySession().getRelationshipManager().findAssociatedGroups(getRootGroup(), null, true, true));
+
+ // Check for all type groups mapped as part of the group tree but not connected with the root group by association
+ if (orgService.getConfiguration().isForceMembershipOfMappedTypes())
{
- if (!orgService.getGtnGroupType().equals(orgService.getGtnRootGroupType())
- || !group.getName().equals(orgService.getExoRootGroupName()))
+ for (String type : orgService.getConfiguration().getAllTypes())
{
- exoGroups.add(convertGroup(group));
+ plGroups
+ .addAll(getIdentitySession().getPersistenceManager().findGroup(type));
}
+ }
+ Set<Group> exoGroups = new HashSet<Group>();
+
+ for (org.picketlink.idm.api.Group group : plGroups)
+ {
+ exoGroups.add(convertGroup(group));
}
- return exoGroups;
+ // UI has hardcoded casts to List
+ return new LinkedList<Group>(exoGroups);
+
}
private void preSave(Group group, boolean isNew) throws Exception
@@ -316,25 +349,25 @@
}
}
- public Group getGroup(String groupName) throws Exception
- {
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
+// public Group getGroup(String groupName) throws Exception
+// {
+// org.picketlink.idm.api.Group jbidGroup =
+// getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
+//
+// if (jbidGroup == null)
+// {
+// return null;
+// }
+//
+// return convertGroup(jbidGroup);
+//
+// }
- if (jbidGroup == null)
- {
- return null;
- }
-
- return convertGroup(jbidGroup);
-
- }
-
- private Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exception
+ protected Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exception
{
Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
- GroupImpl exoGroup = new GroupImpl(jbidGroup.getName());
+ ExtGroup exoGroup = new ExtGroup(jbidGroup.getName());
if (attrs.containsKey(GROUP_DESCRIPTION) && attrs.get(GROUP_DESCRIPTION).getValue() != null)
{
@@ -346,53 +379,51 @@
}
// Resolve full ID
- String id = getGroupId(jbidGroup.getName());
+ String id = getGroupId(jbidGroup);
exoGroup.setId(id);
+ // child of root
if (id.length() == jbidGroup.getName().length() + 1)
{
exoGroup.setParentId(null);
}
- else
+ else if (!id.equals("") && !id.equals("/"))
{
- exoGroup.setParentId(id.substring(0, id.length() - jbidGroup.getName().length() - 1));
+
+ exoGroup.setParentId(id.substring(0, id.lastIndexOf("/")));
}
return exoGroup;
}
- private String getGroupId(String groupName) throws Exception
+ private String getGroupId(org.picketlink.idm.api.Group jbidGroup) throws Exception
{
- if (groupName.equals(orgService.getExoRootGroupName()))
+ if (jbidGroup.getName().equals(orgService.getConfiguration().getRootGroupName()))
{
return "";
}
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
-
Collection<org.picketlink.idm.api.Group> parents =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- false, false);
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, false, false);
if (parents.size() > 1)
{
- throw new IllegalStateException("Group has more than one parent: " + groupName);
+ throw new IllegalStateException("Group has more than one parent: " + jbidGroup.getName());
}
if (parents.size() == 0)
{
//As there is special root group this shouldn't happen:
- throw new IllegalStateException("Group present that is not connected to the root: " + groupName);
+ throw new IllegalStateException("Group present that is not connected to the root: " + jbidGroup.getName());
// This group is at the root
//return "/" + groupName;
}
- String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()).getName());
+ String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()));
- return parentGroupId + "/" + groupName;
+ return parentGroupId + "/" + jbidGroup.getName();
}
@@ -400,13 +431,14 @@
{
org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(exoGroup.getGroupName(), orgService.getGtnGroupType());
+ getIdentitySession().getPersistenceManager().
+ findGroup(exoGroup.getGroupName(), orgService.getConfiguration().getGroupType(exoGroup.getParentId()));
if (jbidGroup == null)
{
jbidGroup =
- getIdentitySession().getPersistenceManager().createGroup(exoGroup.getGroupName(),
- orgService.getGtnGroupType());
+ getIdentitySession().getPersistenceManager().
+ createGroup(exoGroup.getGroupName(), orgService.getConfiguration().getGroupType(exoGroup.getParentId()));
}
String description = exoGroup.getDescription();
@@ -444,16 +476,20 @@
private org.picketlink.idm.api.Group getRootGroup() throws Exception
{
org.picketlink.idm.api.Group rootGroup =
- getIdentitySession().getPersistenceManager().findGroup(orgService.getExoRootGroupName(),
- orgService.getGtnRootGroupType());
+ getIdentitySession().getPersistenceManager().
+ findGroup(orgService.getConfiguration().getRootGroupName(), orgService.getConfiguration().getGroupType("/"));
if (rootGroup == null)
{
rootGroup =
- getIdentitySession().getPersistenceManager().createGroup(orgService.getExoRootGroupName(),
- orgService.getGtnRootGroupType());
+ getIdentitySession().getPersistenceManager().
+ createGroup(
+ orgService.getConfiguration().getRootGroupName(),
+ orgService.getConfiguration().getGroupType("/"));
}
return rootGroup;
}
+
+
}
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2010-01-14 19:39:39 UTC (rev 1301)
@@ -102,7 +102,8 @@
}
String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(g.getGroupName(), orgService.getGtnGroupType());
+ getIdentitySession().getPersistenceManager().
+ createGroupKey(g.getGroupName(), orgService.getConfiguration().getGroupType(g.getParentId()));
if (getIdentitySession().getRoleManager().hasRole(user.getUserName(), groupId, mt.getName()))
{
@@ -131,8 +132,8 @@
public void saveMembership(Membership m, boolean broadcast) throws Exception
{
String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
- orgService.getGtnGroupType());
+ getIdentitySession().getPersistenceManager().
+ createGroupKey(getGroupNameFromId(m.getGroupId()), getGroupTypeFromId(m.getGroupId()));
if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
{
@@ -158,8 +159,8 @@
Membership m = new MembershipImpl(id);
String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
- orgService.getGtnGroupType());
+ getIdentitySession().getPersistenceManager().
+ createGroupKey(getGroupNameFromId(m.getGroupId()), getGroupTypeFromId(m.getGroupId()));
if (!getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
{
@@ -191,7 +192,7 @@
for (Role role : roles)
{
MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
+ Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
m.setGroupId(g.getId());
m.setUserName(role.getUser().getId());
m.setMembershipType(role.getRoleType().getName());
@@ -218,8 +219,8 @@
public Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
{
String gid =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
- orgService.getGtnGroupType());
+ getIdentitySession().getPersistenceManager().
+ createGroupKey(getGroupNameFromId(groupId), getGroupTypeFromId(groupId));
Role role = getIdentitySession().getRoleManager().getRole(type, userName, gid);
@@ -245,8 +246,8 @@
}
String gid =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
- orgService.getGtnGroupType());
+ getIdentitySession().getPersistenceManager().
+ createGroupKey(getGroupNameFromId(groupId), getGroupTypeFromId(groupId));
Collection<RoleType> roleTypes = getIdentitySession().getRoleManager().findRoleTypes(userName, gid, null);
@@ -275,7 +276,7 @@
for (Role role : roles)
{
MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
+ Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
m.setGroupId(g.getId());
m.setUserName(role.getUser().getId());
m.setMembershipType(role.getRoleType().getName());
@@ -288,7 +289,8 @@
static void removeMembershipEntriesOfGroup(PicketLinkIDMOrganizationServiceImpl orgService, Group group,
IdentitySession session) throws Exception
{
- String gid = session.getPersistenceManager().createGroupKey(group.getGroupName(), orgService.getGtnGroupType());
+ String gid = session.getPersistenceManager().
+ createGroupKey(group.getGroupName(), orgService.getConfiguration().getGroupType(group.getParentId()));
Collection<Role> roles = session.getRoleManager().findRoles(gid, null);
@@ -307,7 +309,7 @@
{
String gid =
getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
- orgService.getGtnGroupType());
+ getGroupTypeFromId(groupId));
Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(gid, null);
@@ -317,7 +319,7 @@
for (Role role : roles)
{
MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
+ Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
m.setGroupId(g.getId());
m.setUserName(role.getUser().getId());
m.setMembershipType(role.getRoleType().getName());
@@ -334,7 +336,7 @@
String groupId =
getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
- orgService.getGtnGroupType());
+ getGroupTypeFromId(m.getGroupId()));
if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
{
@@ -391,4 +393,12 @@
return ids[ids.length - 1];
}
+
+ private String getGroupTypeFromId(String groupId)
+ {
+
+ String parentId = groupId.substring(0, groupId.lastIndexOf("/"));
+
+ return orgService.getConfiguration().getGroupType(parentId);
+ }
}
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2010-01-14 19:39:39 UTC (rev 1301)
@@ -23,6 +23,8 @@
import org.exoplatform.container.component.ComponentRequestLifecycle;
import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ObjectParam;
+import org.exoplatform.container.xml.ObjectParameter;
import org.exoplatform.container.xml.ValueParam;
import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.organization.BaseOrganizationService;
@@ -39,22 +41,10 @@
// private static PicketLinkIDMService jbidmService_;
private PicketLinkIDMService idmService_;
- public static final String GTN_GROUP_TYPE_OPTION = "gtnGroupTypeName";
+ public static final String CONFIGURATION_OPTION = "configuration";
- public static final String GTN_ROOT_GROUP_NAME_OPTION = "gtnRootGroupName";
+ private Config configuration = new Config();
- public static final String GTN_ROOT_GROUP_TYPE_NAME_OPTION = "gtnRootGroupTypeName";
-
- public static final String PASSWORD_AS_ATTRIBUTE_OPTION = "passwordAsAttribute";
-
- private String gtnGroupType = "GTN_GROUP_TYPE";
-
- private String gtnRootGroupName = "GTN_ROOT_GROUP";
-
- private String gtnRootGroupType = gtnGroupType;
-
- private boolean passwordAsAttribute = false;
-
public PicketLinkIDMOrganizationServiceImpl(InitParams params, CacheService cservice, PicketLinkIDMService idmService)
throws Exception
{
@@ -69,34 +59,13 @@
if (params != null)
{
//Options
- ValueParam gtnGroupTypeNameParam = params.getValueParam(GTN_GROUP_TYPE_OPTION);
- ValueParam gtnRootGroupTypeNameParam = params.getValueParam(GTN_ROOT_GROUP_TYPE_NAME_OPTION);
- ValueParam gtnRootGroupNameParam = params.getValueParam(GTN_ROOT_GROUP_NAME_OPTION);
- ValueParam passwordAsAttributeParam = params.getValueParam(PASSWORD_AS_ATTRIBUTE_OPTION);
+ ObjectParameter configurationParam = params.getObjectParam(CONFIGURATION_OPTION);
- if (gtnGroupTypeNameParam != null)
+ if (configurationParam != null)
{
- this.gtnGroupType = gtnGroupTypeNameParam.getValue();
+ this.configuration = (Config)configurationParam.getObject();
}
- if (gtnRootGroupNameParam != null)
- {
- this.gtnRootGroupName = gtnRootGroupNameParam.getValue();
- }
-
- if (gtnRootGroupTypeNameParam != null)
- {
- this.gtnRootGroupType = gtnRootGroupTypeNameParam.getValue();
- }
- else if (gtnRootGroupTypeNameParam != null)
- {
- this.gtnRootGroupType = this.gtnGroupType;
- }
-
- if (passwordAsAttributeParam != null && passwordAsAttributeParam.getValue().equalsIgnoreCase("true"))
- {
- this.passwordAsAttribute = true;
- }
}
}
@@ -105,7 +74,13 @@
{
String[] ids = groupId.split("/");
String name = ids[ids.length - 1];
- return idmService_.getIdentitySession().getPersistenceManager().findGroup(name, getGtnGroupType());
+ String parentId = null;
+ if (groupId.contains("/"))
+ {
+ parentId = groupId.substring(0, groupId.lastIndexOf("/"));
+ }
+ return idmService_.getIdentitySession().getPersistenceManager().
+ findGroup(name, getConfiguration().getGroupType(parentId));
}
@Override
@@ -114,15 +89,11 @@
try
{
- // Wrap within transaction so all initializers can work
-// idmService_.getIdentitySession().beginTransaction();
RequestLifeCycle.begin(this);
super.start();
-// idmService_.getIdentitySession().getTransaction().commit();
-
}
catch (Exception e)
{
@@ -182,23 +153,14 @@
}
}
- public String getGtnGroupType()
- {
- return gtnGroupType;
- }
- public String getExoRootGroupName()
+ public Config getConfiguration()
{
- return gtnRootGroupName;
+ return configuration;
}
- public String getGtnRootGroupType()
+ public void setConfiguration(Config configuration)
{
- return gtnRootGroupType;
+ this.configuration = configuration;
}
-
- public boolean isPasswordAsAttribute()
- {
- return passwordAsAttribute;
- }
}
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2010-01-14 19:39:39 UTC (rev 1301)
@@ -219,7 +219,7 @@
boolean authenticated = false;
- if (orgService.isPasswordAsAttribute())
+ if (orgService.getConfiguration().isPasswordAsAttribute())
{
authenticated = user.getPassword().equals(password);
}
@@ -347,7 +347,7 @@
}
if (user.getPassword() != null)
{
- if (orgService.isPasswordAsAttribute())
+ if (orgService.getConfiguration().isPasswordAsAttribute())
{
attributes.add(new SimpleAttribute(USER_PASSWORD, user.getPassword()));
}
Modified: portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml 2010-01-14 19:39:39 UTC (rev 1301)
@@ -24,23 +24,53 @@
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
- <init-params>
- <value-param>
- <name>config</name>
- <value>jar:/conf/portal/idm-config.xml</value>
- </value-param>
- </init-params>
- </component>
+ <component>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>config</name>
+ <value>jar:/conf/portal/idm-config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
- <component>
- <key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
- </component>
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.idm.Config">
+ <field name="useParentIdAsGroupType">
+ <boolean>true</boolean>
+ </field>
+ <field name="groupTypeMappings">
+ <map type="java.util.HashMap">
+ <entry>
+ <key><string>/</string></key>
+ <value><string>root_type</string></value>
+ </entry>
+ <!--<entry>-->
+ <!--<key><string>/platform</string></key>-->
+ <!--<value><string>platform_type</string></value>-->
+ <!--</entry>-->
+ <!--<entry>-->
+ <!--<key><string>/platform/users</string></key>-->
+ <!--<value><string>users_type</string></value>-->
+ <!--</entry>-->
+ <!--<entry>-->
+ <!--<key><string>/organization/acme/france</string></key>-->
+ <!--<value><string>france_type</string></value>-->
+ <!--</entry>-->
+ </map>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
- <component>
+ <component>
<key>org.exoplatform.services.database.HibernateService</key>
<jmx-name>database:type=HibernateService</jmx-name>
<type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
@@ -73,28 +103,28 @@
</init-params>
</component>
- <external-component-plugins>
- <target-component>org.exoplatform.services.database.HibernateService</target-component>
- <component-plugin>
- <name>add.hibernate.mapping</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
- <init-params>
- <values-param>
- <name>hibernate.mapping</name>
- <value>mappings/HibernateRealm.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
- <value>mappings/HibernateIdentityObject.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/pom.xml 2010-01-14 19:39:39 UTC (rev 1301)
@@ -47,7 +47,7 @@
<org.gatein.common.version>2.0.0-CR03</org.gatein.common.version>
<org.gatein.wci.version>2.0.0-CR02</org.gatein.wci.version>
<org.gatein.pc.version>2.1.0-CR02</org.gatein.pc.version>
- <org.picketlink.idm>1.1.0.Beta1</org.picketlink.idm>
+ <org.picketlink.idm>1.1.0.Beta2</org.picketlink.idm>
<org.gatein.wsrp.version>1.0.0-Beta04</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-Beta13</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObjectRelationshipName.hbm.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObjectRelationshipName.hbm.xml 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/mappings/HibernateIdentityObjectRelationshipName.hbm.xml 2010-01-14 19:39:39 UTC (rev 1301)
@@ -18,7 +18,6 @@
lazy="false">
<column name="NAME"
not-null="true"
- unique="true"
unique-key="id"/>
</property>
<map name="properties"
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationshipName.hbm.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationshipName.hbm.xml 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/picketlink-idm/sybase-mappings/HibernateIdentityObjectRelationshipName.hbm.xml 2010-01-14 19:39:39 UTC (rev 1301)
@@ -18,7 +18,6 @@
lazy="false">
<column name="NAME"
not-null="true"
- unique="true"
unique-key="id"/>
</property>
<map name="properties"
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2010-01-14 19:39:39 UTC (rev 1301)
@@ -26,52 +26,113 @@
- <component>
- <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
- <init-params>
- <value-param>
- <name>config</name>
- <value>war:/conf/organization/picketlink-idm/picketlink-idm-config.xml</value>
- </value-param>
- <value-param>
- <name>portalRealm</name>
- <value>realm${container.name.suffix}</value>
- </value-param>
+ <component>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>config</name>
+ <value>war:/conf/organization/picketlink-idm/picketlink-idm-config.xml</value>
- </init-params>
- </component>
+ <!--Sample LDAP config-->
+ <!--<value>war:/conf/organization/picketlink-idm/picketlink-idm-ldap-config.xml</value>-->
+ </value-param>
+ <value-param>
+ <name>portalRealm</name>
+ <value>realm${container.name.suffix}</value>
+ </value-param>
+ </init-params>
+ </component>
- <component>
- <key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
- </component>
- <external-component-plugins>
- <target-component>org.exoplatform.services.database.HibernateService</target-component>
- <component-plugin>
- <name>add.hibernate.mapping</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
- <init-params>
- <values-param>
- <name>hibernate.mapping</name>
- <value>picketlink-idm/mappings/HibernateRealm.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObject.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectCredential.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectType.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
- <value>picketlink-idm/mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.idm.Config">
+ <!-- For all ids not mapped with type in 'groupTypeMappings' use parent id path
+ as a group type to store group in PicketLink IDM. The effect of setting
+ this option to false and not providing any mappings under 'groupTypeMappings' option
+ is that there can be only one group with a given name in all GateIn group tree-->
+ <field name="useParentIdAsGroupType">
+ <boolean>true</boolean>
+ </field>
+ <!-- Group stored in PicketLink IDM with a type mapped in 'groupTypeMappings' will
+ automatically be member under mapped parent. Normally groups are linked by
+ PicketLink IDM group association - such relationship won't be needed then. It can
+ be set to false if all groups are added via GateIn APIs
+ This option may be useful with LDAP config as it will make (if set to true) every entry
+ added to LDAP (not via GateIn management UI) appear in GateIn-->
+ <field name="forceMembershipOfMappedTypes">
+ <boolean>false</boolean>
+ </field>
+ <!-- When 'userParentIdAsGroupType is set to true this value will be used to
+ replace all "/" chars in id. This is because "/" is not allowed to be
+ used in group type name in PicketLink IDM-->
+ <field name="pathSeparator">
+ <string>.</string>
+ </field>
+ <!-- Name of a group stored in PicketLink IDM that acts as root group in GateIn - "/" -->
+ <field name="rootGroupName">
+ <string>GTN_ROOT_GROUP</string>
+ </field>
+ <!-- Map groups added with GateIn API as a childs of a given group ID to be stored with a given
+ group type name in PicketLink IDM. If parent ID ends with "/*" then all child groups will
+ have the mapped group type. Otherwise only direct (first level) children will use this type.
+ This can be leveraged by LDAP setup. Given LDAP DN configured in PicketLink IDM to
+ store specific group type will then store one given branch in GateIn group tree while
+ all other groups will remain in DB. -->
+ <field name="groupTypeMappings">
+ <map type="java.util.HashMap">
+ <entry>
+ <key><string>/</string></key>
+ <value><string>root_type</string></value>
+ </entry>
+ <!-- Uncomment for sample LDAP configuration -->
+ <!--<entry>-->
+ <!--<key><string>/platform/*</string></key>-->
+ <!--<value><string>platform_type</string></value>-->
+ <!--</entry>-->
+ <!--<entry>-->
+ <!--<key><string>/organization/*</string></key>-->
+ <!--<value><string>organization_type</string></value>-->
+ <!--</entry>-->
+ </map>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>picketlink-idm/mappings/HibernateRealm.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>picketlink-idm/mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+
</configuration>
Deleted: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/default-ldap.ldif
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/default-ldap.ldif 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/default-ldap.ldif 2010-01-14 19:39:39 UTC (rev 1301)
@@ -1,35 +0,0 @@
-dn: o=gatein,dc=example,dc=com
-objectclass: top
-objectclass: organization
-o: gatein
-
-dn: o=portal,o=gatein,dc=example,dc=com
-objectclass: top
-objectclass: organization
-o: portal
-
-dn: ou=People,o=portal,o=gatein,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: People
-
-dn: ou=Groups,o=portal,o=gatein,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: Groups
-
-dn: o=sample-portal,o=gatein,dc=example,dc=com
-objectclass: top
-objectclass: organization
-o: sample-portal
-
-dn: ou=People,o=sample-portal,o=gatein,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: People
-
-dn: ou=Groups,o=sample-portal,o=gatein,dc=example,dc=com
-objectclass: top
-objectclass: organizationalUnit
-ou: Groups
-
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-config.xml 2010-01-14 19:39:39 UTC (rev 1301)
@@ -76,26 +76,6 @@
<attributes/>
<options/>
</identity-object-type>
- <identity-object-type>
- <name>GTN_GROUP_TYPE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>GTN_GROUP_TYPE</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
</supported-identity-object-types>
<options>
<option>
@@ -111,6 +91,10 @@
<value>true</value>
</option>
<option>
+ <name>allowNotDefinedIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
<name>allowNotDefinedAttributes</name>
<value>true</value>
</option>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-ldap-config.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-ldap-config.xml 2010-01-14 17:44:18 UTC (rev 1300)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/picketlink-idm-ldap-config.xml 2010-01-14 19:39:39 UTC (rev 1301)
@@ -58,7 +58,8 @@
<identity-store-id>PortalLDAPStore</identity-store-id>
<identity-object-types>
<identity-object-type>USER</identity-object-type>
- <identity-object-type>GTN_GROUP_TYPE</identity-object-type>
+ <identity-object-type>platform_type</identity-object-type>
+ <identity-object-type>organization_type</identity-object-type>
</identity-object-types>
<options/>
</identity-store-mapping>
@@ -72,26 +73,10 @@
</repository>
<repository>
<id>SamplePortalRepository</id>
- <class>org.picketlink.idm.impl.repository.FallbackIdentityStoreRepository</class>
+ <class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
<external-config/>
<default-identity-store-id>HibernateStore</default-identity-store-id>
<default-attribute-store-id>HibernateStore</default-attribute-store-id>
- <identity-store-mappings>
- <identity-store-mapping>
- <identity-store-id>SamplePortalLDAPStore</identity-store-id>
- <identity-object-types>
- <identity-object-type>USER</identity-object-type>
- <identity-object-type>GTN_GROUP_TYPE</identity-object-type>
- </identity-object-types>
- <options/>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
</repository>
</repositories>
<stores>
@@ -115,26 +100,6 @@
<attributes/>
<options/>
</identity-object-type>
- <identity-object-type>
- <name>GTN_GROUP_TYPE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>GTN_GROUP_TYPE</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
</supported-identity-object-types>
<options>
<option>
@@ -150,6 +115,10 @@
<value>true</value>
</option>
<option>
+ <name>allowNotDefinedIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
<name>allowNotDefinedAttributes</name>
<value>true</value>
</option>
@@ -202,7 +171,7 @@
</options>
</identity-object-type>
<identity-object-type>
- <name>GTN_GROUP_TYPE</name>
+ <name>platform_type</name>
<relationships>
<relationship>
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
@@ -210,7 +179,7 @@
</relationship>
<relationship>
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>GTN_GROUP_TYPE</identity-object-type-ref>
+ <identity-object-type-ref>platform_type</identity-object-type-ref>
</relationship>
</relationships>
<credentials/>
@@ -222,7 +191,7 @@
</option>
<option>
<name>ctxDNs</name>
- <value>ou=Groups,o=portal,o=gatein,dc=example,dc=com</value>
+ <value>ou=Platform,o=portal,o=gatein,dc=example,dc=com</value>
</option>
<!--<option>-->
<!--<name>entrySearchFilter</name>-->
@@ -251,70 +220,8 @@
</option>
</options>
</identity-object-type>
- </supported-identity-object-types>
- <options>
- <option>
- <name>providerURL</name>
- <value>ldap://localhost:1389</value>
- </option>
- <option>
- <name>adminDN</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>adminPassword</name>
- <value>password</value>
- </option>
- <option>
- <name>searchTimeLimit</name>
- <value>10000</value>
- </option>
- </options>
- </identity-store>
- <identity-store>
- <id>SamplePortalLDAPStore</id>
- <class>org.picketlink.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
- <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
<identity-object-type>
- <name>USER</name>
- <relationships/>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- </attributes>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeName</name>
- <value>userPassword</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=People,o=sample-portal,o=gatein,dc=example,dc=com</value>
- </option>
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=inetOrgPerson</value>
- <value>sn= </value>
- <value>cn= </value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>GTN_GROUP_TYPE</name>
+ <name>organization_type</name>
<relationships>
<relationship>
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
@@ -322,7 +229,7 @@
</relationship>
<relationship>
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>GTN_GROUP_TYPE</identity-object-type-ref>
+ <identity-object-type-ref>organization_type</identity-object-type-ref>
</relationship>
</relationships>
<credentials/>
@@ -334,7 +241,7 @@
</option>
<option>
<name>ctxDNs</name>
- <value>ou=Groups,o=sample-portal,o=gatein,dc=example,dc=com</value>
+ <value>ou=Organization,o=portal,o=gatein,dc=example,dc=com</value>
</option>
<!--<option>-->
<!--<name>entrySearchFilter</name>-->
@@ -381,6 +288,10 @@
<name>searchTimeLimit</name>
<value>10000</value>
</option>
+ <option>
+ <name>createMissingContexts</name>
+ <value>true</value>
+ </option>
</options>
</identity-store>
</identity-stores>
14 years, 11 months
gatein SVN: r1300 - in portal/trunk/portlet/exoadmin/src/main: webapp/skin/wsrp/webui/component and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-14 12:44:18 -0500 (Thu, 14 Jan 2010)
New Revision: 1300
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
Log:
- Reverted back some changes that didn't bring anything.
- Renamed actions array to PROPERTIES_ACTIONS.
- Fixed display of delete property action.
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java 2010-01-14 17:30:00 UTC (rev 1299)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java 2010-01-14 17:44:18 UTC (rev 1300)
@@ -35,9 +35,7 @@
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIGrid;
import org.exoplatform.webui.core.UIPopupWindow;
-import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
import org.exoplatform.webui.core.lifecycle.UIContainerLifecycle;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.core.renderers.ValueRenderer;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
@@ -69,11 +67,11 @@
@ComponentConfigs({
@ComponentConfig(id = UIWsrpRegistrationDetails.REGISTRATION_PROPERTIES, type = UIGrid.class, template = "system:/groovy/webui/core/UIGrid.gtmpl"),
@ComponentConfig(
- lifecycle = UIApplicationLifecycle.class,
+ lifecycle = UIContainerLifecycle.class,
events = {
@EventConfig(listeners = UIWsrpRegistrationDetails.AddPropertyActionListener.class),
@EventConfig(listeners = UIWsrpRegistrationDetails.EditPropertyActionListener.class),
- @EventConfig(listeners = UIWsrpRegistrationDetails.DeleteActionListener.class)
+ @EventConfig(listeners = UIWsrpRegistrationDetails.DeletePropertyActionListener.class)
})
})
public class UIWsrpRegistrationDetails extends UIFormInputSet
@@ -83,7 +81,7 @@
private UIGrid registrationProperties;
private static final String NAME = "name";
static String[] FIELDS = {NAME, "description", "label", "hint"};
- static String[] SELECT_ACTIONS = {"EditProperty", "Delete"};
+ static String[] PROPERTIES_ACTIONS = {"EditProperty", "DeleteProperty"};
static final String POLICY_CLASS = "policyClassName";
static final String VALIDATOR_CLASS = "validatorClassName";
static final String REGISTRATION_PROPERTIES = "RegistrationPropertySelector";
@@ -116,7 +114,7 @@
registrationProperties.registerRendererFor(renderer, LocalizedString.class);
//configure the edit and delete buttons based on an id from the data list - this will also be passed as param to listener
- registrationProperties.configure(NAME, FIELDS, SELECT_ACTIONS);
+ registrationProperties.configure(NAME, FIELDS, PROPERTIES_ACTIONS);
registrationProperties.getUIPageIterator().setId(REGISTRATION_PROPERTIES_ITERATOR);
registrationProperties.getUIPageIterator().setRendered(false);
addChild(registrationProperties.getUIPageIterator());
@@ -285,13 +283,11 @@
}
}
- static public class DeleteActionListener extends EventListener<UIWsrpRegistrationDetails>
+ static public class DeletePropertyActionListener extends EventListener<UIWsrpRegistrationDetails>
{
public void execute(Event<UIWsrpRegistrationDetails> event)
{
UIWsrpRegistrationDetails source = event.getSource();
- UIApplication uiApp = event.getRequestContext().getUIApplication();
- UIPopupWindow popup = source.getChild(UIPopupWindow.class);
String id = event.getRequestContext().getRequestParameter(OBJECTID);
try
{
@@ -302,6 +298,7 @@
catch (Exception e)
{
e.printStackTrace();
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
uiApp.addMessage(new ApplicationMessage("Failed to delete Producer Property. Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
}
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2010-01-14 17:30:00 UTC (rev 1299)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2010-01-14 17:44:18 UTC (rev 1300)
@@ -1,16 +1,20 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
+/*
+ * 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
@@ -48,7 +52,7 @@
img.DeletePropertyIcon {
width: 16px;
height: 16px;
- background: url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/DustBinIcon.gif') no-repeat;
+ background: url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/DustBin.gif') no-repeat;
}
.UIWsrpPortlet .UITabPane {
14 years, 11 months
gatein SVN: r1299 - portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-14 12:30:00 -0500 (Thu, 14 Jan 2010)
New Revision: 1299
Added:
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E1.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E2.java
Removed:
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java
Modified:
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java
Log:
refactor a bit a unit test
Deleted: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java 2010-01-14 17:24:58 UTC (rev 1298)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java 2010-01-14 17:30:00 UTC (rev 1299)
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.webui.replication;
-
-import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@ReplicatedType
-public class E
-{
-
- E left;
- E right;
-
-}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E1.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E1.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E1.java 2010-01-14 17:30:00 UTC (rev 1299)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.webui.replication;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class E1
+{
+}
Copied: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E2.java (from rev 1269, portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java)
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E2.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E2.java 2010-01-14 17:30:00 UTC (rev 1299)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.webui.replication;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class E2 extends E1
+{
+
+ E1 left;
+ E1 right;
+
+}
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java 2010-01-14 17:24:58 UTC (rev 1298)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java 2010-01-14 17:30:00 UTC (rev 1299)
@@ -60,17 +60,17 @@
public void testAAA() throws Exception
{
TypeDomain domain = new TypeDomain();
- domain.add(E.class);
- E e = new E();
- e.left = new E();
- e.left.left = new E();
- e.left.right = new E();
- e.right = new E();
- e.right.left = e.left.left;
- e.right.right = e.left.right;
+ domain.add(E2.class);
+ E2 e = new E2();
+ e.left = new E2();
+ ((E2)e.left).left = new E1();
+ ((E2)e.left).right = new E1();
+ e.right = new E2();
+ ((E2)e.right).left = ((E2)e.left).left;
+ ((E2)e.right).right = ((E2)e.left).right;
SerializationContext context = new SerializationContext(domain);
e = context.clone(e);
- assertSame(e.left.left, e.right.left);
- assertSame(e.left.right, e.right.right);
+ assertSame(((E2)e.left).left, ((E2)e.right).left);
+ assertSame(((E2)e.left).right, ((E2)e.right).right);
}
}
14 years, 11 months
gatein SVN: r1298 - in portal/trunk: portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component and 2 other directories.
by do-not-reply@jboss.org
Author: wesleyhales
Date: 2010-01-14 12:24:58 -0500 (Thu, 14 Jan 2010)
New Revision: 1298
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
Log:
Wsrp cleanup and try to make buttons work
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java 2010-01-14 15:35:44 UTC (rev 1297)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java 2010-01-14 17:24:58 UTC (rev 1298)
@@ -29,6 +29,7 @@
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
@@ -85,7 +86,11 @@
{
public void execute(Event<UIWsrpProducerPropertyEditor> event) throws Exception
{
- // todo: implement
+ UIWsrpProducerPropertyEditor source = event.getSource();
+ source.save(event.getRequestContext());
+ UIPopupWindow popup = source.getParent();
+ popup.setRendered(false);
+ popup.setShow(false);
}
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java 2010-01-14 15:35:44 UTC (rev 1297)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java 2010-01-14 17:24:58 UTC (rev 1298)
@@ -35,7 +35,9 @@
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIGrid;
import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
import org.exoplatform.webui.core.lifecycle.UIContainerLifecycle;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.core.renderers.ValueRenderer;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
@@ -67,11 +69,11 @@
@ComponentConfigs({
@ComponentConfig(id = UIWsrpRegistrationDetails.REGISTRATION_PROPERTIES, type = UIGrid.class, template = "system:/groovy/webui/core/UIGrid.gtmpl"),
@ComponentConfig(
- lifecycle = UIContainerLifecycle.class,
+ lifecycle = UIApplicationLifecycle.class,
events = {
@EventConfig(listeners = UIWsrpRegistrationDetails.AddPropertyActionListener.class),
@EventConfig(listeners = UIWsrpRegistrationDetails.EditPropertyActionListener.class),
- @EventConfig(listeners = UIWsrpRegistrationDetails.DeletePropertyActionListener.class)
+ @EventConfig(listeners = UIWsrpRegistrationDetails.DeleteActionListener.class)
})
})
public class UIWsrpRegistrationDetails extends UIFormInputSet
@@ -81,7 +83,7 @@
private UIGrid registrationProperties;
private static final String NAME = "name";
static String[] FIELDS = {NAME, "description", "label", "hint"};
- static String[] SELECT_ACTIONS = {"EditProperty", "DeleteProperty"};
+ static String[] SELECT_ACTIONS = {"EditProperty", "Delete"};
static final String POLICY_CLASS = "policyClassName";
static final String VALIDATOR_CLASS = "validatorClassName";
static final String REGISTRATION_PROPERTIES = "RegistrationPropertySelector";
@@ -260,11 +262,11 @@
// todo: deal with registration properties
}
- static public class EditPropertyActionListener extends EventListener<UIWsrpProducerEditor>
+ static public class EditPropertyActionListener extends EventListener<UIWsrpRegistrationDetails>
{
- public void execute(Event<UIWsrpProducerEditor> event) throws Exception
+ public void execute(Event<UIWsrpRegistrationDetails> event) throws Exception
{
- UIWsrpProducerEditor source = event.getSource();
+ UIWsrpRegistrationDetails source = event.getSource();
UIPopupWindow popup = source.getChild(UIPopupWindow.class);
UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
String id = event.getRequestContext().getRequestParameter(OBJECTID);
@@ -283,11 +285,11 @@
}
}
- static public class DeletePropertyActionListener extends EventListener<UIWsrpProducerEditor>
+ static public class DeleteActionListener extends EventListener<UIWsrpRegistrationDetails>
{
- public void execute(Event<UIWsrpProducerEditor> event)
+ public void execute(Event<UIWsrpRegistrationDetails> event)
{
- UIWsrpProducerEditor source = event.getSource();
+ UIWsrpRegistrationDetails source = event.getSource();
UIApplication uiApp = event.getRequestContext().getUIApplication();
UIPopupWindow popup = source.getChild(UIPopupWindow.class);
String id = event.getRequestContext().getRequestParameter(OBJECTID);
@@ -306,11 +308,11 @@
}
}
- static public class AddPropertyActionListener extends EventListener<UIWsrpProducerEditor>
+ static public class AddPropertyActionListener extends EventListener<UIWsrpRegistrationDetails>
{
- public void execute(Event<UIWsrpProducerEditor> event) throws Exception
+ public void execute(Event<UIWsrpRegistrationDetails> event) throws Exception
{
- UIWsrpProducerEditor source = event.getSource();
+ UIWsrpRegistrationDetails source = event.getSource();
UIPopupWindow popup = source.getChild(UIPopupWindow.class);
UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2010-01-14 15:35:44 UTC (rev 1297)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2010-01-14 17:24:58 UTC (rev 1298)
@@ -13,11 +13,11 @@
<table class="ActionContainer">
<tr>
<td>
- <div onclick="<%=uicomponent.getChild(UIWsrpProducerEditor.class).getChild(UIWsrpRegistrationDetails.class).event("Add")%>" class="ActionButton LightBlueStyle">
+ <div onclick="<%=uicomponent.getChild(UIWsrpProducerEditor.class).getChild(UIWsrpRegistrationDetails.class).event("AddProperty")%>" class="ActionButton LightBlueStyle">
<div class="ButtonLeft">
<div class="ButtonRight">
<div class="ButtonMiddle">
- <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getChild(UIWsrpProducerEditor.class).getChild(UIWsrpRegistrationDetails.class).getId() + ".action.Add")%></a>
+ <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getChild(UIWsrpProducerEditor.class).getChild(UIWsrpRegistrationDetails.class).getId() + ".action.AddProperty")%></a>
</div>
</div>
</div>
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl 2010-01-14 15:35:44 UTC (rev 1297)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl 2010-01-14 17:24:58 UTC (rev 1298)
@@ -58,4 +58,4 @@
<% uiform.end() %>
-</div>
\ No newline at end of file
+</div>
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2010-01-14 15:35:44 UTC (rev 1297)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2010-01-14 17:24:58 UTC (rev 1298)
@@ -97,3 +97,18 @@
margin: 0;
}
+.UIWsrpPortlet .UIFormInputSet div.row {
+ clear: both;
+ margin: 0;
+ width: 500px;
+}
+
+.UIWsrpPortlet .UIFormInputSet div.row label {
+ float: left;
+ width: 26%;
+}
+
+.UIWsrpPortlet .UIFormInputSet div.row input {
+ float: left;
+ width: 69%;
+}
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-01-14 15:35:44 UTC (rev 1297)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-01-14 17:24:58 UTC (rev 1298)
@@ -1403,7 +1403,7 @@
UIWsrp.consumer.grid.action.delete.fail=Failed to delete Consumer. Cause: {0}
UIWsrp.consumer.grid.action.refresh.success=Consumer Refreshed Successfully.
UIWsrp.consumer.grid.action.refresh.needfix=Consumer refresh resulted in errors that need to be fixed.
-UIWsrp.consumer.grid.action.refresh.fail=Failed to refresh Consumer.
+UIWsrp.consumer.grid.action.refresh.fail=Failed to refresh Consumer. Cause: {0}
UIWsrp.consumer.grid.action.activate.success=Consumer successfully activated.
UIWsrp.consumer.grid.action.activate.fail=Problem Activating Consumer: {0}
UIWsrp.consumer.grid.action.deactivate.success=Consumer successfully deactivated.
14 years, 11 months
gatein SVN: r1297 - in portal/trunk/webui/core/src: main/java/org/exoplatform/webui/application/replication/annotations and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-14 10:35:44 -0500 (Thu, 14 Jan 2010)
New Revision: 1297
Removed:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/Factory.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C1.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C2.java
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/SerializationContext.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/ClassTypeModel.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A1.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A2.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/TestObjectFactory.java
Log:
actually make factory simpler and less constrained
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/SerializationContext.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/SerializationContext.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/SerializationContext.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -19,6 +19,8 @@
package org.exoplatform.webui.application.replication;
+import org.exoplatform.webui.application.replication.factory.DefaultObjectFactory;
+import org.exoplatform.webui.application.replication.factory.ObjectFactory;
import org.exoplatform.webui.application.replication.model.TypeDomain;
import org.exoplatform.webui.application.replication.serial.ObjectReader;
import org.exoplatform.webui.application.replication.serial.ObjectWriter;
@@ -26,10 +28,9 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.lang.reflect.ParameterizedType;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Map;
-import java.util.Set;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -42,17 +43,31 @@
private final TypeDomain typeDomain;
/** . */
- private final Map<Class<?>, Object> creationContexts;
+ private final Map<Class<?>, ObjectFactory<?>> factories;
public SerializationContext(TypeDomain typeDomain)
{
+ HashMap<Class<?>, ObjectFactory<?>> factories = new HashMap<Class<?>, ObjectFactory<?>>();
+ factories.put(Object.class, new DefaultObjectFactory());
+
+ //
this.typeDomain = typeDomain;
- this.creationContexts = new HashMap<Class<?>, Object>();
+ this.factories = factories;
}
- public void addCreationContext(Object o)
+ public <O> void addFactory(ObjectFactory<O> factory)
{
- creationContexts.put(o.getClass(), o);
+ // OK
+ Class<ObjectFactory<O>> factoryClass = (Class<ObjectFactory<O>>)factory.getClass();
+
+ //
+ ParameterizedType pt = (ParameterizedType)factoryClass.getGenericSuperclass();
+
+ // OK
+ Class<?> objectType = (Class<Object>)pt.getActualTypeArguments()[0];
+
+ //
+ factories.put(objectType, factory);
}
public TypeDomain getTypeDomain()
@@ -60,10 +75,19 @@
return typeDomain;
}
- public <C> C getContext(Class<C> contextType)
+ public <O>ObjectFactory<? super O> getFactory(Class<O> type)
{
- // This is ok
- return (C)creationContexts.get(contextType);
+ // OK
+ ObjectFactory<O> factory = (ObjectFactory<O>)factories.get(type);
+
+ //
+ if (factory == null)
+ {
+ return getFactory(type.getSuperclass());
+ }
+
+ //
+ return factory;
}
public <O> O clone(O o) throws IOException, ClassNotFoundException
Deleted: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/Factory.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/Factory.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/Factory.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.webui.application.replication.annotations;
-
-import org.exoplatform.webui.application.replication.factory.ObjectFactory;
-
-import java.lang.annotation.*;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-(a)Target(ElementType.TYPE)
-(a)Retention(RetentionPolicy.RUNTIME)
-@Inherited
-public @interface Factory
-{
-
- Class<? extends ObjectFactory<?, ?>> type();
-
-}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -23,9 +23,9 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public final class DefaultObjectFactory extends ObjectFactory<Object, Object>
+public final class DefaultObjectFactory extends ObjectFactory<Object>
{
- public <O> O create(Class<O> type, Object context) throws CreateException
+ public <O> O create(Class<O> type) throws CreateException
{
try
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -23,20 +23,18 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
* @param <B> the base object type
- * @param <C> the context type
*/
-public abstract class ObjectFactory<B, C>
+public abstract class ObjectFactory<B>
{
/**
* Instantiate an object based on the provided class.
*
* @param type the type
- * @param context the context
* @param <S> the sub type of the base type
* @return the S instance
* @throws CreateException anything wrong that could happen during instance creation
*/
- public abstract <S extends B> S create(Class<S> type, C context) throws CreateException;
+ public abstract <S extends B> S create(Class<S> type) throws CreateException;
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/ClassTypeModel.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/ClassTypeModel.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/ClassTypeModel.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -19,8 +19,6 @@
package org.exoplatform.webui.application.replication.model;
-import org.exoplatform.webui.application.replication.factory.ObjectFactory;
-
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
@@ -29,7 +27,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ClassTypeModel<O, C> extends TypeModel
+public class ClassTypeModel<O> extends TypeModel
{
/** . */
@@ -44,18 +42,10 @@
/** . */
private final Map<String, FieldModel> immutableFields;
- /** . */
- private final ObjectFactory<? super O, C> factory;
-
- /** . */
- private final Class<C> contextType;
-
ClassTypeModel(
Class<O> javaType,
TypeModel superType,
- Map<String, FieldModel> fields,
- ObjectFactory<? super O, C> factory,
- Class<C> contextType)
+ Map<String, FieldModel> fields)
{
super(javaType);
@@ -64,8 +54,6 @@
this.superType = superType;
this.fields = fields;
this.immutableFields = Collections.unmodifiableMap(fields);
- this.factory = factory;
- this.contextType = contextType;
}
public Class<O> getObjectType()
@@ -73,16 +61,6 @@
return objectType;
}
- public Class<C> getContextType()
- {
- return contextType;
- }
-
- public ObjectFactory<? super O, C> getFactory()
- {
- return factory;
- }
-
public TypeModel getSuperType()
{
return superType;
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -19,14 +19,10 @@
package org.exoplatform.webui.application.replication.model;
-import org.exoplatform.webui.application.replication.annotations.Factory;
import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
-import org.exoplatform.webui.application.replication.factory.DefaultObjectFactory;
-import org.exoplatform.webui.application.replication.factory.ObjectFactory;
import java.io.Serializable;
import java.lang.reflect.Field;
-import java.lang.reflect.ParameterizedType;
import java.util.*;
/**
@@ -126,7 +122,7 @@
return null;
}
- private <O> ClassTypeModel<O, ?> buildClassTypeModel(Class<O> javaType, Map<String, TypeModel> addedTypeModels)
+ private <O> ClassTypeModel<O> buildClassTypeModel(Class<O> javaType, Map<String, TypeModel> addedTypeModels)
{
ClassTypeModel typeModel = (ClassTypeModel) get(javaType, addedTypeModels);
if (typeModel == null)
@@ -145,38 +141,9 @@
TreeMap<String, FieldModel> fieldModels = new TreeMap<String, FieldModel>();
//
- Class<? extends ObjectFactory<?, ?>> declaredFactoryType = null;
- Factory factoryAnn = javaType.getAnnotation(Factory.class);
- if (factoryAnn != null)
- {
- declaredFactoryType = factoryAnn.type();
- }
+ typeModel = new ClassTypeModel<O>(javaType, superTypeModel, fieldModels);
//
- Class<? extends ObjectFactory<? super O, Object>> factoryType = null;
- if (declaredFactoryType != null)
- {
- if (((Class<Object>)((ParameterizedType)declaredFactoryType.getGenericSuperclass()).getActualTypeArguments()[0]).isAssignableFrom(javaType))
- {
- factoryType = (Class<ObjectFactory<? super O,Object>>)declaredFactoryType;
- }
- else
- {
- throw new TypeException();
- }
- }
-
- //
- if (factoryType != null)
- {
- typeModel = createClassType(javaType, fieldModels, superTypeModel, factoryType);
- }
- else
- {
- typeModel = createClassType(javaType, fieldModels, superTypeModel);
- }
-
- //
addedTypeModels.put(javaType.getName(), typeModel);
// Now build fields
@@ -193,34 +160,9 @@
}
// It must be good
- return (ClassTypeModel<O,?>)typeModel;
+ return (ClassTypeModel<O>)typeModel;
}
- private <O, C> ClassTypeModel<O, C> createClassType(
- Class<O> javaType,
- Map<String, FieldModel> fieldModels,
- TypeModel superTypeModel,
- Class<? extends ObjectFactory<? super O, C>> factoryType) {
- Class<C> contextType = (Class<C>)((ParameterizedType)factoryType.getGenericSuperclass()).getActualTypeArguments()[1];
- ObjectFactory<? super O, C> factory;
- try
- {
- factory = factoryType.newInstance();
- }
- catch (Exception e)
- {
- throw new TypeException();
- }
- return new ClassTypeModel<O, C>(javaType, superTypeModel, fieldModels, factory, contextType);
- }
-
- private <O> ClassTypeModel<O, Object> createClassType(
- Class<O> javaType,
- Map<String, FieldModel> fieldModels,
- TypeModel superTypeModel) {
- return new ClassTypeModel<O, Object>(javaType, superTypeModel, fieldModels, new DefaultObjectFactory(), Object.class);
- }
-
private SerializableTypeModel buildSerializable(Class<?> javaType, Map<String, TypeModel> addedTypeModels)
{
SerializableTypeModel typeModel = (SerializableTypeModel) get(javaType, addedTypeModels);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -57,17 +57,14 @@
this.idToResolutions = new HashMap<Integer, List<Resolution>>();
}
- private <O, C> O instantiate(ClassTypeModel<O, C> typeModel) throws InvalidClassException
+ private <O> O instantiate(ClassTypeModel<O> typeModel) throws InvalidClassException
{
try
{
- ObjectFactory<? super O, C> factory = typeModel.getFactory();
+ ObjectFactory<? super O> factory = context.getFactory(typeModel.getObjectType());
//
- C c = context.getContext(typeModel.getContextType());
-
- //
- return factory.create(typeModel.getObjectType(), c);
+ return factory.create(typeModel.getObjectType());
}
catch (Exception e)
{
@@ -100,7 +97,7 @@
id = container.readInt();
Class clazz = (Class) container.readObject();
- ClassTypeModel<?, ?> typeModel = (ClassTypeModel)context.getTypeDomain().getTypeModel(clazz);
+ ClassTypeModel<?> typeModel = (ClassTypeModel)context.getTypeDomain().getTypeModel(clazz);
//
Object instance = instantiate(typeModel);
@@ -109,7 +106,7 @@
idToObject.put(id, instance);
//
- ClassTypeModel<?, ?> currentTypeModel = typeModel;
+ ClassTypeModel<?> currentTypeModel = typeModel;
while (true)
{
for (FieldModel fieldModel : (currentTypeModel).getFields())
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -22,13 +22,10 @@
import org.exoplatform.webui.application.replication.SerializationContext;
import org.exoplatform.webui.application.replication.model.ClassTypeModel;
import org.exoplatform.webui.application.replication.model.FieldModel;
-import org.exoplatform.webui.application.replication.model.TypeDomain;
import org.exoplatform.webui.application.replication.model.TypeModel;
import java.io.*;
-import java.util.HashMap;
import java.util.IdentityHashMap;
-import java.util.Map;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -82,7 +79,7 @@
}
else
{
- ClassTypeModel<?, ?> typeModel = (ClassTypeModel<?, ?>)context.getTypeDomain().getTypeModel(obj.getClass());
+ ClassTypeModel<?> typeModel = (ClassTypeModel<?>)context.getTypeDomain().getTypeModel(obj.getClass());
//
if (typeModel == null)
@@ -96,7 +93,7 @@
output.writeObject(obj.getClass());
//
- ClassTypeModel<?, ?> currentTypeModel = typeModel;
+ ClassTypeModel<?> currentTypeModel = typeModel;
while (true)
{
for (FieldModel fieldModel : (currentTypeModel).getFields())
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A1.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A1.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A1.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -26,13 +26,13 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class A1 extends ObjectFactory<A2, Object>
+public class A1 extends ObjectFactory<A2>
{
static A2 instance = new A2();
@Override
- public <E extends A2> E create(Class<E> type, Object context) throws CreateException
+ public <E extends A2> E create(Class<E> type) throws CreateException
{
if (type == A2.class)
{
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A2.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A2.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/A2.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -19,7 +19,6 @@
package org.exoplatform.webui.replication.factory;
-import org.exoplatform.webui.application.replication.annotations.Factory;
import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
/**
@@ -27,7 +26,6 @@
* @version $Revision$
*/
@ReplicatedType
-@Factory(type = A1.class)
public class A2
{
}
\ No newline at end of file
Deleted: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C1.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C1.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C1.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.webui.replication.factory;
-
-import junit.framework.AssertionFailedError;
-import org.exoplatform.webui.application.replication.factory.CreateException;
-import org.exoplatform.webui.application.replication.factory.ObjectFactory;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class C1 extends ObjectFactory<String, Object>
-{
-
- @Override
- public <E extends String> E create(Class<E> type, Object context) throws CreateException
- {
- throw new AssertionFailedError();
- }
-}
\ No newline at end of file
Deleted: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C2.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C2.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C2.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.webui.replication.factory;
-
-import org.exoplatform.webui.application.replication.annotations.Factory;
-import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@ReplicatedType
-@Factory(type = C1.class)
-public class C2
-{
-}
\ No newline at end of file
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/TestObjectFactory.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/TestObjectFactory.java 2010-01-14 15:28:54 UTC (rev 1296)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/TestObjectFactory.java 2010-01-14 15:35:44 UTC (rev 1297)
@@ -38,6 +38,7 @@
TypeDomain domain = new TypeDomain();
domain.add(A2.class);
SerializationContext context = new SerializationContext(domain);
+ context.addFactory(new A1());
A2 a2 = new A2();
assertSame(A1.instance, context.clone(a2));
}
@@ -57,23 +58,4 @@
{
}
}
-
- public void testFactoryClassNotAssignable() throws Exception
- {
- TypeDomain domain = new TypeDomain();
- try
- {
- domain.add(C2.class);
- fail();
- }
- catch (TypeException e)
- {
- }
- }
-
- public void testCreationContext() throws Exception
- {
- TypeDomain domain = new TypeDomain();
- }
-
}
14 years, 11 months
gatein SVN: r1296 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component.
by do-not-reply@jboss.org
Author: wesleyhales
Date: 2010-01-14 10:28:54 -0500 (Thu, 14 Jan 2010)
New Revision: 1296
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
Log:
fix truncated wsrp error
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2010-01-14 15:09:30 UTC (rev 1295)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2010-01-14 15:28:54 UTC (rev 1296)
@@ -344,7 +344,7 @@
}
catch (Exception e)
{
- uiApp.addMessage(new ApplicationMessage("UIWsrp.consumer.grid.action.refresh.fail" + e.getCause(), null, ApplicationMessage.ERROR));
+ uiApp.addMessage(new ApplicationMessage("UIWsrp.consumer.grid.action.refresh.fail", new String[]{e.getCause().toString()}, ApplicationMessage.ERROR));
e.printStackTrace();
}
}
14 years, 11 months
gatein SVN: r1295 - in portal/trunk/webui/core/src: main/java/org/exoplatform/webui/application/replication/factory and 3 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-14 10:09:30 -0500 (Thu, 14 Jan 2010)
New Revision: 1295
Added:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/SerializationContext.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/B.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C1.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C2.java
Removed:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicationContext.java
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/TestObjectFactory.java
Log:
add unit test
Deleted: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicationContext.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicationContext.java 2010-01-14 13:53:24 UTC (rev 1294)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicationContext.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.webui.application.replication;
-
-import org.exoplatform.webui.application.replication.model.TypeDomain;
-import org.exoplatform.webui.application.replication.serial.ObjectReader;
-import org.exoplatform.webui.application.replication.serial.ObjectWriter;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class ReplicationContext
-{
-
- /** . */
- private final TypeDomain typeDomain;
-
- /** . */
- private final Set<Object> creationContexts;
-
- public ReplicationContext(TypeDomain typeDomain)
- {
- this.typeDomain = typeDomain;
- this.creationContexts = new HashSet<Object>();
- }
-
- public void addCreationContext(Object o)
- {
- creationContexts.add(o);
- }
-
- public <O> O clone(O o) throws IOException, ClassNotFoundException
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectWriter writer = new ObjectWriter(typeDomain, baos);
- writer.writeObject(o);
- writer.close();
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectReader in = new ObjectReader(typeDomain, bais);
- return (O)in.readObject();
- }
-}
Copied: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/SerializationContext.java (from rev 1292, portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicationContext.java)
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/SerializationContext.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/SerializationContext.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.webui.application.replication;
+
+import org.exoplatform.webui.application.replication.model.TypeDomain;
+import org.exoplatform.webui.application.replication.serial.ObjectReader;
+import org.exoplatform.webui.application.replication.serial.ObjectWriter;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class SerializationContext
+{
+
+ /** . */
+ private final TypeDomain typeDomain;
+
+ /** . */
+ private final Map<Class<?>, Object> creationContexts;
+
+ public SerializationContext(TypeDomain typeDomain)
+ {
+ this.typeDomain = typeDomain;
+ this.creationContexts = new HashMap<Class<?>, Object>();
+ }
+
+ public void addCreationContext(Object o)
+ {
+ creationContexts.put(o.getClass(), o);
+ }
+
+ public TypeDomain getTypeDomain()
+ {
+ return typeDomain;
+ }
+
+ public <C> C getContext(Class<C> contextType)
+ {
+ // This is ok
+ return (C)creationContexts.get(contextType);
+ }
+
+ public <O> O clone(O o) throws IOException, ClassNotFoundException
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectWriter writer = new ObjectWriter(this, baos);
+ writer.writeObject(o);
+ writer.close();
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectReader in = new ObjectReader(this, bais);
+ return (O)in.readObject();
+ }
+}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java 2010-01-14 13:53:24 UTC (rev 1294)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/DefaultObjectFactory.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -23,9 +23,9 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class DefaultObjectFactory extends ObjectFactory<Object, Object>
+public final class DefaultObjectFactory extends ObjectFactory<Object, Object>
{
- public <E> E create(Class<E> type, Object context) throws CreateException
+ public <O> O create(Class<O> type, Object context) throws CreateException
{
try
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java 2010-01-14 13:53:24 UTC (rev 1294)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/factory/ObjectFactory.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -22,10 +22,21 @@
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
+ * @param <B> the base object type
+ * @param <C> the context type
*/
-public abstract class ObjectFactory<O, C>
+public abstract class ObjectFactory<B, C>
{
- public abstract <E extends O> E create(Class<E> type, C context) throws CreateException;
+ /**
+ * Instantiate an object based on the provided class.
+ *
+ * @param type the type
+ * @param context the context
+ * @param <S> the sub type of the base type
+ * @return the S instance
+ * @throws CreateException anything wrong that could happen during instance creation
+ */
+ public abstract <S extends B> S create(Class<S> type, C context) throws CreateException;
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java 2010-01-14 13:53:24 UTC (rev 1294)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectReader.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -19,9 +19,10 @@
package org.exoplatform.webui.application.replication.serial;
+import org.exoplatform.webui.application.replication.SerializationContext;
+import org.exoplatform.webui.application.replication.factory.ObjectFactory;
import org.exoplatform.webui.application.replication.model.ClassTypeModel;
import org.exoplatform.webui.application.replication.model.FieldModel;
-import org.exoplatform.webui.application.replication.model.TypeDomain;
import org.exoplatform.webui.application.replication.model.TypeModel;
import java.io.*;
@@ -35,7 +36,7 @@
{
/** . */
- private final TypeDomain domain;
+ private final SerializationContext context;
/** . */
private final Map<Integer, Object> idToObject;
@@ -43,7 +44,7 @@
/** . */
private final Map<Integer, List<Resolution>> idToResolutions;
- public ObjectReader(TypeDomain domain, InputStream in) throws IOException
+ public ObjectReader(SerializationContext context, InputStream in) throws IOException
{
super(in);
@@ -51,11 +52,31 @@
enableResolveObject(true);
//
- this.domain = domain;
+ this.context = context;
this.idToObject = new HashMap<Integer, Object>();
this.idToResolutions = new HashMap<Integer, List<Resolution>>();
}
+ private <O, C> O instantiate(ClassTypeModel<O, C> typeModel) throws InvalidClassException
+ {
+ try
+ {
+ ObjectFactory<? super O, C> factory = typeModel.getFactory();
+
+ //
+ C c = context.getContext(typeModel.getContextType());
+
+ //
+ return factory.create(typeModel.getObjectType(), c);
+ }
+ catch (Exception e)
+ {
+ InvalidClassException ice = new InvalidClassException("Cannot instantiate object from class " + typeModel.getObjectType().getName());
+ ice.initCause(e);
+ throw ice;
+ }
+ }
+
@Override
protected Object resolveObject(Object obj) throws IOException
{
@@ -79,20 +100,10 @@
id = container.readInt();
Class clazz = (Class) container.readObject();
- ClassTypeModel<?, ?> typeModel = (ClassTypeModel) domain.getTypeModel(clazz);
+ ClassTypeModel<?, ?> typeModel = (ClassTypeModel)context.getTypeDomain().getTypeModel(clazz);
//
- Object instance;
- try
- {
- instance = typeModel.getFactory().create(clazz, null);
- }
- catch (Exception e)
- {
- InvalidClassException ice = new InvalidClassException("Cannot instantiate object from class " + clazz.getName());
- ice.initCause(e);
- throw ice;
- }
+ Object instance = instantiate(typeModel);
//
idToObject.put(id, instance);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java 2010-01-14 13:53:24 UTC (rev 1294)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.application.replication.serial;
+import org.exoplatform.webui.application.replication.SerializationContext;
import org.exoplatform.webui.application.replication.model.ClassTypeModel;
import org.exoplatform.webui.application.replication.model.FieldModel;
import org.exoplatform.webui.application.replication.model.TypeDomain;
@@ -37,12 +38,12 @@
{
/** . */
- private final TypeDomain domain;
+ private final SerializationContext context;
/** . */
private final IdentityHashMap<Object, Integer> objectToId;
- public ObjectWriter(TypeDomain domain, OutputStream out) throws IOException
+ public ObjectWriter(SerializationContext context, OutputStream out) throws IOException
{
super(out);
@@ -50,7 +51,7 @@
enableReplaceObject(true);
//
- this.domain = domain;
+ this.context = context;
this.objectToId = new IdentityHashMap<Object, Integer>();
}
@@ -81,7 +82,7 @@
}
else
{
- ClassTypeModel<?, ?> typeModel = (ClassTypeModel<?, ?>)domain.getTypeModel(obj.getClass());
+ ClassTypeModel<?, ?> typeModel = (ClassTypeModel<?, ?>)context.getTypeDomain().getTypeModel(obj.getClass());
//
if (typeModel == null)
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java 2010-01-14 13:53:24 UTC (rev 1294)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -20,12 +20,9 @@
package org.exoplatform.webui.replication;
import junit.framework.TestCase;
+import org.exoplatform.webui.application.replication.SerializationContext;
import org.exoplatform.webui.application.replication.model.TypeDomain;
-import org.exoplatform.webui.application.replication.serial.ObjectReader;
-import org.exoplatform.webui.application.replication.serial.ObjectWriter;
-import java.io.*;
-
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -41,13 +38,8 @@
a.a = "foo";
a.b = 2;
a.c = true;
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectWriter writer = new ObjectWriter(domain, baos);
- writer.writeObject(a);
- writer.close();
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectReader in = new ObjectReader(domain, bais);
- a = (A)in.readObject();
+ SerializationContext context = new SerializationContext(domain);
+ a = context.clone(a);
assertEquals("foo", a.a);
assertEquals(2, a.b);
assertEquals(true, a.c);
@@ -59,12 +51,8 @@
domain.add(B.class);
B b = new B();
b.ref = new B(b);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectWriter writer = new ObjectWriter(domain, baos);
- writer.writeObject(b);
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectReader in = new ObjectReader(domain, bais);
- b = (B)in.readObject();
+ SerializationContext context = new SerializationContext(domain);
+ b = context.clone(b);
assertNotNull(b.ref);
assertSame(b, b.ref.ref);
}
@@ -80,18 +68,9 @@
e.right = new E();
e.right.left = e.left.left;
e.right.right = e.left.right;
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectWriter writer = new ObjectWriter(domain, baos);
- writer.writeObject(e);
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectReader in = new ObjectReader(domain, bais);
- e = (E)in.readObject();
+ SerializationContext context = new SerializationContext(domain);
+ e = context.clone(e);
assertSame(e.left.left, e.right.left);
assertSame(e.left.right, e.right.right);
}
-
- public void testCustomFactory() throws Exception
- {
-
- }
}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/B.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/B.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/B.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.webui.replication.factory;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class B
+{
+ public B()
+ {
+ this(true);
+ }
+
+ public B(boolean fail)
+ {
+ if (fail)
+ {
+ throw new RuntimeException();
+ }
+ }
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C1.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C1.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C1.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.webui.replication.factory;
+
+import junit.framework.AssertionFailedError;
+import org.exoplatform.webui.application.replication.factory.CreateException;
+import org.exoplatform.webui.application.replication.factory.ObjectFactory;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class C1 extends ObjectFactory<String, Object>
+{
+
+ @Override
+ public <E extends String> E create(Class<E> type, Object context) throws CreateException
+ {
+ throw new AssertionFailedError();
+ }
+}
\ No newline at end of file
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C2.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C2.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/C2.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.webui.replication.factory;
+
+import org.exoplatform.webui.application.replication.annotations.Factory;
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+@Factory(type = C1.class)
+public class C2
+{
+}
\ No newline at end of file
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/TestObjectFactory.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/TestObjectFactory.java 2010-01-14 13:53:24 UTC (rev 1294)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/factory/TestObjectFactory.java 2010-01-14 15:09:30 UTC (rev 1295)
@@ -20,9 +20,12 @@
package org.exoplatform.webui.replication.factory;
import junit.framework.TestCase;
-import org.exoplatform.webui.application.replication.ReplicationContext;
+import org.exoplatform.webui.application.replication.SerializationContext;
import org.exoplatform.webui.application.replication.model.TypeDomain;
+import org.exoplatform.webui.application.replication.model.TypeException;
+import java.io.InvalidClassException;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -34,8 +37,43 @@
{
TypeDomain domain = new TypeDomain();
domain.add(A2.class);
- ReplicationContext context = new ReplicationContext(domain);
+ SerializationContext context = new SerializationContext(domain);
A2 a2 = new A2();
assertSame(A1.instance, context.clone(a2));
}
+
+ public void testFactoryThrowsException() throws Exception
+ {
+ TypeDomain domain = new TypeDomain();
+ domain.add(B.class);
+ SerializationContext context = new SerializationContext(domain);
+ B b = new B(false);
+ try
+ {
+ context.clone(b);
+ fail();
+ }
+ catch (InvalidClassException e)
+ {
+ }
+ }
+
+ public void testFactoryClassNotAssignable() throws Exception
+ {
+ TypeDomain domain = new TypeDomain();
+ try
+ {
+ domain.add(C2.class);
+ fail();
+ }
+ catch (TypeException e)
+ {
+ }
+ }
+
+ public void testCreationContext() throws Exception
+ {
+ TypeDomain domain = new TypeDomain();
+ }
+
}
14 years, 11 months
gatein SVN: r1294 - in portal/trunk/examples: portal/war/src/main/webapp/login/jsp and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-14 08:53:24 -0500 (Thu, 14 Jan 2010)
New Revision: 1294
Modified:
portal/trunk/examples/extension/war/src/main/webapp/login/jsp/login.jsp
portal/trunk/examples/portal/war/src/main/webapp/login/jsp/login.jsp
Log:
Text was too long to fit in the window
Modified: portal/trunk/examples/extension/war/src/main/webapp/login/jsp/login.jsp
===================================================================
--- portal/trunk/examples/extension/war/src/main/webapp/login/jsp/login.jsp 2010-01-14 13:44:07 UTC (rev 1293)
+++ portal/trunk/examples/extension/war/src/main/webapp/login/jsp/login.jsp 2010-01-14 13:53:24 UTC (rev 1294)
@@ -60,7 +60,7 @@
<div class="UILogin">
<div class="LoginHeader">Sign In</div>
<div class="LoginContent">
- <div class="WelcomeText">Welcome to eXo Portal from "sample-ext"</div>
+ <div class="WelcomeText">Welcome to GateIn Portal</div>
<div class="CenterLoginContent">
<%/*Begin form*/%>
<%
@@ -109,4 +109,4 @@
</div>
<span style="margin: 10px 0px 0px 5px; font-size: 11px; color: #6f6f6f; text-align: center">Copyright © 2009. All rights Reserved, eXo Platform SAS and Red Hat, Inc.</span>
</body>
-</html>
\ No newline at end of file
+</html>
Modified: portal/trunk/examples/portal/war/src/main/webapp/login/jsp/login.jsp
===================================================================
--- portal/trunk/examples/portal/war/src/main/webapp/login/jsp/login.jsp 2010-01-14 13:44:07 UTC (rev 1293)
+++ portal/trunk/examples/portal/war/src/main/webapp/login/jsp/login.jsp 2010-01-14 13:53:24 UTC (rev 1294)
@@ -60,7 +60,7 @@
<div class="UILogin">
<div class="LoginHeader">Sign In</div>
<div class="LoginContent">
- <div class="WelcomeText">Welcome to eXo Portal from "sample-portal"</div>
+ <div class="WelcomeText">Welcome to GateIn Portal</div>
<div class="CenterLoginContent">
<%/*Begin form*/%>
<%
@@ -109,4 +109,4 @@
</div>
<span style="margin: 10px 0px 0px 5px; font-size: 11px; color: #6f6f6f; text-align: center">Copyright © 2009. All rights Reserved, eXo Platform SAS and Red Hat, Inc.</span>
</body>
-</html>
\ No newline at end of file
+</html>
14 years, 11 months
gatein SVN: r1293 - portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-14 08:44:07 -0500 (Thu, 14 Jan 2010)
New Revision: 1293
Added:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/Factory.java
Log:
and forgot also that one
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/Factory.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/Factory.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/Factory.java 2010-01-14 13:44:07 UTC (rev 1293)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.webui.application.replication.annotations;
+
+import org.exoplatform.webui.application.replication.factory.ObjectFactory;
+
+import java.lang.annotation.*;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+@Inherited
+public @interface Factory
+{
+
+ Class<? extends ObjectFactory<?, ?>> type();
+
+}
14 years, 11 months