Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.ISolutionFile


      }
      userSession = PentahoSessionHolder.getSession();
      repository = PentahoSystem.get(ISolutionRepository.class, userSession);
     
      if (StringUtils.isNotBlank(path)) {
        ISolutionFile sf = repository.getSolutionFile(path, ISolutionRepository.ACTION_EXECUTE);
        if (sf != null && !sf.isDirectory() && (StringUtils.isBlank(type) || sf.getExtension().endsWith(type.toLowerCase())))  {
          List<AclMethod> acls = getAcl(path, false);
                  String localizedName = repository.getLocalizedFileProperty(sf, "title", ISolutionRepository.ACTION_EXECUTE); //$NON-NLS-1$
          objects.add(new RepositoryFileObject(localizedName, "#" + path, type, path, acls));
          return objects;
        }
View Full Code Here


        log.error("Access to Repository has failed");
        throw new NullPointerException("Access to Repository has failed");
      }
      String base = PentahoSystem.getApplicationContext().getSolutionRootPath();
      String parentPath = ActionInfo.buildSolutionPath(solution, path, "");
      ISolutionFile parentFile = repository.getSolutionFile(parentPath, ISolutionRepository.ACTION_CREATE);
      String filePath = parentPath + ISolutionRepository.SEPARATOR + action;
      ISolutionFile fileToSave = repository.getSolutionFile(fullPath, ISolutionRepository.ACTION_UPDATE);



      if (fileToSave != null || (!repository.resourceExists(filePath) && parentFile != null)) {
        repository.publish(base, '/' + parentPath, action, content.getBytes() , true);
View Full Code Here

      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      ZipOutputStream zos = new ZipOutputStream(bos);

      String[] fileArray = null;
      if (StringUtils.isBlank(files)) {
        ISolutionFile dir = repository.getSolutionFile(directory);
        for (ISolutionFile fo : dir.listFiles()) {
          if (!fo.isDirectory()) {
            String entry = fo.getFileName();
            if (".saiku".equals(fo.getExtension())) {
              byte[] doc = fo.getData();
              ZipEntry ze = new ZipEntry(entry);
View Full Code Here

    return repoObjects;
  }
 
  private List<AclMethod> getAcl(String file, boolean folder) {
    boolean isAdministrator = SecurityHelper.isPentahoAdministrator(PentahoSessionHolder.getSession());
    ISolutionFile solutionFile = repository.getSolutionFile(file, ISolutionRepository.ACTION_EXECUTE);
    List<AclMethod> acls = new ArrayList<AclMethod>();
    acls.add(AclMethod.READ);
   
    if (isAdministrator
          || repository.hasAccess(solutionFile, IPentahoAclEntry.PERM_UPDATE)
View Full Code Here

    return getTopFolder().getFileName();
  }

  public String getSolutionPath() {
    ArrayList pathList = new ArrayList();
    ISolutionFile folder = parent;
    while ( !folder.isRoot() && folder.retrieveParent() != null ) {
      pathList.add( folder.getFileName() );
      folder = folder.retrieveParent();
    }
    StringBuffer buffer = new StringBuffer( RepositoryFile.EMPTY_STRING );
    for ( int i = pathList.size() - 1; i >= 0; i-- ) {
      buffer.append( org.pentaho.platform.api.repository2.unified.RepositoryFile.SEPARATOR );
      buffer.append( pathList.get( i ).toString() );
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.ISolutionFile

Copyright © 2018 www.massapicom. 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.