AVM Nodes are (theoretically) mostly aspect ready. AVMNodeService is

now derived from AbstractNodeServiceImpl to make policy awareness easier.
Moved addDefaultPropertyValues from DbNodeServiceImpl to 
AbstractNodeServiceImpl so AVMNodeService can use it.  A fix for an
NPE that showed up in stress test.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3603 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-08-24 18:36:59 +00:00
parent d67b926589
commit 0606fa3ab6
15 changed files with 252 additions and 619 deletions

View File

@@ -268,7 +268,6 @@ class AVMStoreImpl implements AVMStore, Serializable
"UTF-8"));
ContentWriter writer = getWriter(AVMNodeConverter.ExtendAVMPath(path, name));
writer.putContent(data);
file.setContentData(writer.getContentData());
}
/**
@@ -302,6 +301,12 @@ class AVMStoreImpl implements AVMStore, Serializable
public InputStream getInputStream(int version, String path)
{
ContentReader reader = getReader(version, path);
if (reader == null)
{
// TODO This is wrong, wrong, wrong. Do something about it
// sooner rather than later.
throw new AVMNotFoundException(path + " has no content.");
}
return reader.getContentInputStream();
/*
Lookup lPath = lookup(version, path, false);
@@ -323,7 +328,7 @@ class AVMStoreImpl implements AVMStore, Serializable
* @param path The path to the file.
* @return A ContentReader.
*/
public ContentReader getReader(int version, String path)
private ContentReader getReader(int version, String path)
{
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(version, fName + ":" + path);
return AVMContext.fgInstance.getContentService().getReader(nodeRef, ContentModel.PROP_CONTENT);
@@ -334,11 +339,12 @@ class AVMStoreImpl implements AVMStore, Serializable
* @param path The path to the file.
* @return A ContentWriter.
*/
public ContentWriter getWriter(String path)
private ContentWriter getWriter(String path)
{
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, fName + ":" + path);
ContentWriter writer =
AVMContext.fgInstance.getContentService().getWriter(nodeRef, ContentModel.PROP_CONTENT, true);
// TODO This can't perform very well.
setContentData(path, writer.getContentData());
return writer;
}