Package org.dbwiki.data.database

Examples of org.dbwiki.data.database.DatabaseTextNode


      DatabaseNode node = _request.node();
      if (node.isElement()) {
        DatabaseElementNode element = (DatabaseElementNode)node;
        this.printUpdateForm(_request, element, body);
      } else {
        DatabaseTextNode textNode = (DatabaseTextNode)node;
        this.printUpdateForm(_request, textNode, body);
      }
    }
  }
View Full Code Here


  }
  public void printUpdateLine(DatabaseAttributeNode attribute, HtmlLinePrinter body) {
    SchemaLayout layout = _layouter.get(attribute.schema());
   
    DatabaseTextNode value = attribute.value().getCurrent();
    if (value != null) {
      body.openTR();
      body.openTD(layout.getCSS(CSS.CSSObjectLabelActive));
      body.text(layout.getName());
      body.closeTD();
View Full Code Here

  }
 
  private boolean printAttributeValue(DatabaseAttributeNode attribute, RequestParameterVersion versionParameter, SchemaLayout layout, HtmlLinePrinter content) throws org.dbwiki.exception.WikiException {
    int lineCount = 0;
    for (int iValue = 0; iValue < attribute.value().size(); iValue++) {
      DatabaseTextNode value = attribute.value().get(iValue);
      if (versionParameter.matches(value)) {
        lineCount++;
        if (lineCount > 1) {
          content.add("<br/>");
        }
        String target = getNodeLink(value, versionParameter);
        if (value.getTimestamp().isCurrent()) {
          content.linkWithTitle(target, _timestampPrinter.toPrintString(value.getTimestamp()), value.text(), layout.getCSS(CSS.CSSContentValueActive));
        } else {
          content.linkWithTitle(target, _timestampPrinter.toPrintString(value.getTimestamp()), value.text(), layout.getCSS(CSS.CSSContentValueInactive));
        }
        if ((attribute.hasAnnotation()) || (value.hasAnnotation())) {
          addAnnotationIndicator(content);
        }
      }
    }
    return (lineCount > 0);
View Full Code Here

   */
  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 {
      DatabaseGroupNode group = (DatabaseGroupNode)element;
      for (int iNode = 0; iNode < group.children().size(); iNode++) {
View Full Code Here

  }

 
  private void writeTextNodes(RDBMSDatabaseAttributeNode attribute, int entry) throws java.sql.SQLException, org.dbwiki.exception.WikiException {   
    for (int iValue = 0; iValue < attribute.value().size(); iValue++) {
      DatabaseTextNode node = attribute.value().get(iValue);
      if (((NodeIdentifier)node.identifier()).nodeID() == RelDataColIDValUnknown) {
        TimeSequence timestamp = null;
        if (node.hasTimestamp()) {
          timestamp = node.getTimestamp();
        }
        this.insertTextNode(attribute, entry, timestamp, node.value(), attribute.getpre(), attribute.getpost());

      }
    }
  }
View Full Code Here

          // FIXME: Suspicious sideways-cast, is this code reachable?
          assert(parent instanceof DatabaseAttributeNode);
          DatabaseNodeValue values = ((DatabaseAttributeNode)parent).value();
          if (values.size() > 1) {
            for (int iValue = 0; iValue < values.size(); iValue++) {
              DatabaseTextNode value = values.get(iValue);
              if (value.getTimestamp().isCurrent()) {
                updateTimestamp(con, value, value.getTimestamp().finishAt(version.number() - 1));
              }
            }
          }
          insertTimestamp(con, node, node.getTimestamp().continueAt(version.number()));
        }
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 {
      DatabaseGroupNode group = (DatabaseGroupNode)node;
      for (int iChild = 0; iChild < group.children().size(); iChild++) {
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 {
      DatabaseGroupNode group = (DatabaseGroupNode)node;
      for (int iChild = 0; iChild < group.children().size(); iChild++) {
View Full Code Here

    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;
            }
View Full Code Here

  private void getValueIndex(DatabaseGroupNode group, Hashtable<String, DatabaseTextNode> valueIndex) {
    for (int iChild = 0; iChild < group.children().size(); iChild++) {
      DatabaseElementNode child = group.children().get(iChild);
      if (child.isAttribute()) {
        DatabaseTextNode value = ((DatabaseAttributeNode)child).value().getCurrent();
        if (value != null) {
          valueIndex.put(value.identifier().toParameterString(), value);
        }
      } else {
        getValueIndex((DatabaseGroupNode)child, valueIndex);
      }
    }
View Full Code Here

TOP

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

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.