protected void processWebservices( PlatformPlugin plugin, Document doc ) {
List<?> nodes = doc.selectNodes( "//webservice" ); //$NON-NLS-1$
for ( Object obj : nodes ) {
Element node = (Element) obj;
PluginServiceDefinition pws = new PluginServiceDefinition();
pws.setId( getProperty( node, "id" ) ); //$NON-NLS-1$
String type = getProperty( node, "type" ); //$NON-NLS-1$
if ( !StringUtils.isEmpty( type ) ) {
pws.setTypes( type.split( "," ) ); //$NON-NLS-1$
}
pws.setTitle( getProperty( node, "title" ) ); //$NON-NLS-1$
pws.setDescription( getProperty( node, "description" ) ); //$NON-NLS-1$
// TODO: add support for inline service class definition
pws.setServiceBeanId( getProperty( node, "ref" ) ); //$NON-NLS-1$
pws.setServiceClass( getProperty( node, "class" ) ); //$NON-NLS-1$
Collection<String> extraClasses = new ArrayList<String>();
List<?> extraNodes = node.selectNodes( "extra" ); //$NON-NLS-1$
for ( Object extra : extraNodes ) {
Element extraElement = (Element) extra;
String extraClass = getProperty( extraElement, "class" ); //$NON-NLS-1$
if ( extraClasses != null ) {
extraClasses.add( extraClass );
}
}
pws.setExtraClasses( extraClasses );
if ( pws.getServiceBeanId() == null && pws.getServiceClass() == null ) {
PluginMessageLogger.add( Messages.getInstance().getString( "PluginManager.NO_SERVICE_CLASS_FOUND" ) ); //$NON-NLS-1$
} else {
plugin.addWebservice( pws );
}
}