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?
Hi,
I fail to get a good understandinding of XWiki Query Language (my goal is
to transform working HQL to XWQL)
This code is working…
{{velocity}}
#set($classname = "CdLSATEPublic.CdLSATEPublicClass")
#set($findWQL = "
from doc.object($classname) as qat
")
#set($resultDocuments = $services.query.xwql($findWQL).execute())
#foreach($resultDocument in $resultDocuments)
$resultDocument
#end
{{/velocity}}
While this code is not working..
{{velocity}}
#set($classname = "CdLSATEPublic.CdLSATEPublicClass")
#set($findWQL = "
from doc.object($classname) as qat
where qat.language = 'en'
")
#set($resultDocuments = $services.query.xwql($findWQL).execute())
#foreach($resultDocument in $resultDocuments)
$resultDocument
#end
{{/velocity}}
Where is my problem? (see error code below…)
Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to
evaluate content with id [xwiki:CdlsatdCode.try2]
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:247)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:184)
at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:124)
... 106 more
Caused by: org.apache.velocity.exception.MethodInvocationException:
Invocation of method 'execute' in class
org.xwiki.query.internal.DefaultQuery threw exception
org.xwiki.query.QueryException: Exception while translating [
from doc.object(CdLSATEPublic.CdLSATEPublicClass) as qat
where qat.language = 'en'
] XWQL query to the [hql] language. Query statement = [
from doc.object(CdLSATEPublic.CdLSATEPublicClass) as qat
where qat.language = 'en'
] at xwiki:CdlsatdCode.try2[line 7, column 57]
at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228)
... 108 more
Caused by: org.xwiki.query.QueryException: Exception while translating [
from doc.object(CdLSATEPublic.CdLSATEPublicClass) as qat
where qat.language = 'en'
] XWQL query to the [hql] language. Query statement = [
from doc.object(CdLSATEPublic.CdLSATEPublicClass) as qat
where qat.language = 'en'
]
at org.xwiki.query.xwql.internal.XWQLQueryExecutor.execute(XWQLQueryExecutor.java:76)
at org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:72)
at org.xwiki.query.internal.SecureQueryExecutorManager.execute(SecureQueryExecutorManager.java:80)
at org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:236)
at sun.reflect.GeneratedMethodAccessor413.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
... 114 more
Caused by: org.xwiki.query.jpql.lexer.LexerException: [1,95] Unknown token:
at org.xwiki.query.jpql.lexer.Lexer.getToken(Lexer.java:809)
at org.xwiki.query.jpql.lexer.Lexer.peek(Lexer.java:36)
at org.xwiki.query.jpql.parser.Parser.parse(Parser.java:110)
at org.xwiki.query.jpql.internal.JPQLParser.parse(JPQLParser.java:46)
at org.xwiki.query.xwql.internal.hql.XWQLtoHQLTranslator.translate(XWQLtoHQLTranslator.java:55)
at org.xwiki.query.xwql.internal.XWQLQueryExecutor.execute(XWQLQueryExecutor.java:59)
... 123 more
Gerritjan
Hi All,
I dont the *Invitation* space visible for any user . Basically i want no
user should be able to do any operation*( including should not be able
search any page inside invitation space) *on invitation space .
*What i tried for this*
**
I tried blacklisting the invitation space with following code snippet in
xwikivars.vm
*#if ($hasAdmin || $isAdvancedUser)
#set ($blacklistedSpaces = ['Invitation'])
#else
#set ($blacklistedSpaces = ['Import', 'Panels', 'Scheduler', 'Stats',
'XAppClasses', 'XAppSheets', 'XAppTemplates', 'XWiki', 'WatchCode',
'WatchSheets', 'XApp', 'WatchAdmin', 'Watch', 'ColorThemes',
'AnnotationCode','Invitation'])
#end*
what it does only is Invitation space is not visible on dasshboard. *But
still i can do search for all pages inside invitation space and navigate
to invitation space.*
What i also tried is denying all rights on invitation space for all users.
But still users can searc the pages inside invitation space.
*Kindly let me know the configuration to restrict any activity(including
search) on Invitation space.*
Last option i can think of is delete the invitation space but i don't want
to go this way keeping in mind it may be required in future.
Thanks in advance