Package pt.webdetails.cdf.dd.model.inst

Examples of pt.webdetails.cdf.dd.model.inst.Dashboard


  @BeforeClass
  public static void setUp() throws Exception {
    CdfRunJsThingWriterFactory factory = new CdfRunJsThingWriterFactory();
    String indent = "";
    boolean bypassCacheRead = true;
    Dashboard dashboard = getDashboard();
    CdfRunJsDashboardWriteOptions options = getCdfRunJsDashboardWriteOptions();

    context = new PentahoCdfRunJsDashboardWriteContext( factory, indent, bypassCacheRead, dashboard, options);
  }
View Full Code Here


    builder.setSourcePath( ROOT + TEST_FOLDER + DASHBOARD + ".wcdf");
    builder.setWcdf( wcdf );
    builder.setMeta( dashboardType );
    MetaModel.Builder metaBuilder = new MetaModel.Builder();
    MetaModel model;
    Dashboard dashboard = null;
    try {
      model = metaBuilder.build();
      dashboard = builder.build( model );

    } catch ( ValidationException e ) {
View Full Code Here

    builder.setWcdf( wcdf );
    builder.setMeta( dashboardType );
    MetaModel.Builder metaBuilder = new MetaModel.Builder();
    MetaModel model;
    Dashboard dashboard = null;
    try {
      model = metaBuilder.build();
      dashboard = builder.build( model );

    } catch ( ValidationException e ) {
View Full Code Here

    } else {
      _logger.info( "Bypassing dashboard render cache, rendering." );
    }

    // 4. Get the Dashboard object
    Dashboard dash;
    try {
      dash = this.getDashboard( wcdf, cdeFilePath, bypassCacheRead );
    } catch ( ThingReadException ex ) {
      throw new ThingWriteException( ex );
    }
View Full Code Here

    }

    Set<String> invalidateDashboards = new HashSet<String>();
    invalidateDashboards.add( cdeFilePath );

    Dashboard dash = dashboardsByCdfdeFilePath.get( cdeFilePath );
    if ( dash != null && dash.getWcdf().isWidget() ) {
      collectWidgetsToInvalidate( invalidateDashboards, dashboardsByCdfdeFilePath, cdeFilePath );
    }

    if ( _logger.isDebugEnabled() ) {
      for ( String invalidCdeFilePath : invalidateDashboards ) {
View Full Code Here

  private Dashboard getDashboard(
    DashboardWcdfDescriptor wcdf,
    String cdeFilePath,
    boolean bypassCacheRead )
    throws ThingReadException {
    Dashboard cachedDash = null;
    if ( !bypassCacheRead ) {
      cachedDash = this.getDashboardFromCache( cdeFilePath );
      if ( cachedDash == null ) {
        _logger.debug( "Dashboard instance is not in cache, reading from repository." );
      }
    } else {
      _logger.info( "Bypassing Dashboard instance cache, reading from repository." );
    }

    IReadAccess userAccess = Utils.getSystemOrUserReadAccess( cdeFilePath );
    // Read cache, cache item existed and it is valid?
    if ( cachedDash != null
      && cachedDash.getSourceDate().getTime() >= userAccess.getLastModified( cdeFilePath ) ) {
      // Check WCDF file date as well

      if ( !userAccess.fileExists( wcdf.getPath() ) ) {
        throw new ThingReadException( new FileNotFoundException( wcdf.getPath() ) );
      }

      if ( cachedDash.getSourceDate().getTime() >= userAccess.getLastModified( wcdf.getPath() ) ) {
        _logger.debug( "Cached Dashboard instance is valid, using it." );

        return cachedDash;
      }
    }

    if ( cachedDash != null ) {
      _logger.info( "Cached Dashboard instance invalidated, reading from repository." );
    }

    Dashboard newDash = this.readDashboardFromCdfdeJs( wcdf );

    return this.replaceDashboardInCache( cdeFilePath, newDash, cachedDash );
  }
View Full Code Here

    Dashboard oldDash ) {
    assert newDash != null;

    synchronized ( this._dashboardsByCdfdeFilePath ) {
      if ( oldDash != null ) { // otherwise ignore
        Dashboard currDash = this._dashboardsByCdfdeFilePath.get( cdeFullPath );
        if ( currDash != null && currDash != oldDash ) {
          // Do not set.
          // Assume newer
          return currDash;
        }
View Full Code Here

    throws ThingReadException, UnsupportedThingException, ThingWriteException {
    String wcdfFilePath = cdeRelFilePath.replace( ".cdfde", ".wcdf" );

    // Obtain an UPDATED dashboard object
    DashboardManager dashMgr = DashboardManager.getInstance();
    Dashboard dash = dashMgr.getDashboard( wcdfFilePath, /*bypassCacheRead*/false );

    CggRunJsThingWriterFactory cggWriteFactory = new CggRunJsThingWriterFactory();
    IThingWriter cggDashWriter = cggWriteFactory.getWriter( dash );
    CggRunJsDashboardWriteContext cggDashContext = new CggRunJsDashboardWriteContext( cggWriteFactory, dash );
    cggDashWriter.write( access, cggDashContext, dash );
View Full Code Here

    throws ThingReadException, UnsupportedThingException, ThingWriteException {
    String wcdfFilePath = cdeRelFilePath.replace( ".cdfde", ".wcdf" );

    // Obtain an UPDATED dashboard object
    DashboardManager dashMgr = DashboardManager.getInstance();
    Dashboard dash = dashMgr.getDashboard( wcdfFilePath, /*bypassCacheRead*/false );

    CggRunJsThingWriterFactory cggWriteFactory = new CggRunJsThingWriterFactory();
    IThingWriter cggDashWriter = cggWriteFactory.getWriter( dash );
    CggRunJsDashboardWriteContext cggDashContext = new CggRunJsDashboardWriteContext( cggWriteFactory, dash );
    cggDashWriter.write( access, cggDashContext, dash );
View Full Code Here

  protected final Map<String, CdfRunJsDashboardWriteResult> getWidgets(String aliasPrefix)
  {
    Map<String, CdfRunJsDashboardWriteResult> widgetsByContainerId =
            new HashMap<String, CdfRunJsDashboardWriteResult>();
   
    Dashboard dashboard = this._context.getDashboard();
    if(dashboard.getRegularCount() > 0)
    {
      DashboardManager dashMgr = DashboardManager.getInstance();
      CdfRunJsDashboardWriteOptions options = this._context.getOptions();
     
      Iterable<Component> components = dashboard.getRegulars();
      for(Component comp : components)
      {
        if(StringUtils.isNotEmpty(comp.getName()) && comp instanceof WidgetComponent)
        {
          WidgetComponent widgetComp = (WidgetComponent)comp;
View Full Code Here

TOP

Related Classes of pt.webdetails.cdf.dd.model.inst.Dashboard

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.