Search in sources :

Example 6 with XmlException

use of com.enonic.xp.xml.XmlException 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 7 with XmlException

use of com.enonic.xp.xml.XmlException in project xp by enonic.

the class IdProviderDescriptorServiceImpl method parseXml.

private void parseXml(final Resource resource, final IdProviderDescriptor.Builder builder) {
    try {
        final XmlIdProviderDescriptorParser parser = new XmlIdProviderDescriptorParser();
        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 auth descriptor [" + resource.getUrl() + "]: " + e.getMessage());
    }
}
Also used : XmlIdProviderDescriptorParser(com.enonic.xp.xml.parser.XmlIdProviderDescriptorParser) XmlException(com.enonic.xp.xml.XmlException) XmlException(com.enonic.xp.xml.XmlException)

Aggregations

XmlException (com.enonic.xp.xml.XmlException)7 XmlNodeParser (com.enonic.xp.core.impl.export.xml.XmlNodeParser)1 ImportNodeException (com.enonic.xp.export.ImportNodeException)1 ImportNodeResult (com.enonic.xp.node.ImportNodeResult)1 Node (com.enonic.xp.node.Node)1 NodePath (com.enonic.xp.node.NodePath)1 VirtualFile (com.enonic.xp.vfs.VirtualFile)1 XmlIdProviderDescriptorParser (com.enonic.xp.xml.parser.XmlIdProviderDescriptorParser)1 XmlLayoutDescriptorParser (com.enonic.xp.xml.parser.XmlLayoutDescriptorParser)1 XmlMacroDescriptorParser (com.enonic.xp.xml.parser.XmlMacroDescriptorParser)1 XmlPageDescriptorParser (com.enonic.xp.xml.parser.XmlPageDescriptorParser)1 XmlPartDescriptorParser (com.enonic.xp.xml.parser.XmlPartDescriptorParser)1 CharSource (com.google.common.io.CharSource)1