From 2af1438c2e9aa88695dcd3fb5463bdf5c5a66a2a Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Thu, 2 Feb 2006 16:37:36 +0000 Subject: [PATCH] - 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 --- config/alfresco/extension/customModel.xml | 28 ------- config/alfresco/extension/exampleModel.xml | 79 ------------------- .../alfresco/extension/extension-context.xml | 18 ----- .../repo/content/RoutingContentService.java | 9 ++- 4 files changed, 7 insertions(+), 127 deletions(-) delete mode 100644 config/alfresco/extension/customModel.xml delete mode 100644 config/alfresco/extension/exampleModel.xml delete mode 100644 config/alfresco/extension/extension-context.xml diff --git a/config/alfresco/extension/customModel.xml b/config/alfresco/extension/customModel.xml deleted file mode 100644 index 283f781b87..0000000000 --- a/config/alfresco/extension/customModel.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - Custom Model - - 1.0 - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/config/alfresco/extension/exampleModel.xml b/config/alfresco/extension/exampleModel.xml deleted file mode 100644 index 4d60d17332..0000000000 --- a/config/alfresco/extension/exampleModel.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - Example custom Model - - 1.0 - - - - - - - - - - - - - - - - - - - - Standard Operating Procedure - cm:content - - - d:datetime - - - d:text - - - - - - cm:content - false - false - - - - - cm:content - false - true - - - - - - - - - - Image Classfication - - - d:int - - - d:int - - - d:int - - - - - - \ No newline at end of file diff --git a/config/alfresco/extension/extension-context.xml b/config/alfresco/extension/extension-context.xml deleted file mode 100644 index ef063ec596..0000000000 --- a/config/alfresco/extension/extension-context.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - alfresco/extension/exampleModel.xml - alfresco/extension/customModel.xml - - - - - diff --git a/source/java/org/alfresco/repo/content/RoutingContentService.java b/source/java/org/alfresco/repo/content/RoutingContentService.java index 9e3a0fc356..9cf753c5e8 100644 --- a/source/java/org/alfresco/repo/content/RoutingContentService.java +++ b/source/java/org/alfresco/repo/content/RoutingContentService.java @@ -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 types = new HashSet(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