views:

54

answers:

1

Hi there, I first apologize for my poor english level and maybe for the stupidity of my question ;)

I am on an alfresco project to learn how it works.

I have to browse programatically my content repository and gather datas all along. In order to do that I guessed I had to use a ContentReader (I get from my ContentService) but the method getReader wants a nodeRef and a propertyQualifiedName.

I am ok with the nodeRef, I get what it's needed for.

But the propertyQualifiedName puzzles me, I barely get what it is but I frankly don't get how it is used.

Reading some alfresco forum threads I get more and more scared that I dont even get how a reader works, I somewhere saw that a reader can read only one node and only one time per instance.

If anyone knows a bit about the Java API for Alfresco Content Repository use I am all hears !

Cheers all !

+1  A: 

ContentReader is a wrapper class for the content of a given property of a node. So, in order to get an instance of ContentReader you'll have to give the node from which you the property from and the property qualified name.

As for the qualified name, every node property is identified by the conjunction of two string values:

  • The property namespace. Usually an uri like "http://www.alfresco.org/model/content/1.0"
  • The property local name. Usually a simple string like "created".

These two values put together constitute the property qualified name. There are constants defined for most standard properties of the alfresco model in the org.alfresco.model.ContentModel interface. For example, to get the creator of a node you would do something like:

contentService.getReader(myNode, ContentModel.PROP_CREATOR).getContentString();
Hugo Palma
Thanks for the clarification ! Helps a lot !
Ar3s