Entando rest api

13

description

Entando @Devoxx present THE ADVANTAGE OF USING REST API’S IN PORTAL PLATFORMS TO EXTEND THE REACH OF THE PORTAL. While JSR-311 is part of J2EE6, we decided to use it within our OS Portal platform Entando, to allow the exchange of information between external systems. The session will start with an intro to Entando. We will also create an example that will provide an overview of how to develop a service that publishes Open Data on multiple devices (smartphones, tablets...) The aim will be to show how using REST API’s we can extend the reach of a portal and its adoption in an organisation. Entando is an OS Java based portal platform that allows developers to easily make vertical applications or develop & deploy enterprise portals including rich CMS capabilities. Our commitment to remain open source & our passion for opening the world of web to those with visual impairments has made us successful in government sectors & we will profile some success stories of our use of REST API’s in large government deployments in Italy including the Civil protection & the Ministry of Justice.

Transcript of Entando rest api

Page 1: Entando rest api
Page 2: Entando rest api

The advantage of Using Rest API’s

in Portal Platforms to extend the

reach of the portal.

www.entando.com

[email protected]

Page 3: Entando rest api

About Entando

Portal, web CMS and web framework all in one platform

3

Social Citizen Engagement

Social Media

Portal, Mobile App, Social

Networks

Analytics

Page 4: Entando rest api

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

■ …

4

Page 5: Entando rest api

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=CNG

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

■ All response need to be Self Documented

■ …

5

Page 6: Entando rest api

Building a CardManager (Api Definition)

Page 7: Entando rest api

Building a CardManager (Bean Definition)

Page 8: Entando rest api

8

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 9: Entando rest api

Entando & Rest API

Page 10: Entando rest api

Entando & Rest API

Page 11: Entando rest api

Small, Medium and Large Govs

11

www.entando.co

m

Page 12: Entando rest api

Thank you

12

[email protected]

@EntandoSrl

Entando

@ Entando

Follow us

www.entando.co

m www.entando.com

m

https://github.com/entando

Page 13: Entando rest api

Q&A