Search in sources :

Example 31 with ServiceConnection

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

the class ESBRepositoryContentHandler method addNode.

// public RepositoryNode createRepositoryNode(RepositoryNode node) {
// RepositoryNode serviceNode = new RepositoryNode(null, node, ENodeType.SYSTEM_FOLDER);
// serviceNode.setProperties(EProperties.LABEL, ESBRepositoryNodeType.SERVICES);
// serviceNode.setProperties(EProperties.CONTENT_TYPE, ESBRepositoryNodeType.SERVICES);
// return serviceNode;
// }
@Override
public void addNode(ERepositoryObjectType type, RepositoryNode recBinNode, IRepositoryViewObject repositoryObject, RepositoryNode node) {
    if (type == ESBRepositoryNodeType.SERVICES) {
        ServiceConnection serviceConnection = (ServiceConnection) ((ServiceItem) repositoryObject.getProperty().getItem()).getConnection();
        List<ServicePort> listPort = serviceConnection.getServicePort();
        for (ServicePort port : listPort) {
            PortRepositoryObject portRepositoryObject = new PortRepositoryObject(repositoryObject, port);
            RepositoryNode portNode = new RepositoryNode(portRepositoryObject, node, ENodeType.REPOSITORY_ELEMENT);
            portNode.setProperties(EProperties.LABEL, port.getName());
            portNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.SERVICESPORT);
            node.getChildren().add(portNode);
            // 
            List<ServiceOperation> listOperation = port.getServiceOperation();
            for (ServiceOperation operation : listOperation) {
                OperationRepositoryObject operationRepositoryObject = new OperationRepositoryObject(repositoryObject, operation);
                RepositoryNode operationNode = new RepositoryNode(operationRepositoryObject, portNode, ENodeType.REPOSITORY_ELEMENT);
                operationNode.setProperties(EProperties.LABEL, operation.getLabel());
                operationNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.SERVICESOPERATION);
                if (!operation.isInBinding()) {
                    operationRepositoryObject.setInformationStatus(ERepositoryStatus.ERROR);
                    operationRepositoryObject.setDescription(Messages.LocalWSDLEditor_refreshBindingMessage);
                } else {
                    operationRepositoryObject.setInformationStatus(null);
                    operationRepositoryObject.setDescription(null);
                }
                portNode.getChildren().add(operationNode);
            }
        }
    }
}
Also used : ServicePort(org.talend.repository.services.model.services.ServicePort) ServiceConnection(org.talend.repository.services.model.services.ServiceConnection) ServiceOperation(org.talend.repository.services.model.services.ServiceOperation) RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 32 with ServiceConnection

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

the class WSDLUtils method isValidService.

public static boolean isValidService(ServiceItem serviceItem) {
    boolean isValid = false;
    List<ServicePort> listPort = ((ServiceConnection) serviceItem.getConnection()).getServicePort();
    for (ServicePort port : listPort) {
        List<ServiceOperation> listOperation = port.getServiceOperation();
        for (ServiceOperation operation : listOperation) {
            if (operation.getReferenceJobId() != null) {
                isValid = true;
                break;
            }
        }
    }
    return isValid;
}
Also used : ServicePort(org.talend.repository.services.model.services.ServicePort) ServiceConnection(org.talend.repository.services.model.services.ServiceConnection) ServiceOperation(org.talend.repository.services.model.services.ServiceOperation)

Aggregations

ServiceConnection (org.talend.repository.services.model.services.ServiceConnection)32 ServiceOperation (org.talend.repository.services.model.services.ServiceOperation)27 ServicePort (org.talend.repository.services.model.services.ServicePort)27 ServiceItem (org.talend.repository.services.model.services.ServiceItem)20 PersistenceException (org.talend.commons.exception.PersistenceException)17 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)15 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)11 IFile (org.eclipse.core.resources.IFile)7 ProcessItem (org.talend.core.model.properties.ProcessItem)7 IRepositoryNode (org.talend.repository.model.IRepositoryNode)7 ArrayList (java.util.ArrayList)4 CoreException (org.eclipse.core.runtime.CoreException)4 ConnectionItem (org.talend.core.model.properties.ConnectionItem)4 Item (org.talend.core.model.properties.Item)4 RepositoryNode (org.talend.repository.model.RepositoryNode)4 INode (org.talend.core.model.process.INode)3 IProcess2 (org.talend.core.model.process.IProcess2)3 IOException (java.io.IOException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 HashMap (java.util.HashMap)2