Search in sources :

Example 1 with OperationIgnoredException

use of com.amalto.workbench.utils.OperationIgnoredException in project tmdm-studio-se by Talend.

the class DefaultDeployCommand method doExecute.

private IStatus doExecute(Object params, IProgressMonitor monitor) {
    ERepositoryObjectType type = getViewObjectType();
    String objectName = getLabel();
    IInteractiveHandler handler = InteractiveService.findHandler(type);
    if (handler != null) {
        String typeLabel = handler.getLabel();
        monitor.subTask(Messages.bind(Messages.Deploy_text, typeLabel));
        try {
            boolean isOK = handler.deploy(this);
            if (getDeployStatus() != null) {
                return getDeployStatus();
            }
            if (isOK) {
                if (getCommandType() == CMD_MODIFY) {
                    return DeployStatus.getOKStatus(this, Messages.bind(Messages.Deploy_successfully_text, typeLabel, objectName));
                }
                return DeployStatus.getOKStatus(this, Messages.bind(Messages.Create_successfully_text, typeLabel, objectName));
            } else {
                return DeployStatus.getErrorStatus(this, Messages.bind(Messages.Deploy_fail_text, typeLabel, objectName));
            }
        } catch (OperationIgnoredException e) {
            return null;
        } catch (OperationCanceledException e) {
            return DeployStatus.getInfoStatus(this, Messages.bind(Messages.Deploy_cancel_text, typeLabel, objectName));
        } catch (WebServiceException e) {
            return getDetailErrorMsg(Messages.Deploy_fail_cause_text, typeLabel, objectName, e);
        } catch (XtentisException e) {
            return getDetailErrorMsg(Messages.Deploy_fail_cause_text, typeLabel, objectName, e);
        } catch (RuntimeException e) {
            return getDetailErrorMsg(Messages.Deploy_fail_cause_text, typeLabel, objectName, e);
        }
    } else {
        return DeployStatus.getErrorStatus(this, Messages.bind(Messages.Deploy_notSupport_text, objectName));
    }
}
Also used : OperationIgnoredException(com.amalto.workbench.utils.OperationIgnoredException) WebServiceException(javax.xml.ws.WebServiceException) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) IInteractiveHandler(org.talend.mdm.repository.core.service.IInteractiveHandler) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType) XtentisException(com.amalto.workbench.utils.XtentisException)

Aggregations

OperationIgnoredException (com.amalto.workbench.utils.OperationIgnoredException)1 XtentisException (com.amalto.workbench.utils.XtentisException)1 WebServiceException (javax.xml.ws.WebServiceException)1 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)1 IInteractiveHandler (org.talend.mdm.repository.core.service.IInteractiveHandler)1