Update a project from the deprecated Databindings to App Connect

Since I am upgrading a website from the deprecated Databindings to AppConnect just posting some quick notes in case someone finds them useful.

So follow these steps
1.Fist of all before doing anything save a copy of your old website
2.All you have to do is to update each file separately.
2a. Open a file you want to upgrade from Databings to Appconnect
2b. Locate any databindings related code inside the <head> and comment it (yes comment it don’t delete yet)
For example:

<script type="text/javascript" src="ScriptLibrary/dmxDataBindings.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataSet.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataFilters.js"></script>
<script type="text/javascript">
/* dmxDataSet name "dsGetEmails" */
       jQuery.dmxDataSet(
         {"id": "dsGetEmails", "url": "dmxDatabaseSources/dsGetEmails.php?youremail={{$FORM.youremail}}&limit=", "dataSourceType": "database", "dataType": "jsonp"}
       );
  /* END dmxDataSet name "dsGetEmails" */
  /* dmxDataSet name "dsGetCurrentCourse" */
       jQuery.dmxDataSet(
         {"id": "dsGetCurrentCourse", "url": "dmxDatabaseSources/dsGetCurrentCourse.php?c={{$URL.c}}&limit=25", "dataSourceType": "database", "dataType": "jsonp"}
       );
  /* END dmxDataSet name "dsGetCurrentCourse" */
</script>
	<script type="text/javascript" src="ScriptLibrary/dmxDatabaseAction.js"></script>

You want to comment this code so you have a reference on what it needs to be created in AppConnect
3.Add Appconnect to the page
4.Create all ServerConnect and AppConnect actions needed.
4a. Also apply jquery from the AppConnect UI. It will replace the old scriptlibrary/jquery with the new one inside the code.
5.Look inside the <body> and find any references to the databindings. Apply the equal AppConnect binding and then delete the Databinding one (for example this was a databinding {{dsGetCurrentCourse.data[0].glossiki_course_name}} Just apply the Appconnect binding and then delete the deprecated Databinding.
6.If any images etc used replace the src with the dmx-bind:src="", or any dynamic image meta-tag like tiltle and alt , replace them with the dmx-bind:title="" anddmx-bind:alt=""
7.Look inside the code and delete any other reference to the Databindings actions. For example

  <script type="text/javascript">
  /* dmxDatabaseAction name "insertemail" */
       jQuery.dmxDatabaseAction(
         {"id": "insertemail", "url": "../dmxDatabaseActions/insertEmailAction.php", "data": {"mail_email": "{{$FORM.youremail}}", "mail_day_subscribed": "{{$FORM.dateAdded}}"}, "beforeSend": "dmxNotifyAction({\"type\": \"info\", \"title\": \"Αποστολή\", \"msg\": \" \", \"extendedTimeOut\": 2000, \"tapToDismiss\": false});", "success": "dmxNotifyAction({\"title\": \"Ευχαριστούμε!\", \"msg\": \"Το email σας καταχωρήθηκε με επιτυχία\", \"extendedTimeOut\": 2000, \"tapToDismiss\": false});MM_setTextOfTextfield('youremail','','');", "error": "dmxNotifyAction({\"type\": \"warning\", \"title\": \"Δοκιμάστε ξανά\", \"msg\": \"Η καταχώριση δεν μπόρεσε να ολοκληρωθεί\", \"extendedTimeOut\": 2000, \"tapToDismiss\": false});"}
       );
  /* END dmxDatabaseAction name "insertemail" */
</script>     
  1. Once done with changing any reference to the Databings with the AppConnect, upload dmxAppConnect, dmxConnect, dmxConnections, dmxConnectLib folders on the server and also the file you have just updated.
  2. Test it and if it does not work, check the console for errors. If there is any reference to dmxDatabaseActions in the console just make a search inside the file and delete it.
  3. Retry and if it works the delete all the commented code in step 2
  4. Upload and retry. If it works this is it. Well done!

Thank you

Community Page
Last updated: