Search in sources :

Example 6 with PropertyTreeMapper

use of com.enonic.xp.lib.common.PropertyTreeMapper in project xp by enonic.

the class ContentMapper method serializeExtraData.

private void serializeExtraData(final MapGenerator gen, final Iterable<ExtraData> values) {
    gen.map("x");
    final ListMultimap<ApplicationKey, ExtraData> extradatasByModule = ArrayListMultimap.create();
    for (ExtraData extraData : values) {
        extradatasByModule.put(extraData.getName().getApplicationKey(), extraData);
    }
    for (final ApplicationKey applicationKey : extradatasByModule.keys()) {
        final List<ExtraData> extraDatas = extradatasByModule.get(applicationKey);
        if (extraDatas.isEmpty()) {
            continue;
        }
        gen.map(extraDatas.get(0).getApplicationPrefix());
        for (final ExtraData extraData : extraDatas) {
            gen.map(extraData.getName().getLocalName());
            new PropertyTreeMapper(extraData.getData()).serialize(gen);
            gen.end();
        }
        gen.end();
    }
    gen.end();
}
Also used : ApplicationKey(com.enonic.xp.app.ApplicationKey) ExtraData(com.enonic.xp.content.ExtraData) PropertyTreeMapper(com.enonic.xp.lib.common.PropertyTreeMapper)

Example 7 with PropertyTreeMapper

use of com.enonic.xp.lib.common.PropertyTreeMapper in project xp by enonic.

the class AuditLogMapper method serializeData.

private static 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)

Example 8 with PropertyTreeMapper

use of com.enonic.xp.lib.common.PropertyTreeMapper in project xp by enonic.

the class ScheduledJobMapper method serializeConfig.

private void serializeConfig(final MapGenerator gen, final PropertyTree config) {
    gen.map("config");
    new PropertyTreeMapper(config).serialize(gen);
    gen.end();
}
Also used : PropertyTreeMapper(com.enonic.xp.lib.common.PropertyTreeMapper)

Example 9 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 PropertyTree repositoryData) {
    gen.map("data");
    new PropertyTreeMapper(repositoryData).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