Package org.dbwiki.data.document

Examples of org.dbwiki.data.document.DocumentGroupNode


   * @param groupIndex
   * @return
   * @throws org.dbwiki.exception.WikiException
   */
  public static DocumentGroupNode createGroupNode(GroupSchemaNode schema, Hashtable<Integer, DocumentGroupNode> groupIndex) throws org.dbwiki.exception.WikiException {
    DocumentGroupNode root = new DocumentGroupNode(schema);
   
    groupIndex.put(new Integer(schema.id()), root);
   
    for (int iChild = 0; iChild < schema.children().size(); iChild++) {
      // TODO: we probably need to be careful about which bits of the
      // schema are current
      SchemaNode child = schema.children().get(iChild);
      if (child.isGroup()) {
        root.children().add(createGroupNode((GroupSchemaNode)child, groupIndex));
      }
    }
    return root;
  }
View Full Code Here


      if (_rootSchemaNode.label().equals(label)) {
        if (_rootSchemaNode.isAttribute()) {
          _root = new DocumentAttributeNode((AttributeSchemaNode)_rootSchemaNode);
          _valueReader = new NodeValueReader();
        } else {
          _root = new DocumentGroupNode((GroupSchemaNode)_rootSchemaNode);
        }
        _elementStack.push(_root);
      } else {
        throw new WikiDataException(WikiDataException.InvaldInputData, "Expected root label " + _rootSchemaNode.label() + " instead of " + label);
      }
    } else if (!_elementStack.isEmpty()) {
      DocumentNode element = _elementStack.peek();
      if (element.isGroup()) {
        DocumentGroupNode group = (DocumentGroupNode)element;
        SchemaNode childSchemaNode = ((GroupSchemaNode)group.schema()).children().get(label);
        if (childSchemaNode != null && childSchemaNode.getTimestamp().isCurrent()) {
          DocumentNode child = null;
          if (childSchemaNode.isAttribute()) {
            child = new DocumentAttributeNode((AttributeSchemaNode)childSchemaNode);
            _valueReader = new NodeValueReader();
          } else {
            child = new DocumentGroupNode((GroupSchemaNode)childSchemaNode);
          }
          group.children().add(child);
          _elementStack.push(child);
        } else {
          _ignoreSubtreeDepth = 1;
        }
      } else {
View Full Code Here

      if (element.isAttribute()) {
        DocumentAttributeNode attributeChild = (DocumentAttributeNode)element;
        insertAttributeNode((AttributeSchemaNode)attributeChild.schema(), parent, entry, null, attributeChild.value(), attributeChild.getpre(), attributeChild.getpost());

      } else {
        DocumentGroupNode groupChild = (DocumentGroupNode)element;
        RDBMSDatabaseGroupNode node = insertGroupNode((GroupSchemaNode)groupChild.schema(), parent, entry, null, groupChild.getpre(), groupChild.getpost());

        insertGroupChildren(groupChild, node, entry);
      }
    }
  }
View Full Code Here

   
    if (schemaNode != null) {
      if (schemaNode.isAttribute()) {
        return new DocumentAttributeNode((AttributeSchemaNode)schemaNode, ((PasteAttributeNode)sourceNode).getValue().getValue());
      } else {
        DocumentGroupNode group = new DocumentGroupNode((GroupSchemaNode)schemaNode);
        for (int iChild = 0; iChild < ((PasteGroupNode)sourceNode).children().size(); iChild++) {
          DocumentNode insertChild = getPasteInsertNode((GroupSchemaNode)schemaNode, (PasteElementNode)((PasteGroupNode)sourceNode).children().get(iChild), schema);
          if (insertChild != null) {
            group.children().add(insertChild);
          }
        }
        return group;
      }
    } else {
View Full Code Here

        }
      }
      return attribute;
    } else {
      Hashtable<Integer, DocumentGroupNode> groupIndex = new Hashtable<Integer, DocumentGroupNode>();
      DocumentGroupNode root = SchemaNode.createGroupNode((GroupSchemaNode)schemaNode, groupIndex);
      for (int iParameter = 0; iParameter < request.parameters().size(); iParameter++) {
        RequestParameter parameter = request.parameters().get(iParameter);
        if ((parameter.name().startsWith(RequestParameter.TextFieldIndicator)) && (parameter.hasValue())) {
          if (!parameter.value().equals("")) {
            SchemaNode child = database().schema().get(Integer.parseInt(parameter.name().substring(RequestParameter.TextFieldIndicator.length())));
View Full Code Here

TOP

Related Classes of org.dbwiki.data.document.DocumentGroupNode

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.