Search in sources :

Example 1 with PurRepositoryLocation

use of org.pentaho.di.repository.pur.PurRepositoryLocation in project pentaho-kettle by pentaho.

the class RepositoryPerformanceApp method startupRepository.

protected void startupRepository() throws Exception {
    // PentahoLicenseVerifier.setStreamOpener(new TestLicenseStream("pdi-ee=true")); //$NON-NLS-1$
    KettleEnvironment.init();
    repositoryMeta = new PurRepositoryMeta();
    repositoryMeta.setName("JackRabbit");
    repositoryMeta.setDescription("JackRabbit test repository");
    ((PurRepositoryMeta) repositoryMeta).setRepositoryLocation(new PurRepositoryLocation(repositoryLocation));
    userInfo = new UserInfo(EXP_LOGIN, "password", EXP_USERNAME, "Apache Tomcat user", true);
    repository = new PurRepository();
    repository.init(repositoryMeta);
    repository.connect(EXP_LOGIN, "password");
}
Also used : PurRepository(org.pentaho.di.repository.pur.PurRepository) PurRepositoryMeta(org.pentaho.di.repository.pur.PurRepositoryMeta) PurRepositoryLocation(org.pentaho.di.repository.pur.PurRepositoryLocation)

Example 2 with PurRepositoryLocation

use of org.pentaho.di.repository.pur.PurRepositoryLocation in project pentaho-kettle by pentaho.

the class RepositoryConfigController method initializeModel.

private void initializeModel() {
    PurRepositoryMeta purRepositoryMeta = null;
    if (repositoryMeta != null && repositoryMeta instanceof PurRepositoryMeta) {
        purRepositoryMeta = (PurRepositoryMeta) repositoryMeta;
        model.setName(purRepositoryMeta.getName());
        model.setId(purRepositoryMeta.getDescription());
        PurRepositoryLocation location = purRepositoryMeta.getRepositoryLocation();
        if (location != null) {
            model.setUrl(location.getUrl());
        } else {
            model.setUrl(getDefaultUrl());
        }
    } else {
        model.setModificationComments(true);
    }
}
Also used : PurRepositoryMeta(org.pentaho.di.repository.pur.PurRepositoryMeta) PurRepositoryLocation(org.pentaho.di.repository.pur.PurRepositoryLocation)

Example 3 with PurRepositoryLocation

use of org.pentaho.di.repository.pur.PurRepositoryLocation in project pentaho-kettle by pentaho.

the class RepositoryConfigController method ok.

public void ok() {
    if (repositoryMeta instanceof PurRepositoryMeta) {
        repositoryMeta.setName(model.getName());
        repositoryMeta.setDescription(model.getId());
        // remove trailing slash
        String url = model.getUrl();
        String urlTrim = url.endsWith("/") ? url.substring(0, url.length() - 1) : url;
        PurRepositoryLocation location = new PurRepositoryLocation(urlTrim);
        ((PurRepositoryMeta) repositoryMeta).setRepositoryLocation(location);
        ((PurRepositoryMeta) repositoryMeta).setVersionCommentMandatory(model.isModificationComments());
        getCallback().onSuccess(((PurRepositoryMeta) repositoryMeta));
    } else {
        getCallback().onError(new IllegalStateException(BaseMessages.getString(PurRepositoryDialog.class, // $NON-NLS-1$
        "RepositoryConfigDialog.ERROR_0001_NotAnInstanceOfPurRepositoryMeta")));
    }
}
Also used : PurRepositoryMeta(org.pentaho.di.repository.pur.PurRepositoryMeta) PurRepositoryLocation(org.pentaho.di.repository.pur.PurRepositoryLocation)

Aggregations

PurRepositoryLocation (org.pentaho.di.repository.pur.PurRepositoryLocation)3 PurRepositoryMeta (org.pentaho.di.repository.pur.PurRepositoryMeta)3 PurRepository (org.pentaho.di.repository.pur.PurRepository)1