--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
You can just use a normal Joomla component and call it with the
format=raw parameter. You just need to make sure your component is well
written to ensure that it only sends the data after the user is well
authenticated. Joomla 1.6 makes it a little easier because you can use
the normal MVC patterns with different formats, but it's achievable in
1.5 as well.
Louis had a pretty good article on how it's done in 1.6. Good enough
that I had no trouble figuring it out, but I don't have it bookmarked
any more. Google for "Joomla 1.6 Louis webservice xmlrpc" or something
like that and you should find it.
Sincerely,
Brad Gies
-----------------------------------------------------------------------
Bistro Bot - Bistro Blurb
http://bgies.com
http://bistroblurb.com
http://ihottonight.com
http://forcethetruth.com
-----------------------------------------------------------------------
Everything in moderation, including abstinence
Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead
On 22/09/2010 11:36 AM, Oli Griffiths wrote:
>
> Hey all
>
> I'm needing to create a web accessible api for a component im
> creating. I need to be able to converse with the component securely
> and be able to send an retrieve data. The component will be hosted on
> a remote server and needs and api to insert/modify/delete/retrieve
> data and perform functions on that data. The component has a hosted
> frontend that users can use but I also want an api to I can integrate
> other joomla websites with it.
>
> What is the best and future proof way of doing this.
>
> I recall that xmlrpc is depreciated in 1.6 so is webservices a good
> way, perhaps soap? Can anyone point me in the right direction?
>
> Also, what is the best way to get a list of the articles out of a
> joomla site? I've used an xmrpc plugin that achieved it but wondered
> if this is the best way.
>
> Thanks
>
> Oli
>
>
> ------------------------------------------------------------------------
> Contact Organic Development:
> Telephone: 0845 869 7654
> Web: http://www.organic-development.com
> Email: in...@organic-development.com
> Twitter: http://twitter.com/growwithorganic
>
> ------------------------------------------------------------------------
> This email and any attachments to it may be confidential and are
> intended solely for the use of the individual to whom it is addressed.
> Any views or opinions expressed are solely those of the author and do
> not necessarily represent those of Organic Development Ltd.
> If you are not the intended recipient of this email, you must neither
> take any action based upon its contents, nor copy or show it to anyone.
> Please contact the sender if you believe you have received this email
> in error.
I currently have a Json layer that can respond with a json string from the component if format=json is called. Is json an acceptable format for an api?
Oli
I currently have a Json layer that can respond with a json string from the component if format=json is called. Is json an acceptable format for an api?
Oli
I don't use JSON for posting, but there is no reason you couldn't.
Actually, it would be a good way to write one entry point into your
webservice to accept the JSON and decode it, and if you added a field
for the function you want called, the webservice could just do the
security checks, decode the JSON, check that field, and use a switch
statement to pass the JSON on to the correct function, and then return
the results. I really don't think it saves much code however, because
you still need to write all functions. I normally do it the other way. I
write a function that does the security checks, and then call it from
every function written for the web service, but that's just personal
preference. There is no right or wrong way, and both are good designs.
Actually, I should have mentioned that in J 1.5, I normally just do
everything in the controller without the model and views. The code runs
a bit faster, but for 1.6, I do use the MVC pattern.
Sincerely,
Brad Gies
-----------------------------------------------------------------------
Bistro Bot - Bistro Blurb
http://bgies.com
http://bistroblurb.com
http://ihottonight.com
http://forcethetruth.com
-----------------------------------------------------------------------
Everything in moderation, including abstinence
Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead
--
On Sep 24, 4:35 pm, Dan Lopez <danlope...@gmail.com> wrote:There was indeed no xmlrpc-code published yet. On July 2 Louis has
> To be honest the XML-RPC code in joomla is not really even baked.
sent me a 11KB zip with his raw xmlrpc-code. As said, I had no time
yet to develop it further (probably, he neither).
The JWS-initiative is very interesting. At the moment it generates an
API-key and secret instead of using joomla user/password. However they
do intend to modify this functionality in the next release by using
the joomla username and password.
Nicholas (Akeeba) is working on a
JSON-based solution too (with his own authentication API). Rafael
(Dioscouri) is working with SOAP (which is natively available in
PHP5).
Nooku is working with REST and has done quite a lot allready
(but not on authentication/authorization).
I've been using some custom
solutions for data-exchange between Flash/Flex and Joomla!. In this
thread we see Oli looking in which direction he will work on a
solution. And there probably will be dozens of other initiatives. For
connecting Joomla! with other applications will become more and more
wanted.
What I would like, is a basic framework solution upon which we can all
build further, instead of all of us reinventing the same wheel. A
solution that uses methods for authentication and authorization that
can be used in all extensions throughout the CMS *and* with
webservices. A general, basic solution: that is exactly what a
framework is meant for. Authentication and authorization are basic
tasks and should be built very carefully: if it is done well, many
future security issues will be avoided. I was happy to read that JWS
was now also looking in the direction of using the Joomla! username
and password.
It might be a good idea to join forces.
I'm not sure I'm being clear... but maybe all that is needed is a few
small extensions of JController, like JSOAPController..
JXMLRPCController.. JRESTController etc... You, Louis, Andrew etc. would
know more about that than I do :).
Sincerely,
Brad Gies
-----------------------------------------------------------------------
Bistro Bot - Bistro Blurb
http://bgies.com
http://bistroblurb.com
http://ihottonight.com
http://forcethetruth.com
-----------------------------------------------------------------------
Everything in moderation, including abstinence
Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead