cancel
Showing results for 
Search instead for 
Did you mean: 

meta data details called using webscripts

ranj
Champ on-the-rise
Champ on-the-rise
Hi.
created a simple contnet in share called "sample".Using fdk i created a form for a type. after changing the type successfully, i can edit the metadata and save.
the form contains name,description,image fields.
so now that i have attcahed an image with the form(meta data details of "sample"), how can i retrieve or call the image,description using webscripts?Need some help on this. Smiley Sad

Thanks in advance.
4 REPLIES 4

ranj
Champ on-the-rise
Champ on-the-rise
hi,
i have created a content of article type.in edit properties, the properties have primary image field. i have mapped an image to it. how do i get the primary image of that article in webscript. this image i need to display in website.

erikwinlof
Confirmed Champ
Confirmed Champ
If you login as admin to your alfresco repository webscript pages on http://localhost:8080/alfresco/service/index you will be able to see all the webscripts that are available if you click on "Browse by Web Script URI".

One alternative is to use the following webscript to get metadata back in json format:
http://localhost:8081/share/proxy/alfresco/api/metadata?nodeRef=workspace://SpacesStore/7edc8a54-276...

…and to get the content you can do:
http://localhost:8081/share/proxy/alfresco/api/node/content/workspace/SpacesStore/7edc8a54-276d-487c...

Cheers, Erik

ranj
Champ on-the-rise
Champ on-the-rise
hi,
Thanks for ur reply.
But this is not what i want.
I am not trying to get the content of a file (ex. datadictionary->sites->mysite->test->sample.html).

But am trying to get properties of sample.html.
i have changed the type of sample.html to article type.
after clicking edit properties, i see a list of properties to be filled.
name,description,primary image,secondary image.
i have set an image(ex. datadictionary->sites->mysite->images->lotus.jpg) as primary image.

how do i call the primary image of sample.html through webscripts?

Regards,
Ranj

erikwinlof
Confirmed Champ
Confirmed Champ
Hi again Ranj, let's hope I'm more correct this time then 🙂

Have you taken a close look at this webscript?
http://localhost:8080/alfresco/service/script/org/alfresco/cmis/content.get

It is the same one that I used to display the actual content of the node (which in your case turned out to be html), but you should be able to use it to display a property of a node as well by specifying the {property} in the url. So try something like this instead…

http://localhost:8081/share/proxy/alfresco/api/node/contentranj:primaryImage/workspace/SpacesStore/7...

Where "ranjSmiley TonguerimaryImage" of course is the name of your custom property.

Cheers, Erik