Examples of RuntimeRepository


Examples of it.eng.spagobi.engines.talend.runtime.RuntimeRepository

      boolean isInMemory = item.isInMemory();
      long sizeInBytes = item.getSize();
     
      if(fieldName.equalsIgnoreCase("deploymentDescriptor")) return null;
     
      RuntimeRepository runtimeRepository = TalendEngine.getRuntimeRepository();
      File jobsDir = new File(runtimeRepository.getRootDir(), jobDeploymentDescriptor.getLanguage().toLowerCase());
    File projectDir = new File(jobsDir, jobDeploymentDescriptor.getProject());
    File tmpDir = new File(projectDir, "tmp");
    if(!tmpDir.exists()) tmpDir.mkdirs();    
       File uploadedFile = new File(tmpDir, fileName);
     
      try {
      item.write(uploadedFile);
    } catch (Exception e) {
      e.printStackTrace();
   
   
    String[] dirNames = ZipUtils.getDirectoryNameByLevel(new ZipFile(uploadedFile), 2);
    List dirNameList = new ArrayList();
    for(int i = 0; i < dirNames.length; i++) {
      if(!dirNames[i].equalsIgnoreCase("lib")) dirNameList.add(dirNames[i]);
    }
    String[] jobNames = (String[])dirNameList.toArray(new String[0]);
   
      runtimeRepository.deployJob(jobDeploymentDescriptor, new ZipFile(uploadedFile));
      uploadedFile.delete()
      tmpDir.delete();
     
      return jobNames;
  }
View Full Code Here

Examples of it.eng.spagobi.engines.talend.runtime.RuntimeRepository

  }
 
  private String getTemplate(String language, String projectName, String jobName) throws IOException, SpagoBIEngineException {
    String template = null;
   
    RuntimeRepository runtimeRepository = TalendEngine.getRuntimeRepository();
    File jobsDir = new File(runtimeRepository.getRootDir(), language.toLowerCase());
    File projectDir = new File(jobsDir, projectName);
    File jobDir = new File(projectDir, jobName);
    File templateFile = new File(jobDir, "spagobi.xml");
    if(templateFile.exists() && isValidTemplate(templateFile) ) {
      BufferedReader reader = new BufferedReader(new FileReader(templateFile));
View Full Code Here

Examples of it.eng.spagobi.engines.talend.runtime.RuntimeRepository

 
  /*
   * TODO: implementare questa funzione tramite una API  WEB Service
   */
  private void publishOnSpagoBI(EngineStartServletIOManager servletIOManager, String language, String projectName, String jobName) throws IOException, SpagoBIEngineException {
    RuntimeRepository runtimeRepository = TalendEngine.getRuntimeRepository();
   
    String template = getTemplate(language, projectName, jobName);
   
    BASE64Encoder encoder = new BASE64Encoder();
    String templateBase64Coded = encoder.encode(template.getBytes());   
View Full Code Here

Examples of it.eng.spagobi.engines.talend.runtime.RuntimeRepository

     
      if(fieldName.equalsIgnoreCase("deploymentDescriptor")) return;
     
     
     
      RuntimeRepository runtimeRepository = TalendEngine.getRuntimeRepository();
     
      String projectName = jobDeploymentDescriptor.getProject();
      String projectLanguage = jobDeploymentDescriptor.getLanguage().toLowerCase();
      String jobName = "JOB_NAME";
      String contextName = "Default";
View Full Code Here

Examples of it.eng.spagobi.engines.talend.runtime.RuntimeRepository

  private static transient Logger logger = Logger.getLogger(JobRunService.class);
 
 
  public void doService( EngineStartServletIOManager servletIOManager ) throws SpagoBIEngineException {
   
    RuntimeRepository runtimeRepository;
    Job job;

    logger.debug("IN");
   
    try {   
     
      //servletIOManager.auditServiceStartEvent();
       
      super.doService(servletIOManager);
       
      job = new Job( servletIOManager.getTemplateAsSourceBean() );     
      runtimeRepository = TalendEngine.getRuntimeRepository();
     
      try {
        runtimeRepository.runJob(job, servletIOManager.getEnv());
      } catch (JobNotFoundException ex) {
        logger.error(ex.getMessage());

        throw new SpagoBIEngineException("Job not found",
            "job.not.existing");
View Full Code Here

Examples of it.eng.spagobi.engines.weka.runtime.RuntimeRepository

      }
     
      if(engineInstance != null) {
        try {
          //engineInstance.run();
          RuntimeRepository rt = new RuntimeRepository();
          rt.runEngineInstance(engineInstance);
          logger.debug("Engine instance succesfully started");
        } catch (Exception e) {
          logger.error("Impossible to start-up engine instance", e);
          responseMsg = servletIOManager.getLocalizedMessage("an.unpredicted.error.occured");
        }
View Full Code Here

Examples of org.pentaho.platform.repository.runtime.RuntimeRepository

  @SuppressWarnings( "unused" )
  private void doReadOnlyTest( String elementId ) {
    info( Messages.getInstance().getString( "RUNTIMEREPOTEST.USER_TESTINGREADONLY" ) ); //$NON-NLS-1$
    HibernateUtil.beginTransaction();
    try {
      IRuntimeRepository repo = new RuntimeRepository();
      repo.setSession( getPentahoSession() );
      RuntimeElement baseElement = (RuntimeElement) repo.loadElementById( elementId, null );
      info( Messages.getInstance().getString( "RUNTIMEREPOTEST.USER_SETTINGELEMENTTOREADONLY" ) ); //$NON-NLS-1$
      baseElement.setReadOnly( true );
    } finally {
      HibernateUtil.commitTransaction();
    }
    // Now, the element is read-only.
    // Flush the session and re-load the element to
    // test the "loaded" methods.
    HibernateUtil.flushSession();
    HibernateUtil.clear();
    // Now, reload the element.
    HibernateUtil.beginTransaction();
    try {
      info( Messages.getInstance().getString( "RUNTIMEREPOTEST.USER_LOADINGREADONLY" ) ); //$NON-NLS-1$
      IRuntimeRepository repo = new RuntimeRepository();
      repo.setSession( getPentahoSession() );
      RuntimeElement baseElement = (RuntimeElement) repo.loadElementById( elementId, null );
      boolean caughtException = false;
      try {
        info( Messages.getInstance().getString( "RUNTIMEREPOTEST.USER_TRYINGSETSTRINGPROPERTY" ) ); //$NON-NLS-1$
        baseElement
            .setStringProperty(
View Full Code Here

Examples of org.pentaho.platform.repository.runtime.RuntimeRepository

  }

  @SuppressWarnings( "unused" )
  private void cleanupElement( String elementId ) {
    HibernateUtil.beginTransaction();
    IRuntimeRepository repo = new RuntimeRepository();
    repo.setSession( getPentahoSession() );
    RuntimeElement re = (RuntimeElement) repo.loadElementById( elementId, null );
    HibernateUtil.makeTransient( re );
    HibernateUtil.commitTransaction();
    HibernateUtil.flushSession();
    HibernateUtil.clear();
  }
View Full Code Here

Examples of org.pentaho.platform.repository.runtime.RuntimeRepository

  @SuppressWarnings( "unused" )
  private void modifyAdd( RuntimeElement baseElement ) {
    HibernateUtil.beginTransaction();
    try {
      IRuntimeRepository repo = new RuntimeRepository();
      repo.setSession( getPentahoSession() );
      baseElement
          .setStringProperty(
              Messages.getInstance().getString( "RUNTIMEREPOTEST.MODIFY_NEW_STRING_KEY" ), Messages.getInstance().getString( "RUNTIMEREPOTEST.MODIFY_STRING_VALUE" ) ); //$NON-NLS-1$ //$NON-NLS-2$
    } finally {
      HibernateUtil.commitTransaction();
View Full Code Here

Examples of org.pentaho.platform.repository.runtime.RuntimeRepository

    }
  }

  @SuppressWarnings( "unused" )
  private RuntimeElement createRuntimeElement() {
    IRuntimeRepository repo = new RuntimeRepository();
    repo.setSession( getPentahoSession() );
    RuntimeElement ele = null;
    ele =
        (RuntimeElement) repo
            .newRuntimeElement(
                Messages.getInstance().getString( "RUNTIMEREPOTEST.CREATE_PARENT" ), Messages.getInstance().getString( "RUNTIMEREPOTEST.CREATE_PARENT_TYPE" ), false ); //$NON-NLS-1$ //$NON-NLS-2$
    try {
      assertNotNull( ele );
      info( Messages.getInstance().getString( "RUNTIMEREPOTEST.DEBUG_INSTANCE_ID" ) + ele.getInstanceId() ); //$NON-NLS-1$
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.