In XMLUI, I have suppressed the display of a specific collection from all
users.

<xsl:template
match="dri:referenceSet/dri:reference[contains(@url,'123456789/111111')]"
mode="community-browser"/>

An easy way to detect authentication in XMLUI is to set the following
global variable.

<xsl:variable name="AUTH"
select="/dri:document/dri:meta/dri:userMeta/@authenticated"/>

Perhaps these checks could be combined.

<xsl:template
match="dri:referenceSet/dri:reference[contains(@url,'123456789/111111') and
$AUTH]" mode="community-browser"/>

Terry


On Fri, Feb 15, 2019 at 8:14 AM Shaun donovan <sha...@teqcle.co.za> wrote:

> Hi all.
>
> Please note that this is done on DSpace 5.8 using Mirage.
>
> This is the JQuery code:
>
> (function ($) {
>         $(document).ready(function(){
>                 if($("a[href$='/login']").size() != 0){
>
> $('#aspect_artifactbrowser_CommunityBrowser_div_comunity-browser').find('li').each(function(){
>                                 var name = $(this).find("span").text();
>                                 if((name.match("^Africa Collection")) ||
> (name.match("^Cartography")) || (name.match("^Publications")) ||
> (name.match("^HSRC Archive")) ){
>                                         $(this).hide();
>                                 }
>                         });
>                 }
>         });
> })(jq190);
>
> I save this in the skins lib/js directory as abcd.js and then load it in
> the skin's sitemap.xmap:
>
>           <map:transform type="IncludePageMeta">
>                 <map:parameter name="stylesheet.all"
> value="lib/css/media.css"/>
>                 <map:parameter name="javascript"
> value="lib/js/jquery-ui-1.8.15.custom.min.js"/>
>                 <map:parameter name="theme.path"
> value="{global:theme-path}"/>
>                 <map:parameter name="theme.name"
> value="{global:theme-path}"/>
>                 *<map:parameter name="javascript#1"
> value="lib/js/abcd.js"/>*
>                 <map:parameter name="curRequestURI" value="{1}"/>
>             </map:transform>
>
> and then in lib/xsl/core/pagestructure.xsl
>
>              <script type="text/javascript" src="{concat($scheme, '
> ajax.googleapis.com/ajax/libs/jquery/', $jqueryVersion
> ,'/jquery.min.js')}">&#160;</script>
>              <script>
>                 var jq190 = jQuery.noConflict();
>                 var $ = jQuery.noConflict();
>              </script>
>
> It's a pretty manual process but it works. It looks for a "/login" href to
> determine whether the user is logged in or not, and hides the communities
> if they are not. In this case, I am hiding communities "Africa Collection",
> "Cartography", "Publications" and "HSRC Archive".
>
> I hope this helps, but give me a shout if you struggle.
>
> Kind Regards.
>
> Shaun
> On 2019/02/13 08:11, Paul Münch wrote:
>
> Hello Shaun,
>
> it is possible for you to share a code template here or in a public git
> repository?
>
> Many thanks and kind regards,
>
> Paul Münch
>
> Am 12.02.19 um 12:19 schrieb Shaun donovan:
>
> Hi Diego.
>
> I have done this with JQuery. It is a simple solution and it works. Let me
> know if you would like to try it and I will send you the code.
>
> Kind Regards.
>
> Shaun.
> On 2019/02/12 09:00, Antti Laurila wrote:
>
> Hi!
>
> I'll respond on behalf Ilja, we were working on the same project. And the
> answer is unfortunately no, we did not find a solution to this.
>
> BR,
> Antti
>
> On Friday, January 25, 2019 at 4:02:31 PM UTC+2, Diego Brice wrote:
>>
>> IIja, did you finally manage to do this? How?.
>>
>> El miércoles, 14 de septiembre de 2016, 9:40:08 (UTC-3), Ilja Sidoroff
>> escribió:
>>>
>>> I'm trying to hide some internal communities and collections from
>>> unauthenticated users (with DSpace 5.5/XMLUI, but also with upcoming 6.0).
>>> How-to in the Wiki has been outdated (
>>> https://wiki.duraspace.org/display/DSPACE/Hide+Community+or+Collection+from+list)
>>> and some other googling turned out advise to filter specific
>>> communities/collections in xsl, which I think is prone to breakage in
>>> migrations and such (e.g.
>>> http://stackoverflow.com/questions/37122851/hiding-collections-and-sub-collections-in-dspace).
>>>
>>>
>>> What I'd like to do is to filter the community/collection list when it
>>> is generated. This seems such common requirement, that it might have been
>>> implemented already by someone?
>>>
>>> br,
>>>
>>> Ilja Sidoroff
>>> University of Eastern Finland
>>>
>> --
> All messages to this mailing list should adhere to the DuraSpace Code of
> Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> All messages to this mailing list should adhere to the DuraSpace Code of
> Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> Philipps-Universität Marburg | UB
> Digitale Dienste | Deutschhausstraße 9 | D018
> Tel. +49 06421 28-24624
> --
>
> --
> All messages to this mailing list should adhere to the DuraSpace Code of
> Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> All messages to this mailing list should adhere to the DuraSpace Code of
> Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
https://github.com/terrywbrady/info
425-298-5498 (Seattle, WA)

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to