Re: Enquiry

> I'm more than happy to help with this, so feel free to post questions and
share your progress on the mailing list.
Thanks! Maybe we should take this thread off-list then.


On 27 October 2014 15:08, Markus Lanthaler <markus.lanthaler@gmx.net> wrote:

>
> Have you looked at
>
>   http://decoupledcms.org/links.html
>
Ah I see.
My current skills are only php/Drupal
There's a gap between that and what these tools are doing.


> > Drupal's services module exposes entities and fields with Drupal's own
> > structure which is wierd for 3rdparty app developers. e.g.
> >
> > $entity->field_name[language_code][delta] = array(value => whatever,
> > $format => whatever)
> >
> > where the keys of the array are specific to the field type. I think
> > this is the same in Drupal 8 because drupal has no notion of a
> > 'flattened' entity or standard way of representing data in different
> > fields before rendering.
> >
> > So I want to output flat arrays assuming the language is given and the
> > field has a cardinality of 1.
>
> Wouldn't it be quite straightforward to write a serializer that does that?
>
In that case I've probably already written it inside Drupal hooks. I could
separate it into another module if it would help. Drupal 7 which we are
using has no concept of a 'serializer', though Drupal 8 does.


> > Your response didn't mention Hydra as a possible solution at all.
>
> The first step is to serialize the data as JSON-LD. Hydra can then be used
> to describe the operations that the various resources support.
>
ok so maybe we can come back to that.

> I'm ready to write my own REST interface - its not that hard but I'm
> > still hoping for some tools or at least standards I can work to. I
> > wouldn't implement what I've seen of Hydra because it was too complex
> > for me to understand. However if tools already exist, that wouldn't
> > matter.
>
> I'm still trying to understand what exactly you need/want to build. Hydra
> is just a vocabulary which allows you to describe your service interface in
> a machine-readable manner. Nothing more, nothing less. The first step is to
> get the data out, as soon as you've accomplished that, we can describe to a
> client how to interact with it.
>
Global Ecovillage Network has a database in drupal 7 with several content
types and many fields, which are liable to change. We need the data to be
accessible to view and edit and search via a REST interface. It is easy
enough to export flat object in JSON, but building apps to edit dynamic
content types will be a headache, so I understood Hydra provided a standard
way to expose the data structures in a REST interface.
Is that clearer?
Matthew



-- 
Find out more about my work in local money systems
Twitter: @matslats
My personal web site <http://matslats.net> including my blog, Adventures in
mutual credit <http://matslats.net/complementary_currencies>
Lecture about cryptocurrencies
<http://networkcultures.org/wpmu/moneylab/2014/03/27/cryptocurrencies-designing-alternatives>
(18 min)
Brief bio and articles on shareable.net
<http://shareable.net/users/matthew-slater>
I co-founded Community Forge <http://communityforge.net>
Bitcoin donations accepted: 1QLPWcQpp1x2Qzqocjm2CfnpoiCLUd4JXt

Received on Monday, 27 October 2014 17:56:11 UTC