private void writeReportConfig( final Configuration config ) throws IOException { final XmlWriter writer = getXmlWriter(); final Enumeration properties = config.getConfigProperties(); if ( properties.hasMoreElements() ) { writer.writeTag( ExtParserModule.NAMESPACE, AbstractXMLDefinitionWriter.CONFIGURATION_TAG, XmlWriterSupport.OPEN ); while ( properties.hasMoreElements() ) { final String key = (String) properties.nextElement(); final String value = config.getConfigProperty( key ); if ( value != null ) { writer.writeTag( ExtParserModule.NAMESPACE, "property", "name", key, XmlWriterSupport.OPEN ); writer.writeTextNormalized( value, false ); writer.writeCloseTag(); } } writer.writeCloseTag(); } }
writer.writeTextNormalized( String.valueOf( sdf.format( entryValue ) ), false ); writer.writeCloseTag();
xmlWriter.writeTextNormalized( driverProvider.getDriver(), false ); xmlWriter.writeCloseTag(); xmlWriter.writeTextNormalized( driverProvider.getUrl(), false ); xmlWriter.writeCloseTag(); xmlWriter.writeTag( SQLDataFactoryModule.NAMESPACE, "property", "name", name, XmlWriterSupport.OPEN ); if ( name.toLowerCase().contains( "password" ) ) { xmlWriter.writeTextNormalized( PasswordEncryptionService.getInstance().encrypt( value ), false ); } else { xmlWriter.writeTextNormalized( value, false );
writer.writeTextNormalized( String.valueOf( entryValue ), false ); writer.writeCloseTag();
protected void writeConfiguration( final BundleWriterState state, final XmlWriter writer ) throws IOException { if ( state == null ) { throw new NullPointerException(); } if ( writer == null ) { throw new NullPointerException(); } final MasterReport report = state.getMasterReport(); final ModifiableConfiguration rawConfig = report.getReportConfiguration(); if ( rawConfig instanceof HierarchicalConfiguration ) { writer.writeTag( BundleNamespaces.SETTINGS, "configuration", XmlWriterSupport.OPEN ); final HierarchicalConfiguration configuration = (HierarchicalConfiguration) rawConfig; final Enumeration keys = configuration.getConfigProperties(); while ( keys.hasMoreElements() ) { final String key = (String) keys.nextElement(); final String value = configuration.getConfigProperty( key ); if ( value != null && configuration.isLocallyDefined( key ) ) { writer.writeTag( BundleNamespaces.SETTINGS, "property", "name", key, XmlWriterSupport.OPEN ); writer.writeTextNormalized( value, true ); writer.writeCloseTag(); } } writer.writeCloseTag(); } } }
public void writeExpressionParameter( final XmlWriter writer, final BeanUtility beanUtility, final String propertyName, final String namespaceUri ) throws IOException, BeanException { // filter some of the standard properties. These are system-properties // and are set elsewhere final Object property = beanUtility.getProperty( propertyName ); final Class propertyType = beanUtility.getPropertyType( propertyName ); final String value = beanUtility.getPropertyAsString( propertyName ); if ( value != null && property != null ) { final AttributeList attList = new AttributeList(); attList.setAttribute( namespaceUri, "name", propertyName ); if ( BeanUtility.isSameType( propertyType, property.getClass() ) == false ) { attList.setAttribute( namespaceUri, "class", property.getClass().getName() ); } writer.writeTag( namespaceUri, "property", attList, XmlWriterSupport.OPEN ); writer.writeTextNormalized( value, false ); writer.writeCloseTag(); } }
xmlWriter.writeTextNormalized( driverProvider.getConnectionPath(), false ); xmlWriter.writeCloseTag(); xmlWriter.writeTextNormalized( driverProvider.getUsername(), false ); xmlWriter.writeCloseTag(); xmlWriter.writeTextNormalized( PasswordEncryptionService.getInstance().encrypt( driverProvider.getPassword() ), false ); xmlWriter.writeCloseTag();
private void writePreProcessor( final XmlWriter writer, final ReportPreProcessor preProcessor ) throws IntrospectionException, BeanException, IOException { if ( writer == null ) { throw new NullPointerException(); } if ( preProcessor == null ) { throw new NullPointerException(); } // the classic way, in case the expression does not provide any meta-data. This is // in the code for legacy reasons, as there are many expression implementations out there // that do not yet provide meta-data descriptions .. final BeanUtility beanUtility = new BeanUtility( preProcessor ); final String[] propertyNames = beanUtility.getProperties(); for ( int i = 0; i < propertyNames.length; i++ ) { final String key = propertyNames[i]; final Object property = beanUtility.getProperty( key ); final Class propertyType = beanUtility.getPropertyType( key ); final String value = beanUtility.getPropertyAsString( key ); if ( value != null && property != null ) { final AttributeList attList = new AttributeList(); attList.setAttribute( BundleNamespaces.LAYOUT, "name", key ); if ( BeanUtility.isSameType( propertyType, property.getClass() ) == false ) { attList.setAttribute( BundleNamespaces.LAYOUT, "class", property.getClass().getName() ); } writer.writeTag( BundleNamespaces.LAYOUT, "property", attList, XmlWriterSupport.OPEN ); writer.writeTextNormalized( value, false ); writer.writeCloseTag(); } } }
xmlWriter.writeTextNormalized( driverProvider.getConnectionPath(), false ); xmlWriter.writeCloseTag(); xmlWriter.writeTextNormalized( driverProvider.getUsername(), false ); xmlWriter.writeCloseTag(); xmlWriter.writeTextNormalized( driverProvider.getUsername(), false ); xmlWriter.writeCloseTag();
if ( group.getField() != null ) { xmlWriter.writeTag( BundleNamespaces.LAYOUT, "field", XmlWriterSupport.OPEN ); xmlWriter.writeTextNormalized( group.getField(), false ); xmlWriter.writeCloseTag();
if ( group.getField() != null ) { xmlWriter.writeTag( BundleNamespaces.LAYOUT, "field", XmlWriterSupport.OPEN ); xmlWriter.writeTextNormalized( group.getField(), false ); xmlWriter.writeCloseTag();
if ( group.getField() != null ) { xmlWriter.writeTag( BundleNamespaces.LAYOUT, "field", XmlWriterSupport.OPEN ); xmlWriter.writeTextNormalized( group.getField(), false ); xmlWriter.writeCloseTag();
xmlWriter.writeTextNormalized( driverProvider.getDriver(), false ); xmlWriter.writeCloseTag(); xmlWriter.writeTextNormalized( driverProvider.getUrl(), false ); xmlWriter.writeCloseTag(); final String value = driverProvider.getProperty( name ); xmlWriter.writeTag( SQLDataFactoryModule.NAMESPACE, "property", "name", name, XmlWriterSupport.OPEN ); xmlWriter.writeTextNormalized( value, false ); xmlWriter.writeCloseTag();
final String query = staticDataFactory.getQuery( queryName ); xmlWriter.writeTag( StaticDataFactoryModule.NAMESPACE, "query", "name", queryName, XmlWriterSupport.OPEN ); xmlWriter.writeTextNormalized( query, false ); xmlWriter.writeCloseTag();
final String query = sqlDataFactory.getQuery( queryName ); xmlWriter.writeTag( SQLDataFactoryModule.NAMESPACE, "query", "name", queryName, XmlWriterSupport.OPEN ); xmlWriter.writeTextNormalized( query, false ); xmlWriter.writeCloseTag();
protected void openSheet( final ReportAttributeMap logicalPage, final String sheetName, final OutputProcessorMetaData metaData, final SlimSheetLayout sheetLayout, final XmlWriter xmlWriter ) throws ContentIOException, URLRewriteException, IOException { setStyleManager( createStyleManager() ); generateExternalStylePlaceHolder(); generateHeaderOnOpen( logicalPage, sheetName, xmlWriter ); final Object rawContent = logicalPage.getAttribute( AttributeNames.Html.NAMESPACE, AttributeNames.Html.EXTRA_RAW_CONTENT ); if ( rawContent != null ) { xmlWriter.writeText( String.valueOf( rawContent ) ); } // table name if ( "true".equals( metaData.getConfiguration().getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.table.html.EnableSheetNameProcessing" ) ) ) { if ( sheetName != null ) { xmlWriter.writeTag( HtmlPrinter.XHTML_NAMESPACE, "h1", getTagHelper().createSheetNameAttributes(), XmlWriterSupport.OPEN ); xmlWriter.writeTextNormalized( sheetName, true ); xmlWriter.writeCloseTag(); } } // table xmlWriter.writeTag( HtmlPrinter.XHTML_NAMESPACE, "table", getTagHelper().createTableAttributes( sheetLayout, logicalPage ), XmlWriterSupport.OPEN ); writeColumnDeclaration( sheetLayout, xmlWriter ); }
private static void writeStyleRule( final XmlWriter writer, final ElementStyleRule styleRule ) throws IOException { if ( styleRule.getSelectorCount() == 0 && styleRule.getDefinedPropertyNamesArray().length == 0 ) { return; } writer.writeTag( BundleNamespaces.STYLE, "rule", XmlWriter.OPEN ); final NamespaceCollection collection = StyleSheetParserUtil.getInstance().getNamespaceCollection(); for ( int i = 0; i < styleRule.getSelectorCount(); i += 1 ) { writer.writeTag( BundleNamespaces.STYLE, "selector", XmlWriter.OPEN ); writer.writeTextNormalized( styleRule.getSelector( i ).print( collection ), false ); writer.writeCloseTag(); } StyleWriterUtility.writeStyleRule( BundleNamespaces.STYLE, "styles", writer, styleRule ); writer.writeCloseTag(); }
final String field = (String) fields.get( f ); writer.writeTag( ExtParserModule.NAMESPACE, ReportDescriptionWriter.FIELD_TAG, XmlWriterSupport.OPEN ); writer.writeTextNormalized( field, false ); writer.writeCloseTag();
for ( final Map.Entry<String, String> e : entries ) { writer.writeTag( ConnectionModule.NAMESPACE, NODE_ATTRIBUTE, "name", e.getKey(), XmlWriter.OPEN ); writer.writeTextNormalized( e.getValue(), false ); writer.writeCloseTag();
if ( isBasicKey( parameterNames, od ) ) { writer.writeTag( ExtParserModule.NAMESPACE, AbstractXMLDefinitionWriter.BASIC_KEY_TAG, p, XmlWriterSupport.OPEN ); writer.writeTextNormalized( (String) od.getParameter( "value" ), false ); writer.writeCloseTag(); } else {