Alvaro Del Castillo 15 Years Ago Really nice Ray! A great starting point to understand personalization. I hope some of these contents reach the developer guide. Please sign in to reply. Reply as... Cancel Ray Augé Alvaro Del Castillo 15 Years Ago Thanks! Please sign in to reply. Reply as... Cancel
Thomas Ballerstedt 15 Years Ago I really like your [HOWTO]'s. Thank you very much! Please sign in to reply. Reply as... Cancel Ray Augé Thomas Ballerstedt 15 Years Ago Much appreciated! Please sign in to reply. Reply as... Cancel
Ray Augé Thomas Ballerstedt 15 Years Ago Much appreciated! Please sign in to reply. Reply as... Cancel
Hans-Georg Menz 15 Years Ago I like this HOWTO very much, but I still have a question. Maybe you can help me with that. Do you know how to get the req in ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY);in an ICEFaces portlet? Please sign in to reply. Reply as... Cancel Ray Augé Hans-Georg Menz 15 Years Ago Thank you very much!I'm not a *Faces export by any means, BUT I think that in general you can do something like this:FacesContext fCtx = FacesContext.getCurrentInstance();PortletRequest req = (PortletRequest)fCtx.getExternalContext().getRequest();_themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY);Please note that a common mistake with *Faces is that "some" requests aren't actually handled by the portal. Those will never have portal attributes, like "ThemeDisplay" in them, unless you add some sort of special handling. Please sign in to reply. Reply as... Cancel Ruben Gerad Mathew Hans-Georg Menz 13 Years Ago Insert the following in web.xml <context-param> <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name> <param-value>THEME_DISPLAY</param-value> </context-param>Then you can access Theme Display by adding the code in your Managed Bean:avax.portlet.PortletRequest req = (javax.portlet.PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();RenderRequest renderRequest = (RenderRequest) req.getAttribute("javax.portlet.request");ThemeDisplay _theme = (ThemeDisplay) req.getAttribute(WebKeys.THEME_DISPLAY);System.err.println(_theme.getCompany() + " : " + _theme.getCompanyId());System.out.println(_theme.getUser().getFullName() + " : " + _theme.getUserId()); Please sign in to reply. Reply as... Cancel
Ray Augé Hans-Georg Menz 15 Years Ago Thank you very much!I'm not a *Faces export by any means, BUT I think that in general you can do something like this:FacesContext fCtx = FacesContext.getCurrentInstance();PortletRequest req = (PortletRequest)fCtx.getExternalContext().getRequest();_themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY);Please note that a common mistake with *Faces is that "some" requests aren't actually handled by the portal. Those will never have portal attributes, like "ThemeDisplay" in them, unless you add some sort of special handling. Please sign in to reply. Reply as... Cancel
Ruben Gerad Mathew Hans-Georg Menz 13 Years Ago Insert the following in web.xml <context-param> <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name> <param-value>THEME_DISPLAY</param-value> </context-param>Then you can access Theme Display by adding the code in your Managed Bean:avax.portlet.PortletRequest req = (javax.portlet.PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();RenderRequest renderRequest = (RenderRequest) req.getAttribute("javax.portlet.request");ThemeDisplay _theme = (ThemeDisplay) req.getAttribute(WebKeys.THEME_DISPLAY);System.err.println(_theme.getCompany() + " : " + _theme.getCompanyId());System.out.println(_theme.getUser().getFullName() + " : " + _theme.getUserId()); Please sign in to reply. Reply as... Cancel
aligator fred 15 Years Ago <b>No tag "user-display" defined in tag library imported with prefix "liferay-ui"</b> error..there is no file liferay-plugin-package.properties either ? ... Please sign in to reply. Reply as... Cancel aligator fred aligator fred 15 Years Ago as im the only unhappy one here im hoping its just me being a liferay anoying noob Please sign in to reply. Reply as... Cancel Ray Augé aligator fred 15 Years Ago What environment are you working with a portlet or a theme? In ext or SDK? Please sign in to reply. Reply as... Cancel M Murali Krishna Reddy Ray Augé 15 Years Ago Hi Ray, I did all the settings, but I always get null for all the objects like themeDisplay and user etc. Please sign in to reply. Reply as... Cancel auditya manikanta vadrevu M Murali Krishna Reddy 15 Years Ago hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done Please sign in to reply. Reply as... Cancel Jane Eriksson Ray Augé 14 Years Ago Hi Ray,I am trying to get this working, but I get Given Name : null.First of all I am working with a portlet and I am using SDK 5.2.2. I am not sure where to put the <portlet-app> configurations. Is there something that is already written somewhere or shall I write it in some file, in that case, which one. If it is already written, what else can be wrong?Thanks! Please sign in to reply. Reply as... Cancel Ray Augé Jane Eriksson 14 Years Ago The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). Please sign in to reply. Reply as... Cancel Jane Eriksson Ray Augé 14 Years Ago I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. Please sign in to reply. Reply as... Cancel
aligator fred aligator fred 15 Years Ago as im the only unhappy one here im hoping its just me being a liferay anoying noob Please sign in to reply. Reply as... Cancel Ray Augé aligator fred 15 Years Ago What environment are you working with a portlet or a theme? In ext or SDK? Please sign in to reply. Reply as... Cancel M Murali Krishna Reddy Ray Augé 15 Years Ago Hi Ray, I did all the settings, but I always get null for all the objects like themeDisplay and user etc. Please sign in to reply. Reply as... Cancel auditya manikanta vadrevu M Murali Krishna Reddy 15 Years Ago hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done Please sign in to reply. Reply as... Cancel Jane Eriksson Ray Augé 14 Years Ago Hi Ray,I am trying to get this working, but I get Given Name : null.First of all I am working with a portlet and I am using SDK 5.2.2. I am not sure where to put the <portlet-app> configurations. Is there something that is already written somewhere or shall I write it in some file, in that case, which one. If it is already written, what else can be wrong?Thanks! Please sign in to reply. Reply as... Cancel Ray Augé Jane Eriksson 14 Years Ago The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). Please sign in to reply. Reply as... Cancel Jane Eriksson Ray Augé 14 Years Ago I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. Please sign in to reply. Reply as... Cancel
Ray Augé aligator fred 15 Years Ago What environment are you working with a portlet or a theme? In ext or SDK? Please sign in to reply. Reply as... Cancel M Murali Krishna Reddy Ray Augé 15 Years Ago Hi Ray, I did all the settings, but I always get null for all the objects like themeDisplay and user etc. Please sign in to reply. Reply as... Cancel auditya manikanta vadrevu M Murali Krishna Reddy 15 Years Ago hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done Please sign in to reply. Reply as... Cancel Jane Eriksson Ray Augé 14 Years Ago Hi Ray,I am trying to get this working, but I get Given Name : null.First of all I am working with a portlet and I am using SDK 5.2.2. I am not sure where to put the <portlet-app> configurations. Is there something that is already written somewhere or shall I write it in some file, in that case, which one. If it is already written, what else can be wrong?Thanks! Please sign in to reply. Reply as... Cancel Ray Augé Jane Eriksson 14 Years Ago The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). Please sign in to reply. Reply as... Cancel Jane Eriksson Ray Augé 14 Years Ago I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. Please sign in to reply. Reply as... Cancel
M Murali Krishna Reddy Ray Augé 15 Years Ago Hi Ray, I did all the settings, but I always get null for all the objects like themeDisplay and user etc. Please sign in to reply. Reply as... Cancel auditya manikanta vadrevu M Murali Krishna Reddy 15 Years Ago hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done Please sign in to reply. Reply as... Cancel
auditya manikanta vadrevu M Murali Krishna Reddy 15 Years Ago hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done Please sign in to reply. Reply as... Cancel
Jane Eriksson Ray Augé 14 Years Ago Hi Ray,I am trying to get this working, but I get Given Name : null.First of all I am working with a portlet and I am using SDK 5.2.2. I am not sure where to put the <portlet-app> configurations. Is there something that is already written somewhere or shall I write it in some file, in that case, which one. If it is already written, what else can be wrong?Thanks! Please sign in to reply. Reply as... Cancel Ray Augé Jane Eriksson 14 Years Ago The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). Please sign in to reply. Reply as... Cancel Jane Eriksson Ray Augé 14 Years Ago I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. Please sign in to reply. Reply as... Cancel
Ray Augé Jane Eriksson 14 Years Ago The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). Please sign in to reply. Reply as... Cancel Jane Eriksson Ray Augé 14 Years Ago I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. Please sign in to reply. Reply as... Cancel
Jane Eriksson Ray Augé 14 Years Ago I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. Please sign in to reply. Reply as... Cancel
Pierre Denis 15 Years Ago Thanks for this post. I have a question on a topic related to personalization.When a logged user adds, positions or emove a portlet on a page of the portal, the page configuration is persisted somewhere; so the user, for his next session, will retrieve the his set of portlets, in his specific layout. For example,- user Joe has a News portlet on the left and Wheather portlet on the right;- user Sarah has a Weather portlet on top and a Map Viewer portlet on the bottom.The same applies for the specific list of pages, with chosen layout templates, configured by each user.What is exactly the name for this kind of settings (in Liferay or elsewhere)?Is this standardized (JSR-168 or JSR-286)?To be clear, my question is at the level of portal page. I DON'T speak here about- preferences/configuration of one specific portlet- Liferay themes- user profiles (name, address, etc)Thanks Please sign in to reply. Reply as... Cancel
Raju A K 15 Years Ago Hi Ray,Is it possible to achieve rules based personalization or say unified user profile attributes like one available with weblogic ?ThanksRaju Please sign in to reply. Reply as... Cancel Ray Augé Raju A K 15 Years Ago Do you have some references I can read on both these topics? I've never used the terminology, so I can't really comment on whether we can or can't do it. Thanks Please sign in to reply. Reply as... Cancel Raju A K Ray Augé 15 Years Ago Sorry for delay.Rules based personalization: based on embedded business rules like say if A then B defined say using a drools rules engine or like web sphere which has a rules engine as part of personalization .Useful link:http://www.atgsolutionsstrategy.com/2008/09/personalization.htmlUnified user Profile is more Weblogic Portal specific which allows to create and manage unified user profiles for personalization.Heres a useful bea link:http://edocs.bea.com/wlp/docs92/users/uup.htmlDoes liferay support use of say drools rules engine just like it supports jBPM for process management .ThanksRaju Please sign in to reply. Reply as... Cancel
Ray Augé Raju A K 15 Years Ago Do you have some references I can read on both these topics? I've never used the terminology, so I can't really comment on whether we can or can't do it. Thanks Please sign in to reply. Reply as... Cancel Raju A K Ray Augé 15 Years Ago Sorry for delay.Rules based personalization: based on embedded business rules like say if A then B defined say using a drools rules engine or like web sphere which has a rules engine as part of personalization .Useful link:http://www.atgsolutionsstrategy.com/2008/09/personalization.htmlUnified user Profile is more Weblogic Portal specific which allows to create and manage unified user profiles for personalization.Heres a useful bea link:http://edocs.bea.com/wlp/docs92/users/uup.htmlDoes liferay support use of say drools rules engine just like it supports jBPM for process management .ThanksRaju Please sign in to reply. Reply as... Cancel
Raju A K Ray Augé 15 Years Ago Sorry for delay.Rules based personalization: based on embedded business rules like say if A then B defined say using a drools rules engine or like web sphere which has a rules engine as part of personalization .Useful link:http://www.atgsolutionsstrategy.com/2008/09/personalization.htmlUnified user Profile is more Weblogic Portal specific which allows to create and manage unified user profiles for personalization.Heres a useful bea link:http://edocs.bea.com/wlp/docs92/users/uup.htmlDoes liferay support use of say drools rules engine just like it supports jBPM for process management .ThanksRaju Please sign in to reply. Reply as... Cancel
nidhi singh 15 Years Ago hii got good idea about personalization, but i have 1 question that, if i want to change the theme users to user how will i do? Please sign in to reply. Reply as... Cancel Michael Poznecki nidhi singh 15 Years Ago How do you display any of the themeDisplay values?Michael Please sign in to reply. Reply as... Cancel Ray Augé Michael Poznecki 15 Years Ago I'm not sure what you're asking! Can you explain what you are trying to do? Please sign in to reply. Reply as... Cancel Ray Augé nidhi singh 15 Years Ago I'll make a quick blog post about this since I now have 2 inquires of how to do this.Coming soon! Please sign in to reply. Reply as... Cancel touka touka Ray Augé 13 Years Ago Hi Raythank you for the HOWTObut i still have null when i use liferay.user.nickName !!!!Any idea for this!!! Please sign in to reply. Reply as... Cancel Ray Augé touka touka 13 Years Ago How are you using that field? I don't know if that field is even defined! It should be "user.name.nickName" Please sign in to reply. Reply as... Cancel
Michael Poznecki nidhi singh 15 Years Ago How do you display any of the themeDisplay values?Michael Please sign in to reply. Reply as... Cancel Ray Augé Michael Poznecki 15 Years Ago I'm not sure what you're asking! Can you explain what you are trying to do? Please sign in to reply. Reply as... Cancel
Ray Augé Michael Poznecki 15 Years Ago I'm not sure what you're asking! Can you explain what you are trying to do? Please sign in to reply. Reply as... Cancel
Ray Augé nidhi singh 15 Years Ago I'll make a quick blog post about this since I now have 2 inquires of how to do this.Coming soon! Please sign in to reply. Reply as... Cancel touka touka Ray Augé 13 Years Ago Hi Raythank you for the HOWTObut i still have null when i use liferay.user.nickName !!!!Any idea for this!!! Please sign in to reply. Reply as... Cancel Ray Augé touka touka 13 Years Ago How are you using that field? I don't know if that field is even defined! It should be "user.name.nickName" Please sign in to reply. Reply as... Cancel
touka touka Ray Augé 13 Years Ago Hi Raythank you for the HOWTObut i still have null when i use liferay.user.nickName !!!!Any idea for this!!! Please sign in to reply. Reply as... Cancel Ray Augé touka touka 13 Years Ago How are you using that field? I don't know if that field is even defined! It should be "user.name.nickName" Please sign in to reply. Reply as... Cancel
Ray Augé touka touka 13 Years Ago How are you using that field? I don't know if that field is even defined! It should be "user.name.nickName" Please sign in to reply. Reply as... Cancel
Aravind Kumar 15 Years Ago Thanks for the post Ray. I would like to fetch the Liferay logged User's UserGroup Names. How can I do that? Please sign in to reply. Reply as... Cancel Ray Augé Aravind Kumar 14 Years Ago List<UserGroup> com.liferay.portal.service.UserGroupLocalServiceUtil.getUserUserGroups(long userId) throws SystemException; Please sign in to reply. Reply as... Cancel
Ray Augé Aravind Kumar 14 Years Ago List<UserGroup> com.liferay.portal.service.UserGroupLocalServiceUtil.getUserUserGroups(long userId) throws SystemException; Please sign in to reply. Reply as... Cancel
Jeff M. Tackett 14 Years Ago I was trying to figure out how to get the phone number of a user. I am using the themeDisplay object and I just can't find the phone numbers. Please sign in to reply. Reply as... Cancel Jeff M. Tackett Jeff M. Tackett 14 Years Ago Nevermind, I have found a way to get the phone number. Please sign in to reply. Reply as... Cancel
Jeff M. Tackett Jeff M. Tackett 14 Years Ago Nevermind, I have found a way to get the phone number. Please sign in to reply. Reply as... Cancel
Garry Seto 14 Years Ago Hi Ray,Very helpful post! But I am having trouble with one specific attribute, Job Title. I've followed the code exactly and all the other attributes are retrieved correctly but Job Title keeps on coming back NULL. I am using LifeRay 5.2.2. Please let me know if you've or anyone has encountered this before or if this is a known issue.Thanks,Garry Please sign in to reply. Reply as... Cancel
Ruben Gerad Mathew 13 Years Ago Hi, I have a question with regard to personalization, since portlets reside on the same JVM can I use the static Util class which are also available through spring to create and remove content like shown below using my Icefaces portlets Managed Bean class:public class KeyAccess { public void invoke() { try { javax.portlet.PortletRequest req = (javax.portlet.PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); RenderRequest renderRequest = (RenderRequest) req.getAttribute("javax.portlet.request"); ThemeDisplay _theme = (ThemeDisplay) req.getAttribute(WebKeys.THEME_DISPLAY); System.err.println(_theme.getCompany() + " : " + _theme.getCompanyId()); System.out.println(_theme.getUser().getFullName() + " : " + _theme.getUserId()); com.liferay.portlet.announcements.service.AnnouncementsEntryLocalServiceUtil ann = new AnnouncementsEntryLocalServiceUtil(); com.liferay.portlet.messageboards.service.MBMessageLocalServiceUtil msg = new MBMessageLocalServiceUtil(); MBMessage message = msg.createMBMessage(1001); message.setBody("My Simple Message"); message.setSubject("TEST Message"); message.setCompanyId(_theme.getCompanyId()); message.setUserId(_theme.getUserId()); message.setUserName(_theme.getUser().getFullName()); message.setCategoryId(1); msg.updateMBMessage(message); // AnnouncementsEntry entry = ann.createAnnouncementsEntry(109);// Calendar cal = Calendar.getInstance();// entry.setCompanyId(_theme.getCompanyId());// entry.setUserId(_theme.getUserId());// entry.setAlert(true);// entry.setContent("adfads asdfasdf asdfsadf asdfasdf");// entry.setCreateDate(cal.getTime());// entry.setDisplayDate(cal.getTime());// ann.updateAnnouncementsEntry(entry); } catch (SystemException ex) { Logger.getLogger(KeyAccess.class.getName()).log(Level.SEVERE, null, ex); } }} Please sign in to reply. Reply as... Cancel Ray Augé Ruben Gerad Mathew 13 Years Ago Not sure why you have to get the RenderRequest from the already obtained PortletRequest (should both the be the same objects), but perhaps this is a quirck with faces I'm not aware of...Otherwise try this:----------------------------------------try{ RenderRequest renderRequest = ... ThemeDisplay _theme = (ThemeDisplay)renderRequest.getAttribute( WebKeys.THEME_DISPLAY); List<ObjectValuePair<String, byte[]>> files = Collections.EMPTY_LIST; ServiceContext serviceContext = ServiceContextFactory.getInstance( MBMessage.class.getName(), renderRequest); MBMessageLocalServiceUtil.addMessage( _theme.getUserId(), _theme.getUser().getFullName(), _theme.getScopeGroupId(), MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, "TEST Message", "My Simple Message", files, false, MBThreadConstants.PRIORITY_NOT_GIVEN, true, serviceContext);}catch (SystemException ex) { ...}----------------------------------------Furthermore, there is no need to initialize the services as these are singletons that are ready for use. Just invoke their static methods.Also, use the factory add/delete/update methods from core services unless you are ABSOLUTELY sure what you are doing. Please sign in to reply. Reply as... Cancel Ruben Gerad Mathew Ray Augé 13 Years Ago Thank you Ray, I really appreciate your immediate assistance. I hope I can document my full development approach soon. Please sign in to reply. Reply as... Cancel Kevin Jebel Ruben Gerad Mathew 13 Years Ago Hello,Can anyone tell me how to get user attributes from a vaadin portlet please ? Please sign in to reply. Reply as... Cancel Ray Augé Kevin Jebel 13 Years Ago - Edited There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. Please sign in to reply. Reply as... Cancel
Ray Augé Ruben Gerad Mathew 13 Years Ago Not sure why you have to get the RenderRequest from the already obtained PortletRequest (should both the be the same objects), but perhaps this is a quirck with faces I'm not aware of...Otherwise try this:----------------------------------------try{ RenderRequest renderRequest = ... ThemeDisplay _theme = (ThemeDisplay)renderRequest.getAttribute( WebKeys.THEME_DISPLAY); List<ObjectValuePair<String, byte[]>> files = Collections.EMPTY_LIST; ServiceContext serviceContext = ServiceContextFactory.getInstance( MBMessage.class.getName(), renderRequest); MBMessageLocalServiceUtil.addMessage( _theme.getUserId(), _theme.getUser().getFullName(), _theme.getScopeGroupId(), MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, "TEST Message", "My Simple Message", files, false, MBThreadConstants.PRIORITY_NOT_GIVEN, true, serviceContext);}catch (SystemException ex) { ...}----------------------------------------Furthermore, there is no need to initialize the services as these are singletons that are ready for use. Just invoke their static methods.Also, use the factory add/delete/update methods from core services unless you are ABSOLUTELY sure what you are doing. Please sign in to reply. Reply as... Cancel Ruben Gerad Mathew Ray Augé 13 Years Ago Thank you Ray, I really appreciate your immediate assistance. I hope I can document my full development approach soon. Please sign in to reply. Reply as... Cancel Kevin Jebel Ruben Gerad Mathew 13 Years Ago Hello,Can anyone tell me how to get user attributes from a vaadin portlet please ? Please sign in to reply. Reply as... Cancel Ray Augé Kevin Jebel 13 Years Ago - Edited There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. Please sign in to reply. Reply as... Cancel
Ruben Gerad Mathew Ray Augé 13 Years Ago Thank you Ray, I really appreciate your immediate assistance. I hope I can document my full development approach soon. Please sign in to reply. Reply as... Cancel Kevin Jebel Ruben Gerad Mathew 13 Years Ago Hello,Can anyone tell me how to get user attributes from a vaadin portlet please ? Please sign in to reply. Reply as... Cancel Ray Augé Kevin Jebel 13 Years Ago - Edited There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. Please sign in to reply. Reply as... Cancel
Kevin Jebel Ruben Gerad Mathew 13 Years Ago Hello,Can anyone tell me how to get user attributes from a vaadin portlet please ? Please sign in to reply. Reply as... Cancel Ray Augé Kevin Jebel 13 Years Ago - Edited There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. Please sign in to reply. Reply as... Cancel
Ray Augé Kevin Jebel 13 Years Ago - Edited There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. Please sign in to reply. Reply as... Cancel
Mark Ricard 13 Years Ago Very nice article. Do you know how to also get at the "custom fields" values for a particular object? I added a custom field for the Organization type but cannot seem to get the values that are at a particular object. I posted the question in the forum. Not sure if you knew. (http://www.liferay.com/community/forums/-/message_boards/message/5857914?_19_preview=false) Please sign in to reply. Reply as... Cancel Ray Augé Mark Ricard 13 Years Ago Mark, I responded to the post directly. Please sign in to reply. Reply as... Cancel
Ray Augé Mark Ricard 13 Years Ago Mark, I responded to the post directly. Please sign in to reply. Reply as... Cancel
Philipp Bouillon 13 Years Ago Thanks, but I am having trouble getting your example to work. Since I am completely new to Liferay, I am sure, my problem is an easy one, but googling didn't help.Here's what I did:Using the Eclipse Liferay IDE, I created a new Portlet. In the view.jsp, I have this code:<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %><%@ page import="javax.portlet.PortletRequest"%><%@ page import="java.util.Map"%><portlet:defineObjects /><%Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);String givenName = (userInfo != null) ? (String)userInfo.get("user.name.given") : "<empty>";String loginId = (userInfo != null) ? (String) userInfo.get("user.login.id") : "<empty>";String userPassword = PortalUtil.getUserPassword(request);%>Given Name: <%= givenName %>Login ID: <%= loginId %>Password: <%= userPassword %>After deployment, the page shows "Given Name: null, Login ID: null, Password: null", whether I am currently logged in or not. Is there anything I can do to solve this issue? What have I missed? Thanks! Please sign in to reply. Reply as... Cancel Philipp Bouillon Philipp Bouillon 13 Years Ago Arrgh! Ok, sorry: portlet-app. I see. I forgot to include them. Sorry!!However, the password still is not shown, because I couldn't add that one to the portlet-app tags. How do I make the password bit available? Thanks! Please sign in to reply. Reply as... Cancel
Philipp Bouillon Philipp Bouillon 13 Years Ago Arrgh! Ok, sorry: portlet-app. I see. I forgot to include them. Sorry!!However, the password still is not shown, because I couldn't add that one to the portlet-app tags. How do I make the password bit available? Thanks! Please sign in to reply. Reply as... Cancel
Its Me 13 Years Ago I'm using liferay 6. I would like to get current user attributes in the controller.my methods looks like this, and i'm not using annotation (instead of renderingRequests?)@RequestMapping(params = "action=myMethod") public String myMethod(ModelMap model) throws Exception { // Here I want to get current name and save something with his/her name to the database (over a service) model.put("done", isSuccessfull); return "finished"; } Please sign in to reply. Reply as... Cancel Its Me Its Me 13 Years Ago how can i do this here, to get some name of current logged in person? Please sign in to reply. Reply as... Cancel Its Me Its Me 13 Years Ago Okay, not very compicated. Described as aboth. But i will give some more explicite examplego to YourController.javaI) Portlet.xmlDo as described above in main post under "Personalizaton via Portlet spec(s)"II) Controller.java1) Define----------------------------------------------------------------public class YourController.java[...]@Inject // I'm not sure if i have to inject this, but i did.protected PortletRequest portRequest; protected Map mapReq;[...]2) Code request in your method----------------------------@RequestMapping(params = "action=yourMethod")public String pushIt(ModelMap model) throws Exception { Map userInfo =(Map)portRequest.getAttribute(PortletRequest.USER_INFO); String givenName = (userInfo != null) ? (String)userInfo.get("user.name.given") : ""; model.put("getQuickMessages", countNewMessages()); return "thanx";} Please sign in to reply. Reply as... Cancel
Its Me Its Me 13 Years Ago how can i do this here, to get some name of current logged in person? Please sign in to reply. Reply as... Cancel Its Me Its Me 13 Years Ago Okay, not very compicated. Described as aboth. But i will give some more explicite examplego to YourController.javaI) Portlet.xmlDo as described above in main post under "Personalizaton via Portlet spec(s)"II) Controller.java1) Define----------------------------------------------------------------public class YourController.java[...]@Inject // I'm not sure if i have to inject this, but i did.protected PortletRequest portRequest; protected Map mapReq;[...]2) Code request in your method----------------------------@RequestMapping(params = "action=yourMethod")public String pushIt(ModelMap model) throws Exception { Map userInfo =(Map)portRequest.getAttribute(PortletRequest.USER_INFO); String givenName = (userInfo != null) ? (String)userInfo.get("user.name.given") : ""; model.put("getQuickMessages", countNewMessages()); return "thanx";} Please sign in to reply. Reply as... Cancel
Its Me Its Me 13 Years Ago Okay, not very compicated. Described as aboth. But i will give some more explicite examplego to YourController.javaI) Portlet.xmlDo as described above in main post under "Personalizaton via Portlet spec(s)"II) Controller.java1) Define----------------------------------------------------------------public class YourController.java[...]@Inject // I'm not sure if i have to inject this, but i did.protected PortletRequest portRequest; protected Map mapReq;[...]2) Code request in your method----------------------------@RequestMapping(params = "action=yourMethod")public String pushIt(ModelMap model) throws Exception { Map userInfo =(Map)portRequest.getAttribute(PortletRequest.USER_INFO); String givenName = (userInfo != null) ? (String)userInfo.get("user.name.given") : ""; model.put("getQuickMessages", countNewMessages()); return "thanx";} Please sign in to reply. Reply as... Cancel
Abhay Doshi 13 Years Ago Ray: I think I've followed your instructions to the dot. Here's my Portlet.xml --<?xml version="1.0"?><portlet-app version="2.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"> <portlet> <portlet-name>my-email</portlet-name> <display-name>My Email</display-name> <portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class> <init-param> <name>view-jsp</name> <value>/view.jsp</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> </supports> <portlet-info> <title>My Email</title> <short-title>My Email</short-title> <keywords>My Email</keywords> </portlet-info> <security-role-ref> <role-name>administrator</role-name> </security-role-ref> <security-role-ref> <role-name>guest</role-name> </security-role-ref> <security-role-ref> <role-name>power-user</role-name> </security-role-ref> <security-role-ref> <role-name>user</role-name> </security-role-ref> </portlet> <user-attribute> <description>User Given Name</description> <name>user.name.given</name> </user-attribute> <user-attribute> <description>User Last Name</description> <name>user.name.family</name> </user-attribute> <user-attribute> <description>User eMail</description> <name>user.home-info.online.email</name> </user-attribute> </portlet-app>And the code snippet I am using to read the User's email :<portlet:defineObjects /><% Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO); String emailID = "init@notworking.com"; if(userInfo!=null){ emailID = (String) userInfo.get("user.home-info.online.email"); System.out.println("Email ID:"+ emailID); }I always get userInfo variable as a null Can you guide me ? Please sign in to reply. Reply as... Cancel Ray Augé Abhay Doshi 13 Years Ago It took me a few minutes to see the problem myself, but once you realize that "request" is not a PortletRequest it's quite obvious. You need to get the USER_INFO from a PortletRequest, in this case it would be from the "RenderRequest" which is automatically added to the page scope by <portlet:defineObjects />.So change the line to:Map userInfo = (Map) renderRequest.getAttribute(PortletRequest.USER_INFO);and it will work. Please sign in to reply. Reply as... Cancel Abhay Doshi Ray Augé 13 Years Ago Sir, you are awesome ! Thank you Please sign in to reply. Reply as... Cancel Ray Augé Abhay Doshi 13 Years Ago Thank you! I'm glad to help. Please sign in to reply. Reply as... Cancel Abhay Doshi Ray Augé 13 Years Ago Quick question: How can I access the user's additional email address (under profile) and custom fields ? Please sign in to reply. Reply as... Cancel prabhakar m Abhay Doshi 13 Years Ago hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte Please sign in to reply. Reply as... Cancel Ray Augé prabhakar m 13 Years Ago You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes sir im accessing through the portal only.. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago im getting error in the portlet itself. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? Please sign in to reply. Reply as... Cancel
Ray Augé Abhay Doshi 13 Years Ago It took me a few minutes to see the problem myself, but once you realize that "request" is not a PortletRequest it's quite obvious. You need to get the USER_INFO from a PortletRequest, in this case it would be from the "RenderRequest" which is automatically added to the page scope by <portlet:defineObjects />.So change the line to:Map userInfo = (Map) renderRequest.getAttribute(PortletRequest.USER_INFO);and it will work. Please sign in to reply. Reply as... Cancel Abhay Doshi Ray Augé 13 Years Ago Sir, you are awesome ! Thank you Please sign in to reply. Reply as... Cancel Ray Augé Abhay Doshi 13 Years Ago Thank you! I'm glad to help. Please sign in to reply. Reply as... Cancel Abhay Doshi Ray Augé 13 Years Ago Quick question: How can I access the user's additional email address (under profile) and custom fields ? Please sign in to reply. Reply as... Cancel prabhakar m Abhay Doshi 13 Years Ago hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte Please sign in to reply. Reply as... Cancel Ray Augé prabhakar m 13 Years Ago You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes sir im accessing through the portal only.. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago im getting error in the portlet itself. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? Please sign in to reply. Reply as... Cancel
Abhay Doshi Ray Augé 13 Years Ago Sir, you are awesome ! Thank you Please sign in to reply. Reply as... Cancel Ray Augé Abhay Doshi 13 Years Ago Thank you! I'm glad to help. Please sign in to reply. Reply as... Cancel Abhay Doshi Ray Augé 13 Years Ago Quick question: How can I access the user's additional email address (under profile) and custom fields ? Please sign in to reply. Reply as... Cancel prabhakar m Abhay Doshi 13 Years Ago hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte Please sign in to reply. Reply as... Cancel Ray Augé prabhakar m 13 Years Ago You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes sir im accessing through the portal only.. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago im getting error in the portlet itself. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? Please sign in to reply. Reply as... Cancel
Ray Augé Abhay Doshi 13 Years Ago Thank you! I'm glad to help. Please sign in to reply. Reply as... Cancel Abhay Doshi Ray Augé 13 Years Ago Quick question: How can I access the user's additional email address (under profile) and custom fields ? Please sign in to reply. Reply as... Cancel prabhakar m Abhay Doshi 13 Years Ago hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte Please sign in to reply. Reply as... Cancel Ray Augé prabhakar m 13 Years Ago You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes sir im accessing through the portal only.. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago im getting error in the portlet itself. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? Please sign in to reply. Reply as... Cancel
Abhay Doshi Ray Augé 13 Years Ago Quick question: How can I access the user's additional email address (under profile) and custom fields ? Please sign in to reply. Reply as... Cancel prabhakar m Abhay Doshi 13 Years Ago hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte Please sign in to reply. Reply as... Cancel Ray Augé prabhakar m 13 Years Ago You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes sir im accessing through the portal only.. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago im getting error in the portlet itself. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? Please sign in to reply. Reply as... Cancel
prabhakar m Abhay Doshi 13 Years Ago hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte Please sign in to reply. Reply as... Cancel Ray Augé prabhakar m 13 Years Ago You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes sir im accessing through the portal only.. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago im getting error in the portlet itself. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? Please sign in to reply. Reply as... Cancel
Ray Augé prabhakar m 13 Years Ago You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes sir im accessing through the portal only.. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago im getting error in the portlet itself. Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks Please sign in to reply. Reply as... Cancel prabhakar m Ray Augé 13 Years Ago yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? Please sign in to reply. Reply as... Cancel
prabhakar m Ray Augé 13 Years Ago yes sir im accessing through the portal only.. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago im getting error in the portlet itself. Please sign in to reply. Reply as... Cancel
prabhakar m prabhakar m 13 Years Ago im getting error in the portlet itself. Please sign in to reply. Reply as... Cancel
prabhakar m Ray Augé 13 Years Ago And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. Please sign in to reply. Reply as... Cancel prabhakar m prabhakar m 13 Years Ago i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz Please sign in to reply. Reply as... Cancel
prabhakar m prabhakar m 13 Years Ago i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz Please sign in to reply. Reply as... Cancel
prabhakar m Ray Augé 13 Years Ago mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks Please sign in to reply. Reply as... Cancel
prabhakar m Ray Augé 13 Years Ago yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? Please sign in to reply. Reply as... Cancel