Hi, me again, i have this problem:
I enter xwiki as XWiki.Admin
I do something
I close web browser (Firefox)
I open web browser (Firefox)
I go to XWiki.WebHome
I am logged as XWiki.Admin !!!!
Worst, i close web browser, i close my linux (kde) session, i enter
again and the same happens...
How can avoid that, how i can prevent the session persist when browser
restarts ... ?
Thanks
--
A.U.S. Enrique Ferreyra
Centro de Cómputos
Red Megatone - Red Confina
...moved this to the users list
Hi!
In my xwiki 0.9.840 installation I have set the user validation flag on but newly registered users can still log in without activating their accounts. So to say, if user is marked inactive (checked this in db too) he still can log in. I noticed this in xwiki.com too where I registered and directly logged in without "validating" my registration.
Is this the intended behaviour for user account validation and if so, what is it actually for? If this is not a bug, what's the best way - if any - to disable a user account without removing it. Putting it into access denied -group?
:pete
Hi all!
I'm trying to develop a plugin to interact with Jena (
http://jena.sourceforge.net), a semantic web framework.
I developed the plugin as I documented it in the plugin development
tutorial. I have a hello() method which works perfectly. however when I try
to call this method:
public List<String> test1(){
Vector<String> uris = new Vector<String>();
OntModel model = ModelFactory.createOntologyModel(
OntModelSpec.RDFS_MEM_RDFS_INF, null );
model.read("
http://www.dcs.shef.ac.uk/~zzc05jb/environmentOntology/pollutionInventory.r…
");
model.read("
http://www.dcs.shef.ac.uk/~zzc05jb/environmentOntology/instances/disposalRe…
");
Iterator iter = model.listIndividuals();
while(iter.hasNext()){
OntResource ontClass = (OntResource)iter.next();
uris.add(ontClass.getURI());
}
return uris;
}
I get this exception:
Error number 4001 in 4: Error while parsing velocity page
Tests.OntologyPlugin Wrapped Exception: Invocation of method 'test1' in
class secoia.plugin.OntologyPluginApi threw exception class
java.lang.NoSuchFieldError : actualValueType
I can't really make sense of it. This method works if i use it form a
classic Java application. I copied all the Jena jar files to the
webapps/xwiki/WEB-INF/lib directory. Moreover, I don't know where this
actualValueType comes from. Does it come from XWiki?
Any clue on this problem?
Thanks a lot!
--
_ _ Julien Bourdon
(o)(o)--. http://purl.org/net/JulienBourdon
\../ ( ) self isAddictedTo:(#Squeak&#linux)
m\/m--m'`--. ^true
The various kinds of #include directives have always puzzled me, but now
I think I may have a serious need to understand them.
I have seen that some of them are implemented by methods on $xwiki
(includeForm, includeTopic, in two incarnations each - with or without
rendering, I assume), but I have no understanding of why they are all
different. Add in the parse directives and XWiki methods and I am
completely confused.
Can anyone give me a synopsis of what these are all about? I understand
this much: that Velocity directives are read once at parse time,
whereas methods can be invoked multiple times in a loop.
The problem I need to solve, however, may be a Velocity problem or a
caching problem. A menu is called from the left-side navigation menu
XWiki.Menu. I have included it via #includeTopic, and it use
#includeMacros to bring in a macro that reads a document with a list of
objects describing menu items, with a menu label, an href, and a long
description. If the href field is a complete URL, it's output as a
plain link; if it's a local Wiki document, it's output with XWiki's
bracket syntax and its place is held in the menu as a navigational aid.
If it is also in the Web reserved for such documents, it's a submenu,
and the menu macro is called again (thanks to the earlier thread, I did
use a copy of the argument, which is call-by-reference, and saved
headaches).
All of this works just fine except the first time it's called after the
server starts. Instead of the menu text, all I see is the invocation of
the macro. Viewing the menu document directly (as I did when I sought
to debug it) fixes the problem for all until the next reboot.
So what is this? I read some discussion on the velocity-user mailing
list about when and how macro templates are loaded, but didn't
understand it well; in addition, there is all this confusion about when
to include in what way.
brain[sic]
Yep, that's fixed it. Many thanks!
-----Original Message-----
From: Robin Fernandes [mailto:rewbs.soal@gmail.com]
Sent: 05 April 2006 17:50
To: xwiki-users(a)objectweb.org
Subject: Re: Groups (was [xwiki-users])
Hi,
Since you're using 0.9.840, could it be a group cache issue? If you recently added the user to a fifth group but didn't refresh the cache, that could explain it.
See http://mail-archive.objectweb.org/xwiki-users/2006-02/msg00102.html
Regards,
Robin
On 05/04/06, Esbach, Brandon <Esbachb(a)tycoelectronics.com> wrote:
> Hi me again,
>
> This works perfectly for a user with 4 or less groups but, if there are more than 4 groups, it only returns 4 groups? Or maybe there is another problem causing this?
>
> -----Original Message-----
> From: Esbach, Brandon
> Sent: 04 April 2006 08:53
> To: 'xwiki-users(a)objectweb.org'
> Subject: RE: [xwiki-users]
>
> Thanks, that's perfect!
>
> -----Original Message-----
> From: jeremi joslin [mailto:jeremi23@gmail.com]
> Sent: 04 April 2006 02:20
> To: xwiki-users(a)objectweb.org
> Subject: Re: [xwiki-users]
>
> Oh, maybe that change in the last version.
>
> try :
> $context.xWiki.groupService.listGroupsForUser($context.user,
> $context.context)
>
> Jérémi
>
> On 4/4/06, Esbach, Brandon <Esbachb(a)tycoelectronics.com> wrote:
> > Hi,
> > Thanks for the fast reply.
> >
> > This would be on a local Xwiki installation, ver 0.9.840
> >
> > I get an error when I run that:
> > Error number 4001 in 4: Error while parsing velocity page
> > XWiki.XWikiClasses Wrapped Exception: Invocation of method
> > 'listGroupsForUser' in class
> > com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl threw exception
> > class java.lang.NullPointerException : null
> >
> >
> > -----Original Message-----
> > From: jeremi joslin [mailto:jeremi23@gmail.com]
> > Sent: 03 April 2006 16:37
> > To: xwiki-users(a)objectweb.org
> > Subject: Re: [xwiki-users]
> >
> > On 4/3/06, Esbach, Brandon <Esbachb(a)tycoelectronics.com> wrote:
> > >
> > >
> > > Hi Folks
> > >
> > > I was wondering if there is a simple way to determine user-group membership?
> > > Simpler than spinning through all members of that group and doing
> > > a string match with $context.user at the least?
> >
> > Hi,
> > it's depends if you are in the farm or not. if you are, it's not possible I think.
> >
> > If not, and if you have the programming right you can do :
> > $context.xWiki.groupService.listGroupsForUser($user.user.user,
> > $context.context)
> >
> > You will receive a collection of documents representing groups.
> >
> > Jérémi
> >
> > --
> > Blog: http://www.jeremi.info
> > LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
> > Project Manager XWiki: http://www.xwiki.org
> > skype: jeremi23 -- msn et gtalk : jeremi23(a)gmail.com
> >
> >
> >
> >
> > --
> > You receive this message as a subscriber of the xwiki-users(a)objectweb.org mailing list.
> > To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
> > For general help: mailto:sympa@objectweb.org?subject=help
> > ObjectWeb mailing lists service home page:
> > http://www.objectweb.org/wws
> >
> >
> >
>
>
> --
> Blog: http://www.jeremi.info
> LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
> Project Manager XWiki: http://www.xwiki.org
> skype: jeremi23 -- msn et gtalk : jeremi23(a)gmail.com
>
>
>
>
> --
> You receive this message as a subscriber of the xwiki-users(a)objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
> For general help: mailto:sympa@objectweb.org?subject=help
> ObjectWeb mailing lists service home page:
> http://www.objectweb.org/wws
>
>
>
Hi, currently in my wiki, for administrative reasons, there is Admin as
only user, everybody else is a Guest., but in the upper right corner
still i have the register option and i cant find how to hide or remove
this option from there, its possible ? WITHOUT change the skin,
implement css vm templates and all this complicated issues (from my
ignorant point of view, of course)
Mmmm... there some good doc or tutorial about how to change the skin,
for a css and Velocity ignorant ?
Thanks !!
Still trying to solve the Lucene plug-in problem....
--
A.U.S. Enrique Ferreyra
Centro de Cómputos
Red Megatone - Red Confina
Hi, im looking at the code of Main.WebSearch, in particular the SQL that
generate...
In several places the basis of the search is a sentence:
like '%$text%'
How difficult is to add to the form a check control for Matching case,
and the build the SQL with something like (here is when i need help)
like Upper('%$text%')
Or something like that, does anybody do this before? Or i start to broke
forms :)
I assume, need to look at the JDBC Api to see the way i can express
Upper or Lower functions...
Any help welcome.
Thanks
--
A.U.S. Enrique Ferreyra
Centro de Cómputos
Red Megatone - Red Confina
Hi me again,
This works perfectly for a user with 4 or less groups but, if there are more than 4 groups, it only returns 4 groups? Or maybe there is another problem causing this?
-----Original Message-----
From: Esbach, Brandon
Sent: 04 April 2006 08:53
To: 'xwiki-users(a)objectweb.org'
Subject: RE: [xwiki-users]
Thanks, that's perfect!
-----Original Message-----
From: jeremi joslin [mailto:jeremi23@gmail.com]
Sent: 04 April 2006 02:20
To: xwiki-users(a)objectweb.org
Subject: Re: [xwiki-users]
Oh, maybe that change in the last version.
try :
$context.xWiki.groupService.listGroupsForUser($context.user, $context.context)
Jérémi
On 4/4/06, Esbach, Brandon <Esbachb(a)tycoelectronics.com> wrote:
> Hi,
> Thanks for the fast reply.
>
> This would be on a local Xwiki installation, ver 0.9.840
>
> I get an error when I run that:
> Error number 4001 in 4: Error while parsing velocity page
> XWiki.XWikiClasses Wrapped Exception: Invocation of method
> 'listGroupsForUser' in class
> com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl threw exception
> class java.lang.NullPointerException : null
>
>
> -----Original Message-----
> From: jeremi joslin [mailto:jeremi23@gmail.com]
> Sent: 03 April 2006 16:37
> To: xwiki-users(a)objectweb.org
> Subject: Re: [xwiki-users]
>
> On 4/3/06, Esbach, Brandon <Esbachb(a)tycoelectronics.com> wrote:
> >
> >
> > Hi Folks
> >
> > I was wondering if there is a simple way to determine user-group membership?
> > Simpler than spinning through all members of that group and doing a
> > string match with $context.user at the least?
>
> Hi,
> it's depends if you are in the farm or not. if you are, it's not possible I think.
>
> If not, and if you have the programming right you can do :
> $context.xWiki.groupService.listGroupsForUser($user.user.user,
> $context.context)
>
> You will receive a collection of documents representing groups.
>
> Jérémi
>
> --
> Blog: http://www.jeremi.info
> LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
> Project Manager XWiki: http://www.xwiki.org
> skype: jeremi23 -- msn et gtalk : jeremi23(a)gmail.com
>
>
>
>
> --
> You receive this message as a subscriber of the xwiki-users(a)objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
> For general help: mailto:sympa@objectweb.org?subject=help
> ObjectWeb mailing lists service home page:
> http://www.objectweb.org/wws
>
>
>
--
Blog: http://www.jeremi.info
LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
Project Manager XWiki: http://www.xwiki.org
skype: jeremi23 -- msn et gtalk : jeremi23(a)gmail.com
My apologies! This is not a problem with the wiki,
as I'm sure most of you have already realized.
The problem was caused because I am using Firefox and
by default it does not allow access to the file system
via links with the file: protocol.
IE works fine.
There is a description of the file based URL at
Wikipedia that also has a link to solve the problem.
http://en.wikipedia.org/wiki/File:_URL
Sorry for the inconvenience!
-----Original Message-----
From: Graham,Neil [NCR]
Sent: April 4, 2006 2:14 PM
To: xwiki-users(a)objectweb.org
Subject: [xwiki-users] File URL not working in 0.9.840?
Greetings,
I have just downloaded and installed Xwiki 0.9.840 and it seems to be
running fine, but I cannot link to files or directories on my windows
file system using the file: protocol.
This is what was suggested in the FAQ
(http://www.xwiki.com/xwiki/bin/view/Doc/HowDoICreateALinkToAFile )
And I have tried many variations of the URL to link to both local files
(file:///<dir>, file://<dir>, file://c|/<dir>, etc.) and network
(file://<host>/<dir>, file://///<host>/<dir>, etc.).
This does not appear to work, even though I've done the same thing on
other wikis (JSPWiki syntax: file:/host/<dir>) and it works fine.
The FAQ says it should work. Does anyone have any help?
I find xwiki to be a superior wiki, but if I can't do this
I will have to switch to another one.
Greetings,
I have just downloaded and installed Xwiki 0.9.840 and it seems
to be running fine, but I cannot link to files or directories on my windows file
system using the file: protocol.
This is what was suggested in the FAQ
(http://www.xwiki.com/xwiki/bin/view/Doc/HowDoICreateALinkToAFile )
And I have tried many variations of the URL to link to both
local files (file:///<dir>, file://<dir>, file://c|/<dir>, etc.)
and network (file://<host>/<dir>, file://///<host>/<dir>, etc.).
This does not appear to work, even though I've done the same
thing on other wikis (JSPWiki syntax: file:/host/<dir>) and
it works fine.
The FAQ says it should work. Does anyone have any help?
I find xwiki to be a superior wiki, but if I can't do this
I will have to switch to another one.
Hi all,
For those of you who use a svn version of XWiki, please upgrade. there
was a bug in the right management now fixed. The version 0-9-840
doesn't need to be upgraded.
All activated tests are now passed on the build platform.
Soon, we will release the beta1 of xwiki 1.0.
Jérémi
--
Blog: http://www.jeremi.info
LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
Project Manager XWiki: http://www.xwiki.org
skype: jeremi23 -- msn et gtalk : jeremi23(a)gmail.com
Thanks, that's perfect!
-----Original Message-----
From: jeremi joslin [mailto:jeremi23@gmail.com]
Sent: 04 April 2006 02:20
To: xwiki-users(a)objectweb.org
Subject: Re: [xwiki-users]
Oh, maybe that change in the last version.
try :
$context.xWiki.groupService.listGroupsForUser($context.user, $context.context)
Jérémi
On 4/4/06, Esbach, Brandon <Esbachb(a)tycoelectronics.com> wrote:
> Hi,
> Thanks for the fast reply.
>
> This would be on a local Xwiki installation, ver 0.9.840
>
> I get an error when I run that:
> Error number 4001 in 4: Error while parsing velocity page
> XWiki.XWikiClasses Wrapped Exception: Invocation of method
> 'listGroupsForUser' in class
> com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl threw exception
> class java.lang.NullPointerException : null
>
>
> -----Original Message-----
> From: jeremi joslin [mailto:jeremi23@gmail.com]
> Sent: 03 April 2006 16:37
> To: xwiki-users(a)objectweb.org
> Subject: Re: [xwiki-users]
>
> On 4/3/06, Esbach, Brandon <Esbachb(a)tycoelectronics.com> wrote:
> >
> >
> > Hi Folks
> >
> > I was wondering if there is a simple way to determine user-group membership?
> > Simpler than spinning through all members of that group and doing a
> > string match with $context.user at the least?
>
> Hi,
> it's depends if you are in the farm or not. if you are, it's not possible I think.
>
> If not, and if you have the programming right you can do :
> $context.xWiki.groupService.listGroupsForUser($user.user.user,
> $context.context)
>
> You will receive a collection of documents representing groups.
>
> Jérémi
>
> --
> Blog: http://www.jeremi.info
> LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
> Project Manager XWiki: http://www.xwiki.org
> skype: jeremi23 -- msn et gtalk : jeremi23(a)gmail.com
>
>
>
>
> --
> You receive this message as a subscriber of the xwiki-users(a)objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
> For general help: mailto:sympa@objectweb.org?subject=help
> ObjectWeb mailing lists service home page:
> http://www.objectweb.org/wws
>
>
>
--
Blog: http://www.jeremi.info
LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
Project Manager XWiki: http://www.xwiki.org
skype: jeremi23 -- msn et gtalk : jeremi23(a)gmail.com
This question is probably answered somewhere on the site but I failed to find it. I just registered my username and I'm trying to create a wiki hosted by xwiki.com for my classroom. When I press the button it tells me I have to provide my adress and accept the terms and conditions but doesn't tell me how to do so.
Thanks,
Mathieu
Hello,
I'm familiar with configuring skins and have read the FAQ about them,
but I'm unable to find out how to change the background color for all areas
of my wiki.
In styles.css, I don't see a value in the stylesheet to accomplish this.
I've tried adding HTML tags for background and CSS tags for background.
Do I have to adjust a value in the style or templates, or do I have to
add something?
Thanks in advance for the help.
- Michael
Hi,
Thanks for the fast reply.
This would be on a local Xwiki installation, ver 0.9.840
I get an error when I run that:
Error number 4001 in 4: Error while parsing velocity page XWiki.XWikiClasses Wrapped Exception: Invocation of method 'listGroupsForUser' in class com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl threw exception class java.lang.NullPointerException : null
-----Original Message-----
From: jeremi joslin [mailto:jeremi23@gmail.com]
Sent: 03 April 2006 16:37
To: xwiki-users(a)objectweb.org
Subject: Re: [xwiki-users]
On 4/3/06, Esbach, Brandon <Esbachb(a)tycoelectronics.com> wrote:
>
>
> Hi Folks
>
> I was wondering if there is a simple way to determine user-group membership?
> Simpler than spinning through all members of that group and doing a
> string match with $context.user at the least?
Hi,
it's depends if you are in the farm or not. if you are, it's not possible I think.
If not, and if you have the programming right you can do :
$context.xWiki.groupService.listGroupsForUser($user.user.user, $context.context)
You will receive a collection of documents representing groups.
Jérémi
--
Blog: http://www.jeremi.info
LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
Project Manager XWiki: http://www.xwiki.org
skype: jeremi23 -- msn et gtalk : jeremi23(a)gmail.com
Hi Folks
I was wondering if there is a simple way to determine user-group
membership? Simpler than spinning through all members of that group and
doing a string match with $context.user at the least?
Bonjour,
Ceci est une r�ponse automatique g�n�r�e par mon serveur. il vous signale que j'ai bien recu votre message.
Je m'emploi � le traiter dans les meilleurs d�lais.
en Ressources et Potentiel,
Xavier BERNARD
Hi,
I would like to use LDAP for authorization. I read the wiki
howto entry and basically (I think) is it clear.
But I have currently the problem and the question is it possible to
connect the LDAP server with SSL?
Bye
Frank
Setting JVM options for Tomcat
* Windows running Tomcat 5 and later : Go to the "Apache Tomcat
5.0" folder in the Start Menu. Start the "Configure Tomcat
application".
Note: the configuration can only be started when Tomcat is not
running.
Select the "Java VM" tab in the configuration dialog. You will
see some pre-defined lines in the "Java Options" test box.
Append your Java options at the bottom of the option list. For
example, to set server mode and allow 512MB of heap memory,
append the following:
-server
-Xmx400m
* Windows running Tomcat 4.1 or earlier : place the Java options
into the CATALINA_OPTS environment variable. To do this, run
Control Panel / System, select Environment Variables and create
the CATALINA_OPTS variable, and set the desired option, for
example "-server -Xmx400m".
* Linux : place the Java options into the CATALINA_OPTS
environment variable. For example: "-server -Xmx400m".
THANKS TO MARK :)
Hi again my friend.
See below.
Setting JVM options for Tomcat
* Windows running Tomcat 5 and later : Go to the "Apache Tomcat
5.0" folder in the Start Menu. Start the "Configure Tomcat
application".
Note: the configuration can only be started when Tomcat is not
running.
Select the "Java VM" tab in the configuration dialog. You will
see some pre-defined lines in the "Java Options" test box.
Append your Java options at the bottom of the option list. For
example, to set server mode and allow 512MB of heap memory,
append the following:
-server
-Xmx400m
* Windows running Tomcat 4.1 or earlier : place the Java options
into the CATALINA_OPTS environment variable. To do this, run
Control Panel / System, select Environment Variables and create
the CATALINA_OPTS variable, and set the desired option, for
example "-server -Xmx400m".
* Linux : place the Java options into the CATALINA_OPTS
environment variable. For example: "-server -Xmx400m".
Also, you might want to post back to the thread next time so the answer
is there for other people if they need it.
Cheers,
--
Mark Robinson
Regional Clarity Project Manager (HK & AU)
TNT Freight Managment (Australia) Limited
TNT Freight Managment (Hong Kong) Limited
3rd floor, Two Harbourfront, 18-22 Tak Fung Street,
Hung Hom, Kowloon, Hong Kong
Tel: +852 26213688 (ext. 374)
Mob: +852 90335711
Em : mark.robinson(a)hk.tntfreight.com
Web: http://www.tntfreight.com
Hi.
thanks for your time and effort.
im trying to configure xwiki to run utf-8 charachter set because i need hebrew in xwiki.
i read the page at:
http://www.xwiki.org/xwiki/bin/view/Dev/CharactersSets
and i would like to ask how do i implement the following steps in the description in the page above:
# change the LANG environment variable before Java started to en_US.UTF8
# change the file.encoding param (java -Dfile.encoding=UTF-8) to UTF-8
how do I do these changes?
thank you very much for any possible help
Yoda.
Hi.
im new to xwiki. a great software!
i have trouble locating the documentation on how to use and create tags (tag cloud) in xwiki. what is the syntax? how do i creat tags? is there a gui for creating them?
thaks very much, sorry if this has been answerd before, i couldn't find any data about it by using the search on the xwiki site and on this users list.
Yuda.
Hi,
I'd like to allow users to access the a web services from XWiki
documents via a plugin. However, the web service requires
user-specific passwords. What is the best approach to deal with this?
One option is to add "Password Class" fields to the XWikiUsers class,
and adapt the user template to allow users to set their password when
they edit their page. The field's value is not displayed on the page,
but the passwords are stored in the XWiki database in plain text, and
the user's page is found if a wide search is ran on a substring of the
password.
Could also add methods to the plugin that store passwords in the
database after encrypting them with some private key; they'd then get
decrypted within the plugin code before being sent to the web service.
This isn't bad, but maybe you guys have better ideas! :)
Regards,
Robin
Mark:
That seemed, intuitively, to be the way that things were put together, and that's encouraging. However, I'm hoping that your claim that the xwiki objects give most of what I need is true, since that's as deep as I hope to have to get into it. Again, I'm acting as proxy to application developers here, so I need to be sure that this is all as easy as it seems.
In particular, the joins are hairy - a necessary consequence of the flexible object structure. And I'm still a bit confused about how to parse the results.
A use case is this: I have a document that I threw together quickly and easily that lists projects that I am responsible for. Being driven entirely from the objects on the page, it was easy to share, to the point that nearly everyone else who uses it simply uses #includeForm("Brian.WorkPages") - not a good idea from an organizational point of view, but wholly acceptable in a purely experimental environment. Each object on the page lists the name of the project, the name of the project's plan document, and its current status, due dates, etc. For terseness and convenience, I make the project name the text of a link to the project plan document. As success breeds success, I decided it was a really good way to report status to my boss, so I did two things: added a "journal entry" feature to each of the plan documents, which allowed me to add dated comments on document progress and status changes; and created another data-driven page which copied the data from the original page, followed the links to the plan pages, and displayed the project table again, then the journal entries for each one, with intra-page links from the status field text for convenience. In this way, I didn't need to make out a separate weekly status report for my boss; this page would show status at a glance, with links to more detailed information right at hand.
This was good, but two things were wrong: first, the projects were listed in the default order in which getObjects() listed them, which was the order of their creation; second, all the journal entries showed up. I wanted the projects to be listed in order by priority and/or due date, and to list journal entries from only the current week.
I had already seen that I could modify the WHERE clause in searchDocuments(), and used that to add options to Main.AllDocs to order by date or creator. but getObjects() gave me no such ability, so I had to use search(). And rather than futz around with trying to get the search results to fit the same wiki Object format, I followed another example and called getObject() with the objects' number fields, which was all I returned from the query. I could also have used getObjects with a list of objects, but I didn't think of it, and am still not sure I'd know the right way to turn the returned ArrayList into a Vector.
In short, the SQL wasn't hard; tying all the attributes to the BaseObject wasn't hard, when I wanted to do it, but for one thing, when I returned a BaseObject only, I wasn't able to find any of its properties attached to it at all, and none of the syntax that I expected to be able to use to request all fields worked - I suspect because the query schema is virtual and each field had to be specified. In other words, "select obj.* from BaseObject as obj, ..." was refused.
The other matter I asked about before was why I couldn't return an arbitrary expression as I could with SQL, even though the same expression had worked in a qualifier on the same query. I really wanted to ditch all the code I had written to figure out when one week ago was, and since it was already in my qualifier, I thought I'd return it also, but Hibernate didn't like that.
brain[sic]
-----Original Message-----
From: Mark Robinson [mailto:mark.robinson@hk.tntfreight.com]
Sent: Friday, March 24, 2006 11:14 PM
To: xwiki-users(a)objectweb.org
Subject: Re: HQL question (wasRE: [xwiki-users] SQL hair-pulling)
Hi Brian.
Sorry for the lack of clarity there, it was late in my part of the world.
This is my understanding of it in general, but I am sure someone can correct how it relates to xwiki along the way.
Hibernate hides the process of creating objects and populating them with data retrieved from the database.
The Java objects have an almost direct relationship to the database structure. The tables are represented by classes and the columns are represented by properties of the object.
So when an object is created, it already fully represents the table structure. This gives you the advantage of being able to describe the equivalent of SQL queries very simply by referring to their properties.
There are getters and setter for the properties so to select a particular item from the database all you have to do is "get" that property with the value you want.
Example: Instead of "SELECT * FROM foo WHERE id = '22'" you could just use something like ...
item = getSession().get(foo.id, '22');
This is the beautiful bit about it. "item" is now an object with all the data from that row of the table and you can adjust the properties with the setter methods.
Example: Instead of "UPDATE foo SET Name='New Name', Age='36' WHERE id='22'"
item.setName("New Name");
item.setAge("36");
getSession().update(item);
Note: When you want to update the database you just call method (eg update(item)) and your object returns all the current object properties to the appropriate row in the database.
So how does this relate to XWiki? The mapping of xwiki object to the MySQL database is in xwiki.hbm.xml. Using the hibernate query from the category field in the blog as an example.
Example: select prop.value from BaseObject as obj, StringProperty as prop where obj.className='Blog.Categories' and prop.id.id = obj.id and prop.id.name='name'
>From looking at the mapping I can see that "BaseObject" is of the class "com.xpn.xwiki.objects.BaseObject" and it is mapped to the table "xwikiobjects" in the database.
It is then aliased to "obj".
I can also see that the property "className" of "obj" is mapped to "XWO_CLASSNAME", "name" is mapped to "XWO_NAME" and "id" is mapped to "XWO_ID".
"StringProperty" is a joined subclass (hibernate returns all the subclasses automatically) and is mapped to "com.xpn.xwiki.objects.StringProperty" which relates to the table "xwikistrings". In that subclass "value" is mapped to "XWS_VALUE".
StringProperty is then aliased as prop.
So after all that, what we are trying to say is something to the effect of "give me a list object that is made up of the names of the categories".
Why do we have to do it like that? Because the data is described generically in the database schema and stored in 3 different places. To retrieve it you need to ask first to find the objects of the wiki defined class 'Blog.Categories' then you need to retrieve the properties related to those objects (in this case, only the strings) and then you want to list the values of those strings.
So the strength of XWiki is that you can create classes, instances of those classes and manipulate them through the wiki pages to represent almost anything. It also means that it is very independent of the backend (as shown by using HQSQL in the standalone version).
However, the drawback is that you need to understand clearly how your classes are put together because the data is spread across the database (Remember, your classes/objects that you have created are represented in the database by the generic BaseObject and its properties).
Getting back to using this info. I find mostly that the $xwiki, $request and $doc objects give you access via the api to most of what you need anyway without getting that deep into it.
Example: From the mapping file I can see that the string property "fullName" in class com.xpn.xwiki.doc.XWikiDocument (eg $doc or doc) relates to "XWD_FULLNAME" in the "xwikidoc" table.
So if I wanted to list all the different webspaces in my xwiki with the default page of "WebHome" I know that "doc" represents the "xwikidoc" table and "fullName" represents "XWD_FULLNAME" so I write the "where" part of the query as "doc.fullName like '%.WebHome'"
The searchDocuments method of $xwiki translates this as "select distinct doc.web, doc.name from com.xpn.xwiki.doc.XWikiDocument as doc where fullName like '%.WebHome'"
So you end up with a list as demonstrated below in a Velocity setting.
#set($whereclause = "doc.fullName like '%.WebHome'")
#set($mylist = $xwiki.searchDocuments($whereclause))
1.1 The list returned
\\$mylist
1.1 Individual items
#foreach ($item in $mylist)
#set($thisdoc = $xwiki.getDocument($item))
* $thisdoc.getFullName()
#end
Hope that wasn't too wandering and full of mistakes. It is just from poking around a bit inside so could be completely misguided. I look forward to comments.
Cheers,
Mark
On 25 Mar 2006, at 2:30 AM, THOMAS, BRIAN M ((SBCSI)) wrote:
Okay; will do.
But I was just about to reply that if you omit the result-list ("select field, field, ...") then the returned value is the object type of the first object in the "from" list. Exactly what I wanted, and it sounds like what you were describing, but your examples didn't show it.
brain[sic]
-----Original Message-----
From: Mark Robinson [mailto:mark.robinson@hk.tntfreight.com]
Sent: Friday, March 24, 2006 11:35 AM
To: xwiki-users(a)objectweb.org
Subject: Re: HQL question (wasRE: [xwiki-users] SQL hair-pulling)
Hi Brian.
Check this thread out.
http://mail-archive.objectweb.org/xwiki-dev/2005-11/msg00031.html
Cheers,
Mark
On 25 Mar 2006, at 12:57 AM, THOMAS, BRIAN M ((SBCSI)) wrote:
Huh...
Sounds intriguing, but I'm puzzled about a lot of details, like:
how do you do that?
Probably an example would be very useful. Do you have one handy?
brain[sic]
-----Original Message-----
From: Mark Robinson [mailto:mark.robinson@hk.tntfreight.com]
Sent: Friday, March 24, 2006 10:48 AM
To: xwiki-users(a)objectweb.org
Subject: Re: HQL question (wasRE: [xwiki-users] SQL hair-pulling)
It seems to be like ADODB, forget about query strings. Create an
object. Set variables, indicate the relationships (eg joins) and call
the method fpr retrieving the data.
Result data as an object. Updates are a breeze.
Cheers,
Mark
On 25 Mar 2006, at 12:32 AM, THOMAS, BRIAN M ((SBCSI)) wrote:
Would this perhaps be why I can't use an arbitrary expression as a
result field?
Specifically, my query for objects less than a week old used the SQL
expression:
subdate(curdate(), 7)
which worked fine when used in a comparison to a date field in the
WHERE clause, but provoked an error when I tried to use it in the
column-list, which is (I believe) clearly legal SQL syntax. If this
were a feature that HQL simply didn't support, it would explain the
problem. Indeed, that is what the error message seems to say:
Error number 4001 in 4: Error while parsing velocity page
Brian.WorkPagesTest Wrapped Exception: Invocation of method 'search'
in class com.xpn.xwiki.api.XWiki threw exception class
com.xpn.xwiki.XWikiException : Error number 3223 in 3: Exception
while searching documents with sql select subdate(curdate(), 7),
prop.value, [...] where [...] or subdate(curdate(), 7) <=
prop.value ) [...]
Wrapped Exception: No data type for node:
org.hibernate.hql.ast.MethodNode
+-METHOD_CALL? MethodNode: '('
| +-METHOD_NAME? IdentNode: 'subdate' {originalText=subdate}
| -EXPR_LIST? SqlNode: 'exprList'
| +-METHOD_CALL? MethodNode: '('
| | +-METHOD_NAME? IdentNode: 'curdate' {originalText=curdate}
| | -EXPR_LIST? SqlNode: 'exprList'
| -NUM_INT? LiteralNode: '7'
brain[sic]
-----Original Message-----
From: jeremi joslin [mailto:jeremi23@gmail.com]
Sent: Thursday, March 23, 2006 10:47 PM
To: xwiki-users(a)objectweb.org
Subject: Re: [xwiki-users] SQL hair-pulling
Yes, XWiki is using hibernate for the database mapping. So it's not
a sql query, but a hql query. You use the objects and members name to
make the request. (if you don't know the hql, you can take a look to
the hibernate documentation :
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/
#queryhql)
Jérémi
--
You receive this message as a subscriber of the xwiki-
users(a)objectweb.org mailing list. To unsubscribe:
mailto:xwiki-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/
wws
--
You receive this message as a subscriber of the xwiki-
users(a)objectweb.org mailing list.
To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/
wws
--
You receive this message as a subscriber of the xwiki-users(a)objectweb.org mailing list.
To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws