mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merge of all UI clustering changes originally applied to 2.2
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8292 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -42,6 +42,8 @@ import org.alfresco.service.namespace.NamespaceService;
|
||||
*/
|
||||
public class JCRNamespacePrefixResolver implements NamespaceService
|
||||
{
|
||||
private static final long serialVersionUID = -2451839324143403283L;
|
||||
|
||||
// delegate
|
||||
private NamespacePrefixResolver delegate;
|
||||
|
||||
|
@@ -72,6 +72,21 @@ public class Issuer
|
||||
* After the database is up, get our value.
|
||||
*/
|
||||
public void initialize()
|
||||
{
|
||||
getNextId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Issue the next number.
|
||||
* @return A serial number.
|
||||
*/
|
||||
public synchronized long issue()
|
||||
{
|
||||
|
||||
return getNextId();
|
||||
}
|
||||
|
||||
private long getNextId()
|
||||
{
|
||||
class TxnWork implements RetryingTransactionCallback<Long>
|
||||
{
|
||||
@@ -89,14 +104,6 @@ public class Issuer
|
||||
{
|
||||
fNext = result + 1L;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Issue the next number.
|
||||
* @return A serial number.
|
||||
*/
|
||||
public synchronized long issue()
|
||||
{
|
||||
return fNext++;
|
||||
return fNext;
|
||||
}
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@ import org.alfresco.service.namespace.NamespaceService;
|
||||
public class DictionaryNamespaceComponent implements NamespaceService
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -3774701459465102431L;
|
||||
/**
|
||||
* Namespace DAO
|
||||
*/
|
||||
|
@@ -48,6 +48,8 @@ public class NamespaceDAOImpl implements NamespaceDAO
|
||||
{
|
||||
private static final Log logger = LogFactory.getLog(NamespaceDAOImpl.class);
|
||||
|
||||
private static final long serialVersionUID = -1085431310721591548L;
|
||||
|
||||
/**
|
||||
* Lock objects
|
||||
*/
|
||||
|
@@ -39,6 +39,7 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.cmr.repository.datatype.TypeConversionException;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -60,9 +61,9 @@ public class NodeRefPropertyMethodInterceptor implements MethodInterceptor
|
||||
|
||||
private boolean filterOnSet = true;
|
||||
|
||||
private DictionaryService dictionaryService;
|
||||
transient private DictionaryService dictionaryService;
|
||||
|
||||
private NodeService nodeService;
|
||||
transient private NodeService nodeService;
|
||||
|
||||
public boolean isFilterOnGet()
|
||||
{
|
||||
@@ -89,11 +90,29 @@ public class NodeRefPropertyMethodInterceptor implements MethodInterceptor
|
||||
this.dictionaryService = dictionaryService;
|
||||
}
|
||||
|
||||
private DictionaryService getDictionaryService()
|
||||
{
|
||||
if (dictionaryService == null)
|
||||
{
|
||||
dictionaryService = (DictionaryService) ApplicationContextHelper.getApplicationContext().getBean("dictionaryService");
|
||||
}
|
||||
return dictionaryService;
|
||||
}
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
private NodeService getNodeService()
|
||||
{
|
||||
if (nodeService == null)
|
||||
{
|
||||
nodeService = (NodeService) ApplicationContextHelper.getApplicationContext().getBean("mlAwareNodeService");
|
||||
}
|
||||
return nodeService;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object invoke(MethodInvocation invocation) throws Throwable
|
||||
{
|
||||
@@ -278,7 +297,7 @@ public class NodeRefPropertyMethodInterceptor implements MethodInterceptor
|
||||
*/
|
||||
private Serializable getValue(QName propertyQName, Serializable inboundValue)
|
||||
{
|
||||
PropertyDefinition propertyDef = this.dictionaryService.getProperty(propertyQName);
|
||||
PropertyDefinition propertyDef = this.getDictionaryService().getProperty(propertyQName);
|
||||
if (propertyDef == null)
|
||||
{
|
||||
return inboundValue;
|
||||
@@ -303,12 +322,12 @@ public class NodeRefPropertyMethodInterceptor implements MethodInterceptor
|
||||
try
|
||||
{
|
||||
NodeRef test = DefaultTypeConverter.INSTANCE.convert(NodeRef.class, value);
|
||||
if (nodeService.exists(test))
|
||||
if (getNodeService().exists(test))
|
||||
{
|
||||
if (propertyDef.getDataType().getName().equals(DataTypeDefinition.CATEGORY))
|
||||
{
|
||||
QName type = nodeService.getType(test);
|
||||
if (dictionaryService.isSubClass(type, ContentModel.TYPE_CATEGORY))
|
||||
QName type = getNodeService().getType(test);
|
||||
if (getDictionaryService().isSubClass(type, ContentModel.TYPE_CATEGORY))
|
||||
{
|
||||
out.add(test);
|
||||
}
|
||||
@@ -338,12 +357,12 @@ public class NodeRefPropertyMethodInterceptor implements MethodInterceptor
|
||||
try
|
||||
{
|
||||
NodeRef test = DefaultTypeConverter.INSTANCE.convert(NodeRef.class, inboundValue);
|
||||
if (nodeService.exists(test))
|
||||
if (getNodeService().exists(test))
|
||||
{
|
||||
if (propertyDef.getDataType().getName().equals(DataTypeDefinition.CATEGORY))
|
||||
{
|
||||
QName type = nodeService.getType(test);
|
||||
if (dictionaryService.isSubClass(type, ContentModel.TYPE_CATEGORY))
|
||||
QName type = getNodeService().getType(test);
|
||||
if (getDictionaryService().isSubClass(type, ContentModel.TYPE_CATEGORY))
|
||||
{
|
||||
return test;
|
||||
}
|
||||
|
@@ -24,6 +24,8 @@
|
||||
*/
|
||||
package org.alfresco.service.cmr.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Interface contract for the conversion of file name to a fully qualified icon image path for use by
|
||||
* templating and scripting engines executing within the repository context.
|
||||
@@ -33,7 +35,7 @@ package org.alfresco.service.cmr.repository;
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public interface TemplateImageResolver
|
||||
public interface TemplateImageResolver extends Serializable
|
||||
{
|
||||
/**
|
||||
* Resolve the qualified icon image path for the specified filename
|
||||
|
@@ -24,21 +24,25 @@
|
||||
*/
|
||||
package org.alfresco.service.cmr.workflow;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* Workflow Definition Data Object
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class WorkflowDefinition
|
||||
public class WorkflowDefinition implements Serializable
|
||||
{
|
||||
//XXarielb these should most likely all be private
|
||||
private static final long serialVersionUID = -4320345925926816927L;
|
||||
//XXarielb these should most likely all be private
|
||||
public final String id;
|
||||
public final String name;
|
||||
public final String version;
|
||||
public final String title;
|
||||
public final String description;
|
||||
public final WorkflowTaskDefinition startTaskDefinition;
|
||||
|
||||
transient private final WorkflowTaskDefinition startTaskDefinition;
|
||||
|
||||
public WorkflowDefinition(final String id,
|
||||
final String name,
|
||||
@@ -97,6 +101,6 @@ public class WorkflowDefinition
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
return "WorkflowDefinition[id=" + id + ",name=" + name + ",version=" + version + ",title=" + title + ",startTask=" + ((startTaskDefinition == null) ? "undefined" : startTaskDefinition.toString()) + "]";
|
||||
return "WorkflowDefinition[id=" + id + ",name=" + name + ",version=" + version + ",title=" + title + ",startTask=" + ((getStartTaskDefinition() == null) ? "undefined" : getStartTaskDefinition().toString()) + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package org.alfresco.service.cmr.workflow;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -36,8 +37,10 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class WorkflowInstance
|
||||
public class WorkflowInstance implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 4221926809419223452L;
|
||||
|
||||
/** Workflow Instance unique id */
|
||||
public String id;
|
||||
|
||||
|
@@ -41,6 +41,8 @@ import java.util.Set;
|
||||
public class DynamicNamespacePrefixResolver implements NamespaceService
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -7721089444629137409L;
|
||||
|
||||
/**
|
||||
* The delegate
|
||||
*/
|
||||
|
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package org.alfresco.service.namespace;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.alfresco.service.Auditable;
|
||||
@@ -36,7 +37,7 @@ import org.alfresco.service.PublicService;
|
||||
* @author David Caruana
|
||||
*/
|
||||
@PublicService
|
||||
public interface NamespacePrefixResolver
|
||||
public interface NamespacePrefixResolver extends Serializable
|
||||
{
|
||||
/**
|
||||
* Gets the namespace URI registered for the given prefix
|
||||
|
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package org.alfresco.service.namespace;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -40,8 +41,10 @@ import org.apache.commons.logging.LogFactory;
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class QNameMap<K,V> implements Map, Cloneable
|
||||
public class QNameMap<K,V> implements Map, Cloneable, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 2077228225832792605L;
|
||||
|
||||
protected static Log logger = LogFactory.getLog(QNameMap.class);
|
||||
protected Map<String, Object> contents = new HashMap<String, Object>(16, 1.0f);
|
||||
protected NamespacePrefixResolver resolver = null;
|
||||
@@ -60,6 +63,19 @@ public class QNameMap<K,V> implements Map, Cloneable
|
||||
this.resolver = resolver;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for Serialization mechanism
|
||||
*
|
||||
*/
|
||||
protected QNameMap()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see java.util.Map#size()
|
||||
*/
|
||||
|
Reference in New Issue
Block a user