Package org.pentaho.platform.api.ui

Examples of org.pentaho.platform.api.ui.ModuleThemeInfo


    Map<String, Theme> systemThemes = new HashMap<String, Theme>();

    // Find the declared default plugin for themes. Add it's themes to the map first. Any that come in later will
    // overwrite it.
    String defaultThemePlugin = PentahoSystem.getSystemSetting( "default-theme-plugin", "userconsole" );
    ModuleThemeInfo defaultThemePluginInfo = moduleThemes.get( defaultThemePlugin );
    if ( defaultThemePluginInfo == null ) {
      logger.debug( "Unable to find the default theme plugin: " + defaultThemePlugin );
    } else {
      // Add all system themes from the default plugin in now.
      for ( Theme theme : defaultThemePluginInfo.getSystemThemes() ) {
        systemThemes.put( theme.getId(), theme );
      }
    }

    // Loop through other modules and add their system themes. Any which have the same name as one supplied by the
View Full Code Here


      if ( rootThemeFolder == null ) {
        return;
      }

      // Things look good. Build-up theme information for this plugin.
      ModuleThemeInfo moduleThemeInfo = new ModuleThemeInfo( pluginId );

      List<Element> pluginNodes = pluginManifest.getRootElement().elements();
      for ( Element themeNode : pluginNodes ) {

        String themeId = themeNode.getName();
        String themeName = StringUtils.defaultIfEmpty( themeNode.attributeValue( "display-name" ), themeId );
        if ( themeName.startsWith( "${" ) ) {
          themeName = resourceBundle.getString( themeName );
        }
        Theme theme =
            new Theme( themeId, themeName, "content/" + pluginId + "/" + rootThemeFolder + "/" + themeId + "/" );
        theme.setHidden( "true".equals( themeNode.attributeValue( "hidden" ) ) );

        if ( "true".equals( themeNode.attributeValue( "system" ) ) ) {
          moduleThemeInfo.getSystemThemes().add( theme );
        } else {
          moduleThemeInfo.getModuleThemes().add( theme );
        }

        List<Element> resourceList = themeNode.elements();
        for ( Element res : resourceList ) {
          theme.addResource( new ThemeResource( theme, res.getText() ) );
View Full Code Here

      }

      out.write( ( "var core_theme_tree = " + root.toString() + ";\n\n" ).getBytes() );
      out.write( "// Inject the theme script to handle the insertion of requested theme resources\n\n".getBytes() );

      ModuleThemeInfo moduleThemeinfo = themeManager.getModuleThemeInfo( moduleName );
      if ( moduleThemeinfo != null ) {
        // Build-up JSON graph for module theme.
        root = new JSONObject();
        for ( Theme theme : moduleThemeinfo.getModuleThemes() ) {
          themeObject = new JSONObject();
          root.put( theme.getName(), themeObject );
          themeObject.put( "rootDir", theme.getThemeRootDir() );
          for ( ThemeResource res : theme.getResources() ) {
            themeObject.append( "resources", res.getLocation() );
View Full Code Here

      if ( rootThemeFolder == null ) {
        return;
      }

      // Things look good. Build-up theme information for this plugin.
      ModuleThemeInfo moduleThemeInfo = new ModuleThemeInfo( pluginId );

      List<Element> pluginNodes = pluginManifest.getRootElement().elements();
      for ( Element themeNode : pluginNodes ) {

        String themeId = themeNode.getName();
        String themeName = StringUtils.defaultIfEmpty( themeNode.attributeValue( "display-name" ), themeId );
        if ( themeName.startsWith( "${" ) && resourceBundle != null ) {
          themeName = resourceBundle.getString( themeName );
        }
        Theme theme = new Theme( themeId, themeName, pluginId + "/" + rootThemeFolder + "/" + themeId + "/" );
        theme.setHidden( "true".equals( themeNode.attributeValue( "hidden" ) ) );

        if ( "true".equals( themeNode.attributeValue( "system" ) ) ) {
          moduleThemeInfo.getSystemThemes().add( theme );
        } else {
          moduleThemeInfo.getModuleThemes().add( theme );
        }

        List<Element> resourceList = themeNode.elements();
        for ( Element res : resourceList ) {
          theme.addResource( new ThemeResource( theme, res.getText() ) );
View Full Code Here

  public Theme getModuleTheme( String moduleName, String themeId ) {
    if ( themeId == null ) {
      return null;
    }
    Theme theme = null;
    ModuleThemeInfo moduleThemeInfo =
        (ModuleThemeInfo) cache.getFromRegionCache( THEME_CACHE_REGION, MODULE_THEMES + "-" + moduleName );
    if ( moduleThemeInfo == null ) { // may have been flushed, try to fetch it
      moduleThemeInfo = collectAllModuleThemes().get( moduleName );
      if ( moduleThemeInfo == null ) {
        logger.debug( "Unable to retrieve module theme for (" + moduleName
            + ") as the module theme definition was not found" );
        return null;
      }
    }
    for ( Theme t : moduleThemeInfo.getModuleThemes() ) {
      if ( t.getId().equals( themeId ) ) {
        theme = t;
        break;
      }
    }
View Full Code Here

    }
    return theme;
  }

  public ModuleThemeInfo getModuleThemeInfo( String moduleName ) {
    ModuleThemeInfo moduleThemeInfo =
        (ModuleThemeInfo) cache.getFromRegionCache( THEME_CACHE_REGION, MODULE_THEMES + "-" + moduleName );
    if ( moduleThemeInfo == null ) { // may have been flushed, try to fetch it
      moduleThemeInfo = collectAllModuleThemes().get( moduleName );
      if ( moduleThemeInfo == null ) {
        logger.debug( "Unable to retrieve module theme for (" + moduleName
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.ui.ModuleThemeInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.