Author: mo.jeff
Date: Mon Jul  6 12:44:05 2009
New Revision: 3117

Modified:
   trunk/src/ca/sqlpower/architect/olap/Mondrian.xml
   trunk/src/ca/sqlpower/architect/olap/MondrianModel.java
   trunk/src/ca/sqlpower/architect/swingui/olap/LevelEditPanel.java

Log:
Oops, apparently I'm not supposed to me modifying the MondrianModel class directly. This changes a couple of previous fixes (Bug 1930 & Bug 1883) so that they modify the Mondrian.xml model instead of the auto-generated class.

Modified: trunk/src/ca/sqlpower/architect/olap/Mondrian.xml
==============================================================================
--- trunk/src/ca/sqlpower/architect/olap/Mondrian.xml   (original)
+++ trunk/src/ca/sqlpower/architect/olap/Mondrian.xml Mon Jul 6 12:44:05 2009
@@ -176,7 +176,7 @@
                 realized otherwise it is ignored.
             </Doc>
         </Attribute>
-        <Object name="fact" type="Relation" required="true">
+        <Object name="fact" type="RelationOrJoin" required="true">
             <Doc>
The fact table is the source of all measures in this cube. If
                 this is a <code>Table</code> and the schema name is not

Modified: trunk/src/ca/sqlpower/architect/olap/MondrianModel.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/olap/MondrianModel.java     (original)
+++ trunk/src/ca/sqlpower/architect/olap/MondrianModel.java Mon Jul 6 12:44:05 2009
@@ -1046,13 +1046,13 @@
         if (oldval == newval) {
                return;
         }
-        int overallPosition = childPositionOffset(Relation.class);
+        int overallPosition = childPositionOffset(RelationOrJoin.class);
         if (fact != null) {
-            fireChildRemoved(Relation.class, overallPosition, oldval);
+ fireChildRemoved(RelationOrJoin.class, overallPosition, oldval);
         }
         fact = newval;
         fact.setParent(this);
-        fireChildAdded(Relation.class, overallPosition, fact);
+        fireChildAdded(RelationOrJoin.class, overallPosition, fact);
        }

     /**  */
@@ -1333,7 +1333,7 @@
         if (childClass == NamedSet.class) return offset;
         offset += namedSets.size();

-        if (childClass == Relation.class) return offset;
+        if (childClass == RelationOrJoin.class) return offset;
         offset += 1;

         return offset;
@@ -1358,6 +1358,7 @@

         } else if (child instanceof RelationOrJoin) {
             setFact((RelationOrJoin) child);
+
         } else {
             super.addChild(child);
         }
@@ -1413,8 +1414,8 @@
             }
             addNamedSet(index - offset, (NamedSet) child);

-        } else if (child instanceof Relation) {
-            setFact((Relation) child);
+        } else if (child instanceof RelationOrJoin) {
+            setFact((RelationOrJoin) child);

         } else {
             super.addChild(index, child);
@@ -1440,7 +1441,7 @@
         } else if (child instanceof NamedSet) {
             return removeNamedSet((NamedSet) child);

-        } else if (child instanceof Relation) {
+        } else if (child instanceof RelationOrJoin) {
             setFact(null);
             return true;

@@ -3486,29 +3487,6 @@
 } // end of element Hierarchy
 /**  */
 public static class Level extends OLAPObject {
-
-    /**
-     * An enumeration of possible values for the levelType attribute.
-     *
-     * There is a 'Regular' levelType that can only be used for Levels in a
-     * StandardDimension, but since it's currently the only option for
-     * StandardDimension Levels, I've left it out.
-     *
-     * Note that the 'Time' values can only be used for Levels in a
-     * TimeDimension.
-     *
-     * Currently, we are not simply using the LevelType enumeration in
-     * Mondrian so we do not have to include Mondrian as a dependency.
- * However, if the need to include Mondrian as a dependency arises, then - * we can probably dispose of this enumeration and use the Mondrian one.
-     */
-    public enum LevelType {
-        TimeYears,
-        TimeQuarters,
-        TimeMonths,
-        TimeWeeks,
-        TimeDays,
-    }

     /**
      * Creates a new Level with all attributes

Modified: trunk/src/ca/sqlpower/architect/swingui/olap/LevelEditPanel.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/olap/LevelEditPanel.java (original) +++ trunk/src/ca/sqlpower/architect/swingui/olap/LevelEditPanel.java Mon Jul 6 12:44:05 2009
@@ -57,7 +57,6 @@
 import ca.sqlpower.architect.olap.MondrianModel.Property;
 import ca.sqlpower.architect.olap.MondrianModel.Schema;
 import ca.sqlpower.architect.olap.MondrianModel.Table;
-import ca.sqlpower.architect.olap.MondrianModel.Level.LevelType;
 import ca.sqlpower.architect.swingui.SQLObjectComboBoxModel;
 import ca.sqlpower.sqlobject.SQLColumn;
 import ca.sqlpower.sqlobject.SQLObjectException;
@@ -78,6 +77,29 @@

 public class LevelEditPanel implements ValidatableDataEntryPanel {

+    /**
+     * An enumeration of possible values for the levelType attribute.
+     *
+     * There is a 'Regular' levelType that can only be used for Levels in a
+     * StandardDimension, but since it's currently the only option for
+     * StandardDimension Levels, I've left it out.
+     *
+     * Note that the 'Time' values can only be used for Levels in a
+     * TimeDimension.
+     *
+     * Currently, we are not simply using the LevelType enumeration in
+     * Mondrian so we do not have to include Mondrian as a dependency.
+ * However, if the need to include Mondrian as a dependency arises, then + * we can probably dispose of this enumeration and use the Mondrian one.
+     */
+    public enum LevelType {
+        TimeYears,
+        TimeQuarters,
+        TimeMonths,
+        TimeWeeks,
+        TimeDays,
+    }
+
     private final Level level;
     private final JPanel panel;
     private JTextField name;

Reply via email to