Alfresco - Building a Really Simple Wiki
-
Upload
alfresco-software -
Category
Technology
-
view
12.991 -
download
1
description
Transcript of Alfresco - Building a Really Simple Wiki
![Page 1: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/1.jpg)
Built in 60: Build a Simple Wiki with Web Scripts
Luis SalaSenior Director of Solutions Engineering
www.alfresco.com
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 2: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/2.jpg)
Introduction
Luis Sala, Senior Director of Solutions Engineeringhttp://blogs.alfresco.com/luissala
Former Chief Solutions Architect at Epicentric and Principal SE at Vignette
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 3: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/3.jpg)
Agenda
● Web Script Overview
● Web Script-based Wiki
● Other Wiki Options
● Quick Demonstration
● Q & A
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 4: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/4.jpg)
What are Web Scripts?
Web Scripting●Agile Script-Driven MVC●Multiple uses
● Roll your own API
● Create new UI components
● Create portlets/widgets
● Expose WCM/AVM features●Script-based implementation
● Server-side JavaScript
● Freemarker●Limited only by your imagination
● Integration: Create a mashup
● Search: Exposed to other systems.
● Rich Internet Applications
● Cross-language
● Cross-platformJavaScript (Controller)JavaScript (Controller)
Freemarker (View)Freemarker (View)
Alfresco Repository (Model)Alfresco Repository (Model)
Consumer / ClientConsumer / Client
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 5: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/5.jpg)
Components of a Web Script
● XML Descriptor● URI Templates● Authentication Requirements● Transactional Requirements
● One or more server-side JavaScript files (Controller)● One for each HTTP method (GET, PUT, POST, etc.)
● One or more Freemarker templates (View)● One for each HTTP method and desired output type (HTML, XML, JSON, etc.)
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 6: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/6.jpg)
Two types of Web Scripts…
● Data Web Script● RESTstyle / RESTful URL● Returns structured data:
XML
JSON
CSV
● UI Web Script● Renders self-contained UI.● Can leverage Data Web Scripts.
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 7: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/7.jpg)
Web Scripts as Gadgets● Virtually any Web Script can be a gadget by
using its URL.
● http://HOST:PORT/alfresco/wcs/SCRIPT
● Developers have many choices:● HTML● AJAX● JavaScript● JSON● Any combination of the above.
JavaScript (Controller)JavaScript (Controller)
Freemarker (View)Freemarker (View)
Alfresco Repository (Model)Alfresco Repository (Model)
iGoogleiGoogle
HTMLAJAXJSON
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 8: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/8.jpg)
wiki.get.js (part 1)
// Extract the Wiki Space DBID from PATH// Eg. http://localhost/alfresco/s/wiki/1234var wikiId = parseInt(url.extension);
var nodes = search.luceneSearch("@sys\\:node-dbid\:" + wikiId)
var pageName = args["p"];
if (pageName == null || pageName == "") {pageName = "home";
} // end if
var pageNode = wikiSpace.childByNamePath(pageName);
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 9: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/9.jpg)
wiki.get.js (part 2)// Get the designated page or home page.if (pageNode == null) {
pageNode = wikiSpace.createFile(pageName);pageNode.content = "This page has not yet been
edited. Please click on the 'Edit' link to modify."pageNode.save();
}
// Translate WikiLinksvar WIKI_LINK = /\[\[([^\|\]]*)(\|([^\]]+))?\]\]/g;var content = (pageNode.content + "").replace(WIKI_LINK, "<a href=\"" + url.service +"?p=$1\">$1</a>");
model.wikiId = wikiId + "";model.pageNode = pageNode;model.pageName = pageNode.name;model.content = content;
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 10: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/10.jpg)
Other Wiki Alternatives
● MediaWiki Integration
● Available since Alfresco 2.1
● Alfresco Extension for MediaWiki stores content into Alfresco
● Coming in 3.0: MediaWiki inside Alfresco (Quercus)
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 11: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/11.jpg)
Wiki Article – MediaWiki Preview
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 12: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/12.jpg)
Wiki Article – MediaWiki Edit
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 13: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/13.jpg)
Wiki Content stored in Wiki Spaces
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 14: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/14.jpg)
Repository with Wiki content and images
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 15: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/15.jpg)
Wiki Article Details Page (with Template)
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 16: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/16.jpg)
Versioning and Workflow
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 17: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/17.jpg)
Edit Content
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 18: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/18.jpg)
DEMO
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 19: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/19.jpg)
Q&A and Resources
03.04.08
Q&A and Resources● Any Questions?
● Resources:● wiki.alfresco.com/wiki/Web_Scripts● wiki.alfresco.com/wiki/JavaScript_API
● Join the Content Community● alfresco.com
● Participate in the Developer Challenge● alfresco.com/partners/programme/webscripts/
● Join the Alfresco Facebook Group● facebook.com/group.php?gid=6063383762
See the recorded webinar here:http://tinyurl.com/simplewiki
![Page 20: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/20.jpg)
View the recorded webinar
See the recorded webinar here:
http://tinyurl.com/simplewiki
![Page 21: Alfresco - Building a Really Simple Wiki](https://reader035.fdocuments.in/reader035/viewer/2022062703/55562fa5d8b42a5b528b4f20/html5/thumbnails/21.jpg)
Shapes & Colors
Normal Text
● Bullet● Sub-Bullet
Normal TextNormal Text