Package org.apache.pluto.portalImpl.xml.XmlParser

Examples of org.apache.pluto.portalImpl.xml.XmlParser.EntityResolver


        }
        InputSource source = new InputSource(stream);
        Unmarshaller unmarshaller;
        try {
            unmarshaller = new Unmarshaller(portletXmlMapping);
            unmarshaller.setEntityResolver(new EntityResolver(Constants.RES_PORTLET_DTDS, Constants.RES_PORTLET_DTD_NAMES));
        } catch (MappingException e) {
            throw (UnavailableException) new UnavailableException("Unable to construct unmarshaller for portlet.xml").initCause(e);
        }
        unmarshaller.setIgnoreExtraElements(true);
        PortletApplicationDefinitionImpl portletApp;
        try {
            portletApp = (PortletApplicationDefinitionImpl) unmarshaller.unmarshal(source);
        } catch (MarshalException e) {
            throw (UnavailableException) new UnavailableException("Unable to unmarshal portlet.xml from context " + appContext.getServletContextName()).initCause(e);
        } catch (ValidationException e) {
            throw (UnavailableException) new UnavailableException("Unable to validate portlet.xml from context " + appContext.getServletContextName()).initCause(e);
        }

        // load its web.xml
        stream = appContext.getResourceAsStream("/WEB-INF/web.xml");
        if (stream == null) {
            throw new UnavailableException("No web.xml found in context " + appContext.getServletContextName());
        }
        source = new InputSource(stream);
        try {
            unmarshaller = new Unmarshaller(webXmlMapping);
            unmarshaller.setEntityResolver(new EntityResolver(Constants.RES_WEB_PUBLIC_ID,
                                                       Constants.RES_WEB_DTD,
                                                       Constants.RES_WEB_DTD_NAME));
        } catch (MappingException e) {
            throw (UnavailableException) new UnavailableException("Unable to construct unmarshaller for web.xml").initCause(e);
        }
View Full Code Here


        }
        InputSource source = new InputSource(stream);
        Unmarshaller unmarshaller;
        try {
            unmarshaller = new Unmarshaller(portletXmlMapping);
            unmarshaller.setEntityResolver(new EntityResolver(Constants.RES_PORTLET_DTDS, Constants.RES_PORTLET_DTD_NAMES));
        } catch (MappingException e) {
            throw (UnavailableException) new UnavailableException("Unable to construct unmarshaller for portlet.xml").initCause(e);
        }
        unmarshaller.setIgnoreExtraElements(true);
        PortletApplicationDefinitionImpl portletApp;
        try {
            portletApp = (PortletApplicationDefinitionImpl) unmarshaller.unmarshal(source);
        } catch (MarshalException e) {
            throw (UnavailableException) new UnavailableException("Unable to unmarshal portlet.xml from context " + appContext.getServletContextName()).initCause(e);
        } catch (ValidationException e) {
            throw (UnavailableException) new UnavailableException("Unable to validate portlet.xml from context " + appContext.getServletContextName()).initCause(e);
        }

        // load its web.xml
        stream = appContext.getResourceAsStream("/WEB-INF/web.xml");
        if (stream == null) {
            throw new UnavailableException("No web.xml found in context " + appContext.getServletContextName());
        }
        source = new InputSource(stream);
        try {
            unmarshaller = new Unmarshaller(webXmlMapping);
            unmarshaller.setEntityResolver(new EntityResolver(Constants.RES_WEB_PUBLIC_ID,
                                                       Constants.RES_WEB_DTD,
                                                       Constants.RES_WEB_DTD_NAME));
        } catch (MappingException e) {
            throw (UnavailableException) new UnavailableException("Unable to construct unmarshaller for web.xml").initCause(e);
        }
View Full Code Here

        }
        InputSource source = new InputSource(stream);
        Unmarshaller unmarshaller;
        try {
            unmarshaller = new Unmarshaller(portletXmlMapping);
            unmarshaller.setEntityResolver(new EntityResolver(Constants.RES_PORTLET_DTDS, Constants.RES_PORTLET_DTD_NAMES));
        } catch (MappingException e) {
            throw (UnavailableException) new UnavailableException("Unable to construct unmarshaller for portlet.xml at context " + contextName).initCause(e);
        }
        unmarshaller.setIgnoreExtraElements(true);
        PortletApplicationDefinitionImpl portletApp;
        try {
            portletApp = (PortletApplicationDefinitionImpl) unmarshaller.unmarshal(source);
        } catch (MarshalException e) {
            throw (UnavailableException) new UnavailableException("Unable to unmarshal portlet.xml from context " + contextName).initCause(e);
        } catch (ValidationException e) {
            throw (UnavailableException) new UnavailableException("Unable to validate portlet.xml from context " + contextName).initCause(e);
        }

        // load its web.xml
        stream = appContext.getResourceAsStream("/WEB-INF/web.xml");
        if (stream == null) {
            throw new UnavailableException("No web.xml found in context " + contextName);
        }
        source = new InputSource(stream);
        try {
            unmarshaller = new Unmarshaller(webXmlMapping);
            unmarshaller.setEntityResolver(new EntityResolver(Constants.RES_WEB_PUBLIC_ID,
                                                       Constants.RES_WEB_DTD,
                                                       Constants.RES_WEB_DTD_NAME));
        } catch (MappingException e) {
            throw (UnavailableException) new UnavailableException("Unable to construct unmarshaller for web.xml from context " + contextName + ". Error message: " + e.getMessage()).initCause(e);
        }
View Full Code Here

TOP

Related Classes of org.apache.pluto.portalImpl.xml.XmlParser.EntityResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.