Re: [xwiki-users] Using a local class within a wiki page

2014-12-19 Thread
Ok I’ve discussed with Guillaume Laforge from Groovy fame and here are more 

* In our code we capture the output of the script and use it to display the 
rendered page so any println located directly in the script will work.
* However for a println in a Class, Groovy call System.out.println(…) - which 
is why it goes in the xwiki logs - and we would need to capture that in a 
thread safe way to redirect it to the page rendering this is a bit more 
** Use System.set(PrintStream) with a custom PrintStream that would use for 
example a threadlocal variable to direct the content to our page being rendered
** Use Groovy’s runtime metaprogramming feature, for example: 
PrintStream.metaClass.println = { String s - ...handle thread safety here.. }.
** Use Groovy’s compile-time metaprogramming feature and implement a Groovy AST 
Transformation to transform all println calls into something else. For example 
by adding a binding to the ScriptContext and using that binding instead of 
println. This requires using a CompilationCustomizer (we already do that in 
XWiki btw) which returns an ASTTransformationCustomizer to do the work.


On 19 Dec 2014 at 00:10:18, Bryn Jeffries 
( wrote:

 Vincent Massol said:
  Ok I think I know...
  Actually the message is printed in the console.
  You see something in the page only if you print in the global scope because
  this is what gets returned by script evaluation. Calling “println” in a 
  doesn’t return anything in the evaluation and thus you don’t see anything.
  That’s why the examples at work.
 Right, makes sense. So looks like the best fix is to return the string and 
 print it from global (script) scope. This works:
 class Callee {
 def hello() {
 return hello, world
 c = new Callee()
 println c.hello()

users mailing list

Re: [xwiki-users] Line wrapping in Code Macro

2014-12-19 Thread Thomas Mortagne
This is because that's actually what you asked with this syntax. To
customise the macro itself you can use cssClass parameter, see
(code macro inherits box macro).

On Thu, Dec 18, 2014 at 10:14 PM, Jamal wrote:
 Thanks for the reply, Vincent.

 That was my first thought, but here's the weird thing: when I add CSS styles
 that way, the code block ends up getting rendered as a paragraph (P tag)
 with the style applied in a SPAN, instead of being rendered in a DIV as it
 normally is.

 This changes the look completely, and with forced line breaks it gets quite

 But since the macro has a place to specify a CSS class, I guess I could just
 create a class to handle the line breaking.

 I'm still pretty new to Xwiki, can you tell me what best place/way is to add
 a CSS class that I can use on any page?



 View this message in context:
 Sent from the XWiki- Users mailing list archive at
 users mailing list

Thomas Mortagne
users mailing list

Re: [xwiki-users] Query external MSSQL DB in a wiki page

2014-12-19 Thread
Hi Bryn,

On 17 Dec 2014 at 22:49:26, Bryn Jeffries 
( wrote:

 I wrote:
  I have managed the following with an external PostgreSQL server:
  Retrieve and display queried data in a page with Groovy; Write a Java
  component to perform query, call and display with Groovy or Velocity;
  Generate JSON data of query results with Groovy, call and display from
  Happy to share but not near my computer till later today, so let me know
  which of the above is closest to what you want to do and I'll post something
  when I can.
 I've put some examples into the following wiki page:
 I hope that's the correct approach to sharing this kind of stuff - please 
 advise if not.

Thanks for this! :) It’s great to see participation in the wiki.

Now, I’ve done some gardening and since we already have a page about executing 
SQL (, I have 
merged your tutorial on this page.

Hope it’s fine with you!

Also note that you should use a connection pool and use a data source instead 
of defining the user/password/url directly.


users mailing list

[xwiki-users] Migrate MediaWiki content to XWiki

2014-12-19 Thread Ilsa Loving
Hi all,

I’m trying to get us migrated from several installations of MediaWiki to one 
XWiki.  I have installed XWiki 6.3 just fine… but the big problem is migrating 
the data over.

So far all the options I’ve found have been sorely lacking.

-The method provided on the Encodo blog, uses the XMLRPC API which has since 
been deprecated
-The Mediawiki to Xwiki Migration Toolkit requires setting up an entire 
development environment with a special customized version of XWiki just to do 
the import, which is unnecessarily complex and error-prone.
-A few other methods which may work, but omit portions such as history.

Is there a relatively simple batch import mechanism that works with the current 
versions of xwiki, or am I relegated to importing stuff manually?  I *could* 
write my own import tool, but if I have to go that route we may as well just do 
it manually because we will need to audit and clean up the articles anyway.


users mailing list

[xwiki-users] [myxwiki] new wiki request

2014-12-19 Thread Pierre-Antoine Grégoire
   - *subject*: [myxwiki] new wiki request
   - *description*: Wiki for YaJUG
   - *owner name*: zepag (Pierre-Antoine Grégoire)
   - *wiki name*: yajug
users mailing list

Re: [xwiki-users] [myxwiki] new wiki request

2014-12-19 Thread

On 19 Dec 2014 at 18:52:57, Pierre-Antoine Grégoire 

 - *subject*: [myxwiki] new wiki request
 - *description*: Wiki for YaJUG
 - *owner name*: zepag (Pierre-Antoine Grégoire)
 - *wiki name*: yajug


PS: Remember the stability of is not guaranteed! See

users mailing list

Re: [xwiki-users] [myxwiki] new wiki request

2014-12-19 Thread Valdis Vītoliņš
 PS: Remember the stability of is not guaranteed! See

But usually it's not bad though. See for example:


users mailing list

Re: [xwiki-users] Run external script to generate data for wiki page

2014-12-19 Thread Bryn Jeffries
I was thinking basic current side AJAX, rather than doing something server side 
in Velocity. It's not my area, but I'm sure it's possible. The idea is just too 
get your browser to call the CGI script.
- Reply message -
From: Jason Clemons
To: XWiki Users
Subject: Re: [xwiki-users] Run external script to generate data for wiki page
Date: Fri, Dec 19, 2014 12:02

I have control over the it can be in the CGI bin...would I then be 
able to invoke it through velocity?

 On Dec 18, 2014, at 6:01 PM, Bryn Jeffries 

 How external is the external script? Couldn't you wrap the script into a 
 cgi script on the same server and invoke it from the client with an AJAX call?
 From: Jason Clemons []
 Sent: 19 December 2014 10:00
 To: 'XWiki Users'
 Subject: Re: [xwiki-users] Run external script to generate data for wiki page

 Bump... :)

 Hello all,

 I'm wondering if anyone has done anything like this before so, I thought I'd
 ask it here.  Essentially, what I want to do is have a page / form that my
 users fill out and then submit.  Upon submit I need to invoke an external
 script (e.g..Perl, Python, VBScript, Batch etc...) that will do some quick
 data gathering then insert some data in a database.  Once the script
 generates the data the page will then retrieve it and render some results
 based on it.  Most of the mechanics I can figure out I think, but I wanted
 to get some tips on the best way to actually invoke the script from a page
 in Xwiki.
 Any ideas or suggestions are appreciated...
 users mailing list

 users mailing list

users mailing list