use of org.talend.commons.exception.BusinessException in project tdi-studio-se by Talend.
the class EmfEmittersPersistence method saveEmittersPool.
/**
* DOC mhirt Comment method "saveEmittersPool".
*
* @param pool
* @throws BusinessException
*/
public void saveEmittersPool(List<LightJetBean> pool) throws BusinessException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
ObjectOutputStream objectOut = null;
try {
objectOut = new ObjectOutputStream(out);
objectOut.writeObject(pool);
saveEmfPoolFactory(persistantFile, out.toByteArray());
} catch (IOException e) {
throw new BusinessException(e);
} finally {
try {
out.close();
} catch (Exception e) {
// ignore me even if i'm null
}
try {
objectOut.close();
} catch (Exception e) {
// ignore me even if i'm null
}
}
}
use of org.talend.commons.exception.BusinessException in project tmdm-studio-se by Talend.
the class RenameProcessAction method moveToOtherTypeNode.
public void moveToOtherTypeNode(IRepositoryViewObject parent, IRepositoryViewObject viewObj) {
MDMServerObjectItem item = (MDMServerObjectItem) viewObj.getProperty().getItem();
waitSomeTime(viewObj);
IProxyRepositoryFactory factory = getFactory();
try {
if (factory.isEditableAndLockIfPossible(item)) {
String path = item.getState().getPath();
IPath ipath = new Path(path);
factory.moveObject(viewObj, ipath);
IRepositoryViewObject iRepositoryViewObject = ContainerCacheService.get(viewObj.getRepositoryObjectType(), path);
commonViewer.refresh(parent);
commonViewer.refresh(iRepositoryViewObject);
}
} catch (PersistenceException e) {
log.error(e.getMessage(), e);
} catch (BusinessException e) {
log.error(e.getMessage(), e);
} finally {
try {
factory.unlock(item);
} catch (PersistenceException e) {
log.error(e.getMessage(), e);
} catch (LoginException e) {
log.error(e.getMessage(), e);
}
}
}
use of org.talend.commons.exception.BusinessException in project tmdm-studio-se by Talend.
the class RestoreAction method restoreServerObject.
private void restoreServerObject(IRepositoryViewObject viewObj) {
Item item = viewObj.getProperty().getItem();
try {
factory.restoreObject(viewObj, new Path(item.getState().getPath()));
if (RepositoryResourceUtil.isOpenedInEditor(viewObj) != null) {
factory.lock(viewObj);
}
executeRestoreCommand(viewObj);
} catch (PersistenceException e) {
log.error(e.getMessage(), e);
} catch (BusinessException e) {
log.error(e.getMessage(), e);
}
}
use of org.talend.commons.exception.BusinessException in project tmdm-studio-se by Talend.
the class MDMEditViewProcessPropertyAction method moveToOtherTypeNode.
private void moveToOtherTypeNode(IRepositoryViewObject viewObj, String oldPath, String newPath) {
MDMServerObjectItem item = (MDMServerObjectItem) viewObj.getProperty().getItem();
item.getState().setPath(newPath);
waitSomeTime(viewObj);
IProxyRepositoryFactory factory = getFactory();
try {
if (factory.isEditableAndLockIfPossible(item)) {
IPath ipath = new Path(newPath);
factory.moveObject(viewObj, ipath);
ERepositoryObjectType type = viewObj.getRepositoryObjectType();
refreshTree(type, oldPath);
refreshTree(type, newPath);
}
} catch (PersistenceException e) {
log.error(e.getMessage(), e);
} catch (BusinessException e) {
log.error(e.getMessage(), e);
} finally {
unlockItem(item);
}
}
use of org.talend.commons.exception.BusinessException in project tmdm-studio-se by Talend.
the class RemoveFromRepositoryAction method removeServerObject.
private void removeServerObject(IRepositoryViewObject viewObj) {
if (removed.contains(viewObj.getId())) {
return;
}
removed.add(viewObj.getId());
try {
Item item = viewObj.getProperty().getItem();
IEditorReference ref = RepositoryResourceUtil.isOpenedInEditor(viewObj);
if (ref != null) {
RepositoryResourceUtil.closeEditor(ref, true);
}
factory.deleteObjectLogical(viewObj);
if (item instanceof MDMServerObjectItem) {
MDMServerObject serverObj = ((MDMServerObjectItem) item).getMDMServerObject();
CommandManager.getInstance().pushCommand(ICommand.CMD_DELETE, viewObj.getId(), serverObj.getName());
}
} catch (BusinessException e) {
MessageDialog.openError(getShell(), Messages.Common_Error, e.getMessage());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
Aggregations