XWiki Presentation
description
Transcript of XWiki Presentation
![Page 1: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/1.jpg)
XWiki Presentation
![Page 2: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/2.jpg)
Web/Wiki History
1
23
4
(1) Representative event: 1991 Web first used in a small, academic community
Technologies becoming popular: HTTP, HTML, GIF, JPEG
Content view&edit: Tim Berners Lee Browser+Editor; HTML preprocessors
(2) ~1997 E-commerce application Amazon.com IPO
Presentation-oriented HTML, JavaScript, Java Applets, PHP
WYSIWYG editors (FrontPage), Navigator and MS Explorer
(3) ~2001 Collaborative content creation in Wikipedia.org starts
CSS; XHTML and XML-related markup; J2EE Web Apps (servlets+JSP)
Web-based Content management systems (CMS), wiki-formats
(4) Since 2005 - AJAX, Web 2.0, www.37signals.com, Google Docs, Mashups, 2nd generation wikis.
RubyRails, Semantic Web (RDF/OWL), SOA
Content syndication (RSS+RDF), portlets, wiki extensible by macros, plugins and scripting
![Page 3: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/3.jpg)
"Long Tail" & 2nd Generation Wikis• Pareto principle (80-20
rule) and "Long Tail". Various software solutions - spellcheckers, Amazon.com, Google.com show that it is essential to handle "long tails" well.
- Applications like Atlassian Confluence and XWiki claim to be the MS Access and MS Excel of the Web age. - It should be easy to configure simple Web forms and sort all kinds of simple data and documents - to bring the advantages of packaged development to the everyday user.
![Page 4: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/4.jpg)
Remarks on XWiki Installation• Windows installer - Jetty Web Server + HSQLDB (usually a
private XWiki) • Multiple user XWiki - e.g. Apache2+Tomcat5.5 + MySQL.
Java Application Server• Jetty• Apache Tomcat• Apache Geronimo• Resin• JBoss• Oracle OC4J• BEA WebLogic• IBM WebSphere... Anything that can run J2EE Servlet
2.4 spec.
Database Server• Hypersonic (HSQLDB)• MySQL• Postgre• Oracle XE... Anything one can connect via
JDBC or ODBC.
XWiki J2EE Web Application (Struts, Hibernate, Maven2 modules...)
XWiki pre-defined objects/templates Custom objects/templates
![Page 5: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/5.jpg)
Spaces• Space - a logical grouping of pages• Every page belongs to a space • Easier to manage user permissions • Wiki-Notation: [MySpace.MyPage]; external link:
– http://localhost:8080/xwiki/bin/view/MySpace/MyPage • Each space has default starting-page:
[MySpace.WebHome]; external link: http://localhost:8080/xwiki/bin/view/MySpace/ Note the ending slash (/)!
• Space "Main" is pre-defined; [Main.WebHome] is the default homepage document
![Page 6: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/6.jpg)
Creating a new page or space
• Create a link to an empty page; Click on it!
• Links to nonexisting pages display with "?". Clicking that link also creates page.
![Page 7: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/7.jpg)
Administer a Page or Space
• Pick a space, press [Add Access Right Entry]• Select a group or a user; pick level and allow/deny• Levels:
admin/view/edit/comment/delete/register/programming
![Page 8: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/8.jpg)
Headings
• Prefix line with number for heading 1 for heading
1.1 for sub-heading 1.1.1 for sub-sub-heading
» Etc
• Always use "1" and "1.1" (not "2", "2.3", etc.)• Needs to be at the start of line • Can also use html tags (like <h1>...</h1> etc.)
![Page 9: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/9.jpg)
Table of Content - macro
• Note! Long Web documents are not good. • Use velocity macro #toc(init max number)
– Init = Heading level to display – Max = Maximum number of nested levels – Number = Boolean, whether to number results
• Automatically creates links to headings • Examples:
#toc("" "" "") or, say, #toc(1 5 true)
![Page 10: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/10.jpg)
Text Effects
• Bold Surround text with asterisks i.e. *Bold* Equivalent to strong tag - <strong>Bold</strong>
• Italics Surround text with tildes i.e. ~~Italics~~ Equivalent to emphasized tag i.e. <em>Italics</em>
• Strike – Surround text with dashes i.e. –Stricken– – Use deleted tag i.e. <del>Stricken</del>
![Page 11: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/11.jpg)
Lists and Bullet Points
• Prefix text with * (or 1. 1.1. 1.a )• The number of *’s controls indent.
Consider also using headings / toc • Examples:
* Shopping List** Cake *** Flour *** Eggs *** Sugar ** Bananas ** Tomatoes
1. First 1. Second 1*. Second sub-bullet 1*. Second sub-bullet1. Third. Should not introduce\\
line-breaks, except forced ones.1a. Third A1a. Third B1. Fourth
![Page 12: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/12.jpg)
Creating a Hyperlink Syntax: • Link to external website - [Text label >
http://www.accenture.lv] or just [http://www.accenture.lv]• Link with different display text
[label > Space.Name] or [label|Space.Name] (pipe allows refactoring of links, when pages are renamed).
• Link to given space and page [Space.SomeName] (the link is displayed with space "Some Name").
• Link to page in same space [SomeName]
![Page 13: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/13.jpg)
Quiz
• Question: What is the difference between two links: [MyProject.], [MyProject.WebHome] and [MyProject] if used in the document [OtherSpace.Aa]
• Answer: The first two refer to the default page (WebHome) of the space "MyProject". The last one refers to a page "MyProject" in the current document space. Their links are respectively:– http://localhost:8080/xwiki/bin/view/MyProject/
and– http://localhost:8080/xwiki/bin/view/OtherSpace/MyProject
![Page 14: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/14.jpg)
Tables
• Creates an IBM formatted table • Each row must be on it’s own line • Example:
{table} Head1 | Head2 | Head3 Row1.1 | Row1.2 | Row1.3 Row2.1 | Row2.2 | Row 2.3 {table}
![Page 15: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/15.jpg)
Attachments and Pictures
• You can attach large files to a page • To display a link to an attachment
– {attach:filename.doc} • To display an image in the page
– {image:picture.jpg} • To display a remote image
– <img src=“/xwiki/bin/download/{Space}/{Page}/picture.jpg” />
![Page 16: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/16.jpg)
Escaping
Use \ to escape individual characters • Example
– \{table} , \[Button\]– \\ to display \
• May need to use html to display certain characters – < instead of < – > instead of > – \ or \ instead of \
![Page 17: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/17.jpg)
Displaying Code• Use {code:xml} or {code} (i.e. {code:java}) tags
to indicate that a block of text is code. • Example
{code:java} try { // Load the JDBC driver String driverName = "org.gjt.mm.mysql.Driver"; Class.forName(driverName); } catch (ClassNotFoundException e) { // Could not find the driver } {code}
![Page 18: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/18.jpg)
Blocks of Plaintext
• Use {PRE} text {/PRE} to stop the wiki processing text.
• Use <PRE> text </PRE> to stop HTML processing text.
![Page 19: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/19.jpg)
Using Velocity macros
• #toc('' '' '')• Highlighted blocks:
– #info('Info message')– #warning('Warning message')– #error('Error message')– #floatingbox('Surrounded box with text')
• #includeInContext("MySpace.MyPage")• Find more (and define your own) under
/xwiki/skins/albatross/macros.vm
![Page 20: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/20.jpg)
XWiki Distributions• XWiki Enterprise , an
extensible Enterprise wiki,
• XWiki Enterprise Manager , an application for managing farms of wikis,
• XWiki Watch , a collaborative RSS reader with a UI built using GWT,
• Chronopolys, a project management application for managing portfolio of projects
• Nearbee, a wiki focused on work spaces with the ability to invite users to share them .
![Page 21: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/21.jpg)
Editing Objects1
2
3
![Page 22: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/22.jpg)
Some Predefined Objects
• Open – any article, – a blog entry, – a user page with "Edit"->
"Objects". • You should see
something like this:
![Page 23: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/23.jpg)
Editing Objects• From the Objects editor you
can add new (predefined) objects to your document.
• Each document in some space is a list of zero or more objects (plus the template/text of the document itself).
• Typically each document contains one object - an instance of "XWiki.TagClass"
![Page 24: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/24.jpg)
Various Modes of Looking at the Document
• "Edit" -> "Objects" opens a predefined form with text-boxes.
• There are two more modes: (simply) "view" and "inline" (or "inline form").
![Page 25: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/25.jpg)
Defining Your own Object Classeshttp://localhost:8080/xwiki/bin/view/XWiki/XWikiClasses
![Page 26: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/26.jpg)
Class "Todo" - Step 1
• Open some existing classes• Create a new class - Todo
This is the default content for the TODO Class wizard:
![Page 27: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/27.jpg)
Class "Todo" - Step 2
• First click "Edit the Class" and add the class attributes (i.e. the properties for all future "Todo" objects).
• It is not easy to remove properties once added - one can only Rollback the class definition or re-create it.
![Page 28: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/28.jpg)
Script for Displaying Todo's1 Todos
#set ($hql = ", BaseObject as obj where obj.name=doc.fullNameand obj.className='XWiki.TodoClass' and obj.name<>'XWiki.TodoClassTemplate'")
#set ($todos= $xwiki.searchDocuments($hql))
{table}Description|Assignee|Date|Status#foreach ($todo in $todos) #set ($todoDoc = $xwiki.getDocument($todo)) #set ($todoObj = $todoDoc.getObject("XWiki.TodoClass"))[$todoObj.Description>$todo] | $todoObj.Assignee |
$todoObj.TargetDate | $todoObj.Status#end{table}
![Page 29: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/29.jpg)
Result to display Todo's
• For this to work robustly, use
![Page 30: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/30.jpg)
Making Todo list sortable/filterable<table id="todoTable" class="grid sortable filterable doOddEven" cellpadding="0" cellspacing="0"
border="0"> <tr class="sortHeader"> <th>Description</th> <th>Assignee</th> <th>Date</th> <th class="unsortable selectFilter">Status</th> </tr>#foreach ($todo in $todos) <tr> #set ($todoDoc = $xwiki.getDocument($todo)) #set ($todoObj = $todoDoc.getObject("XWiki.TodoClass")) <td>[$todoObj.Description>$todo]</td> <td>$todoObj.Assignee</td> <td>$todoObj.TargetDate</td> <td>$todoObj.Status</td> </tr>#end</table>
![Page 31: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/31.jpg)
Resulting List of Todo's
• Also click to link "tags" (after you have tagged some documents).
![Page 32: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/32.jpg)
Adding Pagination1 Todos<form...</form>#set($itemsPerPage = 5)#if($request.ipp) #set($itemsPerPage = $xwiki.parseInt($request.ipp))#end#set($pageNumber = 0)#if($request.page) #set($pageNumber = $xwiki.parseInt($request.page))#end#set($startAt = $itemsPerPage * $pageNumber)#if($startAt < 0) #set($startAt = 0)#end#set ($hql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.TodoClass' and
obj.name<>'XWiki.TodoClassTemplate'")#set ($count = $xwiki.getXWiki().search("select count(doc) from XWikiDocument doc ${hql}", $context.context).get(0))#set($endAt = $itemsPerPage * ($pageNumber + 1))#if($endAt > $count) #set($endAt = $count)#end#if($startAt > $endAt) #set($startAt = $endAt)#end#set($totalPages = ($count - 1) / $itemsPerPage)#set($crtPageNumber = $startAt / $itemsPerPage)#set ($todos= $xwiki.searchDocuments($hql, $itemsPerPage, $startAt))<table...</table>#pagedViewLinks($itemsPerPage $totalPages $crtPageNumber)
![Page 33: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/33.jpg)
Resulting List of Todo's
• View your objects as paginated list (+ have a simple form for creating new objects).
![Page 34: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/34.jpg)
Add Todo's to the Panel• http://localhost:8080/xwiki/bin/view/Panels/
• Add a script between "panelheader" and "panelfooter"
• Should use Hibernate Query language (HQL)
#set ($hql = ... )
#foreach ($todo in $xwiki.searchDocuments($hql, 5, 0))
* [$todo]#end
![Page 35: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/35.jpg)
Extending XWiki Markup Language
• Can use Plugins as JARs or Groovy scripting.
• An example of adding LaTeX plugin to XWiki is seen http://www.ante.lv/xwiki/bin/view/MetaAnte/RenderingLatex .
![Page 36: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/36.jpg)
XWiki Admin Concerns
• Manage Users• Manage Space and Page Access• Configure private blogging spaces and
similar spaces for users' private use• Ensure that can migrate to newer versions• Create backups for the whole wiki or some
spaces only• Ensure that XWiki content is available
offline
![Page 37: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/37.jpg)
Administration:Managing Users• Registered user typically has more rights than someone
not logged in ("XWikiGuest" vs. a member of "XWiki All Group")
• User registration can be done with confirmation e-mail or just by declaring users data (first/last name, blog address, etc.)
• Reset password is • Deleting user == delete his/her object:
– Log in as one of adminstrators– Click top-right link "Administration"– Open tab "Users & Groups"– In the "Users
![Page 38: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/38.jpg)
Backups
• Export XAR files - essentially ZIP archives, which contain XWiki-markup pages (with meta-information). – Readable and nice; XAR files can be easily
edited to select only those spaces you want to import back, etc.
– Downside - XAR mechanism does not work for sufficiently large XWiki sites (around 10M).
• Use "mysqldump" or similar database backup.
![Page 39: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/39.jpg)
XWiki Offline
• http://code.xwiki.org/xwiki/bin/view/Extensions/XEclipseExtension
• Export XWiki and import to your local machine.
• Create the browsable off-line HTML (standard Web-Crawler)
![Page 40: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/40.jpg)
Examples
• http://wiki.bonita.objectweb.org/xwiki/bin/view/Main/WebHome - Workflow system Bonita
• http://club.mandriva.com/xwiki/bin/view/Main/2008_released - Mandriva user forum
![Page 41: XWiki Presentation](https://reader035.fdocuments.us/reader035/viewer/2022062315/56815cbb550346895dcab9fe/html5/thumbnails/41.jpg)
References
• http://www.xwiki.org/xwiki/bin/view/Main/