是否可以使用配置文件提供程序模型保留两个配置文件?

发布于 2024-08-31 00:15:11 字数 601 浏览 2 评论 0原文

我有一个网站需要将两组用户数据存储到单独的数据存储中。第一组数据由 SiteCore CMS 使用并保存有关用户的信息。第二组数据由存储其自己的用户数据的个性化应用程序使用。它们没有一起存储在同一个配置文件对象中的原因是,个性化应用程序在多个不全部使用 SiteCore 的网站上使用。

我能够创建多个配置文件提供程序 - 我目前有一个来自 SiteCore 的提供程序和一个我编写的自定义提供程序,并且它们都是独立工作的。当您尝试在同一个 web.config 文件中配置两者时,就会出现问题。看来您只能在 web.config 文件中指定一个 Profile 对象,而不是为每个提供程序指定一个。这意味着无论使用哪个提供程序,.Net 框架都会通过 web.config 文件的配置文件部分的“inherits”参数中指定的配置文件对象发送。

我的问题是 - 是否可以为每个配置文件提供程序指定不同的配置文件对象?如果是这样,如何以及在哪里指定?

-编辑-

我应该指出,两个数据集中没有重复的数据,它们是互斥的(不包括电子邮件地址)。 SiteCore 数据仅用于此网站,但我们拥有跨越所有应用程序的公司范围的配置文件数据,因此需要单独的第二个配置文件对象。

-/编辑-

谢谢, 缺口

I have a website that needs to store two sets of user data into separate data stores. The first set of data is used by the SiteCore CMS and holds information about the user. The second set of data is used by a personalisation application that stores its own user data. The reason they aren't stored together in the same profile object is because the personalisation application is used across multiple websites that do not all use SiteCore.

I am able to create multiple Profile Providers - I currently have one from SiteCore and a custom provider that I have written and these both work in isolation. The problem exists when you try to configure both in the same web.config file. It seems you can only specify a single Profile object in the web.config file, rather than one for each provider. This means that regardless of which provider is being used the .Net framework sends through the profile object that is specified in the "inherits" parameter in the profile section of the web.config file.

My questions are - Is it possible to specify a different Profile object for each Profile Provider? If so, how and where is this specified?

-edit-

I should point out that there is no duplication of data in the two data sets, they are mutually exclusive (excluding email address). The SiteCore data is used solely for this website, but we have company wide profile data that spans across all of our applications, hence the need for a separate second profile object.

-/edit-

Thanks,
Nick

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

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

发布评论

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

评论(2

花想c 2024-09-07 00:15:11

Sitecore 允许您通过切换器使用多个提供程序,并且一个提供程序未处理的配置文件属性可能会落入其他提供程序。

这就是 CRM 安全提供商Sitecore for Salesforce(这是我在其中实现自定义配置文件提供程序的产品)配置文件提供程序的工作。

查看 Sitecore 文档:低级 Sitecore CMS 安全性和自定义提供商

Sitecore allows you to use multiple providers via the switcher and profile properties that aren't handled by one provider can fall through to the other providers.

This is how the CRM Security Provider and Sitecore for Salesforce(This is the product I implemented the custom profile provider in) profile providers work.

Have a look at the Sitecore documentation: Low-Level Sitecore CMS Security and Custom Providers

春夜浅 2024-09-07 00:15:11

这种方法给我敲响了警钟。您已经暗示您已考虑将两组数据存储在一个地方。我建议重新审视这种方法。您是否考虑过在单个数据存储之上创建两个视图,一个包含额外的个性化数据,另一个不包含额外的个性化数据?如果您可以编写自己的提供程序,那么您显然有足够的能力来做到这一点。

否则,您可能会因配置文件数据不同步而陷入麻烦。

This approach rings alarm bells with me. You have already hinted that you have considered storing two sets of data in one place. I would recommend re-visiting this approach. Have you looked at creating two views over the top of a single data store, one with the extra personalisation data and one without? You are obviously competent enough to do this if you can write your own providers.

Otherwise, you risk getting into trouble with out-of-sync profile data.

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