Thanks a lot,
the previous problem is solved but the code that I use to copy the page's
rights on another page seems doesn't work.
Vector right = doc.getObjects("XWiki.XWikiRights");
for (Object singleObj : right)
{
Object entry = targetDoc.newObject("XWiki.XWikiRights");
entry.set("groups",singleObj.getProperty("groups").getValue());
Object entry = targetDoc.newObject("XWiki.XWikiRights");
entry.set("groups",singleObj.getProperty("users").getValue());
Object entry = targetDoc.newObject("XWiki.XWikiRights");
entry.set("groups",singleObj.getProperty("level").getValue());
Object entry = targetDoc.newObject("XWiki.XWikiRights");
entry.set("groups",singleObj.getProperty("allow").getValue());
}
targetDoc.save();
What I do wrong?รน
Regards
Raffo
Sergiu Dumitriu-2 wrote:
>
> raffovi wrote:
>> Hi,
>>
>> the code:
>>
>> Jerome Velociter-2 wrote:
>>> $entry.set("allow",$right.get("allow"))
>>>
>>
>> throws this Exception:
>>
>> java.lang.NumberFormatException: For input string:
>> "Deny"---java.lang.NumberFormatException.forInputString(Unknown Source)
>>
>> java.lang.NumberFormatException: For input string:
>> "Deny"---java.lang.Integer.parseInt(Unknown Source)
>>
>> java.lang.NumberFormatException: For input string:
>> "Deny"---java.lang.Integer.<init>(Unknown Source)
>>
>> java.lang.NumberFormatException: For input string:
>> "Deny"---com.xpn.xwiki.objects.classes.BooleanClass.fromString(BooleanClass.java:98)
>> java.lang.NumberFormatException: For input string:
>> "Deny"---com.xpn.xwiki.objects.BaseObject.set(BaseObject.java:204)
>>
>> java.lang.NumberFormatException: For input string:
>> "Deny"---com.xpn.xwiki.api.Object.set(Object.java:82)
>>
>>
>>
>> $right.get("allow") returns "Deny" and not a number as requested from the
>> method fromString(String value) BooleanClass.java row 98
>>
>> Can someone help me
>> Raffo
>
> Try:
>
> $right.getProperty("allow").value
>
> Sergiu
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
>
>
--
View this message in context:
http://www.nabble.com/copy-the-rigths-tp15003379p15201209.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users