More cleanup, fixing, and general futzing. A checkpoint.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2920 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-05-18 18:18:46 +00:00
parent 80215dd3a0
commit 1b4c08d1d4
11 changed files with 218 additions and 49 deletions

View File

@@ -75,7 +75,9 @@ public class Lookup
private int fPosition;
/**
* Create a new instance.
* Create a new one.
* @param repository The Repository that's being looked in.
* @param repName The name of that Repsository.
*/
public Lookup(Repository repository, String repName)
{
@@ -145,7 +147,8 @@ public class Lookup
}
/**
* Set the current node to one higher in the lookup.
* Set the current node to one higher in the lookup. This is used
* repeatedly during copy on write.
*/
public void upCurrentNode()
{
@@ -178,6 +181,8 @@ public class Lookup
{
return true;
}
// Walk up the containment chain and determine if each parent-child
// relationship is one of direct containment.
while (pos > 1)
{
DirectoryNode dir = (DirectoryNode)fComponents.get(pos - 1).getNode();
@@ -248,19 +253,17 @@ public class Lookup
}
LayeredDirectoryNode oNode =
(LayeredDirectoryNode)node;
if (oNode.getLayerID() == fTopLayer.getLayerID())
if (oNode.getLayerID() == fTopLayer.getLayerID() &&
oNode.hasPrimaryIndirection())
{
if (oNode.hasPrimaryIndirection())
StringBuilder builder = new StringBuilder();
builder.append(oNode.getUnderlying());
for (int i = pos + 1; i <= fPosition; i++)
{
StringBuilder builder = new StringBuilder();
builder.append(oNode.getUnderlying());
for (int i = pos + 1; i <= fPosition; i++)
{
builder.append("/");
builder.append(fComponents.get(i).getName());
}
return builder.toString();
builder.append("/");
builder.append(fComponents.get(i).getName());
}
return builder.toString();
}
}
// TODO This is gross. There has to be a neater way to do this.