Liferay 用户属性

发布于 2025-01-07 21:16:43 字数 1464 浏览 6 评论 0原文

昨天我开始开发一个liferay portlet,我想知道是否有一种方法可以更改portlet 中的个人资料图片。我的尝试是一种解决方法,对我来说似乎无效,但我找不到正确的 API 来正确更改它。

//代码 //java

taglib uri="http://java.sun.com/portlet" prefix="portlet" 页面 导入=“javax.portlet.PortletRequest”页面导入=“java.util.Map”

//java

映射用户信息 = (映射)renderRequest.getAttribute(PortletRequest.USER_INFO);细绳 给定名称 = (用户信息!= null) ? (String)userInfo.get("liferay.user.id") : "";

//javascript

变量 link_user_x="http://192.168.1.214:8080/group/control_panel/manage?p_p_id=2&p_p_lifecycle=0&p_p_state=pop_up&p_p_mode=vi ew&doAsGroupId=18&refererPlid=10427&_2_struts_action=/my_account/edit_user_portrait&_2_redirect=http://192.168.1.214 :8080/group/control_panel/manage?p_p_id=2&p_p_lifecycle=0&p_p_state=最大化&p_p_mode=view&doAsGroupId=18&refer erPlid=10427&_2_refererPlid=10427&_2_p_u_i_d=11365&_2_doAsGroupId=18&_2_p_u_i_d=11365&_2_portrait_id=11535";

函数 profilbild_aendern(x) { if (x==1){ winRef = window.open(link_userx);警报(link_user_x); } }

克莱肯·西奥夫·迪森 //a href="" onClick="profilbild_aendern(1);return false;"/Link/a/ um Marcels Profilbild zu ändern。

//想法

所以我的尝试是通过读取用户信息并将它们放入链接中来构建从控制面板动态获得的链接。这篇文章之后我弄清楚了在哪里更改它。

我希望你能帮助我“如何正确更改链接”,或者使用一个简短的代码片段来打开窗口来更改个人资料图片,该功能已经在 liferay 中,但我现在找不到它会很棒的。 如:Stringchange_picture(url);

Yesterday I began to develop a liferay portlet and I wonder if there is a way to Change the Profile picture within the portlet. My attempt is a workaround which seems ineffective to me but I couldn't find the right API to change it properly.

//Code //java

taglib uri="http://java.sun.com/portlet" prefix="portlet" page
import="javax.portlet.PortletRequest" page import="java.util.Map"

//java

Map userInfo =
(Map)renderRequest.getAttribute(PortletRequest.USER_INFO); String
givenName = (userInfo != null) ?
(String)userInfo.get("liferay.user.id") : "";

//javascript

var
link_user_x="http://192.168.1.214:8080/group/control_panel/manage?p_p_id=2&p_p_lifecycle=0&p_p_state=pop_up&p_p_mode=view&doAsGroupId=18&refererPlid=10427&_2_struts_action=/my_account/edit_user_portrait&_2_redirect=http://192.168.1.214:8080/group/control_panel/manage?p_p_id=2&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&doAsGroupId=18&refererPlid=10427&_2_refererPlid=10427&_2_p_u_i_d=11365&_2_doAsGroupId=18&_2_p_u_i_d=11365&_2_portrait_id=11535";

function profilbild_aendern(x) { if (x==1){ winRef =
window.open(link_userx); alert(link_user_x); } }

Klicken sie auf diesen
//a href=""
onClick="profilbild_aendern(1);return false;"/Link/a/ um Marcels
Profilbild zu ändern.

//Ideas

So my attempt is to build the Link I got from the Control Panel dynamic by reading the User Information and put them into the link. I figure out where to change it after this post.

I hope you could help me with a "how to change the link properly", or with a short code snippet which opens the window to change the profile picture, a function which will be already into liferay but I can´t find it right now would be awesome.
Like: String change_picture(url);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一页 2025-01-14 21:16:43

调用 UserServiceUtil.updatePortrait(long userId, byte[] bytes)。

Call UserServiceUtil.updatePortrait(long userId, byte[] bytes).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文