Search in sources :

Example 31 with ExtraData

use of com.enonic.xp.content.ExtraData in project xp by enonic.

the class HtmlAreaContentProcessor method processExtraData.

private void processExtraData(final ExtraDatas extraDatas, final ContentIds.Builder processedIds) {
    if (extraDatas != null) {
        final XDatas xDatas = xDataService.getByNames(extraDatas.getNames());
        if (xDatas.getSize() > 0) {
            xDatas.forEach(xData -> {
                if (extraDatas == null) {
                    return;
                }
                final ExtraData extraData = extraDatas.getMetadata(xData.getName());
                if (extraData != null) {
                    final Collection<Property> properties = getProperties(extraData.getData(), xData.getForm().getFormItems());
                    processDataTree(properties, processedIds);
                }
            });
        }
    }
}
Also used : XDatas(com.enonic.xp.schema.xdata.XDatas) ExtraData(com.enonic.xp.content.ExtraData) Property(com.enonic.xp.data.Property)

Aggregations

ExtraData (com.enonic.xp.content.ExtraData)31 PropertyTree (com.enonic.xp.data.PropertyTree)18 Test (org.junit.jupiter.api.Test)10 XData (com.enonic.xp.schema.xdata.XData)8 XDataName (com.enonic.xp.schema.xdata.XDataName)8 Content (com.enonic.xp.content.Content)7 CreateContentParams (com.enonic.xp.content.CreateContentParams)5 ExtraDatas (com.enonic.xp.content.ExtraDatas)5 ApplicationKey (com.enonic.xp.app.ApplicationKey)4 Media (com.enonic.xp.content.Media)4 ProcessCreateParams (com.enonic.xp.content.processor.ProcessCreateParams)4 ProcessCreateResult (com.enonic.xp.content.processor.ProcessCreateResult)4 PropertySet (com.enonic.xp.data.PropertySet)4 Attachment (com.enonic.xp.attachment.Attachment)3 FormItem (com.enonic.xp.form.FormItem)3 Input (com.enonic.xp.form.Input)3 GeoPoint (com.enonic.xp.util.GeoPoint)3 ImmutableMap (com.google.common.collect.ImmutableMap)3 Map (java.util.Map)3 CreateAttachment (com.enonic.xp.attachment.CreateAttachment)2