Comments (5)
Ok, to clarify the answer that @DiegoPino gave to my above question in conversation. Yes, the task is to reverse. To be able to take an expanded Strawberryfield item and ingest it, through denormalizing in the StrawberryfieldFieldItemNormalizer
, into the format the system expects to work with, aka a string. We discussed what the test for success for this task would be:
- to correctly push an expanded SBF over REST or JSON:API and store it correctly
- to correctly push JSON files stored in our minio
dostorage
. Each of these files are full backups of a digital object node, which can bear strawberryfields. The idea would be, in the future, to be able to fully restore Archipelago content based on these files alone.
Regarding test 2, which I took pretty literally. There are certain fields, like the node ID, stored in our minio JSON that cannot be present when creating a new node (uuid is OK). Also, some fields like those containing revision information are immutable (or, at least I was encountering permission issues with them, when operating as admin). These are node level fields, not inside Strawberryfield, so not denormalized with StrawberryfieldFieldItemNormalizer
. I started trying to write a node-level Normalizer to deal with them, and asked Diego about the approach.
He pointed out this could potentially be way too powerful and impact the entire system, and suggested we could store potentially store data differently in minio. I agree, messing with Node denormalization is probably bad. Can return to this point later.
(whatever approach we come up with for fields like revision, it will be important to preserve that history, and potentially add a new revision while ingesting, or mark the ingest in some way in the data).
from strawberryfield.
See (all pretty basic)
https://www.mediacurrent.com/blog/using-normalizers-alter-rest-json-structure-drupal-8/
https://www.adcisolutions.com/knowledge/how-send-json-data-drupal-8-site
Tests Notes:
I will have to run something like
$serializer = \Drupal::service('serializer');
$node = Node::load(2);
$data = $serializer->serialize($node, 'json_passthrough', ['plugin_id' => 'entity']);
To make sure all is working once this is done?
from strawberryfield.
@DiegoPino I read and understood your work in #15, and what the difference in returned format is when StrawberryfieldFieldItemNormalizer
is enabled vs disabled, and how it works together with StrawberryFieldItem
.
My understanding of the task is to take an input in the format you can see at /do/<id>?_format=json
nicely generated by your custom normalizer, and basically reverse the process. What is the larger context of when that reversal would need to take place? Purely over the REST? Understanding that would help me understand the concrete task.
from strawberryfield.
@marlo-longley good explanation. We/you can share a Dumped full Object in JSON here and mark those fields that can not be used via REST. Of course, when thinking about REST v/s a full blown recover-from-filesystem app, on the later, we can always preprocess the dumped JSON, stripping the protected properties out before denormalizing and ingesting skipping the REST endpoint.Not saying REST or JSON API are not needed, indeed we want that to work.
I also feel the all numeric uid
and nid
and fid
(any content entity primary id
really) should be removed and/or replaced by their UUID counterparts in our file/json/minio/dumps. Since we will have/already have nodes depending on other nodes or referencing files, and as you know, we have no control on what numeric IDs Drupal will end assigning them, making the interrelation between entities a nightmare to handle when dumping, e.g a full collection and restoring. But UUIDs are stable and can be set!
from strawberryfield.
Implemented
from strawberryfield.
Related Issues (20)
- Deprecation error: "trim" receiving NULL HOT 3
- Escape tags on the default raw json formatter HOT 3
- Basic IABookreader Search Controller misbehaves when a CWS Child uses it directly HOT 1
- Are we sure Flavors are being removed on File deletion/removal from an ADO? HOT 3
- Allow ETDF Sets to be processed by our Key Name Providers HOT 1
- Recent change in Views/Initialization breaks Rendered Item Index if Display Mode invokes/contains/renders a view (any) HOT 1
- Use Case: Audit Trail for Solr Index Activity
- Call to undefined method Drupal\search_api_db in StrawberryfieldUtilityService.php HOT 2
- Silly old bug, valid Strawberry Flavor index check is not right HOT 2
- Add extra configurations to Semantic Breadcrumbs
- Normalize Pronom Output HOT 1
- Make flavorsearch limit configurable HOT 6
- Dealing with Layout Builder + Views + no Search API driven Views (SQL) mixed with Search API views HOT 1
- Add re-tracker Search API Index implementation for Strawberry Flavors HOT 1
- Add a simple space to time constant
- noAI. Yes. that
- Support Vectors and ML Model Metadata on Strawberry Flavors HOT 1
- Add extra Caching context for breadcrumbs to avoid Drupal 10/11 changes in breadcrumb manager HOT 1
- Add extra checks for as:filetype structure values if a user decides (still don't OK?) RAW edit JSON and remove keys
- Use "isIndexing" helper on StrawberryFlavor Data source
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strawberryfield.