liferay

Creating liferay portlet - how to pass data to view.jsp from Java class?

99封情书 提交于 2019-12-18 10:53:37
问题 I'm trying to create portlet in liferay with just only from a JSP file called view.jsp . What I need is: When the portlet loads, I want to call custom Java class where I generate an array. I need to pass that array to the view.jsp . How to do that? 回答1: Have you created your portlet with the create.sh script from Liferay? In this case, we will need to create a new portlet class that extends MVCPortlet : public class ArrayPortlet extends MVCPortlet { } Also, you will have to change the WEB-INF

How can I run some action when my plugin was deployed to Liferay?

爷,独闯天下 提交于 2019-12-18 09:14:54
问题 I want to run some code as soon as my plugin ( portlet , hook or theme ) is available in Liferay. I can't find anything like a startup listener in liferay-plugin-package.xml , liferay-portlet.xml , liferay-hook.xml or liferay-look-and-feel.xml . 回答1: There is another way. You could utilize the StartupAction. It is merely an Event, which get's triggered on every startup of a plugin. This method will only get triggered once on a server start or deploy. Recognize, that the doRun method get's a

Display portlet in pop-up Liferay

时间秒杀一切 提交于 2019-12-18 08:58:21
问题 I am trying show a portlet (that previously I have created) from another one, but the pop-up is empty. First, I create the renderURL: <liferay-portlet:renderURL var="testPopupURL" portletName="<%=rule.getBannerPortletId() %>" windowState="<%=LiferayWindowState.POP_UP.toString() %>"></liferay-portlet:renderURL> and I do the link: <aui:a href="#" onClick="showPopup('${testPopupURL}')">View</aui:a> and this is the function showPopup: function showPopup(url){ console.log("En el showPopup "); AUI(

How to deploy portlets to Liferay?

£可爱£侵袭症+ 提交于 2019-12-17 18:40:52
问题 I have faced problems in trying to install new portlets to Liferay running on Glassfish domain. I figured out the flow very lately and want to share it with others also. So, please read the answer and hope this helps someone :) (Pre requisites for the problem is that I knew that adding projects running on Glassfish is done with a autodeploy folder, but making them visible on Liferay was another story.) 回答1: So, you make first a .war file let's say a portlet of name your_file.war. You wanna

Use of request.getParameter in JSP results in NullPointerException

对着背影说爱祢 提交于 2019-12-14 03:26:19
问题 Trying to get a query string parameter and take an appropriate action in a JSP page. Here is a snippet: <%@ page import="com.companyx.portal.model.LDAPAttributes" %> <%@ page import="com.companyx.portal.service.LDAPAttributesLocalServiceUtil" %> <%@ page import="com.liferay.portal.model.User" %> <%@ page import="com.liferay.portal.util.PortalUtil" %> <%@ page import="javax.servlet.http.HttpServletRequest" %> <% User user = PortalUtil.getUser(request); String screenName = user.getScreenName();

Liferay 7 Eclipse IDE override default categories behaviour

天大地大妈咪最大 提交于 2019-12-14 03:17:02
问题 I need to create a portlet in order to change the default category behaviour/interface in Liferay 7. My objective is to duplicate assetcategory table, expand and change its columns, and use this new table as a reference for categories within Liferay backend. Therefore there are three key points my portlet has to update: The category organization UI to create/update category tables on DB. I’m able to create a new Liferay module project ( panel-app template) which can present the UI backend

Delete record on sepecific field value in liferay service builder

一个人想着一个人 提交于 2019-12-14 02:16:38
问题 I want to delete specific record using Field Name Table : Dummy Entity Field Id Field Name public void deleteLocation(req, res){ String getLocationName = request.getParameter("locationName"); Location locationToDelete = new LocationImpl(); locationToDelete.setLocationName(getLocationName); LocationLocalServiceUtil.deleteLocation(locationToDelete); } It's not showing me any error but the record doesn't get deleted. Please hep me out. 回答1: The simplest way to achieve this is to add <finder>

same function working differently when called from two separate functions with same parameters [duplicate]

╄→гoц情女王★ 提交于 2019-12-13 23:51:41
问题 This question already has an answer here : Why am I getting NullPointerException in liferay? (1 answer) Closed 3 years ago . The same function originalStrutsPortletAction.processAction( originalStrutsPortletAction, portletConfig, actionRequest, actionResponse) is working fine when called from one function but not working when called from another function.Although the parameter values are same in both calls. Th code is as follows:- public class ExampleLoginAction extends

How to use custom storage type for liferay 7 forms?

人盡茶涼 提交于 2019-12-13 21:46:08
问题 I am following this tutorial CREATING ADVANCED FORMS, but I am not able to understand how to use external database for storing form data. I cant find any tutorial about this concept. I am using liferay 7 CE. Also tutorial says that developers can implement their own storage types if JSON is not desirable. If they do, the option will appear here in Form Settings. See the tutorial on custom storage types ( not yet written ) for more information. My question is which service-wrapper to use, I

How to delete a portlet in Liferay 6.1 programmatically from code

烂漫一生 提交于 2019-12-13 20:12:21
问题 I'm working on Liferay 6.1 I want to delete a portlet in Liferay 6.1 from my code. What I have done so far is: <a onclick="Liferay.Portlet.close('#p_p_id_28_'); return false;">Remove</a> Above code is working fine. But it is working on the current page only i.e. it can delete the portlet(s) which is there on the current page only. But I want to delete the portlet(s) which could be some where on the menu of my portal using its layout id. Please suggest a way out. Thanks in advance. Regards,