Ejemplo n.º 1
0
  CubeViewImpl(View view, Cube srcCube, AuthUser user, String externalId) {
    // TODO maybe we get the authUser view view.getAccount().getUser()
    this.view = view;
    this.authUser = user; // view.getAccount().getUser();
    this.srcCube = srcCube;

    this.properties = new HashMap<String, Property<Object>>();
    if (externalId != null) {
      addProperty("paloSuiteID", externalId);
    }
    this.formats = new LinkedHashMap<String, Format>();
    this.formatRanges = new ArrayList<FormatRangeInfo>();

    this.key =
        new CompoundKey(
            new Object[] {
              CubeViewImpl.class, view.getId(), srcCube.getId(), srcCube.getDatabase().getId()
            });
  }
Ejemplo n.º 2
0
  private XObject[] addCubes(XFolder parent, Database db) {
    int allCubeCnt = db.getCubeCount();
    int cubeCnt = 0;
    XObject ret[];

    for (int i = 0; i < allCubeCnt; i++) {
      Cube cube = db.getCubeAt(i);
      if ((parent.getFolderType().equalsIgnoreCase(TYPE_STATIC_FOLDER_CUBES) && isDataCube(cube))
          || (parent.getFolderType().equalsIgnoreCase(TYPE_STATIC_FOLDER_SYSTEMCUBES)
              && cube.isSystemCube())
          || (parent.getFolderType().equalsIgnoreCase(TYPE_STATIC_FOLDER_ATTRIBUTECUBES)
              && cube.isAttributeCube())) {
        cubeCnt++;
      }
    }

    if (parent.getFolderType().equalsIgnoreCase(TYPE_STATIC_FOLDER_CUBES)) {
      cubeCnt += 2; // for additional subfolders
    }

    ret = new XObject[cubeCnt];
    int curCube = 0;

    for (int i = 0; i < allCubeCnt; i++) {
      Cube cube = db.getCubeAt(i);
      if ((parent.getFolderType().equalsIgnoreCase(TYPE_STATIC_FOLDER_CUBES) && isDataCube(cube))
          || (parent.getFolderType().equalsIgnoreCase(TYPE_STATIC_FOLDER_SYSTEMCUBES)
              && cube.isSystemCube())
          || (parent.getFolderType().equalsIgnoreCase(TYPE_STATIC_FOLDER_ATTRIBUTECUBES)
              && cube.isAttributeCube())) {
        ret[curCube] = new XCube();
        ret[curCube].setName(cube.getName());
        setIdToXObject(ret[curCube]);
        //				ret[curCube].setId(cube.getId());
        curCube++;
      }
    }

    if (parent.getFolderType().equalsIgnoreCase(TYPE_STATIC_FOLDER_CUBES)) {
      ret[curCube] =
          addStaticFolder(parent, "Attribute Cubes", db.getId(), TYPE_STATIC_FOLDER_ATTRIBUTECUBES);
      ret[curCube + 1] =
          addStaticFolder(parent, "System Cubes", db.getId(), TYPE_STATIC_FOLDER_SYSTEMCUBES);
    }

    return ret;
  }
Ejemplo n.º 3
0
 public static boolean isAttributeCube(Cube cube) {
   return isAttributeCube(cube.getName());
 }
Ejemplo n.º 4
0
 public static boolean isSystemCube(Cube cube) {
   return isSystemCube(cube.getName());
 }
Ejemplo n.º 5
0
 private boolean isDataCube(Cube cube) {
   return (!cube.isSystemCube() && !cube.isAttributeCube() && !cube.isUserInfoCube());
 }