Examples of SDKTemplate


Examples of it.eng.spagobi.sdk.documents.bo.SDKTemplate

    logger.debug("IN");
    if (objTemplate == null) {
      logger.warn("ObjTemplate in input is null!!");
      return null;
    }
    SDKTemplate toReturn = null;
    try {
      byte[] templateContent = objTemplate.getContent();
      toReturn = new SDKTemplate();
      toReturn.setFileName(objTemplate.getName());
      MemoryOnlyDataSource mods = new MemoryOnlyDataSource(templateContent, null);
      DataHandler dhSource = new DataHandler(mods);
      toReturn.setContent(dhSource);
    } catch (Exception e) {
      logger.error("Error while converting ObjTemplate into SDKTemplate.", e);
      logger.debug("Returning null.");
      return null;
    }
View Full Code Here

Examples of it.eng.spagobi.sdk.documents.bo.SDKTemplate

    logger.debug("OUT");
  }

  public SDKTemplate downloadTemplate(Integer documentId) throws NotAllowedOperationException {
    logger.debug("IN");
    SDKTemplate toReturn = null;
    try {
      IEngUserProfile profile = getUserProfile();
      // if user cannot develop the specified document, he cannot upload templates on it
      if (!ObjectsAccessVerifier.canDevBIObject(documentId, profile)) {
        NotAllowedOperationException e = new NotAllowedOperationException();
View Full Code Here

Examples of it.eng.spagobi.sdk.documents.bo.SDKTemplate

    logger.debug("OUT");
  }

  public SDKTemplate downloadDatamartFile(String folderName, String fileName) {
    logger.debug("IN");
    SDKTemplate toReturn = null;
    try {
      FileInputStream isDatamartFile = downloadSingleFile(folderName, fileName);
      //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) {
      return null;
    }
    logger.debug("OUT");
View Full Code Here

Examples of it.eng.spagobi.sdk.documents.bo.SDKTemplate

      //reopen the zip file as input stream to save as SDKTemplate object because is not possible to convert
      //automatically an outputStream in inputStream
      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");
      return toReturn;
     
    } 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.