factory = CreateObject("java", "coldfusion.server.ServiceFactory"); runtime = factory.getRuntimeService(); customTagRoots = runtime.getCustomtags(); mappings = runtime.getMappings() ; roots = ArrayNew(1) ; // add first all cf virtual directories in descendent order, this will // help preserve resolution precedence skipWebroot = false ; virtualDirs = StructKeyArray(mappings) ; ArraySort( virtualDirs, "TEXTNOCASE", "DESC" ) ; for ( i=1; i lte ArrayLen(virtualDirs); i=i+1 ) { prefix = NormalizePath( virtualDirs[i] ); prefix = Replace( prefix, '/', '.', 'ALL' ) ; if ( Find( '.', prefix ) eq 1 ) prefix = RemoveChars( prefix, 1, 1 ) ; if ( prefix eq '' and not skipWebroot ) skipWebroot = true ; root = StructNew() ; root.prefix = prefix ; root.physicalPath = NormalizePath( mappings[virtualDirs[i]] ) ; ArrayAppend( roots, root ) ; } // add webroot if ( not skipWebroot ) { temp = 'abcdefghijklmno.abcdefghijklmno' ; // temporary hack for IIS webroot = Replace(expandPath('/' & temp ), temp, '') ; root = StructNew() ; root.prefix = '' ; root.physicalPath = NormalizePath( webroot ) ; ArrayAppend( roots, root ) ; } // get custom tag roots installationRoot = Replace( server.coldfusion.rootdir, '\', '/', 'ALL' ) ; for ( ctRoot in customTagRoots ) { root = StructNew() ; root.prefix = '' ; // temporary workaround root.physicalPath = NormalizePath( Replace( CustomTagRoots[ctRoot], "##server.coldfusion.rootdir##", installationRoot ) ) ; ArrayAppend( roots, root ) ; } return roots ; readFromCache = checkCache("getcfcs") and not refreshCache ; if ( readFromCache ) { return getCache("getcfcs") ; } else { roots = getComponentRoots() ; components = StructNew() ; packages = StructNew() ; ignoreShadowedPackages = true ; for ( i=1; i lte ArrayLen( roots ); i=i+1 ) { root = CreateObject( "java", "java.io.File" ) ; root.init( roots[i].physicalPath ) ; browseForComponents( roots[i].prefix, root, roots[i].physicalPath, ignoreShadowedPackages ) ; // toggle the switch once we passed the web root (first root without // the package prefix if ( ignoreShadowedPackages and roots[i].prefix eq '' ) ignoreShadowedPackages = false ; } result = ArrayNew(1) ; for ( name in components ) { ArrayAppend( result, components[name] ) ; } setCache("getcfcs", result) ; return result ; } if ( IsDefined('arguments.path') and arguments.path neq '' ) { proxy = CreateObject( "java", "coldfusion.runtime.TemplateProxyFactory" ) ; comp = proxy.ResolvePath( arguments.path, getPageContext() ) ; return getMetaData(comp); } else if( isDefined('arguments.name') ) { comp = CreateObject( "component", name ) ; return getMetaData(comp); }

Component not found

The component definition file for component '#name#' cannot be found on this server.
comp = CreateObject( "component", name ) ; utils = CreateObject( "component", "utils" ) ; return utils.cfcToMCDL(comp) ; if ( IsDefined('arguments.path') and arguments.path neq '' ) { proxy = CreateObject( "java", "coldfusion.runtime.TemplateProxyFactory" ) ; comp = proxy.ResolvePath( arguments.path, getPageContext() ) ; } else { comp = CreateObject( "component", name ) ; } utils = CreateObject( "component", "utils" ) ; WriteOutput( utils.cfcToHTML(comp) ) ;

Component not found

The component definition file for component '#name#' cannot be found on this server.
tree = StructNew() ; cfcs = getcfcs(refreshCache) ; roots = getcomponentroots() ; for ( i=1; i lte ArrayLen(roots); i=i+1 ) { tree[roots[i].physicalPath] = StructNew() ; } for ( i=1; i lte ArrayLen(cfcs); i=i+1 ) { cfc = cfcs[i] ; if ( StructKeyExists( tree, cfc.cfcroot ) ) { if ( not StructKeyExists( tree[cfc.cfcroot], cfc.package ) ) { // add new package to the package struct tree[cfc.cfcroot][cfc.package] = ArrayNew(1) ; } ArrayAppend( tree[cfc.cfcroot][cfc.package], ListLast( cfc.name, '.' ) ) ; } } return tree ; cfcs = getcfcs(true) ; for ( i=1; i lte ArrayLen(cfcs); i=i+1 ) { if ( cfcs[i].name eq name ) return true ; } return false ;