Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-15 Thread Yoann Maingon
In fact the Json I was building was not valid. Now I understood how to fix it. Seems to work well : module namespace _ = 'getObjectTypes'; (:~ : test dev YMA :) declare %rest:path("/getObjectTypes") (: %rest:query-param("name", "{$name}", "anonymous friend") :) %output:method("json")

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-15 Thread Yoann Maingon
Thx, I thought using option format=attribute would work but apparently not. So no I fixed my issue using building the json: module namespace _ = 'getObjectTypes'; (:~ : test dev YMA :) declare %rest:path("/getObjectTypes") (: %rest:query-param("name", "{$name}", "anonymous friend") :) %o

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-15 Thread Arve Gengelbach
Bonjour Yoann, The mapping XML –> JSON is not 1-1, i.e. not any XML can be immediately serialised to JSON. Your XML has to be in a certain format (direct, attributes, jsonml or map) as described in [JSON Module]. I suggest you to template the JSON output you expect and apply json:parse() with

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-14 Thread Yoann Maingon
Working on this development including Basex and AngularJs, I'm stuck with the Json output. here is the error : [BXJS0002] JSON serializer: has invalid attribute "label". Here is the xqm : module namespace _ = 'getObjectTypes'; (:~ : test dev YMA :) declare %rest:path("/getObjectTypes") (:

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-14 Thread Yoann Maingon
Thx for the blog post ! I was close to make it work but now I've got an issue with Basex itself. It says can't communicate with server when I'm trying to launch the basexhttp I know it happened to me once on another computer never knew how I either fixed it or if I had my computer stolen since the

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-14 Thread Andy Bunce
Hi Yoann, I do it like this: http://quodatum.wordpress.com/2014/05/14/using-angular-with-basex /Andy On 14 May 2014 10:53, Yoann Maingon wrote: > Hi, > > I've got two questions about using Basex with Angular, because I still > have an issue accessing the XQuery module file. > > Quick feasibi

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-14 Thread Yoann Maingon
Hi, I've got two questions about using Basex with Angular, because I still have an issue accessing the XQuery module file. Quick feasibility question for development: If I just install basex and store my angularjs app in the webapp folder will this is be ok to interact with the database? The gith

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-07 Thread Alexander Holupirek
On 07.05.2014, at 09:34, Maximilian Gärber wrote: > @basex: maybe it is time for a basex contrib page? Nice idea! We have just created https://github.com/BaseXdb/basex-contrib A github repository for BaseX User Community Contributions On 07.05.2014, at 01:38, Yoann Maingon

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-07 Thread Andy Bunce
>although I was surprised about the reported execution times at that time Yes my test was a bit harsh :-) ab -n 100 -c 10 http://localhost:8984/bsp/simple Is 100 requests as fast as possible with 10 concurrent. I also had nearly 2Mb of parser code in XQuery generated by REX [1] just in one app.

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-07 Thread Christian Grün
> However one thing to be aware of with the current implementation is that > response times depend on the quantity of XQuery code defined, making large > applications problematic. This was mentioned in Christian's recent "Upcoming > features" email, so I am sure it will be addressed soon. I agree

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-07 Thread Andy Bunce
Hi Yoann, I completely agree that RESTXQ is the way to go. I have some Angular auth code for RESTXQ similar to Maximilian's [1]. This is a bit old now (BaseX 7.5 Angular 1.0) so may have rotted a bit. However one thing to be aware of with the current implementation is that response times depend o

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-07 Thread Dirk Kirsten
Hello Yoann, You do not "need to do so", but I remember your project quite well and I was one of the people who said you don't actually need PHP. From what I saw and remember, I think RestXQ is simply a much better fit. RestXQ enables you to do complete server-side processing (just like PHP does)

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-07 Thread Yoann Maingon
Thx I look into the provided example. At first I was more going into Rest and not RestXq, but if I need to do so then I guess I need to spend some time on it. Open sourcing our projects is a good question. I still have some colleagues affraid to somehow loose what they've developped and I don't ha

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-07 Thread Dirk Kirsten
Hi, I agree with Max that it would be a good idea to have a list of projects and examples, which are build on top of BaseX. A problem might be that many applications which are build on top of BaseX are not open source. @Yoann: Please be aware that there is a Rest and RestXQ implementation within

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-07 Thread Maximilian Gärber
Hi Yoann, I guess having examples like these would be helpful in general. Together with basex, we built a larger project for managing conference registrations etc. last year. I could extract some of the modules - maybe we could manage to publish them on some github repo or a dedicated site? @basex

Re: [basex-talk] Rest Access from javascript using AngularJs

2014-05-07 Thread Marco Lettere
Hi Yoann, we had written an example about two years ago when we were using Openlaszlo (RIP) as GUI tool so my example is in the framework's code. I think it is rather understandable and easily portable to JQuery or any othe AJAX tk. Following the method for building and sending the request in

[basex-talk] Rest Access from javascript using AngularJs

2014-05-06 Thread Yoann Maingon
Hi, After xmlprague and my presentation at the BaseX user group I was told (and I agree) that it wasn't really smart to use php for what I was building as it had almost no added value as I could directly query basex using the Rest Interface. Does anyone as some example using either angularjs or j