portlet

How to replace a function on a Liferay native portlet

不想你离开。 提交于 2019-12-09 04:52:04
问题 I am making a change to a native Liferay portlet, that comes with Liferay Intallation. How can I change a function to my own implementation by a hook or similar approach? I have read how to make pre and post conditions and how to make new implementation of an interface, but I don't know how to just replace random function inside random class at a portlet that I want to keep otherwise as it is originally. 回答1: There are several ways you can modify the functionality of a native Liferay portlet.

How to make the ResourceResponse to forward the request to error page in liferay portlet

折月煮酒 提交于 2019-12-09 03:36:24
问题 I am trying to forward my request to error page when error occurs during generating excel sheet. Here is sample code below. I am not sure why it is not getting forwarded to error page when the exception is thrown, it is displaying blank page but not going to my error page for sure.` @ResourceMapping("xyz") public void generateExcelExport(ResourceRequest request, ResourceResponse response) { try { //Do all the excel related logic response.setContentType("application/vnd.openxmlformats

How to get Portlet Id using the portlet name in Liferay?

安稳与你 提交于 2019-12-09 02:51:50
问题 I have a requirement of getting resource permission using portlet name. I will have the name of the portlet not the Id. Resource Permission name for a portlet is that portlet's Id. I checked the Portlet table, it has only the Id and other info. Where will be the other attributes of portlet saved?. Is there a way I can get portlet's Id by using portlet's name. I have a workaroud to get all portlets and compare, but if I can directly get portlet's Id using portlet's name it will be helpful. Its

Deploying a simple Portlet to Liferay - ClassCastException

梦想的初衷 提交于 2019-12-08 21:26:27
问题 I'm deploying the most basic Portlet possible to Liferay: public class FirstPortlet extends GenericPortlet { @RenderMode(name="VIEW") public void welcomeWelcome(RenderRequest request, RenderResponse response) throws PortletException, IOException { PrintWriter out = response.getWriter(); out.println ("This is a portlet, <em>within a Portal</em>"); } } On deployment, I'm getting a ClassCastException: Caused by: java.lang.ClassCastException: FirstPortlet cannot be cast to javax.po rtlet.Portlet

Upload a file from client side to server side with ajax and spring portlet

不羁岁月 提交于 2019-12-08 12:37:06
问题 I need to upload a file from client side to server side with ajax. I have read that it is possible but doesn't work in my project. I'm working with Jquery and Spring Portlet. This is my code at client side: <form method="post" id="formUploadFile"> <input id="uprloadFile" type="file" name="file"/> <input id="submitButton" type="button" value="Upload File" /> </form> javascript: var dataFormulario = new FormData($('#formUploadFile')[0]); $.ajax({ url : accredit.cargarDocumentoURL, type : "POST"

Could not connect to SMTP host: localhost, port: 25?

余生长醉 提交于 2019-12-08 10:06:58
问题 am using liferay 6 and created one custom class..i want to create mail notification function...I have written following code in my class private void SendEmail(NotificationObject pNotificatonObj, String[] pReciepientAddresses) throws MessagingException { log.info("In SendMail"); Properties props = new Properties(); props.put("mail.debug", "true"); props.put("mail.smtp.socketFactory.fallback", "false"); Session session = Session.getInstance(props); Message msg = new MimeMessage(session);

Inter portlet communication in liferay

六眼飞鱼酱① 提交于 2019-12-08 09:58:12
问题 I am new in liferay. So, I just want to explain my scenario. Actually I have two portlet on my web page - one is in left side and other is on right side: he left side portlet contains two hyperlink say demo1 & demo2. And I have another two portlet say demo1Portlet & demo2Portlet. Instead of right side portlet "demo1Portlet" will be displayed by default. Now what I have to do is, if I click on demo2 link then, right side portlet will change and it will display "demo2Portlet" and if I click on

Accessing FacesContext in Util jar from multiple portlets

你离开我真会死。 提交于 2019-12-08 06:23:56
问题 We have several JSF portlets running in a websphere portal environment. A developer wants to create a Utility jar which would live in the shared library, so all portlets could access it. In this jar he wants a faces utility class which would have a static method; this method would access the current FacesContext instance and return that context's session map. We have been having some discussion over whether this is a wise approach, and how we know for sure that the correct context instance

ERROR: 'ContentNegotiatingViewResolver'of Spring 3.0.3 MVC Portlet+JSON

跟風遠走 提交于 2019-12-08 03:41:34
问题 I want to make spring MVC 3.0.3 portlet using DispatcherPortlet class With JSON support. So, i added following configuration in the spring context file. <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> text/html Without this, if i use the 'InternalResourceViewResolver' only then it runs fine and i am able to use the portlet. But with this bean defined, i got the following error on tomcat startup. I googled around and find a link stating that this bean with

Attach the uploaded file as an email

北战南征 提交于 2019-12-08 03:15:20
问题 I am using the apache commons fileupload for uploading the file. I want to attach this file to an email. I don't want to write to temp file but I want to keep the data in memory and send it as an attachment. I need direction from here. Thanks in advance DiskFileItemFactory factory = new DiskFileItemFactory(); PortletFileUpload upload = new PortletFileUpload(factory); List items = upload.parseRequest(request); Iterator iter = items.iterator(); while(iter.hasNext()) { FileItem item = (FileItem)