use of com.enonic.xp.lib.common.PropertyTreeMapper in project xp by enonic.
the class RepositoryMapper method serialize.
private void serialize(final MapGenerator gen, final JsonNode jsonNode) {
final PropertyTree propertyTree = JsonToPropertyTreeTranslator.translate(jsonNode);
new PropertyTreeMapper(propertyTree).serialize(gen);
}
use of com.enonic.xp.lib.common.PropertyTreeMapper in project xp by enonic.
the class PageMapper method serializePage.
private void serializePage(final MapGenerator gen, final Page value) {
gen.map(PAGE);
gen.value(TYPE, PAGE);
gen.value(PATH, ComponentPath.DIVIDER);
gen.value(TEMPLATE, value.getTemplate());
gen.value(DESCRIPTOR, value.getDescriptor());
if (value.hasConfig()) {
gen.map(CONFIG);
new PropertyTreeMapper(value.getConfig()).serialize(gen);
gen.end();
}
if (value.hasRegions()) {
serializeRegions(gen, value.getRegions());
}
gen.end();
}
use of com.enonic.xp.lib.common.PropertyTreeMapper in project xp by enonic.
the class ComponentMapper method serialize.
private void serialize(final MapGenerator gen, final DescriptorBasedComponent comp) {
gen.value(DESCRIPTOR, comp.getDescriptor());
if (comp.getConfig() != null) {
gen.map(CONFIG);
new PropertyTreeMapper(comp.getConfig()).serialize(gen);
gen.end();
}
}
use of com.enonic.xp.lib.common.PropertyTreeMapper in project xp by enonic.
the class ModifyProfileHandler method newProfileEditor.
private void newProfileEditor(final EditableUser edit) {
final PropertyTree profile = edit.source.getProfile();
final PropertyTreeMapper mapper = createPropertyTreeMapper(profile, true);
final ScriptValue scriptValue = this.editor.call(mapper);
updateUser(edit, scriptValue);
}
use of com.enonic.xp.lib.common.PropertyTreeMapper in project xp by enonic.
the class ContentMapper method serializeData.
private void serializeData(final MapGenerator gen, final PropertyTree value) {
gen.map("data");
new PropertyTreeMapper(value).serialize(gen);
gen.end();
}
Aggregations