Package org.pentaho.platform.api.repository

Examples of org.pentaho.platform.api.repository.ISolutionRepository.resourceExists()


      if( repository == null ) {
        log.error("Access to Repository has failed");
        throw new NullPointerException("Access to Repository has failed");
      }

      if (repository.resourceExists(fullPath)) {
        String doc = repository.getResourceAsString(fullPath, ISolutionRepository.ACTION_EXECUTE);
        if (doc == null) {
          log.error("Error retrieving document from solution repository");
          throw new NullPointerException("Error retrieving saiku document from solution repository");
        }
View Full Code Here


      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);
        log.debug(PluginConfig.PLUGIN_NAME + " : Published " + solution + " / " + path + " / " + action );
      } else {
        throw new Exception("Error ocurred while saving query to solution repository");
      }
View Full Code Here

      try {
       
      SolutionReposHelper.setSolutionRepositoryThreadVariable(PentahoSystem.get(ISolutionRepository.class, PentahoSessionHolder.getSession()));
       
        ISolutionRepository repository = PentahoSystem.get(ISolutionRepository.class, PentahoSessionHolder.getSession());
        if (repository.resourceExists(mondrianPropsFilename, ISolutionRepository.ACTION_EXECUTE)) {
          is = repository.getResourceInputStream(mondrianPropsFilename, false, ISolutionRepository.ACTION_EXECUTE);
          MondrianProperties.instance().load(is);
          log.debug("Loaded mondrian properties file: " + mondrianPropsFilename);
        } else {
          log.debug("Cannot find mondrian properties file: "+  mondrianPropsFilename);
View Full Code Here

        }

        String templateName = null;
        String messagesBaseFilename = null;

        if (repository.resourceExists(fullPath)) {
            final ActionResource resource = new ActionResource("", IActionSequenceResource.SOLUTION_FILE_RESOURCE, "text/xml", fullPath);
            final String dashboardMetadata = repository.getResourceAsString(resource, ISolutionRepository.ACTION_EXECUTE);
            final Document doc = DocumentHelper.parseText(dashboardMetadata);
            templateName = XmlDom4JHelper.getNodeText("/cdf/template", doc, "");
View Full Code Here

            } else {
                fullTemplatePath = ActionInfo.buildSolutionPath(solution, path, templateName);
            }
        }

        if (fullTemplatePath != null && repository.resourceExists(fullTemplatePath)) {
            resource = new ActionResource("", IActionSequenceResource.SOLUTION_FILE_RESOURCE, "text/xml", //$NON-NLS-1$ //$NON-NLS-2$
                    fullTemplatePath);
        } else {
            resource = new ActionResource("", IActionSequenceResource.SOLUTION_FILE_RESOURCE, "text/xml", //$NON-NLS-1$ //$NON-NLS-2$
                    "system/" + PLUGIN_NAME + "/default-dashboard-template.html"); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

        final IUITemplater templater = PentahoSystem.get(IUITemplater.class, userSession);
        ArrayList<String> i18nTagsList = new ArrayList<String>();
        if (templater != null) {
           
          String solutionPath = "system/" + PLUGIN_NAME + "/" + dashboardTemplate;
            if(!repository.resourceExists(solutionPath))
            {//then try in solution
              solutionPath = SOLUTION_DIR + "/templates/" + dashboardTemplate;
            }
             
            final ActionResource templateResource = new ActionResource("", IActionSequenceResource.SOLUTION_FILE_RESOURCE, "text/xml", solutionPath); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
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.