String description = XmlDom4JHelper.getNodeText( "description", node, "" ); //$NON-NLS-1$ //$NON-NLS-2$
String mimeType = node.attributeValue( "mime-type", "" ); //$NON-NLS-1$ //$NON-NLS-2$
String iconUrl = XmlDom4JHelper.getNodeText( "icon-url", node, "" ); //$NON-NLS-1$ //$NON-NLS-2$
String metaProviderClass = XmlDom4JHelper.getNodeText( "meta-provider", node, "" ); //$NON-NLS-1$ //$NON-NLS-2$
ContentInfo contentInfo = new ContentInfo();
contentInfo.setDescription( description );
contentInfo.setTitle( title );
contentInfo.setExtension( extension );
contentInfo.setMimeType( mimeType );
contentInfo.setIconUrl( iconUrl );
List<?> operationNodes = node.selectNodes( "operations/operation" ); //$NON-NLS-1$
for ( Object operationObj : operationNodes ) {
Element operationNode = (Element) operationObj;
String id = XmlDom4JHelper.getNodeText( "id", operationNode, "" ); //$NON-NLS-1$ //$NON-NLS-2$
String perspective = XmlDom4JHelper.getNodeText( "perspective", operationNode, "" ); //$NON-NLS-1$ //$NON-NLS-2$
if ( StringUtils.isNotEmpty( id ) ) {
PluginOperation operation = new PluginOperation( id );
if ( StringUtils.isNotEmpty( perspective ) ) {
operation.setPerspective( perspective );
}
contentInfo.addOperation( operation );
}
}
plugin.addContentInfo( contentInfo );
if ( !StringUtils.isEmpty( metaProviderClass ) ) {
plugin.getMetaProviderMap().put( contentInfo.getExtension(), metaProviderClass );
}
PluginMessageLogger.add( Messages.getInstance().getString(
"PluginManager.USER_CONTENT_TYPE_REGISTERED", extension, title ) ); //$NON-NLS-1$
} else {
PluginMessageLogger.add( Messages.getInstance().getString(