use of org.talend.commons.runtime.model.repository.ERepositoryStatus in project tmdm-studio-se by Talend.
the class RepositoryResourceUtil method isLockedViewObject.
public static boolean isLockedViewObject(IRepositoryViewObject viewObj) {
IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
ERepositoryStatus status = factory.getStatus(viewObj);
return status == ERepositoryStatus.LOCK_BY_USER || status == ERepositoryStatus.LOCK_BY_OTHER;
}
use of org.talend.commons.runtime.model.repository.ERepositoryStatus in project tmdm-studio-se by Talend.
the class RepositoryResourceUtil method isLockedItem.
public static boolean isLockedItem(Item item) {
IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
ERepositoryStatus status = factory.getStatus(item);
return status == ERepositoryStatus.LOCK_BY_USER || status == ERepositoryStatus.LOCK_BY_OTHER;
}
use of org.talend.commons.runtime.model.repository.ERepositoryStatus in project tdq-studio-se by Talend.
the class FileSystemImportWriter method removeLockStatus.
/**
* when the item's status is locked, change to unlocked.
*
* @param property
*/
private void removeLockStatus(Property property) {
Item item = property.getItem();
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
ERepositoryStatus status = factory.getStatus(item);
if (status != null && status == ERepositoryStatus.LOCK_BY_USER) {
try {
factory.unlock(item);
// after unlock, reload the resource.
EMFSharedResources.getInstance().reloadResource(getUri(property));
} catch (PersistenceException e) {
log.error(e, e);
} catch (LoginException e) {
log.error(e, e);
}
}
}
use of org.talend.commons.runtime.model.repository.ERepositoryStatus in project tesb-studio-se by Talend.
the class AssignJobAction method init.
@Override
protected void init(RepositoryNode node) {
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
if (!currentNodeType.equals(nodeType)) {
return;
}
IProxyRepositoryFactory proxyFactory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
try {
proxyFactory.updateLockStatus();
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
IRepositoryViewObject repositoryViewObject = node.getObject();
ERepositoryStatus status = proxyFactory.getStatus(repositoryViewObject);
if (!status.isEditable() && !status.isPotentiallyEditable()) {
setEnabled(false);
} else {
// not enabled if the operation doesn't define in binding
if (!WSDLUtils.isOperationInBinding(node)) {
setEnabled(false);
return;
}
setEnabled(true);
}
}
use of org.talend.commons.runtime.model.repository.ERepositoryStatus in project tdi-studio-se by Talend.
the class JobletUtil method isRed.
public boolean isRed(AbstractJobletContainer jobletContainer) {
IProcess2 jobletProcess = (IProcess2) jobletContainer.getNode().getComponent().getProcess();
if (jobletProcess == null) {
return false;
}
ERepositoryStatus status = ProxyRepositoryFactory.getInstance().getStatus(jobletProcess.getProperty().getItem());
if (status == ERepositoryStatus.LOCK_BY_OTHER) {
return true;
}
IEditorPart[] editors = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getDirtyEditors();
if (editors.length <= 0) {
return false;
}
for (IEditorPart editor : editors) {
if (editor.getEditorInput() instanceof RepositoryEditorInput) {
RepositoryEditorInput editorInput = (RepositoryEditorInput) editor.getEditorInput();
String jobletId = editorInput.getId();
if (jobletId.equals(jobletProcess.getId())) {
return true;
}
}
}
return false;
}
Aggregations