public void updateConfigInfo ( final HttpServletRequest request , final XSLTConfig xcfg ) throws ServletException { PresentationState ps = getPresentationState ( request ) ; if ( ps == null ) { // Still can't do a thing return ; } if ( xcfg . nextCfg == null ) { xcfg . nextCfg = new XSLTFilterConfigInfo ( ) ; } else { xcfg . cfg . updateFrom ( xcfg . nextCfg ) ; } xcfg . cfg . setAppRoot ( ps . getAppRoot ( ) ) ; xcfg . nextCfg . setAppRoot ( ps . getAppRoot ( ) ) ; /** Transfer the state */ if ( ps . getNoXSLTSticky ( ) ) { xcfg . cfg . setDontFilter ( true ) ; xcfg . nextCfg . setDontFilter ( true ) ; } else { xcfg . cfg . setDontFilter ( ps . getNoXSLT ( ) ) ; ps . setNoXSLT ( false ) ; } /* ============== Don't filter ================= */ if ( xcfg . cfg . getDontFilter ( ) ) { // I think that's enough return ; } /* ============== Locale ================= */ Locale l = request . getLocale ( ) ; String lang = l . getLanguage ( ) ; if ( ( lang == null ) || ( lang . length ( ) == 0 ) ) { lang = xcfg . cfg . getDefaultLang ( ) ; } String country = l . getCountry ( ) ; if ( ( country == null ) || ( country . length ( ) == 0 ) ) { country = xcfg . cfg . getDefaultCountry ( ) ; } xcfg . cfg . setLocaleInfo ( XSLTFilterConfigInfo . makeLocale ( lang , country ) ) ; /* locale always sticky */ xcfg . nextCfg . setLocaleInfo ( XSLTFilterConfigInfo . makeLocale ( lang , country ) ) ; /* ============== Browser type ================= */ String temp = ps . getBrowserType ( ) ; if ( temp != null ) { xcfg . cfg . setBrowserType ( temp ) ; } if ( ! ps . getBrowserTypeSticky ( ) ) { ps . setBrowserType ( null ) ; } else { xcfg . nextCfg . setBrowserType ( temp ) ; } /* ============== Skin name ================= */ temp = ps . getSkinName ( ) ; if ( temp != null ) { xcfg . cfg . setSkinName ( temp ) ; } if ( ! ps . getSkinNameSticky ( ) ) { ps . setSkinName ( null ) ; } else { xcfg . nextCfg . setSkinName ( temp ) ; } /* ============== Content type ================= */ xcfg . cfg . setContentType ( ps . getContentType ( ) ) ; if ( ! ps . getContentTypeSticky ( ) ) { ps . setContentType ( null ) ; } else { xcfg . nextCfg . setContentType ( ps . getContentType ( ) ) ; } /* ============== Refresh ================= */ xcfg . cfg . setForceReload ( ps . getForceXSLTRefresh ( ) ) ; ps . setForceXSLTRefresh ( false ) ; /* I don't think we ever want to allow this info.setReloadAlways(ps.getForceXSLTRefreshAlways()); */ }
This method can be overridden to allow a subclass to set up ready for a transformation .