Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Tanaji Londhe
Manage my account url for vm file.
24 luglio 2012 2.45
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

Hi,
How do I get url for Manage My Account. Which is pop-up click on the username link after successful login.

Thanks & regards,
Tanaji.
Jignesh Vachhani
RE: Manage my account url for vm file.
24 luglio 2012 2.53
Risposta

Jignesh Vachhani

Punteggio: Liferay Master

Messaggi: 785

Data di Iscrizione: 10 marzo 2008

Messaggi recenti

you can follow same procedure mentioned in http://www.liferaysolution.com/2012/02/create-account-url-in-velocity-template.html

In suggested link we have created link for create account, so same way you can manage it for manage account link and set necessary parameter in URL itself.
Tanaji Londhe
RE: Manage my account url for vm file.
24 luglio 2012 5.29
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

LiferayPortletURL.create(javax.servlet.http.HttpServletRequest request, String portletName, long plid, String lifecycle)
I use following code as per your suggestion
#set ($manage_my_account_url = $portletURLFactory.create($request, "2", $page.getPlid(), "ACTION_PHASE"))
$manage_my_account_url.setWindowState("MAXIMIZED")
$manage_my_account_url.setPortletMode("VIEW")
$manage_my_account_url.setParameter("saveLastPath", "0")
$manage_my_account_url.setParameter("struts_action", "/my_account/edit_user")

It generates following URL.
"http://localhost:8080/web/guest/welcome?p_auth=2kZjemVr&p_p_auth=DU7v1SSr&p_p_id=2&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&saveLastPath=0&_2_struts_action=%2Fmy_account%2Fedit_user"

It shows me one portlet on portal page and gives error message is "My Account is temporarily unavailable."

and it shows error on console

11:55:50,899 WARN [PortletRequestProcessor:166] This URL can only be invoked using POST: /web/guest/welcome?p_auth=2kZjemVr&p_p_auth=DU7v1SSr&p_p_id=2&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&saveLastPath=0&_2_struts_action=%2Fmy_account%2Fedit_user
11:55:50,908 ERROR [render_portlet_jsp:154] com.liferay.portal.security.auth.PrincipalException: /web/guest/welcome?p_auth=2kZjemVr&p_p_auth=DU7v1SSr&p_p_id=2&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&saveLastPath=0&_2_struts_action=%2Fmy_account%2Fedit_user
at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:171)
at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:190)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:70)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:651)
at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:686)
at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:361)
at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:845)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:633)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:244)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:174)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:533)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

Please tell me how to resolve this issue.
Jignesh Vachhani
RE: Manage my account url for vm file.
24 luglio 2012 5.43
Risposta

Jignesh Vachhani

Punteggio: Liferay Master

Messaggi: 785

Data di Iscrizione: 10 marzo 2008

Messaggi recenti

Very simple way to get my account URL is :

$theme_display.getURLMyAccount().toString()

So now only thing you may have to do it open this URL in popup.
Tanaji Londhe
RE: Manage my account url for vm file.
24 luglio 2012 6.00
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

Hi Jignesh,
I use this code as per ur suggestion
<a href="$theme_display.getURLMyAccount().toString()">$my_account_text</a>
but it shows me whole control panel with its all functionality. I dont want to show all control panel.
I just require to display user account information(My Account) which is shows in Manage My Account pop-up when user click on username link.

How to resovle this issue?
Jignesh Vachhani
RE: Manage my account url for vm file.
24 luglio 2012 6.06
Risposta

Jignesh Vachhani

Punteggio: Liferay Master

Messaggi: 785

Data di Iscrizione: 10 marzo 2008

Messaggi recenti

Yeah but strange as both URL are referring same path

So definitely there would be something with popup
Tanaji Londhe
RE: Manage my account url for vm file.
24 luglio 2012 6.13
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

Hi Jignesh,
I am not getting what ur saying.....
or Is their any way to get only My Account info nothing else, When click on my link like "My Account"
Jignesh Vachhani
RE: Manage my account url for vm file.
24 luglio 2012 6.14
Risposta

Jignesh Vachhani

Punteggio: Liferay Master

Messaggi: 785

Data di Iscrizione: 10 marzo 2008

Messaggi recenti

URL which is given in user name link in docbar and url which we are getting in theme, both are same.

You can check below section in docbar.js file to get more idea :

 1
 2var myAccount = A.one('#' + namespace + 'userAvatar .user-links');
 3
 4                if (myAccount) {
 5                    myAccount.delegate(
 6                        'click',
 7                        function(event) {
 8                            event.preventDefault();
 9
10                            var currentTarget = event.currentTarget;
11
12                            var controlPanelCategory = Lang.trim(currentTarget.attr('data-controlPanelCategory'));
13
14                            var uri = currentTarget.attr('href');
15                            var title = currentTarget.attr('title');
16
17                            if (controlPanelCategory) {
18                                uri = Liferay.Util.addParams('controlPanelCategory=' + controlPanelCategory, uri) || uri;
19                            }
20
21                            instance._openWindow(
22                                {
23                                    dialog: {
24                                        align: Util.Window.ALIGN_CENTER,
25                                        width: 960
26                                    },
27                                    title: title,
28                                    uri: uri
29                                }
30                            );
31                        },
32                        'a.use-dialog'
33                    );
Tanaji Londhe
RE: Manage my account url for vm file.
24 luglio 2012 22.53
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

Hi Jignesh,

Can you please tell me how to write this code in velocity

PortletURLImpl myAccountURL = new PortletURLImpl( request, PortletKeys.MY_ACCOUNT, controlPanelPlid,PortletRequest.RENDER_PHASE);
myAccountURL.setWindowState(WindowState.MAXIMIZED);
myAccountURL.setPortletMode(PortletMode.VIEW);
myAccountURL.setRefererPlid(plid);
myAccountURL.setParameter("struts_action", "/my_account/edit_user");
myAccountURL.setParameter("backURL", myAccountRedirect);
themeDisplay.setURLMyAccount(myAccountURL);

I think using this code I can solve my issue of a Manage My Account url related.
Because as you said above post from that i search dockbar.jsp page in that i found this following code
<aui:a cssClass="user-fullname use-dialog" data-controlPanelCategory="<%= PortletCategoryKeys.MY %>" href="<%= themeDisplay.getURLMyAccount().toString() %>" title="manage-my-account"><%= HtmlUtil.escape(user.getFullName()) %></aui:a>
Here they metion PortletCategoryKeys, due this I think i am not getting that pop-up window.
Tejas Kanani
RE: Manage my account url for vm file.
25 luglio 2012 5.08
Risposta

Tejas Kanani

Punteggio: Liferay Master

Messaggi: 655

Data di Iscrizione: 6 gennaio 2009

Messaggi recenti

Hi Tanaji,

Just use below code in your template file. It will simply open only my account page without any other Control Panel options.

1#set ($myaccurl = $theme_display.getURLMyAccount().toString() + "&controlPanelCategory=my")
2<a class="user-fullname use-dialog" href="$myaccurl" >$my_account_text</a>


But its not opening in popup same as given in OOTB dockbar. So if you need it you just have to find a way to open it in popup.

Thanks & Regards,
Tejas
Tanaji Londhe
RE: Manage my account url for vm file.
25 luglio 2012 10.48
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

Hi Tejas,
Thanks you very much Tejas & Jignesh. Its working properly.
Jignesh Vachhani
RE: Manage my account url for vm file.
25 luglio 2012 22.41
Risposta

Jignesh Vachhani

Punteggio: Liferay Master

Messaggi: 785

Data di Iscrizione: 10 marzo 2008

Messaggi recenti

That's great Tanaji
You can make this thread post status to answered now.emoticon
Tanaji Londhe
RE: Manage my account url for vm file.
28 gennaio 2013 2.19
Risposta

Tanaji Londhe

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 25 aprile 2012

Messaggi recenti

Hi Tejas,
I have created url for My Account as per ur suggestion but it doesn't show the dockbar. How to add Back link.
Riley Pickerl
RE: Manage my account url for vm file.
14 giugno 2013 11.29
Risposta

Riley Pickerl

Punteggio: Junior Member

Messaggi: 50

Data di Iscrizione: 10 gennaio 2013

Messaggi recenti

Tejas Kanani:
Hi Tanaji,
But its not opening in popup same as given in OOTB dockbar. So if you need it you just have to find a way to open it in popup.

Do you know how to open it the same way as the dockbar? I thought you had to include the class use-dialog but it doesnt seem to be working for me.

Any ideas?
saritha reddy
RE: Manage my account url for vm file.
11 marzo 2014 12.58
Risposta

saritha reddy

Punteggio: Junior Member

Messaggi: 95

Data di Iscrizione: 27 gennaio 2014

Messaggi recenti

Hi

I have followed the steps which you have provided.

But am getting not found error....

In My init.vm file i have did following
#if ($show_my_account)
#set ($my_account_text = $languageUtil.get($locale, "my-account"))
#set ($my_account_url = $theme_display.getURLMyAccount())

#end

then am trying with http://localhost:8080/web/guest/$my_account_url still same error.


Please help me with this issue.


Thanks in advance

Regards
Saritha
Dhrutika Vyas
RE: Manage my account url for vm file.
25 marzo 2014 11.43
Risposta

Dhrutika Vyas

Punteggio: Expert

Messaggi: 438

Data di Iscrizione: 9 febbraio 2009

Messaggi recenti

Hi Sarita,

Try to print $my_account_url and $show_my_account variables in portal_normal.vm.

Also if you are implementing this as part of your theme, it will be in int_custom.vm in place of int.vm

Regards,
Dhrutika
Enrique Valdes Lacasa
RE: Manage my account url for vm file.
16 aprile 2015 10.44
Risposta

Enrique Valdes Lacasa

Punteggio: Junior Member

Messaggi: 69

Data di Iscrizione: 29 luglio 2014

Messaggi recenti

It is weird, the snippet from Tejas Kanani seemed to work for me at the beginning, opening My Account in a pop up. It seems that right now that is not the case, and the My Account link that I created doesn't display any pop up. The "use-dialog" class, as a user above mentioned, is what I thought that made opening this pop up possible...but it is not working.

If someone could shed more light on this that would be great.

Thank you all for the contributions!
Soori Babu Meesala
RE: Manage my account url for vm file.
17 aprile 2015 3.05
Risposta

Soori Babu Meesala

Punteggio: Junior Member

Messaggi: 43

Data di Iscrizione: 10 luglio 2014

Messaggi recenti

Hi follow this link that might be useful. Click Here

~Regards,
Soori Babu Meesala
Enrique Valdes Lacasa
RE: Manage my account url for vm file.
17 aprile 2015 13.40
Risposta

Enrique Valdes Lacasa

Punteggio: Junior Member

Messaggi: 69

Data di Iscrizione: 29 luglio 2014

Messaggi recenti

Thanks Soori Babu Meesala! I had forgotten to subscribe, so I didn´t know you answered. A co worker and I just found the solution on our side (we wish we had seen yours first)... and it is exactly as shown in the link you posted, so thanks a lot, it is what we were looking for.

We figured it out when we noticed that the Login portlet actually does the same functionality when logging in into Liferay, and it says: You are signed in as User YourUser. The name of the user is a link to pop up the user's profile. So we noticed that this link was different from the one in the dockbar, and they used the specific javascript function that we are talking about. Having a look at the login.jsp, it gave us exactly what we needed.

Summarizing with a solution for anyone interested in Liferay 6.2 for this, will be:

1## Liferay pop up link to display the account editing page of a user (Velocity)
2#set ($my_account_url = $theme_display.getURLMyAccount() + "&controlPanelCategory=my")
3<a href="javascript:Liferay.Util.openWindow({dialog: {destroyOnHide: true}, title: 'My Account', uri: '$my_account_url'});">