liferay

Singleton class to be shared among multiple portlets

懵懂的女人 提交于 2019-12-01 00:15:52
I have a couple of Singleton classes in a Liferay application that hold several configuration parameters and a ServiceLocator with instances to WebServices I need to consume. I have put these classes in a jar that is declared as a dependency on all my portlets. The thing is, I have put some logging lines for initialization in theses singleton classes, and when I deploy my portlets I can see these lines multiple times, once for every portlet, since each portlet has its own class context. For the AppConfig class it might not be such a big deal but my ServiceLocator does actually hold a bunch of

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

why settimeout not delay the function execution?

会有一股神秘感。 提交于 2019-11-30 23:50:30
问题 function tryToDownload(url) { oIFrm = document.getElementById('myIFrm'); oIFrm.src = url; // alert(url); // url=escape(url); setTimeout(deletefile(url), 25000); } following is deletfile function function deletefile(url){ $.ajax({ type:'post', url: "<%= addToDoDeleteDownloadFile %>", data:{filename:url}, type : "GET", timeout : 20000, dataType : "text", success : function(data) { alert("success"); } }); } above is my jQuery and i m calling one function at the end after 25 second,but some how

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

Error when starting Liferay 7 (liferay-portal-7.0-ce-ga1): PWC6345: There is an error in invoking javac.A full JDK (not just JRE) is required

≡放荡痞女 提交于 2019-11-30 18:23:34
问题 I am getting the following error when starting Liferay (liferay-portal-7.0-ce-ga1): org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required I have set my system environment variables correctly: JAVA_HOME: C:\Program Files\Java\jdk1.7.0_80 JRE_HOME: C:\Program Files\Java\jre7 I have added my JAVA_HOME path to my system Path variable: ....;C:\Program Files\Java\jdk1.7.0_80\bin; When I run the windows where javac command, I get the

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()

Save file to Document directory in liferay 6.1 using API

只谈情不闲聊 提交于 2019-11-30 16:35:30
I need to save a uploaded file in sub directory of Document & Media folder in liferay from web-form portlet. I have extended the web Form portlet to do so, but file is getting uploaded successfully in database & not in Document & Media folder. I tried following code to upload the file in document directory but no success please help . ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); String title = file.getName(); DLFolder dlFolder = DLFolderLocalServiceUtil.getFolder(themeDisplay.getScopeGroupId(), 0, "Test"); ServiceContext serviceContext =

Install Liferay as Windows 2012R2 service

萝らか妹 提交于 2019-11-30 16:27:21
I am a newbie on Liferay and furthermore 100% Windows infrastructure knowledge based. I installed Liferay 6.2 on my Windows 2012R2 server together with Java jdk-8u5 version. All is running perfect as long as I am logged in as user on the Server via remotedesktop having open the tomcat startup.bat window. What have I to do exactly to start Liferay and/or tomcat as service? Thanks in advance for your efforts. Configuring liferay or tomcat to run as a service on a windows server doesn't differ that much.So in order to do that you have to add some files to the LIFERAY_HOME\tomcat\bin directory. To

Save file to Document directory in liferay 6.1 using API

拟墨画扇 提交于 2019-11-30 16:17:37
问题 I need to save a uploaded file in sub directory of Document & Media folder in liferay from web-form portlet. I have extended the web Form portlet to do so, but file is getting uploaded successfully in database & not in Document & Media folder. I tried following code to upload the file in document directory but no success please help . ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); String title = file.getName(); DLFolder dlFolder =