diff --git a/config/alfresco/authentication-services-context.xml b/config/alfresco/authentication-services-context.xml
index 00dedab58f..6a6f35832b 100644
--- a/config/alfresco/authentication-services-context.xml
+++ b/config/alfresco/authentication-services-context.xml
@@ -523,13 +523,13 @@
-
+
- PT1H
+ ${authentication.ticket.validDuration}
- false
+ ${authentication.ticket.ticketsExpire}
@@ -539,7 +539,7 @@
- AFTER_FIXED_TIME
+ ${authentication.ticket.expiryMode}
diff --git a/config/alfresco/cache-context.xml b/config/alfresco/cache-context.xml
index 151488b4cd..84a316b756 100644
--- a/config/alfresco/cache-context.xml
+++ b/config/alfresco/cache-context.xml
@@ -473,7 +473,7 @@
-
+
@@ -485,22 +485,7 @@
-
-
-
-
-
-
-
-
- org.alfresco.ticketsTransactionalCache
-
-
- 10
-
-
-
-
+
diff --git a/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.1.sql b/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.1.sql
index 4847ab773a..d3500a2480 100644
--- a/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.1.sql
+++ b/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.1.sql
@@ -282,6 +282,7 @@ INSERT INTO t_summary_nstat (node_id, transaction_id)
SELECT node_id, transaction_id FROM alf_node_status WHERE node_id IS NOT NULL;
-- Copy data over
+--BEGIN TXN
LOCK TABLES
t_alf_node WRITE,
alf_node AS n READ,
@@ -303,6 +304,7 @@ INSERT INTO t_alf_node
JOIN t_summary_nstat nstat ON (nstat.node_id = n.id)
JOIN t_alf_store s ON (s.protocol = n.protocol AND s.identifier = n.identifier)
;
+--END TXN
UNLOCK TABLES;
DROP TABLE t_summary_nstat;
@@ -371,6 +373,7 @@ CREATE TABLE t_alf_child_assoc
UNIQUE (parent_node_id, type_qname_id, child_node_name_crc, child_node_name)
) TYPE=InnoDB;
+--BEGIN TXN
LOCK TABLES
t_alf_child_assoc WRITE,
alf_child_assoc AS ca READ,
@@ -400,6 +403,7 @@ INSERT INTO t_alf_child_assoc
JOIN t_qnames_dyn tqndyn ON (ca.qname = tqndyn.qname)
JOIN t_qnames tqn ON (ca.type_qname = tqn.qname)
;
+--END TXN
UNLOCK TABLES;
-- Clean up
@@ -428,6 +432,7 @@ CREATE TABLE t_alf_node_assoc
UNIQUE (source_node_id, target_node_id, type_qname_id)
) TYPE=InnoDB;
+--BEGIN TXN
LOCK TABLES
t_alf_node_assoc WRITE,
alf_node_assoc AS na READ,
@@ -447,6 +452,7 @@ INSERT INTO t_alf_node_assoc
alf_node_assoc na
JOIN t_qnames tqn ON (na.type_qname = tqn.qname)
;
+--END TXN
UNLOCK TABLES;
-- Clean up
@@ -501,6 +507,7 @@ CREATE TABLE t_alf_node_aspects
PRIMARY KEY (node_id, qname_id)
) TYPE=InnoDB;
+--BEGIN TXN
LOCK TABLES
t_alf_node_aspects WRITE,
alf_node_aspects AS na READ,
@@ -520,6 +527,7 @@ INSERT INTO t_alf_node_aspects
WHERE
tqn.qname != '{http://www.alfresco.org/model/system/1.0}referenceable'
;
+--END TXN
UNLOCK TABLES;
-- Clean up
@@ -761,6 +769,7 @@ CREATE TABLE t_alf_node_properties
PRIMARY KEY (node_id, qname_id, list_index, locale_id)
) TYPE=InnoDB;
+--BEGIN TXN
-- Copy values over
LOCK TABLES
t_alf_node_properties WRITE,
@@ -791,7 +800,9 @@ INSERT INTO t_alf_node_properties
WHERE
np.attribute_value IS NULL
;
+--END TXN
UNLOCK TABLES;
+
-- Update cm:auditable properties on the nodes
UPDATE t_alf_node n SET audit_creator =
(
diff --git a/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.2SP1.sql b/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.2SP1.sql
index a63d66afcb..5f02e50b1e 100644
--- a/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.2SP1.sql
+++ b/config/alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.2SP1.sql
@@ -73,6 +73,7 @@ CREATE TABLE t_summary_nstat
INSERT INTO t_summary_nstat (node_id, transaction_id)
SELECT node_id, transaction_id FROM alf_node_status WHERE node_id IS NOT NULL;
+--BEGIN TXN
-- Copy data over
LOCK TABLES
t_alf_node WRITE,
@@ -93,6 +94,7 @@ INSERT INTO t_alf_node
JOIN t_summary_nstat nstat ON (nstat.node_id = n.id)
JOIN t_alf_store s ON (s.protocol = n.protocol AND s.identifier = n.identifier)
;
+--END TXN
UNLOCK TABLES;
DROP TABLE t_summary_nstat;
@@ -161,6 +163,7 @@ CREATE TABLE t_alf_child_assoc
UNIQUE (parent_node_id, type_qname_id, child_node_name_crc, child_node_name)
) TYPE=InnoDB;
+--BEGIN TXN
LOCK TABLES
t_alf_child_assoc WRITE,
alf_child_assoc AS ca READ
@@ -186,6 +189,7 @@ INSERT INTO t_alf_child_assoc
FROM
alf_child_assoc ca
;
+--END TXN
UNLOCK TABLES;
-- Clean up
@@ -213,6 +217,7 @@ CREATE TABLE t_alf_node_assoc
UNIQUE (source_node_id, target_node_id, type_qname_id)
) TYPE=InnoDB;
+--BEGIN TXN
LOCK TABLES
t_alf_node_assoc WRITE,
alf_node_assoc AS na READ
@@ -230,6 +235,7 @@ INSERT INTO t_alf_node_assoc
FROM
alf_node_assoc na
;
+--END TXN
UNLOCK TABLES;
-- Clean up
@@ -284,6 +290,7 @@ CREATE TABLE t_alf_node_aspects
PRIMARY KEY (node_id, qname_id)
) TYPE=InnoDB;
+--BEGIN TXN
LOCK TABLES
t_alf_node_aspects WRITE,
alf_node_aspects AS na READ,
@@ -306,6 +313,7 @@ INSERT INTO t_alf_node_aspects
ns.uri != 'http://www.alfresco.org/model/system/1.0' OR
qn.local_name != 'referenceable'
;
+--END TXN
UNLOCK TABLES;
-- Clean up
@@ -477,6 +485,7 @@ CREATE TABLE t_alf_node_properties
PRIMARY KEY (node_id, qname_id, list_index, locale_id)
) TYPE=InnoDB;
+--BEGIN TXN
-- Copy values over
LOCK TABLES
t_alf_node_properties WRITE,
@@ -501,7 +510,9 @@ INSERT INTO t_alf_node_properties
WHERE
np.attribute_value IS NULL
;
+--END TXN
UNLOCK TABLES;
+
-- Update cm:auditable properties on the nodes
UPDATE t_alf_node n SET audit_creator =
(
diff --git a/config/alfresco/repository.properties b/config/alfresco/repository.properties
index 3ae1580b7b..a189ab741a 100644
--- a/config/alfresco/repository.properties
+++ b/config/alfresco/repository.properties
@@ -412,6 +412,20 @@ V2.1-A.fixes.to.schema=0
# The default authentication chain
authentication.chain=alfrescoNtlm1:alfrescoNtlm
+# Do authentication tickets expire or live for ever?
+authentication.ticket.ticketsExpire=false
+
+# If ticketsEpire is true then how they should expire?
+# Valid values are: AFTER_INACTIVITY, AFTER_FIXED_TIME, DO_NOT_EXPIRE
+# The default is AFTER_FIXED_TIME
+authentication.ticket.expiryMode=AFTER_FIXED_TIME
+
+# If authentication.ticket.ticketsExpire is true and
+# authentication.ticket.expiryMode is AFTER_FIXED_TIME or AFTER_INACTIVITY,
+# this controls the minimum period for which tickets are valid.
+# The default is PT1H for one hour.
+authentication.ticket.validDuration=PT1H
+
# Default NFS user mappings
nfs.user.mappings=admin
nfs.user.mappings.default.uid=0
diff --git a/source/java/org/alfresco/filesys/auth/cifs/AlfrescoCifsAuthenticator.java b/source/java/org/alfresco/filesys/auth/cifs/AlfrescoCifsAuthenticator.java
index f6cffc57b9..4b028dc020 100644
--- a/source/java/org/alfresco/filesys/auth/cifs/AlfrescoCifsAuthenticator.java
+++ b/source/java/org/alfresco/filesys/auth/cifs/AlfrescoCifsAuthenticator.java
@@ -116,7 +116,7 @@ public class AlfrescoCifsAuthenticator extends CifsAuthenticatorBase
{
// Use the existing authentication token
- getAuthenticationService().validate(alfClient.getAuthenticationTicket(), null);
+ getAuthenticationService().validate(alfClient.getAuthenticationTicket());
// Debug
diff --git a/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java b/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java
index 05c9f7d88f..8d5f3c7b59 100644
--- a/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java
+++ b/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java
@@ -433,7 +433,7 @@ public abstract class CifsAuthenticatorBase extends CifsAuthenticator implements
{
try
{
- getAuthenticationService().validate(alfClient.getAuthenticationTicket(), null);
+ getAuthenticationService().validate(alfClient.getAuthenticationTicket());
}
catch (AuthenticationException e)
{
diff --git a/source/java/org/alfresco/filesys/auth/cifs/PassthruCifsAuthenticator.java b/source/java/org/alfresco/filesys/auth/cifs/PassthruCifsAuthenticator.java
index d03d201505..84939fc8a4 100644
--- a/source/java/org/alfresco/filesys/auth/cifs/PassthruCifsAuthenticator.java
+++ b/source/java/org/alfresco/filesys/auth/cifs/PassthruCifsAuthenticator.java
@@ -188,7 +188,7 @@ public class PassthruCifsAuthenticator extends CifsAuthenticatorBase implements
{
// Use the existing authentication token
- getAuthenticationService().validate(alfClient.getAuthenticationTicket(), null);
+ getAuthenticationService().validate(alfClient.getAuthenticationTicket());
// Debug
@@ -269,41 +269,32 @@ public class PassthruCifsAuthenticator extends CifsAuthenticatorBase implements
else
{
// Map the passthru username to an Alfresco person
-
+
String username = client.getUserName();
- String personName = getPersonService().getUserIdentifier(username);
- if (null == personName)
- {
- personName = username;
- }
- if ( personName != null)
- {
- // Use the person name as the current user
- getAuthenticationComponent().setCurrentUser(personName);
- alfClient.setAuthenticationTicket(getAuthenticationService().getCurrentTicket());
-
- // DEBUG
-
- if ( logger.isDebugEnabled())
- logger.debug("Setting current user using person " + personName + " (username " + username + ")");
-
- // Allow the user full access to the server
-
- authSts = ICifsAuthenticator.AUTH_ALLOW;
-
- // Debug
-
- if (logger.isDebugEnabled())
- logger.debug("Passthru authenticate user=" + client.getUserName() + ", FULL");
- }
- else if ( logger.isDebugEnabled())
- logger.debug("Failed to find person matching user " + username);
+ // Use the person name as the current user
+
+ getAuthenticationComponent().setCurrentUser(username);
+ alfClient.setAuthenticationTicket(getAuthenticationService().getCurrentTicket());
+
+ // DEBUG
+
+ if ( logger.isDebugEnabled())
+ logger.debug("Setting current user using person " + getAuthenticationComponent().getCurrentUserName() + " (username " + username + ")");
+
+ // Allow the user full access to the server
+
+ authSts = ICifsAuthenticator.AUTH_ALLOW;
+
+ // Debug
+
+ if (logger.isDebugEnabled())
+ logger.debug("Passthru authenticate user=" + client.getUserName() + ", FULL");
}
}
- catch (AuthenticationException ex)
+ catch (AuthenticationException e)
{
- logger.debug("User invalid or max tickets exceeded", ex);
+ throw e;
}
catch (Exception ex)
{
diff --git a/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java b/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java
index f67f53feb6..af32f6f359 100644
--- a/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java
+++ b/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java
@@ -313,7 +313,7 @@ public class AlfrescoRpcAuthenticator implements RpcAuthenticator, InitializingB
{
// Set the authentication context for the request
- getAuthenticationService().validate(alfClient.getAuthenticationTicket(), null);
+ getAuthenticationService().validate(alfClient.getAuthenticationTicket());
// DEBUG
diff --git a/source/java/org/alfresco/filesys/repo/ContentIOControlHandler.java b/source/java/org/alfresco/filesys/repo/ContentIOControlHandler.java
index 243f751281..2649603fc3 100644
--- a/source/java/org/alfresco/filesys/repo/ContentIOControlHandler.java
+++ b/source/java/org/alfresco/filesys/repo/ContentIOControlHandler.java
@@ -748,7 +748,7 @@ public class ContentIOControlHandler implements IOControlHandler
{
// Validate the existing ticket
- getAuthenticationService().validate( cInfo.getAuthenticationTicket(), null);
+ getAuthenticationService().validate( cInfo.getAuthenticationTicket());
needTicket = false;
}
catch ( AuthenticationException ex)
@@ -757,7 +757,7 @@ public class ContentIOControlHandler implements IOControlHandler
try
{
- getAuthenticationService().invalidateTicket( cInfo.getAuthenticationTicket(), null);
+ getAuthenticationService().invalidateTicket( cInfo.getAuthenticationTicket());
cInfo.setAuthenticationTicket( null);
}
catch (Exception ex2)
diff --git a/source/java/org/alfresco/jcr/session/SessionImpl.java b/source/java/org/alfresco/jcr/session/SessionImpl.java
index 754786a5f8..b206aaaf4f 100644
--- a/source/java/org/alfresco/jcr/session/SessionImpl.java
+++ b/source/java/org/alfresco/jcr/session/SessionImpl.java
@@ -651,7 +651,7 @@ public class SessionImpl implements Session
{
try
{
- getRepositoryImpl().getServiceRegistry().getAuthenticationService().invalidateTicket(getTicket(), null);
+ getRepositoryImpl().getServiceRegistry().getAuthenticationService().invalidateTicket(getTicket());
}
finally
{
diff --git a/source/java/org/alfresco/jcr/util/JCRProxyFactory.java b/source/java/org/alfresco/jcr/util/JCRProxyFactory.java
index 204bf236be..0c6e6652dd 100644
--- a/source/java/org/alfresco/jcr/util/JCRProxyFactory.java
+++ b/source/java/org/alfresco/jcr/util/JCRProxyFactory.java
@@ -124,7 +124,7 @@ public class JCRProxyFactory
{
if (username == null)
{
- authenticationService.validate(session.getTicket(), null);
+ authenticationService.validate(session.getTicket());
}
}
diff --git a/source/java/org/alfresco/repo/action/ActionServiceTransportImpl.java b/source/java/org/alfresco/repo/action/ActionServiceTransportImpl.java
index 9fe1bf8955..2e2aa57622 100644
--- a/source/java/org/alfresco/repo/action/ActionServiceTransportImpl.java
+++ b/source/java/org/alfresco/repo/action/ActionServiceTransportImpl.java
@@ -59,7 +59,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public Action createAction(String ticket, String name)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.createAction(name);
}
@@ -69,7 +69,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public Action createAction(String ticket, String name,
Map params)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.createAction(name, params);
}
@@ -78,7 +78,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public ActionCondition createActionCondition(String ticket, String name)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.createActionCondition(name);
}
@@ -88,7 +88,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public ActionCondition createActionCondition(String ticket, String name,
Map params)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.createActionCondition(name, params);
}
@@ -97,7 +97,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public CompositeAction createCompositeAction(String ticket)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.createCompositeAction();
}
@@ -107,7 +107,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public boolean evaluateAction(String ticket, Action action,
NodeRef actionedUponNodeRef)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.evaluateAction(action, actionedUponNodeRef);
}
@@ -117,7 +117,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public boolean evaluateActionCondition(String ticket,
ActionCondition condition, NodeRef actionedUponNodeRef)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.evaluateActionCondition(condition, actionedUponNodeRef);
}
@@ -127,7 +127,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public void executeAction(String ticket, Action action,
NodeRef actionedUponNodeRef)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
fActionService.executeAction(action, actionedUponNodeRef);
}
@@ -137,7 +137,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public void executeAction(String ticket, Action action,
NodeRef actionedUponNodeRef, boolean checkConditions)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
fActionService.executeAction(action, actionedUponNodeRef, checkConditions);
}
@@ -148,7 +148,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
NodeRef actionedUponNodeRef, boolean checkConditions,
boolean executeAsynchronously)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
fActionService.executeAction(action, actionedUponNodeRef, checkConditions, executeAsynchronously);
}
@@ -157,7 +157,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public Action getAction(String ticket, NodeRef nodeRef, String actionId)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.getAction(nodeRef, actionId);
}
@@ -167,7 +167,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public ActionConditionDefinition getActionConditionDefinition(
String ticket, String name)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.getActionConditionDefinition(name);
}
@@ -177,7 +177,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public List getActionConditionDefinitions(
String ticket)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.getActionConditionDefinitions();
}
@@ -186,7 +186,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public ActionDefinition getActionDefinition(String ticket, String name)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.getActionDefinition(name);
}
@@ -195,7 +195,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public List getActionDefinitions(String ticket)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.getActionDefinitions();
}
@@ -205,7 +205,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public List getActionDefinitions(String ticket,
NodeRef nodeRef)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.getActionDefinitions(nodeRef);
}
@@ -214,7 +214,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public ParameterConstraint getParameterConstraint(String ticket, String name)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.getParameterConstraint(name);
}
@@ -223,7 +223,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public List getParameterConstraints(String ticket)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.getParameterConstraints();
}
@@ -232,7 +232,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public List getActions(String ticket, NodeRef nodeRef)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fActionService.getActions(nodeRef);
}
@@ -241,7 +241,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public void removeAction(String ticket, NodeRef nodeRef, Action action)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
fActionService.removeAction(nodeRef, action);
}
@@ -250,7 +250,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public void removeAllActions(String ticket, NodeRef nodeRef)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
fActionService.removeAllActions(nodeRef);
}
@@ -259,7 +259,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public void saveAction(String ticket, NodeRef nodeRef, Action action)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
fActionService.saveAction(nodeRef, action);
}
}
diff --git a/source/java/org/alfresco/repo/avm/AVMRemoteTransportService.java b/source/java/org/alfresco/repo/avm/AVMRemoteTransportService.java
index 9933b9fe5b..b7c58a5a81 100644
--- a/source/java/org/alfresco/repo/avm/AVMRemoteTransportService.java
+++ b/source/java/org/alfresco/repo/avm/AVMRemoteTransportService.java
@@ -257,7 +257,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String getInputHandle(String ticket, int version, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
InputStream in = fAVMService.getFileInputStream(version, path);
String handle = GUID.generate();
synchronized (this)
@@ -274,7 +274,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String getInputHandle(String ticket, AVMNodeDescriptor desc)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
InputStream in = fAVMService.getFileInputStream(desc);
String handle = GUID.generate();
synchronized (this)
@@ -294,7 +294,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public byte [] readInput(String ticket, String handle, int count)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
InputStream in = null;
synchronized (this)
{
@@ -347,7 +347,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public synchronized void closeInputHandle(String ticket, String handle)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
InputStream in = fInputStreams.get(handle);
if (in != null)
{
@@ -372,7 +372,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String getOutputHandle(String ticket, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
OutputStream out = fAVMService.getFileOutputStream(path);
String handle = GUID.generate();
synchronized (this)
@@ -394,7 +394,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void writeOutput(String ticket, String handle, byte [] buff, int count)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
OutputStream out = null;
synchronized (this)
{
@@ -429,7 +429,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public synchronized void closeOutputHandle(String ticket, String handle)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
OutputStream out = fOutputStreams.get(handle);
if (out != null)
{
@@ -456,7 +456,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
public SortedMap
getDirectoryListingDirect(String ticket, int version, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getDirectoryListingDirect(version, path);
}
@@ -469,7 +469,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
public SortedMap
getDirectoryListing(String ticket, int version, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getDirectoryListing(version, path);
}
@@ -481,7 +481,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
public SortedMap
getDirectoryListing(String ticket, AVMNodeDescriptor dir)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getDirectoryListing(dir);
}
@@ -493,7 +493,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List getDeleted(String ticket, int version, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getDeleted(version, path);
}
@@ -505,7 +505,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String createFile(String ticket, String path, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
OutputStream out = fAVMService.createFile(path, name);
String handle = GUID.generate();
synchronized (this)
@@ -524,7 +524,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createDirectory(String ticket, String path, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.createDirectory(path, name);
}
@@ -536,7 +536,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createLayeredFile(String ticket, String targetPath, String parent, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.createLayeredFile(targetPath, parent, name);
}
@@ -548,7 +548,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createLayeredDirectory(String ticket, String targetPath, String parent, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.createLayeredDirectory(targetPath, parent, name);
}
@@ -559,7 +559,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void retargetLayeredDirectory(String ticket, String path, String target)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.retargetLayeredDirectory(path, target);
}
@@ -569,7 +569,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createStore(String ticket, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.createStore(name);
}
@@ -582,7 +582,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createBranch(String ticket, int version, String srcPath, String dstPath, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.createBranch(version, srcPath, dstPath, name);
}
@@ -593,7 +593,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void removeNode(String ticket, String parent, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.removeNode(parent, name);
}
@@ -606,7 +606,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void rename(String ticket, String srcParent, String srcName, String dstParent, String dstName)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.rename(srcParent, srcName, dstParent, dstName);
}
@@ -617,7 +617,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void uncover(String ticket, String dirPath, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.uncover(dirPath, name);
}
@@ -628,7 +628,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public int getNextVersionID(String ticket, String storeName)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getNextVersionID(storeName);
}
@@ -649,7 +649,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map createSnapshot(String ticket, String store, String label, String comment)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.createSnapshot(store, label, comment);
}
@@ -660,7 +660,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List getStoreVersions(String ticket, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getStoreVersions(name);
}
@@ -673,7 +673,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List getStoreVersions(String ticket, String name, Date from, Date to)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getStoreVersions(name, from, to);
}
@@ -683,7 +683,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List getStores(String ticket)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getStores();
}
@@ -694,7 +694,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMStoreDescriptor getStore(String ticket, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getStore(name);
}
@@ -706,7 +706,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor getStoreRoot(String ticket, int version, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getStoreRoot(version, name);
}
@@ -718,7 +718,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor lookup(String ticket, int version, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.lookup(version, path);
}
@@ -734,7 +734,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor lookup(String ticket, int version, String path, boolean includeDeleted)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.lookup(version, path, includeDeleted);
}
@@ -747,7 +747,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor lookup(String ticket, AVMNodeDescriptor dir, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.lookup(dir, name);
}
@@ -765,7 +765,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor lookup(String ticket, AVMNodeDescriptor dir, String name, boolean includeDeleted)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.lookup(dir, name, includeDeleted);
}
@@ -778,7 +778,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String getIndirectionPath(String ticket, int version, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getIndirectionPath(version, path);
}
@@ -788,7 +788,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void purgeStore(String ticket, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.purgeStore(name);
}
@@ -799,7 +799,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void purgeVersion(String ticket, int version, String name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.purgeVersion(version, name);
}
@@ -809,7 +809,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void makePrimary(String ticket, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.makePrimary(path);
}
@@ -821,7 +821,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List getHistory(String ticket, AVMNodeDescriptor desc, int count)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getHistory(desc, count);
}
@@ -832,7 +832,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setOpacity(String ticket, String path, boolean opacity)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.setOpacity(path, opacity);
}
@@ -844,7 +844,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor getCommonAncestor(String ticket, AVMNodeDescriptor left, AVMNodeDescriptor right)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getCommonAncestor(left, right);
}
@@ -856,7 +856,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public LayeringDescriptor getLayeringInfo(String ticket, int version, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getLayeringInfo(version, path);
}
@@ -868,7 +868,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setNodeProperty(String ticket, String path, QName name, PropertyValue value)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.setNodeProperty(path, name, value);
}
@@ -879,7 +879,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setNodeProperties(String ticket, String path, Map properties)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.setNodeProperties(path, properties);
}
@@ -892,7 +892,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public PropertyValue getNodeProperty(String ticket, int version, String path, QName name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getNodeProperty(version, path, name);
}
@@ -904,7 +904,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map getNodeProperties(String ticket, int version, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getNodeProperties(version, path);
}
@@ -915,7 +915,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void deleteNodeProperty(String ticket, String path, QName name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.deleteNodeProperty(path, name);
}
@@ -925,7 +925,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void deleteNodeProperties(String ticket, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.deleteNodeProperties(path);
}
@@ -937,7 +937,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setStoreProperty(String ticket, String store, QName name, PropertyValue value)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.setStoreProperty(store, name, value);
}
@@ -948,7 +948,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setStoreProperties(String ticket, String store, Map props)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.setStoreProperties(store, props);
}
@@ -960,7 +960,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public PropertyValue getStoreProperty(String ticket, String store, QName name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getStoreProperty(store, name);
}
@@ -972,7 +972,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map queryStorePropertyKey(String ticket, String store, QName keyPattern)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.queryStorePropertyKey(store, keyPattern);
}
@@ -983,7 +983,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map> queryStoresPropertyKey(String ticket, QName keyPattern)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.queryStoresPropertyKeys(keyPattern);
}
@@ -994,7 +994,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map getStoreProperties(String ticket, String store)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getStoreProperties(store);
}
@@ -1005,7 +1005,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void deleteStoreProperty(String ticket, String store, QName name)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.deleteStoreProperty(store, name);
}
@@ -1014,7 +1014,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void renameStore(String ticket, String sourceName, String destName)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.renameStore(sourceName, destName);
}
@@ -1023,7 +1023,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void addAspect(String ticket, String path, QName aspectName)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.addAspect(path, aspectName);
}
@@ -1032,7 +1032,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Set getAspects(String ticket, int version, String path)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getAspects(version, path);
}
@@ -1041,7 +1041,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public boolean hasAspect(String ticket, int version, String path, QName aspectName)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.hasAspect(version, path, aspectName);
}
@@ -1050,7 +1050,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void removeAspect(String ticket, String path, QName aspectName)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.removeAspect(path, aspectName);
}
@@ -1059,7 +1059,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void revert(String ticket, String path, AVMNodeDescriptor toRevertTo)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.revert(path, toRevertTo);
}
@@ -1068,7 +1068,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Pair getAPath(String ticket, AVMNodeDescriptor desc)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
return fAVMService.getAPath(desc);
}
@@ -1077,7 +1077,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setGuid(String ticket, String path, String guid)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.setGuid(path, guid);
}
@@ -1086,7 +1086,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setEncoding(String ticket, String path, String encoding)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.setEncoding(path, encoding);
}
@@ -1095,7 +1095,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setMimeType(String ticket, String path, String mimeType)
{
- fAuthService.validate(ticket, null);
+ fAuthService.validate(ticket);
fAVMService.setMimeType(path, mimeType);
}
}
diff --git a/source/java/org/alfresco/repo/avm/AVMSyncServiceTransportImpl.java b/source/java/org/alfresco/repo/avm/AVMSyncServiceTransportImpl.java
index 887de4cc86..97fac7e97f 100644
--- a/source/java/org/alfresco/repo/avm/AVMSyncServiceTransportImpl.java
+++ b/source/java/org/alfresco/repo/avm/AVMSyncServiceTransportImpl.java
@@ -65,7 +65,7 @@ public class AVMSyncServiceTransportImpl implements AVMSyncServiceTransport
public List compare(String ticket, int srcVersion,
String srcPath, int dstVersion, String dstPath, NameMatcher excluder)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
return fSyncService.compare(srcVersion, srcPath, dstVersion, dstPath, excluder);
}
@@ -74,7 +74,7 @@ public class AVMSyncServiceTransportImpl implements AVMSyncServiceTransport
*/
public void flatten(String ticket, String layerPath, String underlyingPath)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
fSyncService.flatten(layerPath, underlyingPath);
}
@@ -83,7 +83,7 @@ public class AVMSyncServiceTransportImpl implements AVMSyncServiceTransport
*/
public void resetLayer(String ticket, String layerPath)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
fSyncService.resetLayer(layerPath);
}
@@ -95,7 +95,7 @@ public class AVMSyncServiceTransportImpl implements AVMSyncServiceTransport
boolean overrideConflicts, boolean overrideOlder, String tag,
String description)
{
- fAuthenticationService.validate(ticket, null);
+ fAuthenticationService.validate(ticket);
fSyncService.update(diffList, excluder, ignoreConflicts, ignoreOlder, overrideConflicts, overrideOlder, tag, description);
}
}
diff --git a/source/java/org/alfresco/repo/avm/AVMTestSuite.java b/source/java/org/alfresco/repo/avm/AVMTestSuite.java
index 41f8f0c23a..cdd24092de 100644
--- a/source/java/org/alfresco/repo/avm/AVMTestSuite.java
+++ b/source/java/org/alfresco/repo/avm/AVMTestSuite.java
@@ -70,6 +70,9 @@ public class AVMTestSuite extends TestSuite
suite.addTestSuite(AVMServiceTestBase.class);
suite.addTestSuite(AVMServiceTest.class);
+
+ suite.addTestSuite(PurgeTestP.class);
+
suite.addTestSuite(AVMServiceLocalTest.class);
suite.addTestSuite(AVMLockingServiceTest.class);
diff --git a/source/java/org/alfresco/repo/domain/schema/SchemaBootstrap.java b/source/java/org/alfresco/repo/domain/schema/SchemaBootstrap.java
index 052380b483..e330a1a37b 100644
--- a/source/java/org/alfresco/repo/domain/schema/SchemaBootstrap.java
+++ b/source/java/org/alfresco/repo/domain/schema/SchemaBootstrap.java
@@ -1018,6 +1018,17 @@ public class SchemaBootstrap extends AbstractLifecycleBean
fetchColumnName = assigns[1];
continue;
}
+ // Allow transaction delineation
+ else if (sql.startsWith("--BEGIN TXN"))
+ {
+ connection.setAutoCommit(false);
+ }
+ else if (sql.startsWith("--END TXN"))
+ {
+ connection.commit();
+ connection.setAutoCommit(true);
+ }
+
// Check for comments
if (sql.length() == 0 ||
sql.startsWith( "--" ) ||
diff --git a/source/java/org/alfresco/repo/imap/ImapServiceImplTest.java b/source/java/org/alfresco/repo/imap/ImapServiceImplTest.java
index 6f7d4b3eb3..553248068c 100644
--- a/source/java/org/alfresco/repo/imap/ImapServiceImplTest.java
+++ b/source/java/org/alfresco/repo/imap/ImapServiceImplTest.java
@@ -248,7 +248,7 @@ public class ImapServiceImplTest extends TestCase
private void reauthenticate(String name, String password)
{
- authenticationService.invalidateTicket(authenticationService.getCurrentTicket(), null);
+ authenticationService.invalidateTicket(authenticationService.getCurrentTicket());
authenticationService.clearCurrentSecurityContext();
authenticationService.authenticate(name, password.toCharArray());
}
diff --git a/source/java/org/alfresco/repo/imap/LoadTester.java b/source/java/org/alfresco/repo/imap/LoadTester.java
index 44fbd0b395..75e295b0c2 100644
--- a/source/java/org/alfresco/repo/imap/LoadTester.java
+++ b/source/java/org/alfresco/repo/imap/LoadTester.java
@@ -211,7 +211,7 @@ public class LoadTester extends TestCase
private void reauthenticate(String name, String password)
{
- authenticationService.invalidateTicket(authenticationService.getCurrentTicket(), null);
+ authenticationService.invalidateTicket(authenticationService.getCurrentTicket());
authenticationService.clearCurrentSecurityContext();
authenticationService.authenticate(name, password.toCharArray());
}
diff --git a/source/java/org/alfresco/repo/model/ml/MultilingualContentServiceImpl.java b/source/java/org/alfresco/repo/model/ml/MultilingualContentServiceImpl.java
index a51a219e92..6adc5c1b3e 100644
--- a/source/java/org/alfresco/repo/model/ml/MultilingualContentServiceImpl.java
+++ b/source/java/org/alfresco/repo/model/ml/MultilingualContentServiceImpl.java
@@ -291,10 +291,21 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
// set the pivot language and the functional name
nodeService.setProperty(mlContainerNodeRef, ContentModel.PROP_LOCALE, locale);
nodeService.setProperty(mlContainerNodeRef, ContentModel.PROP_NAME, containerFunctionalName);
-
}
else
{
+ // ALF-2200: Create the translation as the same type as the pivot
+ NodeRef pivotNodeRef = this.getPivotTranslation(mlContainerNodeRef);
+ if (pivotNodeRef != null && !pivotNodeRef.equals(contentNodeRef))
+ {
+ QName pivotNodeType = nodeService.getType(pivotNodeRef);
+ QName contentNodeType = nodeService.getType(contentNodeRef);
+ if (!pivotNodeType.equals(contentNodeType))
+ {
+ nodeService.setType(contentNodeRef, pivotNodeType);
+ }
+ }
+
// Check that the language is not duplicated
Map existingLanguages = this.getTranslations(mlContainerNodeRef);
if (existingLanguages.containsKey(locale))
@@ -379,7 +390,7 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
/** @inheritDoc */
public void deleteTranslationContainer(NodeRef mlContainerNodeRef)
{
- if(!ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(nodeService.getType(mlContainerNodeRef)))
+ if (!ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(nodeService.getType(mlContainerNodeRef)))
{
throw new IllegalArgumentException(
"Node type must be " + ContentModel.TYPE_MULTILINGUAL_CONTAINER);
@@ -394,30 +405,17 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
// remove the translations
for(NodeRef translationToRemove : translations.values())
{
- if(nodeService.exists(translationToRemove))
+ // unmake the translation, ignore any parent-child logic
+ this.unmakeTranslationSimple(translationToRemove);
+ // remove it, if necessary
+ if (nodeService.exists(translationToRemove))
{
- // unmake the translation
- this.unmakeTranslation(translationToRemove);
-
- // remove it
- if(nodeService.exists(translationToRemove))
- {
- nodeService.deleteNode(translationToRemove);
- }
+ nodeService.deleteNode(translationToRemove);
}
}
- // if the mlContainer is not removed with the pivot,
- if(nodeService.exists(mlContainerNodeRef))
- {
- // force its deletion
- nodeService.deleteNode(mlContainerNodeRef);
-
- if (logger.isWarnEnabled())
- {
- logger.warn("The ML container " + mlContainerNodeRef + " was not removed with it's pivot translation in the unmakeTranslation process.");
- }
- }
+ // force its deletion
+ nodeService.deleteNode(mlContainerNodeRef);
// done
if (logger.isDebugEnabled())
@@ -427,26 +425,37 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
" Number of translations: " + translationCount);
}
}
+
+ /**
+ * Does the work of making the translation a simple node again. No parent-child relationships
+ * are modified and the pivot-container logic is not done here.
+ *
+ * @param translationNodeRef a translation
+ */
+ private void unmakeTranslationSimple(NodeRef translationNodeRef)
+ {
+ if (nodeService.hasAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
+ {
+ nodeService.removeAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION);
+ nodeService.addAspect(translationNodeRef, ContentModel.ASPECT_TEMPORARY, null);
+ }
+ else
+ {
+ nodeService.removeAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
+ }
+ }
/** @inheritDoc */
public void unmakeTranslation(NodeRef translationNodeRef)
{
- // Get the container
NodeRef containerNodeRef = getMLContainer(translationNodeRef, true);
if (containerNodeRef == null)
{
- if (nodeService.hasAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
- {
- nodeService.deleteNode(translationNodeRef);
- }
- else
- {
- nodeService.removeAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
- }
+ unmakeTranslationSimple(translationNodeRef);
}
else if (isPivotTranslation(translationNodeRef))
{
- // Get all translation child associations
+ // Pivot nodes are handled by unmaking all translations and removing the container
List mlChildAssocs = nodeService.getChildAssocs(
containerNodeRef,
ContentModel.ASSOC_MULTILINGUAL_CHILD,
@@ -455,30 +464,15 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
{
NodeRef mlChildNodeRef = mlChildAssoc.getChildRef();
// Delete empty translations
- if (nodeService.hasAspect(mlChildNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
- {
- nodeService.deleteNode(mlChildNodeRef);
- }
- else
- {
- nodeService.removeAspect(mlChildNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
- }
+ unmakeTranslationSimple(mlChildNodeRef);
}
// Now delete the container
nodeService.deleteNode(containerNodeRef);
}
else
{
- if (nodeService.hasAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
- {
- nodeService.deleteNode(translationNodeRef);
- }
- else
- {
- // Get the container and break the association to it
- nodeService.removeChild(containerNodeRef, translationNodeRef);
- nodeService.removeAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
- }
+ nodeService.removeChild(containerNodeRef, translationNodeRef);
+ unmakeTranslationSimple(translationNodeRef);
}
}
@@ -739,11 +733,13 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
// Create the document in the space of the node of reference
NodeRef parentNodeRef = nodeService.getPrimaryParent(translationOfNodeRef).getParentRef();
- // Create the empty translation
+ // Create the empty translation.
+ // ALF-2200: Create the translation as the same type as the pivot
+ QName newTranslationType = nodeService.getType(translationOfNodeRef);
NodeRef newTranslationNodeRef = fileFolderService.create(
parentNodeRef,
name,
- ContentModel.TYPE_CONTENT).getNodeRef();
+ newTranslationType).getNodeRef();
// add the translation to the container
addTranslation(newTranslationNodeRef, translationOfNodeRef, locale);
diff --git a/source/java/org/alfresco/repo/model/ml/MultilingualDocumentAspect.java b/source/java/org/alfresco/repo/model/ml/MultilingualDocumentAspect.java
index 0973e4b656..9dfddd883d 100644
--- a/source/java/org/alfresco/repo/model/ml/MultilingualDocumentAspect.java
+++ b/source/java/org/alfresco/repo/model/ml/MultilingualDocumentAspect.java
@@ -122,15 +122,8 @@ public class MultilingualDocumentAspect implements
*/
public void beforeDeleteNode(NodeRef nodeRef)
{
- if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
- {
- // We just let it get deleted
- }
- else
- {
- // First unhook it
- multilingualContentService.unmakeTranslation(nodeRef);
- }
+ // First unhook it
+ multilingualContentService.unmakeTranslation(nodeRef);
}
/**
diff --git a/source/java/org/alfresco/repo/node/AbstractNodeServiceImpl.java b/source/java/org/alfresco/repo/node/AbstractNodeServiceImpl.java
index 31ef41b0e9..c6a5fc9890 100644
--- a/source/java/org/alfresco/repo/node/AbstractNodeServiceImpl.java
+++ b/source/java/org/alfresco/repo/node/AbstractNodeServiceImpl.java
@@ -436,8 +436,11 @@ public abstract class AbstractNodeServiceImpl implements NodeService
if (ignorePolicy(childNodeRef))
{
// special case
- qnames = new HashSet(1);
- qnames.add(ContentModel.ASPECT_VERSIONABLE);
+ if (childAspectQnames.contains(ContentModel.ASPECT_VERSIONABLE) || childNodeTypeQName.equals(ContentModel.ASPECT_VERSIONABLE))
+ {
+ qnames = new HashSet(1);
+ qnames.add(ContentModel.ASPECT_VERSIONABLE);
+ }
}
else
{
diff --git a/source/java/org/alfresco/repo/remote/FileFolderRemoteServer.java b/source/java/org/alfresco/repo/remote/FileFolderRemoteServer.java
index 5a3211d712..8142fc0c5a 100644
--- a/source/java/org/alfresco/repo/remote/FileFolderRemoteServer.java
+++ b/source/java/org/alfresco/repo/remote/FileFolderRemoteServer.java
@@ -97,7 +97,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback> callback = new RetryingTransactionCallback>()
{
@@ -122,7 +122,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback> callback = new RetryingTransactionCallback>()
{
@@ -147,7 +147,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback> callback = new RetryingTransactionCallback>()
{
@@ -172,7 +172,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback callback = new RetryingTransactionCallback()
{
@@ -201,7 +201,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback> callback = new RetryingTransactionCallback>()
{
@@ -232,7 +232,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback> callback = new RetryingTransactionCallback>()
{
@@ -257,7 +257,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback callback = new RetryingTransactionCallback()
{
@@ -283,7 +283,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback callback = new RetryingTransactionCallback()
{
@@ -309,7 +309,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback callback = new RetryingTransactionCallback()
{
@@ -334,7 +334,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback callback = new RetryingTransactionCallback()
{
@@ -359,7 +359,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback callback = new RetryingTransactionCallback()
{
@@ -389,7 +389,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
- authenticationService.validate(ticket, null);
+ authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback