for (Field f : type.getFields()) { String name = f.getName().getLocalName(); Serializable value = hasFacet ? doc.getPropertyValue(name) : null;
for (Field f : type.getFields()) { String name = f.getName().getLocalName(); if (!map.containsKey(name)) {
for (Field f : type.getFields()) { String name = f.getName().getLocalName(); if (!map.containsKey(name)) {
/** * @since 8.3 */ public static void writeVariables(DocumentRoute item, JsonGenerator jg, MarshallerRegistry registry, RenderingContext ctx, SchemaManager schemaManager) throws IOException, JsonGenerationException { String facet = (String) item.getDocument().getPropertyValue(GraphRoute.PROP_VARIABLES_FACET); if (StringUtils.isNotBlank(facet)) { CompositeType type = schemaManager.getFacet(facet); if (type != null) { boolean hasFacet = item.getDocument().hasFacet(facet); Writer<Property> propertyWriter = registry.getWriter(ctx, Property.class, APPLICATION_JSON_TYPE); // provides the current route to the property marshaller try (Closeable resource = ctx.wrap() .with(DocumentModelJsonWriter.ENTITY_TYPE, item.getDocument()) .open()) { for (Field f : type.getFields()) { String name = f.getName().getLocalName(); Property property = hasFacet ? item.getDocument().getProperty(name) : null; OutputStream out = new OutputStreamWithJsonWriter(jg); jg.writeFieldName(name); propertyWriter.write(property, Property.class, Property.class, APPLICATION_JSON_TYPE, out); } } } } }
/** * @since 8.3 */ public static void writeTaskVariables(GraphNode node, JsonGenerator jg, MarshallerRegistry registry, RenderingContext ctx, SchemaManager schemaManager) throws IOException { if (node == null || node.getDocument() == null) { return; } String facet = (String) node.getDocument().getPropertyValue(GraphNode.PROP_VARIABLES_FACET); if (StringUtils.isNotBlank(facet)) { CompositeType type = schemaManager.getFacet(facet); if (type != null) { boolean hasFacet = node.getDocument().hasFacet(facet); Writer<Property> propertyWriter = registry.getWriter(ctx, Property.class, APPLICATION_JSON_TYPE); // provides the current route to the property marshaller try (Closeable resource = ctx.wrap() .with(DocumentModelJsonWriter.ENTITY_TYPE, node.getDocument()) .open()) { for (Field f : type.getFields()) { String name = f.getName().getLocalName(); Property property = hasFacet ? node.getDocument().getProperty(name) : null; OutputStream out = new OutputStreamWithJsonWriter(jg); jg.writeFieldName(name); propertyWriter.write(property, Property.class, Property.class, APPLICATION_JSON_TYPE, out); } } } } }
.with(DocumentModelJsonWriter.ENTITY_TYPE, route.getDocument()) .open()) { for (Field f : type.getFields()) { String name = f.getName().getLocalName(); if (transientSchema.hasField(name)) {