LiveCode Apps integration with Joomla or Wordpress

Interested adding compiled externals from LiveCode and third parties to your LiveCode projects? This is the place to talk about them.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
denzio
Posts: 6
Joined: Sat Oct 05, 2013 9:02 am

LiveCode Apps integration with Joomla or Wordpress

Post by denzio » Sat Oct 05, 2013 9:28 am

Hi,

Please forgive my innocence in asking this matter. Does anyone know how to Integrate livecode apps to my existing Joomla/wordpress website with eCommerce features and functionality?

for example,

I have a joomla or wordpress website and I want to show all the contents especially my ecommerce page where user can see each product details and also user can do purchase using the mobile apps.
screetshot.jpg

Appreciate for any guidance.

Denzio

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: LiveCode Apps integration with Joomla or Wordpress

Post by bangkok » Sat Oct 05, 2013 3:45 pm

Joomla and Wordpress both support XML-RPC (webservices).

So the answer is... YES. :)

From LiveCode Desktop (Windows, MacOS, Linux) you can "pilot" your web app, using the XML-RPC protocol.

If you know nothing about it, you'll have to suffer a little bit, in order to learn :

-XMLRPC library and XML tags, and probably XML library
-arrays and how to manipulate them
-UTF8 (rich text)
-and probably datagrids (to display large informations coming from your web app)

-last but not least the XML API of Joomla and Wordpress ! ( = names of commands + syntax + required parameters)

etc.

For Mobile, it's.... more tricky because the XMLRPC library is missing. But you can bypass the problem by using direct POST queries sent to the web server (by creating first the proper http header then the XML query that will be sent).

denzio
Posts: 6
Joined: Sat Oct 05, 2013 9:02 am

Re: LiveCode Apps integration with Joomla or Wordpress

Post by denzio » Sun Oct 06, 2013 7:14 am

Hi bangkok,

Thank you so much for your guidance. Any advice for me to find it more about "For Mobile, it's.... more tricky because the XMLRPC library is missing. But you can bypass the problem by using direct POST queries sent to the web server (by creating first the proper http header then the XML query that will be sent)." I need to find out more about it coz most of my previous project are using joomla and wordpress.

Best regards,

Denzio

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: LiveCode Apps integration with Joomla or Wordpress

Post by bangkok » Sun Oct 06, 2013 8:45 am

So you want to developp for mobile, right ? IOS or Android ?

Anyway :

-the first thing you need to do is to find a simple command (using XMLRPC) from the API of Joomla or Wordpress. Read their documentation.

-then in your stack, use the XMLRPC library in order to send the query (you need IP address of the server, port number, and path)

Example of a basic query, very simple, without any parameter.

Code: Select all

 put revXMLRPC_CreateRequest("36.255.255.12","8079","xmlrpc/common","http") into rpc_id -- Create the initial connection.
   revXMLRPC_SetMethod rpc_id, "get_server_environment" -- Specify the method to call, from the API of Joomla or Wordpress
   put revXMLRPC_Execute(rpc_id) into result_id -- Submit & get the results.
   put revXMLText (result_id) into tResult
   answer tResult
   if revXMLRPC_Documents() is not empty then revXMLRPC_DeleteAllDocuments
Usually a XMLRPC query must be sent with parameters. For that, use revXMLRPC_AddParam

Code: Select all

 put revXMLRPC_CreateRequest("36.255.255.12","8079","xmlrpc/common","http") into rpc_id -- Create the initial connection.
   revXMLRPC_AddParam rpc_id, "string", "MyFirstString" --this is the parameter, a string that contains "MyFirstString
   revXMLRPC_SetMethod rpc_id, "get_my_name" -- Specify the method to call, from the API
   put revXMLRPC_Execute(rpc_id) into result_id -- Submit & get the results.
   put revXMLText (result_id) into tResult
   answer tResult
   if revXMLRPC_Documents() is not empty then revXMLRPC_DeleteAllDocuments
Now... Eventhough the name is scary, a XMLRPC query is nothing else than :
-a http header
-a message in XML (with XML tags)

... a long string of text !

So, in the first query, here is the raw data that are basically sent to the server.

Code: Select all

POST http://36.255.255.12:8079/xmlrpc/common HTTP/1.1
Host: 36.255.255.12:8079
User-Agent: LiveCode/5.5.3 (Win32)
Content-Length: 104
Content-Type: text/xml

<?xml version="1.0"?>
<methodCall><methodName>get_server_environment</methodName><params/></methodCall>
It's easy to "emulate" those data, and send them to the server using special header and a POST.

Code: Select all

set the httpheaders to fld "header"
post tXML to url tServer
answer it
I remind you that the XMLRPC library is missing -currently- for IOS and Android. So, this is the only way.

A tip :
-use XMLRPC library to build your queries in Livecode Desktop
-then install fiddler (a very good trafic analyser, with a proxy)
-send your queries
-fiddler will display the "raw data" sent to the server (with header and content, and even the answer from the server, again with header and content)
-it will give you a clear view and understanding of what to do in order to create in raw text your XMLRPC queries

Watch out, this work can be tedious... especially for queries with many parameters...

Plus you'll have to work again in order... to decode/analyze the answers from the server... Because it will be XML strings. For that : XML library and arrays.

So basically, if you start from scratch... you'll need time. And some pain.

But it's working fine.

Post Reply

Return to “Using Externals”