[xwiki-users] Need doc about access object in a page (and use doc)

2015-02-09 Thread Pascal BASTIEN
Hello,
I read/apply this doc with succcess:
http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HAccessobjectsinapage

With this code I can display all objects ATTACHED to THIS page.
***
#set($class = $obj.xWikiClass) ## access the class object representing 
SomeSpace.SomeClass
#foreach($prop in $class.properties) ## go through all properties
...
***
but if I attached some class to another page, how can I list properties?
Another question:
I have a page with 3 same Class, how to list them (like ?editor=class did)?
An example:
MySpaceMyClass contain this Class properties:
- My Field ID (IdField: String)
- My Lib Field (LibField: String)
I create MySpace.MyNiceDoc and add my previous Class 
MySpace/MyNiceDoc?editor=object
and contain:
Objets de type MySpace.MyClass (2)
* MyClass 0
 - My Field ID
 - My Lib Field
*MyClass 1:
 - My Field ID
 - My Lib Field

With it I like to fill a select list from this doc (but from another doc to).
How can I proceed? because on MySpace.MyNiceDoc I can only display one/First 
Lib values with this code:
{{velocity}}
## Retrieve the first object (index [0]) among all objects attached to this 
page and of a certain class 
#set($obj = $doc.getObject('MySpace.MyClass'))
#set($class = $obj.xWikiClass) ## access the class object representing 
SomeSpace.SomeClass
#foreach($prop in $class.properties) ## go through all properties
 * ${prop.prettyName} : $doc.display($prop.getName())
#end
{{/velocity}}
I guess i need a loop but which one?

And the big question (who I think it will interest everyone), how can I use 
documentation
( http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation?xpage=embed and or 
http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/platform/xwiki-platform-oldcore/6.4/xwiki-platform-oldcore-6.4-javadoc.jar/!/index.html
 )
to guess xWikiClass (or my loop) by example?

A doc/example to use documentation will be welcome. :-)

thxs for any help.

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


Re: [xwiki-users] Fw : Re: Fw : Re: Need doc about access object in a page (and use doc)

2015-02-09 Thread Jeremie BOUSQUET
Hi,

2015-02-09 15:37 GMT+01:00 Pascal BASTIEN pbasnews-xw...@yahoo.fr:

 Thxs god! xwiki is a wonderfull world ... when we manage to do what we
 want (or we can understand javadoc) ... hum!


Note that javadoc may not be the better entry point to understand the xwiki
model, but you may find this page interesting ;)
http://platform.xwiki.org/xwiki/bin/view/DevGuide/DataModel




 More seriously, thxs a lot for your help (I pulled my hair during all this
 week-end).
 I wil probably add your nice code on this page:
 http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HAccessobjectsinapage

 ## get the document which has the object (only one here) - this is the
 page where I can see things in the object editor
 #set( $MyDoc = $xwiki.getDocument(MySpace.MyNiceDoc))
 ## get the document wich contains the class definition: this page has
 entries in the class editor
 #set( $class = $xwiki.getClass(MySpace.MyClass))
 #foreach($prop in $class.properties) ## go through all properties
 * ${prop.prettyName} : $MyDoc.display($prop.getName())
 #end

 and

 #set($MyDoc = $xwiki.getDocument(MySpace.MyNiceDoc))
 #set($class = $xwiki.getClass(MySpace.MyClass))
 ## loop over all objects
 #foreach($obj in $MyDoc.getObjects(MySpace.MyClass))
   ## empty line is intentionally to create a new paragraph

   Object number $velocityCount
   #set($discard = $MyDoc.use($obj))
   #foreach($prop in $class.properties) ## go through all properties
 * ${prop.prettyName} : $MyDoc.display($prop.getName())
   #end
 #end

 Pascal B.


 --- En date de : Lun 9.2.15, Clemens Klein-Robbenhaar 
 c.robbenh...@espresto.com a écrit :

  De: Clemens Klein-Robbenhaar c.robbenh...@espresto.com
  Objet: Re: [xwiki-users] Fw : Re: Need doc about access object in a page
 (and use doc)
  À: users@xwiki.org
  Date: Lundi 9 février 2015, 14h53
  On 02/09/2015 02:12 PM,
  Pascal BASTIEN wrote:
   This code
  (probably false) doesn't work.
  
  #set( $Class =
  $xwiki.getClass(MySpace.MyClass))
   #foreach($prop in $class.properties) ## go
  through all properties
*
  ${prop.prettyName} : $doc.display($prop.getName())
   #end
 
  It
  works for me if I do something like:
 
  {{velocity}}
  ## get the
  document which has the object (only one here) - this is the
  page where I can see things in the object editor
  #set( $adminDoc =
  $xwiki.getDocument(XWiki.Admin))
  ## get the document wich contains the class
  definition: this page has entries in the class editor
  #set( $class =
  $xwiki.getClass(XWiki.XWikiUsers))
  #foreach($prop in $class.properties) ## go
  through all properties
   * ${prop.prettyName}
  : $adminDoc.display($prop.getName())
  #end
  {{/velocity}}
 
  This code should work for you 1:1 unless you
  have deleted you Admin user. toapply for your
  ise case you will have to adapt the name of the class and of
  the document containing the objects
 
  Note that there is a difference between:
 
   - the document _defining_ the
  class - for users this is XWiki.XWikiUsers and you can see
  it at
http://localhost:8080/xwiki/bin/view/XWiki/XWikiUsers
 and you can cnage it  in the
  class editor:
http://localhost:8080/xwiki/bin/edit/XWiki/XWikiUsers?editor=class
 but this document is in itself a
  user: the object eduitor is emprty:
 
  http://localhost:8080/xwiki/bin/edit/XWiki/XWikiUsers?editor=object
 (not completely empty, but does
  not contain XWiki.XWikiUsers objects)
 
   - the admin User document is not a
  class:
   http://localhost:8080/xwiki/bin/edit/XWiki/Admin?editor=class
 but has a Users oject
  attached:
   http://localhost:8080/xwiki/bin/edit/XWiki/Admin?editor=object
 
 
  Anyway, if
  you have more than one object on a page, you will have to
  loop over them and use $doc.use.
 
  the following works for me
  (even though it is useless in this case, as is loops over
  all users on a page, while there should be only one ...)
 
  {{velocity}}
  #set($adminDoc =
  $xwiki.getDocument(XWiki.Admin))
  #set($class =
  $xwiki.getClass(XWiki.XWikiUsers))
  ## loop over all objects
  #foreach($obj in
  $adminDoc.getObjects(XWiki.XWikiUsers))
## empty line is intentionally to create a
  new paragraph
 
Object
  number $velocityCount
#set($discard =
  $adminDoc.use($obj))
#foreach($prop in
  $class.properties) ## go through all properties
  * ${prop.prettyName} :
  $adminDoc.display($prop.getName())
 
  #end
  #end
 
  {{/velocity}}
 
 
  hth,
 
  clemens
  ___
  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


[xwiki-users] Search inside page source

2015-02-09 Thread walid yaich
Hi XWIKI Team,

Please, is there any way to make a search inside page sources.
I need to search for a word inside page sources in the Space Main.

Even by a query on the database.

Thanks in advance.

Best Regards,
Walid YAICH
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Global user and local user with Xwiki 6.4 Sub wiki + LDAP account

2015-02-09 Thread Pascal BASTIEN
Hello,

Is it possible to force all user in Global user?
I (a friend Admin) use LDAP account and 3 subwiki.
If new LDAP user log in on a sub wiki (sub wiki URL), unfortunaly a local user 
is created.

Perhaps he must remove subscribe right for new user on sub wiki?

Thxs for your help (again :) )

Pascal B


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


Re: [xwiki-users] Global user and local user with Xwiki 6.4 Sub wiki + LDAP account

2015-02-09 Thread Thomas Mortagne
See 
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/LDAPAuthenticationUseCases#HI27minamultiwikienvironmentandIwantmyLDAPuserstoregisteronlyonthemainwiki

On Mon, Feb 9, 2015 at 4:31 PM, Pascal BASTIEN pbasnews-xw...@yahoo.fr wrote:
 Hello,

 Is it possible to force all user in Global user?
 I (a friend Admin) use LDAP account and 3 subwiki.
 If new LDAP user log in on a sub wiki (sub wiki URL), unfortunaly a local 
 user is created.

 Perhaps he must remove subscribe right for new user on sub wiki?

 Thxs for your help (again :) )

 Pascal B


 ___
 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] [ANN] XWiki 7.0 Milestone 1 released

2015-02-09 Thread Eduard Moraru
The XWiki development team is proud to announce the availability of XWiki
7.0 Milestone 1.

This is the first milestone release of the 7.x cycle. It features a
Document Index Tree Finder for the Index Application, integration of the
new Tree Widget with the WYSIWYG editor and some usability improvements.
Developers have a new Finder Plugin for the Tree Widget and the old Lucene
search module was finally retired to Contrib.

You can download it here: http://www.xwiki.org/xwiki/bin/view/Main/Download

Make sure to review the release notes:
http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki70M1

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


Re: [xwiki-users] how to get debug messages in log

2015-02-09 Thread Jason Clemons
is there a way to log a message from groovy?



 On Feb 9, 2015, at 12:14 PM, vinc...@massol.net vinc...@massol.net wrote:
 
 Hi Jason,
 
 
 On 9 Feb 2015 at 19:32:28, Jason Clemons 
 (jason.clem...@live.com(mailto:jason.clem...@live.com)) wrote:
 
  
  
  Hello all, which logging configuration do I need to make to see he results 
  of println from Groovy?
 
 No logs, it goes to the page being rendered…
 
 Thanks
 -Vincent
 
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Wrong parameter for password reset

2015-02-09 Thread vinc...@massol.net
Hi,

No idea, but there’s little chance you’ll get help with what you posted since 
you didn’t give much information :)

1) What URL do you have in the reset password mail (the one you click)
2) You didn’t say where you get the error. In XWiki’s UI, in xwiki’s logs? In 
any case you need to paste the maximum info you get (check the xwiki logs for 
more data)
3) Stop removing the threaded context from your mails, this is a bad practice 
and it forces people who want to help you to have to fish for the past messages 
to understand what you’re talking about! That’s also a reason for not getting 
more help…
4) The code related to this feature is located in the XWiki.ResetPassword page 
if you wish to have a look to understand what’s going on.

Thanks
-Vincent

On 9 Feb 2015 at 07:35:49, lorconksu 
(lorcon...@hotmail.com(mailto:lorcon...@hotmail.com)) wrote:

 Hi vincent,
  
 Do you have an idea what is the problem i'm facing? I have moved on to use
 6.4 and I am still getting that error.
  
  
  
 --
 View this message in context: 
 http://xwiki.475771.n2.nabble.com/Wrong-parameter-for-password-reset-tp7593310p7593892.html

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


[xwiki-users] Fw : Re: Fw : Re: Fw : Re: Need doc about access object in a page (and use doc)

2015-02-09 Thread Pascal BASTIEN


--- En date de : Lun 9.2.15, Jeremie BOUSQUET jeremie.bousq...@gmail.com a 
écrit :

 De: Jeremie BOUSQUET jeremie.bousq...@gmail.com
 Objet: Re: [xwiki-users] Fw : Re: Fw : Re: Need doc about access object in a 
 page (and use doc)
 À: Pascal BASTIEN pbasnews-xw...@yahoo.fr, XWiki Users users@xwiki.org
 Date: Lundi 9 février 2015, 16h36
 Hi,
 
 2015-02-09 15:37 GMT+01:00
 Pascal BASTIEN pbasnews-xw...@yahoo.fr:
 Thxs god! xwiki is a
 wonderfull world ... when we manage to do what we want (or
 we can understand javadoc) ... hum!
 
 Note that javadoc may not be the
 better entry point to understand the xwiki model, but you
 may find this page interesting ;)
 http://platform.xwiki.org/xwiki/bin/view/DevGuide/DataModel

Yes thxs you I knew this page :-)
About he doc I use frequently this one 
http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation end 
https://network.xwiki.com/xwiki/bin/view/DocXE542Fr/XWikiDocTable, but examples 
miss me.
I failed often to guess object type/collection, etc. in my loop or methods.

  
 
 

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


Re: [xwiki-users] Global user and local user with Xwiki 6.4 Sub wiki + LDAP account

2015-02-09 Thread Pascal BASTIEN
Thanks you it is exactly what my friend need :-)


En date de : Lun 9.2.15, Thomas Mortagne thomas.morta...@xwiki.com a écrit :

 Objet: Re: [xwiki-users] Global user and local user with Xwiki 6.4 Sub wiki + 
LDAP account
 À: Pascal BASTIEN pbasnews-xw...@yahoo.fr, XWiki Users users@xwiki.org
 Date: Lundi 9 février 2015, 16h52
 
 See 
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/LDAPAuthenticationUseCases#HI27minamultiwikienvironmentandIwantmyLDAPuserstoregisteronlyonthemainwiki
 
 On Mon, Feb 9, 2015 at 4:31 PM, Pascal BASTIEN
 pbasnews-xw...@yahoo.fr
 wrote:
  Hello,
 
  Is it possible to force all user in Global
 user?
  I (a friend Admin) use LDAP
 account and 3 subwiki.
  If new LDAP user
 log in on a sub wiki (sub wiki URL), unfortunaly a local
 user is created.
 
 
 Perhaps he must remove subscribe right for new
 user on sub wiki?
 
 
 Thxs for your help (again :) )
 
  Pascal B
 
 
 
 ___
  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] how to get debug messages in log

2015-02-09 Thread Jason Clemons


Hello all, which logging configuration do I need to make to see he results of 
println from Groovy?
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Wrong parameter for password reset

2015-02-09 Thread lorconksu



Hi Vincent,  Sorry about that, I was not aware that the threaded information 
was not included.  Anyway, as for the lack of information on the error, I was 
not sure what I needed to provide as the error on the page literally just say 
Wrong parameters.  Back to the password reset page .Here is an example 
link of one of the link from the email: 
http://xwiki.yiucloud.net:8080/xwiki/bin/view/XWiki/ResetPasswordComplete?u=lorconksuv=BdyG1vsVpd7qtJeczLWzvfYGCyowdJ
Looking at the ResetPassword code, it looks like the script is looking for a 
u(user) and v(verification String), but also something else?  That's the 
part I'm not sure.
Thanks again for taking a look at this.
William  Date: Mon, 9 Feb 2015 01:39:36 -0700From: 
ml-node+s475771n7593893h43@n2.nabble.comTo: lorconksu@hotmail.comSubject: Re: 
Wrong parameter for password reset

Hi,
No idea, but there’s little chance you’ll get help with what you posted since 
you didn’t give much information :)
1) What URL do you have in the reset password mail (the one you click)
2) You didn’t say where you get the error. In XWiki’s UI, in xwiki’s logs? In 
any case you need to paste the maximum info you get (check the xwiki logs for 
more data)
3) Stop removing the threaded context from your mails, this is a bad practice 
and it forces people who want to help you to have to fish for the past messages 
to understand what you’re talking about! That’s also a reason for not getting 
more help…
4) The code related to this feature is located in the XWiki.ResetPassword page 
if you wish to have a look to understand what’s going on.
Thanks
-Vincent
On 9 Feb 2015 at 07:35:49, lorconksu ([hidden email](mailto:[hidden email])) 
wrote:
 Hi vincent,
  
 Do you have an idea what is the problem i'm facing? I have moved on to use
 6.4 and I am still getting that error.
  
  
  
 --
 View this message in context: 
 http://xwiki.475771.n2.nabble.com/Wrong-parameter-for-password-reset-tp7593310p7593892.html___
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users








If you reply to this email, your message will be added to the 
discussion below:

http://xwiki.475771.n2.nabble.com/Wrong-parameter-for-password-reset-tp7593310p7593893.html



To unsubscribe from Wrong parameter for password reset, click 
here.
NAML

  



--
View this message in context: 
http://xwiki.475771.n2.nabble.com/Wrong-parameter-for-password-reset-tp7593310p7593916.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] how to get debug messages in log

2015-02-09 Thread vinc...@massol.net



On 9 Feb 2015 at 21:15:34, Jason Clemons 
(jason.clem...@live.com(mailto:jason.clem...@live.com)) wrote:

 is there a way to log a message from groovy?

See 
http://extensions.xwiki.org/xwiki/bin/view/Extension/Logging+Module#HScripting

Thanks
-Vincent

 On Feb 9, 2015, at 12:14 PM, vinc...@massol.net(mailto:vinc...@massol.net) 
 wrote:
  
  Hi Jason,  
   
   
  On 9 Feb 2015 at 19:32:28, Jason Clemons 
  (jason.clem...@live.com(mailto:jason.clem...@live.com)(mailto:jason.clem...@live.com))
   wrote:
   
  
  
   Hello all, which logging configuration do I need to make to see he 
   results of println from Groovy?  
   
  No logs, it goes to the page being rendered…  
   
  Thanks  
  -Vincent
   
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Fw : Re: Need doc about access object in a page (and use doc)

2015-02-09 Thread Pascal BASTIEN


--- En date de : Lun 9.2.15, Clemens Klein-Robbenhaar 
c.robbenh...@espresto.com a écrit :

 De: Clemens Klein-Robbenhaar c.robbenh...@espresto.com
 Objet: Re: [xwiki-users] Need doc about access object in a page (and use doc)
 À: users@xwiki.org
 Date: Lundi 9 février 2015, 13h29
 On 02/09/2015 10:15 AM,
 Pascal BASTIEN wrote:
  Hello,
  I read/apply this doc with succcess:
  http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HAccessobjectsinapage
  
  With this code I can
 display all objects ATTACHED to THIS page.
  ***
 
 #set($class = $obj.xWikiClass) ## access the class object
 representing SomeSpace.SomeClass
 
 #foreach($prop in $class.properties) ## go through all
 properties
  ...
 
 ***
  but if I attached some
 class to another page, how can I list properties?
 
 the $xwiki object has a method
 to access the class if you know the name
 
  #set( $someClass =
 $xwiki.getClass(SomeSpace.SomeClass))
 
 http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/XWiki.html#getClass%28java.lang.String%29

This code (probably false) doesn't work.
#set( $Class = $xwiki.getClass(MySpace.MyClass))
#foreach($prop in $class.properties) ## go through all properties
 * ${prop.prettyName} : $doc.display($prop.getName())
#end

 
  Another question:
  I have a page with 3 same Class, how to
 list them (like ?editor=class did)?
 
  you can get a list of of objects of a certain
 class via
 $doc.getObjects(SomeSpace.SomeClass)
 
  
 http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/Document.html#getObjects%28java.lang.String%29

$doc.getObjects(SomeSpace.SomeClass)

I failed to :-(

The thing I don't understand is, my values are stored in a doc with attached 
class. I need theses value from another doc but all method have Class name 
parameter ... Class name contain only field (properties) name?


(Hope I will understand how find answer in javadoc to avoid disturbed nice 
people of user list)

Thxs


 
  An example:
 
 MySpaceMyClass contain this Class properties:
  - My Field ID (IdField: String)
  - My Lib Field (LibField: String)
  I create MySpace.MyNiceDoc and add my
 previous Class MySpace/MyNiceDoc?editor=object
  and contain:
  Objets
 de type MySpace.MyClass (2)
  * MyClass
 0
   - My Field ID
   - My Lib Field
 
 *MyClass 1:
   - My Field ID
   - My Lib Field
  
  With it I like to fill a select list from
 this doc (but from another doc to).
  How
 can I proceed? because on MySpace.MyNiceDoc I can only
 display one/First Lib values with this code:
  {{velocity}}
  ##
 Retrieve the first object (index [0]) among all objects
 attached to this page and of a certain class 
  #set($obj =
 $doc.getObject('MySpace.MyClass'))
  #set($class = $obj.xWikiClass) ## access
 the class object representing SomeSpace.SomeClass
  #foreach($prop in $class.properties) ## go
 through all properties
   *
 ${prop.prettyName} : $doc.display($prop.getName())
  #end
  {{/velocity}}
  I guess i need a loop but which one?
  
  And the big question
 (who I think it will interest everyone), how can I use
 documentation
  ( http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation?xpage=embed
 and or 
 http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/platform/xwiki-platform-oldcore/6.4/xwiki-platform-oldcore-6.4-javadoc.jar/!/index.html
 )
  to guess xWikiClass (or my loop)
 by example?
  
  A
 doc/example to use documentation will be welcome. :-)
  
  thxs for any
 help.
  
  Pascal
 B
 
 ___
  users mailing list
  users@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/users
  
 
 
 
 mit freundlichen Grüßen
 Clemens Klein-Robbenhaar
 
 -- 
 Clemens Klein-Robbenhaar
 Software Development
 EsPresto
 AG
 Breite Str. 30-31
 10178
 Berlin/Germany
 Tel: +49.(0)30.90 226.763
 Fax: +49.(0)30.90 226.760
 robbenh...@espresto.com
 
 HRB 77554 B -
 Berlin-Charlottenburg
 Vorstand: Maya
 Biersack, Peter Biersack
 Vorsitzender des
 Aufsichtsrats: Dipl.-Wirtsch.-Ing. Winfried Weber
 Zertifiziert nach ISO 9001:2008
 ___
 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] Fw : Re: Need doc about access object in a page (and use doc)

2015-02-09 Thread Clemens Klein-Robbenhaar
On 02/09/2015 02:12 PM, Pascal BASTIEN wrote:
 This code (probably false) doesn't work.
 #set( $Class = $xwiki.getClass(MySpace.MyClass))
 #foreach($prop in $class.properties) ## go through all properties
  * ${prop.prettyName} : $doc.display($prop.getName())
 #end

It works for me if I do something like:

{{velocity}}
## get the document which has the object (only one here) - this is the page 
where I can see things in the object editor
#set( $adminDoc = $xwiki.getDocument(XWiki.Admin))
## get the document wich contains the class definition: this page has entries 
in the class editor
#set( $class = $xwiki.getClass(XWiki.XWikiUsers))
#foreach($prop in $class.properties) ## go through all properties
 * ${prop.prettyName} : $adminDoc.display($prop.getName())
#end
{{/velocity}}

This code should work for you 1:1 unless you have deleted you Admin user. 
toapply for your ise case you will have to adapt the name of the class and of 
the document containing the objects

Note that there is a difference between:

 - the document _defining_ the class - for users this is XWiki.XWikiUsers and 
you can see it at
  http://localhost:8080/xwiki/bin/view/XWiki/XWikiUsers
   and you can cnage it  in the class editor:
  http://localhost:8080/xwiki/bin/edit/XWiki/XWikiUsers?editor=class
   but this document is in itself a user: the object eduitor is emprty:
  http://localhost:8080/xwiki/bin/edit/XWiki/XWikiUsers?editor=object
   (not completely empty, but does not contain XWiki.XWikiUsers objects)

 - the admin User document is not a class:
 http://localhost:8080/xwiki/bin/edit/XWiki/Admin?editor=class
   but has a Users oject attached:
 http://localhost:8080/xwiki/bin/edit/XWiki/Admin?editor=object


Anyway, if you have more than one object on a page, you will have to loop over 
them and use $doc.use.

the following works for me (even though it is useless in this case, as is loops 
over all users on a page, while there should be only one ...)

{{velocity}}
#set($adminDoc = $xwiki.getDocument(XWiki.Admin))
#set($class = $xwiki.getClass(XWiki.XWikiUsers))
## loop over all objects
#foreach($obj in $adminDoc.getObjects(XWiki.XWikiUsers))
  ## empty line is intentionally to create a new paragraph

  Object number $velocityCount
  #set($discard = $adminDoc.use($obj))
  #foreach($prop in $class.properties) ## go through all properties
* ${prop.prettyName} : $adminDoc.display($prop.getName())
  #end
#end

{{/velocity}}


hth,

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


Re: [xwiki-users] Server side validation / block save

2015-02-09 Thread Clemens Klein-Robbenhaar
On 02/06/2015 11:04 PM, Jason Clemons wrote:
 
 Hey Clemens, 
  
 Thanks so much for the response I really appreciate it.  
  
 Ok.. I have the first part working which I think is the plumbing but I'm 
 not sure of the next step. 
  
 So far I've implemented this in my sheet page:
  
 $doc.setValidationScript(ValidationSample.ValidationGroovy)
 $doc.validate()
  

I think the option you have choose is only useful if you programatically call 
doc.save() - in that case you are also expected to do the validation and 
stuff by yourself.

However that is not your use case; you want to have a validation callback that 
gets called implicitly from the normal document save action.

To do that you should add the hidden input fields:

   input type=hidden name=xvalidate value=1 /
   input type=hidden name=xvalidation 
value=ValidationSample.ValidationGroovy /

in the edit view of the sheet.
Probably this means that you have to wrap these two entries around an

#if ($xcontext.action==edit)
   ...
#end

or the like to avoid having them in the normal view.
In that case the save action should figure out from the submitted form values:
  a) that it should do a custom validation of form submit (as xvalidate=1)
  b) and being told where to look for the validation script (by loading 
xvalidation=ValidationSample.ValidationGroovy)
In this case you should not need to add velocity code by your own to trigger 
the validation.

However you might need custom code to display the validation errors, as show in 
the next section of the tutorial,
or your users will never know what the problem is with their inputs ...


hope this helps,

Clemens

 I've validated that the page is returning a value from 
 ValidationSample.ValidationGroovy because when I explicitly change the values 
 in the ValidationSample.ValidationGroovy page, I see the value reflected on 
 my sheet when it is instantiated. 
  
 I definitely understand that the meat of my validation logic goes in the 
 ValidationSample.ValidationGroovy page, and I understand how to return a 
 value from that page.. but how do I stop/intercept the actual save of the 
 page?
  
 Currently regardless of the value I return (e.g.. true of false) the page 
 save happens the same. I think the part I'm missing is in the How to 
 validate and save the document in CreateDoc section of the tutorial listed 
 here == 
 http://platform.xwiki.org/xwiki/bin/view/DevGuide/Creating+a+form+with+validation+and+tooltips#HHowtovalidateandsavethedocumentinCreateDoc
  although, I'm having some trouble understanding WHERE that code should live 
 and what exactly its function is. 
  
 Does the CreateDoc implementation live in my application sheet, or does it 
 live in it's own sheet named CreateDoc? (which is how it is implemented in 
 the example).  Is the CreateDoc essentially the code that is shimed in 
 between the save event and the actual save? If so, how is it called?
  
 Thanks again for all your help
 
 
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Need doc about access object in a page (and use doc)

2015-02-09 Thread Clemens Klein-Robbenhaar
On 02/09/2015 10:15 AM, Pascal BASTIEN wrote:
 Hello,
 I read/apply this doc with succcess:
 http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HAccessobjectsinapage
 
 With this code I can display all objects ATTACHED to THIS page.
 ***
 #set($class = $obj.xWikiClass) ## access the class object representing 
 SomeSpace.SomeClass
 #foreach($prop in $class.properties) ## go through all properties
 ...
 ***
 but if I attached some class to another page, how can I list properties?

the $xwiki object has a method to access the class if you know the name

 #set( $someClass = $xwiki.getClass(SomeSpace.SomeClass))

http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/XWiki.html#getClass%28java.lang.String%29

 Another question:
 I have a page with 3 same Class, how to list them (like ?editor=class did)?

 you can get a list of of objects of a certain class via 
$doc.getObjects(SomeSpace.SomeClass)

 
http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/Document.html#getObjects%28java.lang.String%29

 An example:
 MySpaceMyClass contain this Class properties:
 - My Field ID (IdField: String)
 - My Lib Field (LibField: String)
 I create MySpace.MyNiceDoc and add my previous Class 
 MySpace/MyNiceDoc?editor=object
 and contain:
 Objets de type MySpace.MyClass (2)
 * MyClass 0
  - My Field ID
  - My Lib Field
 *MyClass 1:
  - My Field ID
  - My Lib Field
 
 With it I like to fill a select list from this doc (but from another doc to).
 How can I proceed? because on MySpace.MyNiceDoc I can only display one/First 
 Lib values with this code:
 {{velocity}}
 ## Retrieve the first object (index [0]) among all objects attached to this 
 page and of a certain class 
 #set($obj = $doc.getObject('MySpace.MyClass'))
 #set($class = $obj.xWikiClass) ## access the class object representing 
 SomeSpace.SomeClass
 #foreach($prop in $class.properties) ## go through all properties
  * ${prop.prettyName} : $doc.display($prop.getName())
 #end
 {{/velocity}}
 I guess i need a loop but which one?
 
 And the big question (who I think it will interest everyone), how can I use 
 documentation
 ( http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation?xpage=embed and or 
 http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/platform/xwiki-platform-oldcore/6.4/xwiki-platform-oldcore-6.4-javadoc.jar/!/index.html
  )
 to guess xWikiClass (or my loop) by example?
 
 A doc/example to use documentation will be welcome. :-)
 
 thxs for any help.
 
 Pascal B
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
 



mit freundlichen Grüßen
Clemens Klein-Robbenhaar

-- 
Clemens Klein-Robbenhaar
Software Development
EsPresto AG
Breite Str. 30-31
10178 Berlin/Germany
Tel: +49.(0)30.90 226.763
Fax: +49.(0)30.90 226.760
robbenh...@espresto.com

HRB 77554 B - Berlin-Charlottenburg
Vorstand: Maya Biersack, Peter Biersack
Vorsitzender des Aufsichtsrats: Dipl.-Wirtsch.-Ing. Winfried Weber
Zertifiziert nach ISO 9001:2008
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Fw : Re: Fw : Re: Need doc about access object in a page (and use doc)

2015-02-09 Thread Pascal BASTIEN
Thxs god! xwiki is a wonderfull world ... when we manage to do what we want (or 
we can understand javadoc) ... hum!

More seriously, thxs a lot for your help (I pulled my hair during all this 
week-end).
I wil probably add your nice code on this page: 
http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HAccessobjectsinapage

## get the document which has the object (only one here) - this is the page 
where I can see things in the object editor
#set( $MyDoc = $xwiki.getDocument(MySpace.MyNiceDoc))
## get the document wich contains the class definition: this page has entries 
in the class editor
#set( $class = $xwiki.getClass(MySpace.MyClass))
#foreach($prop in $class.properties) ## go through all properties
* ${prop.prettyName} : $MyDoc.display($prop.getName())
#end

and

#set($MyDoc = $xwiki.getDocument(MySpace.MyNiceDoc))
#set($class = $xwiki.getClass(MySpace.MyClass))
## loop over all objects
#foreach($obj in $MyDoc.getObjects(MySpace.MyClass))
  ## empty line is intentionally to create a new paragraph

  Object number $velocityCount
  #set($discard = $MyDoc.use($obj))
  #foreach($prop in $class.properties) ## go through all properties
* ${prop.prettyName} : $MyDoc.display($prop.getName())
  #end
#end

Pascal B.


--- En date de : Lun 9.2.15, Clemens Klein-Robbenhaar 
c.robbenh...@espresto.com a écrit :

 De: Clemens Klein-Robbenhaar c.robbenh...@espresto.com
 Objet: Re: [xwiki-users] Fw : Re: Need doc about access object in a page (and 
 use doc)
 À: users@xwiki.org
 Date: Lundi 9 février 2015, 14h53
 On 02/09/2015 02:12 PM,
 Pascal BASTIEN wrote:
  This code
 (probably false) doesn't work.
 
 #set( $Class =
 $xwiki.getClass(MySpace.MyClass))
  #foreach($prop in $class.properties) ## go
 through all properties
   *
 ${prop.prettyName} : $doc.display($prop.getName())
  #end
 
 It
 works for me if I do something like:
 
 {{velocity}}
 ## get the
 document which has the object (only one here) - this is the
 page where I can see things in the object editor
 #set( $adminDoc =
 $xwiki.getDocument(XWiki.Admin))
 ## get the document wich contains the class
 definition: this page has entries in the class editor
 #set( $class =
 $xwiki.getClass(XWiki.XWikiUsers))
 #foreach($prop in $class.properties) ## go
 through all properties
  * ${prop.prettyName}
 : $adminDoc.display($prop.getName())
 #end
 {{/velocity}}
 
 This code should work for you 1:1 unless you
 have deleted you Admin user. toapply for your
 ise case you will have to adapt the name of the class and of
 the document containing the objects
 
 Note that there is a difference between:
 
  - the document _defining_ the
 class - for users this is XWiki.XWikiUsers and you can see
 it at
       http://localhost:8080/xwiki/bin/view/XWiki/XWikiUsers
    and you can cnage it  in the
 class editor:
       http://localhost:8080/xwiki/bin/edit/XWiki/XWikiUsers?editor=class
    but this document is in itself a
 user: the object eduitor is emprty:
      
 http://localhost:8080/xwiki/bin/edit/XWiki/XWikiUsers?editor=object
    (not completely empty, but does
 not contain XWiki.XWikiUsers objects)
 
  - the admin User document is not a
 class:
      http://localhost:8080/xwiki/bin/edit/XWiki/Admin?editor=class
    but has a Users oject
 attached:
      http://localhost:8080/xwiki/bin/edit/XWiki/Admin?editor=object
 
 
 Anyway, if
 you have more than one object on a page, you will have to
 loop over them and use $doc.use.
 
 the following works for me
 (even though it is useless in this case, as is loops over
 all users on a page, while there should be only one ...)
 
 {{velocity}}
 #set($adminDoc =
 $xwiki.getDocument(XWiki.Admin))
 #set($class =
 $xwiki.getClass(XWiki.XWikiUsers))
 ## loop over all objects
 #foreach($obj in
 $adminDoc.getObjects(XWiki.XWikiUsers))
   ## empty line is intentionally to create a
 new paragraph
 
   Object
 number $velocityCount
   #set($discard =
 $adminDoc.use($obj))
   #foreach($prop in
 $class.properties) ## go through all properties
     * ${prop.prettyName} :
 $adminDoc.display($prop.getName())
  
 #end
 #end
 
 {{/velocity}}
 
 
 hth,
 
 clemens
 ___
 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] how to get debug messages in log

2015-02-09 Thread vinc...@massol.net
Hi Jason,


On 9 Feb 2015 at 19:32:28, Jason Clemons 
(jason.clem...@live.com(mailto:jason.clem...@live.com)) wrote:

  
  
 Hello all, which logging configuration do I need to make to see he results of 
 println from Groovy?

No logs, it goes to the page being rendered…

Thanks
-Vincent

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