Uploaded image for project: 'Fuse Tooling'
  1. Fuse Tooling
  2. FUSETOOLS-1409

swithing between "design view" and "source view" rewrite camel context xml file

    XMLWordPrintable

Details

    • Workaround Exists
    • Hide

      Use <description> tags to save such comments. This has also the benefit that you see those comments in the properties view of the editor in the "Description" field.

      Example:

      <log message="The message contains ${body}">
         <description>here will set the message</description>
      </log>
      
      Show
      Use <description> tags to save such comments. This has also the benefit that you see those comments in the properties view of the editor in the "Description" field. Example: <log message="The message contains ${body}"> <description>here will set the message</description> </log>

    Description

      At the beginning the camel context xml is as below, note the comment position.

      <!-- try to set body here -->
      <!-- here will set the message-->
      

      The camel context xml is as below,

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:osgi="http://www.springframework.org/schema/osgi"
             xsi:schemaLocation="
             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
             http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
      
        <bean id="helloBean" class="com.mycompany.camel.spring.dm.HelloBean">
            <property name="say" value="Hi from Camel"/>
        </bean>
      
        <camelContext xmlns="http://camel.apache.org/schema/spring">
        <route>
          <from uri="timer:foo?period=5000"/>
          <!-- try to set body here -->
          <setBody>
            <method ref="helloBean" method="hello"></method>
          </setBody>
          <!-- here will set the message-->
          <log message="The message contains ${body}"/>
        </route>
      </camelContext>
      
      </beans>
      

      I just clicked the "design view" and then "source view" several times, all the comments are put before <camelContext>.

      ==>

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:osgi="http://www.springframework.org/schema/osgi"
             xsi:schemaLocation="
             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
             http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
      
        <bean id="helloBean" class="com.mycompany.camel.spring.dm.HelloBean">
            <property name="say" value="Hi from Camel"/>
        </bean>
      
        <!-- try to set body here --><!-- here will set the message--><camelContext xmlns="http://camel.apache.org/schema/spring">
        <route>
          <from uri="timer:foo?period=5000"/>
          <setBody>
            <method ref="helloBean" method="hello"></method>
          </setBody>
          <log message="The message contains ${body}"/>
        </route>
      </camelContext>
      
      </beans>
      

      Attachments

        Activity

          People

            lheinema@redhat.com Lars Heinemann
            rhn-support-xiwu Xiaohui Wu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: