liferay-6

How do I make Liferay 6.1.0 always redirect to a 404 page when a resource isn't found?

ⅰ亾dé卋堺 提交于 2019-12-19 04:24:07
问题 I have created a simple hook for a Liferay site I have. It contains a 404.jsp that overrides the default Liferay 404. It works fine if I type in a specific page. For example: Going to http://localhost:8080/jooky.jsp throws SEVERE: PWC6117: File "C%3A%5Cbundles%5Cliferay-portal-6.1.0-ce-ga1%5Cglassfish-3.1.1%5Cdomains%5Cdomain1%5Capplications%5Cliferay-portal%5Cjooky.jsp" not found in my Glassfish server log and redirects me to my custom /errors/404.jsp without a problem. However, going to

How to customize which portlets to show in “Add more portlets” menu

痞子三分冷 提交于 2019-12-19 03:18:08
问题 I need to customize as to which portlet appear in the "Add more portlet menu" as shown in the image below: I need to restrict the number of portlets displayed in this menu based on the logged-in user or site (community). So that Site-owner or Site-admin will be able to add only those portlets to their pages which the omni-admin decides for them. Does Liferay provide any such functionality (through configuration or something) or do I have to create a new portlet and a hook to achieve this?

How to customize which portlets to show in “Add more portlets” menu

杀马特。学长 韩版系。学妹 提交于 2019-12-19 03:18:01
问题 I need to customize as to which portlet appear in the "Add more portlet menu" as shown in the image below: I need to restrict the number of portlets displayed in this menu based on the logged-in user or site (community). So that Site-owner or Site-admin will be able to add only those portlets to their pages which the omni-admin decides for them. Does Liferay provide any such functionality (through configuration or something) or do I have to create a new portlet and a hook to achieve this?

Is it possible to add Extra Fields Under Create User in Liferay

你离开我真会死。 提交于 2019-12-18 11:57:41
问题 I am using Liferay 6 for portal Development . During Creating Users under Liferay , i need to add some extra Fields also ?? Please let me know if this is ppossible or not ?? Please see the screen shot attached here , and also please let me know in which table this will be stored in Database ?? 回答1: Yes, you can use Custom Attributes functionality for liferay entities (in your case, User) and can add as many extra fields as necessary for each liferay entity. Custom field for the user-entity

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

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>

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,

Liferay 6.2 LAR import: No JournalFolder exists with the primary key 2

懵懂的女人 提交于 2019-12-13 09:40:04
问题 I'm trying to import a LAR file containing portlets, JournalFolders and JournalArticles from the Sites page with Import. However I get the following exception: com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portlet.journal.NoSuchFolderException: No JournalFolder exists with the primary key 2 at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:168) at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil

Liferay - autologin hook/portlet doesn't logout the current user

雨燕双飞 提交于 2019-12-13 05:31:29
问题 It seems Liferay's autologin hook doesn't logout the current user. So I tried to do it programmatically with the following method call: request.getSession().invalidate(); but with no success.Does anyone had the same issues with the auto-login hook ? 回答1: Hi to logout you have to invalidate the cookies and then invalidate the session see the Liferay LogoutAction for more detail https://github.com/liferay/liferay-portal/blob/6.2.x/portal-impl/src/com/liferay/portal/action/LogoutAction.java 回答2:

Liferay create site / page programmatically

我只是一个虾纸丫 提交于 2019-12-13 04:46:20
问题 I have been using Liferay for work for 2 weeks. I noticed that it's a bit difficult to find good documentation and tutorials. Until now I created pages from the web portal. After I create them, I drag and drop portlets. I don't really like this approach, I would prefer to use a coding approach. Is there a way to create a website or page programmatically by defining a project as I do to create portlets? Moreover, I am using Liferay with WebLogic 10.3.6. I want to know where liferay puts pages