[Tree Extension] Removes reference to ADTreeType in code
authorAugusto Mauch <augusto.mauch@openbravo.com>
Thu, 20 Feb 2014 10:32:41 +0100
changeset 22515 27282c905ccc
parent 22514 e6803bd2527d
child 22516 1dfac2bd7453
[Tree Extension] Removes reference to ADTreeType in code
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-view-tab.js.ftl
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeGridComponent.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeReferenceComponent.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java	Wed Feb 19 18:06:03 2014 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java	Thu Feb 20 10:32:41 2014 +0100
@@ -41,7 +41,6 @@
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.ad.datamodel.Table;
-import org.openbravo.model.ad.utility.ADTreeType;
 import org.openbravo.model.ad.utility.TableTree;
 import org.openbravo.service.datasource.DataSourceService;
 import org.openbravo.service.datasource.DataSourceServiceProvider;
@@ -107,12 +106,11 @@
       return null;
     }
     TableTree tableTree = tableTreeList.get(0);
-    ADTreeType treeType = tableTree.getTreeCategory();
 
     DataSourceService dataSource = null;
-    if (TREENODE_STRUCTURE.equals(treeType.getTreeStructure())) {
+    if (TREENODE_STRUCTURE.equals(tableTree.getTreeStructure())) {
       dataSource = dataSourceServiceProvider.getDataSource(TREENODE_DATASOURCE);
-    } else if (LINKTOPARENT_STRUCTURE.equals(treeType.getTreeStructure())) {
+    } else if (LINKTOPARENT_STRUCTURE.equals(tableTree.getTreeStructure())) {
       dataSource = dataSourceServiceProvider.getDataSource(LINKTOPARENT_DATASOURCE);
     }
     return dataSource;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-tab.js.ftl	Wed Feb 19 18:06:03 2014 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-tab.js.ftl	Thu Feb 20 10:32:41 2014 +0100
@@ -56,9 +56,6 @@
     </#if> 
     <#if tabComponent.tree>
     isTree: ${tabComponent.tree?string},
-      <#if tabComponent.treeTypeId != "" >
-    treeTypeId: '${tabComponent.treeTypeId?string}',
-      </#if>
     </#if>     
     
     standardProperties:{
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeGridComponent.java	Wed Feb 19 18:06:03 2014 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeGridComponent.java	Thu Feb 20 10:32:41 2014 +0100
@@ -25,7 +25,6 @@
 import org.openbravo.client.kernel.Template;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.ad.ui.Tab;
-import org.openbravo.model.ad.utility.ADTreeType;
 import org.openbravo.model.ad.utility.TableTree;
 
 /**
@@ -78,7 +77,7 @@
   public boolean isOrderedTree() {
     TableTree tableTree = tab.getTableTree();
     if (tableTree != null) {
-      return tableTree.getTreeCategory().isOrdered();
+      return tableTree.isOrdered();
     } else {
       return false;
     }
@@ -93,13 +92,12 @@
     String dataSourceId = null;
     TableTree tableTree = tab.getTableTree();
     if (tableTree != null) {
-      ADTreeType treeCategory = tableTree.getTreeCategory();
-      if (TREENODE_STRUCTURE.equals(treeCategory.getTreeStructure())) {
+      if (TREENODE_STRUCTURE.equals(tableTree.getTreeStructure())) {
         dataSourceId = TREENODE_DATASOURCE;
-      } else if (LINKTOPARENT_STRUCTURE.equals(treeCategory.getTreeStructure())) {
+      } else if (LINKTOPARENT_STRUCTURE.equals(tableTree.getTreeStructure())) {
         dataSourceId = LINKTOPARENT_DATASOURCE;
       } else {
-        return treeCategory.getDatasource().getId();
+        return tableTree.getDatasource().getId();
       }
       return dataSourceId;
     } else {
@@ -110,8 +108,7 @@
   public String getTreeStructure() {
     TableTree tableTree = tab.getTableTree();
     if (tableTree != null) {
-      ADTreeType treeCategory = tableTree.getTreeCategory();
-      return treeCategory.getTreeStructure();
+      return tableTree.getTreeStructure();
     } else {
       return null;
     }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeReferenceComponent.java	Wed Feb 19 18:06:03 2014 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBTreeReferenceComponent.java	Thu Feb 20 10:32:41 2014 +0100
@@ -56,7 +56,6 @@
 import org.openbravo.model.ad.domain.ReferencedTree;
 import org.openbravo.model.ad.domain.ReferencedTreeField;
 import org.openbravo.model.ad.module.Module;
-import org.openbravo.model.ad.utility.ADTreeType;
 import org.openbravo.model.ad.utility.TableTree;
 import org.openbravo.service.datasource.DataSourceConstants;
 import org.openbravo.service.datasource.DataSourceProperty;
@@ -126,7 +125,7 @@
   }
 
   public boolean isParentSelectionAllowed() {
-    return getReferencedTree().getTableTreeCategory().getTreeCategory().isParentSelectionAllowed();
+    return getReferencedTree().getTableTreeCategory().isParentSelectionAllowed();
   }
 
   private static String getPropertyOrDataSourceField(ReferencedTreeField treeField) {
@@ -608,13 +607,12 @@
     String dataSourceId = null;
     TableTree tableTree = referencedTree.getTableTreeCategory();
     if (tableTree != null) {
-      ADTreeType treeCategory = tableTree.getTreeCategory();
-      if (TREENODE_STRUCTURE.equals(treeCategory.getTreeStructure())) {
+      if (TREENODE_STRUCTURE.equals(tableTree.getTreeStructure())) {
         dataSourceId = TREENODE_DATASOURCE;
-      } else if (LINKTOPARENT_STRUCTURE.equals(treeCategory.getTreeStructure())) {
+      } else if (LINKTOPARENT_STRUCTURE.equals(tableTree.getTreeStructure())) {
         dataSourceId = LINKTOPARENT_DATASOURCE;
       } else {
-        return treeCategory.getDatasource().getId();
+        return tableTree.getDatasource().getId();
       }
       return dataSourceId;
     } else {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java	Wed Feb 19 18:06:03 2014 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java	Thu Feb 20 10:32:41 2014 +0100
@@ -613,14 +613,6 @@
     return preferenceAttributes;
   }
 
-  public String getTreeTypeId() {
-    if (tab.getTableTree() != null) {
-      return tab.getTableTree().getTreeCategory().getId();
-    } else {
-      return "";
-    }
-  }
-
   public class ButtonField {
     private static final String AD_DEF_ERROR = "AD definition error: process parameter (%s) is using %s reference without %s";
     private String id;
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java	Wed Feb 19 18:06:03 2014 +0100
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java	Thu Feb 20 10:32:41 2014 +0100
@@ -724,7 +724,7 @@
       log.error("A request to the TreeDatasourceService must include the tabId or the treeReferenceId parameter");
       return null;
     }
-    String treeTypeName = tableTree.getTreeCategory().getName();
+    String treeTypeName = tableTree.getName();
     CheckTreeOperationManager ctom = null;
     try {
       ctom = checkTreeOperationManagers.select(new ComponentProvider.Selector(treeTypeName)).get();