Hi all,
i have seen xwiki can do lot of stuff with groovy and velocity.I am new to
groovy so trying to understand how groovy and velocty can benefit xwiki and
ultimately end user. As most of the site says groovy and java are almost
similar. so why xwiki is using groovy when it built upon java. As per my
understanding xwiki is using groovy as scripting language where admin can
write groovy scripts at run time from UI which needs not nto be compiled
but work like in the similar fashion to java. Internally we are passing
this grrovy script as string to server which is compilinh it and executing
it at run time. Right?
Now second part is why velocity in xwiki? Velocity is used in similar
fashin to groovy in xwiki but difference is that any user without
programming rights also can write velocity scripts as it has access to
limited set of apis . Apart from that we can also write front end in
velocity script like if i write
{velocity}Hello:$xContext.getUser(){velocity} it will simply say
Hello:Scott on UI
but inside groovy scriplets everything will be taken as java code. Right?
I am trying to execute below groovy script thru one of the UI Page
String xwikiUser = xwiki.getUser("Scott")//line1 executing
String wikiname = xwiki.getXWiki().clearName("Scott", true, true,
xcontext.getContext())//line2
// other code which is also not executing
but line 2 never executes becoz i dont get control in clearName method.
After debugging it i found while
xwiki.getXWiki() it checks whether user has programming right rights
which returns null. But i have explicitly given the admin user program
rights at
wiki administartion level.
For more debugging information control goes to method i.e public boolean
hasProgrammingRights(XWikiContext context) of xwikiAuthServiceImpl.java
and line 3 returns false
// Once dropPermissions has been called, the document in the
// context cannot have programming permission.
if (context.hasDroppedPermissions()) {
return false;//;line 3
}
Not getting how to give proper programming rights to admin user here?
i have deployed the xwiki 3.5. I am trying to debug the
com.xpn.xwiki.xwiki.java file(inside xwiki-platform-legacy-oldcore-3.5.jar
file) but as soon as debugger comes to break point, it skips some line.
Basically seems like i dont not have correct 3.5 source code for the
classfile deployed .Then i got the 3.5 version of source code from
https://github.com/xwiki/xwiki-platform/tree/stable-3.5.x.
But again there are some discrepencies. Like if i open the decompiled
com.xpn.xwiki.xwiki.java from <wikiDeployedDirectory>/lib, i dont see any
file with name
AbstractXWikiMigrationManager but in downloaded 3.5 version of xwiki.java i
can see ocurrences of AbstractXWikiMigrationManager file wich is not any
where in my deployed
3.5 wiki.Looks like i am not refeering to correct 3.5 version of
com.xpn.xwiki.xwiki.java. Could you point me the right link where i can get
the correct file?Thanks in advance.
The XWiki development team is proud to announce the release of XWiki Enterprise 4.1 Milestone 1, the first milestone along the 4.1 road map.
This release brings new 3D graphs made with pure XWiki syntax, safer Groovy scripting, and better hiding of internal application related documents.
As always, it includes plenty of important bug fixes and improvements.
See: http://www.xwiki.org/xwiki/bin/ReleaseNotes/ReleaseNotesXWikiEnterprise41M1 for more details.
Or grab the fresh downloads at: http://enterprise.xwiki.org/xwiki/bin/view/Main/Download
Thanks to everyone in the community for making this release great!
Caleb
On Tue, May 15, 2012 at 10:55 AM, Moritz Hesse (EA GmbH)
<moritz.hesse(a)ea-gmbh.de> wrote:
> What is an appropriate way to structure multidimensional arrays in velocity?
>
> Let's say I want to have a main topic with two subtopics with three elements
> each:
>
> 1 maintopic
> Â 1.1 subtopic1
> Â Â Â 1.1.1 one
> Â Â Â 1.1.2 two
> Â Â Â 1.1.3 three
> Â 1.2 subtopic2
> Â Â Â 1.2.1 one
> Â Â Â 1.2.2 two
> Â Â Â 1.2.3 three
>
> My approach would be:
> {{velocity}}
> #set( $maintopic = ["subtopic1", "subtopic2"] )
> #set( $maintopic.subtopic1 = ["one", "two", "three"] )
> #set( $maintopic.subtopic2 = ["one", "two", "three"] )
> {{/velocity}}
$maintopic is a List here and not a Map so $maintopic.subtopic1 does
not mean anything.
try with
#set( $subtopic1 = ["one", "two", "three"] )
#set( $subtopic2 = ["one", "two", "three"] )
#set( $maintopic = {"subtopic1" : $subtopic1, "subtopic2" : $subtopic2} )
>
> But I cannot access the one-two-threes in each subtopic. What am I doing
> wrong?
>
> Thanks and best regards,
> Moritz
>
> _______________________________________________
> users mailing list
> users(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne
On Thu, May 10, 2012 at 9:48 AM, Moritz Hesse (EA GmbH)
<moritz.hesse(a)ea-gmbh.de> wrote:
> Hello,
>
> how is it possible (I presume it is) to access parameters in a URI? The
> xwiki API describes methods to encode and decode URIs (namely encodeURI and
> decodeURI). I suppose I can access it via the Request object (XWikiRequest;
> http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwi
> ki/web/XWikiRequest.html), but got no clue how.
>
> E.g. I would like to pass a boolean param by calling the URI
> http://<mydomain>/xwiki/bin/view/Main/WebHome?bool=true and access it in
> velocity code.
>
> Anyone has an idea how to proceed or a link to an example?
You can access the
http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xw…
object using $request in Velocity (or "request" mapping in general in
all other languages).
>
> Thx and bests,
> Moritz
>
> _______________________________________________
> users mailing list
> users(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne
Hello XWiki users,
I'd like to know what the users of XWiki use as monitoring tools.
Does anyone have experience with Nagios? Zabbix? AlertSite?
Another?
A hand-made solution?
(I haven't met one that is java based, that'd be cute!)
Here's my answer:
- with i2geo.net, we used Nagios, it was relatively faithful at warning of downtime and even at warning "failed restart" (which remain a mystery to me but happen, from time to time)
- with curriki.org, we use AlertSite, it works very well to warn about the downtime and plot performance changes. Internally, also, we use a script to detect too long response times and restart (which happens when queries start to lock too many other queries) and a hand-made monitoring tool which displays a synchronized overview of the top, page loading time, apache and appservlogs, and mysql queries; it's a youngish but can help diagnose.
thanks in advance
Paul
Hi,
I think there's a problem in UsedSpace for Admin Tools Application.
If we change the default values for "xwiki.db" and "xwiki.db.prefix"
parameters (in xwiki.cfg), the code of "showSpaceUsed" procedure doesn't
work :
def showSpaceUsed(message, table, wiki) {
def mwikiquery = (wiki=="") ? "" : "AND TABLE_SCHEMA = '${wiki}'"
def query = (table=="") ? "SELECT SUM(DATA_LENGTH)/1024/1024 as 'space'
FROM INFORMATION_SCHEMA.TABLES WHERE 1=1 ${mwikiquery}" : "SELECT
SUM(DATA_LENGTH)/1024/1024 as 'space' FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME='${table}' ${mwikiquery}"
For example with "xwiki.db=manager" and "xwiki.db.prefix=xwiki_" :
My table is "xwiki_manager" and not "xwiki".
As result :
Wiki xwiki
o Total Space used: ? (No signature of method: static
java.lang.Math.floor() is applicable for argument types:
(java.lang.String) values: []
Possible solutions: floor(double), log(double), find(), acos(double),
cos(double), cosh(double)
o Attachment Space used: ? (No signature of method: static
java.lang.Math.floor() is applicable for argument types:
(java.lang.String) values: []
Possible solutions: floor(double), log(double), find(), acos(double),
cos(double), cosh(double)
o Attachment History Space used: ? (No signature of method: static
java.lang.Math.floor() is applicable for argument types:
(java.lang.String) values: []
Possible solutions: floor(double), log(double), find(), acos(double),
cos(double), cosh(double)
o Attachment Recycle bin Space used: ? (No signature of method:
static java.lang.Math.floor() is applicable for argument types:
(java.lang.String) values: []
Possible solutions: floor(double), log(double), find(), acos(double),
cos(double), cosh(double)
o History Space used: ? (No signature of method: static
java.lang.Math.floor() is applicable for argument types:
(java.lang.String) values: []
Possible solutions: floor(double), log(double), find(), acos(double),
cos(double), cosh(double)
o Recycle bin Space used: ? (No signature of method: static
java.lang.Math.floor() is applicable for argument types:
(java.lang.String) values: []
Possible solutions: floor(double), log(double), find(), acos(double),
cos(double), cosh(double)
o Other Space used 0.0MB
Best regards,
Nicolas
Hi All,
i created a space i.e MySpace1. On WebHome, i put the some content i.e
"This is my latest content". Now in my java class, i want to get the content
of MySpace1.WebHome page . Here is the code snippet i tried to get the
content of page but i get the document1 as null though the page exists.
com.xpn.xwiki.api.XWiki xwikiApi= new
com.xpn.xwiki.api.XWiki(context.getWiki(),context);
Document document1=null;
try {
document1 = xwikiApi.getDocument("MySpace1.WebHome");//
getting document1 as null
} catch (XWikiException e) {
log.info("did not find OrgDataCreation.WebHome page");
}
String contentStr="";
if(document1!=null)
{
contentStr=document1.getContent();
}
I am not sure what i am missing here?