Re: [xwiki-users] Livetable macro, custom classes, sorting

2010-03-08 Thread Jeremie BOUSQUET
Hi,

I think I found it, at least a way to have it work in most cases ...

In the $columnProperties parameter of the #livetable macro, you should now
add explicitely a parameter class:MyClass  for each column, where
MyClass is the name of the class of the objects you want to show (the same
as the parameter $classNames in $options parameter).

In your case, the following might work :
#set($colprops = {
Customer : { type : text , size : 20, link : edit,
class:Task.TasksClass},
Responsible : { type : list , class: XWiki.XWikiUsers},
 TargetDate: { type : date ,sortable:true, displayName:Target
Date, class:Task.TasksClass},
Activities : { type : text, class:Task.TasksClass },
priority: {type: number, class:Task.TasksClass },
 _actions : {actions: [copy,delete,rename,inline]}

})

There seems to be something wrong with how the class is detected for each
column if you don't do this.

I will update the JIRA,

BR,
Jeremie

2010/3/4 Jeremie BOUSQUET jeremie.bousq...@gmail.com

 Again,
 I eventually created a JIRA on this ...
 http://jira.xwiki.org/jira/browse/XWIKI-4973


 2010/3/4 Jeremie BOUSQUET jeremie.bousq...@gmail.com

 Hi,

 I think it's the same issue I encountered (see my other posts Still issue
 in livetable...).

 I did investigate a little, and in my understanding the sort query
 generated by XWiki.LiveTableResultsMacros is broken when type of field is
 not text (StringProperty).
 It seems to me that the macro in this case do not properly retrieve the
 field type, and so puts the default, StringProperty. Of course the query
 returns no answer, and your livetable is empty.

 In my case I corrected it in a very ugly way, for my particular use-case
 on Dates properties. I did not find, though, exactly why the macro do not
 find the correct type, but I think it might be linked to how the
 resultsmacros page is called (with parameters like
 TargetDate_class=${propClassName}), in this case it would more be a bug in
 the #livetable macro or in the javascript.

 I wanted to create a JIRA on this but I'd like some feedback from the wiki
 team before :)

 Jeremie

 2010/3/4 Hans-Peter Zorn h...@gmx.org

 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




 ___
 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] Creating user using XML RPC....

2010-03-08 Thread Dilipkumar Jadhav
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 nithu...@gmail.com
Subject: [xwiki-users] Creating user using XML RPC
To: users@xwiki.org
Message-ID: 1267637585814-4669004.p...@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 ser...@xwiki.com
Subject: Re: [xwiki-users] Creating user using XML RPC
To: XWiki Users users@xwiki.org
Message-ID: 4b8ea930.8020...@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/


--

___
users mailing list
users@xwiki.org

[xwiki-users] How to add/ register a new user in xwiki through xmlrpc??

2010-03-08 Thread Nithya Vembu

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(sh...@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-tp4694340p4694340.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] calendar plugin in myexwiki

2010-03-08 Thread Rune Hylleberg
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

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Problems logigging in

2010-03-08 Thread 2smart4u
hi there,

found out what the problem was.

so in case anyone else is caught in the same pitfall, here's the
receipe to avoid the hassel:

- precondition:

you're installing xwiki as a war-file being deployed in your servlet-container

in the docs is mentioned, that you have to use the import/export-tool
to import the xwkiki-default-pages.

however, to do so, you must be logged-in which obviously does not work
without the default-pages being imported.

solution:

- enable the superuser-account, then import the default pages

- go to the user-management and set the password for the Admin-user

- disable the superuser-account (security!)

- restart xwiki

- login as Admin

hope this helps somebody in the future when browsing the archives of this list

cheers

gregor
-- 
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
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Problems logigging in

2010-03-08 Thread 2smart4u
On Mon, Mar 8, 2010 at 2:51 PM, Vincent Massol vinc...@massol.net wrote:


 Actually you don't have to be logged in (unless a regression was introduced 
 recently). I've always imported without being logged in in the past.


I don't know what magic you're doing, but seems I'm not the only one
having made that experience:

 [ cut ]=
Default administrator login after installation is: Username: Admin
('A' capitalized, not: admin or Administrator) Password: admin (all
lowercase)

This user is not available if you just deploy the .war on tomcat or
jetty; You must also import the xwiki-1.0-beta-1.xar.xar into your
XWiki instance. In which case you might need to know how to enable the
superadmin user:
(http://www.xwiki.org/xwiki/bin/view/FAQ/HowCanIGetBackAdminRightsWhenIDeletedThemForMeByAccident)
 [ cut ]=

Source: 
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation#HFailuretologin

Cheers

Gregor
-- 
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
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Problems logigging in

2010-03-08 Thread Vincent Massol

On Mar 8, 2010, at 3:03 PM, 2smart4u wrote:

 On Mon, Mar 8, 2010 at 2:51 PM, Vincent Massol vinc...@massol.net wrote:
 
 
 Actually you don't have to be logged in (unless a regression was introduced 
 recently). I've always imported without being logged in in the past.
 
 
 I don't know what magic you're doing, but seems I'm not the only one
 having made that experience:
 
  [ cut ]=
 Default administrator login after installation is: Username: Admin
 ('A' capitalized, not: admin or Administrator) Password: admin (all
 lowercase)
 
 This user is not available if you just deploy the .war on tomcat or
 jetty; You must also import the xwiki-1.0-beta-1.xar.xar into your
 XWiki instance. In which case you might need to know how to enable the
 superadmin user:
 (http://www.xwiki.org/xwiki/bin/view/FAQ/HowCanIGetBackAdminRightsWhenIDeletedThemForMeByAccident)
  [ cut ]=
 
 Source: 
 http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation#HFailuretologin

The Admin user is imported when you import the default XE XAR. When you install 
a wiki with an empty database the security system is not in place and the user 
not logged in can perform an import.

Just talked to Thomas Mortagne who confirmed we have a regression and it's not 
working any more. So this will get fixed ASAP (I guess in XE 2.2.3).

Thanks and sorry about the problem
-Vincent

 Cheers
 
 Gregor
 -- 
 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
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Problems logigging in

2010-03-08 Thread 2smart4u
On Mon, Mar 8, 2010 at 3:30 PM, Vincent Massol vinc...@massol.net wrote:


 Just talked to Thomas Mortagne who confirmed we have a regression and it's 
 not working any more. So this will get fixed ASAP (I guess in XE 2.2.3).

 Thanks and sorry about the problem

well, no problem, at least there's a workaround importing the stuff as
the superadmin

cheers

gregor
-- 
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
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] How to add/ register a new user in xwiki through xmlrpc??

2010-03-08 Thread Dilipkumar Jadhav
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.dilipku...@gmail.com
 Subject: Re: [xwiki-users] Creating user using XML RPC
 To: users@xwiki.org
 Message-ID: 4b93ce62.5744f10a.750e.0...@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 nithu...@gmail.com
 Subject: [xwiki-users] Creating user using XML RPC
 To: users@xwiki.org
 Message-ID: 1267637585814-4669004.p...@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 ser...@xwiki.com
 Subject: Re: [xwiki-users] Creating user using XML RPC
 To: XWiki Users users@xwiki.org
 Message-ID: 4b8ea930.8020...@xwiki.com
 Content-Type: text/plain; charset=UTF-8;