RE: Editing resources

On Wednesday, November 05, 2014 7:27 PM, Kev Kirkland wrote:
> > > version of the Hydra Client I would like the fields to be populated
> > > with the data for the event (by automatically doing a GET request for
> > > the resource).
> > 
> > You could tweak the HydraConsole to, e.g., understand
> > http://schema.org/ReplaceAction and make the UI act as you
> > described. I'd probably merge a PR doing so if you would file one
> > ;-P
> 
> I don't know PHP so unfortunately, so can't supply a PR for the PHP
> Hydra Console.

The HydraConsole is mostly implemented in JavaScript. PHP is just used to implement a proxy [1] to work around cross-origin restrictions and to expand/frame the JSON-LD. All the logic is implemented in JavaScript (in a very ugly way using Backbone.js) [2].



> I'll make the change in the AngularJS console I'm working on though.

Cool


> I haven't released the AngularJS Console just yet - there's two things
> holding me up. The first issue is that it looks up the API Doc from a
> static URL (rather than using the rel link in the HTTP header).

Why is that? Do you have problems getting at or parsing the HTTP Link header?


> Secondly I'd need to write a demo app which delivers Hydra JSON-LD
> with CORs headers (the client doesn't use a proxy like the PHP
> version). Been on my list of things to do for a while, but really
> busy.

Yeah, I should add CORS headers to the demo APIs. Are you aware of APItools? It's quite handy for debugging and simply transformations as adding CORS headers. 


[1] https://github.com/lanthaler/HydraConsole/blob/master/proxy.php
[2] https://github.com/lanthaler/HydraConsole/blob/master/js/hydra.js


Cheers,
Markus


--
Markus Lanthaler
@markuslanthaler



> 
> Thanks,
> 
> Kev
> Thanks for the reply Markus
> 
> > version of the Hydra Client I would like the fields to be populated
> > with the data for the event (by automatically doing a GET request for
> > the resource).
> 
> You could tweak the HydraConsole to, e.g., understand
> http://schema.org/ReplaceAction and make the UI act as you described.
> I'd probably merge a PR doing so if you would file one ;-P I don't
> know PHP so unfortunately, so can't supply a PR for the PHP Hydra
> Console. I'll make the change in the AngularJS console I'm working on
> though.
> 
> I haven't released the AngularJS Console just yet - there's two things
> holding me up. The first issue is that it looks up the API Doc from a
> static URL (rather than using the rel link in the HTTP header).
> Secondly I'd need to write a demo app which delivers Hydra JSON-LD
> with CORs headers (the client doesn't use a proxy like the PHP
> version). Been on my list of things to do for a while, but really
> busy.
> 
> Thanks,
> 
> Kev

Received on Thursday, 6 November 2014 20:12:43 UTC