使用中のウィジェット・テンプレートを識別する方法を教えてください。
written-by
Emma Carr-Gardner
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
ご覧のページは、お客様の利便性のために一部機械翻訳されています。また、ドキュメントは頻繁に更新が加えられており、翻訳は未完成の部分が含まれることをご了承ください。最新情報は都度公開されておりますため、必ず英語版をご参照ください。翻訳に問題がある場合は、こちら までご連絡ください。
問題
どのウィジェットテンプレートが使用中であるかを知るには?
ウィジェットテンプレートがLiferayインスタンス全体で使用されている場所を確認するにはどうすればいいですか?
解像度
Liferay DXP 7.4のユーザーは、UIを使ってどのテンプレートが使われているか、どこで使われているかを調べることができます。
製品メニューへ移動 > デザイン > テンプレート > ウィジェットテンプレート
ここで使用件数を見ることができ、さらにアクションボタンをクリックすると、そのテンプレートの使用件数を見ることができます。
Liferay DXP 7.0-7.3のユーザーには、groovyスクリプト(ここに添付)を使うことができます。
コントロールパネル > サーバー管理 > スクリプトに移動し、添付のスクリプトを貼り付けます。
List<com.liferay.portal.kernel.model.PortletPreferences> portletPreferences = com.liferay.portal.kernel.service.PortletPreferencesLocalServiceUtil.getPortletPreferences(); for (com.liferay.portal.kernel.model.PortletPreferences portletPreference : portletPreferences) { String preferencesXML = portletPreference.getPreferences(); javax.portlet.PortletPreferences jxPortletPreferences = com.liferay.portal.kernel.portlet.PortletPreferenceskernel.portlet.PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML); String displayStyle = jxPortletPreferences.getValue("displayStyle", ""); if (displayStyle.isEmpty()) { continue; } com.liferay.portal.kernel.model.Layout layout = com.liferay.portal.kernel.service.LayoutLocalServiceUtil.fetchLayout(portletPreference.getPlid()); out.println( "テンプレート名: " + displayStyle); out.println( "レイアウト名:" + layout.getNameCurrentValue() + " Plid:" + portletPreference.getPlid()); out.println( "PortletId:" + portletPreference.getPortletId()); out.println( "----"); }.
did-this-article-resolve-your-issue