Merged V3.0 to HEAD

12795: ALFCOM-2419: ResourceBundleWrapper is no longer (de)serializable after changes merged from 2.1-A rev 8323
   12826: Fix for ETHREEOH-37 and ETHREEOH-176.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12828 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2009-01-16 14:20:15 +00:00
parent 10a62367d6
commit f70b674593
9 changed files with 173 additions and 137 deletions

View File

@@ -44,6 +44,8 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.Path;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.alfresco.service.namespace.NamespacePrefixResolverProvider;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.web.app.Application;
@@ -53,9 +55,9 @@ import org.alfresco.web.app.Application;
*
* @author gavinc
*/
public class Node implements Serializable
public class Node implements Serializable, NamespacePrefixResolverProvider
{
private static final long serialVersionUID = 3544390322739034169L;
private static final long serialVersionUID = 3544390322739034170L;
protected NodeRef nodeRef;
protected String name;
@@ -94,7 +96,7 @@ public class Node implements Serializable
this.nodeRef = nodeRef;
this.id = nodeRef.getId();
this.properties = new QNameNodeMap<String, Object>(getServiceRegistry().getNamespaceService(), this);
this.properties = new QNameNodeMap<String, Object>(this, this);
}
/**
@@ -134,7 +136,7 @@ public class Node implements Serializable
{
if (this.assocsRetrieved == false)
{
this.associations = new QNameNodeMap(getServiceRegistry().getNamespaceService(), this);
this.associations = new QNameNodeMap(this, this);
List<AssociationRef> assocs = getServiceRegistry().getNodeService().getTargetAssocs(this.nodeRef, RegexQNamePattern.MATCH_ALL);
@@ -196,7 +198,7 @@ public class Node implements Serializable
{
if (this.childAssocsRetrieved == false)
{
this.childAssociations = new QNameNodeMap(getServiceRegistry().getNamespaceService(), this);
this.childAssociations = new QNameNodeMap(this, this);
List<ChildAssociationRef> assocs = getServiceRegistry().getNodeService().getChildAssocs(this.nodeRef);
@@ -519,4 +521,9 @@ public class Node implements Serializable
}
return this.services;
}
public NamespacePrefixResolver getNamespacePrefixResolver()
{
return getServiceRegistry().getNamespaceService();
}
}

View File

@@ -28,7 +28,7 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.alfresco.service.namespace.NamespacePrefixResolverProvider;
import org.alfresco.service.namespace.QNameMap;
/**
@@ -38,19 +38,20 @@ import org.alfresco.service.namespace.QNameMap;
*/
public final class QNameNodeMap<K, V> extends QNameMap implements Map, Cloneable, Serializable
{
private static final long serialVersionUID = -1760755862411509263L;
private static final long serialVersionUID = -1760755862411509262L;
private Node parent = null;
private Map<String, NodePropertyResolver> resolvers = new HashMap<String, NodePropertyResolver>(8, 1.0f);
/**
* Constructor
*
* @param parent Parent Node of the QNameNodeMap
*/
public QNameNodeMap(NamespacePrefixResolver resolver, Node parent)
public QNameNodeMap(NamespacePrefixResolverProvider provider, Node parent)
{
super(resolver);
super(provider);
if (parent == null)
{
throw new IllegalArgumentException("Parent Node cannot be null!");
@@ -58,9 +59,8 @@ public final class QNameNodeMap<K, V> extends QNameMap implements Map, Cloneable
this.parent = parent;
}
/**
*
* Serialization constructor
*/
protected QNameNodeMap()
{
@@ -141,7 +141,7 @@ public final class QNameNodeMap<K, V> extends QNameMap implements Map, Cloneable
@SuppressWarnings("unchecked")
public Object clone()
{
QNameNodeMap map = new QNameNodeMap(this.resolver, this.parent);
QNameNodeMap map = new QNameNodeMap(this.provider, this.parent);
map.putAll(this);
if (this.resolvers.size() != 0)
{

View File

@@ -166,8 +166,8 @@ public class TransientNode extends Node
DictionaryService ddService = this.getServiceRegistry().getDictionaryService();
// marshall the given properties and associations into the internal maps
this.associations = new QNameNodeMap(getServiceRegistry().getNamespaceService(), this);
this.childAssociations = new QNameNodeMap(getServiceRegistry().getNamespaceService(), this);
this.associations = new QNameNodeMap(this, this);
this.childAssociations = new QNameNodeMap(this, this);
if (data != null)
{