aranami's picture
From aranami rss RSS  subscribe Subscribe

Webscripts in an Alfresco REST Architecture 



 

 
 
Tags:  architecture  enterprise  webscripts  wcm  web scripts  management  ecm  opentext  enterprise content management  content  filenet  web  document  alfresco 
Views:  3318
Downloads:  28
Published:  December 23, 2009
 
0
download

Share plick with friends Share
save to favorite
Report Abuse Report Abuse
 
Related Plicks
Auto Content Cash Review | Amazing Bonus!

Auto Content Cash Review | Amazing Bonus!

From: jh12
Views: 297 Comments: 0
http://ppc-loophole-bonus.blogspot.com/2010/02/auto-content-cash.html - PLEASE DON'T SHARE OUR $5,900 Auto Content Cash BONUS PAGE TO ANYONE!
 
See all 
 
More from this user
EMBELLECEDORES MASCULINOS

EMBELLECEDORES MASCULINOS

From: aranami
Views: 146
Comments: 0

[Finance]Learn How To Get Free Debt Relief Advice[5337]

[Finance]Learn How To Get Free Debt Relief Advice[5337]

From: aranami
Views: 197
Comments: 0

Communicate With Personalized Color For Better Results

Communicate With Personalized Color For Better Results

From: aranami
Views: 327
Comments: 0

Diapositivas Pedagogia Critica

Diapositivas Pedagogia Critica

From: aranami
Views: 3019
Comments: 0

Belize Real Estate - Belize Tourist for a Second and a Resident in the Next

Belize Real Estate - Belize Tourist for a Second and a Resident in the Next

From: aranami
Views: 12
Comments: 0

Ugg dakota

Ugg dakota

From: aranami
Views: 5
Comments: 0

See all 
 
 
 URL:          AddThis Social Bookmark Button
Embed Thin Player: (fits in most blogs)
Embed Full Player :
 
 

Name

Email (will NOT be shown to other users)

 

 
 
Comments: (watch)
plicker loan (3 months ago)
The loan are useful for guys, which want to organize their company. By the way, that is very easy to get a car loan.
plicker CathrynGross30 (3 months ago)
The <a href="http://goodfinance-blog.com">loan</a> are useful for guys, which want to organize their company. By the way, that is very easy to get a car loan.
 
 
Notes:
 
Slide 1: Using Web Scripts in a REST-based Architecture Richard Im Solutions Engineer www.alfresco.com See the recorded webinar here: http://snurl.com/webscripts
Slide 2: Agenda: * What is REST? * What is a Web Script? * Common uses of Web Scripts * Review a Web Script for UI components * Review a Web Script for data retrieval * Sample. See the recorded webinar here: http://snurl.com/webscripts
Slide 3: What is REST? Acronym for: Representational State Transfer ● An architectural style. Systems following these principles referred to as 'RESTful' ● Resources are URL-Addressable. Easy utilizing HTTP Methods: GET, POST, PUT, DELETE. ● “REST strictly refers to a collection of network architecture principles which outline how resources are defined and addressed. ● The term is often used in a looser sense to describe any simple interface which transmits domain-specific data over HTTP without an additional messaging layer such as SOAP or session tracking via HTTP cookies.” See the recorded webinar here: http://snurl.com/webscripts
Slide 4: The Principles of REST Key Rest Principles ● Application state and functionality are abstracted into resources ● Every resource is uniquely addressable using a universal syntax for use in hypermedia links ● All resources share a uniform interface for the transfer of state between client and resource, consisting of •A constrained set of well-defined operations •A constrained set of content types, optionally supporting code on demand ● A protocol which is: Client-server, Stateless, Cacheable, Layered See the recorded webinar here: http://snurl.com/webscripts
Slide 5: REST Web Services REST v. SOAP WS ● Cacheable representations, leading to improved response time. ● Less dependencies: i.e. no SOAP ● No need for a resource directory ● More scalable. No session state maintenance required across servers. ● Exchange of Resources, rather than Methods – Nouns v. Verbs See the recorded webinar here: http://snurl.com/webscripts
Slide 6: Alfresco Web Scripts REST & Alfresco = Web Scripts ● From 2.1 onward – ideally to open it up to more channels: Office, Portal, Websites ● Ease of use and lightweight: Javascript, Templates ● Multi use: create your own API, new UI components, widgets, expose features. ● Cross language and cross platform data. ● MVC – Alfresco Repository (Model), Javascript (Controller), Freemarker (View). See the recorded webinar here: http://snurl.com/webscripts
Slide 7: Alfresco Web Scripts URL HTML, ATOM, RSS, JSON 1 6 Web Script REST Dispatcher ● Content 5 2 Web Script REST Infrastructure JavaScript Rendition Services Search Security Repository Navigation ● Metadata ● User Interface Components ● Queries FreeMarker 3 Content Services 4 See the recorded webinar here: http://snurl.com/webscripts
Slide 8: Alfresco Web Scripts cont... What makes a Web Script? ● XML Descriptor file: define your resource ● Javascript: Controller with access to various content services • Search: Search the repository and format the result any way needed. • Create: Add content into the repository. • Navigate: See what is in the repository • Security: Make sure you have the permissions to access ● Freemarker: Representation/Response, format can be XML, JSON, HTML See the recorded webinar here: http://snurl.com/webscripts
Slide 9: Alfresco Web Scripts Example XML Descriptor: docActions.get.desc.xml <webscript> <shortname>Document Actions (Office Add-In)</shortname> <description>Used by the Office Add-In to perform actions on managed documents</description> <url>/office/docActions</url> <authentication>user</authentication> <transaction>required</transaction> </webscript> ● XML Descriptor file: define your resource and HTTP method (naming convention) ● url: Define your resource and any parameters needed to execute ● Level of authentication required to run ● Optionally define whether a transaction is required. ● Can define a default format to fall back to incase format is not defined when executing. See the recorded webinar here: http://snurl.com/webscripts
Slide 10: Alfresco Web Scripts Example Javscript Controller: docActions.get.js // Client has requested server-side action /* Inputs */ var runAction = args.a; /* Outputs */ var resultString = "Action failed", resultCode = false; // Is this action targetting a document? var docNodeId = args.n; if ((docNodeId != "") && (docNodeId != null)) { var docNode = search.findNode("workspace://SpacesStore/" + docNodeId); if (docNode != null && docNode.isDocument) { try { if (runAction == "makepdf") { resultString = "Could not convert document"; var nodeTrans = docNode.transformDocument("application/pdf"); if (nodeTrans != null) { resultString = "Document converted"; resultCode = true; See the recorded webinar here: } http://snurl.com/webscripts }...
Slide 11: Alfresco Web Scripts cont... JSON ATOM HTML See the recorded webinar here: http://snurl.com/webscripts
Slide 12: Web Scripts and REST Architecture OK Great, now how do I apply this in a REST Architecture? ● Can be applied in a DM or WCM Deployment, in similar fashion ● Customize a completely different UI (i.e. Flex, HTML, Portal). (Web Scripts feature, not necessarily REST) ● Use Alfresco in your own app without exposing them to Alfresco. You will get the performance and reliability of all Alfresco services but abstract it from the user's perspective. Data API ● Serve content to users through Alfresco ASRs ● Provide data to other services whether they're written in .NET, PHP, Java, etc. See the recorded webinar here: http://snurl.com/webscripts
Slide 13: RESTful UI Office Plugin ● Implemented in mini browser window ● All actions available through REST API •HTML Response for UI •Other json for responses to update UI and data retrieval. ● Core services accessible through plug-in •Doc management •Workflow •Search See the recorded webinar here: http://snurl.com/webscripts
Slide 14: RESTful UI Portlets/Gadgets ● Allow users access through a portal like iGoogle. ● Since Web Scripts are jsr-168 compliant, just have to make portal aware. ● Popular portals: Jboss Portal, Liferay ● All data transmitted through json, xml, html, through custom REST API See the recorded webinar here: http://snurl.com/webscripts
Slide 15: RESTful DM Sample DM Architecture ● Client access Alfresco Web Scripts Directly •UI Web Scripts, Office Plugin Web Scripts, etc. ● Or...Layer another application in between. •Webapp access Alfresco using RESTful API to retrieve data: XML, JSON, HTML ● Can scale and cluster this environment •Your webapp •Alfresco ECM server Alfresco ECM Server Your Webapp See the recorded webinar here: http://snurl.com/webscripts
Slide 16: RESTful DM Sample Customer DM Architecture ● Customer uses Alfresco as DAM ● Manages all contents internally with Alfresco with custom UI and actions. ● Same data then pushed out through transfer to serve internet •Webapp utilizes Web Scripts to get data from DMZ Alfresco •Able to perform transformations on images •Can download transformed or original. ● Serves worldwide user base. Alfresco ECM Server Your Webapp Firewall Alfresco ECM Server See the recorded webinar here: http://snurl.com/webscripts
Slide 17: RESTful WCM Sample WCM Architecture ● Create your content on Alfresco WCM Server (Authoring) ● Content (XML files, etc.) deployed to runtime ● Web Scripts on the Alfresco Runtime serves your webapp: •Data Acess API •HTML, JSON, XML, RSS, ATOM, etc. Your choice •Supports cached results. •Use for searching, navigation, or dynamic page assembly. ● Add more runtimes: load balance Alfresco WCM Server Alfresco Runtime Alfresco Runtime Alfresco Runtime Your Webapp Firewall See the recorded webinar here: http://snurl.com/webscripts
Slide 18: Useful Links Links ● Alfresco Content Community Developer Toolbox: http://tinyurl.com/6yajvj • http://wiki.alfresco.com/wiki/RESTful_API • http://wiki.alfresco.com/wiki/RESTful_API_Reference • http://wiki.alfresco.com/wiki/Surf_Platform •http://wiki.alfresco.com/wiki/3.0_REST_API See the recorded webinar here: http://snurl.com/webscripts
Slide 19: ● Resources: ● ● ● ● ● ● ● Developer Toolbox: http://tinyurl.com/6yajvj RESTful API: wiki.alfresco.com/wiki/RESTful_API Q&A and Resources RESTful API Ref: wiki.alfresco.com/wiki/RESTful_API_Reference Alfresco SURF: wiki.alfresco.com/wiki/Surf_Platform Alfresco 3.0 REST API: wiki.alfresco.com/wiki/3.0_REST_API Join the Content Community: alfresco.com/community/register Developer Challenge: alfresco.com/partners/programme/webscripts/ ● Join the Alfresco Facebook Group ● facebook.com/group.php?gid=6063383762 ● Nominate Alfresco in the Packt CMS Awards ● http://tinyurl.com/68og3p 03.04.08 See the recorded webinar here: http://snurl.com/webscripts
Slide 20: See the recorded webinar See the recorded webinar here: http://snurl.com/webscripts 03.04.08

   
Time on Slide Time on Plick
Slides per Visit Slide Views Views by Location