Hi All,
I have created user through xml rpc. But the user dont have any rights
and the user not added in the default group.
how to add the user in XWiki All Group and give the rights through xml
rpc??
Any idea.?? I surfed net and this nabble forum but i didnt get the
solution.
Thanks,
Nithya.
--
View this message in context: http://n2.nabble.com/Adding-user-to-defaul-group-with-appropriate-rights-th…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Nithya,
As Sergiu rightly said, an XWiki user is just another document/Page with a
XWiki.XWikiUser object associated to it.
Hope the following example helps you in creating users using XMLRPC.
Please note that I have only been able to create a user. "Setting" the
password is something I did not have much luck with.
Probably, the XMLRPC API method to set the "password" property stores the
password in plain text when in fact XWiki expects passwords which are
"hashed".
I hope someone on the mailing list could help by providing the code snippet
to update password using XMLRPC. Once, that is done, we can save this
example at
http://platform.xwiki.org/xwiki/bin/view/Features/XMLRPCJavaExamples
========================================================================
import java.net.MalformedURLException;
import org.apache.xmlrpc.XmlRpcException;
import org.codehaus.swizzle.confluence.Page;
import org.xwiki.xmlrpc.XWikiXmlRpcClient;
import org.xwiki.xmlrpc.model.XWikiObject;
public class CreateUser {
public static void main(String[] args) throws MalformedURLException,
XmlRpcException {
//URL of the xwiki instance
String url = "http://localhost:8080/xwiki/xmlrpc/confluence";
//Replace user & pass with desired xwiki username & password
String user = "Admin";
String pass = "admin";
XWikiXmlRpcClient rpc = new XWikiXmlRpcClient(url);
try {
//Perform Login & Authentication
rpc.login(user, pass);
//Create a Page to hold the user profile & set it's three
important attributes viz. Space, Title, Content
//Set the space="XWiki" since all XWiki users go to
"XWiki" space by default
//Set title to the username of the user. In our
case, username="testuser"
//Set content to include the XWikiUserSheet.
//Without this the user Page will come up blank and
no fields will be displayed
Page page = new Page();
page.setSpace("XWiki");
page.setTitle("testuser");
page.setId("XWiki.testuser");
page.setContent("{{include
document=\"XWiki.XWikiUserSheet\"/}}");
rpc.storePage(page);
//Create a XWikiObject and set the class to
XWiki.XWikiUsers
//Set the "host" Page as XWiki.testuser. This is the
page we created in the steps above
//Set the first_name & last_name properties with
values "Test" and "User" respectively
//We can access the list of all properties for a
User class at the following link:
//http://localhost:8080/xwiki/bin/edit/XWiki/XWikiUsers?editor=class
//Finally, save the object using rpc.storeObject
XWikiObject xobj = new XWikiObject();
xobj.setClassName("XWiki.XWikiUsers");
xobj.setPageId("XWiki.testuser");
xobj.setProperty("first_name", "Test");
xobj.setProperty("last_name", "User");
rpc.storeObject(xobj);
} catch (XmlRpcException e) {
System.out.println(e);
} finally {
rpc.logout();
}
}
}
========================================================================
Message: 1
Date: Wed, 3 Mar 2010 09:33:05 -0800 (PST)
From: Nithya Vembu <nithu2k5(a)gmail.com>
Subject: [xwiki-users] Creating user using XML RPC....
To: users(a)xwiki.org
Message-ID: <1267637585814-4669004.post(a)n2.nabble.com>
Content-Type: text/plain; charset=us-ascii
Hi All,
Is there any sample available to create a user through XML RPC like the
examples in the following link for creation of page, space etc..
http://platform.xwiki.org/xwiki/bin/view/Features/XMLRPCJavaExamples
Please help me out if there any solution.
Thanks,
Nithya.
--
View this message in context:
http://n2.nabble.com/Creating-user-using-XML-RPC-tp4669004p4669004.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
------------------------------
Message: 2
Date: Wed, 03 Mar 2010 19:23:44 +0100
From: Sergiu Dumitriu <sergiu(a)xwiki.com>
Subject: Re: [xwiki-users] Creating user using XML RPC....
To: XWiki Users <users(a)xwiki.org>
Message-ID: <4B8EA930.8020102(a)xwiki.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
On 03/03/2010 06:33 PM, Nithya Vembu wrote:
>
> Hi All,
>
> Is there any sample available to create a user through XML RPC like the
> examples in the following link for creation of page, space etc..
>
> http://platform.xwiki.org/xwiki/bin/view/Features/XMLRPCJavaExamples
>
> Please help me out if there any solution.
A user is just like any other document+object. Just do what's usually
done for creating a new document and adding a XWiki.XWikiUsers object.
Don't forget to add the user to the groups you want.
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
------------------------------
Hi Nithya,
Looks like in your example you are using Apache XMLRPC directly. In
the example that I provided I have used the client side proxy for Java
which is much easier and less verbose than the other method.
Please run this example and let me know if it works out for you...
I am quite interested in finding out if it works...thanks.
> ------------------------------
>
> Message: 2
> Date: Sun, 7 Mar 2010 21:33:32 +0530
> From: "Dilipkumar Jadhav" <jadhav.dilipkumar(a)gmail.com>
> Subject: Re: [xwiki-users] Creating user using XML RPC....
> To: <users(a)xwiki.org>
> Message-ID: <4b93ce62.5744f10a.750e.0934(a)mx.google.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi Nithya,
> As Sergiu rightly said, an XWiki user is just another document/Page with a
> XWiki.XWikiUser object associated to it.
> Hope the following example helps you in creating users using XMLRPC.
> Please note that I have only been able to create a user. "Setting" the
> password is something I did not have much luck with.
> Probably, the XMLRPC API method to set the "password" property stores the
> password in plain text when in fact XWiki expects passwords which are
> "hashed".
> I hope someone on the mailing list could help by providing the code snippet
> to update password using XMLRPC. Once, that is done, we can save this
> example at
> http://platform.xwiki.org/xwiki/bin/view/Features/XMLRPCJavaExamples
>
> ========================================================================
>
>
> import java.net.MalformedURLException;
> import org.apache.xmlrpc.XmlRpcException;
> import org.codehaus.swizzle.confluence.Page;
> import org.xwiki.xmlrpc.XWikiXmlRpcClient;
> import org.xwiki.xmlrpc.model.XWikiObject;
>
> public class CreateUser {
>
> public static void main(String[] args) throws MalformedURLException,
> XmlRpcException {
>
> //URL of the xwiki instance
> String url = "http://localhost:8080/xwiki/xmlrpc/confluence";
>
> //Replace user & pass with desired xwiki username & password
> String user = "Admin";
> String pass = "admin";
>
> XWikiXmlRpcClient rpc = new XWikiXmlRpcClient(url);
> try {
> //Perform Login & Authentication
> rpc.login(user, pass);
>
> //Create a Page to hold the user profile & set it's three
> important attributes viz. Space, Title, Content
> //Set the space="XWiki" since all XWiki users go to
> "XWiki" space by default
> //Set title to the username of the user. In our
> case, username="testuser"
> //Set content to include the XWikiUserSheet.
> //Without this the user Page will come up blank and
> no fields will be displayed
>
> Page page = new Page();
> page.setSpace("XWiki");
> page.setTitle("testuser");
> page.setId("XWiki.testuser");
> page.setContent("{{include
> document=\"XWiki.XWikiUserSheet\"/}}");
> rpc.storePage(page);
>
> //Create a XWikiObject and set the class to
> XWiki.XWikiUsers
> //Set the "host" Page as XWiki.testuser. This is the
> page we created in the steps above
> //Set the first_name & last_name properties with
> values "Test" and "User" respectively
> //We can access the list of all properties for a
> User class at the following link:
>
> //http://localhost:8080/xwiki/bin/edit/XWiki/XWikiUsers?editor=class
> //Finally, save the object using rpc.storeObject
>
> XWikiObject xobj = new XWikiObject();
> xobj.setClassName("XWiki.XWikiUsers");
> xobj.setPageId("XWiki.testuser");
> xobj.setProperty("first_name", "Test");
> xobj.setProperty("last_name", "User");
> rpc.storeObject(xobj);
>
> } catch (XmlRpcException e) {
> System.out.println(e);
> } finally {
> rpc.logout();
> }
> }
> }
>
> ========================================================================
>
>
> Message: 1
> Date: Wed, 3 Mar 2010 09:33:05 -0800 (PST)
> From: Nithya Vembu <nithu2k5(a)gmail.com>
> Subject: [xwiki-users] Creating user using XML RPC....
> To: users(a)xwiki.org
> Message-ID: <1267637585814-4669004.post(a)n2.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi All,
>
> Is there any sample available to create a user through XML RPC like the
> examples in the following link for creation of page, space etc..
>
> http://platform.xwiki.org/xwiki/bin/view/Features/XMLRPCJavaExamples
>
> Please help me out if there any solution.
>
> Thanks,
> Nithya.
> --
> View this message in context:
> http://n2.nabble.com/Creating-user-using-XML-RPC-tp4669004p4669004.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 03 Mar 2010 19:23:44 +0100
> From: Sergiu Dumitriu <sergiu(a)xwiki.com>
> Subject: Re: [xwiki-users] Creating user using XML RPC....
> To: XWiki Users <users(a)xwiki.org>
> Message-ID: <4B8EA930.8020102(a)xwiki.com>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> On 03/03/2010 06:33 PM, Nithya Vembu wrote:
>>
>> Hi All,
>>
>> Is there any sample available to create a user through XML RPC like the
>> examples in the following link for creation of page, space etc..
>>
>> http://platform.xwiki.org/xwiki/bin/view/Features/XMLRPCJavaExamples
>>
>> Please help me out if there any solution.
>
> A user is just like any other document+object. Just do what's usually
> done for creating a new document and adding a XWiki.XWikiUsers object.
>
> Don't forget to add the user to the groups you want.
>
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
>
>
> ------------------------------
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 8 Mar 2010 02:09:14 -0800 (PST)
> From: Nithya Vembu <nithu2k5(a)gmail.com>
> Subject: [xwiki-users] How to add/ register a new user in xwiki
> through xmlrpc??
> To: users(a)xwiki.org
> Message-ID: <1268042954966-4694340.post(a)n2.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi All,
>
> I am struggling in the user creation part of xwiki through xml rpc.
>
> This is my code snippet to create a new user in xwiki..
>
> String url =
> "http://sso.isupport.com/xwiki/xmlrpc/confluence";
> String user = "Admin";
> String pass = "admin";
>
> Confluence confObj = new Confluence(url);
> confObj.login(user, pass);
>
> User userObj = new User(new HashMap());
> userObj.setEmail("shimy(a)gmail.com");
> userObj.setFullname("shimyThomas");
> userObj.setName("shimy");
> confObj.addUser(userObj, "csscorp");
>
> while running this an application i am getting the following error.. in
> this specific line
>
> confObj.addUser(userObj, "csscorp");
>
> org.codehaus.swizzle.confluence.ConfluenceException: No such handler:
> confluence1.addUser
> at org.codehaus.swizzle.confluence.Confluence.call(Confluence.java:808)
> at org.codehaus.swizzle.confluence.Confluence.call(Confluence.java:770)
> at org.codehaus.swizzle.confluence.Confluence.addUser(Confluence.java:435)
> at CreateUser.main(CreateUser.java:55)
>
>
> Can anyone suggest me how to create a user? Kindly tell me is there any
> bug in the code...
>
>
> Thanks,
> Nithya.
> --
> View this message in context: http://n2.nabble.com/How-to-add-register-a-new-user-in-xwiki-through-xmlrpc…
> Sent from the XWiki- Users mailing list archive at Nabble.com.
>
>
Is the calendar plugin installed in myxwiki. If not are there any chance it might happen?
I tried to install the calendar application but gets this output:
$cparams.put("categories", $rqcategories)
$cview.getHTMLCalendar($cparams, "")
I hope someone can help me
-Rune
Hi All,
I am struggling in the user creation part of xwiki through xml rpc.
This is my code snippet to create a new user in xwiki..
String url =
"http://sso.isupport.com/xwiki/xmlrpc/confluence";
String user = "Admin";
String pass = "admin";
Confluence confObj = new Confluence(url);
confObj.login(user, pass);
User userObj = new User(new HashMap());
userObj.setEmail("shimy(a)gmail.com");
userObj.setFullname("shimyThomas");
userObj.setName("shimy");
confObj.addUser(userObj, "csscorp");
while running this an application i am getting the following error.. in
this specific line
confObj.addUser(userObj, "csscorp");
org.codehaus.swizzle.confluence.ConfluenceException: No such handler:
confluence1.addUser
at org.codehaus.swizzle.confluence.Confluence.call(Confluence.java:808)
at org.codehaus.swizzle.confluence.Confluence.call(Confluence.java:770)
at org.codehaus.swizzle.confluence.Confluence.addUser(Confluence.java:435)
at CreateUser.main(CreateUser.java:55)
Can anyone suggest me how to create a user? Kindly tell me is there any
bug in the code...
Thanks,
Nithya.
--
View this message in context: http://n2.nabble.com/How-to-add-register-a-new-user-in-xwiki-through-xmlrpc…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi,
I am using xwiki 2.1.1 and i am having problem with livetable and a simple
custom class.
Here is my code:
#set($collist = ["Customer", "Responsible", "TargetDate", "Activities",
"priority", "_actions"])
#set($colprops = {
"Customer" : { "type" : "text" , "size" : 20, "link" : "edit"},
"Responsible" : { "type" : "list" , "class": "XWiki.XWikiUsers"},
"TargetDate": { "type" : "date" ,"sortable":"true",
"displayName":"Target Date"},
"Activities" : { "type" : "text" },
"priority": {"type": "number" },
"_actions" : {"actions": ["copy","delete","rename","inline"]}
})
#set($options = { "className":"Task.TasksClass",
"rowCount": 15 })
#livetable("alldocs" $collist $colprops $options)
It displays three documents, but as soon as I click on one of the other
columns to sort the table, it gets empty.
For the allDocumentsSnippet it works.
I have no carriage returns or quotes in the fields that are to be displayed.
I tried with different options and also only two fields (customer and
priority): the same happens.
Is this a known bug or did I misunderstand the livetable macro?
Thanks,
Hans-Peter
Hi everybody,
Is there a way to dynamically (through groovy code) change the values on a
static list or on any other property of a xwiki class?
I am using *field = document.getxWikiClass().get("propertyName")* to get the
property.
document is of type* com.xpn.xwiki.api.Document*.
But when I try to change the value using *
field.getPropertyClass().setValues("val1|val2|val3")* I get a *null* value
from* field.getPropertyClass()*
I am following the information on
http://www.mail-archive.com/users@xwiki.org/msg10692.html
I am using groovy on xwiki 2.0.2.24645
Regards
Abel
Hi,
With XE 2.2.1, I think I have some issues retrieving expected results from
Lucene search, using "object:" term.
For example, if I want to search for comments containing "test", I would
enter as search term in Main.LuceneSearch:
test AND object:XWiki.XWikiComments
This returns no result in my case.
But then if I use Luke to browse the Lucene index in
$TOMCAT_HOME/work/Catalina/localhost/xwiki/lucene, I can find at least 5
documents for which field "XWiki.XWikiComments.comment" matches with "test".
I believe that Main.LuceneSearch should return exactly the same result, and
not an empty set ?
Another use-case, if my search term is only "object:XWiki.XWikiComments",
page retrieves only 2 results. There are far more comments in my wiki of
course ...
Am I missing something ?
Best regards,
Jeremie
Hi,
We're evaluating XWiki for a project of collaborative portal. Just to
explain the needs in a few points :
- users can create and update pages (sometimes it's good to remind basics
;-)
- a page is structured in fields. Fields are predefined in templates. The
vocabulary for xwiki seems to be classes (templates) and objects (pages)
- a page can be translated.
- a page can be tagged
We started the development of a proof of concept, based on the version
Enterprise 2.2.27100. I was impressed by built-in translated pages and the
way to develop applications. But two blocker points have now to be fixed :
- the search engine does not process page tags. Some threads on the
mailing-list address this question but I can't find a real solution.
- objects can not be translated (see
XWIKI-69<http://jira.xwiki.org/jira/browse/XWIKI-69>).
In my words a page can not be translated if it uses a template. Using
conditions in macros is not a good workaround for end-users. Is there
another way to implement this feature ? Do you have any recommendations ?
Your help would be much appreciated.
Thank you,
Simon Brandhof
Sonar - http://www.sonarsource.com
---
Hi guys,
first off, thanks to VBincent, Anca & Sdumitriu for pointing me to
this list via Twitter
My current environment:
Using CATALINA_BASE: /home/tomcat/www
Using CATALINA_HOME: /home/tomcat/www
Using CATALINA_TMPDIR: /home/tomcat/www/temp
Using JRE_HOME: /usr/lib/jvm/java-1.6.0-sun
Server version: Apache Tomcat/5.5.20
Server built: Sep 12 2006 10:09:20
Server number: 5.5.20.0
OS Name: Linux
OS Version: 2.6.18-4-686
Architecture: i386
JVM Version: 1.6.0_10-b33
JVM Vendor: Sun Microsystems Inc.
I'm running on Debia, but I'm not using a packaged version but a
vanilla Tomcat installation
MySQL:
mysql Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2
Connection id: 57
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.0.32-Debian_7etch11-log Debian etch distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 14 days 21 hours 38 min 38 sec
Now I know what you guys are saying - "you have to set up a
UTF-8-databse", but well, should be enough if the database is set to
use UTF-8 and not the whole MySQL-instance,right?
Therefore:
mysql> show create database xwiki;
+----------+----------------------------------------------------------------+
| Database | Create Database |
+----------+----------------------------------------------------------------+
| xwiki | CREATE DATABASE `xwiki` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+----------------------------------------------------------------+
1 row in set (0.00 sec)
Now what I did so far:
- I downloaded the latest stand-alone war from the xwiki-website
- I created a new Virtual Host within Tomcat and deployed the war
- I commented out the default HSQL-DB-settings and adapted the
MySQL-settings in hibernate.cfg.xml:
<property name="connection.url">jdbc:mysql://localhost/xwiki?useServerPrepStmts=false&useUnicode=true&characterEncoding=UTF-8&sessionVariables=sql_mode=''</property>
<property name="connection.username">someUser</property>
<property name="connection.password">somePassword</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
<property name="connection.pool_size">2</property>
<property name="statement_cache.size">2</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
- in xwiki.cfg, I left everything at their default values except
xwiki.store.migration=0
- I restartet Tomcat, and then went to
http://myServer/xwiki/bin/import/XWiki/XWikiPreferences
to import the default pages as suggested in the docs.
However, I'm getting a HTTP 500 with the following exception:
Caused by: java.sql.BatchUpdateException: Data truncation: Out of
range value adjusted for column 'XWD_HIDDEN' at row 1
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:894)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
/There are a lot more exeption, but the above one should be the root-cause.
My understanding is, that some mapping within Hibernate is wrong, but
I got no idea on how to fix that.
Any suggestions would be very much appreciated.
TIA
Gregor
PS.: I'm running Tomcat as a demon via jsvc, but I don't think that
this has anything to do with the above error
--
--
just because you're paranoid, don't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available
@ http://pgpkeys.pca.dfn.de:11371
@ http://pgp.mit.edu:11371/
skype:rc46fi