Issue
Facing an issue with the missing parameters in the JSONT format file when using the "Data Migration Center" portlet.
Batch Client Extension only supports the "JSONT" file format. After generating the "JSONT" file for Object Entry, the generated JSONT file doesn't have the few parameters that are required for importing the object entries:-
-
"containsHeaders":"false" --> "containsHeaders":"true"
-
"createStrategy":"INSERT" --> "createStrategy":"UPSERT"
-
taskDelegateName:"C_<ObjectName>" --> shift this parameter after the “updateStrategy":"UPDATE"}”
- By Default JSONT parameters format:-
{"containsHeaders":"false","createStrategy":"INSERT","importStrategy":"ON_ERROR_FAIL","taskItemDelegateName":"C_ShipObject","updateStrategy":"UPDATE"},"userId":20123,"version":"v1.0"}
- After changing the JSONT parameters format:-
{"containsHeaders":"true","createStrategy":"UPSERT","importStrategy":"ON_ERROR_FAIL","updateStrategy":"UPDATE"},"taskItemDelegateName":"C_ShipObject","userId":20123,"version":"v1.0"}
- Create a Workspace folder with the name "client-extension-workspace".
- Open the "client-extension-workspace" directory in the terminal and run the below command.
blade init -v dxp-7.4-u102 - The workspace is created.
- Now create the "client-extensions" and "bundles" folders in the "client-extension-workspace" directory.
- Create a "batch" folder and a "client-extension.yaml" file in the "client-extensions" folder and add the below data in the "client-extension.yaml" file.
- Extract the same Liferay in the "bundles" folder and copy the path.
- Open the "gradle.properties" file and add the "lifeary.workspace.home.dir = /home/.../client-extension-workspace/bundles" property and save it.
- Start the Liferay server and follow the below steps:
a) Navigate to the Control Panel-> Object and create an object by the name ShipObject.
b) After the "ShipObject" is created, open the same object, open the "field" tab, and create a field with the "Text" type.
c) Open the "Details" tab and go to the "SCOPE" section, select the "Panel Link" Control Panel->Object.
d) Publish the "ShipObject" object.
e) Navigate to the “Control Panel-> Object-> Ship Object”, click on "+" button, and add an entry.
f) Navigate to the “Instance Settings-> PLATFORM-> Feature Flags-> VIRTUAL INSTANCE SCOPE-> Beta” and enable the "Data Migration Center".
g) Navigate to the "Applications-> Data Migration Center", click on "+" and select the "Export File".
h) Select the "C_ShipObject" in the "Entity Type" section, select the "JSONT" format in the "Export File Format" and export the object entry.
i) Again follow the (e) step, go to the Ship Object, and delete the existing entry. - The exported file we exported in the above steps, extract the export file, copy the "export.batch-engine-data.json" file and navigate to the "client-extension-workspace/client-extensions/batch" directory and paste the "export.batch-engine-data.json" file.
- Navigate to the "client-extension-workspace/client-extensions" path in the terminal and run the "blade gw build" command and after this command run the "blade gw deploy" command.
- Open the Liferay server console log, where we can see the below "INFO":
024-02-05 09:56:39.370 INFO [fileinstall-directory-watcher][BundleStartStopLogger:68] STARTED clientextensions_7.4.13 [1431] 2024-02-05 09:56:39.552 INFO [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.oauth2.provider.configuration.OAuth2ProviderApplicationHeadlessServerConfiguration~liferay-sample-batch-oauth-application-headless-server)][InterpolationConfigurationPlugin:135] Replaced value of configuration property 'homePageURL' for PID com.liferay.oauth2.provider.configuration.OAuth2ProviderApplicationHeadlessServerConfiguration~liferay-sample-batch-oauth-application-headless-server 2024-02-05 09:56:39.709 INFO [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.oauth2.provider.configuration.OAuth2ProviderApplicationHeadlessServerConfiguration~liferay-sample-batch-oauth-application-headless-server)][OAuth2ProviderApplicationHeadlessServerConfigurationFactory:176] OAuth 2 application with external reference code liferay-sample-batch-oauth-application-headless-server and company ID 20095 has client ID id-1c9a9a82-cd19-2993-fd6c-a538d5973549 - Open the Liferay UI, navigate to the “Control Panel-> Object-> Ship Object”, and refresh the page, the entry is not visible.
- After that, change the following parameters of the "export.batch-engine-data.json" file and run the "blade gw deploy" command again.
{"containsHeaders":"true","createStrategy":"UPSERT","importStrategy":"ON_ERROR_FAIL","updateStrategy":"UPDATE"},"taskItemDelegateName":"C_ShipObject","userId":20123,"version":"v1.0"} - Follow the 12th step again and refresh the page, now the entry is visible.
Note: Attached are the “client-extension.yaml“ files.
Observed Behavior: When users deploy the original “JSONT” file the entry will not be inserted inside the created object, but if they modify the “JSONT” file, then the entry will be created and visible.
Expected Behavior: When users deploy the original “JSONT” file, the entry will be created and visible.
- DXP 2023.Q4.0 Quarterly Release and above
Resolution
- The observed behavior is a known bug that has been addressed by: LPD-17470.
- If a hotfix is required or any more information on this, please create a support ticket requesting a hotfix by attaching patch details.
- Installing Fix Packs and Hotfixes on Liferay DXP will guide you to install this hotfix in the respective environment.