Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Data Engine
Using the new Liferay Data Engine like described here
https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/data-engine
I have two questions and one issue:
1. Creating a DataRecordCollection in a DataDefinition seems to create 2 different collections. Inspected with a GraphQL Query:
Why are there two and which one must I use to finally store my records in?
2. Does anybody know an example that uses the property
What is it good for? Is it possible to store some kind of relation to other DataDefinitions?
3. After playing around with the Data Engine for a while ... (creation and deletion of dfinitions and collections) It seems that I can't delete DataDefinitions and DataRecordCollections anymore. The server responds with 500 (internal error).
Using Postman like this:
reveals
Any advice?
https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/data-engine
I have two questions and one issue:
1. Creating a DataRecordCollection in a DataDefinition seems to create 2 different collections. Inspected with a GraphQL Query:
{
"data": {
"dataRecordCollections": {
"items": [
{
"id": 37043,
"dataDefinitionId": 37037,
"dataRecordCollectionKey": "37042"
},
{
"id": 37039,
"dataDefinitionId": 37037,
"dataRecordCollectionKey": "FIELDDEFINITION"
}
}
}
The dataRecordCollectionKey "FieldDefinition" is the DataDefinitionKey of the corresponding DataDefinition. BTW the request that creates the collection(s) returns the id of the first one. (In this example 37043)Why are there two and which one must I use to finally store my records in?
2. Does anybody know an example that uses the property
nestedDataDefinitionFields ? What is it good for? Is it possible to store some kind of relation to other DataDefinitions?
3. After playing around with the Data Engine for a while ... (creation and deletion of dfinitions and collections) It seems that I can't delete DataDefinitions and DataRecordCollections anymore. The server responds with 500 (internal error).
Using Postman like this:
DELETE http://localhost:8080/o/data-engine/v1.0/data-definitions/37028 reveals
com.liferay.dynamic.data.mapping.exception.NoSuchStorageLinkException: No DDMStorageLink exists with the key {classPK=37132}
in the response. Nothing in the Logs and restarting the server does not help. Any advice?
I'm not sure how to recreate the exception to help you to help you troubleshoot this
just thought to ask what version of liferay are you using? 7.3 GA1?
I see some issues reported and fixed in 7.3 GA1, but not sure. https://issues.liferay.com/browse/LPS-105942
I see some issues reported and fixed in 7.3 GA1, but not sure. https://issues.liferay.com/browse/LPS-105942
Thanks! I'm on 7.2.1 and will update to 7.3 now. I don't belive that the issue you posted has something to do with mine, but I can see that the Data Engine and also the App Builder is under constant development.
Yes, they still development and as issues are reported on issues.liferay.com, those issues will be addressed, resolved and eventually released into a future GA release.
I'd recommend that anything you hit, report it so you might get a fix in the next GA...
I'd recommend that anything you hit, report it so you might get a fix in the next GA...
Ok, now I applied for a JIRA Account. But in the meantime:
Having updated to 7.3 GA the REST API obviously has changed.
For example: looking up existing DataDefinitions was previously done with a
Now, looking into the source code here:
https://github.com/liferay/liferay-portal/blob/master/modules/apps/data-engine/data-engine-rest-client/src/main/java/com/liferay/data/engine/rest/client/resource/v2_0/DataDefinitionResource.java
I guess it must be something like:
This is a guess because I could not find a documentation of the new API. (Nothing in the Knowledge base or swagger hub...)
AND calling the endpoint like described above only raises an "500 Internal Server Error" (NPE in the logs) because (another guess) apperantly the sideId/groupId/sideKey is missing :-(
It seems like I'm an early bird playing around with the Data Engine, but I hope that somebody has more detailed information how to use the new REST API. If this is of any importance: Unlike the new "App Builder" I'm using the API from outside Liferay and with Basic Authentication.
Having updated to 7.3 GA the REST API obviously has changed.
For example: looking up existing DataDefinitions was previously done with a
GET .../o/data-engine/v1.0/sites/{sideId}/data-definitionsNow, looking into the source code here:
https://github.com/liferay/liferay-portal/blob/master/modules/apps/data-engine/data-engine-rest-client/src/main/java/com/liferay/data/engine/rest/client/resource/v2_0/DataDefinitionResource.java
I guess it must be something like:
GET .../o/data-engine/v2.0/data-definitions/by-content-type/{contentType} This is a guess because I could not find a documentation of the new API. (Nothing in the Knowledge base or swagger hub...)
AND calling the endpoint like described above only raises an "500 Internal Server Error" (NPE in the logs) because (another guess) apperantly the sideId/groupId/sideKey is missing :-(
It seems like I'm an early bird playing around with the Data Engine, but I hope that somebody has more detailed information how to use the new REST API. If this is of any importance: Unlike the new "App Builder" I'm using the API from outside Liferay and with Basic Authentication.
FYI, the APIs for data engine and app builder have been uploaded to swaggerhub.
Great news! Thank you!
For others beeing interested:
For 7.3 GA it's here:
https://app.swaggerhub.com/apis/liferayinc/data-engine/2.0
For others beeing interested:
For 7.3 GA it's here:
https://app.swaggerhub.com/apis/liferayinc/data-engine/2.0
After a hard time figuring out WTF {contentType} may be I found out (by inspecting the browsers console) when using "App Builder" that
Maybe this saves others people time while waiting for the documantation of 7.3
BTW: App Builder is currently only working when using an english locale. There are issues reported that adress this situation...
GET http://[myHost:myPort]/o/data-engine/v2.0/sites/[mySiteId]/data-definitions/by-content-type/app-builder
is returning a valid JSON Response with an Items Array with the existing DataDefinitions. Maybe this saves others people time while waiting for the documantation of 7.3
BTW: App Builder is currently only working when using an english locale. There are issues reported that adress this situation...