* @see net.sf.jportlet.portlet.descriptor.ApplicationDescriptorLoader#load(java.io.InputStream)
*/
public ApplicationDescriptor load( InputStream in )
throws PortletException
{
Digester digester = new Digester( );
/* portlet-app */
digester.addObjectCreate( "portlet-app", ApplicationDescriptor.class );
digester.addBeanPropertySetter( "portlet-app/portlet-app-name", "name" );
/* portlet-app/context-param */
digester.addCallMethod( "portlet-app/context-param", "addContextParameter", 2 );
digester.addCallParam( "portlet-app/context-param/param-name", 0 );
digester.addCallParam( "portlet-app/context-param/param-value", 1 );
/* portlet-app/portlet */
digester.addObjectCreate( "portlet-app/portlet", PortletDescriptor.class );
digester.addBeanPropertySetter( "portlet-app/portlet/portlet-name", "name" );
digester.addBeanPropertySetter( "portlet-app/portlet/portlet-class", "portletClass" );
digester.addBeanPropertySetter( "portlet-app/portlet/default-locale", "defaultLocale" );
digester.addBeanPropertySetter( "portlet-app/portlet/action-listener", "actionListenerClass" );
digester.addBeanPropertySetter( "portlet-app/portlet/message-listener", "messageListenerClass" );
/* portlet-app/portlet/cache */
digester.addObjectCreate( "portlet-app/portlet/cache", CacheDescriptor.class );
digester.addSetProperties( "portlet-app/portlet/cache", "mode", "mode" );
digester.addBeanPropertySetter( "portlet-app/portlet/cache/expires", "expires" );
digester.addBeanPropertySetter( "portlet-app/portlet/cache/shared", "shared" );
digester.addSetNext( "portlet-app/portlet/cache", "addCacheDescriptor" );
/* portlet-app/portlet/language */
digester.addObjectCreate( "portlet-app/portlet/language", LanguageDescriptor.class );
digester.addSetProperties( "portlet-app/portlet/language", "locale", "locale" );
digester.addBeanPropertySetter( "portlet-app/portlet/language/title", "title" );
digester.addBeanPropertySetter( "portlet-app/portlet/language/title-short", "titleShort" );
digester.addBeanPropertySetter( "portlet-app/portlet/language/description", "description" );
digester.addBeanPropertySetter( "portlet-app/portlet/language/keywords", "keywords" );
digester.addSetNext( "portlet-app/portlet/language", "addLanguageDescriptor" );
/* portlet-app/portlet/supports/markup */
digester.addObjectCreate( "portlet-app/portlet/supports/markup", MarkupDescriptor.class );
digester.addSetProperties( "portlet-app/portlet/supports/markup", "name", "markup" );
digester.addCallMethod( "portlet-app/portlet/supports/markup/view", "supportView" );
digester.addCallMethod( "portlet-app/portlet/supports/markup/edit", "supportEdit" );
digester.addCallMethod( "portlet-app/portlet/supports/markup/configure", "supportConfigure" );
digester.addCallMethod( "portlet-app/portlet/supports/markup/help", "supportHelp" );
digester.addSetNext( "portlet-app/portlet/supports/markup", "addMarkupDescriptor" );
/* portlet-app/portlet/init-param */
digester.addCallMethod( "portlet-app/portlet/init-param", "addInitParameter", 2 );
digester.addCallParam( "portlet-app/portlet/init-param/param-name", 0 );
digester.addCallParam( "portlet-app/portlet/init-param/param-value", 1 );
/* portlet-app/portlet/security-contraint/auth-contraint */
digester.addObjectCreate( "portlet-app/portlet/security-constraint/auth-constraint", AuthConstraintDescriptor.class );
digester.addSetProperties( "portlet-app/portlet/security-constraint/auth-constraint", "mode", "mode" );
digester.addBeanPropertySetter( "portlet-app/portlet/security-constraint/auth-constraint/allow-anonymous", "allowAnonymous" );
digester.addCallMethod( "portlet-app/portlet/security-constraint/auth-constraint/role-name", "addRole", 1 );
digester.addCallParam( "portlet-app/portlet/security-constraint/auth-constraint/role-name", 0 );
digester.addSetNext( "portlet-app/portlet/security-constraint/auth-constraint", "addAuthConstraintDescriptor" );
/* portlet-app/portlet/webflow/action */
digester.addObjectCreate( "portlet-app/portlet/webflow/action", WebflowActionDescriptor.class );
digester.addSetProperties( "portlet-app/portlet/webflow/action", "name", "name" );
digester.addCallMethod( "portlet-app/portlet/webflow/action/return", "addReturnUri", 2 );
digester.addCallParam( "portlet-app/portlet/webflow/action/return", 0, "code" );
digester.addCallParam( "portlet-app/portlet/webflow/action/return", 1 );
digester.addSetNext( "portlet-app/portlet/webflow/action", "addWebflowActionDescriptor" );
digester.addSetNext( "portlet-app/portlet", "addPortletDescriptor" );
try
{
digester.setValidating( true );
return ( ApplicationDescriptor ) digester.parse( in );
}
catch ( Exception e )
{
__log.error( "Unexpected error", e );