本文整理汇总了Java中org.eclipse.birt.report.engine.api.HTMLRenderOption.setEnableMetadata方法的典型用法代码示例。如果您正苦于以下问题:Java HTMLRenderOption.setEnableMetadata方法的具体用法?Java HTMLRenderOption.setEnableMetadata怎么用?Java HTMLRenderOption.setEnableMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.birt.report.engine.api.HTMLRenderOption
的用法示例。
在下文中一共展示了HTMLRenderOption.setEnableMetadata方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testVisionOptimize
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
public void testVisionOptimize( ) throws EngineException, IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
options.setOutputMasterPageMargins( true );
options.setEmbeddable( false );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
String regex = "<col style=\"width: 1.25in;\">";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例2: testTableColumnWidth
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
*
* @throws EngineException
* @throws IOException
*/
public void testTableColumnWidth( ) throws EngineException, IOException
{
//the default cell to place the group icon is the first cell.
String designFile = "org/eclipse/birt/report/engine/emitter/html/TableColumnWidth.xml";
HTMLRenderOption options = new HTMLRenderOption( );
options.setLayoutPreference( "fixed" );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
content = content.replaceAll( "\n", "\"\n\"+\\\\n" );
String regex = "table-layout:fixed";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例3: testGetEnableMetadata
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
* Test setEnableMetadata(boolean enableMetadata) getEnableMetadata()
*/
public void testGetEnableMetadata( )
{
HTMLRenderOption option = new HTMLRenderOption( );
option.setEnableMetadata( false );
assertFalse( option.getEnableMetadata( ) );
}
示例4: testScriptOutput
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
*
* @throws EngineException
* @throws IOException
*/
public void testScriptOutput( ) throws EngineException, IOException
{
//the default cell to place the group icon is the first cell.
String designFile = "org/eclipse/birt/report/engine/emitter/html/comments.xml";
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
content = content.replaceAll( "\n", "\"\n\"+\\\\n" );
String regex = "<!--comments1-->";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
regex = "<!--comments2-->";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
regex = "<!--comments3-->";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例5: testActionScript
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
*
* @throws EngineException
* @throws IOException
*/
public void testActionScript( ) throws EngineException, IOException
{
//the default cell to place the group icon is the first cell.
String designFile = "org/eclipse/birt/report/engine/emitter/html/DrillThroughActionScriptTest.xml";
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
content = content.replaceAll( "\n", "\"\n\"+\\\\n" );
String regex = "report-document";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
regex = "report-design";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例6: testScriptOutput
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
*
* @throws EngineException
* @throws IOException
*/
public void testScriptOutput( ) throws EngineException, IOException
{
//the default cell to place the group icon is the first cell.
String designFile = "org/eclipse/birt/report/engine/emitter/html/ScriptOutputTest.xml";
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
content = content.replaceAll( "\n", "\"\n\"+\\\\n" );
String regex = "<script[^<>]*>[^<>]*function test[^<>]*</script>"
+"[^<>]*<script[^<>]*src=\"birt/ajax/ui/app/BirtToolbar.js\"[^<>]*>[^<>]*</script>"
+"[^<>]*<script[^<>]*src=\"birt/ajax/ui/app/sdfsadfsadfasd.js\"[^<>]*>[^<>]*</script>";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例7: getAllInstanceIds
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
private Set<InstanceID> getAllInstanceIds( IReportDocument document )
throws EngineException, UnsupportedEncodingException
{
Set<InstanceID> instanceIds = new HashSet<InstanceID>();
IRenderTask task = engine.createRenderTask( document );
ByteArrayOutputStream ostream = new ByteArrayOutputStream( );
// create the render options
HTMLRenderOption option = new HTMLRenderOption( );
option.setOutputFormat( "html" );
option.setOutputStream( ostream );
option.setEnableMetadata( true );
// set the render options
task.setRenderOption( option );
assertTrue(task.getRenderOption( ).equals( option ));
task.render( );
task.close( );
String content = ostream.toString( "utf-8" );
// get all the instance ids
Pattern iidPattern = Pattern.compile( "iid=\"([^\"]*)\"" );
Matcher matcher = iidPattern.matcher( content );
while ( matcher.find( ) )
{
String strIid = matcher.group( 1 );
InstanceID iid = InstanceID.parse( strIid );
instanceIds.add( iid );
}
return instanceIds;
}
示例8: getAllInstanceIds
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
private Set<InstanceID> getAllInstanceIds( IReportDocument document )
throws EngineException, UnsupportedEncodingException
{
Set<InstanceID> instanceIds = new HashSet<InstanceID>( );
IRenderTask task = engine.createRenderTask( document );
ByteArrayOutputStream ostream = new ByteArrayOutputStream( );
// create the render options
HTMLRenderOption option = new HTMLRenderOption( );
option.setOutputFormat( "html" );
option.setOutputStream( ostream );
option.setEnableMetadata( true );
// set the render options
task.setRenderOption( option );
assertTrue( task.getRenderOption( ).equals( option ) );
task.render( );
task.close( );
String content = ostream.toString( "utf-8" );
// get all the instance ids
Pattern iidPattern = Pattern.compile( "iid=\"([^\"]*)\"" );
Matcher matcher = iidPattern.matcher( content );
while ( matcher.find( ) )
{
String strIid = matcher.group( 1 );
InstanceID iid = InstanceID.parse( strIid );
instanceIds.add( iid );
}
return instanceIds;
}