Re: [xwiki-users] 2 problems with XWiki: search and "All pages"

2015-06-08 Thread Marius Dumitru Florea
On Tue, Jun 9, 2015 at 9:14 AM, VasyaPupkin  wrote:
> Hi all! My english is bad, and I sorry about this...:-\
>
> I have XWiki Enterprise 6.4.3 on CentOS 7.
>

> And first problem is: when I click on "All pages", I see nothing, but the
> pages have (screenshot 1)

Where exactly did you click? By default there's no page named "allpages".

> 
>
> Second problem is: when I try to search something in Russian language I get
> symbols as in the screenshot 2
> 
>
> In English language search works fine.
>

> xwiki.encoding=utf-8

The encoding must be configured at multiple levels. See
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Encoding .

>
>
>
> --
> View this message in context: 
> http://xwiki.475771.n2.nabble.com/2-problems-with-XWiki-search-and-All-pages-tp7595058.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
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] 2 problems with XWiki: search and "All pages"

2015-06-08 Thread VasyaPupkin
Hi all! My english is bad, and I sorry about this...:-\

I have XWiki Enterprise 6.4.3 on CentOS 7.

And first problem is: when I click on "All pages", I see nothing, but the
pages have (screenshot 1)
 

Second problem is: when I try to search something in Russian language I get
symbols as in the screenshot 2
 

In English language search works fine. 

xwiki.encoding=utf-8



--
View this message in context: 
http://xwiki.475771.n2.nabble.com/2-problems-with-XWiki-search-and-All-pages-tp7595058.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] Get parts of a page...

2015-06-08 Thread Gerritjan Koekkoek
I'm not sure what cased the 503, maybe because I did:
 #foreach($topicDefenitionDoc in $topicDefenitionDocs)
   #set($topicDefenitionDocument=$xwiki.getDocument($topicDefenitionDoc))
   
#set($topicDefenitionObject=$topicDefenitionDocument.getObject($classDefenitionName))
   == 
$topicDefenitionDocument.display('topicTitle','view',$topicDefenitionObject) ==
   #foreach($headerBlock in 
$topicDefenitionDocument.getXDOM().getBlocks("class:HeaderBlock", 
""DESCENDANT"))
 $headerBlock -- to inspect what's inside
   #end
#end

I changed the inside of the loop to $velocityCount and indeed the numbers 
seemed to allign wel with number of headers inside the page

I've now changed class:HeaderBlock into class:GroupBlock
but now the $velocityCount equals 1 all the time wile my text is like:
== Behavior ==
Behavioral problems in people with CdLS are not inevitable. In fact, some 
people have no behavioral problems, while others are mild, have transient 
problems. Many problems are treatable. At the same time it is obviously the 
severity of behavioral problems in people who injure themselves or others deny.

Many behavior problems are a reaction to something in the body or the 
environment and they are cyclical (they come and go). Behavioral changes often 
occur in early childhood and the teenage years. Like most people, develop 
people with CdLS behavior for a certain reason, and it is important to first 
address the underlying causes of the behavior. If the source of the behavior is 
determined, one can try to recognize that resource and to avoid.

If the behavior follows a pattern (such as it is always at the same time, same 
place, or to a particular person) treatment will begin to investigate whether 
the situation can be changed. When the problem is that the environment does not 
provide sufficient structure or variation, that can be addressed. Discovering 
the reasons for behavior is the most difficult part of the treatment. Sometimes 
one can not eliminate the cause and one should look for ways to control the 
behavior. This can vary from moment to rest in your own room, distract the 
person to another activity to the use of protective clothing.

It remains important to always look at possible underlying medical problems. 
Gastrointestinal problems, muscle pain, ear infections, dental pain and 
epilepsy can cause irritability, self-injurious behavior or aggressive 
behavior. Even people who can communicate well, sometimes can not recognize the 
source of their discontent. Undetected disease (silent reflux) and tooth decay 
/ gum disease are the two most common causes of behavioral changes.

I would have expected the  velocity count to number to 4 )equal to number op 
tags in the text? but it counts only 1

Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website
Facebook
email





From: users  on behalf of Thomas Mortagne 

Sent: 08 June 2015 11:19
To: XWiki Users
Subject: Re: [xwiki-users] Get parts of a page...

On Mon, Jun 8, 2015 at 11:11 AM, Gerritjan Koekkoek
 wrote:
> From: users  on behalf of Thomas Mortagne 
> 
> Sent: 08 June 2015 11:00
> To: XWiki Users
> Subject: Re: [xwiki-users] Get parts of a page...
>
> On Mon, Jun 8, 2015 at 10:52 AM, Gerritjan Koekkoek
>  wrote:
>> From: users  on behalf of Thomas Mortagne 
>> 
>> Sent: 08 June 2015 10:46
>> To: XWiki Users
>> Subject: Re: [xwiki-users] Get parts of a page...
>>
>> On Mon, Jun 8, 2015 at 10:28 AM, Gerritjan Koekkoek
>>  wrote:
>>> Hi,
>>>
>>> this indeed looks very useful...
>>> We run XWiki version 6.4
>
> Is this functionality very costly from a performance perspective?
> The loop i'm running will give me approx 25 pages
> Now I have added the loop through all the Headerblocks and the server crashed 
> (503 service not available)
> Now retrying and the page load is very slow: Wating for many minutes now?

Loading 25 pages is slow whatever you do with them, then they are in
cache and it should be OK. I don't see how reading a XDOM could cause
a crash, you should look at the log and see what this 503 really mean.

>
>>> 
>>> From: users  on behalf of Thomas Mortagne 
>>> 
>>> Sent: 08 June 2015 10:17
>>> To: XWiki Users
>>> Subject: Re: [xwiki-users] Get parts of a page...
>>>
>>> In your macro you could get the document and then use something like
>>> what is described in
>>> http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki61RC1#HAccesstoBlockMatchersfromvelocityscripts
>>> to extract the GroupBlock you want (i.e. the one with a parameter
>>> "class" equals to "lead" from what I understood).
>>>
>>> My script is:
>>> #foreach($topicDefenitionDoc in $topicDefenitionDocs)
>>>   #set($topicDefenitionDocument=$xwiki.getDocument($topicDefenitionDoc))
>>>   
>>> #set($topicDefenitionObject=$topicDefenitionDocument.getObject($classDefenitionName))
>>>   == 
>>> $topic

Re: [xwiki-users] User list and user profile access rights

2015-06-08 Thread Eduard Moraru
Hi,

On Thu, Jun 4, 2015 at 12:57 PM, robert  wrote:

> Hello, three questions:
>
> 1) How to make list of all wiki's users
> (http://localhost:8080/xwiki/bin/view/Main/UserDirectory) hidden from
> users
> and unregistered users? By removing "view" rights I made whole "Main" wiki
> unavailable and that is not what I wanted.  So I simply deleted
> "UserDirectory" page. I am not sure whether it was correct approach.
>

Make sure you understand the difference between page-level rights,
space-level rights and wiki-level rights. In this case you only need to
edit the page rights of the Main.UserDirectory document. Just deny the view
right to the XWikiAllGroup and to unregistered users and you should be fine.


>
> 2) How to make user profile page available only for particular user? Right
> now these profile pages are available for every one who knows the link
> (i.e., http://localhost:8080/xwiki/bin/view/XWiki/).
>

You could edit the space-level rights of the "XWiki" space and deny the
"view" right to the XWikiAllGroup (that is, to registered users) and to
Unregistered Users. This would allow users to only see their own profile
and not that of other users. However, the side-effect of this is that UIs
where users are displayed (user avatar + user name) will not look right
because the current user is not allowed to see other profiles than his own,
the result will be that you can see the another user's ID but not his first
name and last name, neither his avatar... so the user experience will not
be very nice. The reason is that the code displaying users is using the
current user's privileges to retrieve the information it is about to show
(first name, last name and avatar) and, if the current user does not have
the right privileges, what the code will display will be just some very
basic stuff.


>
> 3) How to make user profile pages only read only (if possible then only
> admins can edit)? We have integration with LDAP so it makes no sense to
> edit
> profile info. Also it is not nice that regular user can set "Display hidden
> documents" to "True".
>

This is a bit more complicated because a user has explicitly added a
page-level right on his profile page to make sure that he is able to edit
it, even if the space-level or wiki-level rights setup deny him to. There
are other XWiki features that require the user to be able to set some
preferences to his profile page, so it`s not generally a good idea to try
to prevent that through rights. Your solution of modifying the sheet should
be good enough for the general case, but a user could still use a script to
change his profile data programatically.

Hope this helps,
Eduard


> Thanks!
>
>
>
> --
> View this message in context:
> http://xwiki.475771.n2.nabble.com/User-list-and-user-profile-access-rights-tp7594977.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
>
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Get parts of a page...

2015-06-08 Thread Thomas Mortagne
On Mon, Jun 8, 2015 at 11:11 AM, Gerritjan Koekkoek
 wrote:
> From: users  on behalf of Thomas Mortagne 
> 
> Sent: 08 June 2015 11:00
> To: XWiki Users
> Subject: Re: [xwiki-users] Get parts of a page...
>
> On Mon, Jun 8, 2015 at 10:52 AM, Gerritjan Koekkoek
>  wrote:
>> From: users  on behalf of Thomas Mortagne 
>> 
>> Sent: 08 June 2015 10:46
>> To: XWiki Users
>> Subject: Re: [xwiki-users] Get parts of a page...
>>
>> On Mon, Jun 8, 2015 at 10:28 AM, Gerritjan Koekkoek
>>  wrote:
>>> Hi,
>>>
>>> this indeed looks very useful...
>>> We run XWiki version 6.4
>
> Is this functionality very costly from a performance perspective?
> The loop i'm running will give me approx 25 pages
> Now I have added the loop through all the Headerblocks and the server crashed 
> (503 service not available)
> Now retrying and the page load is very slow: Wating for many minutes now?

Loading 25 pages is slow whatever you do with them, then they are in
cache and it should be OK. I don't see how reading a XDOM could cause
a crash, you should look at the log and see what this 503 really mean.

>
>>> 
>>> From: users  on behalf of Thomas Mortagne 
>>> 
>>> Sent: 08 June 2015 10:17
>>> To: XWiki Users
>>> Subject: Re: [xwiki-users] Get parts of a page...
>>>
>>> In your macro you could get the document and then use something like
>>> what is described in
>>> http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki61RC1#HAccesstoBlockMatchersfromvelocityscripts
>>> to extract the GroupBlock you want (i.e. the one with a parameter
>>> "class" equals to "lead" from what I understood).
>>>
>>> My script is:
>>> #foreach($topicDefenitionDoc in $topicDefenitionDocs)
>>>   #set($topicDefenitionDocument=$xwiki.getDocument($topicDefenitionDoc))
>>>   
>>> #set($topicDefenitionObject=$topicDefenitionDocument.getObject($classDefenitionName))
>>>   == 
>>> $topicDefenitionDocument.display('topicTitle','view',$topicDefenitionObject)
>>>  ==
>>>   $topicDefenitionDocument.getXDOM().getBlocks("class:lead", 
>>> "DESCENDANT")
>> I understand above line should be changed in:
>> #foreach($headerBlock in 
>> $topicDefenitionDocument.getXDOM().getBlocks("class:HeaderBlock", 
>> "DESCENDANT"))
>>   But how do is then inspect if the block has the 'class="lead" ?
>
> Note that HeaderBlock is for headers and what you have in your example
> in your first mail is a GroupBlock.
>
> Now for the parameters I talked about see
> http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/rendering/xwiki-rendering-api/6.4.4/xwiki-rendering-api-6.4.4-javadoc.jar/!/org/xwiki/rendering/block/Block.html#getParameter%28java.lang.String%29
>
> When you have the block you can as for the value of "class" parameter
> using $headerBlock.getParameter('class')
>
>>   ...
>> #end
>>> #end
>>>
>>> But the output I get is:
>>> == Behavior ==
>>> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
>>> == Early Intervention / Education ==
>>> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
>>>
>>> ...
>>> What am I missing?
>>
>> the "class" in $topicDefenitionDocument.getXDOM().getBlocks("class:lead",
>> "DESCENDANT") has nothing to do with css. This is the Java class of
>> the block you want to find so you are supposed to put GroupBlock there
>> as I suggested and then select the one in the list having the
>> parameter "class" equals to "lead".
>>
>>> I also tried:
>>> $topicDefenitionDocument..getDocument().getXDOM().getBlocks("class:lead", 
>>> "DESCENDANT")
>>> Same result, as if methods/functions are not available?
>>>
>>> On Mon, Jun 8, 2015 at 9:31 AM, Gerritjan Koekkoek
>>>  wrote:
 I know wiki has a nice macro to select a part of a page based on headers.

 But headers can be changed and when you translate the page the page 
 holding the macro wil have a ugly error.


 {{include reference="DocumentToInclude" section="HMySection"}}


 How could I do it based on the following wiki syntax:


 (%class="lead")(((

 Text to be included

 )))

 Text to be excluded


 'Text to be included' and 'text to be excluded' can have any wiki-markup


 I would like to create a macro that would look like

 {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="true"}}


 I could get the whole page by

 {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false"}}


 I could get only 'Text to be excluded' by

 {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false" 
 onlyRestText="true"}}

 Any suggestion is welcome
 Note that the used Class is a bootstrap class that will add markup to the 
 section that will show it as a INTRO text...


 Gerritjan Koekkoek
 Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
 Visit our w

Re: [xwiki-users] Get parts of a page...

2015-06-08 Thread Gerritjan Koekkoek
From: users  on behalf of Thomas Mortagne 

Sent: 08 June 2015 11:00
To: XWiki Users
Subject: Re: [xwiki-users] Get parts of a page...

On Mon, Jun 8, 2015 at 10:52 AM, Gerritjan Koekkoek
 wrote:
> From: users  on behalf of Thomas Mortagne 
> 
> Sent: 08 June 2015 10:46
> To: XWiki Users
> Subject: Re: [xwiki-users] Get parts of a page...
>
> On Mon, Jun 8, 2015 at 10:28 AM, Gerritjan Koekkoek
>  wrote:
>> Hi,
>>
>> this indeed looks very useful...
>> We run XWiki version 6.4

Is this functionality very costly from a performance perspective?
The loop i'm running will give me approx 25 pages
Now I have added the loop through all the Headerblocks and the server crashed 
(503 service not available)
Now retrying and the page load is very slow: Wating for many minutes now?

>> 
>> From: users  on behalf of Thomas Mortagne 
>> 
>> Sent: 08 June 2015 10:17
>> To: XWiki Users
>> Subject: Re: [xwiki-users] Get parts of a page...
>>
>> In your macro you could get the document and then use something like
>> what is described in
>> http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki61RC1#HAccesstoBlockMatchersfromvelocityscripts
>> to extract the GroupBlock you want (i.e. the one with a parameter
>> "class" equals to "lead" from what I understood).
>>
>> My script is:
>> #foreach($topicDefenitionDoc in $topicDefenitionDocs)
>>   #set($topicDefenitionDocument=$xwiki.getDocument($topicDefenitionDoc))
>>   
>> #set($topicDefenitionObject=$topicDefenitionDocument.getObject($classDefenitionName))
>>   == 
>> $topicDefenitionDocument.display('topicTitle','view',$topicDefenitionObject) 
>> ==
>>   $topicDefenitionDocument.getXDOM().getBlocks("class:lead", 
>> "DESCENDANT")
> I understand above line should be changed in:
> #foreach($headerBlock in 
> $topicDefenitionDocument.getXDOM().getBlocks("class:HeaderBlock", 
> "DESCENDANT"))
>   But how do is then inspect if the block has the 'class="lead" ?

Note that HeaderBlock is for headers and what you have in your example
in your first mail is a GroupBlock.

Now for the parameters I talked about see
http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/rendering/xwiki-rendering-api/6.4.4/xwiki-rendering-api-6.4.4-javadoc.jar/!/org/xwiki/rendering/block/Block.html#getParameter%28java.lang.String%29

When you have the block you can as for the value of "class" parameter
using $headerBlock.getParameter('class')

>   ...
> #end
>> #end
>>
>> But the output I get is:
>> == Behavior ==
>> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
>> == Early Intervention / Education ==
>> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
>>
>> ...
>> What am I missing?
>
> the "class" in $topicDefenitionDocument.getXDOM().getBlocks("class:lead",
> "DESCENDANT") has nothing to do with css. This is the Java class of
> the block you want to find so you are supposed to put GroupBlock there
> as I suggested and then select the one in the list having the
> parameter "class" equals to "lead".
>
>> I also tried:
>> $topicDefenitionDocument..getDocument().getXDOM().getBlocks("class:lead", 
>> "DESCENDANT")
>> Same result, as if methods/functions are not available?
>>
>> On Mon, Jun 8, 2015 at 9:31 AM, Gerritjan Koekkoek
>>  wrote:
>>> I know wiki has a nice macro to select a part of a page based on headers.
>>>
>>> But headers can be changed and when you translate the page the page holding 
>>> the macro wil have a ugly error.
>>>
>>>
>>> {{include reference="DocumentToInclude" section="HMySection"}}
>>>
>>>
>>> How could I do it based on the following wiki syntax:
>>>
>>>
>>> (%class="lead")(((
>>>
>>> Text to be included
>>>
>>> )))
>>>
>>> Text to be excluded
>>>
>>>
>>> 'Text to be included' and 'text to be excluded' can have any wiki-markup
>>>
>>>
>>> I would like to create a macro that would look like
>>>
>>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="true"}}
>>>
>>>
>>> I could get the whole page by
>>>
>>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false"}}
>>>
>>>
>>> I could get only 'Text to be excluded' by
>>>
>>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false" 
>>> onlyRestText="true"}}
>>>
>>> Any suggestion is welcome
>>> Note that the used Class is a bootstrap class that will add markup to the 
>>> section that will show it as a INTRO text...
>>>
>>>
>>> Gerritjan Koekkoek
>>> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
>>> Visit our website
>>> Facebook
>>> email
>>>
>>>
>>>
>>> ___
>>> 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/u

Re: [xwiki-users] Get parts of a page...

2015-06-08 Thread Thomas Mortagne
On Mon, Jun 8, 2015 at 10:52 AM, Gerritjan Koekkoek
 wrote:
> From: users  on behalf of Thomas Mortagne 
> 
> Sent: 08 June 2015 10:46
> To: XWiki Users
> Subject: Re: [xwiki-users] Get parts of a page...
>
> On Mon, Jun 8, 2015 at 10:28 AM, Gerritjan Koekkoek
>  wrote:
>> Hi,
>>
>> this indeed looks very useful...
>> We run XWiki version 6.4
>> 
>> From: users  on behalf of Thomas Mortagne 
>> 
>> Sent: 08 June 2015 10:17
>> To: XWiki Users
>> Subject: Re: [xwiki-users] Get parts of a page...
>>
>> In your macro you could get the document and then use something like
>> what is described in
>> http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki61RC1#HAccesstoBlockMatchersfromvelocityscripts
>> to extract the GroupBlock you want (i.e. the one with a parameter
>> "class" equals to "lead" from what I understood).
>>
>> My script is:
>> #foreach($topicDefenitionDoc in $topicDefenitionDocs)
>>   #set($topicDefenitionDocument=$xwiki.getDocument($topicDefenitionDoc))
>>   
>> #set($topicDefenitionObject=$topicDefenitionDocument.getObject($classDefenitionName))
>>   == 
>> $topicDefenitionDocument.display('topicTitle','view',$topicDefenitionObject) 
>> ==
>>   $topicDefenitionDocument.getXDOM().getBlocks("class:lead", 
>> "DESCENDANT")
> I understand above line should be changed in:
> #foreach($headerBlock in 
> $topicDefenitionDocument.getXDOM().getBlocks("class:HeaderBlock", 
> "DESCENDANT"))
>   But how do is then inspect if the block has the 'class="lead" ?

Note that HeaderBlock is for headers and what you have in your example
in your first mail is a GroupBlock.

Now for the parameters I talked about see
http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/rendering/xwiki-rendering-api/6.4.4/xwiki-rendering-api-6.4.4-javadoc.jar/!/org/xwiki/rendering/block/Block.html#getParameter%28java.lang.String%29

When you have the block you can as for the value of "class" parameter
using $headerBlock.getParameter('class')

>   ...
> #end
>> #end
>>
>> But the output I get is:
>> == Behavior ==
>> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
>> == Early Intervention / Education ==
>> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
>>
>> ...
>> What am I missing?
>
> the "class" in $topicDefenitionDocument.getXDOM().getBlocks("class:lead",
> "DESCENDANT") has nothing to do with css. This is the Java class of
> the block you want to find so you are supposed to put GroupBlock there
> as I suggested and then select the one in the list having the
> parameter "class" equals to "lead".
>
>> I also tried:
>> $topicDefenitionDocument..getDocument().getXDOM().getBlocks("class:lead", 
>> "DESCENDANT")
>> Same result, as if methods/functions are not available?
>>
>> On Mon, Jun 8, 2015 at 9:31 AM, Gerritjan Koekkoek
>>  wrote:
>>> I know wiki has a nice macro to select a part of a page based on headers.
>>>
>>> But headers can be changed and when you translate the page the page holding 
>>> the macro wil have a ugly error.
>>>
>>>
>>> {{include reference="DocumentToInclude" section="HMySection"}}
>>>
>>>
>>> How could I do it based on the following wiki syntax:
>>>
>>>
>>> (%class="lead")(((
>>>
>>> Text to be included
>>>
>>> )))
>>>
>>> Text to be excluded
>>>
>>>
>>> 'Text to be included' and 'text to be excluded' can have any wiki-markup
>>>
>>>
>>> I would like to create a macro that would look like
>>>
>>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="true"}}
>>>
>>>
>>> I could get the whole page by
>>>
>>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false"}}
>>>
>>>
>>> I could get only 'Text to be excluded' by
>>>
>>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false" 
>>> onlyRestText="true"}}
>>>
>>> Any suggestion is welcome
>>> Note that the used Class is a bootstrap class that will add markup to the 
>>> section that will show it as a INTRO text...
>>>
>>>
>>> Gerritjan Koekkoek
>>> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
>>> Visit our website
>>> Facebook
>>> email
>>>
>>>
>>>
>>> ___
>>> 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
>
>
>
> --
> 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/l

Re: [xwiki-users] Get parts of a page...

2015-06-08 Thread Gerritjan Koekkoek
From: users  on behalf of Thomas Mortagne 

Sent: 08 June 2015 10:46
To: XWiki Users
Subject: Re: [xwiki-users] Get parts of a page...

On Mon, Jun 8, 2015 at 10:28 AM, Gerritjan Koekkoek
 wrote:
> Hi,
>
> this indeed looks very useful...
> We run XWiki version 6.4
> 
> From: users  on behalf of Thomas Mortagne 
> 
> Sent: 08 June 2015 10:17
> To: XWiki Users
> Subject: Re: [xwiki-users] Get parts of a page...
>
> In your macro you could get the document and then use something like
> what is described in
> http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki61RC1#HAccesstoBlockMatchersfromvelocityscripts
> to extract the GroupBlock you want (i.e. the one with a parameter
> "class" equals to "lead" from what I understood).
>
> My script is:
> #foreach($topicDefenitionDoc in $topicDefenitionDocs)
>   #set($topicDefenitionDocument=$xwiki.getDocument($topicDefenitionDoc))
>   
> #set($topicDefenitionObject=$topicDefenitionDocument.getObject($classDefenitionName))
>   == 
> $topicDefenitionDocument.display('topicTitle','view',$topicDefenitionObject) 
> ==
>   $topicDefenitionDocument.getXDOM().getBlocks("class:lead", 
> "DESCENDANT") 
I understand above line should be changed in:
#foreach($headerBlock in 
$topicDefenitionDocument.getXDOM().getBlocks("class:HeaderBlock", "DESCENDANT"))
  But how do is then inspect if the block has the 'class="lead" ?
  ...
#end
> #end
>
> But the output I get is:
> == Behavior ==
> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
> == Early Intervention / Education ==
> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
>
> ...
> What am I missing?

the "class" in $topicDefenitionDocument.getXDOM().getBlocks("class:lead",
"DESCENDANT") has nothing to do with css. This is the Java class of
the block you want to find so you are supposed to put GroupBlock there
as I suggested and then select the one in the list having the
parameter "class" equals to "lead".

> I also tried:
> $topicDefenitionDocument..getDocument().getXDOM().getBlocks("class:lead", 
> "DESCENDANT")
> Same result, as if methods/functions are not available?
>
> On Mon, Jun 8, 2015 at 9:31 AM, Gerritjan Koekkoek
>  wrote:
>> I know wiki has a nice macro to select a part of a page based on headers.
>>
>> But headers can be changed and when you translate the page the page holding 
>> the macro wil have a ugly error.
>>
>>
>> {{include reference="DocumentToInclude" section="HMySection"}}
>>
>>
>> How could I do it based on the following wiki syntax:
>>
>>
>> (%class="lead")(((
>>
>> Text to be included
>>
>> )))
>>
>> Text to be excluded
>>
>>
>> 'Text to be included' and 'text to be excluded' can have any wiki-markup
>>
>>
>> I would like to create a macro that would look like
>>
>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="true"}}
>>
>>
>> I could get the whole page by
>>
>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false"}}
>>
>>
>> I could get only 'Text to be excluded' by
>>
>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false" 
>> onlyRestText="true"}}
>>
>> Any suggestion is welcome
>> Note that the used Class is a bootstrap class that will add markup to the 
>> section that will show it as a INTRO text...
>>
>>
>> Gerritjan Koekkoek
>> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
>> Visit our website
>> Facebook
>> email
>>
>>
>>
>> ___
>> 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



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


Re: [xwiki-users] Get parts of a page...

2015-06-08 Thread Thomas Mortagne
On Mon, Jun 8, 2015 at 10:28 AM, Gerritjan Koekkoek
 wrote:
> Hi,
>
> this indeed looks very useful...
> We run XWiki version 6.4
> 
> From: users  on behalf of Thomas Mortagne 
> 
> Sent: 08 June 2015 10:17
> To: XWiki Users
> Subject: Re: [xwiki-users] Get parts of a page...
>
> In your macro you could get the document and then use something like
> what is described in
> http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki61RC1#HAccesstoBlockMatchersfromvelocityscripts
> to extract the GroupBlock you want (i.e. the one with a parameter
> "class" equals to "lead" from what I understood).
>
> My script is:
> #foreach($topicDefenitionDoc in $topicDefenitionDocs)
>   #set($topicDefenitionDocument=$xwiki.getDocument($topicDefenitionDoc))
>   
> #set($topicDefenitionObject=$topicDefenitionDocument.getObject($classDefenitionName))
>   == 
> $topicDefenitionDocument.display('topicTitle','view',$topicDefenitionObject) 
> ==
>   $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
> #end
>
> But the output I get is:
> == Behavior ==
> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
> == Early Intervention / Education ==
> $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
>
> ...
> What am I missing?

the "class" in $topicDefenitionDocument.getXDOM().getBlocks("class:lead",
"DESCENDANT") has nothing to do with css. This is the Java class of
the block you want to find so you are supposed to put GroupBlock there
as I suggested and then select the one in the list having the
parameter "class" equals to "lead".

> I also tried:
> $topicDefenitionDocument..getDocument().getXDOM().getBlocks("class:lead", 
> "DESCENDANT")
> Same result, as if methods/functions are not available?
>
> On Mon, Jun 8, 2015 at 9:31 AM, Gerritjan Koekkoek
>  wrote:
>> I know wiki has a nice macro to select a part of a page based on headers.
>>
>> But headers can be changed and when you translate the page the page holding 
>> the macro wil have a ugly error.
>>
>>
>> {{include reference="DocumentToInclude" section="HMySection"}}
>>
>>
>> How could I do it based on the following wiki syntax:
>>
>>
>> (%class="lead")(((
>>
>> Text to be included
>>
>> )))
>>
>> Text to be excluded
>>
>>
>> 'Text to be included' and 'text to be excluded' can have any wiki-markup
>>
>>
>> I would like to create a macro that would look like
>>
>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="true"}}
>>
>>
>> I could get the whole page by
>>
>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false"}}
>>
>>
>> I could get only 'Text to be excluded' by
>>
>> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false" 
>> onlyRestText="true"}}
>>
>> Any suggestion is welcome
>> Note that the used Class is a bootstrap class that will add markup to the 
>> section that will show it as a INTRO text...
>>
>>
>> Gerritjan Koekkoek
>> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
>> Visit our website
>> Facebook
>> email
>>
>>
>>
>> ___
>> 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



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


Re: [xwiki-users] Get parts of a page...

2015-06-08 Thread Gerritjan Koekkoek
Hi, 

this indeed looks very useful...
We run XWiki version 6.4 

From: users  on behalf of Thomas Mortagne 

Sent: 08 June 2015 10:17
To: XWiki Users
Subject: Re: [xwiki-users] Get parts of a page...

In your macro you could get the document and then use something like
what is described in
http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki61RC1#HAccesstoBlockMatchersfromvelocityscripts
to extract the GroupBlock you want (i.e. the one with a parameter
"class" equals to "lead" from what I understood).

My script is:
#foreach($topicDefenitionDoc in $topicDefenitionDocs)
  #set($topicDefenitionDocument=$xwiki.getDocument($topicDefenitionDoc))
  
#set($topicDefenitionObject=$topicDefenitionDocument.getObject($classDefenitionName))
  == 
$topicDefenitionDocument.display('topicTitle','view',$topicDefenitionObject) ==
  $topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
#end

But the output I get is:
== Behavior ==
$topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")
== Early Intervention / Education ==
$topicDefenitionDocument.getXDOM().getBlocks("class:lead", "DESCENDANT")

...
What am I missing? I also tried:
$topicDefenitionDocument..getDocument().getXDOM().getBlocks("class:lead", 
"DESCENDANT")
Same result, as if methods/functions are not available?

On Mon, Jun 8, 2015 at 9:31 AM, Gerritjan Koekkoek
 wrote:
> I know wiki has a nice macro to select a part of a page based on headers.
>
> But headers can be changed and when you translate the page the page holding 
> the macro wil have a ugly error.
>
>
> {{include reference="DocumentToInclude" section="HMySection"}}
>
>
> How could I do it based on the following wiki syntax:
>
>
> (%class="lead")(((
>
> Text to be included
>
> )))
>
> Text to be excluded
>
>
> 'Text to be included' and 'text to be excluded' can have any wiki-markup
>
>
> I would like to create a macro that would look like
>
> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="true"}}
>
>
> I could get the whole page by
>
> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false"}}
>
>
> I could get only 'Text to be excluded' by
>
> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false" 
> onlyRestText="true"}}
>
> Any suggestion is welcome
> Note that the used Class is a bootstrap class that will add markup to the 
> section that will show it as a INTRO text...
>
>
> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website
> Facebook
> email
>
>
>
> ___
> 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


Re: [xwiki-users] Get parts of a page...

2015-06-08 Thread Thomas Mortagne
In your macro you could get the document and then use something like
what is described in
http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki61RC1#HAccesstoBlockMatchersfromvelocityscripts
to extract the GroupBlock you want (i.e. the one with a parameter
"class" equals to "lead" from what I understood).

On Mon, Jun 8, 2015 at 9:31 AM, Gerritjan Koekkoek
 wrote:
> I know wiki has a nice macro to select a part of a page based on headers.
>
> But headers can be changed and when you translate the page the page holding 
> the macro wil have a ugly error.
>
>
> {{include reference="DocumentToInclude" section="HMySection"}}
>
>
> How could I do it based on the following wiki syntax:
>
>
> (%class="lead")(((
>
> Text to be included
>
> )))
>
> Text to be excluded
>
>
> 'Text to be included' and 'text to be excluded' can have any wiki-markup
>
>
> I would like to create a macro that would look like
>
> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="true"}}
>
>
> I could get the whole page by
>
> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false"}}
>
>
> I could get only 'Text to be excluded' by
>
> {{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false" 
> onlyRestText="true"}}
>
> Any suggestion is welcome
> Note that the used Class is a bootstrap class that will add markup to the 
> section that will show it as a INTRO text...
>
>
> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website
> Facebook
> email
>
>
>
> ___
> 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] Get parts of a page...

2015-06-08 Thread Gerritjan Koekkoek
I know wiki has a nice macro to select a part of a page based on headers.

But headers can be changed and when you translate the page the page holding the 
macro wil have a ugly error.


{{include reference="DocumentToInclude" section="HMySection"}}


How could I do it based on the following wiki syntax:


(%class="lead")(((

Text to be included

)))

Text to be excluded


'Text to be included' and 'text to be excluded' can have any wiki-markup


I would like to create a macro that would look like

{{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="true"}}


I could get the whole page by

{{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false"}}


I could get only 'Text to be excluded' by

{{myGetSectionMacro reference="DocumentToInclude" onlyLeadText="false" 
onlyRestText="true"}}

Any suggestion is welcome
Note that the used Class is a bootstrap class that will add markup to the 
section that will show it as a INTRO text...


Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website
Facebook
email



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