Package org.pentaho.reporting.designer.core.inspections

Examples of org.pentaho.reporting.designer.core.inspections.AttributeLocationInfo


      catch (Exception e)
      {
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("InvalidFormatInspection.AttributeInvalidFormat",
                element.getName(), data.getDisplayName(Locale.getDefault()), fmtString),
            new AttributeLocationInfo(element, data.getNameSpace(), data.getName(), false)));
      }

    }

    traverseAttributeExpressions(designerContext, reportRenderContext, resultHandler, columnNames, element);
View Full Code Here


    super.inspect(designerContext, reportRenderContext, resultHandler);
    final AbstractReportDefinition definition = reportRenderContext.getReportDefinition();
    final String query = definition.getQuery();
    if (query == null)
    {
      final AttributeLocationInfo queryLocation = new AttributeLocationInfo
          (definition, AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.QUERY, false);
      resultHandler.notifyInspectionResult
          (new InspectionResult(this, InspectionResult.Severity.HINT,
              Messages.getString("InvalidQueryNameReferenceInspection.QueryUndefined"),
              queryLocation));

    }
    else
    {
      if (isQueryExecutable(definition, query) == false)
      {
        final AttributeLocationInfo queryLocation = new AttributeLocationInfo
            (definition, AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.QUERY, false);
        resultHandler.notifyInspectionResult
            (new InspectionResult(this, InspectionResult.Severity.ERROR,
                Messages.getString("InvalidQueryNameReferenceInspection.QueryNotRecognized", query),
                queryLocation));
View Full Code Here

          // notify of invalid type
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("MandatoryAttributeMissingInspection.AttributeValueHasInvalidType",
                  element.getName(), attributeMetaData.getDisplayName(Locale.getDefault()),
                  attributeMetaData.getTargetType().getName(), value.getClass().getName()),
              new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
        }

        if (attributeMetaData.isDesignTimeValue())
        {
          if (element.getAttributeExpression(attributeMetaData.getNameSpace(), attributeMetaData.getName()) != null)
          {
            // warn that design-time values have no need for a expression
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("MandatoryAttributeMissingInspection.DesignTimeAttributeWithExpression",
                    element.getName(), attributeMetaData.getDisplayName(Locale.getDefault())),
                new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
          }
        }
        continue;
      }

      if (attributeMetaData.isMandatory() == false)
      {
        continue;
      }
      if (attributeMetaData.isDesignTimeValue() == false)
      {
        if (element.getAttributeExpression(attributeMetaData.getNameSpace(), attributeMetaData.getName()) != null)
        {
          continue;
        }

        // warn that either value or expression must be set
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("MandatoryAttributeMissingInspection.MandatoryAttributeWithoutValueOrExpression",
                element.getName(), attributeMetaData.getDisplayName(Locale.getDefault())),
            new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));

      }
      else
      {
        // warn that a value must be set
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("MandatoryAttributeMissingInspection.MandatoryAttributeWithoutValue",
                element.getName(), attributeMetaData.getDisplayName(Locale.getDefault())),
            new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
      }
    }
  }
View Full Code Here

        if (e == null)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidGroupReferenceInspection.AttributeInvalidGroup",
                  element.getName(), group, metaData.getDisplayName(Locale.getDefault())),
              new AttributeLocationInfo(element, metaData.getNameSpace(), metaData.getName(), false)));
        }
      }
    }

  }
View Full Code Here

    {
      final String message = attrDescr.getDeprecationMessage(Locale.getDefault());
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("DeprecatedUsagesInspection.StyleExpressionTargetDeprecated",
              element.getName(), attrDescr.getDisplayName(Locale.getDefault()), message),
          new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
    }

    if (expressionMetaData == null)
    {
      return;
    }

    if (expressionMetaData.isDeprecated() == false)
    {
      return;
    }
    final String message = expressionMetaData.getDeprecationMessage(Locale.getDefault());
    if (attrDescr != null)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("DeprecatedUsagesInspection.StyleExpressionDeprecated",
              element.getName(), attrDescr.getDisplayName(Locale.getDefault()), message),
          new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
    }
    else
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("DeprecatedUsagesInspection.StyleExpressionDeprecatedNoMetaData",
              element.getName(), attributeNamespace, attributeName, message),
          new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
    }

  }
View Full Code Here

      if (attributeMetaData.getCompatibilityLevel() > compatibilityLevel)
      {
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("ReportMigrationInspection.AttributeInvalid",
                attributeMetaData.getDisplayName(Locale.getDefault()), element.getName(), compatibilityText),
            new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
      }
    }

    traverseAttributeExpressions(designerContext, reportRenderContext, resultHandler, columnNames, element);
    traverseStyleExpressions(designerContext, reportRenderContext, resultHandler, columnNames, element);
View Full Code Here

    if (attributeMetaData.getCompatibilityLevel() > compatibilityLevel)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("ReportMigrationInspection.AttributeExpressionDefined",
              attributeMetaData.getDisplayName(Locale.getDefault()), element.getName(), compatibilityText),
          new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
    }

    if (expressionMetaData.getCompatibilityLevel() > compatibilityLevel)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("ReportMigrationInspection.AttributeExpressionInvalid",
              attributeMetaData.getDisplayName(Locale.getDefault()), element.getName(), compatibilityText),
          new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
    }
  }
View Full Code Here

      if (attrMeta != null)
      {
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("FormulaErrorInspection.AttributeNoFormulaNoMetaData",
                element.getName(), attrMeta.getDisplayName(Locale.getDefault())),
            new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
      }
      else
      {
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("FormulaErrorInspection.AttributeNoFormulaNoMetaData",
                element.getName(), attributeNamespace, attributeName),
            new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
      }
      return;
    }

    try
    {
      compileFormula(s);
    }
    catch (ParseException pe)
    {

      final AttributeMetaData attrMeta = element.getMetaData().getAttributeDescription
          (attributeNamespace, attributeName);
      if (attrMeta != null)
      {
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("FormulaErrorInspection.AttributeInvalidFormula",
                element.getName(), attrMeta.getDisplayName(Locale.getDefault())),
            new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
      }
      else
      {
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("FormulaErrorInspection.AttributeInvalidFormulaNoMetaData",
                element.getName(), attributeNamespace, attributeName),
            new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
      }
    }
  }
View Full Code Here

            if (property == null)
            {
              resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                  Messages.getString("ExpressionsParameterInspection.AttributeExpressionValidationErrorNoMetaData",
                      element.getName(), attributeNamespace, attributeName, warning),
                  new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
            }
            else
            {
              resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                  Messages.getString("ExpressionsParameterInspection.AttributeExpressionValidationPropertyErrorNoMetaData",
                      element.getName(), attributeNamespace, attributeName, property, warning),
                  new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, property)));
            }
          }
          else
          {
            if (property == null)
            {
              resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                  Messages.getString("ExpressionsParameterInspection.AttributeExpressionValidationError",
                      element.getName(), attributeMetaData.getDisplayName(Locale.getDefault()), warning),
                  new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
            }
            else
            {
              resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                  Messages.getString("ExpressionsParameterInspection.AttributeExpressionValidationPropertyError",
View Full Code Here

        if (isValidField(field, columnNames) == false)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidFieldReferenceInspection.AttributeInvalidField", element.getName(),
                  field, data.getDisplayName(Locale.getDefault())),
              new AttributeLocationInfo(element, data.getNameSpace(), data.getName(), false)
          ));
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.designer.core.inspections.AttributeLocationInfo

Copyright © 2018 www.massapicom. 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.