[xwiki-users] Users

2010-02-01 Thread J. Allen Santos

Hi,
I was playing with XWiki 1.8.1. I was told that users in a wiki is represented 
as a page with a certain object - XWikiUsers. I copied one user page from one 
xwiki instance and then saved it to another xwiki instance so as to register 
that user to that instance. The user was registered but, it seems that the 
user doesn't have any rights at all. So, I tried modifying the rights. I 
registered as Admin then included that user to the XWikiAll group. That solved 
the problem.
Any comments?
Any ideas on how to completely register a user from one instance to another 
by copying the user page.. using code?
Thanks,
Allen 
_
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Users

2010-02-01 Thread Vincent Massol
Hi,

On Feb 1, 2010, at 9:58 AM, J. Allen Santos wrote:

 
 Hi,
 I was playing with XWiki 1.8.1. I was told that users in a wiki is 
 represented as a page with a certain object - XWikiUsers. I copied one user 
 page from one xwiki instance and then saved it to another xwiki instance so 
 as to register that user to that instance. The user was registered but, 
 it seems that the user doesn't have any rights at all. So, I tried modifying 
 the rights. I registered as Admin then included that user to the XWikiAll 
 group. That solved the problem.
 Any comments?
 Any ideas on how to completely register a user from one instance to another 
 by copying the user page.. using code?

You also need to add the new user to the correct group (XWikiAllGroup for ex). 
You can do that using the UI, using the object editor or through code.

Thanks
-Vincent

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


[xwiki-users] parseGroovyFromPage() and singleton

2010-02-01 Thread Jeremie BOUSQUET
Hi all,

I use method parseGroovyFromPage() to instantiate an object from a Groovy
class stored in a page.

It works well, but now I would like to forbid multiple executions of this
class. To do so, I changed it to be a singleton, setting the constructor as
private.
Of course, now, parseGroovyFromPage() returns that the object can't be
instantiated ... As the call to the constructor is inside this method, I
can't change it to just call getInstance().

Are there any workarounds, or other ways to achieve this ?

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


Re: [xwiki-users] parseGroovyFromPage() and singleton

2010-02-01 Thread Vincent Massol
Hi Jeremie,

On Feb 1, 2010, at 10:11 AM, Jeremie BOUSQUET wrote:

 Hi all,
 
 I use method parseGroovyFromPage() to instantiate an object from a Groovy
 class stored in a page.
 
 It works well, but now I would like to forbid multiple executions of this
 class. To do so, I changed it to be a singleton, setting the constructor as
 private.
 Of course, now, parseGroovyFromPage() returns that the object can't be
 instantiated ... As the call to the constructor is inside this method, I
 can't change it to just call getInstance().
 
 Are there any workarounds, or other ways to achieve this ?

Why do you need to use this method?

With XWiki Syntax 2.0 we now have the ability to do:

{{include document=groovypage/}}

where groovypage is a page using the {{groovy}} macro to define groovy code.

If you want to forbid several executions of the {{groovy}} script you could use 
an if() inside it and check if a value is present in the session or application 
context (depending if you want it called once per user or per application).

Thanks
-Vincent



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


Re: [xwiki-users] parseGroovyFromPage() and singleton

2010-02-01 Thread Jeremie BOUSQUET
Thanks Vincent,

You're right it will be easier through context...
Do $context (velocity) and context (groovy) variables refer to the
application context or to the session context ?

Jeremie

2010/2/1 Vincent Massol vinc...@massol.net

 Hi Jeremie,

 On Feb 1, 2010, at 10:11 AM, Jeremie BOUSQUET wrote:

  Hi all,
 
  I use method parseGroovyFromPage() to instantiate an object from a Groovy
  class stored in a page.
 
  It works well, but now I would like to forbid multiple executions of this
  class. To do so, I changed it to be a singleton, setting the constructor
 as
  private.
  Of course, now, parseGroovyFromPage() returns that the object can't be
  instantiated ... As the call to the constructor is inside this method, I
  can't change it to just call getInstance().
 
  Are there any workarounds, or other ways to achieve this ?

 Why do you need to use this method?

 With XWiki Syntax 2.0 we now have the ability to do:

 {{include document=groovypage/}}

 where groovypage is a page using the {{groovy}} macro to define groovy
 code.

 If you want to forbid several executions of the {{groovy}} script you could
 use an if() inside it and check if a value is present in the session or
 application context (depending if you want it called once per user or per
 application).

 Thanks
 -Vincent



 ___
 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] parseGroovyFromPage() and singleton

2010-02-01 Thread Thomas Mortagne
On Mon, Feb 1, 2010 at 10:41, Jeremie BOUSQUET
jeremie.bousq...@gmail.com wrote:
 Thanks Vincent,

 You're right it will be easier through context...
 Do $context (velocity) and context (groovy) variables refer to the
 application context or to the session context ?

No, and even $context in velocity is here for backward compatibility.
You should use xcontext binding in velocity and groovy when using
syntax xwiki/2.0.


 Jeremie

 2010/2/1 Vincent Massol vinc...@massol.net

 Hi Jeremie,

 On Feb 1, 2010, at 10:11 AM, Jeremie BOUSQUET wrote:

  Hi all,
 
  I use method parseGroovyFromPage() to instantiate an object from a Groovy
  class stored in a page.
 
  It works well, but now I would like to forbid multiple executions of this
  class. To do so, I changed it to be a singleton, setting the constructor
 as
  private.
  Of course, now, parseGroovyFromPage() returns that the object can't be
  instantiated ... As the call to the constructor is inside this method, I
  can't change it to just call getInstance().
 
  Are there any workarounds, or other ways to achieve this ?

 Why do you need to use this method?

 With XWiki Syntax 2.0 we now have the ability to do:

 {{include document=groovypage/}}

 where groovypage is a page using the {{groovy}} macro to define groovy
 code.

 If you want to forbid several executions of the {{groovy}} script you could
 use an if() inside it and check if a value is present in the session or
 application context (depending if you want it called once per user or per
 application).

 Thanks
 -Vincent



 ___
 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] parseGroovyFromPage() and singleton

2010-02-01 Thread Sergiu Dumitriu
On 02/01/2010 10:41 AM, Jeremie BOUSQUET wrote:
 Thanks Vincent,

 You're right it will be easier through context...
 Do $context (velocity) and context (groovy) variables refer to the
 application context or to the session context ?

Neither, it's a custom context valid for one request. You can get either 
of the session/application context starting from the $request (velocity) 
request (groovy) variable, which internally is a HttpServletRequest, 
look at its documentation for more details:

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequest.html

 Jeremie

 2010/2/1 Vincent Massolvinc...@massol.net

 Hi Jeremie,

 On Feb 1, 2010, at 10:11 AM, Jeremie BOUSQUET wrote:

 Hi all,

 I use method parseGroovyFromPage() to instantiate an object from a Groovy
 class stored in a page.

 It works well, but now I would like to forbid multiple executions of this
 class. To do so, I changed it to be a singleton, setting the constructor
 as
 private.
 Of course, now, parseGroovyFromPage() returns that the object can't be
 instantiated ... As the call to the constructor is inside this method, I
 can't change it to just call getInstance().

 Are there any workarounds, or other ways to achieve this ?

 Why do you need to use this method?

 With XWiki Syntax 2.0 we now have the ability to do:

 {{include document=groovypage/}}

 where groovypage is a page using the {{groovy}} macro to define groovy
 code.

 If you want to forbid several executions of the {{groovy}} script you could
 use an if() inside it and check if a value is present in the session or
 application context (depending if you want it called once per user or per
 application).

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


Re: [xwiki-users] How to put an image as panel background ?

2010-02-01 Thread Dilipkumar Jadhav
Hello there,
If you would simply like to display an image in your panel background follow
these simple steps:

1. Create the Panel from the Panels.WebHome Page (Let's say, the Panel is
called test image)
2. Attach an image/logo of your choice to this Page. (Assume, the image is
called img.jpg)
3. Edit the Panel in inline mode. For XWiki syntax 1.0 edit the Panel code
so that it looks something like this:

#panelheader('test image')
{image:img.jpg|document=Panels.test image}
#panelfooter()

The reason we mention the document attribute is that by default image:
would look for image files on the Page that you are viewing. By specifying
the Document attribute we make sure that no matter what Page you are
viewing, the panel will always display the img.jpg attached to the
Document called Panels.test image.
You can also lookup the Syntax guide to specify other attributes such as
default size of the image in the Panel.


Hope this helps...


Hello All,
I want just to display my logos in panels background.

Thanks,

--

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


Re: [xwiki-users] Programmatically delete documents without putting them in recycle bin

2010-02-01 Thread Jeremie BOUSQUET
To be clearer, I know that I could do this by executing appropriate SQL
delete requests, but it's ugly and I wanted to know if some internal API is
able to do so.

2010/2/1 Jeremie BOUSQUET jeremie.bousq...@gmail.com

 Hi,

 I'd like to know if there is a way to delete a document (in velocity or
 groovy) without putting in in recycle bin ? (equivalent of shift-delete).

 I have to regularly delete (for tests) documents with heavy attachments,
 and it's quite long ... And I don't care about retrieving them later.

 Thanks,
 Jeremie

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


[xwiki-users] Wiki 2.2 milestone 2

2010-02-01 Thread Aplamon

Hi
Just updated to latest milestone from 2.04. Overall, it looks nice! A couple
of things I noticed:
1. User profile page has a stray {/pre} tag at the end of the page.
2. Our profile pictures are not shown as avatars anymore in places like
recent changes in dashboard.
3. When I imported the default pages I wanted the recent change history
seemed to get reset?

Thank you
Daniel
-- 
View this message in context: 
http://n2.nabble.com/Wiki-2-2-milestone-2-tp4495259p4495259.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] LDAP (Active Directory ) integration.

2010-02-01 Thread jarjona
Hello:

Thanks for XWiki.  I think is great software!.

I am trying to import the pictures of the users from LDAP.  They are 
currently stored in the AD field named thumbnailPhoto.  I cannot find on 
the XWikiUsers class the field that contains it. 

Is it somewhere else ?  How can I get that picture in ?

Thanks,

Juan
 
 
This email and any attached files (Message) may contain confidential and/or 
privileged information. It is intended solely for the addressee(s). If you 
receive this Message in error, inform the sender by reply email, delete the 
Message and destroy any printed copy.
Any unauthorized use, distribution, or copying of this Message or any part 
thereof is prohibited. Emails are susceptible to alteration. Neither Technip 
nor any of its affiliates shall be liable for the Message if altered or 
falsified nor shall they be liable for any damage caused by any virus that 
might be transmitted with this Message.

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


Re: [xwiki-users] Wiki 2.2 milestone 2

2010-02-01 Thread Vincent Massol
Hi Daniel,

On Feb 1, 2010, at 5:29 PM, Aplamon wrote:

 
 Hi
 Just updated to latest milestone from 2.04. Overall, it looks nice!

Thanks for the feedback.

 A couple
 of things I noticed:
 1. User profile page has a stray {/pre} tag at the end of the page.

Yep, I've fixed it thanks.

 2. Our profile pictures are not shown as avatars anymore in places like
 recent changes in dashboard.

Fixed too.

 3. When I imported the default pages I wanted the recent change history
 seemed to get reset?

You choose what behavior you want in the import. Check the various options 
there and let us know if they're ok for you.

Thanks
-Vincent

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


Re: [xwiki-users] Wiki 2.2 milestone 2

2010-02-01 Thread Aplamon

Ok,
I choose make a new revision of existing documents. I thought importing default 
pages would not affect that?

Daniel


From: vmassol [via XWiki] [mailto:ml-node+4495299-208866...@n2.nabble.com]
Sent: Monday, February 01, 2010 8:35 AM
To: Daniel Johansson
Subject: Re: Wiki 2.2 milestone 2

Hi Daniel,

On Feb 1, 2010, at 5:29 PM, Aplamon wrote:


 Hi
 Just updated to latest milestone from 2.04. Overall, it looks nice!

Thanks for the feedback.

 A couple
 of things I noticed:
 1. User profile page has a stray {/pre} tag at the end of the page.

Yep, I've fixed it thanks.

 2. Our profile pictures are not shown as avatars anymore in places like
 recent changes in dashboard.

Fixed too.

 3. When I imported the default pages I wanted the recent change history
 seemed to get reset?

You choose what behavior you want in the import. Check the various options 
there and let us know if they're ok for you.

Thanks
-Vincent

___
users mailing list
[hidden 
email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4495299i=0
http://lists.xwiki.org/mailman/listinfo/users


View message @ http://n2.nabble.com/Wiki-2-2-milestone-2-tp4495259p4495299.html
To unsubscribe from Wiki 2.2 milestone 2, click here (link removed) .


-- 
View this message in context: 
http://n2.nabble.com/Wiki-2-2-milestone-2-tp4495259p4495348.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 (Active Directory ) integration.

2010-02-01 Thread Thomas Mortagne
Hi,

On Mon, Feb 1, 2010 at 17:04,  jarj...@technip.com wrote:
 Hello:

 Thanks for XWiki.  I think is great software!.

 I am trying to import the pictures of the users from LDAP.  They are
 currently stored in the AD field named thumbnailPhoto.  I cannot find on
 the XWikiUsers class the field that contains it.

 Is it somewhere else ?  How can I get that picture in ?

I depends what you mean by import the pictures of the users from
LDAP. If it's an URL I think you can synchronize it with the XWiki
user field called avatar.


 Thanks,

 Juan


 This email and any attached files (Message) may contain confidential and/or 
 privileged information. It is intended solely for the addressee(s). If you 
 receive this Message in error, inform the sender by reply email, delete the 
 Message and destroy any printed copy.
 Any unauthorized use, distribution, or copying of this Message or any part 
 thereof is prohibited. Emails are susceptible to alteration. Neither Technip 
 nor any of its affiliates shall be liable for the Message if altered or 
 falsified nor shall they be liable for any damage caused by any virus that 
 might be transmitted with this Message.

 ___
 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] Wiki 2.2 milestone 2

2010-02-01 Thread Vincent Massol

On Feb 1, 2010, at 5:42 PM, Aplamon wrote:

 
 Ok,
 I choose make a new revision of existing documents. I thought importing 
 default pages would not affect that?

Not sure what you mean by default pages. But if you choose to create new 
revisions then the old revisions will still be there (ie you can rollback to 
them) and a new revision will be created for the imported page.

I'm really interested to know if there's something not clear so that we can 
improve it before the final release.

Thanks
-Vincent

 Daniel
 
 
 From: vmassol [via XWiki] [mailto:ml-node+4495299-208866...@n2.nabble.com]
 Sent: Monday, February 01, 2010 8:35 AM
 To: Daniel Johansson
 Subject: Re: Wiki 2.2 milestone 2
 
 Hi Daniel,
 
 On Feb 1, 2010, at 5:29 PM, Aplamon wrote:
 
 
 Hi
 Just updated to latest milestone from 2.04. Overall, it looks nice!
 
 Thanks for the feedback.
 
 A couple
 of things I noticed:
 1. User profile page has a stray {/pre} tag at the end of the page.
 
 Yep, I've fixed it thanks.
 
 2. Our profile pictures are not shown as avatars anymore in places like
 recent changes in dashboard.
 
 Fixed too.
 
 3. When I imported the default pages I wanted the recent change history
 seemed to get reset?
 
 You choose what behavior you want in the import. Check the various options 
 there and let us know if they're ok for you.
 
 Thanks
 -Vincent
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] LDAP (Active Directory ) integration.

2010-02-01 Thread jarjona
Thanks for the prompt answer.

It is actually a binary field in .jpg format stored in the field...

I guess some custom development has to be done to import the picture and put it 
in the db, and then reference it...

Juan



- Original Message -
From: Thomas Mortagne [thomas.morta...@xwiki.com]
Sent: 01/02/2010 17:40 CET
To: XWiki Users users@xwiki.org
Subject: Re: [xwiki-users] LDAP (Active Directory ) integration.



Hi,

On Mon, Feb 1, 2010 at 17:04,  jarj...@technip.com wrote:
 Hello:

 Thanks for XWiki.  I think is great software!.

 I am trying to import the pictures of the users from LDAP.  They are
 currently stored in the AD field named thumbnailPhoto.  I cannot find on
 the XWikiUsers class the field that contains it.

 Is it somewhere else ?  How can I get that picture in ?

I depends what you mean by import the pictures of the users from
LDAP. If it's an URL I think you can synchronize it with the XWiki
user field called avatar.


 Thanks,

 Juan


 This email and any attached files (Message) may contain confidential and/or 
 privileged information. It is intended solely for the addressee(s). If you 
 receive this Message in error, inform the sender by reply email, delete the 
 Message and destroy any printed copy.
 Any unauthorized use, distribution, or copying of this Message or any part 
 thereof is prohibited. Emails are susceptible to alteration. Neither Technip 
 nor any of its affiliates shall be liable for the Message if altered or 
 falsified nor shall they be liable for any damage caused by any virus that 
 might be transmitted with this Message.

 ___
 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

 
 
This email and any attached files (Message) may contain confidential and/or 
privileged information. It is intended solely for the addressee(s). If you 
receive this Message in error, inform the sender by reply email, delete the 
Message and destroy any printed copy.
Any unauthorized use, distribution, or copying of this Message or any part 
thereof is prohibited. Emails are susceptible to alteration. Neither Technip 
nor any of its affiliates shall be liable for the Message if altered or 
falsified nor shall they be liable for any damage caused by any virus that 
might be transmitted with this Message.

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


Re: [xwiki-users] LDAP (Active Directory ) integration.

2010-02-01 Thread Thomas Mortagne
On Mon, Feb 1, 2010 at 20:55,  jarj...@technip.com wrote:
 Thanks for the prompt answer.

 It is actually a binary field in .jpg format stored in the field...

 I guess some custom development has to be done to import the picture and put 
 it in the db, and then reference it...

Yes this is not supported, it would need some development to get the
picture byte put it as attachment in the profile and link to this
attachment in the avatar field.


 Juan



 - Original Message -
 From: Thomas Mortagne [thomas.morta...@xwiki.com]
 Sent: 01/02/2010 17:40 CET
 To: XWiki Users users@xwiki.org
 Subject: Re: [xwiki-users] LDAP (Active Directory ) integration.



 Hi,

 On Mon, Feb 1, 2010 at 17:04,  jarj...@technip.com wrote:
 Hello:

 Thanks for XWiki.  I think is great software!.

 I am trying to import the pictures of the users from LDAP.  They are
 currently stored in the AD field named thumbnailPhoto.  I cannot find on
 the XWikiUsers class the field that contains it.

 Is it somewhere else ?  How can I get that picture in ?

 I depends what you mean by import the pictures of the users from
 LDAP. If it's an URL I think you can synchronize it with the XWiki
 user field called avatar.


 Thanks,

 Juan


 This email and any attached files (Message) may contain confidential 
 and/or privileged information. It is intended solely for the addressee(s). 
 If you receive this Message in error, inform the sender by reply email, 
 delete the Message and destroy any printed copy.
 Any unauthorized use, distribution, or copying of this Message or any part 
 thereof is prohibited. Emails are susceptible to alteration. Neither Technip 
 nor any of its affiliates shall be liable for the Message if altered or 
 falsified nor shall they be liable for any damage caused by any virus that 
 might be transmitted with this Message.

 ___
 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



 This email and any attached files (Message) may contain confidential and/or 
 privileged information. It is intended solely for the addressee(s). If you 
 receive this Message in error, inform the sender by reply email, delete the 
 Message and destroy any printed copy.
 Any unauthorized use, distribution, or copying of this Message or any part 
 thereof is prohibited. Emails are susceptible to alteration. Neither Technip 
 nor any of its affiliates shall be liable for the Message if altered or 
 falsified nor shall they be liable for any damage caused by any virus that 
 might be transmitted with this Message.

 ___
 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] Single Page Visit/View Count through Groovy Snippet

2010-02-01 Thread Dilipkumar Jadhav
Hello folks,

I was trying to get the visit count for a single Page through the following
Groovy Code in Syntax 2.0:

 

{{groovy}}

println Total No. Of Visits:
${doc.getCurrentMonthPageStats(view).getVisits()};

{{/groovy}}

 

It looks like it is returning some data for the Page from the start of the
month. However, the concern is every time I view the Page, the count
increases by +2 rather than +1.

The same is saved in the database in xwikistatsdoc as well. 

Is there a logic that probably I missed out on. My understanding was that
the counter should have increased by +1.

Also, is the code snippet that I wrote correct to get this kind of
data...Any help would as always be greatly appreciated.

Thank you.

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


Re: [xwiki-users] REST services access to spaces tags

2010-02-01 Thread Dilipkumar Jadhav
Hello Fabio  friends,
Previously I had emailed a possible work around to make sure that
XWiki.Guest user does not have access to the list of Spaces in a completely
private wiki instance. In the meantime, I was working on a possible
resolution to the issue of Tags being publicly accessible to XWiki.Guest in
a private wiki.
Submitting my code change for your kind consideration:


I modified the file TagsResource.java in package
org.xwiki.rest.resources.tags.
I replaced the method :

private ListString getAllTags() throws QueryException
{
String query =
select distinct elements(prop.list) from BaseObject as obj, 
+ DBStringListProperty as prop where
obj.className='XWiki.TagClass' 
+ and obj.id=prop.id.id and prop.id.name='tags';

ListString tags = queryManager.createQuery(query,
Query.HQL).execute();
Collections.sort(tags, String.CASE_INSENSITIVE_ORDER);

return tags;
}


With the following code:

  private ListString getAllTags() throws QueryException
{
ListString tags=null;
 
if(!Utils.getXWikiUser(componentManager).equalsIgnoreCase(XWiki.Guest)){
 String query =
select distinct elements(prop.list) from BaseObject as obj, 
+ DBStringListProperty as prop where
obj.className='XWiki.TagClass' 
+ and obj.id=prop.id.id and prop.id.name='tags';

tags = queryManager.createQuery(query, Query.HQL).execute();
Collections.sort(tags, String.CASE_INSENSITIVE_ORDER);
}

return tags;
}
}

I am unable to throw a authentication required in the browser. 
However, I am able to block the anonymous/Xwiki.Guest user from accessing
the list of tags :)

Next, I need to investigate if the anomaly exists with Classes, Objects,
etc.
Thank you folks...



--

Message: 3
Date: Wed, 27 Jan 2010 17:57:02 +0530
From: Dilipkumar Jadhav jadhav.dilipku...@gmail.com
Subject: Re: [xwiki-users] REST services access to spaces  tags
To: users@xwiki.org
Message-ID: 4b60313f.5644f10a.7b9c.4...@mx.google.com
Content-Type: text/plain;   charset=us-ascii

Hello friends,
I had enquired on the mailing list about the access to Spaces  Tags on a
strictly private wiki.
I believe I might have a resolution:

Possible Resolution:
1. I checked out the XWiki Platform - Core -REST module for XWiki 2.1.1.
2. As per the original issue, the Pages were not accessible but Spaces were
accessible in a private wiki even without authentication.
   Hence, I found the two class files  compared them, viz. 
a. SpacesResource.java in package org.xwiki.rest.resources.spaces
b. PagesResource.java in package org.xwiki.rest.resources.pages

3. In SpacesResource.java replaced the following code:

if (Utils.getXWikiApi(componentManager).exists(homeId)) {
home =
Utils.getXWikiApi(componentManager).getDocument(homeId);
}
spaces.getSpaces().add(
DomainObjectFactory.createSpace(objectFactory,
uriInfo.getBaseUri(), wikiName, spaceName, home));

With the following code:

if (Utils.getXWikiApi(componentManager).exists(homeId)) {
home =
Utils.getXWikiApi(componentManager).getDocument(homeId);

if (home != null) {
spaces.getSpaces().add(
 DomainObjectFactory.createSpace(objectFactory,
uriInfo.getBaseUri(), wikiName, spaceName, home));


4. Compiled the module jar  deployed it on the XWiki instance.
5. Now, the spaces show up only when the user has been authenticated through
the browser. When there is no authentication, all that is displayed is an
empty /spaces tag. So things do look partly the way I wanted them to work.

I have following two questions at this point of time:
1. Is this the right way to do it. Did I end up breaking something else that
was working?
2. If this is the correct resolution, how could I add a Status.UNAUTHORIZED
when there is no authentication?

Any help will be greatly appreciated. Thank you for your time 
consideration folks.




2. REST services access to spaces  tags (Dilipkumar Jadhav)
Message: 2
Date: Mon, 25 Jan 2010 17:45:27 +0530
From: Dilipkumar Jadhav jadhav.dilipku...@gmail.com
Subject: [xwiki-users] REST services access to spaces  tags
To: users@xwiki.org
Message-ID: 4b5d8b69.0404c00a.65db.a...@mx.google.com
Content-Type: text/plain;   charset=us-ascii

Hello friends,

I am facing some unexpected behavior with RESTful services in private wiki
instance:

 

Issue: Spaces, Tags entities can be accessed publicly through REST URL,
eventhough XWiki is run in private wiki mode.

 

Description: One of the XWiki 2.1.1 instance is setup in a private wiki
mode. Guests are not allowed to register or view any page on this instance.

I am also making use of authenticated services (RESTful services  XMLRPC
services) for 

Re: [xwiki-users] Single Page Visit/View Count through Groovy Snippet

2010-02-01 Thread Marius Dumitru Florea
Dilipkumar Jadhav wrote:
 Hello folks,
 
 I was trying to get the visit count for a single Page through the following
 Groovy Code in Syntax 2.0:
 
  
 
 {{groovy}}
 
 println Total No. Of Visits:
 ${doc.getCurrentMonthPageStats(view).getVisits()};
 
 {{/groovy}}
 
  
 
 It looks like it is returning some data for the Page from the start of the
 month. However, the concern is every time I view the Page, the count
 increases by +2 rather than +1.
 
 The same is saved in the database in xwikistatsdoc as well. 
 
 Is there a logic that probably I missed out on. My understanding was that
 the counter should have increased by +1.

I think this is a known issue, see 
http://jira.xwiki.org/jira/browse/XWIKI-4590 .

Hope this helps,
Marius

 
 Also, is the code snippet that I wrote correct to get this kind of
 data...Any help would as always be greatly appreciated.
 
 Thank you.
 
 ___
 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