Search in sources :

Example 1 with XDataMapping

use of com.enonic.xp.site.XDataMapping in project xp by enonic.

the class XmlSiteParser method toXDataMapping.

private XDataMapping toXDataMapping(final DomElement xDataElement) {
    final XDataMapping.Builder builder = XDataMapping.create();
    final ApplicationRelativeResolver resolver = new ApplicationRelativeResolver(this.currentApplication);
    final String name = xDataElement.getAttribute(X_DATA_ATTRIBUTE_NAME);
    builder.xDataName(resolver.toXDataName(name));
    final String allowContentTypes = xDataElement.getAttribute(X_DATA_CONTENT_TYPE_ATTRIBUTE);
    builder.allowContentTypes(allowContentTypes);
    final String optional = xDataElement.getAttribute(X_DATA_OPTIONAL_ATTRIBUTE);
    if (optional != null) {
        builder.optional(Boolean.valueOf(optional));
    }
    return builder.build();
}
Also used : XDataMapping(com.enonic.xp.site.XDataMapping) ApplicationRelativeResolver(com.enonic.xp.app.ApplicationRelativeResolver)

Aggregations

ApplicationRelativeResolver (com.enonic.xp.app.ApplicationRelativeResolver)1 XDataMapping (com.enonic.xp.site.XDataMapping)1