Examples of InspectionResult


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

    {
      return;
    }
    if (expressionMetaData.getCompatibilityLevel() > compatibilityLevel)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("ReportMigrationInspection.ExpressionInvalid",
              expressionMetaData.getDisplayName(Locale.getDefault()), compatibilityText),
          new LocationInfo(expression)));
    }
  }
View Full Code Here

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

          support.setFormatString(fmtString);
        }
      }
      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)));
      }
View Full Code Here

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

        {
          final AttributeMetaData attrMetaData =
              element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
          if (attrMetaData == null)
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidFormatInspection.AttributeExpressionInvalidFormatNoMetaData",
                    element.getName(), attributeNamespace, attributeName, fmtString, metaData.getDisplayName(Locale.getDefault())),
                new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())));
          }
          else
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidFormatInspection.AttributeExpressionInvalidFormat",
                    element.getName(), attrMetaData.getDisplayName(Locale.getDefault()), fmtString, metaData.getDisplayName(Locale.getDefault())),
                new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())));
          }
View Full Code Here

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

          }
        }
        catch (Exception e)
        {
          final StyleMetaData attrMetaData = element.getMetaData().getStyleDescription(styleKey);
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidFormatInspection.StyleExpressionInvalidFormat",
                  element.getName(), attrMetaData.getDisplayName(Locale.getDefault()), fmtString, metaData.getDisplayName(Locale.getDefault())),
              new StyleExpressionPropertyLocationInfo(element, styleKey, metaData.getName())));
        }
      }
View Full Code Here

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

            support.setFormatString(fmtString);
          }
        }
        catch (Exception e)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidFormatInspection.ExpressionInvalidFormat",
                  expression.getName(), metaData.getDisplayName(Locale.getDefault()), fmtString, metaData.getDisplayName(Locale.getDefault())),
              new PropertyLocationInfo(expression, metaData.getName())));
        }
      }
    }
    catch (Exception e)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          e.getMessage(),
          new LocationInfo(expression)));
    }

  }
View Full Code Here

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

          final ReportElement e =
              FunctionUtilities.findElementByAttribute(reportDefinition, AttributeNames.Core.NAMESPACE,
                  AttributeNames.Core.NAME, element);
          if (e == null)
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidElementReferenceInspection.ExpressionReferencesInvalidName",
                    expression.getName(), metaData.getDisplayName(Locale.getDefault())),
                new PropertyLocationInfo(expression, metaData.getName())));
          }
        }
      }
    }
    catch (Exception e)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          e.getMessage(),
          new LocationInfo(expression)));
    }
  }
View Full Code Here

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

    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));
      }
    }

    final ContextAwareDataSchemaModel dataSchemaModel = reportRenderContext.getReportDataSchemaModel();
    if (dataSchemaModel.isValid() == false)
    {
      final Throwable throwable = dataSchemaModel.getDataFactoryException();
      if (throwable != null)
      {
        final DataFactory dataFactory = reportRenderContext.getContextRoot().getDataFactory();
        final LocationInfo queryLocation;
        if (dataFactory instanceof CompoundDataFactory)
        {
          final CompoundDataFactory cdf = (CompoundDataFactory) dataFactory;
          final DataFactory element = cdf.getDataFactoryForQuery(query);
          if (element == null)
          {
            queryLocation = new LocationInfo(dataFactory);
          }
          else
          {
            queryLocation = new LocationInfo(element);
          }
        }
        else
        {
          queryLocation = new LocationInfo(dataFactory);
        }
        resultHandler.notifyInspectionResult
            (new InspectionResult(this, InspectionResult.Severity.ERROR,
                Messages.getString("InvalidQueryNameReferenceInspection.QueryDidNotExecute", query, throwable.toString()),
                queryLocation));
      }
    }
  }
View Full Code Here

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

      final String query = listParameter.getQueryName();
      if (query == null)
      {
        final ParameterLocationInfo queryLocation = new ParameterLocationInfo(parameter);
        resultHandler.notifyInspectionResult
            (new InspectionResult(this, InspectionResult.Severity.HINT,
                Messages.getString("InvalidQueryNameReferenceInspection.QueryUndefined"),
                queryLocation));

      }
      else
      {
        if (isQueryExecutable(reportRenderContext.getReportDefinition(), query) == false)
        {
          final ParameterLocationInfo queryLocation = new ParameterLocationInfo(parameter);
          resultHandler.notifyInspectionResult
              (new InspectionResult(this, InspectionResult.Severity.ERROR,
                  Messages.getString("InvalidQueryNameReferenceInspection.QueryNotRecognized", query),
                  queryLocation));
        }
      }
    }
View Full Code Here

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

      if (value != null)
      {
        if (attributeMetaData.getTargetType().isInstance(value) == false)
        {
          // 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

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

        final String group = groups[j];
        final AbstractReportDefinition reportDefinition = reportRenderContext.getReportDefinition();
        final ReportElement e = reportDefinition.getGroupByName(group);
        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
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.