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.
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.
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
The loan are useful for guys, which want to organize their company. By the way, that is very easy to get a car loan.
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.