Nuxeo - OpenSocial

24
Open Source ECM 2011 - Thomas Roger - [email protected] - @throger Nuxeo - OpenSocial Leveraging OpenSocial within the Nuxeo Platorm

Transcript of Nuxeo - OpenSocial

Page 1: Nuxeo - OpenSocial

Open Source ECM

2011 - Thomas Roger - [email protected] - @throger

Nuxeo - OpenSocialLeveraging OpenSocial withinthe Nuxeo Platorm

Page 2: Nuxeo - OpenSocial

Why OpenSocial?Common standard used in the enterpriseEasy for developers HTTP, XML, HTML, JavaScript and RESTful APIs

Gadgets as reusable blocks

2

Page 3: Nuxeo - OpenSocial

GWT Container

3

Contributed by Leroy MerlinApache Shindig + GWT2Easier to integrate in your applicationLighter & faster!

Page 4: Nuxeo - OpenSocial

4

Page 5: Nuxeo - OpenSocial

5

Implement a new SpaceProviderMySpaceProvider extends AbstractSpaceProvider { ... }

Create your own dashboardGWT Container

Page 6: Nuxeo - OpenSocial

6

Implement a new SpaceProviderMySpaceProvider extends AbstractSpaceProvider { ... }

Contribute it<extension target="org.nuxeo.ecm.spaces.core.spacemanager.service point="spaceProviders"> <spaceProvider name="mySpaceProvider"> <class>org.nuxeo.sample.MySpaceProvider</class> </spaceProvider></extension>

Create your own dashboardGWT Container

Page 7: Nuxeo - OpenSocial

7

<nxu:set var="repositoryName" value="#{navigationContext.currentServerLocation.name}"><nxu:set var="spaceProviderName" value="mySpaceProvider"> <ui:decorate template="/incl/opensocial_container_template.xhtml"> </ui:decorate></nxu:set></nxu:set>

Use it in your pageGWT Container

Page 8: Nuxeo - OpenSocial

Lightweight Container

8

Why? Simple gadget integration Static positioning in the pageHow? JS container from Apache Shindig jQuery plugin available Simple to use!

Page 9: Nuxeo - OpenSocial

<link href="#{baseURL}css/opensocial/light-container-gadgets.css"></link><script src="#{baseURL}opensocial/gadgets/js/rpc.js?c=1"></script><script src="#{baseURL}js/?scripts=opensocial/cookies.js|opensocial/util.js|opensocial/gadgets.js|opensocial/cookiebaseduserprefstore.js|opensocial/jquery.opensocial.gadget.js"></script>

9

IncludesLightweight container

Page 10: Nuxeo - OpenSocial

<div class="polls gadgets-gadget-chrome gadgets"></div>

10

HTMLLightweight container

Page 11: Nuxeo - OpenSocial

jQuery('.polls').openSocialGadget({ baseURL: '#{baseURL}', language: '#{localeSelector.language}', gadgetDefs: [{ specUrl: '#{gadgetsBaseURL}/site/gadgets/polls/polls.xml', title: '#{messages['label.poll.result']}', displayTitleBar: false, width: '100%' }]});

11

Loading the polls gadgetLightweight container

Page 12: Nuxeo - OpenSocial

12

Page 13: Nuxeo - OpenSocial

Nuxeo supports OAuth authenticationConnect to third party services supporting OAuth, like Google Docs

OAuth authentication in gadgets<ModulePrefs> <#include "default-oauth-prefs.ftl"/></ModulePrefs>

13

OAuth

Page 14: Nuxeo - OpenSocial

14

Most of our gadgets are fully OpenSocialWork on other OpenSocial containers: iGoogle, JIRA, ...Nuxeo can use external gadgets (those available on iGoogle for instance)

Following the Standard

Page 15: Nuxeo - OpenSocial

15

Page 16: Nuxeo - OpenSocial

Gadget SpecRendered through FreemarkerPredefined Freemarker templatesJS context injected

16

Page 17: Nuxeo - OpenSocial

Automation JS LibraryLibrary to be used in gadgetsCall Nuxeo automationHandle OAuth authenticationEasy to use!

17

Page 18: Nuxeo - OpenSocial

<script src="${specDirectoryUrl}default-automation-request.js"></script>

...

<#include "default-request-controls.ftl"/>

18

IncludesAutomation JS library

Page 19: Nuxeo - OpenSocial

var requestParams = { operationId: 'Document.PageProvider', operationParameters: { pageSize: 5, query: ‘SELECT * FROM Document’ operationContext: {}, operationDocumentProperties: "common,dublincore", entityType: 'documents', operationCallback: myCallback, noEntryLabel: '__MSG_label.gadget.no.document__'};doAutomationRequest(requestParams) 19

Querying documentsAutomation JS library

Page 20: Nuxeo - OpenSocial

function myCallback(response, params) { var docs = response.data.entries; ...}

20

Querying documentsAutomation JS library

Page 21: Nuxeo - OpenSocial

<script src="${specDirectoryUrl}default-documentlist-display.js"></script>...<#include "default-documentlist-layout.ftl"/>...var requestParams = { ... displayMethod: displayDocumentList,};

21

Easy document listingAutomation JS library

Page 22: Nuxeo - OpenSocial

Nuxeo IDEGadget templatesDefault gadget structure, contributionFully OpenSocialSupports hot reload!

22

Page 23: Nuxeo - OpenSocial

Standard gadget OAuth authentication InternationalizationAutomation gadget Automation JS library Document listing JS library 23

Gadget templatesNuxeo IDE

Page 24: Nuxeo - OpenSocial

Thank you!

24