private ApplicationDefinition loadAppRow ( Tenant tenant , Map < String , String > colMap ) { ApplicationDefinition appDef = new ApplicationDefinition ( ) ; String appSchema = colMap . get ( COLNAME_APP_SCHEMA ) ; if ( appSchema == null ) { return null ; // Not a real application definition row } String format = colMap . get ( COLNAME_APP_SCHEMA_FORMAT ) ; ContentType contentType = Utils . isEmpty ( format ) ? ContentType . TEXT_XML : new ContentType ( format ) ; String versionStr = colMap . get ( COLNAME_APP_SCHEMA_VERSION ) ; int schemaVersion = Utils . isEmpty ( versionStr ) ? CURRENT_SCHEMA_LEVEL : Integer . parseInt ( versionStr ) ; if ( schemaVersion > CURRENT_SCHEMA_LEVEL ) { m_logger . warn ( "Skipping schema with advanced version: {}" , schemaVersion ) ; return null ; } try { appDef . parse ( UNode . parse ( appSchema , contentType ) ) ; } catch ( Exception e ) { m_logger . warn ( "Error parsing schema for application '" + appDef . getAppName ( ) + "'; skipped" , e ) ; return null ; } appDef . setTenantName ( tenant . getName ( ) ) ; return appDef ; }
Parse the application schema from the given application row .