liferay

JUnit Liferay services

混江龙づ霸主 提交于 2019-12-04 20:23:39
I use liferay service builder in my project and now i want to test *Util classes. It would be easy, but i don't know simple method of init environment. For example in ant testing with spring configuration from service.xml (auto generated) i use InitUtil.initWithSpring() for init beans, but get follow error: [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 2,413 sec [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 2,413 sec [junit] [junit] Testcase: testJournalArticleSearch(MTest): Caused an ERROR [junit] BeanLocator has not been set for servlet context My-portlet [junit]

How to disable default message: “Your request processed successfully”?

一世执手 提交于 2019-12-04 20:11:20
问题 How would I disable this default message: "Your request processed successfully" for my plugin portlet when an add/update action is performed in my portlet? Also I would want to disable this for my custom configuration page ( configuration.jsp ), this is the configuration page which is shown when we click on the wrench icon which appears on the top-right corner of every portlet. Is there a configuration option anywhere which I can set or some code which I can write to disable it? Or else would

How do I get Sites of which the user is a member in Liferay theme?

痞子三分冷 提交于 2019-12-04 20:03:30
In Liferay 6.1 custom theme - How can I get Sites for a user that it is a member of in a theme? I have seen how the dockbar Go to/My sites gets generated via the Liferay UI taglib. However, I want to get a list of user's sites and list them as part of super navigation bar separate from the dockbar options. Is this possible and what is the API call to get the user's sites in a list? Thanks in advance. From the user object you can retrieve the groups he belongs to: $user.mySites This returns a List<Group> . Once you have the Group you can easily build a URL to the public and private pages of

How to obtain the download url for a document library content programmatically

时间秒杀一切 提交于 2019-12-04 19:56:32
问题 I have several contents in my document library (images, documents, videos...) and I want to obtain the download url for each of them programmatically, so I can show them on a jsp in a custom portlet. Investigating, I have found this page with a possible solution: https://www.liferay.com/community/forums/-/message_boards/message/11073293 but I'm not comfortable with it, since it implies building the url manually with several parameters. I would like to know if there is a better way ("Liferay

How to migrate Liferay portal from one windows machine to other?

允我心安 提交于 2019-12-04 19:35:47
Liferay migration from one server to another help required. Can anyone share there steps for migration of Liferay portal 5.2.3 from one server to another. I am using Windows + Tomcat + MySql. I have uploaded whole tomcat folder to the new windows machine and imported the database too with the corresponding change to the configuration file like Database details. But after starting the tomcat server it is showing some error like "Unable to load repository http://plugins.liferay.com ". Any idea why I am getting this error ? Sunil Rai These are the steps that I have followed and able to migrate

Users are not getting deleted from Liferay DB

血红的双手。 提交于 2019-12-04 18:40:53
I have deleted users from Liferay UI. Some time its asking to deactivate and then delete. some time only deactivate. And users are not going from db always. So, recreation of same user is not possible as it is throwing errors like "email address already exist or username alreasdy exist". Why user is not getting deleted from DB after deletion from UI? I am using liferay-portal-6.1.1-ce-ga2. How to solve this issue? Prakash K Deactivate and Delete are two different functionalities. When you Deactivate the user remains in the database and only the status is changed to deactivate. This is known as

Liferay 7 not able to set the global session attribute

天大地大妈咪最大 提交于 2019-12-04 17:46:17
I am trying to set the Session attribute [HTTP or Portlet Session] so that i can access it globally (through out the portal). But while getting the Session attribute its returning me the null instead of actual value. SETTING the Session Attribute: @Component( immediate = true, property = { "com.liferay.portlet.display-category=IPC Sender", "com.liferay.portlet.instanceable=true", "javax.portlet.display-name=IPC_Sender Portlet", "javax.portlet.init-param.template-path=/", "javax.portlet.init-param.view-template=/view.jsp", "com.liferay.portlet.private-session-attributes=false", "javax.portlet

get Liferay user information with Vaadin

我们两清 提交于 2019-12-04 16:54:52
I need to check in my portlet wich language does an user have selected as his "main" language, to do that, I have to get the UserID (name) first . i have been looking for it for two days (Liferay forums , vaadin forums , stackoverflow etc.) but nothing found that would work so far. I have found an nice example but it doesnt seem to work (It always returns "null"). package com.example.translation_portlet; import javax.portlet.PortletRequest; import javax.portlet.PortletResponse; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception

How to use Liferay's permission system in other applications?

▼魔方 西西 提交于 2019-12-04 14:49:35
I'm considering using Liferay's permission system to implement access security in an external Java application (not a portlet). Liferay has robust features for managing users, groups, roles, permissions and resources. It would be great if I could leverage those instead of re-inventing the wheel in our external app. Liferay and our external application are configured to use the same CAS and LDAP for authentication, so they share the same users. So far I've successfully used Liferay's JSON-WS API to manage a user's Roles. This is great but I need to take it to the next step. Can I define and

Liferay: what is the relationship and difference between ActionRequest, RenderRequest and PortletRequest?

别说谁变了你拦得住时间么 提交于 2019-12-04 14:41:02
问题 What is the relationship and difference between ActionRequest , RenderRequest and PortletRequest ? Can we get instance of one from another? 回答1: The PortletRequest is the parent of both. An ActionRequest and a RenderRequest are both different types of PortletRequest objects. An ActionRequest is valid during the action processing phase of the portlet. During this phase, the portlet hasn't completely decided how it is going to render itself, be it minimized, maximized, in edit mode or in veiw