Examples of CdfRunJsDashboardWriteContext


Examples of pt.webdetails.cdf.dd.model.inst.writer.cdfrunjs.dashboard.CdfRunJsDashboardWriteContext

    // 1. Obtain a Writer for the CdfRunJs format
    CdfRunJsThingWriterFactory writerFactory = new CdfRunJsThingWriterFactory();
    CdfRunJsDashboardWriter writer = writerFactory.getDashboardWriter( dash );

    // 2. Write it
    CdfRunJsDashboardWriteContext writeContext = CdeEngine.getInstance().
      getEnvironment().getCdfRunJsDashboardWriteContext( writerFactory, /*indent*/"", bypassCacheRead, dash, options );

    CdfRunJsDashboardWriteResult.Builder dashboardWriteBuilder =
      new CdfRunJsDashboardWriteResult.Builder();

View Full Code Here

Examples of pt.webdetails.cdf.dd.model.inst.writer.cdfrunjs.dashboard.CdfRunJsDashboardWriteContext

    // Options are kind of irrelevant in this context,
    // as we're only rendering one component, not a dashboard (and not a widget component).
    CdfRunJsDashboardWriteOptions options = new CdfRunJsDashboardWriteOptions(false, false, "", "");

    // Idem
    CdfRunJsDashboardWriteContext writeContext =
        CdeEngine.getInstance().getEnvironment().getCdfRunJsDashboardWriteContext(
            writerFactory,
            /*indent*/"",
            /*bypassCacheRead*/true,
            context.getDashboard(),
View Full Code Here

Examples of pt.webdetails.cdf.dd.model.inst.writer.cdfrunjs.dashboard.CdfRunJsDashboardWriteContext

    {
      addJsProperty(out, definitionName, " {", INDENT1, true);
      indent = INDENT2;
    }
   
    CdfRunJsDashboardWriteContext childContext = context.withIndent(indent);
    childContext.setIsFirstInList(true);
   
    IThingWriterFactory factory = context.getFactory();
    for(PropertyTypeUsage propUsage : compType.getPropertiesByDefinition(definitionName))
    {
      String propName = propUsage.getName();
      // The 'name' property is handled specially
      if(!(isDefaultDefinition && "name".equalsIgnoreCase(propName)))
      {
        PropertyBinding propBind = comp.tryGetPropertyBindingByName(propName);
        if(propBind != null)
        {
          IThingWriter writer;
          try
          {
            writer = factory.getWriter(propBind);
          }
          catch(UnsupportedThingException ex)
          {
            throw new ThingWriteException(ex);
          }
         
          // TODO: empty properties are not output
          // and the NEWLINE is already output...
          if(!isDefaultDefinition && childContext.isFirstInList())
          {
            out.append(NEWLINE);
          }
         
          writer.write(out, childContext, propBind);
        }
      }
    }
   
    if(comp.getExtensionPropertyBindingCount() > 0)
    {
      // HACK: CCC V1 properties have to go into the "chartDefinition" definition...
      boolean isCCC = compType.getName().startsWith("ccc");
      if(isCCC ? !isDefaultDefinition : isDefaultDefinition)
      {
        Iterable<ExtensionPropertyBinding> propBinds = comp.getExtensionPropertyBindings();
        for(ExtensionPropertyBinding propBind : propBinds)
        {
          IThingWriter writer;
          try
          {
            writer = factory.getWriter(propBind);
          }
          catch(UnsupportedThingException ex)
          {
            throw new ThingWriteException(ex);
          }

          if(!isDefaultDefinition && childContext.isFirstInList())
          {
            out.append(NEWLINE);
          }
         
          writer.write(out, childContext, propBind);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.