How do I connect to an external API using Joomla 1.5? - web-services

I want to connect to an external API from my joomla website.
The external api is a reservation system which I would like to view info and update content. They have provided a URL for testing as well as documentation of the various functions available.
Not sure what to do from here. I have built many Joomla components before but never had time to learn XML-RPC and how it works.
I have looked at mastering Joomla 1.5 extensions and framework development but couldn't get what I wanted from it. Any help appreciated.

If you have built MVC components in the past, then the hard part is done. XML-RPC is not all that different from a typical cURL request in that you build a set of parameters that are sent to a remote server that then returns a response. The main difference is that the request and response are formatted in XML. There is a pretty good overview here - http://www.phpbuilder.com/columns/luis20010329.php3?print_mode=1

If you want to connect to an external link from your joomla, you can modify the link type (menu item) to "wrapper" (Displays an iframe to wrap an external page or site into Joomla! ), when you are done, in the right side there are some Basic parameters, you can write there the link, and add the width and height to it.

Related

Does joomla/jomsocial provides webservices/API to their core functionality?

I am developing mobile apps using phonegap.
My mobile app will have same functionality as like my joomla-jomsocial website.
I have to access web services using jQuery.ajax as I am using javascript and html only.
Are there any ready web services or APIs in joomla-jomsocial?
Joomla! only recently formed a working group for "Web Services" and I think you won't see any outcomes from that for a while.
As #Riccardo Zom, say your best bet will be to access the barest formats you can from each component type using the format/tmpl parameters.
If you're motivated enough you could extend existing components (core and otherwise) to return the desired format (e.g. json), in that case you should read Louis Landry's note on the changes from 1.5 era XML-RPC feature set to the 1.6/2.5 mechanism.
If you're still looking after that you may be interested in the "Joomla! API - Generic RESTful API framework for Joomla! 2.5" by Rafael Corral, it's a component (com_api) that provides a framework for creating a RESTful API for a Joomla! 2.5 site.
Unless you want to rewrite the whole component logic in your html app, you might be happy with grabbing the component output without all the extra page markup i.e. get the bare html returned from the component: just add &format=raw to the query; if you want libraries and css to be returned as well, instead add &tmpl=component
There is also (limited) support for &format=json in some core components.

Beginning Webservice with Joomla

I am new to joomla 2.5. I need to design application which is to be used by STB(SET TOP BOX) or TV Application. Is it possible to use below features with Joomla 2.5 ?
Authenticate users where credentials are passed from STB or TV via POST method.
Calling Webservices after authentication, custom string format needs to be return instead of JSON or XML.
Is it possible to host file with encryption from developed administrator component ?
Any Ideas? Any good beginners book for Joomla 2.5 ?
Thanks.
yes if you previously download the login page and grab the token, which is a dynamic security feature
no problem there, just make sure you end your controller method with
exit
so the template won't be output.
I can't figure out what you mean. Encrypted files will not be accepted on the Joomla Extension Directory, but you can use them in custom components.
Beginners books: really depends on your php and overall development experience. The reference and plenty of guides are on docs.joomla.org (section developers), but check here first for any questions, there are plenty of answers on Joomla!

REST Server, Delphi and Web Services - Advice needed

I am looking on advice on how best to approach a new project I need to develop. From the outset I must add, I have 0 experience with Web development on any level.
What I need to do is provide a web interface through the browser which will communicate with a server back end. The data retrieved will be sourced from either a DB or from another source - external device which the server itself will communicate with via IP. The data retrieved from the external device will always be a string format of n length (non unicode) and the DB data will mostly be strings and numbers with the odd blob thrown in (storing a picture). The communication will always go from the Client (web browser) to the Server. I don't believe that the server would need to instigate the comms.
I have Delphi XE, so started looking at using a REST server for communication and I think that seems to be OK. However, from what I can see, I need to create HTML web pages to "render" the data on the web browser. Is that true? Can I use the IW components with a REST server? If so, I'm not sure how to get the data to/from the browser UI. Am I better of investigating Ruby on Rails perhaps? From what I read on a different thread in here, it's based on MVC and some other areas which I feel, design wise, would fit how I would create the application (I was planning on creating the app based on the MVP or similar design pattern).
I think REST makes the most sense, so if the IW components can't be used, are there any 3rd party products I can use which would let me design "pretty" UI html. Given I don't know java script, would that be a stumbling block with REST too.
Thanks and hopefully I have provided enough information.
Thanks
Jason
Will a human being be responsible for typing the data retrieved from your external device into a web page?
If so, and you have no web development experience, Intraweb is definitely the way to go for Delphi programmers wanting to build a web application without learning new skills. For additional components to create a prettier UI I suggest using TMS Software's Intraweb Component Pack Pro.
If you don't need a human being to manually type in this data then you don't need Intraweb at all. Instead you would write a client application which presumably interrogated your external device for the data and then transmitted it to the REST server. Look at the documentation you've used to build your REST server and it should have a section on how to build a REST client.
You can build an ISAPI module with delphi that does the job, or include a HTTP server right into you executable with Indy, ICS or Synapse.
ISAPI will give you the freedom to choose Apache or IIS and give you all their power this way. Embeded HTTP server will give you a nice small application in which you control all ascpects of how it works.
Yes go with REST as it is simple and clean. All you need is to think and design the API (functions that your server will support). You can bind the APIs to the URL schema thus using the REST principle. I would do it simply like this.
A client makes a request. You show some form of GUI (load or render a HTML page with possible javascript)
User makes an action, you call appropriate API (or the user does it directly).
Show the user some result
Just guide the user process through a series of API calls until the result is made
You can use plain HTML and then add javascript if needed (jquery) or you can use ExtJS from Sencha which makes building a nice GUI a lot easier and is very well structured.
I would not use any "WYSIWYG" web tools. Plain old HTML written by your favorite editor is still the king in my opinion.

HTML5 Offline storage web framework

I am looking for a web app framework which can automatically generate an HTML5 offline storage based app, so while the users become disconnected they still can view the data which normally is stored on a server
Also currently I am using Django and it would be great if there was a framework which could pull data from Django and present that as an offline app.
From the related questions suggested by stackoverflow, while writing this question, I found one interesting link mentioning that GWT has such functionality, I would like to know more about that if possible and if it can generate an HTML5 offline app
Thanks in Advance
Rather than server-side frameworks, you should be taking a look at JavaScript frameworks.
Dojo Storage will transparently select between providers such as Google Gears, Adobe AIR or plain old HTML 5 local storage. Dojo 1.5 - dojox.storage: http://dojotoolkit.org/api/1.5/dojox/storage
There's also jQuery local storage: http://plugins.jquery.com/project/saveit
... or jStorage, which can act as a storage plugin for jQuery, Prototype or MooTools: http://www.jstorage.info/
With any of these, you should be able to use a quick little AJAX call to pull (JSON perhaps) data from your server and use one of these tools to help minimise your storage code.
You're talking about a standalone app, not a django app.
This can be done with javascript (jQuery, Sproutcore, JavascriptMVC, Pyjamas ...) or Adobe AIR, or...
Pulling data from Django is just a matter of setting up a syncing method, most probably using JSON, to fill up the browser local storage. So this is not django-specific at all.
If you want a standalone django app, this can be done if you bundle in a python desktop app django with a built-in server, that's another question
You could suggest the users to create web apps or use google gears instead... I don't know if this will fill the question, but, i'm in the same way. However, I'm developing an governamental solution who will run only for some kind of people, so, I can have a few control about the user's environment... All you need to do is to use jquery to detect if user has a live connection, or offer to the users a 'preferences' page where you define the behavior of the page itself...
Some info about offline cache: http://diveintohtml5.ep.io/offline.html
PS.: In another post in stackoverflow, I 've found another question: html5 offline caching with php driven sites... The last Post said:
HTML5 offline caching does not work to make your pages interact; it works only to make a
particular page available offline. Basically, it works on a URL-by-URL basis. If you
absolutely need offline functionality, you will be forced to make it work in JS.
Also, make sure your manifest includes all resources used by all pages.
Hope this helps!
Hope it helps!!

Integrating smartgwt and web2py

I'd like to build an application using smartgwt and web2py.
I am new to both.
Ultimately what I would like to do is display objects obtained from a web2py backend in a smartgwt TileGrid.
Can anyone enumerate the broad strokes of what needs to be done? Or point me to any useful resources?
Any information that would apply more to django is also welcome.
download smartgwt (excellent framework by the way) and look into this example:
file://localhost/Users/massimodipierro/Desktop/smartgwt-1.0b1/samples/Showcase/www/com.smartgwt.sample.showcase.Showcase/index.html#tiling_load_on_deamnd
which displays images in a tilegrid. The images are received from Yahoo via an http request. The response is in JSON. Look into the source code. To see the json response from Yahoo try the following URL:
http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&output=json&query=snowboard
To make this work with web2py you need to replace that URL with the URL of a web2py action that returns a similar JSON response.
I do not know much about smartgwt but I am sure on the web2py google groups there are people willing to help.
Have a look at this tutorial on using web2py with Pajamas, which is another library built on GWT.