Search in sources :

Example 1 with PropertyTreeMapper

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);
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) PropertyTreeMapper(com.enonic.xp.lib.common.PropertyTreeMapper)

Example 2 with PropertyTreeMapper

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();
}
Also used : PropertyTreeMapper(com.enonic.xp.lib.common.PropertyTreeMapper)

Example 3 with PropertyTreeMapper

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();
    }
}
Also used : PropertyTreeMapper(com.enonic.xp.lib.common.PropertyTreeMapper)

Example 4 with PropertyTreeMapper

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);
}
Also used : ScriptValue(com.enonic.xp.script.ScriptValue) PropertyTree(com.enonic.xp.data.PropertyTree) PropertyTreeMapper(com.enonic.xp.lib.common.PropertyTreeMapper)

Example 5 with PropertyTreeMapper

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();
}
Also used : PropertyTreeMapper(com.enonic.xp.lib.common.PropertyTreeMapper)

Aggregations

PropertyTreeMapper (com.enonic.xp.lib.common.PropertyTreeMapper)9 PropertyTree (com.enonic.xp.data.PropertyTree)2 ApplicationKey (com.enonic.xp.app.ApplicationKey)1 ExtraData (com.enonic.xp.content.ExtraData)1 ScriptValue (com.enonic.xp.script.ScriptValue)1