简体   繁体   English

在“我的资料”页面中添加一个属性-Alfresco分享

[英]Adding one property in My Profile page - Alfresco Share

I was trying to add in one more property in Alfresco Share User Profile page. 我试图在Alfresco共享用户个人资料页面中添加另一个属性。 I did all the thing necessary to add one property to content model and user interface. 我做了所有必要的事情,以向内容模型和用户界面添加一个属性。

Then I saw a debug message 然后我看到了一条调试消息

Key "nickName" was not found on instance of org.springframework.extensions.webscripts.ScriptUser Introspection information for the class is: {getJobTitle=public java.lang.String org.springframework.extensions.webscripts.ScriptUser.getJobTitle().. 在org.springframework.extensions.webscripts.ScriptUser实例上找不到键“ nickName”。该类的自检信息为:{getJobTitle = public java.lang.String org.springframework.extensions.webscripts.ScriptUser.getJobTitle()。

And the new property value was not shown on the page, My Profile page. 并且新属性值未显示在页面“我的个人资料”页面上。

What other thing do I need to add to add one property to "My Profile" page in Alfresco Share ? 我还需要添加什么其他东西才能在Alfresco Share的“我的资料”页面中添加一个属性?

Any kind help is appreciated. 任何帮助将不胜感激。

This is to help anyone who have the similar requirement. 这是为了帮助有类似要求的任何人。 The following files are needed to change. 需要更改以下文件。

org.springframework.extensions.webscripts.ScriptUser.java
org.springframework.extensions.webscripts.connector.User.java
org.springframework.extensions.surf.support.AlfrescoUserFactory.java

userprofile.get.html.ftl
contentModel.xml

You can add custom properties to the cm:person object and then expose those properties to the Alfresco Share user interface without modifying any of the out-of-the-box Alfresco files. 您可以将自定义属性添加到cm:person对象,然后将这些属性公开给Alfresco Share用户界面,而无需修改任何现成的Alfresco文件。 I haven't written up the blog post that accompanies it, but the source code that will eventually go with the write up lives here . 我还没有写过随附的博客文章,但是最终将与该文章一起使用的源代码仍在此处

At a high-level, the steps are: 从高层次上讲,这些步骤是:

Step 1: Extend org.alfresco.web.site.SlingshotUserFactory with your own Factory class - Override the constructSomeUser method. 第1步:使用您自己的Factory类扩展org.alfresco.web.site.SlingshotUserFactory-覆盖ConstructSomeUser方法。 Follow existing pattern to build your own. 遵循现有模式来构建自己的模式。 - Override saveUser - Wire in the custom user factory through Spring using parent="webframework.factory.base" -覆盖saveUser-使用parent =“ webframework.factory.base”通过Spring连接自定义用户工厂

Step 2: In share-config-custom, override the defaults, user-factory element with a pointer to the new user factory bean 步骤2:在share-config-custom中,使用指向新用户工厂bean的指针覆盖默认的用户工厂元素。

Step 3: Override Alfresco's profile.js with your own. 第3步:使用您自己的覆盖Alfresco的profile.js。 - Modify onEditProfile to include your custom props -修改onEditProfile以包括您的自定义道具

Step 4: Extend org/alfresco/components/profile/userprofile.get.html.ftl with your own that includes fields and labels for your custom properties. 步骤4:使用您自己的扩展org / alfresco / components / profile / userprofile.get.html.ftl,其中包括自定义属性的字段和标签。

Step 5: Externalize the strings. 步骤5:外部化字符串。

I have tried this in Alfresco 3.4.d Community but have not yet tried it in Alfresco 4 Community. 我已经在Alfresco 3.4.d社区中进行了尝试,但尚未在Alfresco 4社区中进行了尝试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM