CdfRunJsDashboardWriteOptions options,
boolean bypassCacheRead )
throws ThingWriteException {
// 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();
writer.write( dashboardWriteBuilder, writeContext, dash );
return dashboardWriteBuilder.build();
}