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() }); }
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; }
public static boolean isAttributeCube(Cube cube) { return isAttributeCube(cube.getName()); }
public static boolean isSystemCube(Cube cube) { return isSystemCube(cube.getName()); }
private boolean isDataCube(Cube cube) { return (!cube.isSystemCube() && !cube.isAttributeCube() && !cube.isUserInfoCube()); }