accessing google api with xpl

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

accessing google api with xpl

Prameela R

Hi All,

 

 

Can we call google api with xpl?

If so, how?

My requirement is to get client location.

It can be achieved with  java script, but how with xpl?

 

--Prameela.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: accessing google api with xpl

Florent Georges-3
Prameela R wrote:

> Can we call google api with xpl?

  Google has a lot of APIs.  You'll find an example with the Contact
API at http://www.fgeorges.org/xslt/saxon-ext/#google-sample.  This is
a complete sample, entirely written in XSLT.  The HTTP request is sent
by an XSLT extension (this is actually an example for this extension,)
but with OPS you can use the XPL feature instead to send the HTTP
request.

  Hope that helps,

--
Florent Georges
http://www.fgeorges.org/
























     



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Re: accessing google api with xpl

Prameela R
Hi Florent Georges,

Thanks for the reply. I tried the example.But iam getting the following
exception.


XPath syntax error at char 38 on line 46 in {...send($http-request,
$endpoi...}:
Cannot find a matching 2-argument function named
{java:org.fgeorges.xslt.Exslt2}http-send(). Note: external function calls
have been disabled

Any Clues?

--Prameela

-----Original Message-----
From: Florent Georges [mailto:[hidden email]]
Sent: Tuesday, January 06, 2009 5:59 PM
To: [hidden email]
Subject: [ops-users] Re: accessing google api with xpl

Prameela R wrote:

> Can we call google api with xpl?

  Google has a lot of APIs.  You'll find an example with the Contact
API at http://www.fgeorges.org/xslt/saxon-ext/#google-sample.  This is
a complete sample, entirely written in XSLT.  The HTTP request is sent
by an XSLT extension (this is actually an example for this extension,)
but with OPS you can use the XPL feature instead to send the HTTP
request.

  Hope that helps,

--
Florent Georges
http://www.fgeorges.org/
























     




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: RE: Re: accessing google api with xpl

Ryan Puddephatt-3
Prameela,
        Change your XPL processor from oxf:xslt to oxf:unsafe-xslt, the latter enables external function calls

Ryan

-----------------------------------------------
Ryan Puddephatt
Connectivity Developer
Fidessa LatentZero
1 Old Jewry
London EC2R 8DN
Office: +44 (0) 20 7105 1000
Direct: +44 (0) 20 7105 1821
Blackberry: +44 (0) 79 8539 2458
Fax: +44 (0) 20 7105 1818
Email: [hidden email]
Web: http://www.latentzero.com


-----Original Message-----
From: Prameela R [mailto:[hidden email]]
Sent: 07 January 2009 09:51
To: [hidden email]
Subject: [ops-users] RE: Re: accessing google api with xpl

Hi Florent Georges,

Thanks for the reply. I tried the example.But iam getting the following exception.


XPath syntax error at char 38 on line 46 in {...send($http-request,
$endpoi...}:
Cannot find a matching 2-argument function named {java:org.fgeorges.xslt.Exslt2}http-send(). Note: external function calls have been disabled

Any Clues?

--Prameela

-----Original Message-----
From: Florent Georges [mailto:[hidden email]]
Sent: Tuesday, January 06, 2009 5:59 PM
To: [hidden email]
Subject: [ops-users] Re: accessing google api with xpl

Prameela R wrote:

> Can we call google api with xpl?

  Google has a lot of APIs.  You'll find an example with the Contact API at http://www.fgeorges.org/xslt/saxon-ext/#google-sample.  This is a complete sample, entirely written in XSLT.  The HTTP request is sent by an XSLT extension (this is actually an example for this extension,) but with OPS you can use the XPL feature instead to send the HTTP request.

  Hope that helps,

--
Florent Georges
http://www.fgeorges.org/
























     




______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

_______________________________________________________________________
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

_____________________________________________________________________
This e-mail has been scanned for viruses by Verizon Business Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RE: Re: accessing google api with xpl

Florent Georges-3
In reply to this post by Prameela R
Prameela R wrote:

  Prameela,

> XPath syntax error at char 38 on line 46 in {...send($http-request,
> $endpoi...}:
> Cannot find a matching 2-argument function named
> {java:org.fgeorges.xslt.Exslt2}http-send(). Note: external function
> calls have been disabled

  As Ryan said, you can use oxf:unsafe-xslt to enable calls from Saxon
to extension function written in Java.  But I think Orbeon provides
the ability to send HTTP requests too.  So you have the following two
options:

  - format your request to the Google Authentication service using
    XSLT or whatever, use XPL HTTP support to send it, store the
    authentication token in an XPL variable, use it to format your
    requests to your target Google service (contacts, agenda or
    whatever) and again use XPL HTTP support to send them;

  - use oxf:unsafe-xslt and put fgeorges.jar in the Orbeon classpath,
    and create an XSLT stylesheet that do the whole job, including
    sending HTTP request with the extension function (as within the
    example I pointed you to.)

  The advantage of the former is that you rely on a more wisely used
implementation to send HTTP requests, so it should be more reliable
and there are more people to answer your questions.

  The advantage of the later is that you have a standalone stylesheet
that does the job, usable outside of Orbeon too (this is particularly
useful to help you developing the stylesheet I think, for example if
you use an IDE like oXygen, you can write your stylesheet with it and
execute it with a single click, without having to set a Java EE
environment up.)

  Hope that helps,

--
Florent Georges
http://www.fgeorges.org/






















     



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws