Announcement Announcement Module
Collapse
No announcement yet.
Spring integration visual editor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring integration visual editor

    I have a question about using the STS visual editor for Spring Integration. I am using STS 2.7.2 with Spring Integration 2.0. The visual editor seems a bit buggy. Many times when I try to drag an item from a pallette and drop it on the page, the item does not show in the page. When I go to view the source, it does not show there either. However if I make any changes to the source, they do show up in the visual editor. Is there a trick to the drag and drop?

  • #2
    If you attempt to drag a part onto the graph that might result in bad XML, the visual editor will not accept the drop. However, if you're able to make the same edits in the source page then there must be some other issue at play. Do you get any entries in your error log when you try to use the visual editor? If not, then do you have a configuration that can reliably reproduce the error that you can share with me?

    Leo Dos Santos
    Committer, SpringSource Tool Suite

    Comment


    • #3
      Here is my config

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans:beans xmlns="http://www.springframework.org/schema/integration"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xmlns:beans="http://www.springframework.org/schema/beans"
      	xmlns:int="http://www.springframework.org/schema/integration"
      	xmlns:stream="http://www.springframework.org/schema/integration/stream"
      	xmlns:amqp="http://www.springframework.org/schema/integration/amqp"
      	xmlns:context="http://www.springframework.org/schema/context"
      	xmlns:mail="http://www.springframework.org/schema/integration/mail"
      	xmlns:ws="http://www.springframework.org/schema/integration/ws"
      	xmlns:int-http="http://www.springframework.org/schema/integration/http"
      	xmlns:oxm="http://www.springframework.org/schema/oxm"
      	xmlns:int-xml="http://www.springframework.org/schema/integration/xml"
      	xmlns:int-xmpp="http://www.springframework.org/schema/integration/xmpp"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans
      			http://www.springframework.org/schem...-beans-3.0.xsd
      			http://www.springframework.org/schema/integration
      			http://www.springframework.org/schem...ration-2.0.xsd
      			http://www.springframework.org/schem...gration/stream
      			http://www.springframework.org/schem...stream-2.0.xsd
      			http://www.springframework.org/schema/context 
      			http://www.springframework.org/schem...ontext-3.0.xsd
      			http://www.springframework.org/schema/integration/amqp
      			http://www.springframework.org/schem...n-amqp-2.1.xsd
      			http://www.springframework.org/schema/integration/mail
      			http://www.springframework.org/schem...n-mail-2.0.xsd
      			http://www.springframework.org/schema/integration/ws
      			http://www.springframework.org/schem...ion-ws-2.0.xsd
      			http://www.springframework.org/schema/integration/http
      			http://www.springframework.org/schem...n-http-2.0.xsd
      			http://www.springframework.org/schema/oxm
      			http://www.springframework.org/schem...ng-oxm-3.0.xsd
      			http://www.springframework.org/schema/integration/xml
      			http://www.springframework.org/schem...on-xml-2.0.xsd
      			http://www.springframework.org/schema/integration/xmpp
      			http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp-2.0.xsd">
      
      	<amqp:inbound-channel-adapter queue-names="queue.requestqueue"
      		channel="inboundChannel" connection-factory="connectionFactory" />
      	<context:component-scan base-package="com.somepackage"/>
      
      
      	<int:channel id="inboundChannel">
      		<int:queue capacity="1000000" />
      	</int:channel>
      
      	<int:router input-channel="inboundChannel" expression="payload%2==0">
      		<int:mapping value="true" channel="evenChannel" />
      		<int:mapping value="false" channel="oddChannel" />
      	</int:router>
      	<int:channel id="oddChannel" />
      
      	<int:publish-subscribe-channel id="evenChannel"
      		apply-sequence="true" />
      
      	<int-http:outbound-gateway
      		url="http://www.mapquestapi.com/geocoding/v1/address?outFormat=xml&amp;location={location}"
      		http-method="GET" request-channel="evenChannel"
      		expected-response-type="javax.xml.transform.Source" reply-channel="geocodingChannelXML">
      		<int-http:uri-variable name="location"
      			expression="payload" />
      	</int-http:outbound-gateway>
      
      	<int:channel id="geocodingChannelXML" />
      	<oxm:jaxb2-marshaller contextPath="com.somepackage.traffic.jaxb"
      		id="trafficmarshaller" />
      	<int-xml:unmarshalling-transformer
      		unmarshaller="trafficmarshaller" input-channel="geocodingChannelXML"
      		output-channel="geocodingChannel" />
      
      	<int:channel id="geocodingChannel" />
      
      	<beans:bean
      		class="com.somepackage.springintegration.serviceactivators.BoundingBoxFactoryImpl"
      		id="boundingBoxFactory" />
      	<int:service-activator ref="boundingBoxFactory"
      		input-channel="geocodingChannel" output-channel="boundingBoxChannel" />
      
      
      	<int:channel id="boundingBoxChannel" />
      
      	<int-http:outbound-gateway
      		url="http://www.mapquestapi.com/traffic/v1/incidents?callback=handleIncidentsResponse&amp;boundingBox={boundingBox}&amp;filters=construction,incidents&amp;inFormat=kvp&amp;outFormat=xml"
      		http-method="GET" request-channel="boundingBoxChannel"
      		expected-response-type="javax.xml.transform.Source" reply-channel="trafficIssuesXML">
      		<int-http:uri-variable name="boundingBox"
      			expression="payload" />
      	</int-http:outbound-gateway>
      
      	<int:channel id="trafficIssuesXML" />
      
      	<oxm:jaxb2-marshaller contextPath="com.somepackage.traffic.incident.jaxb"
      		id="trafficincidentmarshaller" />
      	<int-xml:unmarshalling-transformer
      		unmarshaller="trafficincidentmarshaller" input-channel="trafficIssuesXML"
      		output-channel="trafficAndWeatherChannelUnaggregated" />
      
      	<int:channel id="trafficAndWeatherChannelUnaggregated" />
      
      
      	<int:aggregator input-channel="trafficAndWeatherChannelUnaggregated"
      		output-channel="trafficAndWeatherChannel" />
      
      
      	<int-http:outbound-gateway
      		url="http://www.google.com/ig/api?weather={location}" http-method="GET"
      		request-channel="evenChannel" expected-response-type="javax.xml.transform.Source"
      		reply-channel="weatherXML">
      		<int-http:uri-variable name="location"
      			expression="payload" />
      	</int-http:outbound-gateway>
      
      
      	<int:channel id="weatherXML" />
      	<oxm:jaxb2-marshaller contextPath="com.somepackage.weather.jaxb"
      		id="weathermarshaller" />
      	<int-xml:unmarshalling-transformer
      		unmarshaller="weathermarshaller" input-channel="weatherXML"
      		output-channel="trafficAndWeatherChannelUnaggregated" />
      
      
      	<int:channel id="trafficAndWeatherChannel" />
      
      	<beans:bean id="mailMessageBuilder"
      		class="com.somepackage.springintegration.serviceactivators.MailMessageBuilderImpl" />
      	<beans:bean id="mailSplitter"
      		class="com.somepackage.springintegration.splitters.MailMessageSplitter" />
      	<int:chain input-channel="trafficAndWeatherChannel"
      		output-channel="messageChannel">
      		<int:service-activator ref="mailMessageBuilder" />
      		<int:splitter ref="mailSplitter" />
      		<mail:header-enricher>
      			<mail:from value="[email protected]" />
      			<mail:reply-to value="[email protected]" />
      			<mail:subject value="Hello" />
      		</mail:header-enricher>
      	</int:chain>
      	<int:publish-subscribe-channel id="messageChannel">
      		<int:interceptors>
      			<int:wire-tap channel="wiretapChannel" />
      		</int:interceptors>
      	</int:publish-subscribe-channel>
      	<int:chain input-channel="messageChannel" output-channel="imchannel">
      		<int:filter expression="payload?.to[0] matches '.*nonexistentdomain[.]com'"/>
      		<int:header-enricher>
      			<int:header name="xmpp_chatTo" expression="payload.to[0]"></int:header>
      		</int:header-enricher>
      		<int:transformer expression="payload.text.substring(0,1999)"/>
      	</int:chain>
      	<int:channel id="imchannel"/>
      	<int-xmpp:outbound-channel-adapter xmpp-connection="googleTalkConnection"  channel="imchannel"/>
      
      
      	<mail:outbound-channel-adapter host="mailout.someaddress.com"
      		channel="messageChannel" />
      	<int:publish-subscribe-channel id="wiretapChannel" />
      	<stream:stdout-channel-adapter channel="wiretapChannel" />
      	<int:logging-channel-adapter level="WARN" channel="wiretapChannel"/>
      	<context:property-placeholder location="classpath:xmpp.properties" />
      
      	<beans:bean id="dummySocketFactory" class="org.jivesoftware.spark.util.DummySSLSocketFactory"/>
      
      	
      	<stream:stdout-channel-adapter channel="oddChannel"/>
      </beans:beans>

      Comment


      • #4
        Fixed it.

        I later noticed that the ide was only blocking putting certain components on the page. The ones it was blocking were the Channels, Routing, Transformation and Endpoints. Knowing that the editor is driven off of what schemas are included, I changed the 2nd line from:

        Code:
        <beans:beans xmlns="http://www.springframework.org/schema/integration"
        to:

        Code:
        <beans:beans xmlns="http://www.springframework.org/schema/beans"
        and it worked. Now I am able to put components in the page.

        Comment


        • #5
          Great that you found a workaround!

          In your file you've declared the Spring Integration schema twice, first as:

          Code:
          xmlns="http://www.springframework.org/schema/integration"
          and then again as:

          Code:
          xmlns:int="http://www.springframework.org/schema/integration"
          It's the duplicate declaration that's confusing the visual editor. Normally you'd only need to declare the import once, but if this case works with the XML editor then we should try to ensure that it works with the visual editor as well.

          Comment

          Working...
          X