PageSource[] sources = ((PageContextImpl)pageContext).getPageSources(template);
PageSource ps = MappingImpl.isOK(sources);
if(ps==null)
throw new MissingIncludeException(sources[0],"could not find template ["+template+"], file ["+sources[0].getDisplayPath()+"] doesn't exist");
source=new InitFile(ps,template,template.endsWith('.'+pageContext.getConfig().getCFCExtension()));
}
else {
source=new InitFile(pageContext.getCurrentPageSource().getRealPage(template),template,StringUtil.endsWithIgnoreCase(template,'.'+pageContext.getConfig().getCFCExtension()));
if(!MappingImpl.isOK(source.getPageSource())){
throw new MissingIncludeException(source.getPageSource(),"could not find template ["+template+"], file ["+source.getPageSource().getDisplayPath()+"] doesn't exist");
}
}
//attributesScope.removeEL(TEMPLATE);
setAppendix(source.getPageSource());
}
else if(objName!=null) {
attributesScope.removeEL(KeyConstants._name);
String[] filenames = toRealPath(config,objName.toString());
boolean exist=false;
// appcontext mappings
Mapping[] ctms = pageContext.getApplicationContext().getCustomTagMappings();
if(ctms!=null) {
outer:for(int f=0;f<filenames.length;f++){
for(int i=0;i<ctms.length;i++){
source=new InitFile(ctms[i].getPageSource(filenames[f]),filenames[f],filenames[f].endsWith('.'+config.getCFCExtension()));
if(MappingImpl.isOK(source.getPageSource())) {
exist=true;
break outer;
}
}
}
}
// config mappings
if(!exist) {
ctms = config.getCustomTagMappings();
outer:for(int f=0;f<filenames.length;f++){
for(int i=0;i<ctms.length;i++){// TODO optimieren siehe CFTag
source=new InitFile(ctms[i].getPageSource(filenames[f]),filenames[f],filenames[f].endsWith('.'+config.getCFCExtension()));
if(MappingImpl.isOK(source.getPageSource())) {
exist=true;
break outer;
}
}