mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.2 to HEAD
8078: Merged V2.1 to V2.2 8025: Fixes WCM-1039, problems with case insensitive name handling. 8079: Merged V2.1 to V2.2 8035: -- DONE SEPARATELY -- 8040: Fix AR-1985: SQL Server dialect is derived from Sybase dialect there need additional no-op script 8046: Better Javadocs for getChildByName() 8056: Fixed WCM-790: Date conversion for metadata extractors 8057: Fixed WCM-790: Properties that don't convert can be discarded (default is to fail) 8059: -- DONE SEPARATELY -- 8061: Fixes WCM-790: Fallout from CHK-2168 and CHK-2169 8081: Fix for WCM-1018 8082: Merged V2.1 to V2.2 8016: Merged V2.1-A to V2.1 8000: Additional indexes for AVM 8013: Patch to introduce reverse indexes required for AVM git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8474 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -68,6 +68,7 @@ import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
|
||||
import org.alfresco.service.cmr.avm.LayeringDescriptor;
|
||||
import org.alfresco.service.cmr.avm.VersionDescriptor;
|
||||
import org.alfresco.service.cmr.avm.deploy.DeploymentEvent;
|
||||
import org.alfresco.service.cmr.avm.deploy.DeploymentReport;
|
||||
import org.alfresco.service.cmr.avm.deploy.DeploymentService;
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
@@ -96,7 +97,7 @@ import org.alfresco.util.Pair;
|
||||
|
||||
/**
|
||||
* Big test of AVM behavior.
|
||||
*
|
||||
*
|
||||
* @author britt
|
||||
*/
|
||||
public class AVMServiceTest extends AVMServiceTestBase
|
||||
@@ -612,6 +613,15 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
runQueriesForCreateAndDeploy("target");
|
||||
assertEquals(fService.lookup(-1, "main:/a/b/biz").getGuid(), fService.lookup(-1, "target:/a/b/biz").getGuid());
|
||||
fService.removeNode("main:/a/b/c/foo");
|
||||
fService.createFile("main:/a/b/c", "Foo").close();
|
||||
ContentWriter writer = fService.getContentWriter("main:/a/b/c/Foo");
|
||||
writer.setEncoding("UTF-8");
|
||||
writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
|
||||
writer.putContent("I am main:/a/b/c/foo");
|
||||
report = depService.deployDifference(-1, "main:/a", "localhost", 50500, "admin", "admin", "target:/a", matcher, false, false, false, null);
|
||||
System.out.println(report);
|
||||
assertEquals(DeploymentEvent.Type.UPDATED, report.iterator().next().getType());
|
||||
fService.removeNode("main:/a/b/c/foo");
|
||||
report = depService.deployDifference(-1, "main:/a", "localhost", 50500, "admin", "admin", "target:/a", matcher, false, true, false, null);
|
||||
runQueriesForCreateAndDeploy("target");
|
||||
System.out.println(report);
|
||||
@@ -5531,7 +5541,7 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
|
||||
/**
|
||||
* Test async indexing.
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void testAsyncIndex() throws Exception
|
||||
|
@@ -695,7 +695,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
private SortedMap<String, AVMNodeDescriptor>
|
||||
translateListing(Map<String, AVMNode> listing, Lookup lPath)
|
||||
{
|
||||
SortedMap<String, AVMNodeDescriptor> results = new TreeMap<String, AVMNodeDescriptor>();
|
||||
SortedMap<String, AVMNodeDescriptor> results = new TreeMap<String, AVMNodeDescriptor>(String.CASE_INSENSITIVE_ORDER);
|
||||
for (String name : listing.keySet())
|
||||
{
|
||||
// TODO consider doing this at a lower level.
|
||||
|
@@ -778,7 +778,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
return false;
|
||||
}
|
||||
// layer and underlying must match for flattening to be useful.
|
||||
if (!layer.getIndirection().equals(underlying.getPath()))
|
||||
if (!layer.getIndirection().equalsIgnoreCase(underlying.getPath()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -514,7 +514,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
public SortedMap<String, AVMNodeDescriptor> getListingDirect(AVMNodeDescriptor dir, boolean includeDeleted)
|
||||
{
|
||||
List<ChildEntry> children = AVMDAOs.Instance().fChildEntryDAO.getByParent(this);
|
||||
SortedMap<String, AVMNodeDescriptor> listing = new TreeMap<String, AVMNodeDescriptor>();
|
||||
SortedMap<String, AVMNodeDescriptor> listing = new TreeMap<String, AVMNodeDescriptor>(String.CASE_INSENSITIVE_ORDER);
|
||||
for (ChildEntry child : children)
|
||||
{
|
||||
AVMNode childNode = child.getChild();
|
||||
@@ -551,7 +551,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
{
|
||||
throw new AVMBadArgumentException("Illegal null argument.");
|
||||
}
|
||||
SortedMap<String, AVMNodeDescriptor> baseListing = new TreeMap<String, AVMNodeDescriptor>();
|
||||
SortedMap<String, AVMNodeDescriptor> baseListing = new TreeMap<String, AVMNodeDescriptor>(String.CASE_INSENSITIVE_ORDER);
|
||||
// If we are not opaque, get the underlying base listing.
|
||||
if (!fOpacity)
|
||||
{
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.alfresco.repo.avm;
|
||||
|
||||
@@ -19,22 +19,22 @@ public class LookupKey implements Serializable
|
||||
* The name of the store.
|
||||
*/
|
||||
private String fStoreName;
|
||||
|
||||
|
||||
/**
|
||||
* The path being looked up.
|
||||
*/
|
||||
private SimplePath fPath;
|
||||
|
||||
|
||||
/**
|
||||
* The version being looked up.
|
||||
*/
|
||||
private int fVersion;
|
||||
|
||||
|
||||
/**
|
||||
* Whether the lookup is a write lookup.
|
||||
*/
|
||||
private boolean fWrite;
|
||||
|
||||
|
||||
/**
|
||||
* Whether the lookup includes deleted nodes.
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ public class LookupKey implements Serializable
|
||||
* @param write Whether this is a write lookup.
|
||||
* @param includeDeleted Whether this lookup should include deleted items.
|
||||
*/
|
||||
public LookupKey(int version,
|
||||
public LookupKey(int version,
|
||||
SimplePath path,
|
||||
String storeName,
|
||||
boolean write,
|
||||
@@ -60,7 +60,7 @@ public class LookupKey implements Serializable
|
||||
fWrite = write;
|
||||
fIncludeDeleted = includeDeleted;
|
||||
}
|
||||
|
||||
|
||||
public LookupKey(LookupKey other)
|
||||
{
|
||||
fVersion = other.fVersion;
|
||||
@@ -69,7 +69,7 @@ public class LookupKey implements Serializable
|
||||
fWrite = other.fWrite;
|
||||
fIncludeDeleted = other.fIncludeDeleted;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the writeness of this key.
|
||||
*/
|
||||
@@ -86,7 +86,7 @@ public class LookupKey implements Serializable
|
||||
{
|
||||
return fStoreName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is this a write lookup.
|
||||
* @return Whether this is a write lookup.
|
||||
@@ -95,12 +95,12 @@ public class LookupKey implements Serializable
|
||||
{
|
||||
return fWrite;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
@@ -111,7 +111,7 @@ public class LookupKey implements Serializable
|
||||
return false;
|
||||
}
|
||||
LookupKey o = (LookupKey)obj;
|
||||
return fStoreName.equals(o.fStoreName) &&
|
||||
return fStoreName.equalsIgnoreCase(o.fStoreName) &&
|
||||
fVersion == o.fVersion &&
|
||||
fPath.equals(o.fPath) &&
|
||||
fWrite == o.fWrite &&
|
||||
@@ -122,9 +122,9 @@ public class LookupKey implements Serializable
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = fStoreName.hashCode();
|
||||
int hash = fStoreName.toLowerCase().hashCode();
|
||||
hash += fPath.hashCode();
|
||||
hash += fVersion;
|
||||
hash += fWrite ? 1 : 0;
|
||||
@@ -136,8 +136,8 @@ public class LookupKey implements Serializable
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
public String toString()
|
||||
{
|
||||
return fStoreName + ":" + fPath + "-" + fVersion + "-" + fWrite + "-" + fIncludeDeleted;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -163,7 +163,7 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
|
||||
{
|
||||
throw new AVMBadArgumentException("Path is null.");
|
||||
}
|
||||
SortedMap<String, AVMNodeDescriptor> result = new TreeMap<String, AVMNodeDescriptor>();
|
||||
SortedMap<String, AVMNodeDescriptor> result = new TreeMap<String, AVMNodeDescriptor>(String.CASE_INSENSITIVE_ORDER);
|
||||
List<ChildEntry> children = AVMDAOs.Instance().fChildEntryDAO.getByParent(this);
|
||||
for (ChildEntry child : children)
|
||||
{
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.alfresco.repo.avm.util;
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.io.Serializable;
|
||||
* Holds a simple path.
|
||||
* @author britt
|
||||
*/
|
||||
public class SimplePath implements Serializable
|
||||
public class SimplePath implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 2696828491008988470L;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class SimplePath implements Serializable
|
||||
* The names of the path's components.
|
||||
*/
|
||||
private String [] fNames;
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new one from a string.
|
||||
* @param path The String representation of the path.
|
||||
@@ -39,7 +39,7 @@ public class SimplePath implements Serializable
|
||||
}
|
||||
fNames = path.split("/+");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the component name at index.
|
||||
* @param index The index of the component to get.
|
||||
@@ -49,7 +49,7 @@ public class SimplePath implements Serializable
|
||||
{
|
||||
return fNames[index];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the number of components in this path.
|
||||
* @return The number of components.
|
||||
@@ -63,7 +63,7 @@ public class SimplePath implements Serializable
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ public class SimplePath implements Serializable
|
||||
}
|
||||
for (int i = 0; i < fNames.length; i++)
|
||||
{
|
||||
if (!fNames[i].equals(o.fNames[i]))
|
||||
if (!fNames[i].equalsIgnoreCase(o.fNames[i]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -92,12 +92,12 @@ public class SimplePath implements Serializable
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 0;
|
||||
for (String name : fNames)
|
||||
{
|
||||
hash += name.hashCode();
|
||||
hash += name.toLowerCase().hashCode();
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class SimplePath implements Serializable
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String name : fNames)
|
||||
|
Reference in New Issue
Block a user