Extending Archetype entity.SMSConfig EmailClickatell.1.1

I was trying to add the Sender ID function into the custom archetype designed for Clickatell...however I ran into a slight hitch.... I added a new string node.  senderId, which worked and I adjusted the textexpression concat to read... >'concat("user:", $user,"password:", $password, "\n","api_id:", $apiId,"to:", >$phone,"from:", $senderID,reply:", $replyTo,"text:", replace($message, >"","text:"))' > however changing the concat broke something ...I compared it too the orignal archetype and I am now assuming to had some hidden chars I couldnt see. I attempted to change the adl and reload Message from benjamin.charlton@ascotvetsurgery.com.au benjamin.charlton@ascotvetsurgery.com.au I was trying to add the Sender ID function into the custom archetype designed for Clickatell...however I ran into a slight hitch.... I added a new string node.  senderId, which worked and I adjusted the textexpression concat to read... >'concat("user:", $user,"password:", $password, "\n","api_id:", $apiId,"to:", >$phone,"from:", $senderID,reply:", $replyTo,"text:", replace($message, >"","text:"))' > however changing the concat broke something ...I compared it too the orignal archetype and I am now assuming to had some hidden chars I couldnt see. I attempted to change the adl and reload the concat but that doesnt work either >node name="textExpression" path="/details/textExpression" >type="java.lang.String" minCardinality="1" hidden="true" >              defaultValue="'concat("user:", $user, >" password:", $password, " api_id:", $apiId, >" to:", $phone, " reply:", $replyTo, >" from:", $senderID, " text:", replace($message, >" "," text:"))'"/> > was what I tried.. I realize that is the code for a line return byte wise, but somehow its getting stripped or modifed when I edit the archetype in the interface as well as with a text editor on the adl...of course I can see the final replace is supposed to replace line returns with a "text:" and new line.   Any tips, I was editing the .adl files using a simple notepad program maybe thats not the best way. _______________________________________________ OpenVPMS User Mailing List users@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/users Posts from this mailing list can be viewed online and replied to in the OpenVPMS User's forum- http://tinyurl.com/openvfu

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Extending Archetype entity.SMSConfig EmailClickatell.1.1

When you edit the .adl file, you need to escape the quotes (") and line feeds (
).

Clickatell requires each field to be on a new line, hence the 
 characters.

Note that there is also a variable $nl, which you can use in place of 
.

Your node above should look something like:

        <node name="textExpression" path="/details/textExpression" type="java.lang.String" minCardinality="1" hidden="true"
              defaultValue="'concat(&quot;user:&quot;, $user, &quot;&#xA;password:&quot;, $password, &quot;&#xA;api_id:&quot;, $apiId, &quot;&#xA;from:&quot;, $senderID, &quot;&#xA;to:&quot;, $phone, &quot;&#xA;reply:&quot;, $replyTo, &quot;&#xA;text:&quot;, replace($message, &quot;&#xA;&quot;,&quot;&#xA;text:&quot;))'"/>

Also note that the case of the node must be the same as that of the variable name - i.e senderId and $senderId or senderID and $senderID

-Tim

Re: Extending Archetype entity.SMSConfig EmailClickatell.1.1

Thanks Tim, I figured as much, It must have been a language/rendering issue with the notepad program I was using because even when I used a copy and past technique to modify the concat the Line feeds were simply not importing...and I would end up with the concat missing the \n.  I ended up going in with mysql admin to directly edit the mysql database and insert the concat I needed and its working well.

I probably need a better ADL editting program...I was actually using Notepad++ which has language specific setups.

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au
Syndicate content