liferay

How to replace a function on a Liferay native portlet

不想你离开。 提交于 2019-12-09 04:52:04
问题 I am making a change to a native Liferay portlet, that comes with Liferay Intallation. How can I change a function to my own implementation by a hook or similar approach? I have read how to make pre and post conditions and how to make new implementation of an interface, but I don't know how to just replace random function inside random class at a portlet that I want to keep otherwise as it is originally. 回答1: There are several ways you can modify the functionality of a native Liferay portlet.

How to get Portlet Id using the portlet name in Liferay?

安稳与你 提交于 2019-12-09 02:51:50
问题 I have a requirement of getting resource permission using portlet name. I will have the name of the portlet not the Id. Resource Permission name for a portlet is that portlet's Id. I checked the Portlet table, it has only the Id and other info. Where will be the other attributes of portlet saved?. Is there a way I can get portlet's Id by using portlet's name. I have a workaroud to get all portlets and compare, but if I can directly get portlet's Id using portlet's name it will be helpful. Its

Unit tests for Liferay portlets

梦想与她 提交于 2019-12-09 00:12:03
问题 Does anyone know how to run unit tests for Liferay portlets? I have found a lot of posts about it (e.g. http://agile-reflections.opnworks.com/2010/06/portlet-unit-testing-with-liferay-6.html) but none works nonetheless. 回答1: This may be overkill, but if you're looking for an Enterprise approach with continuous integration testing, this blog gives a very good example: Continuous integration on Liferay: running your Selenium 2 tests on the Tomcat 6 bundle 回答2: Unit testing Liferay portlets is

Deploying a simple Portlet to Liferay - ClassCastException

梦想的初衷 提交于 2019-12-08 21:26:27
问题 I'm deploying the most basic Portlet possible to Liferay: public class FirstPortlet extends GenericPortlet { @RenderMode(name="VIEW") public void welcomeWelcome(RenderRequest request, RenderResponse response) throws PortletException, IOException { PrintWriter out = response.getWriter(); out.println ("This is a portlet, <em>within a Portal</em>"); } } On deployment, I'm getting a ClassCastException: Caused by: java.lang.ClassCastException: FirstPortlet cannot be cast to javax.po rtlet.Portlet

Liferay With Multiple Server Instances

一曲冷凌霜 提交于 2019-12-08 18:26:09
问题 I'm working with multiple Liferay Projects (different Portal, plugins, user and usergroups etc ) in the same time, and often have to switch between them. This switch requires lots of steps like Editing the portal-ext.properties (to change the Liferay Database, and edit some custom project-specific properties), and edit 'portal-setup-wizard.properties' Add/remove portlets themes and hooks from the Eclipse Server instance, sometimes clean the Tomcat's 'data' 'Webapps' and 'work' folder Go to

same bean id on different xml file, will it merge?

一笑奈何 提交于 2019-12-08 17:42:19
问题 i'm reading liferay source code and found out that 2 xml files using same bean-id. will all the properties merge together if using this way? dynamic-data-spring ---------------------- <bean id="liferayDataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy"> <property name="targetDataSource"> <bean class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="targetSource" ref="dynamicDataSourceTargetSource" /> </bean> </property> </bean>

Can the ResourceLocalService be called remotely via the JSON-WS API?

六眼飞鱼酱① 提交于 2019-12-08 13:31:31
问题 I'm trying to create a Liferay permissions resource using the JSON-WS API. I haven't found any JSON-WS API registered service methods in http://localhost:8080/api/jsonws for creating Resources. According to the JSON Web Services docs, you can remotely enable services by adding the @JSONWebService annotation. It is not clear to me how and if you can register Liferay's built-in services if they aren't already exposed. Also, the Javadocs for ResourceLocalService specifically state: This is a

Why the searchContainer variable is unknown?

牧云@^-^@ 提交于 2019-12-08 11:00:51
问题 I'm trying to do a simple example with the searchContainer working with liferay 6.1. The searchContainer variable is unknown in view.jsp. I get the error "searchContainer cannot be resolved". I tried to include <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> It didn't work. Code looks like this: <liferay-ui:search-container iteratorURL="<%= actionURL %>" delta="10" emptyResultsMessage="no-documents"> <liferay-ui:search-container-results total="<%= list.size() %>" results="<%

Uploading files to Liferay server

随声附和 提交于 2019-12-08 10:32:16
问题 I'm using Liferay 6.2 CE and I would like to add a simple functionality in which administrator can upload files to liferay server and add hyperlink to this file on the page. I've found in Liferay's 6.1 documentation that in that version administrator could just create a data list and add File Upload field there as shown below: Unfortunately in Liferay 6.2 this field doesn't exist (I'm confused here what's the reason): I also saw that during new blog post creation, there is this HTML in

Inter portlet communication in liferay

六眼飞鱼酱① 提交于 2019-12-08 09:58:12
问题 I am new in liferay. So, I just want to explain my scenario. Actually I have two portlet on my web page - one is in left side and other is on right side: he left side portlet contains two hyperlink say demo1 & demo2. And I have another two portlet say demo1Portlet & demo2Portlet. Instead of right side portlet "demo1Portlet" will be displayed by default. Now what I have to do is, if I click on demo2 link then, right side portlet will change and it will display "demo2Portlet" and if I click on