掲示板

Manage my account url for vm file.

thumbnail
11年前 に Tanaji M. Londhe によって更新されました。

Manage my account url for vm file.

Regular Member 投稿: 194 参加年月日: 12/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.
thumbnail
11年前 に Jignesh Vachhani によって更新されました。

RE: Manage my account url for vm file.

Liferay Master 投稿: 803 参加年月日: 08/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.
thumbnail
11年前 に Tanaji M. Londhe によって更新されました。

RE: Manage my account url for vm file.

Regular Member 投稿: 194 参加年月日: 12/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.
thumbnail
11年前 に Jignesh Vachhani によって更新されました。

RE: Manage my account url for vm file.

Liferay Master 投稿: 803 参加年月日: 08/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.
thumbnail
11年前 に Tanaji M. Londhe によって更新されました。

RE: Manage my account url for vm file.

Regular Member 投稿: 194 参加年月日: 12/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?
thumbnail
11年前 に Jignesh Vachhani によって更新されました。

RE: Manage my account url for vm file.

Liferay Master 投稿: 803 参加年月日: 08/03/10 最新の投稿
Yeah but strange as both URL are referring same path

So definitely there would be something with popup
thumbnail
11年前 に Tanaji M. Londhe によって更新されました。

RE: Manage my account url for vm file.

Regular Member 投稿: 194 参加年月日: 12/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"
thumbnail
11年前 に Jignesh Vachhani によって更新されました。

RE: Manage my account url for vm file.

Liferay Master 投稿: 803 参加年月日: 08/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 :


var myAccount = A.one('#' + namespace + 'userAvatar .user-links');

				if (myAccount) {
					myAccount.delegate(
						'click',
						function(event) {
							event.preventDefault();

							var currentTarget = event.currentTarget;

							var controlPanelCategory = Lang.trim(currentTarget.attr('data-controlPanelCategory'));

							var uri = currentTarget.attr('href');
							var title = currentTarget.attr('title');

							if (controlPanelCategory) {
								uri = Liferay.Util.addParams('controlPanelCategory=' + controlPanelCategory, uri) || uri;
							}

							instance._openWindow(
								{
									dialog: {
										align: Util.Window.ALIGN_CENTER,
										width: 960
									},
									title: title,
									uri: uri
								}
							);
						},
						'a.use-dialog'
					);
thumbnail
11年前 に Tanaji M. Londhe によって更新されました。

RE: Manage my account url for vm file.

Regular Member 投稿: 194 参加年月日: 12/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.
thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: Manage my account url for vm file.

Liferay Master 投稿: 654 参加年月日: 09/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.

#set ($myaccurl = $theme_display.getURLMyAccount().toString() + "&amp;controlPanelCategory=my")
<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
thumbnail
11年前 に Tanaji M. Londhe によって更新されました。

RE: Manage my account url for vm file.

Regular Member 投稿: 194 参加年月日: 12/04/25 最新の投稿
Hi Tejas,
Thanks you very much Tejas & Jignesh. Its working properly.
thumbnail
11年前 に Jignesh Vachhani によって更新されました。

RE: Manage my account url for vm file.

Liferay Master 投稿: 803 参加年月日: 08/03/10 最新の投稿
That's great Tanaji
You can make this thread post status to answered now.emoticon
thumbnail
11年前 に Tanaji M. Londhe によって更新されました。

RE: Manage my account url for vm file.

Regular Member 投稿: 194 参加年月日: 12/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.
10年前 に Riley Pickerl によって更新されました。

RE: Manage my account url for vm file.

Junior Member 投稿: 50 参加年月日: 13/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?
10年前 に saritha reddy によって更新されました。

RE: Manage my account url for vm file.

Junior Member 投稿: 95 参加年月日: 14/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
thumbnail
10年前 に Dhrutika Vyas によって更新されました。

RE: Manage my account url for vm file.

Expert 投稿: 435 参加年月日: 09/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
thumbnail
9年前 に Enrique Valdes Lacasa によって更新されました。

RE: Manage my account url for vm file.

Junior Member 投稿: 92 参加年月日: 14/07/29 最新の投稿
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!
thumbnail
9年前 に Soori Babu Meesala によって更新されました。

RE: Manage my account url for vm file.

Junior Member 投稿: 43 参加年月日: 14/07/10 最新の投稿
Hi follow this link that might be useful. Click Here

~Regards,
Soori Babu Meesala
thumbnail
9年前 に Enrique Valdes Lacasa によって更新されました。

RE: Manage my account url for vm file.

Junior Member 投稿: 92 参加年月日: 14/07/29 最新の投稿
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:

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