Top Banner
14

Devoxx2012 Entando restapi

Aug 31, 2014

Download

Technology

Rinaldo Bonazzo

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Devoxx2012 Entando restapi
Page 2: Devoxx2012 Entando restapi

The advantage of Using Rest API’s in Portal Platforms to

extend the reach of the portal.

Rinaldo BonazzoPre-Sales Engineer

Entando Srl@RinaldoBonazzo

Page 3: Devoxx2012 Entando restapi

3

Rinaldo BonazzoSpeaker Bio■ Over 30 years experience in the IT world.

Passionate about new technology and always open to new solution.

■ My Last projects■ Entando ■ Optibirth■ European community Project Manager(Eurovet II, Optibirth,

…)■ aDoc, …

Page 4: Devoxx2012 Entando restapi

About Entando

Portal, web CMS and web framework all in one platform

4

Page 5: Devoxx2012 Entando restapi

Why Rest Api’s ■ Rich web clients can talk directly with your Application■ Useful when you have to integrate multiple different clients■ RESTful way takes less effort■Works Out of the Box no setup, just a design model■ Standardize Development ■ Standard API - Creating an API on standards that already exist

makes it much easier for application developers to use your API■…

5

Page 6: Devoxx2012 Entando restapi

Entando Guideline■ Entando REST Api’s need to provides access to data &

services via a standard JSON/XML-based Api■  All Entando REST Api’s resources need to be accessed using

a base URI<APPLICATION_BASE_URL>/api/rs/<LANG_CODE>/<NAMESPACE>/<RESOURCE_NAME>.<EXTENSION>?<QUERY_STRING>

myportal.com/api/rs/en/jcms/contents?contentType=CNGmyportal.com/api/rs/en/jcms/content.json?id=CNG51

■ All response need to be Self Documented■…

6

Page 7: Devoxx2012 Entando restapi

Building a CardManager (Api Definition)

Page 8: Devoxx2012 Entando restapi

Building a CardManager (Bean Definition)

Page 9: Devoxx2012 Entando restapi

9

Building a CardManager public class CardManager {

public List<Card> getCardsForApi(Properties properties) throws Throwable {

String holder = properties.getProperty("holder");

return this.searchCards(holder);

}

public Card getCardForApi(Properties properties) throws Throwable {

String idString = properties.getProperty("id");

int id = 0;

try {

id = Integer.parseInt(idString);

} catch (NumberFormatException e) { throw new ApiException(IApiErrorCodes.API_PARAMETER_VALIDATION_ERROR, "Invalid number format for 'id' parameter - '" + idString + "'", Response.Status.CONFLICT);

}…

Page 10: Devoxx2012 Entando restapi

Entando & Rest API

Page 11: Devoxx2012 Entando restapi

Entando & Rest API

Page 12: Devoxx2012 Entando restapi

Small, Medium and Large Govs

12

www.entando.com

Page 13: Devoxx2012 Entando restapi

Thank you

13

[email protected]

@EntandoSrl

Entando

@ Entando

Follow us

www.entando.com www.entando.c

ommhttps://github.com/entando

Page 14: Devoxx2012 Entando restapi

Q&A