XML- Edit according to feature - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Jimmy
Posts: 36
Joined: Thu Apr 12, 2012 1:13 pm

XML- Edit according to feature

HI there

I try to resolve the following problem:
I should insert route descriptions (Enterprise Intergration pattern things) into an xml file according to a selection and configuration the customer does while UI Stage.
The routes could have different properties like e.g. :
route #1:

Code: Select all

		<route autoStartup=[ROUTE1_AUTOSTART]>
			<description>[ROUTE1_DESC]</description>
			<from uri="file://[ROUTE1_SOURCEPATH]?consumer.delay=5000&preMove=.process&move=../.done&moveFailed=../.error"/>
			<to uri="bean:[ROUTE2_ENRICHBEAN]" />
			<convertBodyTo type="byte[]" inheritErrorHandler="true" />
			<to uri="activemq:[ROUTE1_QUEUE]?priority=5" inheritErrorHandler="true" />
		</route>
route 2:

Code: Select all

		<route autoStartup=[ROUTE2_AUTOSTART]>
			<description>[ROUTE2_DESC]</description>
			<from uri="file://[ROUTE2_SOURCEPATH]?consumer.delay=5000&preMove=.process&move=../.done&moveFailed=../.error"/>
			<to uri="bean:[ROUTE2_ENRICHBEAN]" />
			<convertBodyTo type="byte[]" inheritErrorHandler="true" />
			<to uri="activemq:[ROUTE2_QUEUE]?priority=5" inheritErrorHandler="true" />
		</route>
route 3:

Code: Select all

		<route autoStartup=[ROUTE3_AUTOSTART]>
			<description>[ROUTE3_DESC]</description>
			<from uri="file://[ROUTE3_SOURCEPATH]?preMove=.process&move=../.done&moveFailed=../.error&delay=10000"/>
			<to uri="ftp://[ROUTE3_FTPUSER]@[ROUTE3_FTPSERVER][ROUTE3_FTPPATH]?password=[ROUTE3_FTPUSERPSSWD]&binary=true&passiveMode=true&disconnect=true"/>
		</route>
route 4:

Code: Select all

		<route autoStartup=[ROUTE4_AUTOSTART]>
			<description>[ROUTE4_DESC]</description>
			<from uri="ftp://[ROUTE4_FTPUSER]@[ROUTE4_FTPSERVER][ROUTE4_FTPPATH]?password=[ROUTE4_FTPUSERPSSWD]&include=.*?pri.csv&passiveMode=true&delay=60000&preMove=.process&move=../.done&moveFailed=../.error"/>
			<to uri="file://[ROUTE4_SINKPATH]"/>
		</route>		
How can I achieve, that those routes are only written, if the mean features are selected (could be some other thing like a checkbox instead of a feature)?
How can I do xml writes depending on properties? Any other highly welcomed ideas? :) :oops:

Thanks in advance

Jimmy
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: XML- Edit according to feature

Hi Jimmy,

Unfortunately you cannot condition an element entry of your XML file within the XML editor.

Each of the above examples should be an XML update.
You can try to condition each XML update's component from the "XML File Install Tab". Simply associate each XML update with a component and then, from the Organization page, add a "Condition" for each component. Each condition can of course include a reference to a public property( e.g MY_CHECKBOX_PROPERTY ) attached to a checkbox control.

Since the updates have the same name and need to be installed in the same location, here's the "How do I install two files with the same name in the same folder?" article you can follow.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Jimmy
Posts: 36
Joined: Thu Apr 12, 2012 1:13 pm

Re: XML- Edit according to feature

Hi Mihai

Thank you very much for your suggestion.
Meanwhile (after some thinking, of course), I came to the same conclusion, and will give it a try, next time I get a little time for this installer.

Best regards
Jimmy

Return to “Common Problems”