This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Login / Editing objects with AJAX
expandshrink

Login / Editing objects with AJAX

Login / Editing objects with AJAX

Friday 29 August 2008 2:52:06 pm - 9 replies

Hello

I would like to know if it was possible to login to eZPublish and edit content objects via AJAX and/or webservices... Indeed, I would like to allow my visitors to edit comments without having to display a dedicated page for the form (for example with a DIV fading in the page of the current viewed article).
Moreover, I plan to develop a webapp (or native Application like Wordpress has) for iPhone allowing contributors to manage content of their website on the iPhone. But I wonder how eZPublish can manage publishing this way...
Any idea ?

Thanks

Saturday 30 August 2008 12:06:26 pm

Hi Jérôme,

as far as i know, ezPublish has a build-in SOAP server, so it should be possible to create an extension providing a webservice for editing object (or: creating comment objects, in your case).
But, if your client as a webbrowser, i guess, it's much easier to create an eZ publish template, which fits your need.
If i understand you right, you want to have a "comment box" inside the normal "view" template. I think, this should be possible by merging the "content/view/full" template with the "content/edit" template.
That is: insert the form of the edit template of the "comment" class into the "full view" template of the article/folder/product/whatever-template.

Just a wild guess, but that would be my approach.

Sunday 31 August 2008 12:27:40 am

That is: insert the form of the edit template of the "comment" class into the "full view" template of the article/folder/product/whatever-template.

You'll need a custom view for that as well, the normal content/edit view creates a draft on every view so wouldn't work in this setting.

Monday 01 September 2008 11:12:17 am

Not really Ajax, but it avoids the creation of drafts when displaying a form:

http://projects.ez.no/powercontent

Monday 01 September 2008 11:31:31 am

Thanks all for your replies happy.gif Emoticon
Wouldn't it be easier if I called the content/edit view via AJAX ? I mean, for example a user clicks on "New comment" button which makes appear the comment box in javascript. The JS code then makes an AJAX call to display the right form... Of course I should first make an override rule for the pagelayout so that only the form would appear.
But what if the user closes the window without clicking on the Cancel button ? Is there a cronjob to clean the empty drafts ?

Monday 01 September 2008 11:39:51 am

With the powercontent contrib, you won't have an empty draft. Ajaxify this mechanism would be a good option, but you can already have the quick comment form with some DHTML operating on a display attribute

Hth
Paul

Monday 01 September 2008 12:06:34 pm

If I understand well this extension, I just have to "prepare" my comment form in a hidden DIV, for example with the help of the <i>powercontent_attribute_create_gui</i> function.
My form doesn't submit to <i>/content/action</i> any more, but to <i>/powercontent/action</i>.
Then when the user clicks on the submit button, the comment will automatically be published ? If so, it's exactly what I need happy.gif Emoticon

About the SOAP API, is there a place where I can find up-to-date documentation ?

Modified on Monday 01 September 2008 12:16:47 pm by Jérôme Vieilledent

Tuesday 02 September 2008 10:15:51 pm

Hi,

that's exactly the way it works indeed.

There is an option (hidden field) to automatically publish the content, don't forget to set it so you can come back to the page.

X+

P.S. You will have problems with spams, and some captcha extensions don't work with powercontent... ended up dirty tweeking, but might be a better option out there.

Monday 08 September 2008 5:03:14 pm

You will have problems with spams, and some captcha extensions don't work with powercontent... ended up dirty tweeking, but might be a better option out there.

In my case, only registered users would be able to post comments, so I think this extension exactly suits my needs happy.gif Emoticon

Friday 18 June 2010 3:10:46 pm

@Jerome: take a look at ezwebservicesapi

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from