4

We have implemented PageContentFilter and BinaryContentFilterin Tridion 2013 SP1 because we serve pages from custom filesystem location with following code:

public class BinaryContentFilterWrapper extends BinaryContentFilter {

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        if (RestDCPAppConfig.isXpmEnabled()) {
            super.doFilter(servletRequest, servletResponse, filterChain);
        } else {
            filterChain.doFilter(servletRequest, servletResponse); 
        }
    }

}

Now we need to re-implement this for 8.5, but when I take a look at these classes, they are completely different with new methods, plus doFilter() method cannot be implemented since its final.

@Override
protected BinaryData fetchBinaryData(String arg0) {}    

@Override
protected String handleBinaryData(PreviewSession arg0, BinaryData arg1, String arg2, String arg3) {}

@Override
protected void doInit() throws SessionHandlingException  {}

@Override
protected PreviewSession obtainPreviewSession()  {}

Is there any documentation on how to implement this? Or what these methods are? How should we re-implement doFilter() method for XPM?

  • Did you manage to resolve this Marko? – Jonathan Primmer Jun 13 at 20:44
  • No. We contacted support and tey have no clue – Marko Milic Jun 13 at 20:45
  • Thanks all the same for your reply. I’m working on the exact same thing so I’ll keep you posted if I make any progress. – Jonathan Primmer Jun 13 at 21:05
  • 1
    I managed to conditionally execute the XPM filters per environment as outlined in this blog. contentbloom.com/blog/…. I don't think it exactly answers your question but it looks like our overall requirements are the same based on your code example. Hope it helps – Jonathan Primmer Jun 18 at 16:50
  • great. can you please add this as an answer and ill accept it. So that the next guy has easier time fixing it :D – Marko Milic Jun 19 at 7:01
1

You can conditionally execute the XPM filters per environment by defining your own custom filter which implement a FilterChain with the chain.doFilter() command executed conditionally based on your environment configuration.

You're essentially replacing the XPM filters in the web.xml with your own custom ones that conditionally execute a FilterChain.

Here's a blog explaining how to achieve that https://www.contentbloom.com/blog/conditional-sdl-experience-manager-xpm-filters-per-environment/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.