[xwiki-users] Bulletin Board cannot display topic title and first post !?
I use Bulletin Board application with XE 1.1.2. I import the xar file, I add a new topic, enter title and first post, then make some reply. Every thing is displayed properly (author, post reply,..), except for the topic title and topic first post always be the empty string "", although they are not empty !?
Hi, can you please send a screenshot of your topic page in both view & edit object mode ? Can you also try to edit the page with /xwiki/bin/edit/BulletinBoard/YourTopicPage?editor=object -> on this page check the contents of the TopicClass object -> is something written there ? If you write something, is it then displayed on the page ? Also, did you have to log in at some point in the process ? It might be that an object wasn't properly added at some point in the process. Can you try creating another topic (making sure you're logged in first) and see what happens ? I've checked locally and everything works fine... You need to make sure nothing specific happens between the moment you click on "create this topic" and the moment you see the topic page. Guillaume PS: I've just finished writing the application and this is its first iteration, thanks for your patience & feedback ;-) On 18/02/2008, Ngo Thi Hong Nga <zorro.lp.x@gmail.com> wrote:
I use Bulletin Board application with XE 1.1.2. I import the xar file, I add a new topic, enter title and first post, then make some reply. Every thing is displayed properly (author, post reply,..), except for the topic title and topic first post always be the empty string "", although they are not empty !?
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
The screenshot is here: http://farm3.static.flickr.com/2411/2274127483_df5296912f_o.jpg In the left is view mode and the right is edit mode. I check the contents of the TopicClass object in my topic page, both the properties title and post is empty, when I enter something in these 2 properties, everything is displayed properly. I view the code in BBCode.TopicClassSheet, I don't see any code assign the value for this 2 properties, I don't know the Bulletin_Board.xar I downloaded is the same as yours. #if ($context.action == 'inline' && $doc.isNew() == 'true') $msg.bb_entertopictitle<br /> $doc.display('topictitle') $msg.bb_entertopicpost<br /> $doc.display('topicpost') #set($newtopictitle = $request.topictitle) #if($newtopictitle) #set($newtopictitle = $newtopictitle.replaceAll('"',"'")) <script type="text/javascript"> var topictitle = "${newtopictitle}"; {pre} document.forms.inline["BBCode.TopicClass_0_topictitle"].value = topictitle; {/pre} </script> #end #elseif.. #end
Ok, everything's working fine. Basically, when creating a new topic, the first time you acces the page it offers you the possibility to enter a title and content for the topic's first post. So you have to enter those values manually. Since a post is supposed not to be edited afterwards, when you try to edit the page again it gives you a message saying that you cannot do so. So basically you need to be careful & enter a title and a content for the first post of your new topic each time you create one :-) -> Check the attached image to see what I mean. It's the page an user should be presented with right after creating a new topic. You'll see it if you try to create a new topic. If you forget to do so, you can edit the page object to update it - as you did - but this workaround is better left for advanced users only. Guillaume On 18/02/2008, Ngo Thi Hong Nga <zorro.lp.x@gmail.com> wrote:
The screenshot is here: http://farm3.static.flickr.com/2411/2274127483_df5296912f_o.jpg In the left is view mode and the right is edit mode. I check the contents of the TopicClass object in my topic page, both the properties title and post is empty, when I enter something in these 2 properties, everything is displayed properly. I view the code in BBCode.TopicClassSheet, I don't see any code assign the value for this 2 properties, I don't know the Bulletin_Board.xar I downloaded is the same as yours.
I have already entered a title and the first post for the new topic, then click Save and View and the result is what you see in the left of the screenshot. That's the reason why I post this problem here.
Hi, I tried to reproduce your problem but didn't manage to... Can you provide more information about the steps you're following ? -> is your user logged-in when he creates the topic ? -> has you done anything special with your rights setup ? -> has the page been saved once before you create the topic ? -> what version of XWiki are you using ? -> does it do this with every new topic you create ? -> is there any other code on the page ? -> etc... Basically I need to be able to reproduce your issue locally in order to find a solution :-) Guillaume On 19/02/2008, Ngo Thi Hong Nga <zorro.lp.x@gmail.com> wrote:
I have already entered a title and the first post for the new topic, then click Save and View and the result is what you see in the left of the screenshot. That's the reason why I post this problem here. _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
http://rapidshare.com/files/93105012/XwikiBulletionBoard.avi.html You can download my screen recorder to see what I have done. The category name, category description, topic title and topic first post all empty.
Which Quicktime plugin should I use to watch this video ? Guillaume On 19/02/2008, Ngo Thi Hong Nga <zorro.lp.x@gmail.com> wrote:
http://rapidshare.com/files/93105012/XwikiBulletionBoard.avi.html You can download my screen recorder to see what I have done. The category name, category description, topic title and topic first post all empty.
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
I use Windows Media Player 11 with K-lite Codec Pack to view this avi. You can download K-lite Codec Pack here: http://rapidshare.com/files/93178779/klcodec362f.exe.html ;)
Try using mplayer: http://www1.mplayerhq.hu/MPlayer/releases/MPlayerOSX_1.0rc1.dmg Guillaume Lerouge wrote:
Which Quicktime plugin should I use to watch this video ?
Guillaume
On 19/02/2008, *Ngo Thi Hong Nga* <zorro.lp.x@gmail.com <mailto:zorro.lp.x@gmail.com>> wrote:
http://rapidshare.com/files/93105012/XwikiBulletionBoard.avi.html You can download my screen recorder to see what I have done. The category name, category description, topic title and topic first post all empty.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Doesn't work either... Cannot find the player nor the codecs :-( (I'm on a mac...) I've been looking into the issue but still cannot reproduce it... What version of XWiki did you say you were using ? I'll try to install it again and import the BB from scratch to see how it goes... Guillaume
I use XE 1.1.2
I found the problem: when using IE 7.0.5730.11 the problem occurs, but when using Firefox 2.0.0.12 everything's ok. So strange..
Ok, I found the problem with the help of a handful of helpful people :-) I'll update the XAR in the evening. Thanks for your patience and your help ! Guillaume On 19/02/2008, Ngo Thi Hong Nga <zorro.lp.x@gmail.com> wrote:
I found the problem: when using IE 7.0.5730.11 the problem occurs, but when using Firefox 2.0.0.12 everything's ok. So strange..
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Hi, the problem you encountered has now been corrected. The Bulletin Board application has also been upgraded, adding some administration features as well as the possibility to quote other messages. Full description here : http://code.xwiki.org/xwiki/bin/view/Applications/BulletinBoardApplication I hope you'll have fun using it :-) Guillaume On 19/02/2008, Guillaume Lerouge <guillaume@xwiki.com> wrote:
Ok, I found the problem with the help of a handful of helpful people :-)
I'll update the XAR in the evening. Thanks for your patience and your help !
Guillaume
On 19/02/2008, Ngo Thi Hong Nga <zorro.lp.x@gmail.com> wrote:
I found the problem: when using IE 7.0.5730.11 the problem occurs, but when using Firefox 2.0.0.12 everything's ok. So strange..
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Guillaume Lerouge wrote:
Hi,
the problem you encountered has now been corrected. The Bulletin Board application has also been upgraded, adding some administration features as well as the possibility to quote other messages. Full description here : http://code.xwiki.org/xwiki/bin/view/Applications/BulletinBoardApplication
I hope you'll have fun using it :-)
Guillaume Thank you so much for your work, Guillaume. We have been already enjoying the application.
Just one doubt: it is possible to control the access to the contents of a given category, but the name of the category is still displayed in the "home" Bulletin Board page although no topics are shown. Is there any way of preventing this category to be listed in the Bulletin Board home page for users that have no access to its content? Thanks! Cheers, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
Hi Ricardo, I'm not quite sure about what's the best way to handle this issue at the level of categories. However, please note that using the latest version of the application you can create new bulletin boards, giving each one its own space. This way protecting Topics and categories becomes much easier since you can use XWiki's built-in rights system more effectively. To find out how, download the latest XAR (it may cause a few compatibilities issues with the first one though, you may want to keep a backup the first BB XAR...) and go to the [BBCode.Admin] page -> you'll be able to create as many Bulletin Board as you wish, each in its own space :-) Hope this helps, Guillaume PS: thanks for the nice words :-) Actually I was greatly helped by Jérôme Velociter, Jean-Vincent Drean & Raffaello Pelagalli -> kudos to them three :-) On 21/02/2008, [Ricardo Rodriguez] Your EPEC Network ICT Team < webmaster@environmentalchange.net> wrote:
Guillaume Lerouge wrote:
Hi, the problem you encountered has now been corrected. The Bulletin Board application has also been upgraded, adding some administration features as well as the possibility to quote other messages. Full description here : http://code.xwiki.org/xwiki/bin/view/Applications/BulletinBoardApplication
I hope you'll have fun using it :-)
Guillaume
Thank you so much for your work, Guillaume. We have been already enjoying the application.
Just one doubt: it is possible to control the access to the contents of a given category, but the name of the category is still displayed in the "home" Bulletin Board page although no topics are shown.
Is there any way of preventing this category to be listed in the Bulletin Board home page for users that have no access to its content? Thanks!
Cheers,
Ricardo
-- Ricardo Rodríguez Your EPEC Network ICT Team
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Guillaume Lerouge wrote:
Hi Ricardo,
I'm not quite sure about what's the best way to handle this issue at the level of categories. However, please note that using the latest version of the application you can create new bulletin boards, giving each one its own space. This way protecting Topics and categories becomes much easier since you can use XWiki's built-in rights system more effectively.
To find out how, download the latest XAR (it may cause a few compatibilities issues with the first one though, you may want to keep a backup the first BB XAR...) and go to the [BBCode.Admin] page -> you'll be able to create as many Bulletin Board as you wish, each in its own space :-)
Hope this helps,
Guillaume
PS: thanks for the nice words :-) Actually I was greatly helped by Jérôme Velociter, Jean-Vincent Drean & Raffaello Pelagalli -> kudos to them three :-)
Thanks Guillaume. And thanks to the whole BB Team :-) Sorry for asking before trying the last release! One thing I have been considering it to use this BB stuff as the "by default" way of discussing about the contents of a document. At least for us is much more important the discussion than the document by itself. So to efficiently capture the "creation process" is of key importance. I was thinking about something like a tabbed page with a default "forum" for each document. It could be an option to create such a thing. And the access rights must be anyway managed independently (an user or group could read the document but not the discussion, for instance). I could figure out some other cross references between discussion and document, but I don't know if this could make sense at all. Please, does this make sense for you? Thanks for your time! Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
It makes sense, discussions àla Wikipedia if I'm right ;-) The quickest way to do this is to create a specific skin with a new displayer for comments. In fact, that's what was done for http://wikipeople.elle.fr, see for instance http://wikipeople.elle.fr/xwiki/bin/view/People/DrewBarrymore . As for the rights setting (people seeing the page but not the comments), I'm not sure that XWiki can do that out of the box... What you could do though is to create 2 spaces, MySpace & MySpaceDiscussion -> then on each page of /MySpace you put a button such as [PageDiscussion>MySpaceDiscussion.$doc.getName()] (through a panel for instance). Then people can create a discussion page with different rights for each existing page. With the parent set right it's easy to get back from the page in the discussion space to the original one... Then you'd need to create a topic in your panel in the second space. You could try to put this in a panel on the 2nd space : $doc.getObject('BBCode.TopicClass', true) -> this creates a topic in your page, but you'd still miss all the content on the TopicClassSheet... Maybe playing a bit with an input form in the panel :-) But this looks like a big hack... Good luck if you wanna try and do it though ;-) Guillaume PS: if you wait a few hours, I'll may have the time to improve the BB's remaining rough edges and upload a new XAR... On 21/02/2008, [Ricardo Rodriguez] Your EPEC Network ICT Team < webmaster@environmentalchange.net> wrote:
Guillaume Lerouge wrote:
Hi Ricardo,
I'm not quite sure about what's the best way to handle this issue at the level of categories. However, please note that using the latest version of the application you can create new bulletin boards, giving each one its own space. This way protecting Topics and categories becomes much easier since you can use XWiki's built-in rights system more effectively.
To find out how, download the latest XAR (it may cause a few compatibilities issues with the first one though, you may want to keep a backup the first BB XAR...) and go to the [BBCode.Admin] page -> you'll be able to create as many Bulletin Board as you wish, each in its own space :-)
Hope this helps,
Guillaume
PS: thanks for the nice words :-) Actually I was greatly helped by Jérôme Velociter, Jean-Vincent Drean & Raffaello Pelagalli -> kudos to them three :-)
Thanks Guillaume. And thanks to the whole BB Team :-)
Sorry for asking before trying the last release!
One thing I have been considering it to use this BB stuff as the "by default" way of discussing about the contents of a document. At least for us is much more important the discussion than the document by itself. So to efficiently capture the "creation process" is of key importance.
I was thinking about something like a tabbed page with a default "forum" for each document. It could be an option to create such a thing. And the access rights must be anyway managed independently (an user or group could read the document but not the discussion, for instance). I could figure out some other cross references between discussion and document, but I don't know if this could make sense at all.
Please, does this make sense for you?
Thanks for your time!
Ricardo
-- Ricardo Rodríguez Your EPEC Network ICT Team
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Hi Guillaume! Guillaume Lerouge wrote:
It makes sense, discussions àla Wikipedia if I'm right ;-)
I am not sure this is a good comparison. I must recognize that the last MediaWiki release I've installed and used is a bit old (1.9.3), but as far as I see the possibilities open by the XWiki arquitecture are far from being comparable to the ones provided by MediaWiki. In MediaWiki you have an interface to create new headed paragraphs of the same level in the discussion page. But what you have done is to provide a tool to create an object for each post, topic,... and this opens an universe (or multiverse!) of opportunities.
The quickest way to do this is to create a specific skin with a new displayer for comments. In fact, that's what was done for http://wikipeople.elle.fr, see for instance http://wikipeople.elle.fr/xwiki/bin/view/People/DrewBarrymore .
The example from Elle is PERFECT. But instead of using comments, I would like to use BBCode. It is not possible to categorize comments as we can categorize Category(sic)>Topic>Message.
As for the rights setting (people seeing the page but not the comments), I'm not sure that XWiki can do that out of the box... What you could do though is to create 2 spaces, MySpace & MySpaceDiscussion -> then on each page of /MySpace you put a button such as [PageDiscussion>MySpaceDiscussion.$doc.getName()] (through a panel for instance). Then people can create a discussion page with different rights for each existing page. With the parent set right it's easy to get back from the page in the discussion space to the original one...
Then you'd need to create a topic in your panel in the second space. You could try to put this in a panel on the 2nd space :
$doc.getObject('BBCode.TopicClass', true) -> this creates a topic in your page, but you'd still miss all the content on the TopicClassSheet... Maybe playing a bit with an input form in the panel :-)
But this looks like a big hack... Good luck if you wanna try and do it though ;-)
Guillaume
PS: if you wait a few hours, I'll may have the time to improve the BB's remaining rough edges and upload a new XAR...
Thanks for the tips! I have these hours indeed. In the meantime, I keep trying to make the pieces fit! Cheers, -- Ricardo Rodríguez Your EPEC Network ICT Team
Hi there, The last version of the Bulletin Board Application is now available for download at http://code.xwiki.org/xwiki/bin/view/Applications/BulletinBoardApplicationDo... . Description of the application available here : http://code.xwiki.org/xwiki/bin/view/Applications/BulletinBoardApplication This version adds a few layout changes and introduces a new panel that lists the bulletin boards an user has access to in a given wiki, available at [ Panels.BulletinBoardList] Hope you will like it, Guillaume
Hi! Guillaume Lerouge wrote:
This version adds a few layout changes and introduces a new panel that lists the bulletin boards an user has access to in a given wiki, available at [ Panels.BulletinBoardList]
Hope you will like it,
Guillaume
I do! At least for us, this is a longly desired application/feature. Of course we will use it and report back any issue. I know it will be desirable we can contribute in a more active way, but I am afraid we have to keep learning prior to be helpful. Just a detail and another thing that could be considered as a bug: 1. The title of the panel list reads: "Your Bulleting Boards". There is another useful panel listing recent modifications that reads "My Recent Modifications". I do prefer the "my" instead of the "your": the user has this nice feeling of control over what s/he is accessing. Of course it is quite easy to modify this, but you have to do that each time the panel is reimported. I don't know it if is worthing to consider this. 2. See this... http://mire.environmentalchange.net/~webmaster/images/BBCodeRRodriguez.png I've rights to read all three BB created in this wiki. So, the panel shows the right contents. But see this... http://mire.environmentalchange.net/~webmaster/images/BBCodeXPontevedra.png User Xabier has access only to BB Red Natura 2000. Each one of the three links points to one of the three created BB to which I've access, but access is correctly denied. Perhaps this makes sense for your before I am able to dig into the code to see what is happening here. Thanks! Cheers, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team -- View this message in context: http://www.nabble.com/Bulletin-Board-cannot-display-topic-title-and-first-po... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi! Sorry for posting this message again, but I've done something wrong in my previous post and it is hard to read it. Guillaume Lerouge wrote:
This version adds a few layout changes and introduces a new panel that lists the bulletin boards an user has access to in a given wiki, available at [ Panels.BulletinBoardList]
Hope you will like it,
Guillaume
I do! At least for us, this is a longly desired application/feature. Of course we will use it and report back any issue. I know it will be desirable we can contribute in a more active way, but I am afraid we have to keep learning prior to be helpful. Just a detail and another thing that could be considered as a bug: 1. The title of the panel list reads: "Your Bulletin Boards". There is another useful panel listing recent modifications that reads "My Recent Modifications". I do prefer the "my" instead of the "your": the user has this nice feeling of control over what s/he is accessing. Of course it is quite easy to modify this, but you have to do that each time the panel is reimported. I don't know it if is worthing to consider this. 2. See this... http://mire.environmentalchange.net/~webmaster/images/BBCodeRRodriguez.png I've rights to read all three BB created in this wiki. So, the panel shows the right contents. But see this... http://mire.environmentalchange.net/~webmaster/images/BBCodeXPontevedra.png User Xabier has access only to BB Red Natura 2000. Each one of the three links points to one of the three created BB to which I've access, but access is correctly denied. Perhaps this makes sense for your before I am able to dig into the code to see what is happening here. Thanks! Cheers, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team -- View this message in context: http://www.nabble.com/Bulletin-Board-cannot-display-topic-title-and-first-po... Sent from the XWiki- Users mailing list archive at Nabble.com.
There's a problem indeed... Here is the code : #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='BBCode.BBClass' and obj.name<>'BBCode.BBClassTemplate' order by doc.date desc") #set($bbs = $xwiki.searchDocuments($sql)) #foreach ($item in $bbs) #set ($bbdoc = $xwiki.getDocument($item)) #if ($bbdoc.hasAccessLevel('view', $context.user) == 'true') #if ($bbdoc.getValue('bbtitle') != "") * [$bbdoc.display('bbtitle')>$item] #else * [$item] #end #end #end -> the check on rights is done before the moment each Bulletin Board is displayed, so it may have something to do with the rights configuration... Do you explicitely deny the view right to your user ? (Locally when I deny view right to an user he cannot see the bulletin boards he can't access in the list, ie I don't get the bug) In the meanwhile I've updated the XAR for the panel to read My instead of Your ;-) Guillaume On 21/02/2008, [Ricardo Rodriguez] <webmaster@environmentalchange.net> wrote:
Hi!
Guillaume Lerouge wrote: This version adds a few layout changes and introduces a new panel that lists the bulletin boards an user has access to in a given wiki, available at [ Panels.BulletinBoardList] Hope you will like it, Guillaume
I do! At least for us, this is a longly desired application/feature. Of course we will use it and report back any issue. I know it will be desirable we can contribute in a more active way, but I am afraid we have to keep learning prior to be helpful. Just a detail and another thing that could be considered as a bug: 1. The title of the panel list reads: "Your Bulleting Boards". There is another useful panel listing recent modifications that reads "My Recent Modifications". I do prefer the "my" instead of the "your": the user has this nice feeling of control over what s/he is accessing. Of course it is quite easy to modify this, but you have to do that each time the panel is reimported. I don't know it if is worthing to consider this. 2. See this... http://mire.environmentalchange.net/~webmaster/images/BBCodeRRodriguez.pngI've rights to read all three BB created in this wiki. So, the panel shows the right contents. But see this... http://mire.environmentalchange.net/~webmaster/images/BBCodeXPontevedra.pngU... Xabier has access only to BB Red Natura 2000. Each one of the three links points to one of the three created BB to which I've access, but access is correctly denied. Perhaps this makes sense for your before I am able to dig into the code to see what is happening here. Thanks! Cheers, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team ------------------------------ View this message in context: Re: Bulletin Board cannot display topic title and first post !?<http://www.nabble.com/Bulletin-Board-cannot-display-topic-title-and-first-post-%21--tp15547458p15609017.html> Sent from the XWiki- Users mailing list archive<http://www.nabble.com/XWiki--Users-f2565.html>at Nabble.com.
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Guillaume Lerouge wrote:
-> the check on rights is done before the moment each Bulletin Board is displayed, so it may have something to do with the rights configuration... Do you explicitely deny the view right to your user ?
(Locally when I deny view right to an user he cannot see the bulletin boards he can't access in the list, ie I don't get the bug)
In the meanwhile I've updated the XAR for the panel to read My instead of Your ;-)
Guillaume
Thanks for the "My" :-) As for the "bug", I have not been able yet to find a pattern. It happens with some users, but not with others. And I am not able to find the differences between them concerning rights assignments. Come back as soon as possible. Thanks! -- Ricardo Rodríguez Your EPEC Network ICT Team
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
As for the "bug", I have not been able yet to find a pattern. It happens with some users, but not with others. And I am not able to find the differences between them concerning rights assignments. Come back as soon as possible.
Thanks!
The differences comes from the number/order of the spaces each user has access to. Given three fora, each of them with its own space, see these results... José Carlos can only view the first one: http://mire.environmentalchange.net/~webmaster/images/BBCodeViewFirst.png Cruz, the first and the second ones: http://mire.environmentalchange.net/~webmaster/images/BBCodeViewFirstSecond.... My own user has view access to all three fora: http://mire.environmentalchange.net/~webmaster/images/BBCodeViewAllThree.png Flavio, second and third: http://mire.environmentalchange.net/~webmaster/images/BBCodeViewSecondThird.... Manuel, just second: http://mire.environmentalchange.net/~webmaster/images/BBCodeViewSecond.png Arturo, only to the third: http://mire.environmentalchange.net/~webmaster/images/BBCodeViewThird.png And Mónica no view access to any fora: http://mire.environmentalchange.net/~webmaster/images/BBCodeViewNone.png "Extra" links point to the right forum even though access is denied when clicked. This code works fine for me... #set($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='BBCode.BBClass' and obj.name<>'BBCode.BBClassTemplate' order by doc.date desc") #foreach($item in $xwiki.searchDocuments($sql)) #if($xwiki.getDocument($item).hasAccessLevel('view', $context.user) == 'true') #if ($xwiki.getDocument($item).getValue('bbtitle') != "") * [$xwiki.getDocument($item).display('bbtitle')>$item] #else * [$item] #end #end #end The only difference is that I've removed #set ($bbdoc = $xwiki.getDocument($item)) and used $xwiki.getDocument($item) instead of $bbdoc. The point seems to be how $bbdoc is assigned within the control structure #foreach. Does this make sense for you? Thanks! Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
Hi Ricardo, thanks for taking the time to test stuff and sort it out :-) The point seems to be how $bbdoc is assigned within the control
structure #foreach. Does this make sense for you? Thanks!
I must admit I have no idea why the code behaves this way, but since your code apparently works better than mine I updated the XAR using it :-) -> if it works let's use it ;-) Thanks for your help, Guillaume
Guillaume Lerouge wrote:
The point seems to be how $bbdoc is assigned within the control structure #foreach. Does this make sense for you? Thanks!
I must admit I have no idea why the code behaves this way, but since your code apparently works better than mine I updated the XAR using it :-) -> if it works let's use it ;-)
Thanks! After all this is about collaboration! The point is that $bbdoc gets the value of the first granted document, let's say com.xpn.xwiki.api.Document@ab18cf, and this is the value used for the no-granted entries from this point onwards. It will be great to know why does this happen. Let's hope others have sometime to jump in here and solve the doubt. Cheers, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Guillaume Lerouge wrote:
The point seems to be how $bbdoc is assigned within the control structure #foreach. Does this make sense for you? Thanks!
I must admit I have no idea why the code behaves this way, but since your code apparently works better than mine I updated the XAR using it :-) -> if it works let's use it ;-)
Thanks! After all this is about collaboration!
The point is that $bbdoc gets the value of the first granted document, let's say com.xpn.xwiki.api.Document@ab18cf, and this is the value used for the no-granted entries from this point onwards. It will be great to know why does this happen. Let's hope others have sometime to jump in here and solve the doubt.
Cheers,
Ricardo
Simple. $xwiki.getDocument returns null if you can't access that document. #set($var = null) will leave $var to its previous value (velocity feature, can be configured to allow setting null, but it is not allowed by default). -- Sergiu Dumitriu http://purl.org/net/sergiu/
Sergiu Dumitriu wrote:
Simple. $xwiki.getDocument returns null if you can't access that document. #set($var = null) will leave $var to its previous value (velocity feature, can be configured to allow setting null, but it is not allowed by default).
Thanks Sergiu. It is easy to understand now. By the way, do you use some Velocity debugger, if any is available... Thanks! Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Sergiu Dumitriu wrote:
Simple. $xwiki.getDocument returns null if you can't access that document. #set($var = null) will leave $var to its previous value (velocity feature, can be configured to allow setting null, but it is not allowed by default).
Thanks Sergiu. It is easy to understand now.
By the way, do you use some Velocity debugger, if any is available...
Nope, just my years of experience with Velocity. -- Sergiu Dumitriu http://purl.org/net/sergiu/
Hi Guillaume, Guillaume Lerouge wrote:
if it works let's use it ;-)
Following Vicent advise in another thread I have realized that Panels.IncludedDocuments could help me to avoid a problem: if I included Panels.BulletinBoardList in a given column and an user has no access to any bulletin board, we got an empty panel. Just the title was showed up. We think users must not get this entry if they have not access to any bb. I would like to propose the following code to avoid what we consider a problem. The way I check for granted access to bb is really primitive. But it works and it is not dangerous at all! It will be great if you or others could find a more elegant way to get the same result. Thanks! ***** #set($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='BBCode.BBClass' and obj.name<>'BBCode.BBClassTemplate' order by doc.date desc") #set($count = 0) #foreach($item in $xwiki.searchDocuments($sql)) #if($xwiki.getDocument($item).hasAccessLevel('view', $context.user) == 'true') #set($count = $count +1) #end #end #if($count >0 || $showEmptyPanels) #includeMacros("XWiki.Macros") #panelheaderc('My Bulletin Boards') #foreach($item in $xwiki.searchDocuments($sql)) #if($xwiki.getDocument($item).hasAccessLevel('view', $context.user) == 'true') #if ($xwiki.getDocument($item).getValue('bbtitle') != "") * [$xwiki.getDocument($item).display('bbtitle')>$item] #else * [$item] #end #end #end #panelfooter() #end ***** The description must be modified accordingly. Perhaps... ***** This panels lists all the Bulletin Boards an user has view, edit & admin access to in a given wiki. If an user does not have the right to see a given Bulletin Board, he / she will not see it in the list. If he / she has access to none of them, the panel will not show up. ***** Thanks! -- Ricardo Rodríguez Your EPEC Network ICT Team
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Hi Guillaume,
Guillaume Lerouge wrote:
if it works let's use it ;-)
Following Vicent advise in another thread I have realized that Panels.IncludedDocuments could help me to avoid a problem: if I included Panels.BulletinBoardList in a given column and an user has no access to any bulletin board, we got an empty panel. Just the title was showed up.
We think users must not get this entry if they have not access to any bb. I would like to propose the following code to avoid what we consider a problem. The way I check for granted access to bb is really primitive. But it works and it is not dangerous at all! It will be great if you or others could find a more elegant way to get the same result. Thanks!
***** #set($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='BBCode.BBClass' and obj.name<>'BBCode.BBClassTemplate' order by doc.date desc")
#set($count = 0)
#foreach($item in $xwiki.searchDocuments($sql)) #if($xwiki.getDocument($item).hasAccessLevel('view', $context.user) == 'true') #set($count = $count +1) #end #end
#if($count >0 || $showEmptyPanels)
#includeMacros("XWiki.Macros") #panelheaderc('My Bulletin Boards') #foreach($item in $xwiki.searchDocuments($sql)) #if($xwiki.getDocument($item).hasAccessLevel('view', $context.user) == 'true') #if ($xwiki.getDocument($item).getValue('bbtitle') != "") * [$xwiki.getDocument($item).display('bbtitle')>$item] #else * [$item] #end #end #end #panelfooter()
#end *****
The description must be modified accordingly. Perhaps...
***** This panels lists all the Bulletin Boards an user has view, edit & admin access to in a given wiki. If an user does not have the right to see a given Bulletin Board, he / she will not see it in the list. If he / she has access to none of them, the panel will not show up. *****
Thanks!
Sorry, I've forgotten that this code uses a XWiki.Macros document containing a #panelheaderc customized macro. It is just a workaround until we have not a generalized expanded/collapsed parameter for panels. Here the macro: ***** #macro(panelheaderc $title) #set($cookieName = "${context.user}_${panel}") #set($expanded = "collapsed") #set($expanded = $xwiki.getUserPreferenceFromCookie($cookieName)) ## Note: We pass the Panel name as an HTML class attribute so that it's possible to style ## the Panels selectively using CSS. #set ($specialClassAttribute = "") #if ($paneldoc && $paneldoc != "") #set ($specialClassAttribute = $util.convertToAlphaNumeric($paneldoc.name)) #end <div class="panel $expanded $specialClassAttribute"> <h5 class="xwikipaneltitle" onclick="if(eltHasClass(this.parentNode, 'expanded')) createCookie('$cookieName','collapsed', ''); else eraseCookie('$cookieName'); togglePanelVisibility(this.parentNode);">$title</h5> <div class="xwikipanelcontents"> #end ***** Cheers, -- Ricardo Rodríguez Your EPEC Network ICT Team
participants (5)
-
[Ricardo Rodriguez] -
[Ricardo Rodriguez] Your EPEC Network ICT Team -
Guillaume Lerouge -
Ngo Thi Hong Nga -
Sergiu Dumitriu