Fórum

How to get Model classes and Constant Fields Values into JSp's in LR 7 GA2?

lokesh gorrela, modificado 7 Anos atrás.

How to get Model classes and Constant Fields Values into JSp's in LR 7 GA2?

Regular Member Postagens: 173 Data de Entrada: 09/03/16 Postagens Recentes
Hi guys,

I have to get Models classes and Constants Field Values for below FormNavigator key and use in My Jsp code in liferay 7 GA2. Any one knows about this requirement. Please give replay to me.

CATEGORY_KEY_LAYOUT_ADVANCED
CATEGORY_KEY_LAYOUT_GENERAL
CATEGORY_KEY_LAYOUT_LOOK_AND_FEEL
CATEGORY_KEY_LAYOUT_SEO
CATEGORY_KEY_LAYOUT_SET_ADVANCED
CATEGORY_KEY_LAYOUT_SET_LOOK_AND_FEEL
CATEGORY_KEY_ORGANIZATION_IDENTIFICATION


Thanks
With Regards
Lokesh
thumbnail
James Hinkey, modificado 7 Anos atrás.

RE: How to get Model classes and Constant Fields Values into JSp's in LR 7

Junior Member Postagens: 62 Data de Entrada: 15/02/11 Postagens Recentes
Hi Lokesh,

I'm not sure if you've already seen, but the tutorial Form Navigator Extensions describes all the parts involved and how to use them. It mentions the constants are in FormNavigationConstants. If you need them in your JSP, you should be able to import that class into your JSP.

If that's not helpful or I'm misunderstanding your question, please clarify.

Thanks,
Jim
lokesh gorrela, modificado 7 Anos atrás.

RE: How to get Model classes and Constant Fields Values into JSp's in LR 7

Regular Member Postagens: 173 Data de Entrada: 09/03/16 Postagens Recentes
Hello James
Thanks for your replay.

Already I seen you provided links.But I can't Understand How to use CATEGORY_KEY_LAYOUT_LOOK_AND_FEEL ,CATEGORY_KEY_LAYOUT_GENERAL, CATEGORY_KEY_SITES_GENERAL ,CATEGORY_KEY_LAYOUT_SET_LOOK_AND_FEEL constants in edit_layout.jsp in liferay 7 portal code.

I overriden below jsp from liferay 7 GA2 potal code.see the below location:
portal\modules\apps\web-experience\layout\layout-admin-web\src\main\resources\META-INF\resources\edit_layout.jsp

edit_layout.jsp :

Layout selLayout = layoutsAdminDisplayContext.getSelLayout();
<liferay-ui:form-navigator
formModelBean="<%= selLayout %>"
id="<%= FormNavigatorConstants.FORM_NAVIGATOR_ID_LAYOUT %>"
markupView="lexicon"
showButtons="<%= false %>"
/>

The above code is working fine in edit_layout.jsp. Now I want to use below code instead of above code in edit_layout.jsp.
Layout selLayout = layoutsAdminDisplayContext.getSelLayout();
<liferay-ui:form-navigator
formModelBean="<%= selLayout %>"
id="<%= FormNavigatorConstants.CATEGORY_KEY_SITES_GENERAL %>"
markupView="lexicon"
showButtons="<%= false %>"
/>


I am using this code in edit_layout.jsp, It throws below errors:
04:49:44,313 WARN [http-nio-8080-exec-6][ThemeLocalServiceImpl:237] No theme found for specified theme id classic. Returning the default theme.
04:49:48,666 ERROR [http-nio-8080-exec-6][IncludeTag:128] Current URL /group/11104/~/control_panel/manage?p_p_id=com_liferay_layout_admin_web_portlet_GroupPagesPortlet&p_p_lifecycle=0&p_p_state=maximized&p_r_p___selPlid=11117&_com_liferay_layout_admin_web_portlet_GroupPagesPortlet_backURL=%2F&_com_liferay_layout_admin_web_portlet_GroupPagesPortlet_groupId=11105&p_p_auth=PWoWGizu generates exception: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at org.apache.jsp.html.taglib.ui.form_005fnavigator.lexicon.page_jsp._jspService(page_jsp.java:3009)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.includePage(IncludeTag.java:380)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:362)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:206)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:88)
at org.apache.jsp.edit_005flayout_jsp._jspService(edit_005flayout_jsp:1205)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:408)


could you please tell the solution for this problem.
lokesh gorrela, modificado 7 Anos atrás.

RE: How to get Model classes and Constant Fields Values into JSp's in LR 7

Regular Member Postagens: 173 Data de Entrada: 09/03/16 Postagens Recentes
Hello James

I am waiting for your replay. This is great help to me.

Thanks
With Regards
Lokesh