Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Dynamically changing an existing dataconnection's server / port

Avatar

Former Community Member

Hi All,

Moving from one development environment to the next is sometimes a real pain.

Scenario:

- I have three environments: DEV, QA & PROD

- I have a livecycle designer pdf - FORM A - that has the following dataconnection: http://DEVserver:8080/....

- When I move FORM A from DEV to QA, i need to update the dataconnection to http://QAserver:8090/...

- When I move FORM A from QA to PROD, I need to update the dataconnection (again) to http://PRODserver:7890/...

1) this is a pain

2) this is a nightmare, when you have multiple dataconnections and many forms.

Proposed Solution, that I need input on.

The binding XML, will pass in the server name and required port number.

Then via code, I change the server & port of an existing dataconnection dynamically.

I tried:

WebserviceCallButton.event__click.submit.target = "http://" + vServer + ":" + vPort + vURLCall;

However, it does not allow the change.

Am I missing something?

ANY INPUT OR ALTERNATIVE IDEAS

Thanks alot in advance.

I thought of maybe a trying to wrap a dataconnection into a fragment... no luck!

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Note that you do not want to cahnge the submit URL but the soapAddress......but that is protected too. The soapAddress is not a bindable property but you get get the value from a bound hidden field or you can get the address from the data dom yourself.

Either way the issue is with Acrobat security .....it will not allow you to modify the soap address on the fly. The dom which holds this information is protected (for security reasons). So we can clone it and use the cloned connection and change that address. Here is some code which does that:

//xfa.connectionSet.DataConnection.soapAddress.value

var

oCS = xfa.connectionSet.DataConnection.clone(1);

app.alert(oCS.soapAddress.value);

//app.alert(xfa.connectionSet.DataConnection.soapAddress.value)

oCS.soapAddress.value

= "http://pgdell:8080/soap/services/WebServiceTest";

app.alert(oCS.soapAddress.value);

oCS.execute(0);

Hope that helps

Paul

View solution in original post

3 Replies

Avatar

Correct answer by
Former Community Member

Note that you do not want to cahnge the submit URL but the soapAddress......but that is protected too. The soapAddress is not a bindable property but you get get the value from a bound hidden field or you can get the address from the data dom yourself.

Either way the issue is with Acrobat security .....it will not allow you to modify the soap address on the fly. The dom which holds this information is protected (for security reasons). So we can clone it and use the cloned connection and change that address. Here is some code which does that:

//xfa.connectionSet.DataConnection.soapAddress.value

var

oCS = xfa.connectionSet.DataConnection.clone(1);

app.alert(oCS.soapAddress.value);

//app.alert(xfa.connectionSet.DataConnection.soapAddress.value)

oCS.soapAddress.value

= "http://pgdell:8080/soap/services/WebServiceTest";

app.alert(oCS.soapAddress.value);

oCS.execute(0);

Hope that helps

Paul

Avatar

Former Community Member

legendry response...

makes sense why they wouldn't want one to change the "set" dataconnection.

thanks for this...

will try it on monday!

Avatar

Level 2

I am so new to adobe designer and just figuring things out.

Did this solution work for you and where did you place the script to do this?

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----