cancel
Showing results for 
Search instead for 
Did you mean: 

How to read aspect properties?

kumbach
Champ in-the-making
Champ in-the-making
I must be missing something or else I've hit yet another frustrating limitation of web services…

I'm using WebServiceFactory.getRepositoryService().get() to retrieve a node. The node has several custom aspects of which I want to retrieve the properties of.

But, I can't see any way to extract the custom aspect properties. Is this possible? I've looked in the web service wiki section, the examples, and on the web with no success.

Kevin
6 REPLIES 6

vsuarez
Champ in-the-making
Champ in-the-making
In the web client, you can use the node browser to discover the full names of the the Alfresco objects' properties. You can find the node-browser in the administration console, and then following "workspace://SpacesStore"/ link and next ones.

Then you can retrieve the node properties by their (exact) names: "{http://www.alfresco.org/model/content/1.0}title", "{http://www.alfresco.org/model/content/1.0}author",…

kumbach
Champ in-the-making
Champ in-the-making
Thanks, that is a good way to get the full name of the properties. My problem now is that even though I know the property name, I don't know the method to call to retrieve the property value. In the foundation services, I have used the NodeService to do this. However, I don't think NodeService is implemented in the WebService client. Therefore I don't see a way to get the property values.

vsuarez
Champ in-the-making
Champ in-the-making
In the Repository Service there is a get() method which returns a Node object. Then you can call Node.getProperties() that returns a list of NamedValue objects, one per node property (note they can be multivalued).

kumbach
Champ in-the-making
Champ in-the-making
Forget this post. I figured the problem out.

kumbach
Champ in-the-making
Champ in-the-making
In the Repository Service there is a get() method which returns a Node object. Then you can call Node.getProperties() that returns a list of NamedValue objects, one per node property (note they can be multivalued).

What I was seeing was that node.getProperties() was only returning the base Alfresco properties, not the properties for my custom aspects. It turns out the node I chose for testing didn't have the properties I was looking for. Silly mistake….

vekariyakeyur
Champ in-the-making
Champ in-the-making
Is there any way to get node.getProperties() by it's name rather than iterating it ?