From f9227ce0d524e94d9d14e3b167929ee76d699e76 Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Fri, 13 Nov 2009 09:12:56 +0000
Subject: [PATCH] LMS-1274 The fix for this issue is to turn off nested value
 support in the GXT widgets. We have implemented this by refactoring all the
 BaseModelData subclasses into two hierarchies with CISD{BaseModel,
 BaseModelData} at the respective roots.

SVN: 13374
---
 .../application/model/CISDBaseModel.java      | 59 ++++++++++++++++++
 .../application/model/CISDBaseModelData.java  | 61 +++++++++++++++++++
 2 files changed, 120 insertions(+)
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/CISDBaseModel.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/CISDBaseModelData.java

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/CISDBaseModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/CISDBaseModel.java
new file mode 100644
index 00000000000..cc2afbb05e0
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/CISDBaseModel.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2009 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.generic.client.web.client.application.model;
+
+import java.util.Map;
+
+import com.extjs.gxt.ui.client.data.BaseModel;
+
+/**
+ * A Subclass of the GXT BaseModel that, by default, turns off nested value support. 
+ * 
+ * NestedValues check for key strings with '.' in then treat them as paths for traversing multiple
+ * HashMaps. 
+ * 
+ * We don't need this, and, in fact, it causes problems for us, since we occasionally use '.' as
+ * part of a normal column name for a table without intending the nested-value semantics; thus we
+ * turn it off.
+ * 
+ * @author Chandrasekhar Ramakrishnan
+ */
+public abstract class CISDBaseModel extends BaseModel
+{
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     *
+     */
+    public CISDBaseModel()
+    {
+        super();
+        setAllowNestedValues(false);
+    }
+
+    /**
+     * @param properties
+     */
+    public CISDBaseModel(Map<String, Object> properties)
+    {
+        super(properties);
+        setAllowNestedValues(false);
+    }
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/CISDBaseModelData.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/CISDBaseModelData.java
new file mode 100644
index 00000000000..c8d13e2e190
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/CISDBaseModelData.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2009 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.openbis.generic.client.web.client.application.model;
+
+import java.util.Map;
+
+import com.extjs.gxt.ui.client.data.BaseModelData;
+
+/**
+ * A Subclass of the GXT BaseModelData that, by default, turns off nested value support. 
+ * 
+ * NestedValues check for key strings with '.' in then treat them as paths for traversing multiple
+ * HashMaps. 
+ * 
+ * We don't need this, and, in fact, it causes problems for us, since we occasionally use '.' as
+ * part of a normal column name for a table without intending the nested-value semantics; thus we
+ * turn it off.
+ * 
+ * @author Chandrasekhar Ramakrishnan
+ */
+public abstract class CISDBaseModelData extends BaseModelData
+{
+    
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     *
+     */
+    public CISDBaseModelData()
+    {
+        super();
+        setAllowNestedValues(false);
+    }
+
+    /**
+     *
+     *
+     * @param properties
+     */
+    public CISDBaseModelData(Map<String, Object> properties)
+    {
+        super(properties);
+        setAllowNestedValues(false);
+    }
+
+}
-- 
GitLab