private PortletApplicationDefinition createDefinition ( ServletContext servletContext , String name , String contextPath ) throws PortletContainerException { PortletApplicationDefinition portletApp = null ; try { InputStream paIn = servletContext . getResourceAsStream ( PORTLET_XML ) ; InputStream webIn = servletContext . getResourceAsStream ( WEB_XML ) ; if ( paIn == null ) { throw new PortletContainerException ( "Cannot find '" + PORTLET_XML + "'. Are you sure it is in the deployed package?" ) ; } if ( webIn == null ) { throw new PortletContainerException ( "Cannot find '" + WEB_XML + "'. Are you sure it is in the deployed package?" ) ; } portletApp = this . portletAppDescriptorService . read ( name , contextPath , paIn ) ; this . portletAppDescriptorService . mergeWebDescriptor ( portletApp , webIn ) ; } catch ( Exception ex ) { throw new PortletContainerException ( "Exception loading portlet descriptor for: " + servletContext . getServletContextName ( ) , ex ) ; } return portletApp ; }
Creates the portlet . xml deployment descriptor representation .