private static boolean isPageInTemplateDefinition ( Page page ) { Resource resource = page . adaptTo ( Resource . class ) ; if ( resource != null ) { Resource parent = resource . getParent ( ) ; if ( parent != null ) { return StringUtils . equals ( NT_TEMPLATE , parent . getValueMap ( ) . get ( JCR_PRIMARYTYPE , String . class ) ) ; } } return false ; }
Checks if the given page is part of the editable template definition itself .