Examples of AttributeList


Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

    if (element == null)
    {
      throw new NullPointerException();
    }

    final AttributeList attList = createMainAttributes(element, xmlWriter);
    xmlWriter.writeTag(BundleNamespaces.LAYOUT, "crosstab-row-group-body", attList, XmlWriterSupport.OPEN);
    writeElementBody(bundle, state, element, xmlWriter);
    writeChildElements(bundle, state, xmlWriter, (Section) element);
    xmlWriter.writeCloseTag();
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

    if (element == null)
    {
      throw new NullPointerException();
    }

    final AttributeList attList = createMainAttributes(element, xmlWriter);
    xmlWriter.writeTag(BundleNamespaces.LAYOUT, "crosstab-column-group-body", attList, XmlWriterSupport.OPEN);
    writeElementBody(bundle, state, element, xmlWriter);
    writeChildElements(bundle, state, xmlWriter, (Section) element);
    xmlWriter.writeCloseTag();
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

    if (element == null)
    {
      throw new NullPointerException();
    }

    final AttributeList attList = createMainAttributes(element, xmlWriter);
    xmlWriter.writeTag(BundleNamespaces.LAYOUT, "crosstab-summary-header", attList, XmlWriterSupport.OPEN);
    writeElementBody(bundle, state, element, xmlWriter);
    writeChildElements(bundle, state, xmlWriter, (Band) element);
    xmlWriter.writeCloseTag();
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

  {
    final MasterReport report = (MasterReport) getReport();
    final String reportName = report.getTitle();
    final XmlWriter xmlWriter = getXmlWriter();

    final AttributeList attList = new AttributeList();
    attList.addNamespaceDeclaration("", ExtParserModule.NAMESPACE);
    if (reportName != null)
    {
      attList.setAttribute(ExtParserModule.NAMESPACE, "name", reportName);
    }

    final String query = report.getQuery();
    if (query != null)
    {
      attList.setAttribute(ExtParserModule.NAMESPACE, "query", query);
    }
    attList.setAttribute(ExtParserModule.NAMESPACE,
        "engine-version", ClassicEngineInfo.getInstance().getVersion());

    xmlWriter.writeTag(ExtParserModule.NAMESPACE,
        AbstractXMLDefinitionWriter.REPORT_DEFINITION_TAG, attList, XmlWriterSupport.OPEN);
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

                           final BundleWriterState state,
                           final XmlWriter xmlWriter,
                           final Element element)
      throws IOException, BundleWriterException
  {
    final AttributeList attList = createMainAttributes(element, xmlWriter);
    if (xmlWriter.isNamespaceDefined(LegacyChartElementModule.NAMESPACE) == false)
    {
      attList.addNamespaceDeclaration("legacy-charts", LegacyChartElementModule.NAMESPACE);
    }
    xmlWriter.writeTag(LegacyChartElementModule.NAMESPACE, "legacy-chart", attList, XmlWriter.OPEN);
    writeElementBody(bundle, state, element, xmlWriter);
    xmlWriter.writeCloseTag();
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

    if (element == null)
    {
      throw new NullPointerException();
    }

    final AttributeList attList = createMainAttributes(element, xmlWriter);
    attList.addNamespaceDeclaration("ext", ExtParserModule.NAMESPACE);

    xmlWriter.writeTag(BundleNamespaces.LAYOUT, "legacy", attList, XmlWriterSupport.OPEN);
    writeElementBody(bundle, state, element, xmlWriter);

    final ReportWriter writer = new ReportWriter(state.getMasterReport(), "UTF-8");
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

    try
    {
      final TableDataFactory tableDataFactory = (TableDataFactory) dataFactory;

      final AttributeList rootAttrs = new AttributeList();
      if (xmlWriter.isNamespaceDefined(InlineDataFactoryModule.NAMESPACE) == false)
      {
        rootAttrs.addNamespaceDeclaration("data", InlineDataFactoryModule.NAMESPACE);
      }
      xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "inline-datasource", rootAttrs, XmlWriterSupport.OPEN);

      final String[] tables = tableDataFactory.getQueryNames();
      for (int i = 0; i < tables.length; i++)
      {
        final String tableName = tables[i];
        final TableModel tableModel = tableDataFactory.queryData(tableName, null);

        xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "inline-table", "name", tableName, XmlWriterSupport.OPEN);
        xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "definition", XmlWriterSupport.OPEN);

        final Class[] colTypes = new Class[tableModel.getColumnCount()];
        for (int col = 0; col < tableModel.getColumnCount(); col += 1)
        {
          final AttributeList colAttrs = new AttributeList();
          colAttrs.setAttribute(InlineDataFactoryModule.NAMESPACE, "name", tableModel.getColumnName(col));

          final Class columnClass = tableModel.getColumnClass(col);
          if (columnClass == null)
          {
            colAttrs.setAttribute(InlineDataFactoryModule.NAMESPACE, "type", Object.class.getName());
            colTypes[col] = Object.class;
          }
          else
          {
            colAttrs.setAttribute(InlineDataFactoryModule.NAMESPACE, "type", columnClass.getName());
            colTypes[col] = columnClass;
          }

          xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "data", colAttrs, XmlWriterSupport.CLOSE);
        }
        xmlWriter.writeCloseTag(); // definition

        for (int row = 0; row < tableModel.getRowCount(); row += 1)
        {
          xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "row", XmlWriterSupport.OPEN);
          for (int col = 0; col < tableModel.getColumnCount(); col += 1)
          {
            final AttributeList colAttrs = new AttributeList();
            final Object value = tableModel.getValueAt(row, col);
            if (value == null)
            {
              colAttrs.setAttribute(InlineDataFactoryModule.NAMESPACE, "null", "true");
              xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "data", colAttrs, XmlWriterSupport.CLOSE);
            }
            else
            {
              final Class valueClass = value.getClass();
              if (ObjectUtilities.equal(colTypes[col], valueClass) == false)
              {
                colAttrs.setAttribute(InlineDataFactoryModule.NAMESPACE, "type", valueClass.getName());
              }

              try
              {
                final String s = ConverterRegistry.toAttributeValue(value);
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

    if (element == null)
    {
      throw new NullPointerException();
    }

    final AttributeList attList = createMainAttributes(element, xmlWriter);
    copyStaticResources(bundle, state, element);

    xmlWriter.writeTag(BundleNamespaces.LAYOUT, "content-field", attList, XmlWriterSupport.OPEN);
    writeElementBody(bundle, state, element, xmlWriter);
    xmlWriter.writeCloseTag();
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

    if (element == null)
    {
      throw new NullPointerException();
    }

    final AttributeList attList = createMainAttributes(element, xmlWriter);
    xmlWriter.writeTag(BundleNamespaces.LAYOUT, "crosstab-column-group", attList, XmlWriterSupport.OPEN);

    final CrosstabColumnGroup group = (CrosstabColumnGroup) element;
    if (group.getField() != null)
    {
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.common.AttributeList

  {
    final XmlWriter writer = getXmlWriter();
    if (expression instanceof FormulaExpression)
    {
      final FormulaExpression fe = (FormulaExpression) expression;
      final AttributeList properties = new AttributeList();
      if (expression.getName() != null)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "name", expression.getName());
      }
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
      writer.writeTag(ExtParserModule.NAMESPACE, FunctionsWriter.EXPRESSION_TAG, properties, XmlWriterSupport.CLOSE);
      return;
    }

    if (expression instanceof FormulaFunction)
    {
      final FormulaFunction fe = (FormulaFunction) expression;
      final AttributeList properties = new AttributeList();
      if (expression.getName() != null)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "name", expression.getName());
      }
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      properties.setAttribute(ExtParserModule.NAMESPACE, "initial", fe.getInitial());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
      writer.writeTag(ExtParserModule.NAMESPACE, FunctionsWriter.EXPRESSION_TAG, properties, XmlWriterSupport.CLOSE);
      return;
    }

    try
    {
      final BeanUtility bu = new BeanUtility(expression);
      final String[] propertyNames = bu.getProperties();
      if (propertyNames.length == 0)
      {
        final AttributeList properties = new AttributeList();
        if (expression.getName() != null)
        {
          properties.setAttribute(ExtParserModule.NAMESPACE, "name", expression.getName());
        }
        properties.setAttribute(ExtParserModule.NAMESPACE, "class", expression.getClass().getName());
        if (expression.getDependencyLevel() > 0)
        {
          properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
              expression.getDependencyLevel()));
        }
        writer.writeTag(ExtParserModule.NAMESPACE, FunctionsWriter.EXPRESSION_TAG, properties, XmlWriterSupport.CLOSE);
      }
      else
      {
        final AttributeList properties = new AttributeList();
        if (expression.getName() != null)
        {
          properties.setAttribute(ExtParserModule.NAMESPACE, "name", expression.getName());
        }
        properties.setAttribute(ExtParserModule.NAMESPACE, "class", expression.getClass().getName());
        if (expression.getDependencyLevel() > 0)
        {
          properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
              expression.getDependencyLevel()));
        }
        writer.writeTag(ExtParserModule.NAMESPACE, FunctionsWriter.EXPRESSION_TAG, properties, XmlWriterSupport.OPEN);

        writeExpressionParameters(propertyNames, bu);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.