mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Retyped a counter so had to muck with many beans. Forced creation of layered directories
to work. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2930 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -61,7 +61,7 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
attrs.setLastModifier("britt");
|
||||
fData =
|
||||
new LayeredFileNodeBeanImpl(repo.getSuperRepository().issueID(),
|
||||
-1L,
|
||||
-1,
|
||||
-1L,
|
||||
null,
|
||||
null,
|
||||
@@ -98,7 +98,7 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
attrs.setLastModifier("britt");
|
||||
fData =
|
||||
new LayeredFileNodeBeanImpl(repos.getSuperRepository().issueID(),
|
||||
-1L,
|
||||
-1,
|
||||
-1L,
|
||||
null,
|
||||
null,
|
||||
@@ -125,7 +125,7 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
time,
|
||||
time);
|
||||
fData = new LayeredFileNodeBeanImpl(repo.getSuperRepository().issueID(),
|
||||
-1L,
|
||||
-1,
|
||||
-1L,
|
||||
null,
|
||||
null,
|
||||
@@ -143,10 +143,6 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
*/
|
||||
public void handlePostCopy(DirectoryNode parent)
|
||||
{
|
||||
if (parent != null)
|
||||
{
|
||||
setRepository(parent.getRepository());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,7 +154,7 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
// LayeredFileNodes are always copied.
|
||||
// TODO This is busted. Need to set the PlainFileNode contents
|
||||
// to share with underlying file node.
|
||||
PlainFileNode newMe = new PlainFileNode(getRepository());
|
||||
PlainFileNode newMe = new PlainFileNode(lPath.getRepository());
|
||||
newMe.setAncestor(this);
|
||||
return newMe;
|
||||
}
|
||||
@@ -167,7 +163,7 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
* Get the type of this node.
|
||||
* @return The type.
|
||||
*/
|
||||
public AVMNodeType getType()
|
||||
public int getType()
|
||||
{
|
||||
return AVMNodeType.LAYERED_FILE;
|
||||
}
|
||||
@@ -176,16 +172,16 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
* Get the content of the specified version.
|
||||
* @return A FileContent object.
|
||||
*/
|
||||
public FileContent getContentForRead(int version)
|
||||
public FileContent getContentForRead(int version, Repository repo)
|
||||
{
|
||||
Lookup lookup = getRepository().getSuperRepository().lookup(version, fData.getIndirection());
|
||||
Lookup lookup = repo.getSuperRepository().lookup(version, fData.getIndirection());
|
||||
AVMNode node = lookup.getCurrentNode();
|
||||
if (!(node instanceof FileNode))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Missing Link.");
|
||||
}
|
||||
FileNode file = (FileNode)node;
|
||||
return file.getContentForRead(version);
|
||||
return file.getContentForRead(version, repo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,4 +200,12 @@ public class LayeredFileNode extends FileNode implements Layered
|
||||
{
|
||||
return fData.getIndirection();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
public String toString(Lookup lPath)
|
||||
{
|
||||
return "[LF:" + fData.getId() + ":" + fData.getIndirection() + "]";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user