Hi all,
I included this quite simple Groovy script in a XWiki page:
<% println "Hello World"
list = ["Rod", "James", "Chris"]
list.each { println it }
println "${list.size()}" %>
And I get...
Hello World 3
But nothing about printing list.
The same script works fine in groovyConsole being the output:
Hello World
Rod
James
Chris
3
Please, what am I doing wrong? Must I expect that a script working in
groovyConsole do the same in a XWiki page?
Thanks for your help,
Ricardo
--
Ricardo Rodríguez
Your EPEC Network ICT Team
Hi,
I this message is an attempt to give every person understanding about what
xwiki is and what it can do for you, whether you are an end user, a business
analyst or an independent developer. If you like this article then probably
this thread can be sticky or used as a starting point to know xwiki. I have
been using xwiki as an independent developer for only couple of months now,
so there may be errors and omissions.
1. What is XWiki?
This is a second generation wiki or an applications wiki. In traditional
wikis like media wiki one uses these to create and share collaborative
content. Xwiki goes one step ahead of that where you can create applications
on top of xwiki platform. These applications can in turn help you create and
share content and this content can be raw content like in other wikis or be
structured content of different types where each having defined set of
attributes and defined interfaces to interact with the content.
Next, what type of applications you can create on xwiki?
You can create a simple Create Read Update Delete (CRUD) application to
maintain and share some structured data to a rich portal based applications
where many such structured objects relate to each other as per the ER
diagram and users can use them using rich interfaces defined in xwiki. It
all depends on how creative you can get.
In the subsequent sections I would explain on how to map structured entities
define interfaces in xwiki.
2. Technology stack behind XWiki?
The application is written using Java and works on any J2EE compliant
application server. For most of the deployments tomcat is the best choice.
The core engine is designed on a Struts framework where for every action
there are respective Java classes responsible to serve that action.
These core classes interact with the database layer using Hibernate, to
store and fetch data.
The front end is written using template engines like Velocity and Groovy.
The application can support number of databases. For a default personal use
one can build the application on java based low memory footprint database -
Hypersonic. For standard deployments over a lan/wan one can use standard
databases likle MySql, Oracle, PostgreSql.
Further application is a meta data driven i.e. apart from the core
schema/data which serves as meta data for further data to be created by
users it has no other schema/data. It can accept any schema or ER which
users would like to store their data into. That is what makes xwiki an ideal
platform to build applications. The developers and users can only
concentrate on specific functionalities of the application and can leave all
the legacy work of storing data to the xwiki platform.
More on this in the next section.
3. How XWiki is presented to us?
The basic deployment of xwiki is to simply unzip the core xwiki war
(xwiki-enterprise-web-x.xx.war) in the tomcat container.
This would create a blank xwiki deployment. This blank deployment would be
no good for most of us unless we just want to create some wiki pages.
This deployment of xwiki is the core platform. Next step is to create
applications on top of it.
The immediate application which we can think of is one that can add/manager
users and spaces and their rights. To make our job easier along with the
xwiki war the xwiki team has also shipped a xar
(xwiki-enterprise-wiki-x.xx.xar) file. A xar file is collection of
applications.
With standard xwiki xar we get the following applications:
1. Main 2. Blog 3. XWiki (has the user and space management modules)
4.Sandbox 5. photo
We may choose to import one or all the applications as per our needs. Thus
after importing we would have xwiki functional. So up till this point xwiki
has served the functionality of what other traditional wikis do. But then
this is just a starting point.
I hope up till now following is clear:
We add applications to xwiki to add functionality.
Xwiki team has provided with some default applications to get us started
with basic wiki tasks.
In next section I would explain more about application.
4. Understanding applications in XWiki
If you happen to look at the source if xar files these are nothing but
collection of xml files.
These xml files contain set of XWiki classes and its attributes and their
relationships.
You can also create classes in xwiki which would map to the entities of your
applications and relate them as per your business needs. Once you are done
you can export the page or space and you would have your application ready
(Mostly application are packaged as a space. Say panels application is under
a panels space.). Then this application can be imported to any xwiki
deployment.
More on this can be found under DevGuide and Applications section on xwiki
platform on xwiki.org
XWiki team have themselves created many applications few gets shipped with
standard xar file (as described above), few are part of core platform and
can be downloaded and imported from xwiki.org or can also be built directly
from the source (if you like me are in habit of building xwiki always from
source).
One can import and study them to know how to create simple to complex
applications.
I would touch on applications once again in the end.
5. Understanding User Interface in XWiki
The user interfaces are defined under skins. The skin can be found under
webapps/xwiki/skins directory. Default and most supported skin is albatross.
A skin is a set of velocity templates, javascript and css files. You can do
many things with the UI:
1. Say you like to change the presentation of objects of particular class
you define in some application. Then this can be done by altering the
velocity code in the template of the class.
2. Say you like to change the overall look and feel of the application. Then
the place would be to start altering the velocity templates/js files/css
files under the albatross skin. Once you have done and tested the needed
changes the same skin can be renamed to the bird of your choice.
More on skins can be found under the AdminGuide on XWiki Platform on
xwiki.org.
Before I move forward I would like to explain how UI of xwiki is rendered.
Whenever any xwiki action is requested it calls set of velocity pages (.vm
files) responsible for generating and rendering the UI content for that
action. A velocity page may further include other velocity page, and this
way a hierarchy of pages is established. Each vm page can access some of
the core objects of xwiki. More on these objects can be again found in the
DevGuide.
Thus vm page would access these objects, fetch the relevant content and
display them as they are to be rendered on the browser.
So you can see that this gives one lot of flexibility on the UI side. I can
do many things, change-rearrange the hierarchy, remove the pages whose
content I don't want, re arrange the content in a page.
I can even add the js files of my favorite ajax toolkits and now I have the
same content generated by vm templates rendered by my ajax widgets thus
giving a whole new look.
As mentioned above that these vm files access core xwiki objects. You can
also make them access your own objects. This can be done by defining plugins
which takes xwiki to even a further level. More on this in next section.
Last point I would like to mention is that in order to modify and alter the
skins vm files we have to know that what are the vm files and in what order
they are called on each user action. I don't have a document answer to this,
but since I build xwiki from source and am able to add breakpoints to find
the same information. Perhaps this could be done by some log settings.
6. Extending XWiki and wrap up
I hope by now following is clear:
1. Xwiki presents us with core platform.
2. It can be extended by adding applications.
3. The look and feel can be altered to a great extent by modifying vm files.
4. It can be further extended by adding plugins which introduces objects in
xwiki engine.
5. To help us xwiki has created and supports some applications and plugins
as part of their source.
If you happen to checkout the source of xwiki you would notice that it has
been arranged pretty intuitively. It has the following top level structure
(important ones):
1. xwiki-platform-applications
- the set of applications xwiki built
2. xwiki-platform-core
- the core platform
3. xwiki-platform-plugins
- the set of plugins xwiki built
4. xwiki-platform-web
- the standard UI which contains skins and velocity templates
5. xwiki-product-curriki
- their curriki product, which is built on core platform.
- this would further have its own set of plugins, applications and
skins.
6. xwiki-product-enterprise
- the core xwiki product something to start with for standard xwiki
deployments
7. xwiki-product-enterprise-manager
- the enterprise manager product
8. xwiki-product-watch
- their watch product, which is built on core platform.
- this would further have its own applications and skins.
Idea of presenting this structure here is that if you want to build rich
applications on xwiki and package them as product on top of xwiki platform,
these would give you some insight. While building the product you can choose
from the set of applications and plugins already built by xwiki team which
are part of core or part of specific product. You can also start with skin
you like and modify as you want.
note: this section is specially for developers who want to create products
and would like to choose xwiki as the platform. Knowledge of technology
stack used in xwiki is advisable and also try to build xwiki from source, to
give you greater flexibility and control.
Lastly I would touch on plugin section of which my knowledge is only
theoretical has I am yet to create a plugin. You can find information on
plugin architecture on xwiki DevGuide section CreatingPlugins. You would
need plugin to do some custom task that can be called via action from a
velocity page. Say I have to create a workflow for my class. Upon state
change some custom process needs to be invoked (like send of email), I can
do that in my plugin and when user changes the state then I invoke the
plugin from my vm file.
Thanks
Sachin
--
View this message in context: http://www.nabble.com/XWiki---A-brief-overview-tp15116968p15116968.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hello again,
Thanks a lot for the reply to my request Vincent.
I am further encouraged to start using XWiki because of such good
participation from all.
Since, I have just started looking at it, I am also concerned about the
issues llike how is XWiki different from MediaWiki.
Why should one choose to use XWiki if there exists a wiki that has been
around for a while- like the mediawiki.
No offense meant. I know that this is a second generation wiki and is
possibly the best among all of its kind, but, I am just trying to justify
myself for choosing XWiki over others :)
Thanks
Hi All,
I was able to run latest xwiki version on all oracle stack (db and oc4j as
application server). Good! :)
Just two questions, maybe for all platform:
1) http://mywiki/xwiki/xmlrpc returns 405 http error.
Any hints?
2) I can see there is a portlet.xml file in order to renderer xwiki as a
portlet. But, web.xml file is not provided with the right info for this
feature. Any hints?
Thanks a lot,
emiliano
Hi,
Here is my java version (sun jdk): 1.6.0_02
Here is the way I've installed xwiki:
#java -jar wiki-enterprise-installer-generic-1.2.jar
Everything work fine.
Here is what I have when I start xwiki enterprise:
**********************************
Starting Jetty on port 8080 ...
Logs are in the /opt/XWiki Enterprise/xwiki.log file
14:51:11.272 INFO [main] org.mortbay.log.LogImpl.add(LogImpl.java:109) >14> added org.mortbay.log.OutputStreamLogSink@36484621
14:51:11.189 INFO [main] org.mortbay.util.FileResource.<clinit>(FileResource.java:60) >09> Checking Resource aliases
14:51:11.341 WARN!! [main] org.mortbay.xml.XmlParser.<init>(XmlParser.java:81) >10> Schema validation may not be supported
14:51:11.623 INFO [main] org.mortbay.http.HttpServer.doStart(HttpServer.java:729) >07> Version Jetty/5.1.5
14:51:11.637 INFO [main] org.mortbay.util.Container.start(Container.java:74) >11> Started org.mortbay.jetty.servlet.ServletHandler@59e00
14:51:11.638 INFO [main] org.mortbay.util.Container.start(Container.java:74) >08> Started ServletHttpContext[/,/]
14:51:11.641 INFO [main] org.mortbay.http.SocketListener.start(SocketListener.java:204) >08> Started SocketListener on 127.0.0.1:8081
14:51:11.643 INFO [main] org.mortbay.util.Container.start(Container.java:74) >06> Started org.mortbay.jetty.Server@36657f01
14:51:11.711 INFO [main] org.mortbay.http.HttpServer.setStatsOn(HttpServer.java:1133) >12> Statistics on = false for org.mortbay.jetty.Server@36657d81
14:51:11.713 INFO [main] org.mortbay.http.HttpServer.doStart(HttpServer.java:729) >07> Version Jetty/5.1.5
14:51:11.740 WARN!! [main] org.mortbay.xml.XmlParser.<init>(XmlParser.java:81) >14> Schema validation may not be supported
14:51:12.534 INFO [main] org.mortbay.util.Container.start(Container.java:74) >12> Started org.mortbay.jetty.servlet.WebApplicationHandler@36525e81
14:51:14.004 INFO [main] org.mortbay.jetty.servlet.ServletHandler$Context.log(ServletHandler.java:1134) >14> Loading plexus context properties from: '/WEB-INF/plexus.properties'
14:51:14.008 INFO [main] org.mortbay.jetty.servlet.ServletHandler$Context.log(ServletHandler.java:1134) >13> Initializing Plexus.
14:51:14.011 INFO [main] org.mortbay.jetty.servlet.ServletHandler$Context.log(ServletHandler.java:1134) >14> resource = file:/opt/XWiki%20Enterprise/webapps/xwiki/WEB-INF/plexus.xml
14:51:14.410 INFO [main] org.mortbay.jetty.servlet.ServletHandler$Context.log(ServletHandler.java:1134) >13> Plexus initialized.
14:51:15.497 INFO [main] org.mortbay.util.Container.start(Container.java:74) >08> Started WebApplicationContext[/xwiki,xwiki]
14:51:15.501 INFO [main] org.mortbay.http.SocketListener.start(SocketListener.java:204) >08> Started SocketListener on 0.0.0.0:8080
14:51:15.502 INFO [main] org.mortbay.util.Container.start(Container.java:74) >06> Started org.mortbay.jetty.Server@36657d81
*****************************************
Nothing happen when I try to go to http://localhost:8080/xwiki/bin/view/Main/WebHome:
HERE is an extract of the begining xwiki.log file:
*****************************************
# more /opt/XWiki\ Enterprise/xwiki.log
14:54:30,482 [http://localhost:8080/xwiki/bin/view/Main/WebHome] [P1-19] ERROR proxy.BasicLazyInitializer - CGLIB Enhancement failed: com.xpn.xwiki.objects.classes.StringClass
java.lang.NoClassDefFoundError: net.sf.cglib.core.DebuggingClassWriter$1
at java.lang.Class.initializeClass(libgcj.so.8rh)
at net.sf.cglib.core.DebuggingClassWriter.toByteArray(DebuggingClassWriter.java:73)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:26)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
at java.lang.Class.initializeClass(libgcj.so.8rh)
at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:116)
at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:41)
at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:161)
at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:131)
at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:257)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersist
er.java:90)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
*******************************************
Any idea?
thank you
FD
Créez votre adresse électronique prénom.nom(a)laposte.net
1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
Hello,
a good practice is to import the markup-intensive pages from "shared
pages" which, typically, make their internationalization, using
property-bundles.
Now, however, these imported pages should be multilingual.
Thus far, they seem not to be so because the usage of msg.get('xx')
seems to pull from the english phrases.
- any way to "set the language" before including ?
- any way to state that such a page is "language neutral" ? (as it
should be)
thanks
paul
Hi all,
I've recently updated a couple of XWiki installations to 1.2.6932.
Either with old documents or with new ones, when I try to see a given
revision of a page, any of them, I get the following exception:
Error number 3103 in 3: Exception while reading document version {1}
Wrapped Exception: Error number 13027 in 13: Exception while patching
Wrapped Exception: line::java.lang.NumberFormatException
com.xpn.xwiki.XWikiException: Error number 3103 in 3: Exception while
reading document version {1}
Wrapped Exception: Error number 13027 in 13: Exception while patching
Wrapped Exception: line::java.lang.NumberFormatException
at
com.xpn.xwiki.doc.XWikiDocumentArchive.loadDocument(XWikiDocumentArchive.java:319)
at
com.xpn.xwiki.store.XWikiHibernateVersioningStore.loadXWikiDoc(XWikiHibernateVersioningStore.java:162)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1060)
at com.xpn.xwiki.web.XWikiAction.handleRevision(XWikiAction.java:257)
at com.xpn.xwiki.web.ViewrevAction.render(ViewrevAction.java:29)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:148)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Unknown Source)
This happens both in wikis where I've imported the 1.2 .xar and where I
don't.
Comparisons between releases usually show the whole content highlighted
green. Or no changes at all.
New documents work fine for "a while". I say "a while" because I am not
able to identify the point where they start behaving as the old ones.
Please, could you help me with this issue! Thank you so much.
Ricardo
--
Ricardo Rodríguez
Your EPEC Network ICT Team
Hello All,
I am a newbie in XWiki.
I installed the standalone version of XWiki and also downloaded the source
code for the platform (core) and for the Enterprise (Product).
Can anyone guide me as to what should I do next if I wanted to play a little
with the Enterprise code and add some features to it.
I am using Eclipse IDE.
Thanks
I see that java1.5 is needed to install xwiki. But does it work with 1.6?
thank you
Créez votre adresse électronique prénom.nom(a)laposte.net
1 Go d'espace de stockage, anti-spam et anti-virus intégrés.