[Tree Extension] Adds support for LinkToParent Tree tables
authorAugusto Mauch <augusto.mauch@openbravo.com>
Thu, 26 Sep 2013 11:20:34 +0200
changeset 22365 63c26d625f3c
parent 22364 231ead57aedc
child 22366 75870b27ca7f
[Tree Extension] Adds support for LinkToParent Tree tables
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-tree-grid.js.ftl
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeGridComponent.java
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-grid.js
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
src-db/database/model/tables/AD_TABLE.xml
src-db/database/sourcedata/AD_AUXILIARINPUT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_FIELDGROUP.xml
src-db/database/sourcedata/AD_MENU.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_REF_TABLE.xml
src-db/database/sourcedata/AD_TREENODE.xml
src-db/database/sourcedata/OBSERDS_DATASOURCE.xml
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java	Mon Sep 23 11:23:37 2013 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java	Thu Sep 26 11:20:34 2013 +0200
@@ -50,7 +50,7 @@
   private static Entity[] entities = getTreeTables();
 
   private static final String TREENODE_DATASOURCE = "90034CAE96E847D78FBEF6D38CB1930D";
-  private static final String LINKTOPARENT_DATASOURCE = "90034CAE96E847D78FBEF6D38CB1930D";
+  private static final String LINKTOPARENT_DATASOURCE = "610BEAE5E223447DBE6FF672B703F72F";
 
   private static final String TREENODE_STRUCTURE = "ADTree";
   private static final String LINKTOPARENT_STRUCTURE = "LinkToParent";
@@ -111,9 +111,16 @@
     JSONObject jsonBob = new JSONObject();
     try {
       for (Property property : propertyList) {
+        if (property.isOneToMany()) {
+          continue;
+        }
         if (property.getReferencedProperty() != null) {
           BaseOBObject referencedbob = (BaseOBObject) bob.get(property.getName());
-          jsonBob.put(property.getName(), referencedbob.getId());
+          if (referencedbob != null) {
+            jsonBob.put(property.getName(), referencedbob.getId());
+          } else {
+            jsonBob.put(property.getName(), (Object) null);
+          }
         } else {
           jsonBob.put(property.getName(), bob.get(property.getName()));
         }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-tree-grid.js.ftl	Mon Sep 23 11:23:37 2013 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-tree-grid.js.ftl	Thu Sep 26 11:20:34 2013 +0200
@@ -23,6 +23,7 @@
     view: this,
     referencedTableId: '${data.referencedTableId}',
     orderedTree:  ${data.orderedTree?string},
-    // the this is the view instance
+    dataSourceId:  '${data.dataSourceId}',
+    treeStructure:  '${data.treeStructure}',
     fields: this.gridFields
 })
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeGridComponent.java	Mon Sep 23 11:23:37 2013 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeGridComponent.java	Thu Sep 26 11:20:34 2013 +0200
@@ -37,6 +37,12 @@
   private static final String DEFAULT_TEMPLATE_ID = "74451C30650946FC855FCFDB4577070C";
   protected static final Map<String, String> TEMPLATE_MAP = new HashMap<String, String>();
 
+  private static final String TREENODE_DATASOURCE = "90034CAE96E847D78FBEF6D38CB1930D";
+  private static final String LINKTOPARENT_DATASOURCE = "610BEAE5E223447DBE6FF672B703F72F";
+
+  private static final String TREENODE_STRUCTURE = "ADTree";
+  private static final String LINKTOPARENT_STRUCTURE = "LinkToParent";
+
   private Tab tab;
   private OBViewTab viewTab;
   private String referencedTableId;
@@ -78,4 +84,20 @@
     return treeType.isOrdered();
   }
 
+  public String getDataSourceId() {
+    String dataSourceId = null;
+    ADTreeType treeCategory = tab.getTable().getTreeCategory();
+    if (TREENODE_STRUCTURE.equals(treeCategory.getTreeStructure())) {
+      dataSourceId = TREENODE_DATASOURCE;
+    } else if (LINKTOPARENT_STRUCTURE.equals(treeCategory.getTreeStructure())) {
+      dataSourceId = LINKTOPARENT_DATASOURCE;
+    }
+    return dataSourceId;
+  }
+
+  public String getTreeStructure() {
+    ADTreeType treeCategory = tab.getTable().getTreeCategory();
+    return treeCategory.getTreeStructure();
+  }
+
 }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-grid.js	Mon Sep 23 11:23:37 2013 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-grid.js	Thu Sep 26 11:20:34 2013 +0200
@@ -26,6 +26,7 @@
 
   canPickFields: false,
   canDropOnLeaves: true,
+  canHover: false,
   canReorderRecords: true,
   canAcceptDroppedRecords: true,
   dropIconSuffix: "into",
@@ -35,6 +36,11 @@
   folderIcon: null,
   autoFetchData: true,
   closedIconSuffix: "",
+  selectionAppearance: "checkbox",
+  showSelectedStyle: true,
+  // Can't reparent with cascade selection 
+  //  showPartialSelection: true,
+  //  cascadeSelection: true,
   dataProperties: {
     modelType: "parent",
     rootValue: "0",
@@ -55,32 +61,17 @@
   setDataSource: function (ds, fields) {
     var me = this;
     ds.transformRequest = function (dsRequest) {
-      var childrenOfNewParent, prevNode, nextNode;
       dsRequest.params = dsRequest.params || {};
       dsRequest.params.referencedTableId = me.referencedTableId;
       me.parentTabRecordId = me.getParentTabRecordId();
       dsRequest.params.parentRecordId = me.parentTabRecordId;
+      dsRequest.params.tabId = me.view.tabId;
       if (dsRequest.dropIndex || dsRequest.dropIndex === 0) {
         //Only send the index if the tree is ordered
-        if (me.orderedTree) {
-          dsRequest.params.dropIndex = dsRequest.dropIndex;
-          childrenOfNewParent = me.getData().getChildren(dsRequest.newParentNode);
-          if (childrenOfNewParent.length !== 0) {
-            if (dsRequest.dropIndex === 0) {
-              nextNode = childrenOfNewParent[dsRequest.dropIndex];
-              dsRequest.params.nextNodeId = nextNode.id;
-            } else if (dsRequest.dropIndex === childrenOfNewParent.length) {
-              prevNode = childrenOfNewParent[dsRequest.dropIndex - 1];
-              dsRequest.params.prevNodeId = prevNode.id;
-            } else {
-              prevNode = childrenOfNewParent[dsRequest.dropIndex - 1];
-              dsRequest.params.prevNodeId = prevNode.id;
-              nextNode = childrenOfNewParent[dsRequest.dropIndex];
-              dsRequest.params.nextNodeId = nextNode.id;
-            }
-          }
-        }
+        dsRequest = me.addOrderedTreeParameters(dsRequest);
       }
+
+      dsRequest.params.selectedRecords = me.getSelectedRecordsString();
       dsRequest.params._selectedProperties = me.getSelectedPropertiesString();
       return this.Super('transformRequest', arguments);
     };
@@ -93,6 +84,47 @@
     return this.Super("setDataSource", [ds, fields]);
   },
 
+  addOrderedTreeParameters: function (dsRequest) {
+    var childrenOfNewParent, prevNode, nextNode;
+    if (this.orderedTree) {
+      dsRequest.params.dropIndex = dsRequest.dropIndex;
+      childrenOfNewParent = this.getData().getChildren(dsRequest.newParentNode);
+      if (childrenOfNewParent.length !== 0) {
+        if (dsRequest.dropIndex === 0) {
+          nextNode = childrenOfNewParent[dsRequest.dropIndex];
+          dsRequest.params.nextNodeId = nextNode.id;
+        } else if (dsRequest.dropIndex === childrenOfNewParent.length) {
+          prevNode = childrenOfNewParent[dsRequest.dropIndex - 1];
+          dsRequest.params.prevNodeId = prevNode.id;
+        } else {
+          prevNode = childrenOfNewParent[dsRequest.dropIndex - 1];
+          dsRequest.params.prevNodeId = prevNode.id;
+          nextNode = childrenOfNewParent[dsRequest.dropIndex];
+          dsRequest.params.nextNodeId = nextNode.id;
+        }
+      }
+    }
+    return dsRequest;
+  },
+
+  getSelectedRecordsString: function () {
+    var selectedRecordsString = '[',
+        first = true,
+        selectedRecords = this.view.viewGrid.getSelectedRecords(),
+        len = selectedRecords.length,
+        i;
+    for (i = 0; i < len; i++) {
+      if (first) {
+        first = false;
+        selectedRecordsString = selectedRecordsString + "'" + selectedRecords[i][OB.Constants.ID] + "'";
+      } else {
+        selectedRecordsString = selectedRecordsString + ',' + "'" + selectedRecords[i][OB.Constants.ID] + "'";
+      }
+    }
+    selectedRecordsString = selectedRecordsString + ']';
+    return selectedRecordsString;
+  },
+
   getParentTabRecordId: function () {
     var parentRecordId = null;
     if (!this.view.parentView) {
@@ -103,7 +135,9 @@
 
   getSelectedPropertiesString: function () {
     var selectedProperties = '[',
-        first = true, len = this.fields.length, i;
+        first = true,
+        len = this.fields.length,
+        i;
     for (i = 0; i < len; i++) {
       if (first) {
         first = false;
@@ -152,6 +186,17 @@
       }
     }
     return true;
+  },
+
+  getNodeByID: function (nodeId) {
+    var i, node, nodeList = this.data.getNodeList();
+    for (i = 0; i < nodeList.length; i++) {
+      node = nodeList[i];
+      if (node.id === nodeId) {
+        return node;
+      }
+    }
+    return null;
   }
 });
 
@@ -304,11 +349,13 @@
       referencedTableId: this.referencedTableId,
       fields: gridFields,
       orderedTree: this.orderedTree,
+      treeStructure: this.treeStructure,
+
       width: 500,
       height: 400
     });
 
-    OB.Datasource.get('90034CAE96E847D78FBEF6D38CB1930D', this.tree, null, true);
+    OB.Datasource.get(this.dataSourceId, this.tree, null, true);
 
     this.mainLayout.addMember(this.tree);
     this.addAutoChild('buttonLayout');
@@ -351,5 +398,12 @@
       this.tree.fetchData(null, callback);
     }
     return this.Super('show', arguments);
+  },
+
+  hide: function () {
+    this.Super('hide', arguments);
+    if (this.treeStructure === 'LinkToParent') {
+      this.view.viewGrid.refreshGrid();
+    }
   }
 });
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java	Thu Sep 26 11:20:34 2013 +0200
@@ -0,0 +1,254 @@
+package org.openbravo.service.datasource;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.List;
+import java.util.Map;
+
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.hibernate.ScrollMode;
+import org.hibernate.ScrollableResults;
+import org.hibernate.criterion.Projections;
+import org.hibernate.criterion.Restrictions;
+import org.openbravo.base.exception.OBException;
+import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
+import org.openbravo.base.model.Property;
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.base.structure.BaseOBObject;
+import org.openbravo.dal.service.OBCriteria;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBQuery;
+import org.openbravo.database.ConnectionProvider;
+import org.openbravo.model.ad.datamodel.Column;
+import org.openbravo.model.ad.datamodel.Table;
+import org.openbravo.model.ad.ui.Tab;
+import org.openbravo.model.ad.utility.Tree;
+import org.openbravo.model.ad.utility.TreeNode;
+import org.openbravo.service.db.DalConnectionProvider;
+import org.openbravo.service.json.DataResolvingMode;
+import org.openbravo.service.json.DataToJsonConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class LinkToParentTreeDatasourceService extends TreeDatasourceService {
+  final static Logger logger = LoggerFactory.getLogger(LinkToParentTreeDatasourceService.class);
+
+  @Override
+  protected void addNewNode(JSONObject bobProperties) {
+    // Nothing needs to be done
+  }
+
+  @Override
+  protected void deleteNode(JSONObject bobProperties) {
+    try {
+      String bobId = bobProperties.getString("id");
+      String entityName = bobProperties.getString("_entity");
+      Entity entity = ModelProvider.getInstance().getEntity(entityName);
+      Table table = OBDal.getInstance().get(Table.class, entity.getTableId());
+      Property linkToParentProperty = getLinkToParentProperty(table);
+      String bobParentNode = null;
+      if (bobProperties.has(linkToParentProperty.getName())) {
+        bobProperties.getString(linkToParentProperty.getName());
+      }
+
+      int nChildrenMoved = reparentChildrenOfDeletedNode(entity, bobParentNode, bobId);
+      logger.info(nChildrenMoved + " children have been moved to another parent");
+    } catch (Exception e) {
+      logger.error("Error while deleting tree node: ", e);
+      throw new OBException("The node could not be deleted");
+    }
+  }
+
+  public int reparentChildrenOfDeletedNode(Entity entity, String newParentId, String deletedNodeId) {
+    int nChildrenMoved = -1;
+    Table table = OBDal.getInstance().get(Table.class, entity.getTableId());
+    Property linkToParentProperty = getLinkToParentProperty(table);
+    Column linkToParentColumn = OBDal.getInstance().get(Column.class,
+        linkToParentProperty.getColumnId());
+    try {
+      StringBuilder sql = new StringBuilder();
+      sql.append(" UPDATE " + table.getDBTableName() + " ");
+      if (newParentId == null) {
+        sql.append(" set " + linkToParentColumn.getDBColumnName() + " = null ");
+      } else {
+        sql.append(" set " + linkToParentColumn.getDBColumnName() + " = ? ");
+      }
+      sql.append(" WHERE " + linkToParentColumn.getDBColumnName() + " = ? ");
+      PreparedStatement ps = OBDal.getInstance().getConnection(false)
+          .prepareStatement(sql.toString());
+
+      if (newParentId == null) {
+        ps.setString(1, deletedNodeId);
+      } else {
+        ps.setString(1, newParentId);
+        ps.setString(2, deletedNodeId);
+      }
+      nChildrenMoved = ps.executeUpdate();
+    } catch (SQLException e) {
+      logger.error("Error while deleting tree node: ", e);
+    }
+    return nChildrenMoved;
+  }
+
+  private Property getLinkToParentProperty(Table table) {
+    Column linkToParentColumn = table.getLinkToParentColumn();
+    Entity entity = ModelProvider.getInstance().getEntityByTableId(table.getId());
+    return entity.getPropertyByColumnName(linkToParentColumn.getDBColumnName());
+  }
+
+  @Override
+  protected JSONArray fetchNodeChildren(Map<String, String> parameters) throws JSONException {
+
+    final String ROOT_NODE = "0";
+    String tabId = parameters.get("tabId");
+    String parentId = parameters.get("parentId");
+
+    boolean fetchRoot = ROOT_NODE.equals(parentId);
+    Tab tab = OBDal.getInstance().get(Tab.class, tabId);
+    Table table = tab.getTable();
+    Entity entity = ModelProvider.getInstance().getEntityByTableId(table.getId());
+    Property linkToParentProperty = getLinkToParentProperty(table);
+
+    StringBuilder whereClause = new StringBuilder();
+    whereClause.append(" where " + linkToParentProperty.getName());
+    if (fetchRoot) {
+      whereClause.append(" is null ");
+    } else {
+      BaseOBObject parentBob = OBDal.getInstance().get(entity.getName(), parentId);
+      whereClause.append(".id = '" + parentBob.getId() + "' ");
+    }
+
+    final OBQuery<BaseOBObject> query = OBDal.getInstance().createQuery(entity.getName(),
+        whereClause.toString());
+
+    final DataToJsonConverter toJsonConverter = OBProvider.getInstance().get(
+        DataToJsonConverter.class);
+
+    JSONArray responseData = new JSONArray();
+
+    final ScrollableResults scrollableResults = query.scroll(ScrollMode.FORWARD_ONLY);
+    while (scrollableResults.next()) {
+      BaseOBObject bob = (BaseOBObject) scrollableResults.get()[0];
+      final JSONObject json = toJsonConverter.toJsonObject((BaseOBObject) bob,
+          DataResolvingMode.FULL);
+      json.put("parentId", parentId);
+      json.put("_hasChildren", (this.nodeHasChildren(entity, bob)) ? true : false);
+      responseData.put(json);
+
+    }
+    return responseData;
+  }
+
+  private boolean nodeHasChildren(Entity entity, BaseOBObject node) {
+    Table table = OBDal.getInstance().get(Table.class, entity.getTableId());
+    Property linkToParentProperty = getLinkToParentProperty(table);
+    OBCriteria<BaseOBObject> nodeChildrenCriteria = OBDal.getInstance().createCriteria(
+        entity.getName());
+    nodeChildrenCriteria.add(Restrictions.eq(linkToParentProperty.getName(), node));
+    return nodeChildrenCriteria.count() > 0;
+  }
+
+  private void recomputeSequenceNumbers(Tree tree, String newParentId, Long seqNo) {
+    StringBuilder queryStr = new StringBuilder();
+    queryStr.append(" UPDATE ad_treenode ");
+    queryStr.append(" SET seqno = (seqno + 10) ");
+    queryStr.append(" WHERE ad_tree_id = ? ");
+    queryStr.append(" AND parent_id = ? ");
+    queryStr.append(" AND seqno >= ? ");
+
+    ConnectionProvider conn = new DalConnectionProvider(false);
+    PreparedStatement st;
+    try {
+      st = conn.getPreparedStatement(queryStr.toString());
+      st.setString(1, tree.getId());
+      st.setString(2, newParentId);
+      st.setLong(3, seqNo);
+      int nUpdated = st.executeUpdate();
+      logger.debug("Recomputing sequence numbers: " + nUpdated + " nodes updated");
+      conn.releasePreparedStatement(st);
+    } catch (Exception e) {
+      logger.error("Exception while recomputing sequence numbers: ", e);
+    }
+  }
+
+  private String getReferencedColumnValue(JSONObject bobProperties, List<Column> parentColumns) {
+    Column parentColumn = parentColumns.get(0);
+    Property property = getPropertyFromColumn(parentColumn);
+    String referencedBobId = null;
+    try {
+      referencedBobId = (String) bobProperties.get(property.getName());
+    } catch (JSONException e) {
+      logger.error("Error on tree datasource", e);
+    }
+    return referencedBobId;
+  }
+
+  private List<Column> getParentColumns(Table table) {
+    OBCriteria<Column> isParentColumnsCriteria = OBDal.getInstance().createCriteria(Column.class);
+    isParentColumnsCriteria.add(Restrictions.eq(Column.PROPERTY_TABLE, table));
+    isParentColumnsCriteria.add(Restrictions.eq(Column.PROPERTY_LINKTOPARENTCOLUMN, true));
+    return isParentColumnsCriteria.list();
+  }
+
+  private Property getPropertyFromColumn(Column column) {
+    Entity entity = ModelProvider.getInstance().getEntityByTableId(column.getTable().getId());
+    return entity.getPropertyByColumnName(column.getDBColumnName());
+  }
+
+  protected void moveNode(Map<String, String> parameters, String nodeId, String newParentId,
+      String prevNodeId, String nextNodeId) throws Exception {
+
+    String referencedTableId = parameters.get("referencedTableId");
+    Table table = OBDal.getInstance().get(Table.class, referencedTableId);
+    Entity entity = ModelProvider.getInstance().getEntityByTableId(table.getId());
+    Property linkToParentProperty = getLinkToParentProperty(table);
+    boolean isOrdered = table.getTreeCategory().isOrdered();
+
+    // TODO:Testing
+    // Long seqNo = null;
+    // if (isOrdered) {
+    // seqNo = this.calculateSequenceNumberAndRecompute(tree, prevNodeId, nextNodeId,
+    // newParentId);
+    // }
+
+    BaseOBObject bob = OBDal.getInstance().get(entity.getName(), nodeId);
+    BaseOBObject parentBob = OBDal.getInstance().get(entity.getName(), newParentId);
+    bob.set(linkToParentProperty.getName(), parentBob);
+
+    // if (isOrdered) {
+    // treeNode.setSequenceNumber(seqNo);
+    // }
+    OBDal.getInstance().flush();
+  }
+
+  private Long calculateSequenceNumberAndRecompute(Tree tree, String prevNodeId, String nextNodeId,
+      String newParentId) throws Exception {
+    Long seqNo = null;
+    if (prevNodeId == null && nextNodeId == null) {
+      // Only child, no need to recompute sequence numbers
+      seqNo = 10L;
+    } else if (nextNodeId == null) {
+      // Last positioned child. Pick the highest sequence number of its brothers and add 10
+      // No need to recompute sequence numbers
+      OBCriteria<TreeNode> maxSeqNoCriteria = OBDal.getInstance().createCriteria(TreeNode.class);
+      maxSeqNoCriteria.add(Restrictions.eq(TreeNode.PROPERTY_TREE, tree));
+      maxSeqNoCriteria.add(Restrictions.eq(TreeNode.PROPERTY_REPORTSET, newParentId));
+      maxSeqNoCriteria.setProjection(Projections.max(TreeNode.PROPERTY_SEQUENCENUMBER));
+      Long maxSeqNo = (Long) maxSeqNoCriteria.uniqueResult();
+      seqNo = maxSeqNo + 10;
+    } else {
+      // Sequence numbers of the nodes that are positioned after the new one needs to be recomputed
+      OBCriteria<TreeNode> nextNodeCriteria = OBDal.getInstance().createCriteria(TreeNode.class);
+      nextNodeCriteria.add(Restrictions.eq(TreeNode.PROPERTY_TREE, tree));
+      nextNodeCriteria.add(Restrictions.eq(TreeNode.PROPERTY_NODE, nextNodeId));
+      TreeNode nextNode = (TreeNode) nextNodeCriteria.uniqueResult();
+      seqNo = nextNode.getSequenceNumber();
+      recomputeSequenceNumbers(tree, newParentId, seqNo);
+    }
+    return seqNo;
+  }
+
+}
--- a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Mon Sep 23 11:23:37 2013 +0200
+++ b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Thu Sep 26 11:20:34 2013 +0200
@@ -75,11 +75,12 @@
 });
 
 isc.Tree.addProperties({
+	  _original_getLoadState: isc.Tree.getPrototype().getLoadState,
   getLoadState: function (node) {
     if (node._hasChildren === false) {
       return isc.Tree.LOADED;
     } else {
-      return this.Super('getLoadState', arguments);
+      return  this._original_getLoadState(node);
     }
   }
 });
--- a/src-db/database/model/tables/AD_TABLE.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/model/tables/AD_TABLE.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -141,6 +141,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="LINKTOPARENTCOLUMN" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="TREESEQUENCECOLUMN" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="OBSERDS_DATASOURCE" name="AD_COLUMN_DATASOURCE">
         <reference local="OBSERDS_DATASOURCE_ID" foreign="OBSERDS_DATASOURCE_ID"/>
       </foreign-key>
@@ -162,6 +170,12 @@
       <foreign-key foreignTable="AD_WINDOW" name="AD_TABLE_AD_WINDOW">
         <reference local="PO_WINDOW_ID" foreign="AD_WINDOW_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="AD_COLUMN" name="AD_TABLE_PARENT_LINK">
+        <reference local="LINKTOPARENTCOLUMN" foreign="AD_COLUMN_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_COLUMN" name="AD_TABLE_SEQ_COL">
+        <reference local="TREESEQUENCECOLUMN" foreign="AD_COLUMN_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_WINDOW" name="AD_WINDOW_TABLE" onDelete="setnull">
         <reference local="AD_WINDOW_ID" foreign="AD_WINDOW_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -908,6 +908,17 @@
 <!--162BEBF77E8D419ABDAD4E87A5C17430-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--162BEBF77E8D419ABDAD4E87A5C17430--></AD_AUXILIARINPUT>
 
+<!--175C5A0C916849EC8A56591CC4792670--><AD_AUXILIARINPUT>
+<!--175C5A0C916849EC8A56591CC4792670-->  <AD_AUXILIARINPUT_ID><![CDATA[175C5A0C916849EC8A56591CC4792670]]></AD_AUXILIARINPUT_ID>
+<!--175C5A0C916849EC8A56591CC4792670-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--175C5A0C916849EC8A56591CC4792670-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--175C5A0C916849EC8A56591CC4792670-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--175C5A0C916849EC8A56591CC4792670-->  <AD_TAB_ID><![CDATA[100]]></AD_TAB_ID>
+<!--175C5A0C916849EC8A56591CC4792670-->  <NAME><![CDATA[TreeCategoryStructure]]></NAME>
+<!--175C5A0C916849EC8A56591CC4792670-->  <CODE><![CDATA[@SQL=SELECT treestructure FROM ad_treetype WHERE ad_treetype_id = @ad_treetype_id@]]></CODE>
+<!--175C5A0C916849EC8A56591CC4792670-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--175C5A0C916849EC8A56591CC4792670--></AD_AUXILIARINPUT>
+
 <!--17F5DEA4A5254BDDA77560A7D67667B6--><AD_AUXILIARINPUT>
 <!--17F5DEA4A5254BDDA77560A7D67667B6-->  <AD_AUXILIARINPUT_ID><![CDATA[17F5DEA4A5254BDDA77560A7D67667B6]]></AD_AUXILIARINPUT_ID>
 <!--17F5DEA4A5254BDDA77560A7D67667B6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1827,6 +1838,17 @@
 <!--5EE498F6C1484535A77A8CE36D96C77B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5EE498F6C1484535A77A8CE36D96C77B--></AD_AUXILIARINPUT>
 
+<!--600E99CDA16A4959B0B59D7272D462D2--><AD_AUXILIARINPUT>
+<!--600E99CDA16A4959B0B59D7272D462D2-->  <AD_AUXILIARINPUT_ID><![CDATA[600E99CDA16A4959B0B59D7272D462D2]]></AD_AUXILIARINPUT_ID>
+<!--600E99CDA16A4959B0B59D7272D462D2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--600E99CDA16A4959B0B59D7272D462D2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--600E99CDA16A4959B0B59D7272D462D2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--600E99CDA16A4959B0B59D7272D462D2-->  <AD_TAB_ID><![CDATA[100]]></AD_TAB_ID>
+<!--600E99CDA16A4959B0B59D7272D462D2-->  <NAME><![CDATA[IsOrderedTree]]></NAME>
+<!--600E99CDA16A4959B0B59D7272D462D2-->  <CODE><![CDATA[@SQL=SELECT isordered FROM ad_treetype WHERE ad_treetype_id = @ad_treetype_id@]]></CODE>
+<!--600E99CDA16A4959B0B59D7272D462D2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--600E99CDA16A4959B0B59D7272D462D2--></AD_AUXILIARINPUT>
+
 <!--60A4A6C6CCCD4101A1FF072BEEB624A3--><AD_AUXILIARINPUT>
 <!--60A4A6C6CCCD4101A1FF072BEEB624A3-->  <AD_AUXILIARINPUT_ID><![CDATA[60A4A6C6CCCD4101A1FF072BEEB624A3]]></AD_AUXILIARINPUT_ID>
 <!--60A4A6C6CCCD4101A1FF072BEEB624A3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -252688,6 +252688,40 @@
 <!--625259FDD54F4144B22BD350158EE154-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--625259FDD54F4144B22BD350158EE154--></AD_COLUMN>
 
+<!--62B0B7FBCC084D77AB76F12EFF853439--><AD_COLUMN>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <AD_COLUMN_ID><![CDATA[62B0B7FBCC084D77AB76F12EFF853439]]></AD_COLUMN_ID>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <NAME><![CDATA[Tree Sequence Column]]></NAME>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <COLUMNNAME><![CDATA[TreeSequenceColumn]]></COLUMNNAME>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <AD_TABLE_ID><![CDATA[100]]></AD_TABLE_ID>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <AD_REFERENCE_VALUE_ID><![CDATA[E125179F7310445E880814C659CA9F5A]]></AD_REFERENCE_VALUE_ID>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <SEQNO><![CDATA[161]]></SEQNO>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <AD_ELEMENT_ID><![CDATA[DD1CAEC50F54425CB4EF470DBB9FDA2C]]></AD_ELEMENT_ID>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <POSITION><![CDATA[37]]></POSITION>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--62B0B7FBCC084D77AB76F12EFF853439-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--62B0B7FBCC084D77AB76F12EFF853439--></AD_COLUMN>
+
 <!--62D58DE741344625BB85B770C2007281--><AD_COLUMN>
 <!--62D58DE741344625BB85B770C2007281-->  <AD_COLUMN_ID><![CDATA[62D58DE741344625BB85B770C2007281]]></AD_COLUMN_ID>
 <!--62D58DE741344625BB85B770C2007281-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -304803,6 +304837,40 @@
 <!--CA49F473D15C4B778B338AE9ECB5DEA7-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--CA49F473D15C4B778B338AE9ECB5DEA7--></AD_COLUMN>
 
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9--><AD_COLUMN>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <AD_COLUMN_ID><![CDATA[CA527B95DCAC4A5C8D35D8A0B384C4C9]]></AD_COLUMN_ID>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <NAME><![CDATA[Link to Parent Column]]></NAME>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <COLUMNNAME><![CDATA[LinkToParentColumn]]></COLUMNNAME>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <AD_TABLE_ID><![CDATA[100]]></AD_TABLE_ID>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <AD_REFERENCE_VALUE_ID><![CDATA[E125179F7310445E880814C659CA9F5A]]></AD_REFERENCE_VALUE_ID>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <SEQNO><![CDATA[151]]></SEQNO>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <AD_ELEMENT_ID><![CDATA[D4D7E2ED15CA403C88268790EB09C018]]></AD_ELEMENT_ID>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <POSITION><![CDATA[36]]></POSITION>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--CA527B95DCAC4A5C8D35D8A0B384C4C9--></AD_COLUMN>
+
 <!--CA55C27F81D94F2E824789DDCBA07F1F--><AD_COLUMN>
 <!--CA55C27F81D94F2E824789DDCBA07F1F-->  <AD_COLUMN_ID><![CDATA[CA55C27F81D94F2E824789DDCBA07F1F]]></AD_COLUMN_ID>
 <!--CA55C27F81D94F2E824789DDCBA07F1F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -30744,6 +30744,18 @@
 <!--D4CE0D9FD3B146CC8F15295E9F3F7742-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--D4CE0D9FD3B146CC8F15295E9F3F7742--></AD_ELEMENT>
 
+<!--D4D7E2ED15CA403C88268790EB09C018--><AD_ELEMENT>
+<!--D4D7E2ED15CA403C88268790EB09C018-->  <AD_ELEMENT_ID><![CDATA[D4D7E2ED15CA403C88268790EB09C018]]></AD_ELEMENT_ID>
+<!--D4D7E2ED15CA403C88268790EB09C018-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D4D7E2ED15CA403C88268790EB09C018-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D4D7E2ED15CA403C88268790EB09C018-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D4D7E2ED15CA403C88268790EB09C018-->  <COLUMNNAME><![CDATA[LinkToParentColumn]]></COLUMNNAME>
+<!--D4D7E2ED15CA403C88268790EB09C018-->  <NAME><![CDATA[Link to Parent Column]]></NAME>
+<!--D4D7E2ED15CA403C88268790EB09C018-->  <PRINTNAME><![CDATA[Link to Parent Column]]></PRINTNAME>
+<!--D4D7E2ED15CA403C88268790EB09C018-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D4D7E2ED15CA403C88268790EB09C018-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--D4D7E2ED15CA403C88268790EB09C018--></AD_ELEMENT>
+
 <!--D50985CA0CA5436ABFD922D3D68D1F59--><AD_ELEMENT>
 <!--D50985CA0CA5436ABFD922D3D68D1F59-->  <AD_ELEMENT_ID><![CDATA[D50985CA0CA5436ABFD922D3D68D1F59]]></AD_ELEMENT_ID>
 <!--D50985CA0CA5436ABFD922D3D68D1F59-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -31146,6 +31158,18 @@
 <!--DBB02A64470D4093A2534F0DFC8BF855-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--DBB02A64470D4093A2534F0DFC8BF855--></AD_ELEMENT>
 
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C--><AD_ELEMENT>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C-->  <AD_ELEMENT_ID><![CDATA[DD1CAEC50F54425CB4EF470DBB9FDA2C]]></AD_ELEMENT_ID>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C-->  <COLUMNNAME><![CDATA[TreeSequenceColumn]]></COLUMNNAME>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C-->  <NAME><![CDATA[Tree Sequence Column]]></NAME>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C-->  <PRINTNAME><![CDATA[Tree Sequence Column]]></PRINTNAME>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--DD1CAEC50F54425CB4EF470DBB9FDA2C--></AD_ELEMENT>
+
 <!--DD64C1EFFA364FE7E040007F01002A49--><AD_ELEMENT>
 <!--DD64C1EFFA364FE7E040007F01002A49-->  <AD_ELEMENT_ID><![CDATA[DD64C1EFFA364FE7E040007F01002A49]]></AD_ELEMENT_ID>
 <!--DD64C1EFFA364FE7E040007F01002A49-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -192405,6 +192405,33 @@
 <!--3D0F213439C848F2990DC82AB370878A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--3D0F213439C848F2990DC82AB370878A--></AD_FIELD>
 
+<!--3D21BC48702042B6AE0547A2EB0C7344--><AD_FIELD>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <AD_FIELD_ID><![CDATA[3D21BC48702042B6AE0547A2EB0C7344]]></AD_FIELD_ID>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <NAME><![CDATA[Link to Parent Column]]></NAME>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <AD_TAB_ID><![CDATA[100]]></AD_TAB_ID>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <AD_COLUMN_ID><![CDATA[CA527B95DCAC4A5C8D35D8A0B384C4C9]]></AD_COLUMN_ID>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <DISPLAYLOGIC><![CDATA[@TreeCategoryStructure@='LinkToParent']]></DISPLAYLOGIC>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <SEQNO><![CDATA[230]]></SEQNO>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--3D21BC48702042B6AE0547A2EB0C7344-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--3D21BC48702042B6AE0547A2EB0C7344--></AD_FIELD>
+
 <!--3D4E04FA05BF41CF9B19AFB2F52A6579--><AD_FIELD>
 <!--3D4E04FA05BF41CF9B19AFB2F52A6579-->  <AD_FIELD_ID><![CDATA[3D4E04FA05BF41CF9B19AFB2F52A6579]]></AD_FIELD_ID>
 <!--3D4E04FA05BF41CF9B19AFB2F52A6579-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -242404,6 +242431,7 @@
 <!--A9357E760CE746CCB7C05FD25D112EEA-->  <AD_TAB_ID><![CDATA[100]]></AD_TAB_ID>
 <!--A9357E760CE746CCB7C05FD25D112EEA-->  <AD_COLUMN_ID><![CDATA[6D214BF8E931416786EEF0E056BB67CB]]></AD_COLUMN_ID>
 <!--A9357E760CE746CCB7C05FD25D112EEA-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--A9357E760CE746CCB7C05FD25D112EEA-->  <AD_FIELDGROUP_ID><![CDATA[0352F3116DDD4654B3BF8922364CBB6A]]></AD_FIELDGROUP_ID>
 <!--A9357E760CE746CCB7C05FD25D112EEA-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--A9357E760CE746CCB7C05FD25D112EEA-->  <DISPLAYLOGIC><![CDATA[@Istree@='Y']]></DISPLAYLOGIC>
 <!--A9357E760CE746CCB7C05FD25D112EEA-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
@@ -266918,6 +266946,33 @@
 <!--D3B13C70B60045729EB8B37B6B785B24-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--D3B13C70B60045729EB8B37B6B785B24--></AD_FIELD>
 
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE--><AD_FIELD>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <AD_FIELD_ID><![CDATA[D3C66EB0CDE04ECDB03A1FE8D645EAAE]]></AD_FIELD_ID>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <NAME><![CDATA[Tree Sequence Column]]></NAME>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <AD_TAB_ID><![CDATA[100]]></AD_TAB_ID>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <AD_COLUMN_ID><![CDATA[62B0B7FBCC084D77AB76F12EFF853439]]></AD_COLUMN_ID>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <DISPLAYLOGIC><![CDATA[@TreeCategoryStructure@='LinkToParent' & @IsOrderedTree@='Y']]></DISPLAYLOGIC>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <SEQNO><![CDATA[240]]></SEQNO>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D3C66EB0CDE04ECDB03A1FE8D645EAAE--></AD_FIELD>
+
 <!--D3F1C0F0C9EB4D60A39E8221A81133B9--><AD_FIELD>
 <!--D3F1C0F0C9EB4D60A39E8221A81133B9-->  <AD_FIELD_ID><![CDATA[D3F1C0F0C9EB4D60A39E8221A81133B9]]></AD_FIELD_ID>
 <!--D3F1C0F0C9EB4D60A39E8221A81133B9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELDGROUP.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/AD_FIELDGROUP.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -334,6 +334,16 @@
 <!--1002100000-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--1002100000--></AD_FIELDGROUP>
 
+<!--0352F3116DDD4654B3BF8922364CBB6A--><AD_FIELDGROUP>
+<!--0352F3116DDD4654B3BF8922364CBB6A-->  <AD_FIELDGROUP_ID><![CDATA[0352F3116DDD4654B3BF8922364CBB6A]]></AD_FIELDGROUP_ID>
+<!--0352F3116DDD4654B3BF8922364CBB6A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0352F3116DDD4654B3BF8922364CBB6A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0352F3116DDD4654B3BF8922364CBB6A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0352F3116DDD4654B3BF8922364CBB6A-->  <NAME><![CDATA[Tree Configuration]]></NAME>
+<!--0352F3116DDD4654B3BF8922364CBB6A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--0352F3116DDD4654B3BF8922364CBB6A-->  <ISCOLLAPSED><![CDATA[N]]></ISCOLLAPSED>
+<!--0352F3116DDD4654B3BF8922364CBB6A--></AD_FIELDGROUP>
+
 <!--0595CF7C85754F72B393E766F9CF327C--><AD_FIELDGROUP>
 <!--0595CF7C85754F72B393E766F9CF327C-->  <AD_FIELDGROUP_ID><![CDATA[0595CF7C85754F72B393E766F9CF327C]]></AD_FIELDGROUP_ID>
 <!--0595CF7C85754F72B393E766F9CF327C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MENU.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/AD_MENU.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -4450,6 +4450,18 @@
 <!--3CC69F84B2524A69B53D1BD90FC7D0B9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--3CC69F84B2524A69B53D1BD90FC7D0B9--></AD_MENU>
 
+<!--3E1511B073444816AA02EFFA6789C603--><AD_MENU>
+<!--3E1511B073444816AA02EFFA6789C603-->  <AD_MENU_ID><![CDATA[3E1511B073444816AA02EFFA6789C603]]></AD_MENU_ID>
+<!--3E1511B073444816AA02EFFA6789C603-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3E1511B073444816AA02EFFA6789C603-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3E1511B073444816AA02EFFA6789C603-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3E1511B073444816AA02EFFA6789C603-->  <NAME><![CDATA[Employee (LinkToParent)]]></NAME>
+<!--3E1511B073444816AA02EFFA6789C603-->  <ISSUMMARY><![CDATA[N]]></ISSUMMARY>
+<!--3E1511B073444816AA02EFFA6789C603-->  <ACTION><![CDATA[W]]></ACTION>
+<!--3E1511B073444816AA02EFFA6789C603-->  <AD_WINDOW_ID><![CDATA[86D57ADF6BDD457FA669B8A2D3074E6A]]></AD_WINDOW_ID>
+<!--3E1511B073444816AA02EFFA6789C603-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3E1511B073444816AA02EFFA6789C603--></AD_MENU>
+
 <!--4ACC59DA7DAB48FFAEB9128B7D803A15--><AD_MENU>
 <!--4ACC59DA7DAB48FFAEB9128B7D803A15-->  <AD_MENU_ID><![CDATA[4ACC59DA7DAB48FFAEB9128B7D803A15]]></AD_MENU_ID>
 <!--4ACC59DA7DAB48FFAEB9128B7D803A15-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -6008,6 +6008,18 @@
 <!--DF812D5784884A83A0D0E3E711819BF5-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--DF812D5784884A83A0D0E3E711819BF5--></AD_REFERENCE>
 
+<!--E125179F7310445E880814C659CA9F5A--><AD_REFERENCE>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_REFERENCE_ID><![CDATA[E125179F7310445E880814C659CA9F5A]]></AD_REFERENCE_ID>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E125179F7310445E880814C659CA9F5A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E125179F7310445E880814C659CA9F5A-->  <NAME><![CDATA[Tree Table Link to Parent / Sequence field]]></NAME>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E125179F7310445E880814C659CA9F5A-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--E125179F7310445E880814C659CA9F5A-->  <PARENTREFERENCE_ID><![CDATA[18]]></PARENTREFERENCE_ID>
+<!--E125179F7310445E880814C659CA9F5A-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--E125179F7310445E880814C659CA9F5A--></AD_REFERENCE>
+
 <!--E8E9B9F9FBDE4E679EC69611D2CCE1E3--><AD_REFERENCE>
 <!--E8E9B9F9FBDE4E679EC69611D2CCE1E3-->  <AD_REFERENCE_ID><![CDATA[E8E9B9F9FBDE4E679EC69611D2CCE1E3]]></AD_REFERENCE_ID>
 <!--E8E9B9F9FBDE4E679EC69611D2CCE1E3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_TABLE.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/AD_REF_TABLE.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -1395,6 +1395,19 @@
 <!--DF1CEA94B3564A33AFDB37C07E1CE353-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--DF1CEA94B3564A33AFDB37C07E1CE353--></AD_REF_TABLE>
 
+<!--E125179F7310445E880814C659CA9F5A--><AD_REF_TABLE>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_REFERENCE_ID><![CDATA[E125179F7310445E880814C659CA9F5A]]></AD_REFERENCE_ID>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E125179F7310445E880814C659CA9F5A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_TABLE_ID><![CDATA[101]]></AD_TABLE_ID>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_KEY><![CDATA[109]]></AD_KEY>
+<!--E125179F7310445E880814C659CA9F5A-->  <AD_DISPLAY><![CDATA[111]]></AD_DISPLAY>
+<!--E125179F7310445E880814C659CA9F5A-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--E125179F7310445E880814C659CA9F5A-->  <WHERECLAUSE><![CDATA[ad_table_id=@ad_table_id@]]></WHERECLAUSE>
+<!--E125179F7310445E880814C659CA9F5A-->  <ORDERBYCLAUSE><![CDATA[name]]></ORDERBYCLAUSE>
+<!--E125179F7310445E880814C659CA9F5A--></AD_REF_TABLE>
+
 <!--E943EF6DC4524209BD5933661EC0BDDC--><AD_REF_TABLE>
 <!--E943EF6DC4524209BD5933661EC0BDDC-->  <AD_REFERENCE_ID><![CDATA[E943EF6DC4524209BD5933661EC0BDDC]]></AD_REFERENCE_ID>
 <!--E943EF6DC4524209BD5933661EC0BDDC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TREENODE.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/AD_TREENODE.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -3892,6 +3892,17 @@
 <!--57A5918685E48F9DE040007F010157A3-->  <SEQNO><![CDATA[50]]></SEQNO>
 <!--57A5918685E48F9DE040007F010157A3--></AD_TREENODE>
 
+<!--580033DC63C3462497E6C116D38CF523--><AD_TREENODE>
+<!--580033DC63C3462497E6C116D38CF523-->  <AD_TREENODE_ID><![CDATA[580033DC63C3462497E6C116D38CF523]]></AD_TREENODE_ID>
+<!--580033DC63C3462497E6C116D38CF523-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
+<!--580033DC63C3462497E6C116D38CF523-->  <NODE_ID><![CDATA[3E1511B073444816AA02EFFA6789C603]]></NODE_ID>
+<!--580033DC63C3462497E6C116D38CF523-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--580033DC63C3462497E6C116D38CF523-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--580033DC63C3462497E6C116D38CF523-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--580033DC63C3462497E6C116D38CF523-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
+<!--580033DC63C3462497E6C116D38CF523-->  <SEQNO><![CDATA[999]]></SEQNO>
+<!--580033DC63C3462497E6C116D38CF523--></AD_TREENODE>
+
 <!--5849002C5F1154C3E040007F0100223C--><AD_TREENODE>
 <!--5849002C5F1154C3E040007F0100223C-->  <AD_TREENODE_ID><![CDATA[5849002C5F1154C3E040007F0100223C]]></AD_TREENODE_ID>
 <!--5849002C5F1154C3E040007F0100223C-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
--- a/src-db/database/sourcedata/OBSERDS_DATASOURCE.xml	Mon Sep 23 11:23:37 2013 +0200
+++ b/src-db/database/sourcedata/OBSERDS_DATASOURCE.xml	Thu Sep 26 11:20:34 2013 +0200
@@ -1,5 +1,17 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <data>
+<!--610BEAE5E223447DBE6FF672B703F72F--><OBSERDS_DATASOURCE>
+<!--610BEAE5E223447DBE6FF672B703F72F-->  <OBSERDS_DATASOURCE_ID><![CDATA[610BEAE5E223447DBE6FF672B703F72F]]></OBSERDS_DATASOURCE_ID>
+<!--610BEAE5E223447DBE6FF672B703F72F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--610BEAE5E223447DBE6FF672B703F72F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--610BEAE5E223447DBE6FF672B703F72F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--610BEAE5E223447DBE6FF672B703F72F-->  <NAME><![CDATA[Link to Parent Tree DataSource]]></NAME>
+<!--610BEAE5E223447DBE6FF672B703F72F-->  <CLASSNAME><![CDATA[org.openbravo.service.datasource.LinkToParentTreeDatasourceService]]></CLASSNAME>
+<!--610BEAE5E223447DBE6FF672B703F72F-->  <OBCLKER_TEMPLATE_ID><![CDATA[2BAD445C2A0343C58E455F9BD379C690]]></OBCLKER_TEMPLATE_ID>
+<!--610BEAE5E223447DBE6FF672B703F72F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--610BEAE5E223447DBE6FF672B703F72F-->  <USEASTABLEDATAORIGIN><![CDATA[N]]></USEASTABLEDATAORIGIN>
+<!--610BEAE5E223447DBE6FF672B703F72F--></OBSERDS_DATASOURCE>
+
 <!--6654D607F650425A9DFF7B6961D54920--><OBSERDS_DATASOURCE>
 <!--6654D607F650425A9DFF7B6961D54920-->  <OBSERDS_DATASOURCE_ID><![CDATA[6654D607F650425A9DFF7B6961D54920]]></OBSERDS_DATASOURCE_ID>
 <!--6654D607F650425A9DFF7B6961D54920-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -18,7 +30,7 @@
 <!--90034CAE96E847D78FBEF6D38CB1930D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--90034CAE96E847D78FBEF6D38CB1930D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--90034CAE96E847D78FBEF6D38CB1930D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--90034CAE96E847D78FBEF6D38CB1930D-->  <NAME><![CDATA[Tree Datasource]]></NAME>
+<!--90034CAE96E847D78FBEF6D38CB1930D-->  <NAME><![CDATA[AD Tree Datasource]]></NAME>
 <!--90034CAE96E847D78FBEF6D38CB1930D-->  <CLASSNAME><![CDATA[org.openbravo.service.datasource.ADTreeDatasourceService]]></CLASSNAME>
 <!--90034CAE96E847D78FBEF6D38CB1930D-->  <OBCLKER_TEMPLATE_ID><![CDATA[2BAD445C2A0343C58E455F9BD379C690]]></OBCLKER_TEMPLATE_ID>
 <!--90034CAE96E847D78FBEF6D38CB1930D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>