1

I'm using Alfresco 5.1 Community, and i'm trying to get a property of an object for example, in the user we have:

"{http://www.alfresco.org/model/content/1.0}companytelephone"

If I want to get the value of this property, how can I obtain this in javascript?

Petter S
  • 49
  • 8

1 Answers1

3

It depends where you're trying to do this, if you're doing this in a JavaScript controller for a WebScript on the Repository then you will be able to find most of the information in this Wiki page: https://wiki.alfresco.com/wiki/JavaScript_API_Cookbook

If you're doing it in the JavaScript controller of a WebScript running on Share then for most objects you'll need to request the full metadata for the node by calling a REST API on the Repository.

In the case of the user, there is a "user" object available in WebScripts running on the Share tier.

There is lots of information on getting this kind of data with some basic Googling, I'd also recommend launching the Rhino debugger via the WebScripts index page so you can try evaluating JavaScript code (this works for both the Repository and for Share).

Dave Draper
  • 1,837
  • 11
  • 25