Search in sources :

Example 1 with DataServiceValidationException

use of org.pentaho.di.trans.dataservice.serialization.DataServiceValidationException in project pdi-dataservice-server-plugin by pentaho.

the class DataServiceDialogController method saveAndClose.

public void saveAndClose() throws XulException {
    try {
        if (dataServiceHasNoName(model)) {
            return;
        }
        String existing = dataService != null ? dataService.getName() : null;
        delegate.save(delegate.checkConflict(delegate.checkDefined(model.getDataService()), existing));
        // Remove edited data service if name changed
        if (dataService != null && !model.getServiceName().equals(existing)) {
            delegate.removeDataService(dataService);
        }
        // Ensure the synchronization service is installed
        delegate.createSyncService().install(model.getTransMeta());
        close();
    } catch (DataServiceValidationException e) {
        error(getString(PKG, "DataServiceDialog.SaveError.Title"), e.getMessage());
    } catch (Exception e) {
        error(getString(PKG, "DataServiceDialog.SaveError.Title"), e.getMessage());
        getLogChannel().logError(e.getMessage(), e);
    }
}
Also used : BaseMessages.getString(org.pentaho.di.i18n.BaseMessages.getString) XulException(org.pentaho.ui.xul.XulException) InvocationTargetException(java.lang.reflect.InvocationTargetException) DataServiceValidationException(org.pentaho.di.trans.dataservice.serialization.DataServiceValidationException) DataServiceValidationException(org.pentaho.di.trans.dataservice.serialization.DataServiceValidationException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 BaseMessages.getString (org.pentaho.di.i18n.BaseMessages.getString)1 DataServiceValidationException (org.pentaho.di.trans.dataservice.serialization.DataServiceValidationException)1 XulException (org.pentaho.ui.xul.XulException)1