Newbie Question - Configuration Interface - LF 7.2
Newbie Question - Configuration Interface - LF 7.2
https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=115100977
2024-03-28T14:16:47Z
2024-03-28T14:16:47Z
RE: Newbie Question - Configuration Interface - LF 7.2
Mohammed Yasin
https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=115104369
2019-09-05T17:46:27Z
2019-09-05T17:46:27Z
Hi , <br />You can refer below forum<br /><a href="https://liferay.dev/forums/-/message_boards/message/114236948">https://liferay.dev/forums/-/message_boards/message/114236948</a><br /><a href="https://liferay.dev/forums/-/message_boards/message/114871855">https://liferay.dev/forums/-/message_boards/message/114871855</a><br /><a href="https://liferay.dev/forums/-/message_boards/message/114892030">https://liferay.dev/forums/-/message_boards/message/114892030</a>
Mohammed Yasin
2019-09-05T17:46:27Z
Newbie Question - Configuration Interface - LF 7.2
Fábio Coelho
https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=115100976
2019-09-05T17:40:03Z
2019-09-05T17:40:03Z
Newbie here again...<br />Trying to make a configurable portlet. Followed <a href="https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/configurable-applications">https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/configurable-applications </a>to the Ts.<br />configuration always return null and no UI is presented whatsoever.<br /><br />INTERFACE<br />package newbie.project.configuration;<br />import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;import aQute.bnd.annotation.metatype.Meta;@ExtendedObjectClassDefinition(category = "setup", scope = ExtendedObjectClassDefinition.Scope.PORTLET_INSTANCE)<br />@Meta.OCD(id = "newbie.project.configuration.SectionPageConfiguration")<br />public interface SectionPageConfiguration {<br /> @Meta.AD(deflt = "SECTION ID 1.1", required = false, name = "section-name")<br /> public String siteSection();<br />}<br /><br />BEAN DECLARATION<br />package newbie.project.configuration;<br />import com.liferay.portal.kernel.settings.definition.ConfigurationBeanDeclaration;import org.osgi.service.component.annotations.Component;@Component<br />public class SectionPageConfigurationBeanDeclaration implements<br />ConfigurationBeanDeclaration {<br /> @Override<br /> public Class<?> getConfigurationBeanClass() {<br /> return SectionPageConfiguration.class;<br /> }<br />}<br />RELEVEANT PART IN PORTLET CLASS<br />(...)<br />@Component(configurationPid = "newbie.project.configuration.SectionPageConfiguration", <br />(...)<br /> @Override<br /> public void doView(RenderRequest renderRequest, RenderResponse renderResponse)<br /> throws IOException, PortletException {<br /> ThemeDisplay themeDisplay = (ThemeDisplay) PortalUtil.getHttpServletRequest(renderRequest)<br /> .getAttribute(WebKeys.THEME_DISPLAY);<br /> PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();<br /> SectionPageConfiguration _configuration;<br /> String siteSection = "SECTION ID 1.1";<br /> try {<br /> _configuration = portletDisplay<br /> .getPortletInstanceConfiguration(SectionPageConfiguration.class);<br /> siteSection = _configuration.siteSection();<br /> } catch (Exception e) {<br /> System.out.println( e.getMessage());<br /> }<br /> renderRequest.setAttribute("sectionBodyContent", getRenderedHTML(siteSection));<br /> super.doView(renderRequest, renderResponse);<br /> }<br /><br />-----------------------------------<br />I tried first with the simplest setup, no scope, no bean declaration, to no avail...How not even the most basic unscope UI showed, I'm concerned that moving forward to custom jsp and actions would not solve the problem, so I'm asking first!<br />Any advice, will be more than welcome!<br />Even if for you is obvious, remember, I'm a newbie! <br />So you see, here, in this forum, very patiente and kind Mr Dang pointed me a solution in liferay source i