cancel
Showing results for 
Search instead for 
Did you mean: 

How to add new content using WebScripts?

jaiatpm
Champ in-the-making
Champ in-the-making
Hi All,

I have created a custom content type using this article http://ecmarchitect.com/archives/2007/06/09/756

I have also created a webscript to read data using http://ecmarchitect.com/archives/2007/10/25/777

But I am struggling to find a way to create webscript that can add new content into the repository. We need to add content to Alfresco from non-java clients using HTTP POST (RESTfully). This particular content does not have any binary content associated.

Which classes in Alfresco API should I use to add content through WebScripts?

Thank you very much

Regards
Jeyaram
3 REPLIES 3

calle
Champ in-the-making
Champ in-the-making
Hi
I think you will find what you are looking for in this example: http://wiki.alfresco.com/wiki/Web_Scripts_Examples#File_Upload

If you need to add custom properties pass them with the request as parameters.

//Carl

handsum_z
Champ in-the-making
Champ in-the-making
would you please show me an example of how to pass custom properties as parameters? thanx
Regards

lista
Star Contributor
Star Contributor
Hi,

normally, you'd set a new name like this (for example):

node.properties["cm:name"] = new_value;

In order to do this with your new custom property, you need to include it's prefix. If we go by that article, then it's:

node.properties["sc:some_property"] = new_value;

Cheers!