Thank you Antoine,

It works.

Best regards
Evgeni

On Wed, May 13, 2015 at 12:27 PM, Antoine Snyers <anto...@atmire.com> wrote:

>  Hi Evgeni Dimitrov
>
> You have to modify the "public Serializable getKey()" and "public
> SourceValidity getValidity()" methods of that same class.
> These methods evaluate whether addBody should be called or whether the
> cached document may be used.
>
>
> Evgeni Dimitrov schreef op 13/05/15 om 11:01:
>
> Hi,
>
> This is about DSpace 5.1.
>
> I am trying to make a small change in the way an item is displayed. When
> the user has "write" rights on the item it should display as originally.
> Otherwise the item handle is passed to another web application.
>
> I added several lines in the beginning of
> org.dspace.app.xmlui.aspect.artifactbrowser.ItemViewer.addBody
>
> Request request = ObjectModelHelper.getRequest(objectModel);
> if(!AuthorizeManager.authorizeActionBoolean(context, item,
> Constants.WRITE)) {
>     StringBuilder redirectURL = new StringBuilder();
>     redirectURL.append(request.getContextPath().replace("/xmlui",
> "/dspviewerf/"));
>     redirectURL.append(item.getHandle());
>     redirectURL.append("?sq=");
>     redirectURL.append("123");
>
>     HttpServletResponse httpResponse =
>         (HttpServletResponse)
> objectModel.get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
>     httpResponse.sendRedirect(redirectURL.toString());
> }
>
> It works as expected for the user without "write" rights.
> It works as expected for the user with "write" rights.
>
> But after it has worked once for the user with "write" rights, it creates
> cache and displays the same page for the user without "write" rights.
>
> What can I reasonably do? Disable the cache in some way?
>
> Best regards
> Evgeni
>
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM 
> Insight.http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>
>
>
> _______________________________________________
> DSpace-tech mailing 
> listDSpace-tech@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette: 
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>
>
>
> --
>   [image: logo]
>  *Antoine Snyers*
> *2888 Loker Avenue East, Suite 315, Carlsbad, CA. 92010*
> *Esperantolaan 4, Heverlee 3001, Belgium*
> www.atmire.com
> <http://atmire.com/website/?q=services&utm_source=emailfooter&utm_medium=email&utm_campaign=antoine>
>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to