- Added extension sample project to contain extenstion samples and used to test extension capabilities

- Added contentHits sample aspect that, when applied, counts the number of times a node of content is read and updated.
- Fix to web service sample
- Prevented onContentRead policy being fired when content is updated.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2287 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2006-02-02 16:37:36 +00:00
parent 21eab8566f
commit 2af1438c2e
4 changed files with 7 additions and 127 deletions

View File

@@ -233,6 +233,11 @@ public class RoutingContentService implements ContentService
}
public ContentReader getReader(NodeRef nodeRef, QName propertyQName)
{
return getReader(nodeRef, propertyQName, true);
}
private ContentReader getReader(NodeRef nodeRef, QName propertyQName, boolean fireContentReadPolicy)
{
// ensure that the node property is of type content
PropertyDefinition contentPropDef = dictionaryService.getProperty(propertyQName);
@@ -263,7 +268,7 @@ public class RoutingContentService implements ContentService
reader.setEncoding(contentData.getEncoding());
// Fire the content read policy
if (reader != null)
if (reader != null && fireContentReadPolicy == true)
{
// Fire the content update policy
Set<QName> types = new HashSet<QName>(this.nodeService.getAspects(nodeRef));
@@ -280,7 +285,7 @@ public class RoutingContentService implements ContentService
public ContentWriter getWriter(NodeRef nodeRef, QName propertyQName, boolean update)
{
// check for an existing URL - the get of the reader will perform type checking
ContentReader existingContentReader = getReader(nodeRef, propertyQName);
ContentReader existingContentReader = getReader(nodeRef, propertyQName, false);
// TODO: Choose the store to write to at runtime