Sitecore自定义用户配置文件-存储在哪里,如何查询 [英] Sitecore Custom User Profile - where is it stored how can it be queried

查看:107
本文介绍了Sitecore自定义用户配置文件-存储在哪里,如何查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Sitecore的核心数据库中创建了自定义的用户配置文件模板和对象(根据Security API Cookbook).

I have created a custom User profile template and object in the core database in Sitecore (as per the Security API Cookbook).

我可以通过编程方式选择此选项(根据《安全API食谱》),以便我的Extranet用户具有扩展的配置文件,其中涵盖了所有常见的可疑对象(地址,电话,电子邮件格式等)

I can select this programmatically (as per the Security API Cookbook) so that my extranet users have an extended profile, that covers all the usual suspects (Address, phone, email format etc.)

但是,这些数据存储在哪里?以及如果我想查询数据库以基于此配置文件数据返回一部分用户,该如何访问它.

However, where is this data stored? And how do I access it if I want to query the database to return a subset of users based on this profile data.

Extranet成员系统的典型要求是提取电子邮件或电话类型广告系列中要联系的用户列表.可以使用Sitecore会员系统来做到这一点吗?

A typical requirement for an extranet member system is to extract a list of users to contact either in an email or a phone type campaign. Can this be done with the Sitecore membership system?

更新> 我要猜测一下,说配置文件数据存储在aspnet_Profile.PropertyValuesBinary ..中,这使得几乎无法查询并且不适合我的目的.那是不幸的.因此,如果是这种情况,请扩展我的问题,是否有可能让Sitecore将这些值存储在文本字段中以便它们可搜索?

UPDATE> I'm going to take a guess and say the profile data is stored in aspnet_Profile.PropertyValuesBinary .. which would make it nigh on impossible to query and not suited to my purpose. That is unfortunate. So to extend my question, if that is the case, is it possible to get Sitecore to store those values in the text field so they are searchable?

推荐答案

SqlProfileProvider的标准Microsoft实现(默认在Sitecore中使用)将用户配置文件信息存储在aspnet_Profile表中.所有属性都被序列化到PropertyNames/PropertyValuesString列中. PropertyValuesBinary用于存储二进制数据(图像).如果查看System.Web.Profile.SqlProfileProvider,SetPropertyValues方法的代码,则可以找到更多详细信息.

The standard Microsoft implementation of the SqlProfileProvider (which is used in Sitecore by default) stores the user profile information in the aspnet_Profile table. All the properties are serialized into the PropertyNames / PropertyValuesString columns. The PropertyValuesBinary is used to store the binary data (images). You can find more details if you look at the code of System.Web.Profile.SqlProfileProvider, SetPropertyValues method.

接下来,您在用户配置文件中定义的所有自定义属性都被序列化为Profile类的SerializedData属性,并且像其他任何属性一样,再次被序列化为PropertyNames/PropertyValuesString列.

Next, all the custom properties you define in the user profile, are serialized to the SerializedData property of the Profile class, and it is again serialized to the PropertyNames / PropertyValuesString columns like any other property.

此外,几个属性存储在aspnet_Membership表中(由于某些原因)-电子邮件和注释.

Also, couple of properties are stored in aspnet_Membership table (for some reason) - Email and Comment.

因此,如果要通过电子邮件查询用户,则可以使用MembershipProvider的FindUsersByEmail方法.否则,我想,如果您打算按另一个属性值进行过滤,则必须获取所有用户并过滤所获得的集合.

So, if you are going to query the users by Email, you can use FindUsersByEmail method of MembershipProvider. Otherwise, if you plan to filter by another property value, I suppose, you'll have to get all users and filter the obtained collection.

希望这会有所帮助.

这篇关于Sitecore自定义用户配置文件-存储在哪里,如何查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆