问题描述
我正在使用Liferay 6进行门户开发.在Liferay下创建用户期间,我还需要添加一些额外的字段?请告诉我这是否可行??
I am using Liferay 6 for portal Development .During Creating Users under Liferay , i need to add some extra Fields also ??Please let me know if this is ppossible or not ??
请查看此处所附的屏幕截图,也请让我知道它将存储在数据库中的哪个表中?
Please see the screen shot attached here , and also please let me know in which table this will be stored in Database ??
推荐答案
是的,您可以使用 Liferay实体(在您的情况下为User)的自定义属性功能,并且可以为每个liferay实体添加所需数量的额外字段
Yes, you can use Custom Attributes functionality for liferay entities (in your case, User) and can add as many extra fields as necessary for each liferay entity.
可以通过以下方式创建用户实体的自定义字段:
->
->
->
.
Custom field for the user-entity can be created through:
->
->
->
.
并且可以以编程方式创建如下:
And programmatically can be created as follows:
user.getExpandoBridge().addAttribute("yourCustomFieldKey");
然后将值设置为:
user.getExpandoBridge().setAttribute("yourCustomFieldKey", "valueForCustomField");
如果您的自定义字段已经存在,则可以像这样检查:
If your custom field is already present you can check like this:
if (user.getExpandoBridge().hasAttribute("yourCustomFieldKey")) { ... };
数据存储在以"EXPANDO" 为前缀的表中:
The data is stored in tables prefixed with "EXPANDO":
- EXPANDOCOLUMN:存储自定义字段键和其他设置(包含tableId引用)
- EXPANDODATA :存储键的自定义字段值(包含columnId和tableId刷新)
- EXPANDOTABLE:存储要为其添加Liferay实体(用户)的商店自定义字段
- EXPANDOROW :存储用户及其值之间的链接信息(包含tableId和userId引用)
- EXPANDOCOLUMN: stores the custom field key and other settings(contains the tableId refrences)
- EXPANDODATA: stores the custom field value for the key (contains thecolumnId and tableId refrences)
- EXPANDOTABLE: stores for which liferay entity (user) are you addingthe custom field
- EXPANDOROW: stores linking information between a user and its values(contains tableId and userId refrences)
希望这会有所帮助.
这篇关于是否可以在Liferay中的“创建用户"下添加其他字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!