private Boolean isInsideCITemplate ( Page page ) { SourceCode sc = page . getSourceCode ( ) ; if ( ! ( sc instanceof PageSourceCode ) ) return null ; PageSource psc = ( ( PageSourceCode ) sc ) . getPageSource ( ) ; String src = psc . getDisplayPath ( ) ; return Constants . isComponentExtension ( ResourceUtil . getExtension ( src , "" ) ) ; // int pos=src.lastIndexOf("."); // return pos!=-1 && pos<src.length() && src.substring(pos+1).equals(Constants.COMPONENT_EXTENSION); }
is the template ending with a component extension?