構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Tanaji Londhe
Manage my account url for vm file.
2012/07/24 2:45
答え

Tanaji Londhe

ランク: Regular Member

投稿: 196

参加年月日: 2012/04/25

最近の投稿

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.
2012/07/24 2:53
答え

Jignesh Vachhani

ランク: Liferay Master

投稿: 775

参加年月日: 2008/03/10

最近の投稿

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.
2012/07/24 5:29
答え

Tanaji Londhe

ランク: Regular Member

投稿: 196

参加年月日: 2012/04/25

最近の投稿

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.
2012/07/24 5:43
答え

Jignesh Vachhani

ランク: Liferay Master

投稿: 775

参加年月日: 2008/03/10

最近の投稿

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.
2012/07/24 6:00
答え

Tanaji Londhe

ランク: Regular Member

投稿: 196

参加年月日: 2012/04/25

最近の投稿

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.
2012/07/24 6:06
答え

Jignesh Vachhani

ランク: Liferay Master

投稿: 775

参加年月日: 2008/03/10

最近の投稿

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.
2012/07/24 6:13
答え

Tanaji Londhe

ランク: Regular Member

投稿: 196

参加年月日: 2012/04/25

最近の投稿

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.
2012/07/24 6:14
答え

Jignesh Vachhani

ランク: Liferay Master

投稿: 775

参加年月日: 2008/03/10

最近の投稿

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.
2012/07/24 22:53
答え

Tanaji Londhe

ランク: Regular Member

投稿: 196

参加年月日: 2012/04/25

最近の投稿

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.
2012/07/25 5:08
答え

Tejas Kanani

ランク: Liferay Master

投稿: 654

参加年月日: 2009/01/06

最近の投稿

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.
2012/07/25 10:48
答え

Tanaji Londhe

ランク: Regular Member

投稿: 196

参加年月日: 2012/04/25

最近の投稿

Hi Tejas,
Thanks you very much Tejas & Jignesh. Its working properly.
Jignesh Vachhani
RE: Manage my account url for vm file.
2012/07/25 22:41
答え

Jignesh Vachhani

ランク: Liferay Master

投稿: 775

参加年月日: 2008/03/10

最近の投稿

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.
2013/01/28 2:19
答え

Tanaji Londhe

ランク: Regular Member

投稿: 196

参加年月日: 2012/04/25

最近の投稿

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.
2013/06/14 11:29
答え

Riley Pickerl

ランク: Junior Member

投稿: 50

参加年月日: 2013/01/10

最近の投稿

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.
2014/03/11 12:58
答え

saritha reddy

ランク: Junior Member

投稿: 63

参加年月日: 2014/01/27

最近の投稿

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.
2014/03/25 11:43
答え

Dhrutika Vyas

ランク: Expert

投稿: 435

参加年月日: 2009/02/09

最近の投稿

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