updated to new palojlib (SF 5.1SR2)
authorChristian Schwarzinger <christian.schwarzinger@proclos.com>
Fri, 08 Aug 2014 13:19:03 +0200
changeset 33892d194a4bb7
parent 32 f908aee19953
child 34 ca8c3ce863ed
updated to new palojlib (SF 5.1SR2)
fixed freeze bug by turning socket reuse off in palojlib
dist/PalOOCa.jar
dist/PalOOCa.oxt
dist/external_jars/jars.properties
lib/palojlib-5.1.jar
nbproject/project.properties
src/org/palooca/DataValueHandler.java
src/org/palooca/dialogs/Modeller.java
src/org/palooca/h2/OlapAggregator.java
src/org/palooca/network/ConnectionHandler.java
src/org/palooca/network/ConnectionInfo.java
src/org/palooca/olap4j/Olap4jCell.java
src/org/palooca/olap4j/Olap4jDimension.java
     1.1 Binary file dist/PalOOCa.jar has changed
     2.1 Binary file dist/PalOOCa.oxt has changed
     3.1 --- a/dist/external_jars/jars.properties	Thu Aug 07 10:52:37 2014 +0200
     3.2 +++ b/dist/external_jars/jars.properties	Fri Aug 08 13:19:03 2014 +0200
     3.3 @@ -1,3 +1,3 @@
     3.4  #PackageActionDescription
     3.5 -#Thu Aug 07 10:51:47 CEST 2014
     3.6 +#Fri Aug 08 13:13:14 CEST 2014
     3.7  external.jars=external_jars/dom4j-1.6.1.jar external_jars/swing-layout-1.0.4.jar external_jars/appframework-1.0.3.jar external_jars/swing-worker-1.1.jar external_jars/AbsoluteLayout.jar external_jars/log4j-1.2.16.jar external_jars/xercesImpl.jar external_jars/h2-1.3.172.jar external_jars/olap4j-1.2.0-SNAPSHOT.jar external_jars/olap4j-xmla-1.2.0-SNAPSHOT.jar external_jars/palojlib-5.1.jar
     4.1 Binary file lib/palojlib-5.1.jar has changed
     5.1 --- a/nbproject/project.properties	Thu Aug 07 10:52:37 2014 +0200
     5.2 +++ b/nbproject/project.properties	Fri Aug 08 13:19:03 2014 +0200
     5.3 @@ -53,8 +53,8 @@
     5.4      ${file.reference.h2-1.3.172.jar}:\
     5.5      ${file.reference.olap4j-1.2.0-SNAPSHOT.jar}:\
     5.6      ${file.reference.olap4j-xmla-1.2.0-SNAPSHOT.jar}:\
     5.7 -    ${file.reference.palojlib-5.1.jar}:\
     5.8 -    ${file.reference.PalOOCa_IDL_types.jar}
     5.9 +    ${file.reference.PalOOCa_IDL_types.jar}:\
    5.10 +    ${file.reference.palojlib-5.1.jar}
    5.11  # Space-separated list of extra javac options
    5.12  javac.compilerargs=
    5.13  javac.deprecation=false
    5.14 @@ -97,6 +97,5 @@
    5.15      ${javac.test.classpath}:\
    5.16      ${build.test.classes.dir}
    5.17  source.reference.olap4j-xmla-1.2.0-SNAPSHOT.jar=/Users/chris/workspace/olap4j/src
    5.18 -source.reference.palojlib-5.1.jar=/Users/chris/colibrispace/colibri/palojlib/src/main/java/
    5.19  src.dir=src
    5.20  test.src.dir=test
     6.1 --- a/src/org/palooca/DataValueHandler.java	Thu Aug 07 10:52:37 2014 +0200
     6.2 +++ b/src/org/palooca/DataValueHandler.java	Fri Aug 08 13:19:03 2014 +0200
     6.3 @@ -83,59 +83,65 @@
     6.4  
     6.5      public static Object getPaloDataValue(XComponentContext context, String servdb, String cubeName, Object[] coordinates){
     6.6          ICell cell = null;
     6.7 +        try {
     6.8  
     6.9 -        // Read results from batch if required
    6.10 -        if (DataValueHandler.getReadFromBatchResults()){
    6.11 -            Map<String,ICell> preCalcLookup = cellLookup.get(getServerCubeCombo(servdb,cubeName));
    6.12 -            if (preCalcLookup != null) {
    6.13 -                cell = preCalcLookup.get(PaloLibUtil.getPathString(coordinates));
    6.14 -                if (cell == null && fixMissingCells) {
    6.15 -                    cell = new Cell(new String[]{},0,CellType.CELL_NUMERIC,new IDimension[]{});
    6.16 +            // Read results from batch if required
    6.17 +            if (DataValueHandler.getReadFromBatchResults()){
    6.18 +                Map<String,ICell> preCalcLookup = cellLookup.get(getServerCubeCombo(servdb,cubeName));
    6.19 +                if (preCalcLookup != null) {
    6.20 +                    cell = preCalcLookup.get(PaloLibUtil.getPathString(coordinates));
    6.21 +                    if (cell == null && fixMissingCells) {
    6.22 +                        cell = new Cell(new int[]{},0,CellType.CELL_NUMERIC,new IDimension[]{},new String[]{});
    6.23 +                    }
    6.24 +                }
    6.25 +            }
    6.26 +            // Otherwise calculate the value
    6.27 +            else {
    6.28 +                PalOOCaManager manager = PalOOCaManager.getInstance(context);
    6.29 +                ConnectionHandler connectionHandler = manager.getConnectionHandler();
    6.30 +
    6.31 +                IDatabase database = connectionHandler.getDatabase(servdb);
    6.32 +                if ( database == null )
    6.33 +                    return null;
    6.34 +
    6.35 +                ICube cube = database.getCubeByName(cubeName);
    6.36 +                if ( cube == null )
    6.37 +                    return null;
    6.38 +
    6.39 +                String[] coordStrings = PalOOCaImpl.processCoordinates(coordinates);
    6.40 +                IElement[] elementCoords = new IElement[coordStrings.length];
    6.41 +                IDimension[] dimensions = cube.getDimensions();
    6.42 +
    6.43 +                for (int i = 0; i < coordStrings.length; i++) {
    6.44 +                    elementCoords[i] = dimensions[i].getElementByName(coordStrings[i],false);
    6.45 +                    if (elementCoords[i] == null)
    6.46 +                        return null;
    6.47 +                }
    6.48 +
    6.49 +                cell = cube.getCell(elementCoords);
    6.50 +            }
    6.51 +
    6.52 +            if (cell == null)
    6.53 +                return null;
    6.54 +
    6.55 +            if (cell.getType() == ICell.CellType.CELL_STRING) {
    6.56 +                if (cell.getValue() == null) {
    6.57 +                    return "";
    6.58 +                } else {
    6.59 +                    return cell.getValue();
    6.60 +                }
    6.61 +            } else {
    6.62 +                if (cell.getValue() == null) {
    6.63 +                    return new Double(0);
    6.64 +                } else {
    6.65 +                    return cell.getValue();
    6.66                  }
    6.67              }
    6.68          }
    6.69 -        // Otherwise calculate the value
    6.70 -        else {
    6.71 -            PalOOCaManager manager = PalOOCaManager.getInstance(context);
    6.72 -            ConnectionHandler connectionHandler = manager.getConnectionHandler();
    6.73 -
    6.74 -            IDatabase database = connectionHandler.getDatabase(servdb);
    6.75 -            if ( database == null )
    6.76 -                return null;
    6.77 -
    6.78 -            ICube cube = database.getCubeByName(cubeName);
    6.79 -            if ( cube == null )
    6.80 -                return null;
    6.81 -
    6.82 -            String[] coordStrings = PalOOCaImpl.processCoordinates(coordinates);
    6.83 -            IElement[] elementCoords = new IElement[coordStrings.length];
    6.84 -            IDimension[] dimensions = cube.getDimensions();
    6.85 -
    6.86 -            for (int i = 0; i < coordStrings.length; i++) {
    6.87 -                elementCoords[i] = dimensions[i].getElementByName(coordStrings[i],false);
    6.88 -                if (elementCoords[i] == null)
    6.89 -                    return null;
    6.90 -            }
    6.91 -
    6.92 -            cell = cube.getCell(elementCoords);
    6.93 +        catch (Exception e) {
    6.94 +            e.printStackTrace();
    6.95          }
    6.96 -
    6.97 -        if (cell == null)
    6.98 -            return null;
    6.99 -
   6.100 -        if (cell.getType() == ICell.CellType.CELL_STRING) {
   6.101 -            if (cell.getValue() == null) {
   6.102 -                return "";
   6.103 -            } else {
   6.104 -                return cell.getValue();
   6.105 -            }
   6.106 -        } else {
   6.107 -            if (cell.getValue() == null) {
   6.108 -                return new Double(0);
   6.109 -            } else {
   6.110 -                return cell.getValue();
   6.111 -            }
   6.112 -        }
   6.113 +        return null;
   6.114      }
   6.115  
   6.116  }
     7.1 --- a/src/org/palooca/dialogs/Modeller.java	Thu Aug 07 10:52:37 2014 +0200
     7.2 +++ b/src/org/palooca/dialogs/Modeller.java	Fri Aug 08 13:19:03 2014 +0200
     7.3 @@ -625,12 +625,13 @@
     7.4                              addCubes(dbNode);
     7.5                          }
     7.6                      }
     7.7 +                    IDatabase systemDB = connection.getDatabaseByName("System");
     7.8                      System.err.println("Pre Groups: "+(System.currentTimeMillis()-time));
     7.9 -                    addGroups(cNode, connection.getDatabaseByName("System"));
    7.10 +                    addGroups(cNode, systemDB);
    7.11                      System.err.println("Pre Users: "+(System.currentTimeMillis()-time));
    7.12 -                    addUsers(cNode, connection.getDatabaseByName("System"));
    7.13 +                    addUsers(cNode, systemDB);
    7.14                      System.err.println("Pre Roles: "+(System.currentTimeMillis()-time));
    7.15 -                    addRoles(cNode, connection.getDatabaseByName("System"));
    7.16 +                    addRoles(cNode, systemDB);
    7.17                  }
    7.18              }
    7.19          }
     8.1 --- a/src/org/palooca/h2/OlapAggregator.java	Thu Aug 07 10:52:37 2014 +0200
     8.2 +++ b/src/org/palooca/h2/OlapAggregator.java	Fri Aug 08 13:19:03 2014 +0200
     8.3 @@ -90,7 +90,7 @@
     8.4                  //fix for aggDim = LastDim
     8.5                  if (coords[dimensions.length-1] == null) coords[dimensions.length-1] = aggregateElementName;
     8.6                  String key = PaloLibUtil.getPathString(coords);
     8.7 -                result.put(key, new Cell(new String[]{},value,CellType.CELL_NUMERIC,new IDimension[]{}));
     8.8 +                result.put(key, new Cell(new int[]{},value,CellType.CELL_NUMERIC,new IDimension[]{}, new String[]{}));
     8.9              }
    8.10           } catch (SQLException sqle) {
    8.11              sqle.printStackTrace();
     9.1 --- a/src/org/palooca/network/ConnectionHandler.java	Thu Aug 07 10:52:37 2014 +0200
     9.2 +++ b/src/org/palooca/network/ConnectionHandler.java	Fri Aug 08 13:19:03 2014 +0200
     9.3 @@ -167,8 +167,13 @@
     9.4              connection = getConnection(connectionData[0]);
     9.5  
     9.6          IDatabase database = null;
     9.7 -        if ( connection != null )
     9.8 -            database = connection.getDatabaseByName(connectionData[1]);
     9.9 +        if ( connection != null ) {
    9.10 +            if (connection == lastConnection && lastDatabase != null && lastDatabase.getName().equals(connectionData[1])) {
    9.11 +                database = lastDatabase;
    9.12 +            } else {
    9.13 +                database = connection.getDatabaseByName(connectionData[1]);
    9.14 +            }
    9.15 +        }
    9.16          
    9.17          if (database != null) {
    9.18              lastConnection = connection;
    10.1 --- a/src/org/palooca/network/ConnectionInfo.java	Thu Aug 07 10:52:37 2014 +0200
    10.2 +++ b/src/org/palooca/network/ConnectionInfo.java	Fri Aug 08 13:19:03 2014 +0200
    10.3 @@ -248,6 +248,8 @@
    10.4  
    10.5      public boolean connect(int timeout) {
    10.6          boolean success = false;
    10.7 +        //decativate socket reuse, since this may cause crashes / OLAP server not beeing responsive any more.
    10.8 +       com.jedox.palojlib.http.SocketManager.getInstance().setActive(false);
    10.9  
   10.10                  try {
   10.11  //                    setConnection(ConnectionFactory.getInstance().newConnection(host, port, username, password));
    11.1 --- a/src/org/palooca/olap4j/Olap4jCell.java	Thu Aug 07 10:52:37 2014 +0200
    11.2 +++ b/src/org/palooca/olap4j/Olap4jCell.java	Fri Aug 08 13:19:03 2014 +0200
    11.3 @@ -1,5 +1,7 @@
    11.4  package org.palooca.olap4j;
    11.5  
    11.6 +import com.jedox.palojlib.exceptions.PaloException;
    11.7 +import com.jedox.palojlib.exceptions.PaloJException;
    11.8  import com.jedox.palojlib.interfaces.ICell;
    11.9  
   11.10  public class Olap4jCell implements ICell {
   11.11 @@ -32,4 +34,9 @@
   11.12  		return CellType.CELL_NUMERIC;
   11.13  	}
   11.14  
   11.15 +        @Override
   11.16 +        public String getPathNameAt(int i) throws PaloException, PaloJException {
   11.17 +            return getPathNames()[i];
   11.18 +        }
   11.19 +
   11.20  }
    12.1 --- a/src/org/palooca/olap4j/Olap4jDimension.java	Thu Aug 07 10:52:37 2014 +0200
    12.2 +++ b/src/org/palooca/olap4j/Olap4jDimension.java	Fri Aug 08 13:19:03 2014 +0200
    12.3 @@ -257,11 +257,6 @@
    12.4      }
    12.5  
    12.6      @Override
    12.7 -    public void addBaseElements(IElement[] ies) throws PaloException, PaloJException {
    12.8 -        throw new UnsupportedOperationException("Not supported yet.");
    12.9 -    }
   12.10 -
   12.11 -    @Override
   12.12      public boolean hasConsolidatedElements() {
   12.13          throw new UnsupportedOperationException("Not supported yet.");
   12.14      }
   12.15 @@ -290,6 +285,17 @@
   12.16      public void moveElements(IElement[] ies, Integer[] intgrs) throws PaloException, PaloJException {
   12.17          throw new UnsupportedOperationException("Not supported yet.");
   12.18      }
   12.19 +
   12.20 +
   12.21 +    @Override
   12.22 +    public IAttribute addAttribute(String string, ElementType et) throws PaloJException, PaloException {
   12.23 +        throw new UnsupportedOperationException("Not supported yet.");
   12.24 +    }
   12.25 +
   12.26 +    @Override
   12.27 +    public IElement getSingleElement(String name, boolean withAttributes) throws PaloException, PaloJException {
   12.28 +        return getElementByName(name, withAttributes);
   12.29 +    }
   12.30  	
   12.31  
   12.32