Using essentials Rest Services Setup on documents with custom compounds

29 views
Skip to first unread message

Martijn van der Vorst

unread,
Nov 26, 2015, 9:50:04 AM11/26/15
to Hippo Community
Hello,

I'm not sure if this is a bug or simply hasn't been added yet, but when creating a Rest Service using the setup provided in Essentials, it only outputs methods which return the standard hippo fields.

If you've added custom compounds (or content blocks) it simply ignores them and you have to manually add all the annotations to the underlying compounds.

For example:

Document A
-- String title
-- HippoHtml html
-- CustomCompound custom

CustomCompound
-- String title
-- String Introduction


Will output:
only title and html from Document A but completely ignore the CustomCompound custom when generating the rest service.

I've also found that it only adds the first restservice bean to the spring-plain-rest-api.xml any subsequent services need to be added manually.

It's not a massive problem, the additional manual steps are few and easily done, but it's somewhat inconsistent with the documentation.

Kind regards,
Martijn van der Vorst

Bert Leunis

unread,
Nov 27, 2015, 5:07:55 AM11/27/15
to Hippo Community
On Thu, Nov 26, 2015 at 3:50 PM, Martijn van der Vorst <martijn.va...@indivirtual.com> wrote:
Hello,

I'm not sure if this is a bug or simply hasn't been added yet, but when creating a Rest Service using the setup provided in Essentials, it only outputs methods which return the standard hippo fields.

If you've added custom compounds (or content blocks) it simply ignores them and you have to manually add all the annotations to the underlying compounds.

For example:

Document A
-- String title
-- HippoHtml html
-- CustomCompound custom

CustomCompound
-- String title
-- String Introduction


Will output:
only title and html from Document A but completely ignore the CustomCompound custom when generating the rest service.
I tried it out myself and you're right: the getter for the custom compound on the document bean did not get the @XmlAttribute annotation. That may be an easy addition. If you select the custom compound bean in the rest setup then it gets all the necessary annotation there too.

The rest service tool is at the moment a shoot-once tool. If rest configuration is already once added to the project, the tool does not pick that up. Like the way that the Gallery manager tool does for example. We definitely have some improvement points still to work out, see for example an issue like [1]. What I also think about this Rest tool is that it is more a demo feature than giving you full and extensive support in building a rest service. The requirements for building such a service can be so diverse, I don't think it can be supported easily by a tool like this. You will always need developers building the project specifc code.

Regards, Bert

 

I've also found that it only adds the first restservice bean to the spring-plain-rest-api.xml any subsequent services need to be added manually.

It's not a massive problem, the additional manual steps are few and easily done, but it's somewhat inconsistent with the documentation.

Kind regards,
Martijn van der Vorst

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages