use of org.talend.repository.model.IProxyRepositoryService in project tdi-studio-se by Talend.
the class NewProcessWizardPage method loadRepViewObjectWithOtherTypes.
@Override
protected List<IRepositoryViewObject> loadRepViewObjectWithOtherTypes() throws PersistenceException {
List<IRepositoryViewObject> list = new ArrayList<IRepositoryViewObject>();
// List for all other processes
List<IRepositoryViewObject> processList = getAllProcessTypeObjectsWithoutCurrentType();
if (processList != null && !processList.isEmpty()) {
list.addAll(processList);
}
// List for routine
if (ERepositoryObjectType.ROUTINES != null) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
IProxyRepositoryService service = (IProxyRepositoryService) GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
List<IRepositoryViewObject> mrList = service.getProxyRepositoryFactory().getAll(ERepositoryObjectType.ROUTINES, true, false);
if (mrList != null && mrList.size() > 0) {
list.addAll(mrList);
}
}
}
return list;
}
use of org.talend.repository.model.IProxyRepositoryService in project tdi-studio-se by Talend.
the class JobletUtil method needReadOnlyJoblet.
public boolean needReadOnlyJoblet(JobletProcessItem jobletItem) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart[] editors = page.getEditors();
for (IEditorPart editor : editors) {
if (editor instanceof AbstractMultiPageTalendEditor) {
List<? extends INode> nodeList = ((AbstractMultiPageTalendEditor) editor).getProcess().getGraphicalNodes();
for (INode node : nodeList) {
if (((Node) node).isJoblet() && jobletItem.getProperty() != null) {
if (jobletItem.getProperty().getId().equals(node.getComponent().getProcess().getId())) {
boolean haveLock = jobletItem.getState().isLocked();
boolean isSvn = false;
ISVNProviderService service = null;
if (PluginChecker.isSVNProviderPluginLoaded()) {
service = (ISVNProviderService) GlobalServiceRegister.getDefault().getService(ISVNProviderService.class);
}
if (service != null && service.isProjectInSvnMode()) {
isSvn = service.isProjectInSvnMode();
}
if (isSvn) {
IProxyRepositoryService proxyService = (IProxyRepositoryService) GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
IProxyRepositoryFactory factory = proxyService.getProxyRepositoryFactory();
ERepositoryStatus repositoryStatus = factory.getStatus(jobletItem);
if (repositoryStatus == ERepositoryStatus.LOCK_BY_USER) {
haveLock = true;
}
}
if (haveLock) {
return true;
}
}
}
}
}
}
return false;
}
use of org.talend.repository.model.IProxyRepositoryService in project tdi-studio-se by Talend.
the class JobletUtil method lockByOthers.
// public void reloadJobletComponent(IProcess2 process){
// IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
// IJobletProviderService.class);
// if (service != null) {
// process.get
// service.reloadJobletProcess(this);
// }
// }
public boolean lockByOthers(Item item) {
IProxyRepositoryService service = (IProxyRepositoryService) GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
IProxyRepositoryFactory factory = service.getProxyRepositoryFactory();
ERepositoryStatus repositoryStatus = factory.getStatus(item);
if (repositoryStatus == ERepositoryStatus.LOCK_BY_OTHER) {
return true;
}
return false;
}
use of org.talend.repository.model.IProxyRepositoryService in project tdi-studio-se by Talend.
the class GenericConnWizardPage method loadRepViewObjectWithSameType.
/**
* Loads the repository view objects, which have the same repository type as the current job that are opened in
* properties wizard dialog. Added by Marvin Wang on Feb 22, 2013.
*
* @return
* @throws PersistenceException
*/
private List<IRepositoryViewObject> loadRepViewObjectWithSameType() throws PersistenceException {
List<IRepositoryViewObject> list = new ArrayList<IRepositoryViewObject>();
ERepositoryObjectType type = ERepositoryObjectType.getType(((GenericConnectionItem) connectionItem).getTypeName());
if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
IProxyRepositoryService service = (IProxyRepositoryService) GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
list = service.getProxyRepositoryFactory().getAll(type, true, false);
}
return list;
}
Aggregations