liferay-6

Programmatically get the url of a page in liferay

雨燕双飞 提交于 2019-11-29 11:22:43
问题 I want to create a link in a portlet so that I can navigate to a different page in the liferay portal. I order to do that I am looking for an API (can be liferay specific) that given a page name, would return it's url (it can be the friendlyURL as well). 回答1: The API to access pages in Liferay is the LayoutService. However, page names are not unique in Liferay and furthermore they are internationalized. So you need some unique property for a page to retrieve its url, besides its name. If you

How to create a top-level servlet in liferay

元气小坏坏 提交于 2019-11-29 10:22:23
I wanted to create a servlet in liferay that is listening to a URL such as http://localhost:8080/my-servlet I tried to add it to a portlet but the I have the URL http://localhost:8080/my-portlet/my-servlet I tried to add my servlet description to the web.xml of ext-web, but no luck. Is there any way to add such a servlet ? Liferay is also "Servlet"-Application - but a very-very big one. And Liferay need some servlet container like tomcat, jetty, jboss etc. However, you can simple create servlet project and deploy it direct to servlet container where liferay is running. edit: and put to web.xml

How can I get the current user in Liferay?

最后都变了- 提交于 2019-11-29 06:44:28
问题 How can I get the current user connected to a Liferay portal with a simple Java code? I'm using Liferay 6.0.6 回答1: Simply: User currentUser = PortalUtil.getUser(request); 回答2: In your doView/processAction method do following User user = (User) request.getAttribute(WebKeys.USER); or use the ThemeDisplay object. It contains another information like companyId, groupId, ... ThemeDisplay td =(ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY); User user = td.getUser(); Classes ThemeDisplay,

memberOf vs. groupMembership in LDAP (Liferay)

左心房为你撑大大i 提交于 2019-11-29 04:35:25
What is the difference b/n memberOf attribute and groupMembership attribute when used in LDAP Authentication settings in Liferay? The users are imported successfully. The groups are also imported successfully. But the users are not assigned to the groups automatically. And when I changed the group variable from 'groupMembership' to 'memberOf', several users are not able to login to Liferay. What exactly are memberOf and groupMembership variables? memberOf is not a "variable", it is an attribute, or more accurately, it is a virtual attribute, or a dynamic attribute generated on the fly by some

extend session of Liferay when performing AJAX call

混江龙づ霸主 提交于 2019-11-29 03:56:05
问题 I created a portlet that uses AJAX every function. That is, the portlet is only rendered once and i didnt utilize processAction or the like. Is there a way to extend the user's session using built in Liferay function using javascript? I tried Liferay.Session.extend(); but it does not seem to work.. I also tried a solution in the ICEfaces forum, which is if (Liferay.Session._stateCheck) { window.clearTimeout(Liferay.Session._stateCheck); Liferay.Session._stateCheck = null; } Liferay.Session

ERROR: application/pdf is not a supported mime type [duplicate]

安稳与你 提交于 2019-11-28 14:03:41
This question is an exact duplicate of: File is not downloading from server 3 answers I am using Struts2 and Liferay for developing an application. My struts.xml is as follows: <action name="download" class="com.stp.portal.view.DownloadAction"> <result name="success" type="stream"> <param name="contentType">application/pdf</param> <param name="inputName">fileInputStream</param> <param name="contentDisposition">attachment;filename="abc.pdf"</param> <param name="bufferSize">1024</param> </result> </action> I basically want to download a pdf file from the server. But I get the following error: 10

Serve PDF in Spring Portlet MVC Architecture - Liferay 6.0.6

自作多情 提交于 2019-11-28 08:50:29
I was looking for a way to send a PDF (direct display) file to the browser through Liferay Portal. Found many solutions - the most popular one being writing a Servlet that does the job. I've read about Portlet Resource Serving in JSR 286 Specification, can someone please elaborate on that for Spring 3.0 Portlet MVC? <servlet> <display-name>DownloadServlet</display-name> <servlet-name>DownloadServlet</servlet-name> <servlet-class>com.liferay.portal.pdf.DownloadServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>DownloadServlet</servlet-name> <url-pattern>/DownloadServlet/*</url

How to create a top-level servlet in liferay

橙三吉。 提交于 2019-11-28 03:39:18
问题 I wanted to create a servlet in liferay that is listening to a URL such as http://localhost:8080/my-servlet I tried to add it to a portlet but the I have the URL http://localhost:8080/my-portlet/my-servlet I tried to add my servlet description to the web.xml of ext-web, but no luck. Is there any way to add such a servlet ? 回答1: Liferay is also "Servlet"-Application - but a very-very big one. And Liferay need some servlet container like tomcat, jetty, jboss etc. However, you can simple create

Liferay Service Builder 6.2: Many to one relationships

一世执手 提交于 2019-11-28 00:35:00
问题 I want to create a one to many relationships and I've used the following service.xml: <entity name="Student" local-service="true" remote-service="true" cache-enabled="false"> <column name="studentId" type="long" primary="true" /> <column name="courses" type="Collection" entity="Course"/> </entity> <entity name="Course" local-service="true" remote-service="true" cache-enabled="false"> <column name="courseId" type="long" primary="true" /> <column name="studentId" type="long"/> </entity> My

How to find portlets added on a particular page in Liferay?

老子叫甜甜 提交于 2019-11-27 23:38:53
问题 How can I find which portlets are added on a particular Liferay page? For Example: I have three pages: Welcome , Wiki and Search . Now all these pages have portlets added on them and some of them are instanceable portlets (like web-content display and iframe portlets). Now I want to pass some information in the form of request parameters to the iframe-portlet on the Search page from the Welcome page . 回答1: I have found two ways to do this: If you want to find the portlets on the same page in