問題
Batch Client Extensionは "JSONT "ファイル形式のみをサポートします。 オブジェクトエントリーの「JSONT」ファイルを生成した後、生成されたJSONTファイルには、オブジェクトエントリーのインポートに必要ないくつかのパラメータがありません。
-
"containsHeaders":"false" --> "containsHeaders":"true"
-
"createStrategy":"INSERT" --> "createStrategy":"UPSERT"
-
taskDelegateName:"C_<ObjectName>" --> shift this parameter after the “updateStrategy":"UPDATE"}”
- デフォルトのJSONTパラメータ形式:-。
{"containsHeaders":"false","createStrategy":"INSERT","importStrategy":"ON_ERROR_FAIL","taskItemDelegateName":"C_ShipObject","updateStrategy":"UPDATE"},"userId":20123,"version":"v1.0"}
- JSONTパラメータ形式変更後
{"containsHeaders":"true","createStrategy":"UPSERT","importStrategy":"ON_ERROR_FAIL","updateStrategy":"UPDATE"},"taskItemDelegateName":"C_ShipObject","userId":20123,"version":"v1.0"}
- "client-extension-workspace"という名前でWorkspaceフォルダを作成します。
- ターミナルで"client-extension-workspace"ディレクトリを開き、以下のコマンドを実行する。
blade init -v dxp-7.4-u102 - ワークスペースが作成される。
- 次に、"client-extension-workspace "ディレクトリに "client-extensions "フォルダと "bundles "フォルダを作成します。
- client-extensions "フォルダに "batch "フォルダと "client-extension.yaml "ファイルを作成し、"client-extension.yaml "ファイルに以下のデータを追加する。
- 同じLiferayを "bundles "フォルダに展開し、パスをコピーします。
- gradle.properties "ファイルを開き、"lifeary.workspace.home.dir = /home/.../client-extension-workspace/bundles "プロパティを追加し、保存する。
- Liferayサーバーを起動し、以下の手順に従ってください:
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. - 上記の手順でエクスポートしたファイルを解凍し、「export.batch-engine-data.json」ファイルをコピーして、「client-extension-workspace/client-extensions/batch」ディレクトリに移動し、「export.batch-engine-data.json」ファイルを貼り付けます。
- ターミナルで "client-extension-workspace/client-extensions "パスに移動し、"blade gw build "コマンドを実行し、このコマンドの後に "blade gw deploy "コマンドを実行する。
- Liferayサーバーのコンソールログを開くと、以下の "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 - Liferay UIを開き、"Control Panel-> Object-> Ship Object "に移動し、ページを更新すると、エントリが表示されません。
- その後、"export.batch-engine-data.json "ファイルの以下のパラメータを変更し、再度 "blade gw deploy "コマンドを実行する。
{"containsHeaders":"true","createStrategy":"UPSERT","importStrategy":"ON_ERROR_FAIL","updateStrategy":"UPDATE"},"taskItemDelegateName":"C_ShipObject","userId":20123,"version":"v1.0"} - 12番目のステップをもう一度行い、ページを更新すると、エントリーが表示されます。
注:"client-extension.yaml "ファイルを添付します。
観察された動作:しかし、ユーザーが「JSONT」ファイルを修正すると、エントリーが作成され、表示されるようになります。
期待される動作:ユーザーがオリジナルの「JSONT」ファイルをデプロイすると、エントリーが作成され、表示されます。
- DXP 2023.Q4.0 四半期リリース以上
解像度
- 観測された動作は既知のバグであり、LPD-17470によって対処されている: LPD-17470.
- Hotfixが必要な場合、またはこの件に関する詳細については、パッチの詳細を添付してHotfixをリクエストするサポートチケットを作成してください。
- Liferay DXPへの修正パックとHotfixのインストール を参照してください。