Posts

Showing posts with the label portlet

Liferay Search Container Example

Or how to implement a custom search container in Liferay Overview   Search Containers are used in Liferay to display the table data. This article shows a simple example of how to implement a custom search container.  Example < liferay-portlet :renderURL varImpl ="iteratorURL" /> < liferay-ui :search-container total =" <%= ProjectLocalServiceUtil. getProjectsCount (scopeGroupId) %> "                              delta ="10"                              emptyResultsMessage ="no-projects-found"                              iterato...

Fix AMD Loader issue for jQuery Plugins

Image
 Fix AMD Loader issue for jQuery libraries Prerequisites Custom portlet has included jQuery library, sample: com.liferay.portlet.header-portlet-javascript=/js/jstree.js" Error Javascript error during loading portlet:   Fix Modify the library source: ( function (factory) { "use strict" ; if ( typeof define === 'function' && define.amd ) { define ([ 'jquery' ], factory); } else if ( typeof module !== 'undefined' && module . exports ) { module . exports = factory( require ( 'jquery' )); } else { factory( jQuery ); } }( function ($, undefined) { ...   Replace the 'define.amd' with false to fix the AMD loading issue.   P.S. Related article for including jQuery into theme: https://lifedev-solutions.blogspot.com/2019/10/include-jquery-plugin-into-theme.html

Fixing PWC6188 JSTL Error on JSP

Fixing PWC6188 JSTL Error on JSP Prerequisites Portlet module with JSTL core included on JSP: <%@ taglib uri =" http://java.sun.com/jsp/jstl/core " prefix =" c " %> Error Such exception may be thrown after portlet deployment: 2020-03-18 17:42:26.302 ERROR [http-nio-8080-exec-8][PortletRequestDispatcherImpl:295] Unable to dispatch request: /view.jsp(1,1) /init.jsp(3,66) PWC6188: The absolute uri: http://java.sun.com/portlet_2_0 cannot be resolved in either web.xml or the jar files deployed with this application 2020-03-18 17:42:26.303 ERROR [http-nio-8080-exec-8][PortletServlet:112] javax.portlet.PortletException: org.apache.jasper.JasperException: /view.jsp(1,1) /init.jsp(3,66) PWC6188: The absolute uri: http://java.sun.com/portlet_2_0 cannot be resolved in either web.xml or the jar files deployed with this application javax.portlet.PortletException: org.apache.jasper.JasperException: /view.jsp(1,1) /init.jsp(3,66) PWC6188: The absolute uri: http...

Portlet Filter in Liferay 7.2

Liferay 7.2 - Portlet Filter Sample Overview This article describes how to create custom portlet filter in Liferay 7.2. Note: Portet Filters are similar to  Servlet Filters , but they are invoked in scope of portlet and, thus, use  javax.portlet.PortletRequest  /  javax.portlet.PortletResponse  (instead of  javax.servlet.ServletRequest  /  javax.servlet.ServletResponse ). Why do you need it? Portlet filter may be used in the following scenarios: for custom portlet: to simplify portet's and MVCCommand's code; for customization Liferay's OOTB portlets: customization portlets code may be tricky, and you may use portlet filters to inject custom functionality. Portlet Filter creation Create  service  Liferay module for the filter class. Define dependencies in  build.gradle  file: dependencies { compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.0.0" compileOnly gr...