mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V4.0-BUG-FIX to HEAD
34397: ALF-13064: Updated document lib WebScript to protect against access errors dealing with permissions of locked documents 34406: ALF-13069: Fix flash upload file selection page title corruption 34434: ALF-13066: Fix for intermittent failure (testConcurrentLinkToDeletedNode) 34439: Merged BRANCHES/V4.0 to BRANCHES/DEV/V4.0-BUG-FIX 34438: Fix to issue where new Hazelcast based Share clustering was broken by a recent SpringSurf change to ServletRequestContextFactory bean config in libs rev 1028 or higher. 34443: ALF-11433: IE8 specific fix to ensure that document-picker panel is hidden before documents selected event is fired and for TinyMCE to set focus on editor so that content is added correctly 34457: Merged V3.4-BUG-FIX to V4.0-BUG-FIX 34354: ALF-12995 - IMAP: File is modified when received as a message in IMAP account 34444: ALF-12169: Guest/guest/gUest username is now normalized to corresponding person's user ID during authentication, solving problems with synchronization with Active Directory's Guest account 34454: Java 1.6.0_31 for 3.4.9 and 4.0.2 34458: Merged V3.4-BUG-FIX to V4.0-BUG-FIX (RECORD ONLY) 34392: ALF-13146: Merged V4.0-BUG-FIX to V3.4-BUG-FIX 33813: ALF-12736: Stack specific: 'Getting updates failed' notification appears when non-admin user creats DWS - From Pavel: "Some users from ldap don't have lastName. That is why NPE occurs." 34459: Merged V4.0 to V4.0-BUG-FIX 34391: Merged DEV to V4.0 (with corrections) 34390: ALF-13013 : It's impossible to change Activities Feed properties on Websphere Now the Schedule subtree in JMX is set to the correct MBeanServer. 34407: Merged HEAD-2011_12_06 to V4.0 (4.0.1) Updated copyrights 32813: ALF-4098: WCM: Assets in in-flight worflow are allowed to be edited. Ability of editing assets submitted to 'in-flight' workflow has been removed: - .AVMSyncService. service interface was expanded with new method .List<AVMDifference> compare(int srcVersion, String srcPath, int dstVersion, String dstPath, NameMatcher excluder, boolean expandDirs). to introduce ability of collecting all created/modified items in created/modified folder; - all .AVMSyncService. implementations were expanded in accordance with changes in interface; - new tests for newly created items, items in modified folder and for deleted items in modified folder were added 34414: ALF-11607: Bootstrap fails against database 'DB2/LINUXX8664' - Patched hibernate jar to recognize DB2 64 bit Linux 34416: ALF-12992: Updated weblogic DD for SOLR git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34460 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -163,6 +163,10 @@
|
||||
<property name="locateExistingServerIfPossible" value="${mbean.server.locateExistingServerIfPossible}" />
|
||||
</bean>
|
||||
|
||||
<bean id="dynamicExporter" class="org.alfresco.repo.management.DynamicMBeanExporter">
|
||||
<property name="server" ref="alfrescoMBeanServer"/>
|
||||
</bean>
|
||||
|
||||
<!--
|
||||
The local in process RMI registry which will be bound to the address in
|
||||
java.rmi.server.hostname
|
||||
|
@@ -23,7 +23,7 @@
|
||||
<!-- Task scheduler -->
|
||||
<!-- Triggers should not appear here - the scheduler should be injected into the trigger definition -->
|
||||
<!-- This bean should not need to apear else where in extension configuration -->
|
||||
<bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
|
||||
<bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" depends-on="dynamicExporter">
|
||||
<property name="waitForJobsToCompleteOnShutdown">
|
||||
<value>true</value>
|
||||
</property>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -163,7 +163,202 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private enum DiffActionEnum
|
||||
{
|
||||
CREATION, MODIFICATION, DELETION, DELETION_AND_MODIFICATION
|
||||
}
|
||||
|
||||
/**
|
||||
* Test is related to ALF-4098
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void testDiffOfNewItems() throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
performeDiffTesting(DiffActionEnum.CREATION);
|
||||
}
|
||||
finally
|
||||
{
|
||||
fService.purgeStore("testStore");
|
||||
fService.purgeStore("submitStore");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test is related to ALF-4098
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void testDiffOfModifiedItems() throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
performeDiffTesting(DiffActionEnum.MODIFICATION);
|
||||
}
|
||||
finally
|
||||
{
|
||||
fService.purgeStore("testStore");
|
||||
fService.purgeStore("submitStore");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test is related to ALF-4098
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void testDiffOfDeletedItems() throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
performeDiffTesting(DiffActionEnum.DELETION);
|
||||
}
|
||||
finally
|
||||
{
|
||||
fService.purgeStore("testStore");
|
||||
fService.purgeStore("submitStore");
|
||||
}
|
||||
}
|
||||
|
||||
public void testDiffOfDeletedItemsInModifiedDirectory() throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
performeDiffTesting(DiffActionEnum.DELETION_AND_MODIFICATION);
|
||||
}
|
||||
finally
|
||||
{
|
||||
fService.purgeStore("testStore");
|
||||
fService.purgeStore("submitStore");
|
||||
}
|
||||
}
|
||||
|
||||
private void performeDiffTesting(DiffActionEnum action) throws IOException
|
||||
{
|
||||
fService.createStore("testStore");
|
||||
fService.createStore("submitStore");
|
||||
|
||||
fService.createDirectory("submitStore:/", "root");
|
||||
fService.createLayeredDirectory("submitStore:/root", "testStore:/", "root");
|
||||
fService.createSnapshot("testStore", null, null);
|
||||
|
||||
fService.createDirectory("testStore:/root", "test");
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
fService.createFile("testStore:/root/test", ("testFileN" + i + ".txt")).close();
|
||||
}
|
||||
|
||||
List<AVMDifference> diffs = fSyncService.compare(-1, "testStore:/root/", -1, "submitStore:/root/", null);
|
||||
if (DiffActionEnum.CREATION != action)
|
||||
{
|
||||
fSyncService.update(diffs, null, true, true, false, true, null, null);
|
||||
fSyncService.flatten("testStore:/root/", "submitStore:/root/");
|
||||
diffs = fSyncService.compare(-1, "testStore:/root/", -1, "submitStore:/root/", null);
|
||||
}
|
||||
|
||||
List<AVMDifference> actual = fSyncService.compare(-1, "testStore:/root/", -1, "submitStore:/root/", null, true);
|
||||
|
||||
if (DiffActionEnum.CREATION == action)
|
||||
{
|
||||
assertEquals(11, actual.size());
|
||||
|
||||
assertEquals(1, diffs.size());
|
||||
List<AVMDifference> newDiff = fSyncService.compare(-1, "testStore:/root/", -1, "submitStore:/root/", null, false);
|
||||
assertEquals(diffs.toString(), newDiff.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
assertEquals(0, actual.size());
|
||||
assertEquals(0, diffs.size());
|
||||
}
|
||||
|
||||
String parentPath = "testStore:/root/test/";
|
||||
if (DiffActionEnum.CREATION == action)
|
||||
{
|
||||
fService.createDirectory(parentPath, "inner");
|
||||
parentPath += "inner/";
|
||||
}
|
||||
|
||||
int start = (DiffActionEnum.DELETION == action) ? (1) : (0);
|
||||
int incrementingStep = start + 1;
|
||||
|
||||
for (int i = start; i < 10; i += incrementingStep)
|
||||
{
|
||||
String name = "testFileN" + i + ".txt";
|
||||
String path = parentPath + name;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case CREATION:
|
||||
{
|
||||
fService.createFile(parentPath, name).close();
|
||||
break;
|
||||
}
|
||||
case MODIFICATION:
|
||||
{
|
||||
fService.setNodeProperty(path, WCMModel.PROP_REVERTED_ID, new PropertyValue(WCMModel.PROP_REVERTED_ID, null));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
fService.removeNode(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int actualModificationsCount = (DiffActionEnum.DELETION == action) ? (5) : ((DiffActionEnum.CREATION == action) ? (22) : (10));
|
||||
int diffModificationsCount = (DiffActionEnum.DELETION == action) ? (5) : ((DiffActionEnum.CREATION == action) ? (1) : (10));
|
||||
|
||||
actual = fSyncService.compare(-1, "testStore:/root", -1, "submitStore:/root", null, true);
|
||||
diffs = fSyncService.compare(-1, "testStore:/root", -1, "submitStore:/root", null);
|
||||
|
||||
assertEquals(actualModificationsCount, actual.size());
|
||||
assertEquals(diffModificationsCount, diffs.size());
|
||||
|
||||
if (DiffActionEnum.CREATION != action)
|
||||
{
|
||||
assertDiffsList(AVMDifference.NEWER, diffs);
|
||||
assertEquals(diffs.toString(), actual.toString());
|
||||
}
|
||||
|
||||
if (DiffActionEnum.CREATION != action)
|
||||
{
|
||||
if (DiffActionEnum.DELETION == action)
|
||||
{
|
||||
fService.removeNode("testStore:/root/test");
|
||||
}
|
||||
else
|
||||
{
|
||||
fService.setNodeProperty("testStore:/root/test", WCMModel.PROP_REVERTED_ID, new PropertyValue(WCMModel.PROP_REVERTED_ID, null));
|
||||
}
|
||||
|
||||
actual = fSyncService.compare(-1, "testStore:/root/", -1, "submitStore:/root/", null, true);
|
||||
diffs = fSyncService.compare(-1, "testStore:/root/", -1, "submitStore:/root/", null);
|
||||
|
||||
actualModificationsCount = (DiffActionEnum.DELETION == action) ? (1) : (actualModificationsCount + 1);
|
||||
|
||||
assertEquals(actualModificationsCount, actual.size());
|
||||
assertEquals(1, diffs.size());
|
||||
|
||||
assertDiffsList(AVMDifference.NEWER, actual);
|
||||
assertDiffsList(AVMDifference.NEWER, diffs);
|
||||
}
|
||||
}
|
||||
|
||||
private void assertDiffsList(int expectedCode, List<AVMDifference> actual)
|
||||
{
|
||||
for (AVMDifference diff : actual)
|
||||
{
|
||||
assertNotNull(diff);
|
||||
assertTrue(diff.isValid());
|
||||
assertEquals(expectedCode, diff.getDifferenceCode());
|
||||
}
|
||||
}
|
||||
|
||||
public void test_ETWOTWO_570() throws Exception
|
||||
{
|
||||
// Check that read-write methods are properly intercepted
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -110,9 +110,15 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
public List<AVMDifference> compare(int srcVersion, String srcPath,
|
||||
int dstVersion, String dstPath,
|
||||
NameMatcher excluder)
|
||||
{
|
||||
return compare(srcVersion, srcPath, dstVersion, dstPath, excluder, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AVMDifference> compare(int srcVersion, String srcPath, int dstVersion, String dstPath, NameMatcher excluder, boolean expandDirs)
|
||||
{
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(srcPath + " : " + dstPath);
|
||||
@@ -131,21 +137,20 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
if (dstDesc == null)
|
||||
{
|
||||
// Special case: no pre-existing version in the destination.
|
||||
result.add(new AVMDifference(srcVersion, srcPath,
|
||||
dstVersion, dstPath,
|
||||
AVMDifference.NEWER));
|
||||
result.add(new AVMDifference(srcVersion, srcPath, dstVersion, dstPath, AVMDifference.NEWER));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Invoke the recursive implementation.
|
||||
compare(srcVersion, srcDesc, dstVersion, dstDesc, result, excluder, true);
|
||||
compare(srcVersion, srcDesc, dstVersion, dstDesc, result, excluder, true, expandDirs);
|
||||
}
|
||||
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Raw compare: ["+srcVersion+","+srcPath+"]["+dstVersion+","+dstPath+"]["+result.size()+"] in "+(System.currentTimeMillis()-start)+" msecs");
|
||||
logger.debug("Raw compare: [" + srcVersion + "," + srcPath + "][" + dstVersion + "," + dstPath + "][" + result.size() + "] in " + (System.currentTimeMillis() - start)
|
||||
+ " msecs");
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -158,7 +163,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
*/
|
||||
private void compare(int srcVersion, AVMNodeDescriptor srcDesc,
|
||||
int dstVersion, AVMNodeDescriptor dstDesc,
|
||||
List<AVMDifference> result, NameMatcher excluder, boolean firstLevel)
|
||||
List<AVMDifference> result, NameMatcher excluder, boolean firstLevel, boolean expandDirs)
|
||||
{
|
||||
String srcPath = srcDesc.getPath();
|
||||
String dstPath = dstDesc.getPath();
|
||||
@@ -225,6 +230,13 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
result.add(new AVMDifference(srcVersion, srcPath,
|
||||
dstVersion, dstPath,
|
||||
dirDiffCode));
|
||||
|
||||
// Also add all child items if necessary and any exists
|
||||
if (expandDirs)
|
||||
{
|
||||
addNewChildrenIfAny(srcVersion, srcDesc, dstVersion, AVMNodeConverter.ExtendAVMPath(dstPath, dstDesc.getName()), result);
|
||||
}
|
||||
|
||||
return; // short circuit
|
||||
}
|
||||
case AVMDifference.SAME :
|
||||
@@ -269,12 +281,19 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
result.add(new AVMDifference(srcVersion, srcChildPath,
|
||||
dstVersion, dstChildPath,
|
||||
AVMDifference.NEWER));
|
||||
|
||||
// Also add all child items if necessary and any exists
|
||||
if (expandDirs)
|
||||
{
|
||||
addNewChildrenIfAny(srcVersion, srcChild, dstVersion, dstChildPath, result);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
// Otherwise recursively invoke.
|
||||
compare(srcVersion, srcChild,
|
||||
dstVersion, dstChild,
|
||||
result, excluder, false);
|
||||
result, excluder, false, expandDirs);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -344,7 +363,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
// Otherwise, recursively invoke.
|
||||
compare(srcVersion, srcChild,
|
||||
dstVersion, dstChild,
|
||||
result, excluder, false);
|
||||
result, excluder, false, expandDirs);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -378,7 +397,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
// Otherwise recursive invocation.
|
||||
compare(srcVersion, srcChild,
|
||||
dstVersion, dstChild,
|
||||
result, excluder, false);
|
||||
result, excluder, false, expandDirs);
|
||||
}
|
||||
// Iterate over the destination.
|
||||
for (String name : dstList.keySet())
|
||||
@@ -412,6 +431,32 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
}
|
||||
}
|
||||
|
||||
private void addNewChildrenIfAny(int srcVersion, AVMNodeDescriptor srcChild, int dstVersion, String dstChildPath, List<AVMDifference> result)
|
||||
{
|
||||
Map<String, AVMNodeDescriptor> srcList = fAVMService.getDirectoryListingDirect(srcChild, true);
|
||||
|
||||
for (String name : srcList.keySet())
|
||||
{
|
||||
srcChild = srcList.get(name);
|
||||
String srcChildPath = srcChild.getPath();
|
||||
|
||||
String dstPath = AVMNodeConverter.ExtendAVMPath(dstChildPath, name);
|
||||
AVMNodeDescriptor dstDesc = fAVMService.lookup(dstVersion, dstChildPath, true);
|
||||
|
||||
int diffCode = AVMDifference.NEWER;
|
||||
if (null == dstDesc)
|
||||
{
|
||||
diffCode = AVMDifference.NEWER;
|
||||
}
|
||||
result.add(new AVMDifference(srcVersion, srcChildPath, dstVersion, dstPath, diffCode));
|
||||
|
||||
if (srcChild.isDirectory())
|
||||
{
|
||||
addNewChildrenIfAny(srcVersion, srcChild, dstVersion, dstPath, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the destination nodes in the AVMDifferences
|
||||
* with the source nodes. Normally any conflicts or cases in
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -69,6 +69,13 @@ public class AVMSyncServiceTransportImpl implements AVMSyncServiceTransport
|
||||
return fSyncService.compare(srcVersion, srcPath, dstVersion, dstPath, excluder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AVMDifference> compare(String ticket, int srcVersion, String srcPath, int dstVersion, String dstPath, NameMatcher excluder, boolean expandDirs)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fSyncService.compare(srcVersion, srcPath, dstVersion, dstPath, excluder, expandDirs);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.avmsync.AVMSyncServiceTransport#flatten(java.lang.String, java.lang.String, java.lang.String)
|
||||
*/
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -36,6 +36,7 @@ import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
|
||||
/**
|
||||
* DAO layer for the improved ACL implementation. This layer is responsible for setting ACLs and any cascade behaviour
|
||||
@@ -369,7 +370,7 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
else if (dbAcl.getAclType() == ACLType.SHARED)
|
||||
{
|
||||
throw new IllegalStateException();
|
||||
throw new ConcurrencyFailureException("setFixedAcls: unexpected shared acl: "+dbAcl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2005-2010 Alfresco Software, Ltd. All rights reserved.
|
||||
*
|
||||
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
||||
* pursuant to a written agreement and any use of this program without such an
|
||||
* agreement is prohibited.
|
||||
*/
|
||||
package org.alfresco.repo.management;
|
||||
|
||||
import javax.management.ObjectName;
|
||||
|
||||
/**
|
||||
* An interface that allows individual MBeans to be registered and unregistered over time.
|
||||
*
|
||||
* @author dward
|
||||
*/
|
||||
public interface DynamicMBeanExportOperations
|
||||
{
|
||||
/**
|
||||
* Unregisters an MBean
|
||||
*
|
||||
* @param objectName
|
||||
* the object name
|
||||
*/
|
||||
public void unregisterMBean(ObjectName objectName);
|
||||
|
||||
/**
|
||||
* Registers an MBean.
|
||||
*
|
||||
* @param managedResource
|
||||
* the managed resource
|
||||
* @param objectName
|
||||
* the object name
|
||||
* @return the actual object name
|
||||
*/
|
||||
public ObjectName registerMBean(Object managedResource, ObjectName objectName);
|
||||
|
||||
}
|
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Copyright 2005-2010 Alfresco Software, Ltd. All rights reserved.
|
||||
*
|
||||
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
||||
* pursuant to a written agreement and any use of this program without such an
|
||||
* agreement is prohibited.
|
||||
*/
|
||||
package org.alfresco.repo.management;
|
||||
|
||||
import javax.management.InstanceAlreadyExistsException;
|
||||
import javax.management.JMException;
|
||||
import javax.management.MBeanServer;
|
||||
import javax.management.ObjectName;
|
||||
|
||||
import org.springframework.jmx.export.MBeanExporter;
|
||||
import org.springframework.jmx.support.MBeanRegistrationSupport;
|
||||
|
||||
/**
|
||||
* An {@link MBeanExporter} that allows individual MBeans to be registered and unregistered over time.
|
||||
*/
|
||||
public class DynamicMBeanExporter extends MBeanExporter implements DynamicMBeanExportOperations
|
||||
{
|
||||
static private ThreadLocal<MBeanServer> threadServer = new ThreadLocal<MBeanServer>();
|
||||
|
||||
/**
|
||||
* Instantiates a new dynamic MBean exporter.
|
||||
*/
|
||||
public DynamicMBeanExporter()
|
||||
{
|
||||
// For consistency, try to continue to use the last MBeanServer used in the same thread
|
||||
MBeanServer server = threadServer.get();
|
||||
if (server != null)
|
||||
{
|
||||
setServer(server);
|
||||
}
|
||||
|
||||
// Make replace existing the default registration behavior
|
||||
setRegistrationBehavior(MBeanRegistrationSupport.REGISTRATION_REPLACE_EXISTING);
|
||||
setAutodetectMode(MBeanExporter.AUTODETECT_NONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setServer(MBeanServer server)
|
||||
{
|
||||
threadServer.set(server);
|
||||
super.setServer(server);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see
|
||||
* org.alfresco.enterprise.repo.management.DynamicMBeanExportOperations#unregisterMBean(javax.management.ObjectName)
|
||||
*/
|
||||
public void unregisterMBean(ObjectName objectName)
|
||||
{
|
||||
if (this.registeredBeans.remove(objectName))
|
||||
{
|
||||
try
|
||||
{
|
||||
this.server.unregisterMBean(objectName);
|
||||
onUnregister(objectName);
|
||||
}
|
||||
catch (JMException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.enterprise.repo.management.DynamicMBeanExportOperations#registerMBean(java.lang.Object,
|
||||
* javax.management.ObjectName)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public ObjectName registerMBean(Object managedResource, ObjectName objectName)
|
||||
{
|
||||
Object mbean;
|
||||
if (isMBean(managedResource.getClass()))
|
||||
{
|
||||
mbean = managedResource;
|
||||
}
|
||||
else
|
||||
{
|
||||
mbean = createAndConfigureMBean(managedResource, managedResource.getClass().getName());
|
||||
}
|
||||
ObjectName actualObjectName = objectName;
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
actualObjectName = this.server.registerMBean(mbean, objectName).getObjectName();
|
||||
}
|
||||
catch (InstanceAlreadyExistsException ex)
|
||||
{
|
||||
this.server.unregisterMBean(objectName);
|
||||
actualObjectName = this.server.registerMBean(mbean, objectName).getObjectName();
|
||||
}
|
||||
}
|
||||
catch (JMException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
this.registeredBeans.add(actualObjectName);
|
||||
onRegister(actualObjectName);
|
||||
return actualObjectName;
|
||||
}
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -100,4 +100,10 @@ public class AVMSyncServiceRemote implements AVMSyncService
|
||||
{
|
||||
fTransport.update(fTicketHolder.getTicket(), diffList, excluder, ignoreConflicts, ignoreOlder, overrideConflicts, overrideOlder, tag, description);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AVMDifference> compare(int srcVersion, String srcPath, int dstVersion, String dstPath, NameMatcher excluder, boolean expandDirs)
|
||||
{
|
||||
return fTransport.compare(fTicketHolder.getTicket(), srcVersion, srcPath, dstVersion, dstPath, excluder, expandDirs);
|
||||
}
|
||||
}
|
||||
|
@@ -259,7 +259,7 @@ public abstract class AbstractAuthenticationComponent implements AuthenticationC
|
||||
logger.debug("Setting the current user to the guest user of tenant domain \"" + tenantDomain + '"');
|
||||
}
|
||||
GrantedAuthority[] gas = new GrantedAuthority[0];
|
||||
ud = new User(getGuestUserName(tenantDomain), "", true, true, true, true, gas);
|
||||
ud = new User(userName, "", true, true, true, true, gas);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -1223,7 +1223,7 @@ public class WorkflowServiceImpl implements WorkflowService
|
||||
final String packageAvmPath = AVMNodeConverter.ToAVMVersionPath(workflowPackage).getSecond();
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("comparing " + packageAvmPath + " with " + stagingAvmPath);
|
||||
for (AVMDifference d : avmSyncService.compare(-1, packageAvmPath, -1, stagingAvmPath, null))
|
||||
for (AVMDifference d : avmSyncService.compare(-1, packageAvmPath, -1, stagingAvmPath, null, true))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("got difference " + d);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -42,7 +42,17 @@ public interface AVMSyncService
|
||||
public List<AVMDifference> compare(int srcVersion, String srcPath,
|
||||
int dstVersion, String dstPath,
|
||||
NameMatcher excluder);
|
||||
|
||||
|
||||
/**
|
||||
* Get a difference list between two corresponding node trees
|
||||
*
|
||||
* Note: new/modified directories can be optionally expanded to include new/modified children
|
||||
*/
|
||||
public List<AVMDifference> compare(int srcVersion, String srcPath,
|
||||
int dstVersion, String dstPath,
|
||||
NameMatcher excluder,
|
||||
boolean expandDirs);
|
||||
|
||||
/**
|
||||
* Updates the destination nodes in the AVMDifferences
|
||||
* with the source nodes. Normally any conflicts or cases in
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -42,7 +42,23 @@ public interface AVMSyncServiceTransport
|
||||
int srcVersion, String srcPath,
|
||||
int dstVersion, String dstPath,
|
||||
NameMatcher excluder);
|
||||
|
||||
|
||||
/**
|
||||
* Get a difference list between two corresponding node trees. New/modified children in new/modified directories will be also included
|
||||
*
|
||||
* @param srcVersion The version id for the source tree.
|
||||
* @param srcPath The avm path to the source tree.
|
||||
* @param dstVersion The version id for the destination tree.
|
||||
* @param dstPath The avm path to the destination tree.
|
||||
* @param expandDirs {@link Boolean} value that determines whether new/modified children in new/modified directories be included into result
|
||||
* @return A List of AVMDifference structs which can be used for
|
||||
* the update operation.
|
||||
*/
|
||||
public List<AVMDifference> compare(String ticket,
|
||||
int srcVersion, String srcPath,
|
||||
int dstVersion, String dstPath,
|
||||
NameMatcher excluder, boolean expandDirs);
|
||||
|
||||
/**
|
||||
* Updates the destination nodes in the AVMDifferences
|
||||
* with the source nodes. Normally any conflicts or cases in
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -180,7 +180,7 @@ public class WCMWorkflowUtil
|
||||
String wfPath = AVMNodeConverter.ToAVMVersionPath(ref).getSecond();
|
||||
String stagingSandboxPath = WCMUtil.getCorrespondingPath(wfPath, stagingSandboxName);
|
||||
|
||||
List<AVMDifference> diffs = avmSyncService.compare(-1, wfPath, -1, stagingSandboxPath, null);
|
||||
List<AVMDifference> diffs = avmSyncService.compare(-1, wfPath, -1, stagingSandboxPath, null, true);
|
||||
|
||||
for (AVMDifference diff : diffs)
|
||||
{
|
||||
|
Reference in New Issue
Block a user