portlet

Handling Multipart request that is not an Action request?

邮差的信 提交于 2019-12-01 13:16:24
I've been thinking if it is possible to handle Multipart request that is not an Action request. There is a reason why it seems impossible to me : Only ActionRequest implements getFile() kind of methods. I can't find any easy way how to get the file out of request other than Action request What if I don't use a html form to upload a file and I don't want a view to be rendered after action request - render phase happens always after the action phase. What if I want to create a post request (with file(s)) by ajax and use @ResourceMapping handler. How do I get it out of ResourceRequest ? Thank you

Liferay Many-to-Many RelationShip Throws Class Cast Exception

放肆的年华 提交于 2019-12-01 13:02:49
问题 I am creating one example which demonstrates relationship in liferay.I am taking example of Book entity and Author for many to many relationship.I am following below blog for creating this example. http://www.liferaysavvy.com/2014/01/liferay-service-builder-many-to-many_12.html But I faced the issue of class cast exception.In blog also it has been written that it is throwing class cast exception. 11:05:00,422 ERROR [RuntimePageImpl-2][render_portlet_jsp:132] null java.lang.ClassCastException:

How to pass a value inside javascript to managed bean property without using hidden tags in JSF?

妖精的绣舞 提交于 2019-12-01 10:56:47
we wonder that if it is possible to get managed bean property value inside the javascript method in facelets or pass a javascript value to managed bean property but without using hidden tags? When we search about them what we see are all about the examples or solutions that use html hidden tags or hidden button's click events. But this method is not useful for us when we need much data exchange between managedbean and javascript as it needs lots of hidden tags. You can create a json object with name value pair like in a map and send them as a request parameters. You can have a p:remoteCommand

YUI Version Conflict Issue in Portlet

半世苍凉 提交于 2019-12-01 00:07:16
I'm loading yui.js 3.3.0 version file from portlet but liferay its using 3.2.0 yui.js file, so whenever i'm loading that page js errors are coming like G_ENV._loaded[VERSION] is undefined - this error is coming in yui.js which is liferay using that is 3.2.0 version. so its replacing value like G_ENV._loaded[3.2.0] and that will throw an error becoz we loaded 3.3.0 version from portlet. I replaced yui.js 3.2.0 version file in portlet but It was throwing some other js errors. How will it work same in 3.2.0 or Is there any way to update existing version of yui? This is the code of yui.js in this

What is the difference between PortalUtil.getOriginalServletRequest and PortalUtil.getHttpServletRequest?

假装没事ソ 提交于 2019-11-30 22:57:00
I want to know the difference between PortalUtil.getOriginalServletRequest(portletRequest) and PortalUtil.getHttpServletRequest(portletRequest). Looking at the source code for Liferay 6 (I'm assuming your're talking about 6) you can see what PortalUtil.getOriginalServletRequest does and I've placed the code below: public HttpServletRequest getOriginalServletRequest( HttpServletRequest request) { HttpServletRequest originalRequest = request; while (originalRequest.getClass().getName().startsWith( "com.liferay.")) { // Get original request so that portlets inside portlets render // properly

How to add nested portlets(liferay) through code

最后都变了- 提交于 2019-11-30 21:46:39
We have something called nested portlets in liferay. I want to add this portlet dynamically through code. Does anyone know the code for adding nested portlets, and add other portlets inside it? Thanks !!! Martin Gamulin for complete example i'll assume that you want to add nested portlet to current page using another portlets action handler. (if used from render action you would not see nested portlet until next view of the page) Add these methods to your code private static String addPortlet(final long p_userId, final Layout p_layout, final String p_portletId, final String p_columnId, final

What is the difference between PortalUtil.getOriginalServletRequest and PortalUtil.getHttpServletRequest?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 17:48:47
问题 I want to know the difference between PortalUtil.getOriginalServletRequest(portletRequest) and PortalUtil.getHttpServletRequest(portletRequest). 回答1: Looking at the source code for Liferay 6 (I'm assuming your're talking about 6) you can see what PortalUtil.getOriginalServletRequest does and I've placed the code below: public HttpServletRequest getOriginalServletRequest( HttpServletRequest request) { HttpServletRequest originalRequest = request; while (originalRequest.getClass().getName()

How to set a Cookie in Liferay portlet?

[亡魂溺海] 提交于 2019-11-30 15:22:36
问题 I am having problems of trying to set a session cookie(s) in Liferay 6.0 portlets . I want to be able to set a cookie to the client browser to store application key for the linkedin authentication, where it can be then retrieved by other portlets. I am able to read cookies by using a following: public void addLinkedInCV(ActionRequest request, ActionResponse response) throws PortalException, SystemException { HttpServletRequest convertReq = PortalUtil.getHttpServletRequest(request); Cookie[]

How to set a Cookie in Liferay portlet?

♀尐吖头ヾ 提交于 2019-11-30 13:47:43
I am having problems of trying to set a session cookie(s) in Liferay 6.0 portlets . I want to be able to set a cookie to the client browser to store application key for the linkedin authentication, where it can be then retrieved by other portlets. I am able to read cookies by using a following: public void addLinkedInCV(ActionRequest request, ActionResponse response) throws PortalException, SystemException { HttpServletRequest convertReq = PortalUtil.getHttpServletRequest(request); Cookie[] cookies = convertReq.getCookies(); ... } Here's my failed attempt to read one. @Override public void

Open portlet from other portlet

筅森魡賤 提交于 2019-11-30 09:55:23
问题 Is it possible to open pop up window from one portlet, that contains some other portlet ? <portlet:renderURL var="kategorijaSelectorURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <portlet:param name="mvcPath" value="/html/kategorija/view.jsp" /> <portlet:param name="struts_action" value="/html/kategorija/view.jsp" /> <portlet:param name="tabs1" value="kategorije" /> <portlet:param name="redirect" value="<%=redirect1 %>" /> </portlet:renderURL> 回答1: yes you can. var url;