Re: [xwiki-users] Adding a document in XWiki.org
Given that I can't access outside servers from our server network (company policy), I adjusted this to reflect my own database - changing only the db name and user details. I setup a table to mimic your column name as well. On 1.1 it seems to work; though my environment is a bit different to standard release (not completely standard xwiki install). From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Your XEN ICT Team - Ricardo Rodriguez Sent: 01 November 2007 19:15 To: XWiki Users Subject: Re: [xwiki-users] Adding a document in XWiki.org Esbach, Brandon wrote: Xwiki.org sandbox: you don't normally get programming rights (admin rights don't guarantee programming rights on the .org sites). Someone on the xwiki team will have to open and save the page for you in order to test it. Thanks for the information. I didn't realize about the required programming rights. It is perfectly reasonable that this rights must be given by an administrator. But the site is not accessible yet. This link http://sandbox.xwiki.org/xwiki/bin/view/Main/WebHome keeps generating an exception while reading document XWiki.XWikiPreferences. In any case, it there were a problem with programming rights, I understand that no script will be executed. In this case, scripts recovering a single record work fine or printing simple lines by using println work fine. If it's a local xwiki instance that's also causing the problem, I'm not sure. Accessing mysql databases seems to work fine for me for my own local databases. Could you be so kind as to trying the following script in your xwiki installation to see if it is my server the only one that is having problems while printing iterations? Thanks! % import groovy.sql.Sql; println This is a sample to access epec in *mire* def sendSQL = Sql.newInstance(jdbc:mysql://mire.environmentalchange.net/epec,epec_ReadOnly, epec_ReadOnly, com.mysql.jdbc.Driver) sendSQL.eachRow(SELECT * FROM epec.spot s) {row -println ${row.code}} % I've run it in three boxes all of them running 1.2-milestone-1.5235 and always get the same result. Please, could anybody else try this? Thank you so much. Best, -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
First thing to check: Are you logged in as admin or a standard user? And do you definitely have programming rights if you're a standard user? Second thing to check: Could be an older version of Groovy in xwiki than what you're testing with in your scripts. I know this sort of scripting worked fine back with the Beta v1.0 of xwiki (haven't had the need for such scripts since), as I had to make use of it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Your XEN ICT Team - Ricardo Rodriguez Sent: 01 November 2007 09:31 To: XWiki Users Subject: Re: [xwiki-users] Adding a document in XWiki.org Your XEN ICT Team - Ricardo Rodriguez wrote: The code posted above works fine in Groovy Console. I've installed Groovy binaries in a MacBook running Mac OS X 10.4.10 and the scripts work without a glitch. See below... groovy import groovy.sql.Sql; groovy println This is a sample to access epec in *mire* groovy def sendSQL = Sql.newInstance(jdbc:mysql://mire.environmentalchange.net/epec, epec_ReadOnly, epec_ReadOnly, com.mysql.jdbc.Driver) groovy sendSQL.eachRow(SELECT * FROM epec.spot s) {row -println ${row.code}} This is a sample to access epec in *mire* AGÑ BAG BLA BDX BPA BUI CAD CDL CPD LUZ MII MIM PDC PNV PVO PZC QXI SUA ACB SVT groovy import groovy.sql.Sql; groovy println This is a sample to access ibdona in *localhost* groovy def sendSQLibd = Sql.newInstance(jdbc:mysql://localhost/ibdona, root, , com.mysql.jdbc.Driver) groovy sendSQLibd.eachRow(SELECT * FROM ibdona.library_location l) {row -println ${row.location}} This is a sample to access ibdona in *localhost* Palma Pueblos Ibiza y Menorca Otras comunidades Extranjero Palma Pueblos Ibiza y Menorca Otras comunidades Palma Pueblos Otras comu Otros Please, could you figure out why the output is not the same when executed from a XWiki page? Thanks! Cheers, -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
Your XEN ICT Team - Ricardo Rodriguez wrote: The code posted above works fine in Groovy Console. I've installed Groovy binaries in a MacBook running Mac OS X 10.4.10 and the scripts work without a glitch. See below... groovy import groovy.sql.Sql; groovy println This is a sample to access epec in *mire* groovy def sendSQL = Sql.newInstance(jdbc:mysql://mire.environmentalchange.net/epec, epec_ReadOnly, epec_ReadOnly, com.mysql.jdbc.Driver) groovy sendSQL.eachRow(SELECT * FROM epec.spot s) {row -println ${row.code}} This is a sample to access epec in *mire* AGÑ BAG BLA BDX BPA BUI CAD CDL CPD LUZ MII MIM PDC PNV PVO PZC QXI SUA ACB SVT groovy import groovy.sql.Sql; groovy println This is a sample to access ibdona in *localhost* groovy def sendSQLibd = Sql.newInstance(jdbc:mysql://localhost/ibdona, root, , com.mysql.jdbc.Driver) groovy sendSQLibd.eachRow(SELECT * FROM ibdona.library_location l) {row -println ${row.location}} This is a sample to access ibdona in *localhost* Palma Pueblos Ibiza y Menorca Otras comunidades Extranjero Palma Pueblos Ibiza y Menorca Otras comunidades Palma Pueblos Otras comu Otros Please, could you figure out why the output is not the same when executed from a XWiki page? Thanks! Cheers, -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
Esbach, Brandon wrote: Xwiki.org sandbox: you don't normally get programming rights (admin rights don't guarantee programming rights on the .org sites). Someone on the xwiki team will have to open and save the page for you in order to test it. Thanks for the information. I didn't realize about the required programming rights. It is perfectly reasonable that this rights must be given by an administrator. But the site is not accessible yet. This link http://sandbox.xwiki.org/xwiki/bin/view/Main/WebHome keeps generating an exception while reading document XWiki.XWikiPreferences. In any case, it there were a problem with programming rights, I understand that no script will be executed. In this case, scripts recovering a single record work fine or printing simple lines by using println work fine. If it's a local xwiki instance that's also causing the problem, I'm not sure. Accessing mysql databases seems to work fine for me for my own local databases. Could you be so kind as to trying the following script in your xwiki installation to see if it is my server the only one that is having problems while printing iterations? Thanks! % import groovy.sql.Sql; println This is a sample to access epec in *mire* def sendSQL = Sql.newInstance(jdbc:mysql://mire.environmentalchange.net/epec,epec_ReadOnly, epec_ReadOnly, com.mysql.jdbc.Driver) sendSQL.eachRow(SELECT * FROM epec.spot s) {row -println ${row.code}} % I've run it in three boxes all of them running 1.2-milestone-1.5235 and always get the same result. Please, could anybody else try this? Thank you so much. Best, -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
On Oct 31, 2007, at 7:57 AM, V. Harikrishnan Nair wrote: Hello... I've been able to read and enter data into my personal MySQL database (after a very long night, finally!) and I think this should be added into the documentation for XWiki.org but first, I want to get data from a textbox into the database... Because the first thing that newbies like me wanted to do was to communicate with a personal database (especially through the use of forms), I believe this is important. You're the first one I see to have this need so I'm curious to understand what's your use case first. My belief is that you're not using XWiki properly. How can I add a document in XWiki.org ? Do I have editing rights ? Everybody has editing rights but before you make any change: 1) let's agree you have a valid use case and that's you're using the proper way of doing it 2) if 1) is agreed then let's decide together where it should go on xwiki.org Let's start with 1) first. Thanks for offering your help for xwiki.org, very much appreciated. -Vincent ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
Vincent Massol wrote: You're the first one I see to have this need so I'm curious to understand what's your use case first. My belief is that you're not using XWiki properly. Me again jumping in others' threads! :-( Before XWiki arrives to our lives, their are much easier now, we use Oracle and MySQL RDBMS to store experimental data. Personal data are stored in a LDAP enabled directory service. To be able to read/write to/from these repositories from XWiki has been always an objective, but always delayed as we need have more urgent issues to solve! Harikrishnan's entry put the issue top in our to-do list! Let's see if this make sense for you: 1. We use XWiki to create a collaboration environment: the whole team can contribute to a new document. XWiki user's database is synchronized with our eDirectory directory service by using LDAP. 2. New documents include structured text (heading1, heading2, body, list,...), pictures and code. 3. Among code we include small programs generating graphs and tables from the relational data sharing MySQL with XWiki as RDBMS. We use R to generate graphs and tables: to be able to call R directly from XWiki will be a great plus, but it is not strictly required at the current stage of development. 4. Documents will be eventually included as code as far as we would like to use LaTeX as typesetting tool. With this work flow (I think it is a correct use for XWiki), the first thing to solve is what Harikrishnan is asking for... and ready to contribute with!!! So, these are only my two cents. I do hope it makes sense and helps to clarify the problem, doesn't it? Cheers, -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
Since I was probably not clear let me try to rephrase what I meant: 1) If what you to manipulate is data generated by xwiki (i.e. everything in the XWiki database) then you should use the API provided by xwiki and not manipulate this data directly. 2) If what you want to manipulate is your own data (for example data coming from other systems) then you have to use direct JDBC connection for sure. This is why I asked for Harikrishan's use case as he seems to be in use case 1 since he mentioned something about saving some text field in the database. Typically, the standard way for doing this in XWiki is to create an Object and let XWiki save that Object to the database. Hope it makes sense, -Vincent On Oct 31, 2007, at 9:21 AM, Your XEN ICT Team - Ricardo Rodriguez wrote: Vincent Massol wrote: You're the first one I see to have this need so I'm curious to understand what's your use case first. My belief is that you're not using XWiki properly. Me again jumping in others' threads! :-( Before XWiki arrives to our lives, their are much easier now, we use Oracle and MySQL RDBMS to store experimental data. Personal data are stored in a LDAP enabled directory service. To be able to read/write to/from these repositories from XWiki has been always an objective, but always delayed as we need have more urgent issues to solve! Harikrishnan's entry put the issue top in our to-do list! Let's see if this make sense for you: We use XWiki to create a collaboration environment: the whole team can contribute to a new document. XWiki user's database is synchronized with our eDirectory directory service by using LDAP. New documents include structured text (heading1, heading2, body, list,...), pictures and code. Among code we include small programs generating graphs and tables from the relational data sharing MySQL with XWiki as RDBMS. We use R to generate graphs and tables: to be able to call R directly from XWiki will be a great plus, but it is not strictly required at the current stage of development. Documents will be eventually included as code as far as we would like to use LaTeX as typesetting tool. With this work flow (I think it is a correct use for XWiki), the first thing to solve is what Harikrishnan is asking for... and ready to contribute with!!! So, these are only my two cents. I do hope it makes sense and helps to clarify the problem, doesn't it? Cheers, -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
On Oct 31, 2007, at 11:35 AM, V. Harikrishnan Nair wrote: Gosh ! I didn't realise that I could create such an uproar ! :-)) The uproar was caused by the fact that you asked for help without explaining what you wanted to do... If you had explained what you just explained below I guess it would have saved us a few emails ;) One option you should consider is to define standard XWiki Classes and map them to your own database schema using what is called custom mapping. Unfortunately I cannot tell you much more other than it's doable. Anyone having any experience with custom mapping in XWiki? Thanks -Vincent To answer Q1. - I wanted to make XWiki a platform for integrating some tools like XPlanner with a Project Mangement template which carries copious amounts of data in its database and also as an area where employees can interact with each other and share/edit data (making use of versioning). This is on an experimental basis. All I wanted to do is - 1. Insert/read data from the company's database (I'm just doing what I am told to do, okay ?). 2. Allow employees to access their domains in the mail server/ Bugzilla etc. without the need to type in username password repeatedly - just login to XWiki and go to their spaces using links. Something like MS Outlook allows you to access your all your mail accounts. 3. Enter documents under discussion which can be edited by multiple persons (along with histories and RSS) I hope this is clear enough... :-) Xwiki is serving its purpose but I guess just wanted to bend it a bit too much ! Harikrishnan Ricardo Rodríguez wrote: Vincent Massol wrote: Since I was probably not clear let me try to rephrase what I meant: 1) If what you to manipulate is data generated by xwiki (i.e. everything in the XWiki database) then you should use the API provided by xwiki and not manipulate this data directly. 2) If what you want to manipulate is your own data (for example data coming from other systems) then you have to use direct JDBC connection for sure. This is why I asked for Harikrishan's use case as he seems to be in use case 1 since he mentioned something about saving some text field in the database. Typically, the standard way for doing this in XWiki is to create an Object and let XWiki save that Object to the database. Hope it makes sense, -Vincent Definitely. It makes complete sense. I'm also a bit confused by Harikrishnan messages, that is the reason I've brought in our own case to see where, if anywhere, Harikrishnan graft to. Keeping track of this issue, -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users -- View this message in context: http://www.nabble.com/Adding-a-document-in-XWiki.org-tf4723188.html#a13506236 Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
Gosh ! I didn't realise that I could create such an uproar ! :-)) To answer Q1. - I wanted to make XWiki a platform for integrating some tools like XPlanner with a Project Mangement template which carries copious amounts of data in its database and also as an area where employees can interact with each other and share/edit data (making use of versioning). This is on an experimental basis. All I wanted to do is - 1. Insert/read data from the company's database (I'm just doing what I am told to do, okay ?). 2. Allow employees to access their domains in the mail server/Bugzilla etc. without the need to type in username password repeatedly - just login to XWiki and go to their spaces using links. Something like MS Outlook allows you to access your all your mail accounts. 3. Enter documents under discussion which can be edited by multiple persons (along with histories and RSS) I hope this is clear enough... :-) Xwiki is serving its purpose but I guess just wanted to bend it a bit too much ! Harikrishnan Ricardo Rodríguez wrote: Vincent Massol wrote: Since I was probably not clear let me try to rephrase what I meant: 1) If what you to manipulate is data generated by xwiki (i.e. everything in the XWiki database) then you should use the API provided by xwiki and not manipulate this data directly. 2) If what you want to manipulate is your own data (for example data coming from other systems) then you have to use direct JDBC connection for sure. This is why I asked for Harikrishan's use case as he seems to be in use case 1 since he mentioned something about saving some text field in the database. Typically, the standard way for doing this in XWiki is to create an Object and let XWiki save that Object to the database. Hope it makes sense, -Vincent Definitely. It makes complete sense. I'm also a bit confused by Harikrishnan messages, that is the reason I've brought in our own case to see where, if anywhere, Harikrishnan graft to. Keeping track of this issue, -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users -- View this message in context: http://www.nabble.com/Adding-a-document-in-XWiki.org-tf4723188.html#a13506236 Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
V. Harikrishnan Nair wrote: Hi, Harikrishnan, Perhaps the Three Wise Men could be a better target for our messages :-) (I do hope this Christian metaphor is known enough!) I think we are messing up things here and this won't be useful for anybody. Don't you thing it would be better to split this message into three brand new entries sent to the list? Let's propose... Gosh ! I didn't realise that I could create such an uproar ! :-)) To answer Q1. - I wanted to make XWiki a platform for integrating some tools like XPlanner with a Project Mangement template which carries copious amounts of data in its database and also as an area where employees can interact with each other and share/edit data (making use of versioning). This is on an experimental basis. All I wanted to do is - 1. Insert/read data from the company's database (I'm just doing what I am told to do, okay ?). Accessing RDBMS other than XWiki own database from XWiki. 2. Allow employees to access their domains in the mail server/Bugzilla etc. without the need to type in username password repeatedly - just login to XWiki and go to their spaces using links. Something like MS Outlook allows you to access your all your mail accounts. Something like single sing on, but I don't get the exact point here. Sorry. 3. Enter documents under discussion which can be edited by multiple persons (along with histories and RSS) Well, this seems to refer any wiki basis: anybody (or any registered user, or user belonging to a given group, or... depending on your security configuration) will be able to edit a document. What is the doubt here? I hope this is clear enough... :-) Xwiki is serving its purpose but I guess just wanted to bend it a bit too much ! Harikrishnan As far as I've understood you are ready to contribute with a document that will help to solve question number 1 (I'm following that from the Sample Groovy Code thread). Am I right? Vicent has asked about this issue in a previous message. Please, Harikrishnan, have you succeeded while retrieving data from a relational database other than XWiki own database by using Groovy code and you are ready to enter a document about how to do that intended to help to the whole community? Cheers, Ricardo -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
Guys, this looks like a good topic for adding to the API guide at http://www.xwiki.org/xwiki/bin/view/DevGuide/APIGuide It should be mentioned in #warning() box that this is ONLY for data outside of XWiki's control. In addition we should also look at finding out how custom mapping works in XWiki. Thanks! -Vincent On Oct 31, 2007, at 1:41 PM, Esbach, Brandon wrote: Hmm the list server messes up formatting :( Added a bunch of lines to see if that's better % import groovy.sql.Sql; def sendSQL = Sql.newInstance(jdbc:mysql://localhost/ myotherdatabase, username-can-be-root, password-goes-here, com.mysql.jdbc.Driver) sendSQL.eachRow(select * from mytable) {row - println ${row.sessions_guid} } % -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Esbach, Brandon Sent: 31 October 2007 12:33 To: XWiki Users Subject: Re: [xwiki-users] Adding a document in XWiki.org I took a quick look at access another database from xwiki in groovy; this quick snippet -seems- to work (this uses mysql) % import groovy.sql.Sql; def sendSQL = Sql.newInstance(jdbc:mysql://localhost/ myotherdatabase, username-can-be-root, password-goes-here, com.mysql.jdbc.Driver) sendSQL.eachRow(select * from mytable) {row - println ${row.sessions_guid} } % (you will need a database called myotherdatabase and table called mytable for this to work). GORM (groovy's ORM model for hibernate) would be a ton faster to do extended querying, but I'm not sure if it's usable from Xwiki's groovy interface. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Your XEN ICT Team - Ricardo Rodriguez Sent: 31 October 2007 11:36 To: XWiki Users Subject: Re: [xwiki-users] Adding a document in XWiki.org V. Harikrishnan Nair wrote: Hi, Harikrishnan, Perhaps the Three Wise Men could be a better target for our messages :-) (I do hope this Christian metaphor is known enough!) I think we are messing up things here and this won't be useful for anybody. Don't you thing it would be better to split this message into three brand new entries sent to the list? Let's propose... Gosh ! I didn't realise that I could create such an uproar ! :-)) To answer Q1. - I wanted to make XWiki a platform for integrating some tools like XPlanner with a Project Mangement template which carries copious amounts of data in its database and also as an area where employees can interact with each other and share/edit data (making use of versioning). This is on an experimental basis. All I wanted to do is - 1. Insert/read data from the company's database (I'm just doing what I am told to do, okay ?). Accessing RDBMS other than XWiki own database from XWiki. 2. Allow employees to access their domains in the mail server/ Bugzilla etc. without the need to type in username password repeatedly - just login to XWiki and go to their spaces using links. Something like MS Outlook allows you to access your all your mail accounts. Something like single sing on, but I don't get the exact point here. Sorry. 3. Enter documents under discussion which can be edited by multiple persons (along with histories and RSS) Well, this seems to refer any wiki basis: anybody (or any registered user, or user belonging to a given group, or... depending on your security configuration) will be able to edit a document. What is the doubt here? I hope this is clear enough... :-) Xwiki is serving its purpose but I guess just wanted to bend it a bit too much ! Harikrishnan As far as I've understood you are ready to contribute with a document that will help to solve question number 1 (I'm following that from the Sample Groovy Code thread). Am I right? Vicent has asked about this issue in a previous message. Please, Harikrishnan, have you succeeded while retrieving data from a relational database other than XWiki own database by using Groovy code and you are ready to enter a document about how to do that intended to help to the whole community? Cheers, Ricardo -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding a document in XWiki.org
Esbach, Brandon wrote: Hmm the list server messes up formatting :( Added a bunch of lines to see if that's better % import groovy.sql.Sql; def sendSQL = Sql.newInstance(jdbc:mysql://localhost/myotherdatabase, username-can-be-root, password-goes-here, com.mysql.jdbc.Driver) sendSQL.eachRow(select * from mytable) {row - println ${row.sessions_guid} } % Hi, Prior to trying to understand last Vincent entry, I am trying to make the sample code to work here. I have no problem to get single values by using the firstRow method of the sqll class as here... 11: % 12: import groovy.sql.Sql; 13: def sendSQLoo = Sql.newInstance(jdbc:mysql://mire.environmentalchange.net/epec, epec_ReadOnly, epec_ReadOnly, com.mysql.jdbc.Driver) 14: row_a = sendSQLoo.firstRow(select code from epec.spot) 15: println Row: code = ${row_a.code} 16: % But I am not able the get an iteration. I've tried... 19: % 20: import groovy.sql.Sql; 21: println This is a sample to access ibdona in *localhost* 22: def sendSQLibd = Sql.newInstance(jdbc:mysql://localhost/ibdona, root, , com.mysql.jdbc.Driver) 23: sendSQLibd.eachRow(SELECT * FROM ibdona.library_location l) {row -println ${row.location}} 24: % and 1: % 2: import groovy.sql.Sql 3: sql = Sql.newInstance(jdbc:mysql://localhost/ibdona, root, , com.mysql.jdbc.Driver) 4: sql.eachRow(SELECT * FROM ibdona.library_location l, { println it.location + -- ${it.year} --} ); 5: % No error messages. Just a white page in the second script or a page with the static line printed by line 21 for the first one. I'm guessing the query is successful and the sql instance is correctly created, but for any reason I am failing when trying to print the iteration. Please, could you help me with this issue? Thanks! Best, Ricardo -- Ricardo Rodríguez Your XEN ICT Team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users