Package org.opendope.conditions

Examples of org.opendope.conditions.Condition


    if (conditionId != null) {

      log.info("Processing Conditional: " + tag.getVal());

      // At present, this only handles simple conditions
      Condition c = ConditionsPart.getConditionById(conditions,
          conditionId);
      if (c == null) {
        log.error("Missing condition " + conditionId);
      }

      if ( c.evaluate(wordMLPackage, customXmlDataStorageParts, conditions, xPaths) ) {
        log.debug("so keeping");

        List<Object> newContent = new ArrayList<Object>();
        newContent.add(sdt);
        return newContent;
View Full Code Here


  }

  private void processDescendantCondition(Object sdt, String xpathBase,
      int index, Tag tag ) {

    Condition c = null;

    HashMap<String, String> map = QueryString.parseQueryString(
        tag.getVal(), true);


    String conditionId = map.get(BINDING_ROLE_CONDITIONAL);

    if (conditionId != null) {

      c = ConditionsPart.getConditionById(conditions, conditionId);
      if (c == null) {
        log.error("Missing condition " + conditionId);
        throw new InputIntegrityException("Required condition '" + conditionId + "' is missing");
      }

      // TODO: this code assumes the condition contains
      // a simple xpath
      log.debug("Using condition"
          + XmlUtils.marshaltoString(c, true, true));

      Condition newCondition = c.repeat(xpathBase, index, conditions, xPaths);

      // set sdt to use it
      map.put(BINDING_ROLE_CONDITIONAL, newCondition.getId() );
      tag.setVal(QueryString.create(map));
    }

  }
View Full Code Here

        String conditionId = map.get(OpenDoPEHandler.BINDING_ROLE_CONDITIONAL);
        String repeatId = map.get(OpenDoPEHandler.BINDING_ROLE_REPEAT);
        String xp = map.get(OpenDoPEHandler.BINDING_ROLE_XPATH);
       
        if (conditionId!=null ) {
          Condition c = ConditionsPart.getConditionById(conditions,
              conditionId);
          if (c == null) {
            System.out.println(callback.indent + "  " + "Missing condition " + conditionId);
          }
         
          if (c.getParticle() instanceof org.opendope.conditions.Xpathref) {
            org.opendope.conditions.Xpathref xpathRef = (Xpathref)c.getParticle();
            if (xpathRef == null) {
              System.out.println(callback.indent + "  " + "Condition " + c.getId() + " references a missing xpath!");
            }
           
            org.opendope.xpaths.Xpaths.Xpath xpath = XPathsPart.getXPathById(xPaths, xpathRef.getId());
            if (xpath==null) {
              System.out.println(callback.indent + "  " + "XPath specified in condition '" + c.getId() + "' is missing!");
            } else {
              System.out.println(callback.indent + "  " +  xpath.getId() + ": " + xpath.getDataBinding().getXpath() );
            }
          } else {
            System.out.println("Complex condition: " + XmlUtils.marshaltoString(c, true, true) );
View Full Code Here

TOP

Related Classes of org.opendope.conditions.Condition

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.