Package org.dbwiki.data.schema

Examples of org.dbwiki.data.schema.AttributeSchemaNode


        this.buildSchema(schema, node.children().get(i), schemaNode);
      }
    } else {
      // if we've seen no element children here, then assume
      // this is an attribute
      AttributeSchemaNode schemaNode = new AttributeSchemaNode(schema.size(), node.label(), parent);
      schema.add(schemaNode);
    }
  }
View Full Code Here


    SchemaNode schema = null;
    if (type == SchemaNodeTypeAttribute) {
      if (_schema.size() == 0) {
        throw new WikiSchemaException(WikiSchemaException.InvalidSchemaType, "Schema root cannot be an attribute");
      }
      schema = new AttributeSchemaNode(_schema.size(), name, parent, new TimeSequence(version));
    } else if (type == SchemaNodeTypeGroup) {
      schema = new GroupSchemaNode(_schema.size(), name, parent, new TimeSequence(version));
    } else {
      throw new WikiSchemaException(WikiSchemaException.InvalidSchemaType, String.valueOf(type));
    }
View Full Code Here

        }
      }
      if (schemaNode == null) {
        if (_wiki.getAutoSchemaChanges() == DatabaseWikiProperties.AutoSchemaChangesAllow) {
          if (sourceNode.isAttribute()) {
            schemaNode = new AttributeSchemaNode(schema.size(), sourceNode.label(), parentSchemaNode, null);
          } else {
            schemaNode = new GroupSchemaNode(schema.size(), sourceNode.label(), parentSchemaNode, null);
          }
          schema.add(schemaNode);
        } else if (_wiki.getAutoSchemaChanges() == DatabaseWikiProperties.AutoSchemaChangesNever) {
View Full Code Here

        if (results.getInt(RelSchemaColParent) != -1) {
          parent = (GroupSchemaNode)get(results.getInt(RelSchemaColParent));
        }

        if ((results.getInt(RelSchemaColType) == RelSchemaColTypeValAttribute) && (parent != null)) {
          schema = new AttributeSchemaNode(id, label, parent);
        } else if (results.getInt(RelSchemaColType) == RelSchemaColTypeValGroup) {
          schema = new GroupSchemaNode(id, label, parent);
        } else {
          throw new WikiSchemaException(WikiSchemaException.InvalidSchemaType, "Database value " + results.getInt(RelSchemaColType));
        }
View Full Code Here

            stmt.setLabel(label);
            counter.inc();
          }
          SchemaNode renamedSchema = null;
          if (schema.isAttribute()) {
            renamedSchema = new AttributeSchemaNode(-1, label, _resultSchema, schema.getTimestamp());
            //renamedSchema = new AttributeSchemaNode(schema.id(), label, _resultSchema, schema.getTimestamp());
          } else {
            renamedSchema = new GroupSchemaNode(-1, label, _resultSchema, schema.getTimestamp());
            //renamedSchema = new GroupSchemaNode(schema.id(), label, _resultSchema, schema.getTimestamp());
            for (int iChild = 0; iChild < ((GroupSchemaNode)schema).children().size(); iChild++) {
View Full Code Here

   * @throws org.dbwiki.exception.WikiException
   */
  protected DocumentNode getInsertNode(WikiDataRequest  request) throws org.dbwiki.exception.WikiException {
    SchemaNode schemaNode = database().schema().get(Integer.parseInt(request.parameters().get(RequestParameter.ActionValueSchemaNode).value()));
    if (schemaNode.isAttribute()) {
      AttributeSchemaNode attributeSchemaNode = (AttributeSchemaNode)schemaNode;
      DocumentAttributeNode attribute = new DocumentAttributeNode(attributeSchemaNode);
      RequestParameter parameter = request.parameters().get(RequestParameter.TextFieldIndicator + attributeSchemaNode.id());
      if (parameter.hasValue()) {
        if (!parameter.value().equals("")) {
          attribute.setValue(parameter.value());
        }
      }
View Full Code Here

  }
 
  private void printDisplayLabelSelectBox(Vector<SchemaNode> entities, HtmlLinePrinter printer) {
    int currentDisplaySchemaNodeID = -1;
   
    AttributeSchemaNode current = _request.wiki().layouter().displaySchemaNode(_request.wiki().database().schema());
    if (current != null) {
      currentDisplaySchemaNodeID = current.id();
    }
   
    int count = 0;
   
    if (entities.size() > 0) {
View Full Code Here

TOP

Related Classes of org.dbwiki.data.schema.AttributeSchemaNode

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.