2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog

PascalB
Hello,
On my space Webhome I have 2 lists with the same sort (modification date):

{{spaceindex space="$doc.space" sort="modificationDate"/}}

and

{{activity spaces="$!aSpace" rss=true /}}

I edited one doc with minorEdit and I obtain 3 differents sort.

I can understand why spaceindex sort is different than "activity spaces" but why "activity spaces" sort is different than Main.WebRss?)


Here some screenshots:
http://snag.gy/l6iQt.jpg
http://snag.gy/JwMVu.jpg


NB: I modified BlocCode to display 5 first lines of content blog post on Blog.WebHome if the blog post have an empty summary, do you interested?

Thxs

Pascal B
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: 2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog

vmassol
Administrator


On 6 Oct 2014 at 16:40:26, Pascal BASTIEN ([hidden email](mailto:[hidden email])) wrote:

> Hello,
> On my space Webhome I have 2 lists with the same sort (modification date):
>  
> {{spaceindex space="$doc.space" sort="modificationDate"/}}
>  
> and
>  
> {{activity spaces="$!aSpace" rss=true /}}
>  
> I edited one doc with minorEdit and I obtain 3 differents sort.
>  
> I can understand why spaceindex sort is different than "activity spaces" but why "activity spaces" sort is different than Main.WebRss?)
>  
>  
> Here some screenshots:
> http://snag.gy/l6iQt.jpg
> http://snag.gy/JwMVu.jpg
>  
>  
> NB: I modified BlocCode to display 5 first lines of content blog post on Blog.WebHome if the blog post have an empty summary, do you interested?

We used to have this and removed it since it causes too many problems. How can you ensure you’re cutting at some place that doesn’t cause a problem when rendered?

Thanks
-Vincent

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: 2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog

PascalB
I cut at end of line (and remove empty line)

I replaced your piece of comment "#* Disabled until the content can be cleanly cut." in #macro(getEntryContent  of  Blog.BlogCode doc
by this one

    #if($onlyExtract)
     #set($result = '')
     #set($resultArray = $entryObj.getProperty('content').value.split('\s*\n\s*',10))
     #foreach ($value in $resultArray)
     #if( $velocityCount > 5 )
       #break
     #end
   #set($result = "$result
$value")
 #end
   #set($result = "${result} [[...>>${entryDoc}||title='$services.localization.render('xe.blog.code.readpost')']]")
#end





________________________________
 De : "[hidden email]" <[hidden email]>
À : XWiki Users <[hidden email]>
Envoyé le : Lundi 6 octobre 2014 17h16
Objet : Re: [xwiki-users] 2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog
 



On 6 Oct 2014 at 16:40:26, Pascal BASTIEN ([hidden email](mailto:[hidden email])) wrote:

> Hello,
> On my space Webhome I have 2 lists with the same sort (modification date):
>  
> {{spaceindex space="$doc.space" sort="modificationDate"/}}
>  
> and
>  
> {{activity spaces="$!aSpace" rss=true /}}
>  
> I edited one doc with minorEdit and I obtain 3 differents sort.
>  
> I can understand why spaceindex sort is different than "activity spaces" but why "activity spaces" sort is different than Main.WebRss?)
>  
>  
> Here some screenshots:
> http://snag.gy/l6iQt.jpg
> http://snag.gy/JwMVu.jpg
>  
>  
> NB: I modified BlocCode to display 5 first lines of content blog post on Blog.WebHome if the blog post have an empty summary, do you interested?

We used to have this and removed it since it causes too many problems. How can you ensure you’re cutting at some place that doesn’t cause a problem when rendered?

Thanks
-Vincent


_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: 2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog

jerem
Hi,

Problem is if blog content contains more than plain text (ie, html macros,
groovy macros, multiple columns, etc ...), cutting 5 first lines may
generate content impossible to render. Also, nothing says that cutting 5
lines would generate 5 lines in rendered text.
I had the same issue but in my case the "cut" content was pure HTML, and
was displayed in the scope of an iframe, so at least it would not break the
rest of the page or generate exceptions. But it's a heavy solution for
blogs IMHO.
I suppose there are multiple ways to cut a part of this content in a clean
and generic way, but it doesn't seem very easy.
That being said, I suppose your code works most of the times if your blog
posts are mainly plain text or limited to very basic wiki syntax.

BR,
Jeremie


2014-10-06 17:37 GMT+02:00 Pascal BASTIEN <[hidden email]>:

> I cut at end of line (and remove empty line)
>
> I replaced your piece of comment "#* Disabled until the content can be
> cleanly cut." in #macro(getEntryContent  of  Blog.BlogCode doc
> by this one
>
>     #if($onlyExtract)
>      #set($result = '')
>      #set($resultArray =
> $entryObj.getProperty('content').value.split('\s*\n\s*',10))
>      #foreach ($value in $resultArray)
>      #if( $velocityCount > 5 )
>        #break
>      #end
>    #set($result = "$result
> $value")
>  #end
>    #set($result = "${result}
> [[...>>${entryDoc}||title='$services.localization.render('xe.blog.code.readpost')']]")
> #end
>
>
>
>
>
> ________________________________
>  De : "[hidden email]" <[hidden email]>
> À : XWiki Users <[hidden email]>
> Envoyé le : Lundi 6 octobre 2014 17h16
> Objet : Re: [xwiki-users] 2 lists = 3 differents sorts on xwiki 6.2.1 and
> improve blog
>
>
>
>
> On 6 Oct 2014 at 16:40:26, Pascal BASTIEN ([hidden email](mailto:
> [hidden email])) wrote:
>
> > Hello,
> > On my space Webhome I have 2 lists with the same sort (modification
> date):
> >
> > {{spaceindex space="$doc.space" sort="modificationDate"/}}
> >
> > and
> >
> > {{activity spaces="$!aSpace" rss=true /}}
> >
> > I edited one doc with minorEdit and I obtain 3 differents sort.
> >
> > I can understand why spaceindex sort is different than "activity spaces"
> but why "activity spaces" sort is different than Main.WebRss?)
> >
> >
> > Here some screenshots:
> > http://snag.gy/l6iQt.jpg
> > http://snag.gy/JwMVu.jpg
> >
> >
> > NB: I modified BlocCode to display 5 first lines of content blog post on
> Blog.WebHome if the blog post have an empty summary, do you interested?
>
> We used to have this and removed it since it causes too many problems. How
> can you ensure you’re cutting at some place that doesn’t cause a problem
> when rendered?
>
> Thanks
> -Vincent
>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: 2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog

jerem
(Note that a not-so-complex solution could be to first render blog post
content in plain text, and cut the result to display a summary...)

2014-10-06 18:18 GMT+02:00 Jeremie BOUSQUET <[hidden email]>:

> Hi,
>
> Problem is if blog content contains more than plain text (ie, html macros,
> groovy macros, multiple columns, etc ...), cutting 5 first lines may
> generate content impossible to render. Also, nothing says that cutting 5
> lines would generate 5 lines in rendered text.
> I had the same issue but in my case the "cut" content was pure HTML, and
> was displayed in the scope of an iframe, so at least it would not break the
> rest of the page or generate exceptions. But it's a heavy solution for
> blogs IMHO.
> I suppose there are multiple ways to cut a part of this content in a clean
> and generic way, but it doesn't seem very easy.
> That being said, I suppose your code works most of the times if your blog
> posts are mainly plain text or limited to very basic wiki syntax.
>
> BR,
> Jeremie
>
>
> 2014-10-06 17:37 GMT+02:00 Pascal BASTIEN <[hidden email]>:
>
>> I cut at end of line (and remove empty line)
>>
>> I replaced your piece of comment "#* Disabled until the content can be
>> cleanly cut." in #macro(getEntryContent  of  Blog.BlogCode doc
>> by this one
>>
>>     #if($onlyExtract)
>>      #set($result = '')
>>      #set($resultArray =
>> $entryObj.getProperty('content').value.split('\s*\n\s*',10))
>>      #foreach ($value in $resultArray)
>>      #if( $velocityCount > 5 )
>>        #break
>>      #end
>>    #set($result = "$result
>> $value")
>>  #end
>>    #set($result = "${result}
>> [[...>>${entryDoc}||title='$services.localization.render('xe.blog.code.readpost')']]")
>> #end
>>
>>
>>
>>
>>
>> ________________________________
>>  De : "[hidden email]" <[hidden email]>
>> À : XWiki Users <[hidden email]>
>> Envoyé le : Lundi 6 octobre 2014 17h16
>> Objet : Re: [xwiki-users] 2 lists = 3 differents sorts on xwiki 6.2.1 and
>> improve blog
>>
>>
>>
>>
>> On 6 Oct 2014 at 16:40:26, Pascal BASTIEN ([hidden email]
>> (mailto:[hidden email])) wrote:
>>
>> > Hello,
>> > On my space Webhome I have 2 lists with the same sort (modification
>> date):
>> >
>> > {{spaceindex space="$doc.space" sort="modificationDate"/}}
>> >
>> > and
>> >
>> > {{activity spaces="$!aSpace" rss=true /}}
>> >
>> > I edited one doc with minorEdit and I obtain 3 differents sort.
>> >
>> > I can understand why spaceindex sort is different than "activity
>> spaces" but why "activity spaces" sort is different than Main.WebRss?)
>> >
>> >
>> > Here some screenshots:
>> > http://snag.gy/l6iQt.jpg
>> > http://snag.gy/JwMVu.jpg
>> >
>> >
>> > NB: I modified BlocCode to display 5 first lines of content blog post
>> on Blog.WebHome if the blog post have an empty summary, do you interested?
>>
>> We used to have this and removed it since it causes too many problems.
>> How can you ensure you’re cutting at some place that doesn’t cause a
>> problem when rendered?
>>
>> Thanks
>> -Vincent
>>
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>>
>
>
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: 2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog

Clemens Klein-Robbenhaar
In reply to this post by PascalB
On 10/06/2014 04:39 PM, Pascal BASTIEN wrote:
> I can understand why spaceindex sort is different than "activity spaces" but why "activity spaces" sort is different than Main.WebRss?)

The reason is that the activity stream does not contain "minor edits" as events, while the RSS feed just evaluates a HQL-Query fetching pages by last modification time, no matter if the last modification was a minor one or not.

I see this might cause confusion but on the other hand I am not sure if there is a good way to fix this.
After all the activity stream (which might contains other activities, i.e. user messages) and the "recently modified documents" list (which should contain only documents, and every document at most once) are somewhat differeent things.

Cheers,
Clemens
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ... on xwiki 6.2.1 and improve blog

PascalB
In reply to this post by jerem
Yes you are right: my code doesn't work if macro inserted in the blog post :-/
And yes, to work well in all case I must get html rendering of the post. I don't know if I will investigate in this way (I have another priority on Xwiki)


Thxs




________________________________
 De : Jeremie BOUSQUET <[hidden email]>
À : Pascal BASTIEN <[hidden email]>; XWiki Users <[hidden email]>
Envoyé le : Lundi 6 octobre 2014 18h18
Objet : Re: [xwiki-users] 2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog
 


Hi,

Problem is if blog content contains more than plain text (ie, html macros, groovy macros, multiple columns, etc ...), cutting 5 first lines may generate content impossible to render. Also, nothing says that cutting 5 lines would generate 5 lines in rendered text.
I had the same issue but in my case the "cut" content was pure HTML, and was displayed in the scope of an iframe, so at least it would not break the rest of the page or generate exceptions. But it's a heavy solution for blogs IMHO.

I suppose there are multiple ways to cut a part of this content in a clean and generic way, but it doesn't seem very easy.

That being said, I suppose your code works most of the times if your blog posts are mainly plain text or limited to very basic wiki syntax.

BR,
Jeremie




2014-10-06 17:37 GMT+02:00 Pascal BASTIEN <[hidden email]>:

I cut at end of line (and remove empty line)

>
>I replaced your piece of comment "#* Disabled until the content can be cleanly cut." in #macro(getEntryContent  of  Blog.BlogCode doc
>by this one
>
>    #if($onlyExtract)
>     #set($result = '')
>     #set($resultArray = $entryObj.getProperty('content').value.split('\s*\n\s*',10))
>     #foreach ($value in $resultArray)
>     #if( $velocityCount > 5 )
>       #break
>     #end
>   #set($result = "$result
>$value")
> #end
>   #set($result = "${result} [[...>>${entryDoc}||title='$services.localization.render('xe.blog.code.readpost')']]")
>#end
>
>
>
>
>
>________________________________
> De : "[hidden email]" <[hidden email]>
>À : XWiki Users <[hidden email]>
>Envoyé le : Lundi 6 octobre 2014 17h16
>Objet : Re: [xwiki-users] 2 lists = 3 differents sorts on xwiki 6.2.1 and improve blog
>
>
>
>
>
>On 6 Oct 2014 at 16:40:26, Pascal BASTIEN ([hidden email](mailto:[hidden email])) wrote:
>
>> Hello,
>> On my space Webhome I have 2 lists with the same sort (modification date):
>>
>> {{spaceindex space="$doc.space" sort="modificationDate"/}}
>>
>> and
>>
>> {{activity spaces="$!aSpace" rss=true /}}
>>
>> I edited one doc with minorEdit and I obtain 3 differents sort.
>>
>> I can understand why spaceindex sort is different than "activity spaces" but why "activity spaces" sort is different than Main.WebRss?)
>>
>>
>> Here some screenshots:
>> http://snag.gy/l6iQt.jpg
>> http://snag.gy/JwMVu.jpg
>>
>>
>> NB: I modified BlocCode to display 5 first lines of content blog post on Blog.WebHome if the blog post have an empty summary, do you interested?
>
>We used to have this and removed it since it causes too many problems. How can you ensure you’re cutting at some place that doesn’t cause a problem when rendered?
>
>Thanks
>-Vincent
>
>
>_______________________________________________
>users mailing list
>[hidden email]
>http://lists.xwiki.org/mailman/listinfo/users
>_______________________________________________
>users mailing list
>[hidden email]
>http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users