public static Layout parseResource ( String resource ) { int i = resource . indexOf ( ":" ) ; if ( i > 0 ) { String loaderId = resource . substring ( 0 , i ) ; ILayoutLoader layoutLoader = LayoutLoaderRegistry . getInstance ( ) . get ( loaderId ) ; if ( layoutLoader != null ) { String name = resource . substring ( i + 1 ) ; return layoutLoader . loadLayout ( name ) ; } } InputStream strm = ExecutionContext . getSession ( ) . getServletContext ( ) . getResourceAsStream ( resource ) ; if ( strm == null ) { throw new CWFException ( "Unable to locate layout resource: " + resource ) ; } return parseStream ( strm ) ; }
Loads a layout from the specified resource using a registered layout loader or failing that using the default loadFromUrl method .