Re: [xwiki-users] Programming rights needed for Copy Action

2010-03-05 Thread raphaelle

Waiting the correction of the bug you can correct it now by modifying the
file contentmenu.vm of the template you use, you look for the word "copy",
you'll find:

#if( $xwiki.hasProgrammingRights())
#submenuitem($doc.getURL('view', 'xpage=copy') $msg.get('core.menu.copy')
'tmActionCopy', '')
#end

and you delete the lines before and after that prevent it to be displayed
you must get:
#submenuitem($doc.getURL('view', 'xpage=copy') $msg.get('core.menu.copy')
'tmActionCopy', '')

so that every user has access to the copy.
-- 
View this message in context: 
http://n2.nabble.com/Programming-rights-needed-for-Copy-Action-tp4677178p4679599.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


Re: [xwiki-users] Programming rights needed for Copy Action

2010-03-05 Thread Vincent Massol
Hi Raphaelle,

On Mar 5, 2010, at 9:18 AM, raphaelle wrote:

> 
> Waiting the correction of the bug you can correct it now by modifying the
> file contentmenu.vm of the template you use, you look for the word "copy",
> you'll find:
> 
> #if( $xwiki.hasProgrammingRights())
> #submenuitem($doc.getURL('view', 'xpage=copy') $msg.get('core.menu.copy')
> 'tmActionCopy', '')
> #end
> 
> and you delete the lines before and after that prevent it to be displayed
> you must get:
> #submenuitem($doc.getURL('view', 'xpage=copy') $msg.get('core.menu.copy')
> 'tmActionCopy', '')
> 
> so that every user has access to the copy.

That won't work. The reason for these lines is because the copy code thereafter 
requires programming rights (PR) so this code is just to ensure that users with 
no PR don't see the copy action menu since it would fail.

-Vincent

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


Re: [xwiki-users] Programming rights needed for Copy Action

2010-03-05 Thread raphaelle

indeed just realized it...
I tried to cheat and modify the rights on the page "Copy a document" to link
on her, so that all my users could copy, but it doesn't work...
there is'nt a way to bypass the rights with some Velocity code put in the
right place?
-- 
View this message in context: 
http://n2.nabble.com/Programming-rights-needed-for-Copy-Action-tp4677178p4679753.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


Re: [xwiki-users] What is $xwiki.getXMLEncoded()'s purpose in url names?

2010-03-05 Thread Thomas Mortagne
On Fri, Mar 5, 2010 at 04:58, Sergiu Dumitriu  wrote:
> On 03/02/2010 08:20 PM, Thomas Mortagne wrote:
>> On Tue, Mar 2, 2010 at 18:25, Sergiu Dumitriu  wrote:
>>> On 03/02/2010 05:01 PM, Joel Forsberg wrote:

 Greetings

 On my wiki using swedish characters for xwiki page titles give ugly but
 working entries in all panels, e.g. "Backlinks" "Recent modifications" and 
 "My
 recent modifications"

 An example is having:
    "Startsidor för våra intresseområden"
 ...instead of the correct:
    "Startsidor för våra intresseområden"

 Another example is putting thiss wiki code on top of a page:
    = header that    here =

 The script responsible for for the texts in the panels is as follow:

 
 
    $xwiki.getXMLEncoded($rdoc.displayTitle)
 

 I've noticed that changing the third line into only $rdoc.displayTitle will
 produce a nice looking entry, and $rdoc is set via

 #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())

 Now, can anyone see a purpose of using getXMLEncoded() for this? As far as 
 I
 have seen, it only breaks things.
>>>
>>> This is not caused by getXMLEncoded, it merely makes the problem
>>> visible. This method must be used in order to prevent other problems:
>>> Invalid XML, broken layout, XSS...
>>>
>>> The problem is that the code inside getDisplayTitle wrongly uses a XML
>>> escaping option.
>>
>> No, this is valid because the job of $rdoc.displayTitle is to produce
>> xhtml content and theses are valid XML escapes.
>
> Where does it say that it should produce xhtml content?

public String getDisplayTitle(XWikiContext context)
{
return getRenderedTitle(Syntax.XHTML_1_0, context);
}

>
> Assuming that it should produce xhtml, the behavior is inconsistent. If
> the title is placed in the document.title field, then it returns
> characters; if it is placed in the first heading, it returns escapes. If
> we use wiki syntax in the document.title, we get back wiki syntax; if we
> use wiki syntax in the first heading, we get back HTML. That is totally
> inconsistent and confusing.
>
> This is an API design problem that should be discussed further on the
> dev list.
>
>
>
> Going back to this specific problem, I think that it should be solved by
> using the plaintext output syntax, since inside a panel we're not
> interested in formatting or other markup inside the title, just the
> textual content.
>
>> So you don't need to
>> use getXMLEncoded because any xml content is already properly escaped
>> (in xwiki/2.0 syntax).
>
> I need to use getXMLEncoded because the title doesn't always come from
> the content.
>
>> When you want a plain text version of the title you should use
>> $rdoc.getRenderedTitle("plain/1.0").
>
>
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>



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


Re: [xwiki-users] E-Mail Notification by Scheduler Job Script ?

2010-03-05 Thread Thilo

Thanks for your Answer.

Yes, i have clicked schedule. But I only got a Mail back when i clicked
"save and view", but not when the job is fired. 

I'll try your suggestion and post whether it works. 
Is it right that I dont nedd to put between {{groovy}} and {{/groovy}} in
the field for the job script. Just the code?

Thanks
Thilo
-- 
View this message in context: 
http://n2.nabble.com/E-Mail-Notification-by-Scheduler-Job-Script-tp4676911p4679841.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


Re: [xwiki-users] LDAP users with dot in username

2010-03-05 Thread Guillaume Lerouge
Hi,

On Fri, Mar 5, 2010 at 2:08 AM, Dilipkumar Jadhav <
jadhav.dilipku...@gmail.com> wrote:

> Thanks for your prompt response Thomas...now I am relieved.
> All I need to do is figure out how to configure LDAP with XWiki.
> By the way, in case I have a user let's say - Jane Doe whose username in
> Active Directory is Jane.Doe
> Would I create a user of the same name called JaneDoe in XWiki or would I
> create user called Jane.Doe?
> Or am I misreading something here and don't need to create users at all in
> XWiki...
>

You don't need to create them. Once LDAP is configured correctly in XWiki,
users will be created automatically in the wiki the first time they connect
to the wiki with their LDAP credentials.

Guillaume


> On Thu, Mar 4, 2010 at 17:46, Dilipkumar Jadhav
>  wrote:
> > Hello folks,
> > Returning to the xwiki mailing list after a long time with a question
> > about LDAP authentication.
> > Our active directory has usernames with a dot (.) character. Would it
> > be possible to sync our XWiki with the active directory under this
> > scenario. If I am not mistaken, we would need to create equivalent
> > users in the XWiki for each user in the active directory.
> > And, XWiki does not accept a dot in the username field.
> > Any insight will be greatly appreciated. Thank you guys.
>
> XWiki does not accept a dot in the page but LDAP authenticator has a
> special handling of username with . so you will not have issue.
>
> In short don't worry about . in ldap user name it's working ;)
>
> > ___
> > users mailing list
> > users@xwiki.org
> > http://lists.xwiki.org/mailman/listinfo/users
> >
>
>
>
> --
> Thomas Mortagne
>
>
>
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>



-- 
Guillaume Lerouge
Product Manager - XWiki SAS
Skype: wikibc
Twitter: glerouge
http://guillaumelerouge.com/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] E-Mail Notification by Scheduler Job Script ?

2010-03-05 Thread Guillaume Lerouge
Hi,

On Fri, Mar 5, 2010 at 10:22 AM, Thilo  wrote:

>
> Thanks for your Answer.
>
> Yes, i have clicked schedule. But I only got a Mail back when i clicked
> "save and view", but not when the job is fired.
>
> I'll try your suggestion and post whether it works.
> Is it right that I dont nedd to put between {{groovy}} and {{/groovy}} in
> the field for the job script. Just the code?
>

Yes, this is correct. The scheduler assumes that you'll be passing a Groovy
script to it.

Guillaume


> Thanks
> Thilo
> --
> View this message in context:
> http://n2.nabble.com/E-Mail-Notification-by-Scheduler-Job-Script-tp4676911p4679841.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
>



-- 
Guillaume Lerouge
Product Manager - XWiki SAS
Skype: wikibc
Twitter: glerouge
http://guillaumelerouge.com/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] What is $xwiki.getXMLEncoded()'s purpose in url names?

2010-03-05 Thread Sergiu Dumitriu
On 03/05/2010 10:06 AM, Thomas Mortagne wrote:
> On Fri, Mar 5, 2010 at 04:58, Sergiu Dumitriu  wrote:
>> On 03/02/2010 08:20 PM, Thomas Mortagne wrote:
>>> On Tue, Mar 2, 2010 at 18:25, Sergiu Dumitriuwrote:
 On 03/02/2010 05:01 PM, Joel Forsberg wrote:
>
> Greetings
>
> On my wiki using swedish characters for xwiki page titles give ugly but
> working entries in all panels, e.g. "Backlinks" "Recent modifications" 
> and "My
> recent modifications"
>
> An example is having:
> "Startsidor för våra intresseområden"
> ...instead of the correct:
> "Startsidor för våra intresseområden"
>
> Another example is putting thiss wiki code on top of a page:
> = header that  here =
>
> The script responsible for for the texts in the panels is as follow:
>
> 
> 
> $xwiki.getXMLEncoded($rdoc.displayTitle)
> 
>
> I've noticed that changing the third line into only $rdoc.displayTitle 
> will
> produce a nice looking entry, and $rdoc is set via
>
> #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())
>
> Now, can anyone see a purpose of using getXMLEncoded() for this? As far 
> as I
> have seen, it only breaks things.

 This is not caused by getXMLEncoded, it merely makes the problem
 visible. This method must be used in order to prevent other problems:
 Invalid XML, broken layout, XSS...

 The problem is that the code inside getDisplayTitle wrongly uses a XML
 escaping option.
>>>
>>> No, this is valid because the job of $rdoc.displayTitle is to produce
>>> xhtml content and theses are valid XML escapes.
>>
>> Where does it say that it should produce xhtml content?
>
>  public String getDisplayTitle(XWikiContext context)
>  {
>  return getRenderedTitle(Syntax.XHTML_1_0, context);
>  }

I know that this is what it does, but why? The semantics of this method 
changed over time. The method used (with 1.0 syntax) to return whatever 
was in the title, interpreted but not rendered. So, if it did contain 
html markup in it, then that was it. But the wiki markup wasn't rendered 
into HTML. And it still behaves this way for the value placed in the 
title field.

So, I don't agree with the behavior change and the inconsistency it creates.

>>
>> Assuming that it should produce xhtml, the behavior is inconsistent. If
>> the title is placed in the document.title field, then it returns
>> characters; if it is placed in the first heading, it returns escapes. If
>> we use wiki syntax in the document.title, we get back wiki syntax; if we
>> use wiki syntax in the first heading, we get back HTML. That is totally
>> inconsistent and confusing.
>>
>> This is an API design problem that should be discussed further on the
>> dev list.
>>
>>
>>
>> Going back to this specific problem, I think that it should be solved by
>> using the plaintext output syntax, since inside a panel we're not
>> interested in formatting or other markup inside the title, just the
>> textual content.
>>
>>> So you don't need to
>>> use getXMLEncoded because any xml content is already properly escaped
>>> (in xwiki/2.0 syntax).
>>
>> I need to use getXMLEncoded because the title doesn't always come from
>> the content.
>>
>>> When you want a plain text version of the title you should use
>>> $rdoc.getRenderedTitle("plain/1.0").


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] What is $xwiki.getXMLEncoded()'s purpose in url names?

2010-03-05 Thread Thomas Mortagne
On Fri, Mar 5, 2010 at 10:40, Sergiu Dumitriu  wrote:
> On 03/05/2010 10:06 AM, Thomas Mortagne wrote:
>> On Fri, Mar 5, 2010 at 04:58, Sergiu Dumitriu  wrote:
>>> On 03/02/2010 08:20 PM, Thomas Mortagne wrote:
 On Tue, Mar 2, 2010 at 18:25, Sergiu Dumitriu    wrote:
> On 03/02/2010 05:01 PM, Joel Forsberg wrote:
>>
>> Greetings
>>
>> On my wiki using swedish characters for xwiki page titles give ugly but
>> working entries in all panels, e.g. "Backlinks" "Recent modifications" 
>> and "My
>> recent modifications"
>>
>> An example is having:
>>     "Startsidor för våra intresseområden"
>> ...instead of the correct:
>>     "Startsidor för våra intresseområden"
>>
>> Another example is putting thiss wiki code on top of a page:
>>     = header that      here =
>>
>> The script responsible for for the texts in the panels is as follow:
>>
>> 
>> 
>>     $xwiki.getXMLEncoded($rdoc.displayTitle)
>> 
>>
>> I've noticed that changing the third line into only $rdoc.displayTitle 
>> will
>> produce a nice looking entry, and $rdoc is set via
>>
>> #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())
>>
>> Now, can anyone see a purpose of using getXMLEncoded() for this? As far 
>> as I
>> have seen, it only breaks things.
>
> This is not caused by getXMLEncoded, it merely makes the problem
> visible. This method must be used in order to prevent other problems:
> Invalid XML, broken layout, XSS...
>
> The problem is that the code inside getDisplayTitle wrongly uses a XML
> escaping option.

 No, this is valid because the job of $rdoc.displayTitle is to produce
 xhtml content and theses are valid XML escapes.
>>>
>>> Where does it say that it should produce xhtml content?
>>
>>      public String getDisplayTitle(XWikiContext context)
>>      {
>>          return getRenderedTitle(Syntax.XHTML_1_0, context);
>>      }
>
> I know that this is what it does, but why? The semantics of this method
> changed over time. The method used (with 1.0 syntax) to return whatever
> was in the title, interpreted but not rendered. So, if it did contain
> html markup in it, then that was it. But the wiki markup wasn't rendered
> into HTML. And it still behaves this way for the value placed in the
> title field.

You forget part of what i said: "(in xwiki/2.0 syntax)". There is not
such thing as "interpreted but not rendered" with xwiki/2.0 syntax.

>
> So, I don't agree with the behavior change and the inconsistency it creates.
>
>>>
>>> Assuming that it should produce xhtml, the behavior is inconsistent. If
>>> the title is placed in the document.title field, then it returns
>>> characters; if it is placed in the first heading, it returns escapes. If
>>> we use wiki syntax in the document.title, we get back wiki syntax; if we
>>> use wiki syntax in the first heading, we get back HTML. That is totally
>>> inconsistent and confusing.
>>>
>>> This is an API design problem that should be discussed further on the
>>> dev list.
>>>
>>>
>>>
>>> Going back to this specific problem, I think that it should be solved by
>>> using the plaintext output syntax, since inside a panel we're not
>>> interested in formatting or other markup inside the title, just the
>>> textual content.
>>>
 So you don't need to
 use getXMLEncoded because any xml content is already properly escaped
 (in xwiki/2.0 syntax).
>>>
>>> I need to use getXMLEncoded because the title doesn't always come from
>>> the content.
>>>
 When you want a plain text version of the title you should use
 $rdoc.getRenderedTitle("plain/1.0").
>
>
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>



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


[xwiki-users] Installations-problems on Debian, MySQL & Tomcat (Deployment as single war)

2010-03-05 Thread 2smart4u
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:   r...@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:

   jdbc:mysql://localhost/xwiki?useServerPrepStmts=false&useUnicode=true&characterEncoding=UTF-8&sessionVariables=sql_mode=''
   someUser
   somePassword
   com.mysql.jdbc.Driver
   org.hibernate.dialect.MySQLDialect
   com.xpn.xwiki.store.DBCPConnectionProvider
   2
   2
   
   
   

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


[xwiki-users] Lucene Searching with "object:" keyword does not show expected results

2010-03-05 Thread Jeremie BOUSQUET
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
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Lucene Searching with "object:" keyword does not show expected results

2010-03-05 Thread Guillaume Lerouge
Hi,

On Fri, Mar 5, 2010 at 12:28 PM, Jeremie BOUSQUET <
jeremie.bousq...@gmail.com> wrote:

> 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 ?
>

Are you sure your Lucene index is up to date?

Guillaume

Best regards,
> Jeremie
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>



-- 
Guillaume Lerouge
Product Manager - XWiki SAS
Skype: wikibc
Twitter: glerouge
http://guillaumelerouge.com/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] LDAP users with dot in username

2010-03-05 Thread Dilipkumar Jadhav
Thanks Guillaume...
Both your reply and Thomas's response takes good care of my question :)

On Fri, Mar 5, 2010 at 2:08 AM, Dilipkumar Jadhav <
jadhav.dilipku...@gmail.com> wrote:

> Thanks for your prompt response Thomas...now I am relieved.
> All I need to do is figure out how to configure LDAP with XWiki.
> By the way, in case I have a user let's say - Jane Doe whose username in
> Active Directory is Jane.Doe
> Would I create a user of the same name called JaneDoe in XWiki or would I
> create user called Jane.Doe?
> Or am I misreading something here and don't need to create users at all in
> XWiki...
>

You don't need to create them. Once LDAP is configured correctly in XWiki,
users will be created automatically in the wiki the first time they connect
to the wiki with their LDAP credentials.

Guillaume


> On Thu, Mar 4, 2010 at 17:46, Dilipkumar Jadhav
>  wrote:
> > Hello folks,
> > Returning to the xwiki mailing list after a long time with a question
> > about LDAP authentication.
> > Our active directory has usernames with a dot (.) character. Would it
> > be possible to sync our XWiki with the active directory under this
> > scenario. If I am not mistaken, we would need to create equivalent
> > users in the XWiki for each user in the active directory.
> > And, XWiki does not accept a dot in the username field.
> > Any insight will be greatly appreciated. Thank you guys.
>
> XWiki does not accept a dot in the page but LDAP authenticator has a
> special handling of username with . so you will not have issue.
>
> In short don't worry about . in ldap user name it's working ;)
>
> > ___
> > users mailing list
> > users@xwiki.org
> > http://lists.xwiki.org/mailman/listinfo/users
> >
>
>
>
> --
> Thomas Mortagne
>
>
>
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>



-- 
Guillaume Lerouge
Product Manager - XWiki SAS
Skype: wikibc
Twitter: glerouge
http://guillaumelerouge.com/



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


[xwiki-users] [myxwiki] XWiki Enterprise 2.3-SNAPSHOT (3/3/2010) Upgrade

2010-03-05 Thread Vincent Massol
Hello,

myxwiki.org has been upgraded to  XWiki Enterprise 2.3-SNAPSHOT (3/3/2010). 
We've done this to test the stability of the upcoming XE 2.3 release.

If you own a wiki hosted there you'll notice that the AllDocs page shows an 
empty list in your wiki. To fix this you need to upgrade your XAR. Go to your 
administration page on your wiki and follow the instructions in the banner 
there.

To be notified of the myxwiki.org server upgrade you can follow myxwiki on 
twitter:
http://twitter.com/myxwiki

Thanks,
-Vincent on behalf of the XWiki community
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] E-Mail Notification by Scheduler Job Script ?

2010-03-05 Thread Thilo

Ok.

Now the Scheduler and E-Mail are working fine. 
The right way of use ist:

xwiki.mailsender.sendMessage(...)

My last Problem ist how to setup more than one Recepient in the Parameters. 

I've tryed the following way but without success.

xwiki.mailsender.sendMessage("Sender","re...@web.de,rec...@web.de","Subject","Text")

Thanks for your Help!
-- 
View this message in context: 
http://n2.nabble.com/E-Mail-Notification-by-Scheduler-Job-Script-tp4676911p4680414.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


Re: [xwiki-users] E-Mail Notification by Scheduler Job Script ?

2010-03-05 Thread Thilo

Got everything running.

Notation was right but i made something wrong in the cron expression. 

Thanks for your help!
Bye
-- 
View this message in context: 
http://n2.nabble.com/E-Mail-Notification-by-Scheduler-Job-Script-tp4676911p4680528.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


Re: [xwiki-users] [ANN] XWiki Enterprise and XWiki Enterprise Manager 2.2.2 Released

2010-03-05 Thread Thomas Mortagne
The XWiki development team is pleased to announce the release of XWiki
Enterprise and XWiki Enterprise Manager 2.2.2.

This is a bug fix release for the 2.2 branches.

It fixes mainly two important regressions around documents object
handling and office importer on Internet Explorer 7 so if you are
using 2.2 or 2.2.1 you should really upgrade to 2.2.2.

Improvements:

* XAADMINISTRATION-115 - Left align check boxes in "Registration >
Customize XWiki Registration"
* XAADMINISTRATION-63 - In "Administration" -> "Users" closing the
"Add new user" pop-up causes the page to refresh
* XAADMINISTRATION-67 - In "Administration > User > Add new user"
indicate which fields are mandatory
* XAADMINISTRATION-103 - Make registration page support lightbox so
administrator can use it to add users in admin users sheet.
* Updated translations

Important Bugs fixed:

* XWIKI-4955 - Page with empty content leads to "This template does
not exist" message when viewed in plain mode
* XWIKI-4967 - Impossible to import office (copy/paste) with style using IE7
* XWIKI-4965 - Objects can no longer be retrieved relative to their document
* XWIKI-4931 - Links are badly saved on IE7
* XWIKI-4977 - AJAX behavior broken in IE6 for documents with
non-ASCII characters in the name
* XWIKI-4974 - Adding tags with non-ASCII characters fails in Internet Explorer
* XWIKI-4968 - Deleting a comment appears in the history as being
deleted by the person who made the comment instead of the deleter
* XWIKI-4971 - Header generated ids are wrong in 1.0 syntax
* XWIKI-4966 - Missing translation keys for application configuration.
* XWIKI-4590 - View Statistics increment too fast because of AJAX
features in bottom page tags and ratings
* XWIKI-4925 - When XWiki is initialized via a XMLRPC request, it is
in a wrong state and redirect-to-login URLs will be wrong
* XWIKI-3915 - XWiki.copyWiki does not copy hidden documents
* XWIKI-4954 - XWikiDocument#clone should use set/getParent instead of
set/getParentReference
* XWIKI-4555 - XWikiHibernateStore#countDocuments does not always
return the same number as would be the size of #searchDocuments for
the same query
* XWIKI-4969 - Missing translation value for key
"import_listoferrorsfiles" in new Import UI
* XWIKI-4978 - Previewing a comment for a document with non-ASCII
characters in the name uses a wrong URL
* XAADMINISTRATION-68 - In "Administration > User > Add new user"
notify the user when the passwords he types in don't match
* XAADMINISTRATION-21 - User not created when registration information
isn't correct when creating new user in new Administration UI

For more information see the Releases notes at:
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWikiEnterprise222
and http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXEM222

Thanks
-The XWiki dev team
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Installations-problems on Debian, MySQL & Tomcat (Deployment as single war)

2010-03-05 Thread Anca Luca
Hi Gregor,

On 03/05/2010 01:17 PM, 2smart4u wrote:
> 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:   r...@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:
>
>  name="connection.url">jdbc:mysql://localhost/xwiki?useServerPrepStmts=false&useUnicode=true&characterEncoding=UTF-8&sessionVariables=sql_mode=''
> someUser
> somePassword
> com.mysql.jdbc.Driver
> org.hibernate.dialect.MySQLDialect
>  name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider
> 2
> 2
> 
> 
> 
>
> - in xwiki.cfg, I left everything at their default values except
>
>xwiki.store.migration=0

Is this bothering you? could you try to leave it to the default and checkout 
how 
it goes?

Since some fields don't seem to be in their right place, let it do its default 
stuff and then see about adjusted things.

Happy hacking,
Anca

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


Re: [xwiki-users] Installations-problems on Debian, MySQL & Tomcat (Deployment as single war)

2010-03-05 Thread Sergiu Dumitriu
On 03/05/2010 12:17 PM, 2smart4u wrote:
> 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:   r...@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)

In mysql each table and each column can have its own charset. Make sure 
that it's not just the global database that was created using utf8, but 
also the columns. A quick test:

select distinct charset(xwd_content) from xwikidoc;

>
> 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:
>
>  name="connection.url">jdbc:mysql://localhost/xwiki?useServerPrepStmts=false&useUnicode=true&characterEncoding=UTF-8&sessionVariables=sql_mode=''
> someUser
> somePassword
> com.mysql.jdbc.Driver
> org.hibernate.dialect.MySQLDialect
>  name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider
> 2
> 2
> 
> 
> 
>
> - in xwiki.cfg, I left everything at their default values except
>
>xwiki.store.migration=0

Did you also download the mysql connector as indicated on 
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationMySQL ?

http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.12/mysql-connector-java-5.1.12.jar

> - 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

This usually happens when version 3.x of the mysql connector is used. 
Installing the 5.x version should solve it, but this is not a very 
serious error (it would just mean that all documents will be hidden).

> 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

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] What is $xwiki.getXMLEncoded()'s purpose in url names?

2010-03-05 Thread Joel Forsberg
On Friday 05 March 2010 04:58:57 Sergiu Dumitriu wrote:
> I need to use getXMLEncoded because the title doesn't always come from 
> the content.

I saw the suggestion to modify the getXMLEncoded route on the JIRA ticket, so 
I decided to do some testing with that. I only know two ways to set the title 
for a document (are there more?) either from the content or the title, and 
here's the results from those. (I have edited the out some hrefs="")

Case 1: Having a document where title field is blank, but having a section as
Document 1: = A damn  ruler =
Document 2: = Att-göra-lista =

Results: 
$rdoc.displayTitle  
1 A damn 
ruler 2 Att göra-lista $xwiki.getXMLEncoded($rdoc.getRenderedTitle('plain/1.0') 1 A damn
ruler 2 Att göra-lista Visually: all the results appears okay and the same in Firefox. (I wonder if IE versions can handle the XML output?) The xml route outputs UTF-8 characters, whereas displayTitle escapes them correctly even if the browser selects wrong character encoding. However, the rest of the wiki use utf-8 consistently so that later case is not likely an issue. Case 2: Putting the same in proper title field. Results: $rdoc.displayTitle 1 = A damn ruler = 2 = Att göra-lista = $xwiki.getXMLEncoded($rdoc.getRenderedTitle('plain/1.0') 1 = A damnruler = 2 = Att göra-lista = Visually: As you see, the characters are not escaped at all when using the title, no matter what method is being used. Guessing would make me say the title field is buggy. The xml route even puts in a few extra tags for some reason. I think the proper title field needs to be fixed in some way to escape special characters before this can be fixed. It might also be good to have an example where getXMLEncoded() does any good for panel links at the moment, for testing purposes? -Regards, Joel ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users

Re: [xwiki-users] Installations-problems on Debian, MySQL & Tomcat (Deployment as single war)

2010-03-05 Thread 2smart4u
@Sergiu,

thanks for your comments!

> select distinct charset(xwd_content) from xwikidoc;

gives

+--+
| charset(xwd_content) |
+--+
| utf8 |
+--+


Besides, I just can't setup the complete MySQL instance as UTF-8 since
there are other databases online which I don't want to fiddle with.

>
> http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.12/mysql-connector-java-5.1.12.jar
>

nope, haven't done that, but will do within the next few minutes and
keep you posted

@Anca

>>xwiki.store.migration=0
>
> Is this bothering you? could you try to leave it to the default and checkout 
> how
> it goes?

Will do that, you should see the result of your suggestions within 30
minutes on this list ;)

Cheers & thanks again

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] What is $xwiki.getXMLEncoded()'s purpose in url names?

2010-03-05 Thread Sergiu Dumitriu
On 03/05/2010 02:10 PM, Joel Forsberg wrote:
> On Friday 05 March 2010 04:58:57 Sergiu Dumitriu wrote:
>> I need to use getXMLEncoded because the title doesn't always come from
>> the content.
>
> I saw the suggestion to modify the getXMLEncoded route on the JIRA ticket, so
> I decided to do some testing with that. I only know two ways to set the title
> for a document (are there more?) either from the content or the title, and

No, these are the only ones. Actually, as a fallback, if there is not 
title in any of these places, then the document name is used.

> here's the results from those. (I have edited the out some hrefs="")
>
> Case 1: Having a document where title field is blank, but having a section as
> Document 1: = A damn  ruler =
> Document 2: = Att-göra-lista =
>
> Results:
> $rdoc.displayTitle
> 1A damn
ruler > 2Att göra-lista > > > $xwiki.getXMLEncoded($rdoc.getRenderedTitle('plain/1.0') > 1A damn
ruler > 2Att göra-lista > > Visually: all the results appears okay and the same in Firefox. (I wonder if > IE versions can handle the XML output?) The xml route outputs UTF-8 > characters, whereas displayTitle escapes them correctly even if the browser > selects wrong character encoding. However, the rest of the wiki use utf-8 > consistently so that later case is not likely an issue. > > > Case 2: Putting the same in proper title field. > > Results: > $rdoc.displayTitle > 1= A damn ruler = > 2= Att göra-lista = > > $xwiki.getXMLEncoded($rdoc.getRenderedTitle('plain/1.0') > 1= A damnruler = This is caused not by the display code, but by the fact that the result is used inside a panel written with the 1.0 syntax, which doesn't know that the result is already processed. You can check that by actually using this in the panel: {pre}$xwiki.getXMLEncoded($rdoc.getRenderedTitle('plain/1.0')){/pre} {pre}{/pre} prevents re-rendering the content. The result with this is: A damn ruler Which again is a bit wrong, but this is a bug in the core, it always assumes that the content that it got from the title field is velocity+HTML, even if the page is in xwiki/2.0 syntax. > 2= Att göra-lista = > > Visually: As you see, the characters are not escaped at all when using the > title, no matter what method is being used. Guessing would make me say the > title field is buggy. The xml route even puts in a few extra tags for some > reason. > > > I think the proper title field needs to be fixed in some way to escape special > characters before this can be fixed. It might also be good to have an example > where getXMLEncoded() does any good for panel links at the moment, for testing > purposes? Try to put one of these in the title field: When to use => badly broken display CrossSiteScripting example: alert('I pwnd U') => bad, bad, bad -- Sergiu Dumitriu http://purl.org/net/sergiu/ ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users

Re: [xwiki-users] Installations-problems on Debian, MySQL & Tomcat (Deployment as single war)

2010-03-05 Thread 2smart4u
guys,

i don't know which hint it was, but i guess it was the change of the
mysql-driver - it seems to be working now, thanks a lot for that!

but i'm pretty sure i'll have some more questions in the future, still.

maybe just one qwuick one (haven't read the entire docs yet):

when i want to create users with specific rights - is it really
necessary to have an ldap-server? or can i instead use container-based
security?

tia

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


Re: [xwiki-users] Installations-problems on Debian, MySQL & Tomcat (Deployment as single war)

2010-03-05 Thread Guillaume Lerouge
Hi,

On Fri, Mar 5, 2010 at 3:34 PM, 2smart4u  wrote:

> guys,
>
> i don't know which hint it was, but i guess it was the change of the
> mysql-driver - it seems to be working now, thanks a lot for that!
>
> but i'm pretty sure i'll have some more questions in the future, still.
>
> maybe just one qwuick one (haven't read the entire docs yet):
>
> when i want to create users with specific rights - is it really
> necessary to have an ldap-server? or can i instead use container-based
> security?
>

You can create users and configure rights in XWiki itself. No need for LDAP.

Guillaume


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



-- 
Guillaume Lerouge
Product Manager - XWiki SAS
Skype: wikibc
Twitter: glerouge
http://guillaumelerouge.com/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Searching workaround for HTML in title-field

2010-03-05 Thread Joel Forsberg
On Friday 05 March 2010 15:06:34 Sergiu Dumitriu wrote:

> {pre}{/pre} prevents re-rendering the content.
> 
> The result with this is:
> 
> A damn
> 
> ruler
> 
> Which again is a bit wrong, but this is a bug in the core, it always
> assumes that the content that it got from the title field is
> velocity+HTML, even if the page is in xwiki/2.0 syntax.

Do you happen to know the JIRA ticket for this bug? (if there is one?)

The {pre} seems to dodge some of the unwanted effects, but in turn makes 
further editing the script difficult. Next time I edit the {pre} seems to have 
disappeared, instead leaving a -tag artifact depending on circumstances.

> CrossSiteScripting example: alert('I pwnd U')
> => bad, bad, bad
That is exatly what I would like to avoid, hehe. :)

Kind regards, Joel






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


[xwiki-users] Questions about XWiki

2010-03-05 Thread Simon Brandhof
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).
   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
---
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Installations-problems on Debian, MySQL & Tomcat (Deployment as single war)

2010-03-05 Thread Vincent Massol
Hi Gregor,

Cool, glad that it worked.

Could you tell me what version didn't work and what version worked for
you so that we can update
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationMySQL
(you could update it too btw, it's a wiki ;)).

Thanks
-Vincent

On Fri, Mar 5, 2010 at 3:34 PM, 2smart4u  wrote:
> guys,
>
> i don't know which hint it was, but i guess it was the change of the
> mysql-driver - it seems to be working now, thanks a lot for that!
>
> but i'm pretty sure i'll have some more questions in the future, still.
>
> maybe just one qwuick one (haven't read the entire docs yet):
>
> when i want to create users with specific rights - is it really
> necessary to have an ldap-server? or can i instead use container-based
> security?
>
> tia
>
> gregor
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Questions about XWiki: translations for macros

2010-03-05 Thread Valdis Vītoliņš
>- objects can not be translated (see
> 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 ?
The approach should be similar to used in Livetable macro. See
http://code.xwiki.org/xwiki/bin/view/Macros/LiveTableMacro

Then in some xwiki page e.g. /xwiki/bin/view/Custom/MacroTranslations
create content:
...
field=Translation
...
hopefully it will work if you will translate page in necessary languages

open 
/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin§ion=Programming 
and in the field Internationalization Document Bundles set: 
Custom.MacroTranslations


N.B. to Xwikiers

Actually such approach should be supported and documented for
internationalization of new/staged/custom/contributed macros.

Valdis

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


Re: [xwiki-users] Installations-problems on Debian, MySQL & Tomcat (Deployment as single war)

2010-03-05 Thread 2smart4u
Hi Vincent,

On Fri, Mar 5, 2010 at 5:07 PM, Vincent Massol  wrote:

> (you could update it too btw, it's a wiki ;)).

Done that, also corrected another small bug (127.0.0.1 / localhost).

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] Installations-problems on Debian, MySQL & Tomcat (Deployment as single war)

2010-03-05 Thread Vincent Massol

On Mar 5, 2010, at 5:51 PM, 2smart4u wrote:

> Hi Vincent,
> 
> On Fri, Mar 5, 2010 at 5:07 PM, Vincent Massol  wrote:
> 
>> (you could update it too btw, it's a wiki ;)).
> 
> Done that, also corrected another small bug (127.0.0.1 / localhost).
> 
> Cheers!

Thanks!
-Vincent

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


Re: [xwiki-users] Lucene Searching with "object:" keyword does not show expected results

2010-03-05 Thread Jeremie BOUSQUET
Strangely it was up-to-date, because I checked with Lucene Index Toolbox
(luke) directly on the index. And the LuceneSearch page was saying that
index was up-to-date.

But after forcing an index update (and waiting a few minutes), now the
lucenesearch page returns correct results !?

I must have missed something about how it works ...

Jeremie


2010/3/5 Guillaume Lerouge 

> Hi,
>
> On Fri, Mar 5, 2010 at 12:28 PM, Jeremie BOUSQUET <
> jeremie.bousq...@gmail.com> wrote:
>
> > 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 ?
> >
>
> Are you sure your Lucene index is up to date?
>
> Guillaume
>
> Best regards,
> > Jeremie
> > ___
> > users mailing list
> > users@xwiki.org
> > http://lists.xwiki.org/mailman/listinfo/users
> >
>
>
>
> --
> Guillaume Lerouge
> Product Manager - XWiki SAS
> Skype: wikibc
> Twitter: glerouge
> http://guillaumelerouge.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] Lucene Searching with "object:" keyword does not show expected results

2010-03-05 Thread Thomas Mortagne
On Fri, Mar 5, 2010 at 18:21, Jeremie BOUSQUET
 wrote:
> Strangely it was up-to-date, because I checked with Lucene Index Toolbox
> (luke) directly on the index. And the LuceneSearch page was saying that
> index was up-to-date.
>
> But after forcing an index update (and waiting a few minutes), now the
> lucenesearch page returns correct results !?
>
> I must have missed something about how it works ...

The lucene index format changed a little XE 2.1, maybe you did an
upgrade and used had some pre-2.1 documents in the lucene index.

>
> Jeremie
>
>
> 2010/3/5 Guillaume Lerouge 
>
>> Hi,
>>
>> On Fri, Mar 5, 2010 at 12:28 PM, Jeremie BOUSQUET <
>> jeremie.bousq...@gmail.com> wrote:
>>
>> > 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 ?
>> >
>>
>> Are you sure your Lucene index is up to date?
>>
>> Guillaume
>>
>> Best regards,
>> > Jeremie
>> > ___
>> > users mailing list
>> > users@xwiki.org
>> > http://lists.xwiki.org/mailman/listinfo/users
>> >
>>
>>
>>
>> --
>> Guillaume Lerouge
>> Product Manager - XWiki SAS
>> Skype: wikibc
>> Twitter: glerouge
>> http://guillaumelerouge.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
>



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


Re: [xwiki-users] Searching workaround for HTML in title-field

2010-03-05 Thread Sergiu Dumitriu
On 03/05/2010 04:30 PM, Joel Forsberg wrote:
> On Friday 05 March 2010 15:06:34 Sergiu Dumitriu wrote:
> 
>> {pre}{/pre} prevents re-rendering the content.
>>
>> The result with this is:
>>
>> A damn
>> 
>> ruler
>>
>> Which again is a bit wrong, but this is a bug in the core, it always
>> assumes that the content that it got from the title field is
>> velocity+HTML, even if the page is in xwiki/2.0 syntax.
>
> Do you happen to know the JIRA ticket for this bug? (if there is one?)

There isn't one AFAIK.

> The {pre} seems to dodge some of the unwanted effects, but in turn makes
> further editing the script difficult. Next time I edit the {pre} seems to have
> disappeared, instead leaving a-tag artifact depending on circumstances.

Yes, that's another bug in the 1.0 renderer, one which can't be easily 
avoided: the panel display itself is in a 1.0 document, which sees the 
{pre} and "uses" it. As a workaround, you can edit the panel using the 
object editor.

>> CrossSiteScripting example:alert('I pwnd U')
>> =>  bad, bad, bad
> That is exatly what I would like to avoid, hehe. :)
>
> Kind regards, Joel


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Problems logigging in

2010-03-05 Thread 2smart4u
Sorry, me again...

I wanted to login with with the default credeitials (Admin/admin),
however, XWiki tells me "Invalid credentials".

I've just imported the default pages, configuration is vanilla
out-of-the-box - any clues anyone?

TIA

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-05 Thread 2smart4u
hm, maybe this information might be helpful to identify the problem:

I'm getting the following exceptions when trying to login:

2010-03-05 19:35:25,511 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]:
active: 0 (max: 50)   idle: 2(max: 5)
2010-03-05 19:35:25,560 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]:
active: 1 (max: 50)   idle: 1(max: 5)
2010-03-05 19:35:25,561 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]:
active: 0 (max: 50)   idle: 2(max: 5)
2010-03-05 19:35:31,473 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]:
active: 1 (max: 50)   idle: 1(max: 5)
2010-03-05 19:35:31,475 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]:
active: 0 (max: 50)   idle: 2(max: 5)
2010-03-05 19:35:31,475 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]:
active: 1 (max: 50)   idle: 1(max: 5)
2010-03-05 19:35:31,477 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]:
active: 0 (max: 50)   idle: 2(max: 5)
2010-03-05 19:35:31,477 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]: User
Admin login has failed
2010-03-05 19:35:31,499 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]:
active: 1 (max: 50)   idle: 1(max: 5)
2010-03-05 19:35:31,500 INFO
[http://dekolxrd01/xwiki/bin/loginsubmit/XWiki/XWikiLogin]: Error
performing load command
org.hibernate.ObjectNotFoundException: No row with the given
identifier exists: [com.xpn.xwiki.doc.XWikiDocument#-283750366]
at 
org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:377)
at 
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:145)
at 
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
at 
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:784)
at 
com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:675)
at 
com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:289)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1390)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1444)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1462)
at 
com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl.isSuperUser(XWikiRightServiceImpl.java:886)
at 
com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl.hasAccessLevel(XWikiRightServiceImpl.java:629)
at 
com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl.hasAccessLevel(XWikiRightServiceImpl.java:311)
at com.xpn.xwiki.api.Api.hasAccessLevel(Api.java:102)
at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at 
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at 
org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:493)
at 
org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
at 
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
at 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at 
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:191)
at 
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:156)
at 
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:116)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1751)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:740)
at sun.reflect.GeneratedMethodAccessor192.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at 
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at 
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at 
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.j

Re: [xwiki-users] Questions about XWiki

2010-03-05 Thread Jeremie BOUSQUET
Hi,



2010/3/5 Simon Brandhof 

> 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.
>

You can do this by browsing to page Main.LuceneSearch, and using the
following search terms for example to search for any occurrence of tag
TESTTAG (without the quotes):
"TESTTAG AND object:XWiki.TagClass"
It is relatively easy to code a new list-box in this page where you can
specify that you want to search for Tags (or any other predefined object),
and then add the correct search clause, based on what is done for Spaces.
Of course if what you need is a tagCloud related to found results, then it's
... far more difficult I belive ;)


>   - objects can not be translated (see
> 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
> ---
> ___
> 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] Lucene Searching with "object:" keyword does not show expected results

2010-03-05 Thread Jeremie BOUSQUET
That's most probably what happened, because it was few days after a
migration from 2.0.3 to 2.2.1 ... ;-)

Thanks,
Jeremie

2010/3/5 Thomas Mortagne 

> On Fri, Mar 5, 2010 at 18:21, Jeremie BOUSQUET
>  wrote:
> > Strangely it was up-to-date, because I checked with Lucene Index Toolbox
> > (luke) directly on the index. And the LuceneSearch page was saying that
> > index was up-to-date.
> >
> > But after forcing an index update (and waiting a few minutes), now the
> > lucenesearch page returns correct results !?
> >
> > I must have missed something about how it works ...
>
> The lucene index format changed a little XE 2.1, maybe you did an
> upgrade and used had some pre-2.1 documents in the lucene index.
>
> >
> > Jeremie
> >
> >
> > 2010/3/5 Guillaume Lerouge 
> >
> >> Hi,
> >>
> >> On Fri, Mar 5, 2010 at 12:28 PM, Jeremie BOUSQUET <
> >> jeremie.bousq...@gmail.com> wrote:
> >>
> >> > 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 ?
> >> >
> >>
> >> Are you sure your Lucene index is up to date?
> >>
> >> Guillaume
> >>
> >> Best regards,
> >> > Jeremie
> >> > ___
> >> > users mailing list
> >> > users@xwiki.org
> >> > http://lists.xwiki.org/mailman/listinfo/users
> >> >
> >>
> >>
> >>
> >> --
> >> Guillaume Lerouge
> >> Product Manager - XWiki SAS
> >> Skype: wikibc
> >> Twitter: glerouge
> >> http://guillaumelerouge.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
> >
>
>
>
> --
> Thomas Mortagne
> ___
> 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


[xwiki-users] row was deleted by another transaction

2010-03-05 Thread Paul Libbrecht
Hello XWiki experts,

with our XWiki 1.5 I encounter the following complaint at trying to  
save the document of a user, even after a restart of the servlet  
container:

> org.hibernate.StaleObjectStateException: Row was updated or deleted  
> by another transaction (or unsaved-value mapping was incorrect):  
> [com.xpn.xwiki.objects.StringProperty# encoding="UTF-8"?>
> 
> ]
> at  
> org 
> .hibernate 
> .persister 
> .entity.AbstractEntityPersister.check(AbstractEntityPersister.java: 
> 1765)

I am puzzled and have no idea where to go except into SQL, which is  
not really a safe thing.
thanks for hints.
paul
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] row was deleted by another transaction

2010-03-05 Thread Sergiu Dumitriu
On 03/05/2010 11:50 PM, Paul Libbrecht wrote:
> Hello XWiki experts,
>
> with our XWiki 1.5 I encounter the following complaint at trying to
> save the document of a user, even after a restart of the servlet
> container:
>
>> org.hibernate.StaleObjectStateException: Row was updated or deleted
>> by another transaction (or unsaved-value mapping was incorrect):
>> [com.xpn.xwiki.objects.StringProperty#> encoding="UTF-8"?>
>> 
>> ]
>>  at
>> org
>> .hibernate
>> .persister
>> .entity.AbstractEntityPersister.check(AbstractEntityPersister.java:
>> 1765)
>
> I am puzzled and have no idea where to go except into SQL, which is
> not really a safe thing.

But I'm afraid it's the only real solution...

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Is there a way to dynamically change the values on a static list or on any other property of a xwiki class?

2010-03-05 Thread Abel Solórzano Astorga
Thanks again Caleb,

I try your suggestion, but I keep getting a null value from *
valdoc.getDocument().**getxWikiClass().get("Project")*.

The fields Map (
*valdoc.getDocument().**getxWikiClass().fields.keySet(**)*) is empty.

I put the following line on the code:

*println valdoc.getDocument().getxWikiClass().toString()*

and the result is

*
ValidationSample.TestClass_6







*

I was expecting to see the properties on the XML.

Abel

On Fri, Mar 5, 2010 at 1:45 AM, Caleb James DeLisle <
calebdeli...@lavabit.com> wrote:

>
>
> Abel Solórzano Astorga wrote:
> > Thanks Caleb,
> >
> > I follow your recommendation, but I am getting a BaseClass with no
> > properties.
> > The class I am creating it is supposed to have 4 properties.
> >
> > I am using the folling code to use the class:
> >
> > *...*
> >
> > *docname = xwiki.getUniquePageName("ValidationSample", "TestClass")
> > valdoc = xwiki.getDocument("ValidationSample." + docname)
> > ok = valdoc.newObject("ValidationSample.TestClass")
> > ok = valdoc.updateObjectFromRequest("ValidationSample.TestClass")*
> > *
> > ...
> >
> > valdoc.use("ValidationSample.TestClass")*
> >
> > ValidationSample.TestClass has 4 properties (2 TextAreas and 2 a Static
> > Lists).
> >
> > Then to get the property that I need to dynamically change:
> >
> > *field = valdoc.getDocument().getxWikiClass().get("Project")*
> >
> > But I get a null value from *
> > valdoc.getDocument().getxWikiClass().get("Project")*. The BaseClass
> returned
> "get" calls getField().getValue() maybe the problem is that BaseCollection
> is used for objects and xclasses and
> get is only useful for objects. Try getField()
>
> > by *valdoc.getDocument().getxWikiClass() *is a
> > *ValidationSample.TestClass *class
> > but the Properties collection is empty.
>
> Because of a bug in groovy you can view private fields so you can look
> directly at the fields in the class with
>
> for(String name : valdoc.getDocument().getxWikiClass().fields.keySet()) {
>println(name);
> }
>
>
> Also if you want to change the prettyName of a class property (for
> example),
> you would have to cast the field to PropertyClass (didn't test this but it
> should work.)
>
> ((PropertyClass)
> valdoc.getDocument().getxWikiClass().getField()).setPrettyName("new name");
>
>
> Caleb
>
> >
> > Regards,
> >
> > Abel
> >
> > On Wed, Mar 3, 2010 at 1:04 AM, Caleb James DeLisle <
> > calebdeli...@lavabit.com> wrote:
> >
> >> I can tell you that it can be done, anything which can be done by
> >> the user can be done with groovy.
> >>
> >> document.getxWikiClass().get("propertyName") returns an object of
> >> type element.
> >>
> >>
> http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/api/Element.html
> >>
> >> I think you need to drop out of the api section into the core (which
> >> requires programming rights but so does groovy)
> >> document.getDocument().getxWikiClass()
> >> gives you an object of type BaseClass which I think is what you are
> >> after.
> >>
> >>
> http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/objects/classes/BaseClass.html
> >>
> >>
> >> Caleb
> >>
> >>
> >> Abel Solórzano Astorga wrote:
> >>> 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
> >>> ___
> >>> 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
>
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Is there a way to dynamically change the values on a static list or on any other property of a xwiki class?

2010-03-05 Thread Caleb James DeLisle
It looks like you have isolated the problem because doing the same thing with a 
class that is known to exist
$xwiki.getDocument('XWiki.XWikiPreferences').getDocument().getxWikiClass().toString()
displays all of the properties in xml format. I also double checked by adding a 
property to Main.WebHome class
and viewing that, it works as expected.

I recommend you double check valdoc, and add
if (valdoc.isNew()) { println("oops I didn't load the document."); }
to your script.

Caleb

Abel Solórzano Astorga wrote:
> Thanks again Caleb,
> 
> I try your suggestion, but I keep getting a null value from *
> valdoc.getDocument().**getxWikiClass().get("Project")*.
> 
> The fields Map (
> *valdoc.getDocument().**getxWikiClass().fields.keySet(**)*) is empty.
> 
> I put the following line on the code:
> 
> *println valdoc.getDocument().getxWikiClass().toString()*
> 
> and the result is
> 
> *
> ValidationSample.TestClass_6
> 
> 
> 
> 
> 
> 
> 
> *
> 
> I was expecting to see the properties on the XML.
> 
> Abel
> 
> On Fri, Mar 5, 2010 at 1:45 AM, Caleb James DeLisle <
> calebdeli...@lavabit.com> wrote:
> 
>>
>> Abel Solórzano Astorga wrote:
>>> Thanks Caleb,
>>>
>>> I follow your recommendation, but I am getting a BaseClass with no
>>> properties.
>>> The class I am creating it is supposed to have 4 properties.
>>>
>>> I am using the folling code to use the class:
>>>
>>> *...*
>>>
>>> *docname = xwiki.getUniquePageName("ValidationSample", "TestClass")
>>> valdoc = xwiki.getDocument("ValidationSample." + docname)
>>> ok = valdoc.newObject("ValidationSample.TestClass")
>>> ok = valdoc.updateObjectFromRequest("ValidationSample.TestClass")*
>>> *
>>> ...
>>>
>>> valdoc.use("ValidationSample.TestClass")*
>>>
>>> ValidationSample.TestClass has 4 properties (2 TextAreas and 2 a Static
>>> Lists).
>>>
>>> Then to get the property that I need to dynamically change:
>>>
>>> *field = valdoc.getDocument().getxWikiClass().get("Project")*
>>>
>>> But I get a null value from *
>>> valdoc.getDocument().getxWikiClass().get("Project")*. The BaseClass
>> returned
>> "get" calls getField().getValue() maybe the problem is that BaseCollection
>> is used for objects and xclasses and
>> get is only useful for objects. Try getField()
>>
>>> by *valdoc.getDocument().getxWikiClass() *is a
>>> *ValidationSample.TestClass *class
>>> but the Properties collection is empty.
>> Because of a bug in groovy you can view private fields so you can look
>> directly at the fields in the class with
>>
>> for(String name : valdoc.getDocument().getxWikiClass().fields.keySet()) {
>>println(name);
>> }
>>
>>
>> Also if you want to change the prettyName of a class property (for
>> example),
>> you would have to cast the field to PropertyClass (didn't test this but it
>> should work.)
>>
>> ((PropertyClass)
>> valdoc.getDocument().getxWikiClass().getField()).setPrettyName("new name");
>>
>>
>> Caleb
>>
>>> Regards,
>>>
>>> Abel
>>>
>>> On Wed, Mar 3, 2010 at 1:04 AM, Caleb James DeLisle <
>>> calebdeli...@lavabit.com> wrote:
>>>
 I can tell you that it can be done, anything which can be done by
 the user can be done with groovy.

 document.getxWikiClass().get("propertyName") returns an object of
 type element.


>> http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/api/Element.html
 I think you need to drop out of the api section into the core (which
 requires programming rights but so does groovy)
 document.getDocument().getxWikiClass()
 gives you an object of type BaseClass which I think is what you are
 after.


>> http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/objects/classes/BaseClass.html

 Caleb


 Abel Solórzano Astorga wrote:
> 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
> ___
> 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] Is there a way to dynamically change the values on a static list or on any other property of a xwiki class?

2010-03-05 Thread Sergiu Dumitriu
On 03/06/2010 01:06 AM, Abel Solórzano Astorga wrote:
> Thanks again Caleb,
>
> I try your suggestion, but I keep getting a null value from *
> valdoc.getDocument().**getxWikiClass().get("Project")*.
>
> The fields Map (
> *valdoc.getDocument().**getxWikiClass().fields.keySet(**)*) is empty.
>
> I put the following line on the code:
>
> *println valdoc.getDocument().getxWikiClass().toString()*
>
> and the result is
>
> *
> ValidationSample.TestClass_6
> 
> 
> 
> 
> 
> 
> 
> *
>
> I was expecting to see the properties on the XML.
>
> Abel

Is valdoc the document containing the class? It doesn't look like it 
from the name.

So, you must do something like:

> {{velocity}}
> #set($classDoc = $xwiki.getDocument('Your.Class'))
> #set($propertyDefinition = $classDoc.getxWikiClass().get('project'))
> ## $propertyDefinition.class should now print com.xpn.xwiki.api.PropertyClass
> ## Unfortunately, at this point you need programming rights to go into the 
> inner, protected property definition
> #set($propertyDefinition = $propertyDefinition.getPropertyClass())
> ## $propertyDefinition.class should now print 
> com.xpn.xwiki.objects.classes.StaticListClass
> ## If it doesn't, then you don't have programming rights.
> $propertyDefinition.setValues('a|b|c')
> ## Don't forget to save
> $classDoc.save()
> {{/velocity}}

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users