if( pluginID.equals( "org.eclipse.sapphire.doc" ) )
{
if( href.startsWith( "html/extensions/existing.html" ) )
{
final ExtensionSummaryExportOp op = ExtensionSummaryExportOp.TYPE.instantiate();
op.setDocumentBodyTitle( "Sapphire Extensions" );
content = op.execute( getExtensions(), null );
}
else if( href.startsWith( "html/el/index.html" ) )
{
final ExtensionSummaryExportOp op = ExtensionSummaryExportOp.TYPE.instantiate();
op.setCreateFinishedDocument( false );
final ExtensionSummarySectionDef section = op.getSections().insert();
section.setExtensionType( SapphireExtensionDef.PROP_FUNCTIONS.name() );
section.setIncludeSectionHeader( false );
final ExtensionSummarySectionColumnDef nameColumn = section.getColumns().insert();
nameColumn.setName( FunctionDef.PROP_NAME.name() );
final ExtensionSummarySectionColumnDef descColumn = section.getColumns().insert();
descColumn.setName( FunctionDef.PROP_DESCRIPTION.name() );
final String functions = op.execute( getExtensions(), null );
content = loadResource( "html/el/index.html" );
content = content.replace( "##functions##", functions );
}
else if( href.startsWith( "html/services/ConversionService.html" ) )
{
final ExtensionSummaryExportOp op = ExtensionSummaryExportOp.TYPE.instantiate();
op.setCreateFinishedDocument( false );
final ExtensionSummarySectionDef section = op.getSections().insert();
section.setExtensionType( SapphireExtensionDef.PROP_SERVICES.name() );
section.setIncludeSectionHeader( false );
final ExtensionSummarySectionColumnDef idColumn = section.getColumns().insert();
idColumn.setName( ServiceDef.PROP_ID.name() );
final ExtensionSummarySectionColumnDef descColumn = section.getColumns().insert();
descColumn.setName( ServiceDef.PROP_DESCRIPTION.name() );
final Filter<Element> filter = new Filter<Element>()
{
@Override
public boolean allows( final Element element )
{
if( element instanceof ServiceDef )
{
final ServiceDef def = (ServiceDef) element;
final String id = def.getId().text();
final JavaType type = def.getImplementation().target();
final Class<?> cl = ( type == null ? null : (Class<?>) type.artifact() );
if( id != null && id.startsWith( "Sapphire." ) &&
cl != null && ConversionService.class.isAssignableFrom( cl ) )
{
return true;
}
}
return false;
}
};
final String functions = op.execute( getExtensions(), filter );
content = loadResource( "html/services/ConversionService.html" );
content = content.replace( "##servicess##", functions );
}
else if( href.startsWith( "html/services/FactsService.html" ) )
{
final ExtensionSummaryExportOp op = ExtensionSummaryExportOp.TYPE.instantiate();
op.setCreateFinishedDocument( false );
final ExtensionSummarySectionDef section = op.getSections().insert();
section.setExtensionType( SapphireExtensionDef.PROP_SERVICES.name() );
section.setIncludeSectionHeader( false );
final ExtensionSummarySectionColumnDef idColumn = section.getColumns().insert();
idColumn.setName( ServiceDef.PROP_ID.name() );
final ExtensionSummarySectionColumnDef descColumn = section.getColumns().insert();
descColumn.setName( ServiceDef.PROP_DESCRIPTION.name() );
final Filter<Element> filter = new Filter<Element>()
{
@Override
public boolean allows( final Element element )
{
if( element instanceof ServiceDef )
{
final ServiceDef def = (ServiceDef) element;
final String id = def.getId().text();
final JavaType type = def.getImplementation().target();
final Class<?> cl = ( type == null ? null : (Class<?>) type.artifact() );
if( id != null && id.startsWith( "Sapphire." ) &&
cl != null && FactsService.class.isAssignableFrom( cl ) )
{
return true;
}
}
return false;
}
};
final String functions = op.execute( getExtensions(), filter );
content = loadResource( "html/services/FactsService.html" );
content = content.replace( "##servicess##", functions );
}
else if( href.startsWith( "html/actions/index.html" ) )