Restrict export of specific media to anonymous users
Restrict export of specific media to anonymous users
To restrict export of some media to anonymous users you will need to modify one jsp file and add a new text file.
- Make a new text file and call it lunaExportRestrictedFiles.txt. Open it up and add media links you'd like to restrict export on.Â
- To get the link for the media you want to restrict export on open up the LUNA Viewer and copy everything after /servlet/detail/ and before ? , and copy the link in to the lunaExportRestrictedFiles.txt file.
For example http://www.davidrumsey.com/luna/servlet/detail/ RUMSEY~8~1~276068~90049305 ?qvq=sort:pub_list_no_initialsort,pub_date,pub_list_no,series_no;lc:RUMSEY~8~1&mi=4&trs=58438 - The lunaExportRestrictedFiles.txt file is going to be placed in home/YourUser/LunaImaging/
- The file you need to modify is the controlsContent.jsp, so make a back up first. controlsContent.jsp is located at ~/LunaImaging/7.x/LUNA/tomcat/luna_apps/luna.war/WEBINF/views/jsp/insight/detailView/controlsContent.jsp
Â
- Open the file in you favorite text editor.
     Got to line 44 and paste in.
<!-- restrict export change --> <c:import var="restrictedFiles" url="file:///home/YourUser/LunaImaging/lunaExportRestrictedFiles.txt" /> <!-- end change -->
- Next got to line 53 and paste in.Â
<!-- restrict export change --> <c:if test="${!fn:contains(restrictedFiles , media.id )}"> <!-- end change --> <c:if test="${not empty buyLinkBaseUrl && not empty buyLinkQueryString }"> <c:choose> <c:when test="${media.maxWidth / media.maxHeight < .38 || media.maxHeight / media.maxWidth < .38}" > <c:set var="buyBaseUrl_" value="${fn:replace(buyLinkBaseUrl,'002-default.html','002-defaultnss.html')}" /> </c:when> <c:otherwise> <c:set var="buyBaseUrl_" value="${buyLinkBaseUrl}" /> </c:otherwise> </c:choose> <a id="BuyButton" target=_blank onClick="recordEvent(<c:out value="${analyticsEnabled}"/>,'Buy Button','<c:out value="${buyBaseUrl_}${buyLinkQueryString}" />');" href="<c:out value="${buyBaseUrl_}${buyLinkQueryString}" />"><fmt:message key="link.buy" /></a>
- Now to finish it off go to line 86 and paste this in.
<!-- restrict export change --> </c:if> <!-- end change -->
- Once complete, save out your jsp file and stop your LUNA 7 tomcat sever and delete the Tomcat localhost folder located at ~/LunaImaging/7.x/LUNA/tomcat/work/Catalina. Then restart Tomcat sever.