[Hippo-cms7-user] RESTful API Support - Plain JAX-RS Services

Woonsan Ko w.ko at onehippo.com
Thu Sep 27 04:56:49 CEST 2012


On 9/25/12 12:42 PM, Chandan AGARWAL wrote:
> I am using JAX-B to map the ContentBlock object to
> ContentBlockRepresentation object. This object is returned by the
> restClient to the frontend of my site
>   In my ImageRepresentation object I have a variable called path in
> which i want to store the path of the image. The problem is that which
> path should i store so that i can display it in the jsp. I was able to
> display the variables like title and description as they are of string
> type but image is of type HippoGalleryImageSetBean.
>
> Could you suggest me the mapping for the  image type inorder to display
> it in the Jsp.

In your REST Service bean (which extends AbstractResource like you did), 
you can invoke #getSiteLink(requestContext, HippoBean), which returns a 
link object which you can use.
So, for example, if you have a requestContext and 
HippoGalleryImageSetBean, then you could invoke 
super.getSiteLink(requestContext, galleryImageSetBean.getThumbnail()) or 
super.getSiteLink(requestContext, galleryImageSetBean.getOriginal()).
You can also use the method for other documents to create proper website 
links.

Regards,

Woonsan



-- 
w.ko at onehippo.com     www.onehippo.com
Boston - 1 Broadway, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466


More information about the Hippo-cms7-user mailing list