xwiki: developing simple apps quickly

28
Copyright (c) Vincent Massol - 2012 XWiki Developing simple web applications quickly Ocober 2012 Friday, October 12, 12

Upload: vincent-massol

Post on 05-Dec-2014

3.894 views

Category:

Technology


0 download

DESCRIPTION

Presentation given at the Alpes JUG and Mars JUG on 10th and 11th of October 2012. Explains why XWiki is a runtime platform for developing web applications

TRANSCRIPT

Page 1: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

XWikiDeveloping simple web applications quickly

Ocober 2012

Friday, October 12, 12

Page 2: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Agenda

• Architecture

• Developing on XWiki

• Usages

• Pros and cons

• QA

Friday, October 12, 12

Page 3: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Architecture

Friday, October 12, 12

Page 4: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

XWiki Platform

... for developing (collaborative) web applications

Friday, October 12, 12

Page 5: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Building an Application

Traditional way

Runtime

Friday, October 12, 12

Page 6: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Building an Application

XWiki way - Morphing!

RuntimeRuntime

Friday, October 12, 12

Page 7: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Developing on XWikia.k.a Morphing XWiki

Friday, October 12, 12

Page 8: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Extensions

Friday, October 12, 12

Page 9: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Adding Structure

• Ability to associate arbitrary data to any wiki page

• Enable structure in the wiki

• Enable Application development

• == Application wiki or Next Gen Wiki

• Application Within Minutes

Friday, October 12, 12

Page 10: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Classes - Objects

Friday, October 12, 12

Page 11: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Class Sheets

• A Document with script to display the content of Object(s) nicely

• Automatic usage if defined in Class Document

• Can be overridden on a page basis if needed

Friday, October 12, 12

Page 12: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Skinning & Theming

Friday, October 12, 12

Page 13: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Skin ExtensionsCSS JS

== Grease MonkeyFriday, October 12, 12

Page 14: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Scripting in Pages (1/2){{groovy}}import groovy.json.*

def url = "https://api.github.com/users/xwiki/repos".toURL().textdef root = new JsonSlurper().parseText(url)

println "|=Project|=Description|=Use Wiki?|=Use Issues?"root.each() { repo -> println "|[[${repo.name}>>http://github.com/xwiki/${repo.name}]]|${repo.description}|${repo.has_wiki}|${repo.has_issues}"}{{/groovy}}

Friday, October 12, 12

Page 15: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Scripting in Pages (2/2){{velocity}}#set ($xwql = "where doc.content like '%welcome%'")#foreach ($item in $services.query.xwql($xwql).execute()) #if ($request.confirm == "1") #set ($itemDoc = $xwiki.getDocument($item)) $itemDoc.setContent($itemDoc.getContent().replaceAll( "welcome", "bienvenue")) $itemDoc.save("Replaced bienvenue") * [[$item>>$item]] replaced! #else * [[$item>>$item]] #end#end

[[Replace "welcome" by "bienvenue">>?confirm=1]]{{/velocity}}

Friday, October 12, 12

Page 16: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

UI Extensions

{{velocity}}...#foreach($uix in $services.uix.getExtensions( 'org.xwiki.platform.panels.Applications')) #set($params = $uix.getParameters()) * [[image:$params.icon $params.label>>$params.target]]#end...{{/velocity}}

Extension Point

Extension

Result

Friday, October 12, 12

Page 17: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Wiki Macros

Friday, October 12, 12

Page 18: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Components@Rolepublic interface Macro{    List<Block> execute();}

@Component@Named("message")@Singletonpublic class MessageMacro implements Macro{    @Inject    private Execution execution;

   @Inject    @Named("box")    private Macro boxMacro;

   public List<Block> execute()    {       ...    }}

org.xwiki.rendering.internal.macro.message.MessageMacro

META-INF/components.txt

+ Wiki Components!

Friday, October 12, 12

Page 19: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Usages

Friday, October 12, 12

Page 20: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Multiple Usages

Friday, October 12, 12

Page 21: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

http://www.xwiki.org/xwiki/bin/view/Main/Screenshots

Friday, October 12, 12

Page 22: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Long tail of AppsExcel of the

Web

Web’s Swiss army knife

Friday, October 12, 12

Page 23: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Pros and Cons

Friday, October 12, 12

Page 24: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Pros• Iterative, Need-based development

• Continuous Delivery

• Work collaboratively on creating applications

• Designers can style while devs create logic

• Works from day one, immediate feedbacks

• Open source and community-based

Friday, October 12, 12

Page 25: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Cons

• Save code in SCM

• ... but SVN Application, Git Application

• Low integration with existing dev tools

• ... but XEclipse

• ... but WebDAV

• Not an official standard

Friday, October 12, 12

Page 26: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Getting Started• Download XWiki from xwiki.org

• Ask for a wiki on myxwiki.org

• Non-profit orgs and individuals, no SLA

• Used as a test platform by XWiki devs

• XWiki Cloud

• Free plan (5 users), paid plans

• Contact a company supporting XWiki

Friday, October 12, 12

Page 27: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Q&A

Me

Friday, October 12, 12

Page 28: XWiki: Developing simple apps quickly

Copyright (c) Vincent Massol - 2012

Vincent [email protected]: vmassolhttp://about.me/vmassol

http://xwiki.orghttp://xwiki.com

Friday, October 12, 12