legacy-knowledge-base
公開されました Jun. 30, 2025

アプリケーション表示テンプレートでの、オブジェクトカスタムフィールドの使用方法

written-by

Julián Vela Cubas

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • カスタムオブジェクトの検索結果ADTを構成しています。 デフォルトでは、利用可能な変数で、タイトル、著者などを選択することができます。 しかし、私はオブジェクトのカスタムフィールドにもアクセスする必要があります。

Environment

  • Liferay DXP 7.4

解決策

  • Object エンティティに対応する Web ブラウザの API コンソール(/o/api )でサービスエンドポイントを検索します。
  • ADTでは、Idとして "restClient "とclassPKを使用して、レストサービスを呼び出します。
<#if entries?has_content>
<#list entries as entry>
<#assign myobject = restClient.get("/c/myobjects/${entry.getClassPK()}")>
field1: ${myobject.field1} <br>
field2: ${myobject.field2} <br>
field3: ${myobject.field3} <br>
</#list>
</#if>

 

追加情報

  • ここでは、このソリューションの実装方法を完璧に説明する、Alejandro Tardínによるライブデモを収録したセッションを紹介します:

https://liferay.dev/twentyfour#Put%20your%20templates%20at%20REST

 

 

did-this-article-resolve-your-issue

legacy-knowledge-base