Re: [xwiki-users] How to add multiple objects to a page

2014-06-30 Thread Thomas Mortagne
I just tested:

{{velocity}}
## Create an object
#set($obj = $doc.newObject(XWiki.TagClass))
$obj.set(tags, tag0)

#set($obj = $doc.newObject(XWiki.TagClass))
$obj.set(tags, tag1)

#set($obj = $doc.newObject(XWiki.TagClass))
$obj.set(tags, tag2)

## Save the object in the page
$doc.save()
{{/velocity}}

and I get 3 XWiki.TagClass objects added to the page each time I view it.

On Sun, Jun 29, 2014 at 11:39 AM, Matthias Albert
matthias.alb...@gmx.de wrote:
 My code is something like this:

 {{groovy}}
 def importEvents() {
   def attachment = doc.getAttachment('events.csv')
   def events = services.eventTable.loadCsvEventFile(attachment)
   assert events
   // create one object
   events.each { event -
 println (- importing: $event)
 def obj = doc.newObject(Main.Event)
 obj.Title = event.title
 obj.DateTime = event.dateTime
 obj.Place = event.place
   }
   doc.save()
 }
 {{/groovy}}

 The function services.eventTable.loadCsvEventFile returns a list of
 objects of a Event groovy class, by interpreting a CSV attachment, which
 works fine and is not the problem.

 Main.Event is the XWiki class of which the objects are to be created.

 After executing this code, the println statement shows that the events
 list has several instances, but inspection of the objetcs of the page
 shows only one object created, which is the first of the list.

 Invoking doc.save() within the iteration does not improve this.

 The groovy class and the XWiki class are named the same (Event,
 Main.Event, respectively). Could this be a problem?

 Thank you,
 Matthias


 Am 29.06.2014 09:14, schrieb Thomas Mortagne:
 On Sat, Jun 28, 2014 at 9:23 PM, Matthias Albert matthias.alb...@gmx.de 
 wrote:
 In the dev guide, there is  a description, how to add a single object to
 a page
 (http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HAddobjectstoapage).

 Unfortunately, adding multiple objects does not work this way.

 Well It does work this way whatever number of objects. What is your
 code and what issue do you have exactly ?


 Is there any example how to do this?

 Thank you in advance,
 Matthias
 ___
 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] [myxwiki] new wiki request

2014-06-30 Thread Thomas Mortagne
You can access your new wiki on http://bristolaction.myxwiki.org.

Enjoy !

On Fri, Jun 27, 2014 at 9:20 PM, Ronald D. Smith
ron.rdssoftw...@gmail.com wrote:
 Hi,

 • description: Bristol Action of Bristol Township near Canandaigua, NY USA.  
 Bristol Action is an unofficial non-profit group working to protect the 
 environment in Bristol Township.  We want to create a web site that augments 
 our page on FaceBook.  This site will contain information regarding the 
 latest issues regarding High Volume Hydrofracturing, HVHF or ‘Fracking’  in 
 our township and New York State.  It will also contain information about 
 alternative energy sources available in our area. Ron Smith will be the 
 technical person as he has developed computer software for over 40 years.  We 
 will also have several people (no more than 5) updating content on the site.  
 We would like to use the mywiki community farm to host this web site.

 • owner name: smithrond

 • wiki name: bristolaction(if this is not available, then 
 usanybristolaction)

 Please let me know what else you need to set up a wiki on .myxwiki.org.

 Thanks,

 Ronald D. Smith
 ron.rdssoftw...@gmail.com

 PS: Thanks for your patience.






 Ronald D. Smith
 rdssoftw...@frontier.com
 ron.rdssoftw...@icloud.com
 ron.rdssoftw...@gmail.com




 ___
 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] xwiki access rights without group

2014-06-30 Thread O.J. Sousa Rodrigues
After deleting the folder: '/var/lib/xwiki/data/jobs' and restartting the
VM the problem went away.
Good thing xwiki repairs it self :)

Thanks for the support.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki access rights without group

2014-06-30 Thread Thomas Mortagne
I really don't see how '/var/lib/xwiki/data/jobs' could be related to
a right issue. There is just logs basically in there.

On Mon, Jun 30, 2014 at 12:15 PM, O.J. Sousa Rodrigues
osoriojaq...@gmail.com wrote:
 After deleting the folder: '/var/lib/xwiki/data/jobs' and restartting the
 VM the problem went away.
 Good thing xwiki repairs it self :)

 Thanks for the support.
 ___
 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] xwiki access rights without group

2014-06-30 Thread Thomas Mortagne
Or do you mean you deleted it to execute the distribution wizard again ?

On Mon, Jun 30, 2014 at 12:29 PM, Thomas Mortagne
thomas.morta...@xwiki.com wrote:
 I really don't see how '/var/lib/xwiki/data/jobs' could be related to
 a right issue. There is just logs basically in there.

 On Mon, Jun 30, 2014 at 12:15 PM, O.J. Sousa Rodrigues
 osoriojaq...@gmail.com wrote:
 After deleting the folder: '/var/lib/xwiki/data/jobs' and restartting the
 VM the problem went away.
 Good thing xwiki repairs it self :)

 Thanks for the support.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users



 --
 Thomas Mortagne



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


Re: [xwiki-users] xwiki access rights without group

2014-06-30 Thread O.J. Sousa Rodrigues
Actually i did not restart the distribution wizard again.
I presume a restart of xwiki was needed for some reason to actually load
the permissions set.

I am still getting weird warnings and exceptions like:
org.xwiki.security.authorization.AccessDeniedException: Access denied when
checking [admin] access to [Wiki xwiki] for user [xwiki:XWiki.or]
or
Admin right is required to install extension
[org.xwiki.platform:xwiki-platform-user-ui-5.0.2] on namespace [wiki:xwiki]

Caused by: class org.xwiki.extension.InstallException: Admin right is
required to install extension
[org.xwiki.platform:xwiki-platform-user-ui-5.0.2] on namespace [wiki:xwiki]




2014-06-30 12:29 GMT+02:00 Thomas Mortagne thomas.morta...@xwiki.com:

 Or do you mean you deleted it to execute the distribution wizard again ?

 On Mon, Jun 30, 2014 at 12:29 PM, Thomas Mortagne
 thomas.morta...@xwiki.com wrote:
  I really don't see how '/var/lib/xwiki/data/jobs' could be related to
  a right issue. There is just logs basically in there.
 
  On Mon, Jun 30, 2014 at 12:15 PM, O.J. Sousa Rodrigues
  osoriojaq...@gmail.com wrote:
  After deleting the folder: '/var/lib/xwiki/data/jobs' and restartting
 the
  VM the problem went away.
  Good thing xwiki repairs it self :)
 
  Thanks for the support.
  ___
  users mailing list
  users@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/users
 
 
 
  --
  Thomas Mortagne



 --
 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] MyXwiki getting 504 errors

2014-06-30 Thread Regan Gill
Hi XWiki, I am getting a server error today trying to access wikis on 
myxwiki.org

Thanks!

Regan

Can some one take a look
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Implement Jsontool.serialize in groovy

2014-06-30 Thread Eduardo Abritta
I'm trying to implement a function that told me but I can not add the data 
online, I can only add one. How do I do that?
{{groovy}}def hql0 = , BaseObject as obj where doc.fullName = obj.name and 
obj.className = 'E-nova.E-novaClass';def listProjetos = 
services.query.hql(hql0).execute();def i = 0;def data = new 
groovy.json.JsonBuilder();data = [totalprojetos: 
listProjetos.size(),projetos: [  id: ,  tag: ,
  label: ,  size: ,  color: , 
 x: ,  y : ],edges:[id: ,   
 source: ,target: ]];
for(item in listProjetos){  def hql = select distinct list from BaseObject as 
obj, DBStringListProperty as prop join prop.list list where 
obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags' 
and obj.name ='$item' ;def tag = services.query.hql(hql).execute();i = 
i + 1;data.projetos.id=1;data.projetos.tag=tags;
data.projetos.label=Label do projeto;data.projetos.size=5;
data.projetos.color=#696969;data.projetos.x=1;data.projetos.y= 1;}
def json = new groovy.json.JsonBuilder(data)println 
json.toPrettyString(){{/groovy}}
Atenciosamente,
Eduardo Abritta
e-mail: eduardo.abri...@outlook.com | cel: (32)8472-9631



 Date: Fri, 27 Jun 2014 11:51:47 +0200
 From: thomas.morta...@xwiki.com
 To: users@xwiki.org
 Subject: Re: [xwiki-users] Implement Jsontool.serialize in groovy
 
 You should probably use JsonBuilder which is the standard tool to
 manipulate JSON in Groovy.
 
 On Fri, Jun 27, 2014 at 10:33 AM, Clemens Klein-Robbenhaar
 c.robbenh...@espresto.com wrote:
 
  The velocity tools are not automatically created for groovy scripts
  The closest you can get is to create them manually in your script, like:
 
   def jsontool = new org.xwiki.velocity.tools.JSONTool()
 
  I feel there should be a better way to do that, but it works this way.
  (it is likely that using groovy.json.JsonBuilder() works, too, but I have 
  not tried)
 
  Clemens
 
  On 06/24/2014 09:21 PM, Eduardo Abritta wrote:
  Hello Sirs,
  I need to implement the function jsontool.serialize in the code below, 
  groovy, and I do not understand the error that is accusing, can help me 
  solve this?
  {{groovy}}def hql0 = , BaseObject as obj where doc.fullName = obj.name 
  and obj.className = 'E-nova.E-novaClass';def listProjetos = 
  services.query.hql(hql0).execute();def json = ['totalprojetos': 
  listProjetos.size(), 'projetos':[1000] , 'edges':[1000] ];def i = 0;
  for(item in listProjetos){def hql = select distinct list from 
  BaseObject as obj, DBStringListProperty as prop join prop.list list where 
  obj.className='XWiki.TagClass' and obj.id=prop.id.id and 
  prop.id.name='tags' and obj.name ='$item' ;def tag = 
  services.query.hql(hql).execute();i = i + 1;
  json.projetos.add({id: xwiki.getDocument(item).getName()})}
  jsontool.serialize(json);
  {{/groovy}}
  Ty.
  Atenciosamente,
  Eduardo Abritta
  e-mail: eduardo.abri...@outlook.com | cel: (32)8472-9631
 
 
  ___
  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