Package org.dbwiki.data.database

Examples of org.dbwiki.data.database.DatabaseElementNode


    }
  }

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


   */
  private boolean updateNodeTimestamps(Connection con, DatabaseNode node, Update update, Version version) throws org.dbwiki.exception.WikiException {
    boolean hasChanges = false;

    if (node.isElement()) {
      DatabaseElementNode element = (DatabaseElementNode)node;
      if (element.isAttribute()) {
        hasChanges = updateTextNodeTimestamps(con, ((DatabaseAttributeNode)element).value().getCurrent(), update.get(0), version);
      } else {
        Hashtable<String, DatabaseTextNode> valueIndex = new Hashtable<String, DatabaseTextNode>();
        getValueIndex((DatabaseGroupNode)element, valueIndex);
        for (int iUpdate = 0; iUpdate < update.size(); iUpdate++) {
View Full Code Here

 
  private void filterChildrenByTimestamp(DatabaseGroupNode node, TimeSequence timestamp) {
   
    int iChild = 0;
    while (iChild < node.children().size()) {
      DatabaseElementNode child = node.children().get(iChild);
      if (!child.getTimestamp().intersect(timestamp).isEmpty()) {
        if (child.isAttribute()) {
          this.filterChildrenByTimestamp((DatabaseAttributeNode)child, timestamp);
        } else {
          this.filterChildrenByTimestamp((DatabaseGroupNode)child, timestamp);
        }
        iChild++;
View Full Code Here

      }
    }

    Vector<DatabaseElementNode> outputNodes = new Vector<DatabaseElementNode>();
    for (SubTreeSelectStatement stmt : _statements) {
      DatabaseElementNode node = nodeSet.get(stmt.targetPath().variableName());
      QueryOutputNodeCollector nodeMarker = null;
      if(stmt.label() == null)
        nodeMarker = new QueryOutputNodeCollector(outputNodes);
      else
        try {
          nodeMarker = new QueryOutputNodeCollector(outputNodes, _resultSchema.find(stmt.label()));
        } catch (WikiException e) {
          e.printStackTrace();
        }
      new RelativeXPathConsumer().consume(node, stmt.targetPath(), nodeMarker);
    }
    if (outputNodes.size() > 0) {
      TimeSequence timestamp = null;
      for (int iNode = 0; iNode < outputNodes.size(); iNode++) {
        DatabaseElementNode node = outputNodes.get(iNode);
        if (timestamp != null) {
          timestamp = timestamp.union(node.getTimestamp());
        } else {
          timestamp = node.getTimestamp();
        }
      }
      DatabaseGroupNode result = new ResultGroupNode(_resultSchema, timestamp);
      for (DatabaseElementNode node : outputNodes) {
        result.children().add(node);
View Full Code Here

        if (targetNode != null) {
          RequestParameterVersionSingle versionParameter = new RequestParameterVersionSingle(version.number());
          DatabaseNode node = targetNode;
          while (!node.identifier().equals(_request.node().identifier())) {
            if (node.isElement()) {
              DatabaseElementNode element = (DatabaseElementNode)node;
              String elementName = _layouter.get(element.schema()).getShortLabel(element, versionParameter);
              if (targetName != null) {
                targetName = elementName + "/" + targetName;
              } else {
                targetName = elementName;
              }
View Full Code Here

    String line = null;
   
    DatabaseNode node = _request.node();
    while (node != null) {
      if (node.isElement()) {
        DatabaseElementNode element = (DatabaseElementNode)node;
        String target = _request.wri().databaseIdentifier().linkPrefix() + element.identifier().toURLString();
        if (!versionParameter.versionCurrent()) {
          target = target + "?" + versionParameter.toURLString();
        }
        String link = _layouter.get(element.schema()).getShortLabel(element, versionParameter);
        link = "<a CLASS=\"" + CSS.CSSObjectPath + "\" HREF=\"" + target + "\">" + link + "</a>";
        if (line != null) {
          line = link + " &gt; " + line;
        } else {
          line = link;
View Full Code Here

TOP

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

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.