Hey there,
I am trying to save my pageproperties via API-Call.
Unfortunately it doesn't work
When I try to save I get a 207 status and the properties are not saved
Here is my Code in JavaScript:
Thanks in advance.Code:/** * Sets the Page Properties * @param page_path path of the new page * @param properties map of properties */ var setPageProperties = function(page_path, properties) { var api_properties = Deki.$('<properties></properties>'); for(var key in properties) { var propertyname = key; var propertytext = properties[key]; $('<property></property>').attr('name', propertyname) .append('<contents>'+propertytext+'</contents>').attr('type','text/plain') .appendTo(api_properties); } api_properties = '<properties>'+api_properties.html()+'</properties>'; alert(api_properties); var pageapi = '/@api/deki/pages/=' + Deki.url.encode(Deki.url.encode(page_path)); $.ajax({ url: pageapi + '/properties', type: 'PUT', contentType: 'text/xml', processData: true, data: api_properties, complete: function(xhr) { if(xhr.status == 200) { //gets executed when properties get set successfully. loadPage(page_path); } else { //alert('Unable to create/modify Page Properties. Perhaps you do not have permission.'); alert(xhr.status); } } }); }
Regards,
Senad




Reply With Quote
