Search in sources :

Example 21 with ServiceItem

use of org.talend.repository.services.model.services.ServiceItem in project tesb-studio-se by Talend.

the class ServiceMetadataAction method doRun.

@Override
protected void doRun() {
    final IRepositoryNode node = getNode();
    final ServiceItem serviceItem = (ServiceItem) node.getObject().getProperty().getItem();
    final boolean isLocked = isLocked(node.getObject());
    new ServiceMetadataDialog(getWorkbenchWindow(), serviceItem, (ServiceConnection) serviceItem.getConnection()).open();
    if (!isLocked) {
        // restore lock state.
        try {
            ProxyRepositoryFactory.getInstance().unlock(node.getObject());
        } catch (PersistenceException | LoginException e) {
            ExceptionHandler.process(e);
        }
    }
}
Also used : ServiceConnection(org.talend.repository.services.model.services.ServiceConnection) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ServiceMetadataDialog(org.talend.repository.services.ui.ServiceMetadataDialog) PersistenceException(org.talend.commons.exception.PersistenceException) LoginException(org.talend.commons.exception.LoginException) ServiceItem(org.talend.repository.services.model.services.ServiceItem)

Example 22 with ServiceItem

use of org.talend.repository.services.model.services.ServiceItem in project tesb-studio-se by Talend.

the class OpenJobAction method getReferenceJobId.

protected static String getReferenceJobId(IRepositoryNode node) {
    String parentPortName = node.getParent().getObject().getLabel();
    ServiceItem serviceItem = (ServiceItem) node.getParent().getParent().getObject().getProperty().getItem();
    List<ServicePort> listPort = ((ServiceConnection) serviceItem.getConnection()).getServicePort();
    for (ServicePort port : listPort) {
        if (port.getName().equals(parentPortName)) {
            List<ServiceOperation> listOperation = port.getServiceOperation();
            for (ServiceOperation operation : listOperation) {
                if (operation.getLabel().equals(node.getObject().getLabel())) {
                    return operation.getReferenceJobId();
                }
            }
            break;
        }
    }
    return null;
}
Also used : ServicePort(org.talend.repository.services.model.services.ServicePort) ServiceConnection(org.talend.repository.services.model.services.ServiceConnection) ServiceItem(org.talend.repository.services.model.services.ServiceItem) ServiceOperation(org.talend.repository.services.model.services.ServiceOperation)

Aggregations

ServiceItem (org.talend.repository.services.model.services.ServiceItem)22 ServiceConnection (org.talend.repository.services.model.services.ServiceConnection)18 ServiceOperation (org.talend.repository.services.model.services.ServiceOperation)17 ServicePort (org.talend.repository.services.model.services.ServicePort)17 PersistenceException (org.talend.commons.exception.PersistenceException)13 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)9 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)9 IRepositoryNode (org.talend.repository.model.IRepositoryNode)6 IFile (org.eclipse.core.resources.IFile)5 Item (org.talend.core.model.properties.Item)5 ConnectionItem (org.talend.core.model.properties.ConnectionItem)4 ProcessItem (org.talend.core.model.properties.ProcessItem)4 INode (org.talend.core.model.process.INode)3 IProcess2 (org.talend.core.model.process.IProcess2)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 CoreException (org.eclipse.core.runtime.CoreException)2 IPath (org.eclipse.core.runtime.IPath)2 IEditorReference (org.eclipse.ui.IEditorReference)2 IProcess (org.talend.core.model.process.IProcess)2