Examples of SDKObjectsConverter


Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

      } else {
        initialFunctionality = functionalityDAO.loadLowFunctionalityByPath(initialPath, false);
      }
      boolean canSeeFunctionality = ObjectsAccessVerifier.canSee(initialFunctionality, profile);
      if (canSeeFunctionality) {
        toReturn = new SDKObjectsConverter().fromLowFunctionalityToSDKFunctionality(initialFunctionality);
        setFunctionalityContent(toReturn);
      }
    } catch(Exception e) {
      logger.error("Error while loading documents as tree", e);
    }
View Full Code Here

Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

    List visibleDocumentsList = new ArrayList();
    if (containedBIObjects != null && containedBIObjects.size() > 0) {
      for (Iterator it = containedBIObjects.iterator(); it.hasNext();) {
        BIObject obj = (BIObject) it.next();
        if (ObjectsAccessVerifier.checkProfileVisibility(obj, profile)) {
          SDKDocument aDoc = new SDKObjectsConverter().fromBIObjectToSDKDocument(obj);
          visibleDocumentsList.add(aDoc);
        }
      }
    }
    SDKDocument[] containedDocuments = new SDKDocument[visibleDocumentsList.size()];
    containedDocuments = (SDKDocument[]) visibleDocumentsList.toArray(containedDocuments);
    parentFunctionality.setContainedDocuments(containedDocuments);

    // loading contained functionalities
    List containedFunctionalitiesList = DAOFactory.getLowFunctionalityDAO().loadChildFunctionalities(parentFunctionality.getId(), false);
    List visibleFunctionalitiesList = new ArrayList();
    for (Iterator it = containedFunctionalitiesList.iterator(); it.hasNext();) {
      LowFunctionality lowFunctionality = (LowFunctionality) it.next();
      boolean canSeeFunctionality = ObjectsAccessVerifier.canSee(lowFunctionality, profile);
      if (canSeeFunctionality) {
        SDKFunctionality childFunctionality = new SDKObjectsConverter().fromLowFunctionalityToSDKFunctionality(lowFunctionality);
        visibleFunctionalitiesList.add(childFunctionality);
        // recursion
        setFunctionalityContent(childFunctionality);
      }
    }
View Full Code Here

Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

      if (!ObjectsAccessVerifier.canDev(functionalityId, profile)) {
        NotAllowedOperationException e = new NotAllowedOperationException();
        e.setFaultString("User cannot save new documents in the specified folder since he hasn't development permission.");
        throw e;
      }
      BIObject obj = new SDKObjectsConverter().fromSDKDocumentToBIObject(document);
      String userId = ((UserProfile) profile).getUserId().toString();
      logger.debug("Current user id is [" + userId + "]");
      obj.setCreationUser(((UserProfile) profile).getUserId().toString());
      obj.setCreationDate(new Date());
      obj.setVisible(new Integer(1));
      List functionalities = new ArrayList();
      functionalities.add(functionalityId);
      obj.setFunctionalities(functionalities);

      ObjTemplate objTemplate = null;
      if (sdkTemplate != null) {
        objTemplate = new SDKObjectsConverter().fromSDKTemplateToObjTemplate(sdkTemplate);
        objTemplate.setActive(new Boolean(true));
        objTemplate.setCreationUser(userId);
        objTemplate.setCreationDate(new Date());
      }
View Full Code Here

Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

      if (!ObjectsAccessVerifier.canDevBIObject(documentId, profile)) {
        NotAllowedOperationException e = new NotAllowedOperationException();
        e.setFaultString("User cannot upload templates on specified document since he cannot develop it.");
        throw e;
      }
      ObjTemplate objTemplate = new SDKObjectsConverter().fromSDKTemplateToObjTemplate(sdkTemplate);
      objTemplate.setBiobjId(documentId);
      objTemplate.setActive(new Boolean(true));
      String userId = ((UserProfile) profile).getUserId().toString();
      logger.debug("Current user id is [" + userId + "]");
      objTemplate.setCreationUser(userId);
View Full Code Here

Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

      if (temp == null) {
        logger.warn("The template dor document [" + documentId + "] is NULL");
        return null;
      }
      logger.debug("Template dor document [" + documentId + "] retrieved: file name is [" + temp.getName() + "]");
      toReturn = new SDKObjectsConverter().fromObjTemplateToSDKTemplate(temp);
    } catch(Exception e) {
      logger.error(e);
    }
    logger.debug("OUT");
    return toReturn;
View Full Code Here

Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

      BIObject biObject = DAOFactory.getBIObjectDAO().loadBIObjectById(id);
      if (biObject == null) {
        logger.warn("BiObject with identifier [" + id + "] not existing.");
        return null;
      }
      toReturn = new SDKObjectsConverter().fromBIObjectToSDKDocument(biObject);
    } catch(NotAllowedOperationException e) {

    } catch(Exception e) {
      logger.error("Error while retrieving SDKEngine list", e);
      logger.debug("Returning null");
View Full Code Here

Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

      BIObject biObject = DAOFactory.getBIObjectDAO().loadBIObjectByLabel(label);
      if (biObject == null) {
        logger.warn("BiObject with label [" + label + "] not existing.");
        return null;
      }
      toReturn = new SDKObjectsConverter().fromBIObjectToSDKDocument(biObject);
    } catch(NotAllowedOperationException e) {

    } catch(Exception e) {
      logger.error("Error while retrieving SDKEngine list", e);
      logger.debug("Returning null");
View Full Code Here

Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

      //defines a content to return
      byte[] templateContent = SpagoBIUtilities.getByteArrayFromInputStream(isDatamartFile);
     
      toReturn = new SDKTemplate();
      toReturn.setFileName(fileName);
      SDKObjectsConverter objConverter = new SDKObjectsConverter();
      MemoryOnlyDataSource mods = objConverter.new MemoryOnlyDataSource(templateContent, null);
      DataHandler dhSource = new DataHandler(mods);
      toReturn.setContent(dhSource);
     
    } catch(Exception e) {
View Full Code Here

Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

      inFileZip = new File(path);
     
      //creates the returned object
      SDKTemplate toReturn = new SDKTemplate();
      toReturn.setFileName(fileZipName);
      SDKObjectsConverter objConverter = new SDKObjectsConverter();
      MemoryOnlyDataSource mods = objConverter.new MemoryOnlyDataSource(new FileInputStream(inFileZip), null);
      DataHandler dhSource = new DataHandler(mods);
      toReturn.setContent(dhSource);
     
      logger.debug("OUT");
View Full Code Here

Examples of it.eng.spagobi.sdk.utilities.SDKObjectsConverter

          Engine engine = DAOFactory.getEngineDAO().loadEngineByID(engineId);
          if (engine == null) {
            logger.warn("Engine with identifier [" + engineId + "] not existing.");
            return null;
          }
          toReturn = new SDKObjectsConverter().fromEngineToSDKEngine(engine);
        } catch(NotAllowedOperationException e) {
          throw e;
        } catch(Exception e) {
            logger.error("Error while retrieving SDKEngine", e);
            logger.debug("Returning null");
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.