Search in sources :

Example 1 with XmlPageDescriptorParser

use of com.enonic.xp.xml.parser.XmlPageDescriptorParser in project xp by enonic.

the class PageDescriptorServiceImpl method parseXml.

private void parseXml(final Resource resource, final PageDescriptor.Builder builder) {
    try {
        final XmlPageDescriptorParser parser = new XmlPageDescriptorParser();
        parser.builder(builder);
        parser.currentApplication(resource.getKey().getApplicationKey());
        parser.source(resource.readString());
        parser.parse();
    } catch (final Exception e) {
        throw new XmlException(e, "Could not load page descriptor [" + resource.getUrl() + "]: " + e.getMessage());
    }
}
Also used : XmlException(com.enonic.xp.xml.XmlException) XmlPageDescriptorParser(com.enonic.xp.xml.parser.XmlPageDescriptorParser) XmlException(com.enonic.xp.xml.XmlException)

Example 2 with XmlPageDescriptorParser

use of com.enonic.xp.xml.parser.XmlPageDescriptorParser in project xp by enonic.

the class RenderBaseHandlerTest method parseXml.

private void parseXml(final ApplicationKey applicationKey, final PageDescriptor.Builder builder, final String xml) {
    final XmlPageDescriptorParser parser = new XmlPageDescriptorParser();
    parser.builder(builder);
    parser.currentApplication(applicationKey);
    parser.source(xml);
    parser.parse();
}
Also used : XmlPageDescriptorParser(com.enonic.xp.xml.parser.XmlPageDescriptorParser)

Aggregations

XmlPageDescriptorParser (com.enonic.xp.xml.parser.XmlPageDescriptorParser)2 XmlException (com.enonic.xp.xml.XmlException)1