Package org.dbwiki.data.database

Examples of org.dbwiki.data.database.DatabaseAttributeNode


      DatabaseElementNode element = list.get(iNode);
      if (versionParameter.matches(element)) {
        content.openTR();
        String target = getNodeLink(element, versionParameter);
        if (list.schema().isAttribute()) {
          DatabaseAttributeNode attribute = (DatabaseAttributeNode)element;
          if (attribute.getTimestamp().isCurrent()) {
            content.openTD(layout.getCSS(CSS.CSSContentValueActive));
          } else {
            content.openTD(layout.getCSS(CSS.CSSContentValueInactive));
          }
          if (printAttributeValue(attribute, versionParameter, layout, content)) {
View Full Code Here


        }
        content.openTD(layout.getCSS(CSS.CSSContentValue));
        content.openTABLE(layout.getCSS(CSS.CSSContentValueListing));
        content.openTR();
        if (list.schema().isAttribute()) {
          DatabaseAttributeNode attribute = (DatabaseAttributeNode)element;
          if (attribute.getTimestamp().isCurrent()) {
            content.openTD(layout.getCSS(CSS.CSSContentValueActive));
          } else {
            content.openTD(layout.getCSS(CSS.CSSContentValueInactive));
          }
          if (printAttributeValue(attribute, versionParameter, layout, content)) {
View Full Code Here

   * @param versions
   * @throws org.dbwiki.exception.WikiException
   */
  private void addNodeChanges(DatabaseElementNode element, Hashtable<Integer, Version> versions) throws org.dbwiki.exception.WikiException {
    if (element.isAttribute()) {
      DatabaseAttributeNode attribute = (DatabaseAttributeNode)element;
      for (int iValue = 0; iValue < attribute.value().size(); iValue++) {
        DatabaseTextNode value = attribute.value().get(iValue);
        if (value.hasTimestamp()) {
          this.addModificationPoints(value.getTimestamp(), versions);
        }
      }
    } else {
View Full Code Here

    }
  }

  private void activateElementNode(Connection con, DatabaseElementNode node, int deletedAt, Version version) throws org.dbwiki.exception.WikiException {
    if (node.isAttribute()) {
      DatabaseAttributeNode attribute = (DatabaseAttributeNode)node;
      for (int iValue = 0; iValue < attribute.value().size(); iValue++) {
        DatabaseTextNode value = attribute.value().get(iValue);
        if ((value.hasTimestamp()) && (value.getTimestamp().lastValue() == deletedAt)) {
          insertTimestamp(con, value, value.getTimestamp().continueAt(version.number()));
        }
      }
    } else {
View Full Code Here

    }
  }
 
  private void deleteElementNode(Connection con, DatabaseElementNode node, Version version) throws org.dbwiki.exception.WikiException {
    if (node.isAttribute()) {
      DatabaseAttributeNode attribute = (DatabaseAttributeNode)node;
      for (int iValue = 0; iValue < attribute.value().size(); iValue++) {
        DatabaseTextNode value = attribute.value().get(iValue);
        if ((value.hasTimestamp()) && (value.getTimestamp().isCurrent())) {
          updateTimestamp(con, value, value.getTimestamp().finishAt(version.number() - 1));
        }
      }
    } else {
View Full Code Here

  private void exportNode(DatabaseNode node, int version, NodeWriter out, boolean last) throws org.dbwiki.exception.WikiException {
    if (node.getTimestamp().contains(version)) {
      if (node.isElement()) {
        DatabaseElementNode element = (DatabaseElementNode)node;
        if (element.isAttribute()) {
          DatabaseAttributeNode attribute = (DatabaseAttributeNode)element;
          DatabaseTextNode value = null;
          for (int iValue = 0; iValue < attribute.value().size(); iValue++) {
            if (attribute.value().get(iValue).getTimestamp().contains(version)) {
              value = attribute.value().get(iValue);
              break;
            }
          }
          out.writeAttributeNode(attribute, value,last);
        } else {
View Full Code Here

   * Update modified timestamps associated with @node.
   *
   * @return true if any timestamps were updated
   */
  private boolean updateTextNodeTimestamps(Connection con, DatabaseTextNode node, NodeUpdate update, Version version) throws org.dbwiki.exception.WikiException {
    DatabaseAttributeNode attribute = ((DatabaseAttributeNode)node.parent());
    DatabaseNodeValue values = attribute.value();

    if (node.getTimestamp().isCurrent()) {
      if (!update.value().equals(node.text())) {
        updateTimestamp(con, node, node.getTimestamp().finishAt(version.number() - 1));
        for (int iValue = 0; iValue < values.size(); iValue++) {
          if (update.value().equals(values.get(iValue).text())) {
            DatabaseTextNode text = values.get(iValue);
            insertTimestamp(con, text, text.getTimestamp().continueAt(version.number()));
            return true;
          }
        }
        attribute.add(update.value(), new TimeSequence(version), node.getpre(),node.getpost());

        return true;
      }
    }
    return false;
View Full Code Here

   * Public Methods
   */
 
  public void eval(DatabaseElementNode node, EvaluationResult result) {

    DatabaseAttributeNode attribute = (DatabaseAttributeNode)node;
   
    EvaluationResult evalResult = new EvaluationResult();
   
    for (int iValue = 0; iValue < attribute.value().size(); iValue++) {
      boolean opResult = _operator.eval(attribute.value().get(iValue).value());
      evalResult.evaluationResult(opResult);
      if ((opResult) && (_evalQuantifier == Quantifier.FOR_ANY)) {
        break;
      } else if ((!opResult) && (_evalQuantifier == Quantifier.FOR_ALL)) {
        break;
View Full Code Here

    }
  }
 
  public void evalTimestamp(DatabaseElementNode node, TimestampEvaluationResult evalResult) {
   
    DatabaseAttributeNode attribute = (DatabaseAttributeNode)node;
   
    TimeSequence timestamp = null;
   
    boolean hasAllPositiveEvaluations = true;
   
    for (int iValue = 0; iValue < attribute.value().size(); iValue++) {
      boolean opResult = _operator.eval(attribute.value().get(iValue).value());
      if (opResult) {
        if (timestamp != null) {
          timestamp = timestamp.union(attribute.value().get(iValue).getTimestamp());
        } else {
          timestamp = attribute.value().get(iValue).getTimestamp();
        }
      } else {
        hasAllPositiveEvaluations = false;
        if (_evalQuantifier == Quantifier.FOR_ALL) {
          break;
View Full Code Here

      DatabaseElementList matches = children.get(labels.get(0));
      if(matches.size() == 0)
        continue;
     
      // take the first value (the system allows multiple values)
      DatabaseAttributeNode rx = (DatabaseAttributeNode)matches.get(0);
      String x = "'" + escapeString(rx.value().getCurrent().value()) + "'";

      ArrayList<String> yvalues = new ArrayList<String>(schemaSize-1);

      for (int j = 1; j < schemaSize; j++) {
        // Add the empty string if there are no matches
View Full Code Here

TOP

Related Classes of org.dbwiki.data.database.DatabaseAttributeNode

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.