Examples of Cube


Examples of org.olap4j.metadata.Cube

            TestContext.instance().createSubstitutingCube(
                "Sales",
                null,
                "<CalculatedMember name='H1 1997' formula='Aggregate([Time].[1997].[Q1]:[Time].[1997].[Q2])' dimension='Time' />")
            .getOlap4jConnection();
        final Cube cube = testContext.getOlapSchema().getCubes().get("Sales");
        final List<Measure> measureList = cube.getMeasures();
        StringBuilder buf = new StringBuilder();
        for (Measure measure : measureList) {
            buf.append(measure.getName()).append(";");
        }
        // Calc member in the Time dimension does not appear in the list.
View Full Code Here

Examples of org.palo.api.Cube

    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++;
      }
    }
View Full Code Here

Examples of org.palo.api.Cube

      //Account name
      String accountName = getValue("account", link);
      //Connection
      String connection = getValue("connection", link);
      String cubeName = null;
      Cube cube = null;
      String accountId = null;
      if(view.equalsIgnoreCase("")){
        //cube name --> create view dinamically
        cubeName = getValue("cubename", link);

      }
      View v = null;

      for (Account a: authUser.getAccounts()) {
        if(a != null){

          if(view != null && !view.equals("")){           
            //if view specified
            List<View> views = viewService.getViews(a);
            if(!views.isEmpty()){
              Iterator it = views.iterator();
              while(it.hasNext()){
                View selView = (View)it.next();
                if(view != null && !view.equals("")){
                  if(selView.getName().equals(view)){
                    v = selView;
                    break;
                  }
                }
              }
            }

          }else{
            ///tries to get cube
            if(a.getUser().getLoginName().equals(accountName)){
              if(a.getConnection().getName().equals(connection)){
                //use cube name
                accountId = a.getId();
                Connection con = ((PaloAccount) a).login();
                for (Database db: con.getDatabases()) {
                  int connectionType = db.getConnection().getType();
                  Cube c = db.getCubeByName(cubeName);
                  if(c != null){
                    cube = c;
                    //((PaloAccount) a).logout();
                    break;
                  }
View Full Code Here

Examples of org.palo.api.Cube

    cfg.setLoadOnDemand(true);
    try {
      Connection con = ConnectionFactory.getInstance().newConnection(cfg);
      Database db = con.getDatabaseByName("Config");
      if (db != null) {
        Cube c = db.getCubeByName("#_connections");
        if (c != null) {
          Dimension conDim = c.getDimensionByName("connections");
          Dimension conAttribDim = c.getDimensionByName("#_connections_");
          ArrayList <Element []> coords = new ArrayList<Element[]>();
          ArrayList <Element> attributes = new ArrayList<Element>();
          addElement(attributes, conAttribDim, "type");
          addElement(attributes, conAttribDim, "name");
          addElement(attributes, conAttribDim, "host");
          addElement(attributes, conAttribDim, "port");
          addElement(attributes, conAttribDim, "username");
          addElement(attributes, conAttribDim, "password");
          addElement(attributes, conAttribDim, "active");
          addElement(attributes, conAttribDim, "useLoginCred");
          ArrayList <ConnectionDescriptor> connections =
            new ArrayList<ConnectionDescriptor>();
          for (Element e: conDim.getElements()) {
            for (Element e2: attributes) {
              coords.add(new Element [] {e2, e});
            }
          }
          Object [] result = c.getDataBulk(coords.toArray(new Element[0][0]));
          int counter = 0;
          for (int i = 0; i < conDim.getElementCount(); i++) {
            if (counter >= result.length) {
              log.debug("Found connection to which this user has no rights. Skipping it (or them).");
              break;
View Full Code Here

Examples of org.palo.api.Cube

    }
    return data;       
  }
 
  private final XDirectLinkData parsePaloStudioConnectionData(String paloSuiteUser, String paloSuitePass, String paloSuiteHost, String paloSuitePort, Database configDb, String viewId, SimpleLogger log, XDirectLinkData data, String locale) {
    Cube c = configDb.getCubeByName("#_connections");
    if (c != null) {
      Dimension conDim = c.getDimensionByName("connections");
      Dimension conAttribDim = c.getDimensionByName("#_connections_");
      ArrayList <Element []> coords = new ArrayList<Element[]>();
      ArrayList <Element> attributes = new ArrayList<Element>();
      addElement(attributes, conAttribDim, "type");
      addElement(attributes, conAttribDim, "name");
      addElement(attributes, conAttribDim, "host");
      addElement(attributes, conAttribDim, "port");
      addElement(attributes, conAttribDim, "username");
      addElement(attributes, conAttribDim, "password");
      addElement(attributes, conAttribDim, "active");
      addElement(attributes, conAttribDim, "useLoginCred");
      ArrayList <ConnectionDescriptor> connections =
        new ArrayList<ConnectionDescriptor>();
      for (Element e: conDim.getElements()) {
        for (Element e2: attributes) {
          coords.add(new Element [] {e2, e});
        }
      }
      Object [] result = c.getDataBulk(coords.toArray(new Element[0][0]));
      int counter = 0;
      for (int i = 0; i < conDim.getElementCount(); i++) {
        if (counter >= result.length) {
          log.debug("Found connection to which this user has no rights. Skipping it (or them).");
          break;
View Full Code Here

Examples of org.palo.api.Cube

    return account;
  }
 
  public final View convertLegacyView(XView xView, String sessionId)
      throws OperationFailedException {
    Cube cube = null;
    try {
      if (!doCreateDefaultView(xView)) {
        try {
          try {
            cube = getCube(xView, sessionId);
            ConnectionPoolManager.getInstance().disconnect(getAccount(xView.getAccountId()), sessionId, "WPaloCubeViewConverter.convertLegacyView");
            View v = convert(cube.getCubeView(xView.getId()), xView.getName(), sessionId);
            return v;
          } finally {
            ConnectionPoolManager.getInstance().disconnect(getAccount(xView.getAccountId()), sessionId, "WPaloCubeViewConverter.convertLegacyView2");
          }
         
View Full Code Here

Examples of org.palo.api.Cube

 
  public final View createDefaultView(XView xView, String sessionId)
      throws OperationFailedException {
    try {
      Cube cube = getCube(xView, sessionId);
      ConnectionPoolManager.getInstance().disconnect(getAccount(xView.getAccountId()), sessionId, "WPaloCubeViewConverter.createDefaultView");
      return createDefaultViewFor(cube, xView.getName(), xView.getAccountId(), sessionId, xView.getExternalId());
    } finally {
      ConnectionPoolManager.getInstance().disconnect(getAccount(xView.getAccountId()), sessionId, "WPaloCubeViewConverter.createDefaultView2");
    }
View Full Code Here

Examples of org.palo.api.Cube

    return true;
  }
 
  private final XObject[] load(XCube xCube, AuthUser user, String sessionId, UserSession userSession) {
    try {
      Cube cube = getCube(xCube, user, sessionId);
      if (cube != null) {
        String viewIds[] = cube.getCubeViewIds();
        List<XObject> views = new ArrayList<XObject>();
        addDefaultViewFor(cube, xCube.getAccountId(), views, user, userSession);
        for(String viewId : viewIds) {
          String viewName = cube.getCubeViewName(viewId);
          XView view = createXView(viewId, viewName, cube, xCube.getAccountId(), user);
          XObjectWrapper wrappedCandidate = wrap(view);
          wrappedCandidate.setHasChildren(false);
          views.add(wrappedCandidate);
       
View Full Code Here

Examples of org.sumus.dwh.cube.Cube

 
  private void createCube(DataStore dataStore, CubeDefinition definition){
    try {
      definition.addDimensions();
      definition.addMetrics();
      Cube cube = dataStore.createCube(definition.getName(), definition.getTimeScale());
      addDimensions(cube, dataStore, definition.getDimensionDefinitions());
      addMetrics(cube, dataStore, definition.getMetricDefinitions());
    }
    catch (Exception e) {
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.