}
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);
}