Package org.dbwiki.data.schema

Examples of org.dbwiki.data.schema.SchemaNode


   */
 
  public void print(HtmlLinePrinter body) throws org.dbwiki.exception.WikiException {
    if (_request.parameters().hasParameter(RequestParameter.ParameterCreate)) {
      RequestParameter parameter = _request.parameters().get(RequestParameter.ParameterCreate);
      SchemaNode schema = null;
      if (parameter.hasValue()) {
        try {
          schema = _request.wiki().database().schema().get(Integer.parseInt(parameter.value()));
        } catch (NumberFormatException excpt) {
          throw new WikiRequestException(WikiRequestException.InvalidParameterValue, parameter.toString());
View Full Code Here


      body.closeTABLE();
    } else {
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrame));
      GroupSchemaNode groupSchemaNode = (GroupSchemaNode)schema;
      for (int iChild = 0; iChild < groupSchemaNode.children().size(); iChild++) {
        SchemaNode child = groupSchemaNode.children().get(iChild);
        // skip deleted entities
        if (!child.getTimestamp().isCurrent())
          continue;
        if (child.isAttribute()) {
          body.openTR();
          body.openTD(layout.getCSS(CSS.CSSObjectListing));
          body.openTABLE(layout.getCSS(CSS.CSSObjectFrameActive));
          this.printInsertLine(child, body);
          body.closeTABLE();
View Full Code Here

  public void printEditMenu(HtmlLinePrinter printer) throws org.dbwiki.exception.WikiException {
    printer.add("\t<a class=\"" + CSS.CSSMenu + "\" id=\"" + TabEdit + "\" onMouseOut=\"HideItem('" + MenuEdit + "');\" onMouseOver=\"ShowItem('" + MenuEdit + "');\">Edit</a>");

    if (_request.node() != null) {
      if (_request.node().getTimestamp().isCurrent()) {
        SchemaNode schema = null;
        if (_request.node().isElement()) {
          schema = ((DatabaseElementNode)_request.node()).schema();
          if (!schema.isGroup()) {
            schema = null;
          }
        }
        this.printObjectMenu((GroupSchemaNode)schema, printer);
      } else {
View Full Code Here

  private void printIndexMenu(HtmlLinePrinter printer) {
    printer.add("\t\t<div class=\"" + CSS.CSSMenuSub + "\" id=\"" + MenuEdit + "\" onMouseOver=\"ShowItem('" + MenuEdit + "');\" onMouseOut=\"HideItem('" + MenuEdit + "');\">");
    printer.add("\t\t\t<div class=\"" + CSS.CSSMenuSubBox + "\">");
    printer.add("\t\t\t\t<ul>");
   
    SchemaNode root = _request.wiki().database().schema().root();
    printer.add("\t\t\t\t\t<li><span class=\"" + CSS.CSSMenuSubBox + "\">" + menuLabelInsert + "</span></li>");
    if (root != null) {
      printer.add("\t\t\t\t\t<li><a href=\"" + _request.wri().getURL() + "?" + RequestParameter.ParameterCreate + "=" + root.id() + "\" class=\"" + CSS.CSSMenuSubSub + "\">" + _layouter.get(root).getName() + "</a></li>");
    } else {
      printer.add("\t\t\t\t\t<li><a href=\"" + _request.wri().getURL() + "?" + RequestParameter.ParameterCreateSchemaNode + "\" class=\"" + CSS.CSSMenuSubSub + "\">" + menuLabelNew + "</a></li>");
    }
   
    this.printPasteSubMenu(printer);
View Full Code Here

    printer.add("\t\t\t\t<ul>");
   
    if (schema != null) {
      printer.add("\t\t\t\t\t<li><span class=\"" + CSS.CSSMenuSubBox + "\">" + menuLabelInsert + "</span></li>");
      for (int i = 0; i < schema.children().size(); i++) {
        SchemaNode child = schema.children().get(i);
        // skip deleted entities
        if(child.getTimestamp().isCurrent()) {
          printer.add("\t\t\t\t\t<li><a href=\"" + _request.wri().getURL() +
              "?" + RequestParameter.ParameterCreate + "=" + child.id() +
              "\" class=\"" + CSS.CSSMenuSubSub + "\">" + _layouter.get(child).getName() +
              "</a></li>");
        }
      }
      printer.add("\t\t\t\t\t<li><a href=\"" + _request.wri().getURL() + "?" + RequestParameter.ParameterCreateSchemaNode + "\" class=\"" + CSS.CSSMenuSubSub + "\">" + menuLabelNew + "</a></li>");
View Full Code Here

   
    content.openTABLE(layout.getCSS(CSS.CSSContentTable));
     
    content.openTR();
    for (int iColumn = 0; iColumn < schemaNode.children().size(); iColumn++) {
      SchemaNode columnSchemaNode = schemaNode.children().get(iColumn);
      // only display columns for entities that have not been deleted
      if (versionParameter.matches(columnSchemaNode)) {
        SchemaLayout schemaLayout = _layouter.get(columnSchemaNode);
        if (active) {
          content.openTH(layout.getCSS(CSS.CSSContentCellActive));
View Full Code Here

  }
 
  public DatabaseElementList find(SchemaNode schema) {
    Stack<SchemaNode> entities = new Stack<SchemaNode>();
   
    SchemaNode parent = schema.parent();
    while (parent != null) {
      if (parent.equals(this.schema())) {
        break;
      }
      entities.push(parent);
      parent = parent.parent();
    }
   
    if (parent == null) {
      return new DatabaseElementList();
    }
   
    Vector<DatabaseGroupNode> elements = new Vector<DatabaseGroupNode>();
    elements.add(this);
   
    while (!entities.isEmpty()) {
      SchemaNode pathSchema = entities.pop();
      Vector<DatabaseGroupNode> candidates = new Vector<DatabaseGroupNode>();
      for (int iElement = 0; iElement < elements.size(); iElement++) {
        DatabaseGroupNode node = elements.get(iElement);
        for (int iChild = 0; iChild < node.children().size(); iChild++) {
          if (node.children().get(iChild).schema().equals(pathSchema)) {
View Full Code Here

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

            // should be removed.
            RDBMSDatabaseGroupNode parentNode = null;
            if (parent != RelDataColParentValUnknown) {
              parentNode = (RDBMSDatabaseGroupNode)nodeIndex.get(new Integer(parent));
            }
            SchemaNode schemaNode = database.schema().get(schema);
            if (schemaNode.isAttribute()) {
              node = new RDBMSDatabaseAttributeNode(id, (AttributeSchemaNode)schemaNode, parentNode, pre, post);
            } else {
              node = new RDBMSDatabaseGroupNode(id, (GroupSchemaNode)schemaNode, parentNode, pre, post);
            }
            if (parentNode != null) {
View Full Code Here

              // should be removed.
              RDBMSDatabaseGroupNode parentNode = null;
              if (parent != RelDataColParentValUnknown) {
                parentNode = (RDBMSDatabaseGroupNode)nodeIndex.get(new Integer(parent));
              }
              SchemaNode schemaNode = database.schema().get(schema);
              if (schemaNode.isAttribute()) {
                node = new RDBMSDatabaseAttributeNode(id, (AttributeSchemaNode)schemaNode, parentNode);
              } else {
                node = new RDBMSDatabaseGroupNode(id, (GroupSchemaNode)schemaNode, parentNode);
              }
              if (parentNode != null) {
View Full Code Here

TOP

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

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.