use of org.talend.core.model.repository.IRepositoryObject in project tdi-studio-se by Talend.
the class OpenRepositoryJobHierarchyAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
protected void doRun() {
ISelection selection = getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
RepositoryNode node = (RepositoryNode) obj;
Property property = (Property) node.getObject().getProperty();
Property updatedProperty = null;
try {
updatedProperty = ProxyRepositoryFactory.getInstance().getLastVersion(new Project(ProjectManager.getInstance().getProject(property.getItem())), property.getId()).getProperty();
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
// update the property of the node repository object
if (node.getObject() instanceof IRepositoryObject) {
IRepositoryObject iobject = (IRepositoryObject) node.getObject();
iobject.setProperty(updatedProperty);
}
Assert.isTrue(property.getItem() instanceof ProcessItem);
// TODO should use a fake Process here to replace the real Process.
// Process loadedProcess = new Process(property);
// loadedProcess.loadXmlFile();
IDesignerCoreService designerCoreService = CorePlugin.getDefault().getDesignerCoreService();
Process loadedProcess = (Process) designerCoreService.getProcessFromProcessItem((ProcessItem) updatedProperty.getItem());
OpenJobHierarchyAction openAction = new OpenJobHierarchyAction(this.getViewPart());
openAction.run(loadedProcess);
}
use of org.talend.core.model.repository.IRepositoryObject in project tdi-studio-se by Talend.
the class BusinessDeleteListener method propertyChange.
/*
* (non-Javadoc)
*
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/
@Override
public void propertyChange(PropertyChangeEvent event) {
boolean isDeleteBusinessLogical = event.getPropertyName().equals(ERepositoryActionName.DELETE_TO_RECYCLE_BIN.getName());
boolean isDeleteBusinessPhysical = event.getPropertyName().equals(ERepositoryActionName.DELETE_FOREVER.getName());
if (!isDeleteBusinessLogical && !isDeleteBusinessPhysical) {
return;
}
if (!(event.getNewValue() instanceof IRepositoryObject)) {
return;
}
IRepositoryObject object = (IRepositoryObject) event.getNewValue();
if (object.getRepositoryObjectType() != ERepositoryObjectType.BUSINESS_PROCESS) {
return;
}
object = (IRepositoryObject) event.getNewValue();
if (object != null) {
try {
deleteSVGObjectLogicalOrPhysical(object, isDeleteBusinessLogical);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
}
use of org.talend.core.model.repository.IRepositoryObject in project tdi-studio-se by Talend.
the class ProblemsView method propertyChange.
/*
* (non-Javadoc)
*
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (!(evt.getNewValue() instanceof IRepositoryObject)) {
return;
}
IRepositoryObject object = (IRepositoryObject) evt.getNewValue();
if (object.getRepositoryObjectType() != ERepositoryObjectType.ROUTINES) {
return;
}
if (evt.getPropertyName().equals(ERepositoryActionName.DELETE_TO_RECYCLE_BIN.getName()) || evt.getPropertyName().equals(ERepositoryActionName.DELETE_FOREVER.getName())) {
String routineLabel = object.getProperty().getLabel();
Problems.removeProblemsByRoutine(routineLabel);
}
if (evt.getPropertyName().equals(ERepositoryActionName.RESTORE.getName())) {
RoutineItem item = (RoutineItem) object.getProperty().getItem();
restoreProblem(item);
}
}
Aggregations