GSoC 2019 Coding Period Week 8

Since the JSON:API code base is very large, after copying the jsonapi module into the wotapi code base, I deleted a lot of things, such as the Query folder, but it was not enough. Cutting out the code base makes it easier for me to move forward. This is one endpoint of the jsonapi to the listing route to get a list of entities. All I need is a Thing Entity, and everything else is indexed to it based on a Thing Entity.

GSoC 2019 Coding Period Week 7

As I mentioned in another blog, I can edit the value of Thing property when creating the Thing entity by Inline Entity Form (IEF). After adding an Entity Reference type of field, commonly used WIDGET is Autocomplete/Autocomplete (tags style) instead of IEF. In the case of points, IEF is used by default after adding a field of entity reference type where the target type is points. So I need to refer to points to implement hook_entity_presave().

GSoC 2019 Coding Period Week 6

In the past few weeks, I have been thinking: why does the Property object in Thing resource not contain the value of the Thing property? It’s clear that type refers to the type of value the property stores, and the property itself is an Object containing fields such as title, description, and so on. Property object: "temperature": { "title": "Temperature", "type": "number", "unit": "degree celsius", "readOnly": true, "description": "An ambient temperature sensor", "links": [{"href": "/things/pi/properties/temperature"}] } Project resource:

GSoC 2019 Coding Period Week 5

Last week, I try to show mentor the demo of property. So, I add a new field to the thing bundle. When the mentor saw that there was no Thing property to add a new field, he asked me: why is there no Thing property? I said Property is in Other of Reference category. But he said it should be shown on the outside, and I insisted there was no difference.

GSoC 2019 Coding Period Week 4

I made a mistake last week. Thanks so much for the mentor pointing out my mistake. I filled in the wrong data in the screenshot of the blog for testing. The mentor found the problem after reading, and we spent a long time discussing related content. I placed the field that should be defined on the property entity incorrectly on the property bundle. Take the JSONAPI example again. Relationships under Entity contain the type and ID information of the related Entity, but not the storage information of the related Entity.

Problems and handling of the properties field in Thing entity

After I changed the Property entity and Thing entity to support bundles last week, I had a problem. When I created a thing, I couldn’t add a property by Autocomplete. I then add properties when I create a thing. It’s going to look something like below, it doesn’t show the property that I’ve created for me to select. This is the definition of the properties field in the screenshot: Drupal\wotapi_thing\Entity .

Research of module names and related discussion of data structures

This is the second week of coding for the GSoC project. Mentor advised me to create the Thing Entity and Property Entity last week. So, I created these two entities and created the test data. This week I showed to mentor the response in API. The response in API like bellow. GET http://dp.localhost/wotapi/thing/thing/64a6d86d-1f63-4f9c-aa7a-7d194e1e54c9 { "type": "thing--thing", "id": "64a6d86d-1f63-4f9c-aa7a-7d194e1e54c9", "drupal_internal__id": 1, "name": "WoT Pi", "description": "A WoT-connected Raspberry Pi", "langcode": "und", "created": "2019-06-10T07:49:43+00:00", "changed": "2019-06-10T07:49:58+00:00", "user_id": { "type": "user--user", "id": "f9a8935f-1cb2-463e-af64-0d14439cf913", "links": [ { "href": "http://dp.

Research how to design properties/actions/events API in Drupal

When coding started, I have a problem, that is how to create a Thing with properties/actions/events. How can I get the data to result If no data input? Then I read the document again and looked for relevant information. The thing description on this page “A thing Resource provides a Thing Description for a device. A Thing Resource is considered the root resource of a Thing.” About the properties. https://iot.

GSoC's Community bonding period

First of all, I would like to thank the Drupal organization for giving me this opportunity to participate in the Google Summer of Code. Before starting coding, there is a period of Community bonding. The following is a little summary of the period During The community bonding period, my mentor thinks that learning a song can help improve my ability of public communication, so I learn The song Love The Way You Lie.

About My Email: