Nuxeo - OpenSocial
-
Upload
thomas-roger -
Category
Technology
-
view
1.495 -
download
0
Transcript of Nuxeo - OpenSocial
Open Source ECM
2011 - Thomas Roger - [email protected] - @throger
Nuxeo - OpenSocialLeveraging OpenSocial withinthe Nuxeo Platorm
Why OpenSocial?Common standard used in the enterpriseEasy for developers HTTP, XML, HTML, JavaScript and RESTful APIs
Gadgets as reusable blocks
2
GWT Container
3
Contributed by Leroy MerlinApache Shindig + GWT2Easier to integrate in your applicationLighter & faster!
4
5
Implement a new SpaceProviderMySpaceProvider extends AbstractSpaceProvider { ... }
Create your own dashboardGWT Container
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
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
Lightweight Container
8
Why? Simple gadget integration Static positioning in the pageHow? JS container from Apache Shindig jQuery plugin available Simple to use!
<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
<div class="polls gadgets-gadget-chrome gadgets"></div>
10
HTMLLightweight container
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
12
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
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
15
Gadget SpecRendered through FreemarkerPredefined Freemarker templatesJS context injected
16
Automation JS LibraryLibrary to be used in gadgetsCall Nuxeo automationHandle OAuth authenticationEasy to use!
17
<script src="${specDirectoryUrl}default-automation-request.js"></script>
...
<#include "default-request-controls.ftl"/>
18
IncludesAutomation JS library
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
function myCallback(response, params) { var docs = response.data.entries; ...}
20
Querying documentsAutomation JS library
<script src="${specDirectoryUrl}default-documentlist-display.js"></script>...<#include "default-documentlist-layout.ftl"/>...var requestParams = { ... displayMethod: displayDocumentList,};
21
Easy document listingAutomation JS library
Nuxeo IDEGadget templatesDefault gadget structure, contributionFully OpenSocialSupports hot reload!
22
Standard gadget OAuth authentication InternationalizationAutomation gadget Automation JS library Document listing JS library 23
Gadget templatesNuxeo IDE
Thank you!
24