Search code examples
jsonapiparsingalfresco

Parse json from alfresco api


a need parse son from alfresco API, but I have problem with two slashes in URL model address. How can I get value from "prejimka.stavHodnoceni"? Can anyone help me ?

My javascript:

var nazevSlozky = null;

var result = remote.call("/api/metadata?nodeRef=workspace://SpacesStore/7d2eab73-9500-406a-bdb0-40209924b2d2");

var json = JSON.parse(result);

var nazevSlozky = json.properties.{http://ourFirm.cz/model/someFirm/3.0.}prejimka.stavHodnoceni;

JSON: My json


Solution

  • Try json.properties['sf:prejimka.stavHodnoceni'] where "sf" is the model abbreviation.

    Also, I don't think you want to use punctuation in your property names. I'm not sure it is expressly forbidden but it seems like a bad idea.