Hello Friends,
I have been asked to connect an external database with XWiki (XWiki will be
used as the application & MySql as the database).
I am using XWiki Enterprise 1.7.14685 :: MySql 5.0.
The external database (let's call it titan) is on the same mysql instance
(port) as XWiki database itself.
The requirement is to fetch user input (in terms of check boxes, radio
buttons & text boxes) from XWiki page and insert it into database.
Also, some degree of read operation from the database is required.
I've been able to read from my external database using the following code
directly in my XWiki page (under XWiki 1.0 syntax):
<%
import groovy.sql.Sql
def sql = Sql.newInstance("jdbc:mysql://localhost:3306/titan",
"root",
"test", "com.mysql.jdbc.Driver")
sql.eachRow("select * from user"){
println "${it.user}"
}
%>
Hence, I am confident that an update or insert operation can be performed
with ease too (thanks to the groovy page at
http://groovy.codehaus.org/Database+features).
But I am not familiar with how to retrieve session parameters from the page
context. Could someone please guide me to a resource or a working example of
fetching context variables/parameters. Maybe it is a very simple solution,
but I have very little background in velocity. Any help would be much
appreciated.
Also, any time-frame on the page rating feature which is being discussed
very often now?(what version we could expect to see it?). Also, would page
rating be available for all the documents in an existing wiki (as in
embedded in the velocity templates) or would it be available only for newly
created pages/documents.
Thank you everyone...