SharePoint 2010 事件处理程序(接收器)无法在 MySites 网站集的个人网站上运行
我在其自己的 Web 应用程序上设置了 SharePoint 2010 MySites。基础级别有标准网站集 http://site:80/
。
每个用户的个人网站位于托管 URL /personal/
处。
我有一个工作事件处理程序,当用户将某些内容添加到图片库时,它会将项目添加到新闻源。
问题: 问题是,只有当它们添加到基础网站集 http://site:80/
上的图片库时,这才有效,而如果它们添加到 http://site:/ ,则不起作用。 /site:80/personal/最后一个/
。
有谁知道为什么?事件处理程序功能的范围是site
,我的理解是它应该适用于所有子站点。
I have a SharePoint 2010 MySites set up on its own web application. There is the standard site collection at the base level, http://site:80/
.
The personal sites for each user is at the managed URL /personal/
.
I have a working event handler which add items to the Newsfeed when a user adds something to a picture library.
THE PROBLEM:
The problem is, this only works if they add to a picture library at the base site collection, http://site:80/
, and does NOT work if they add to http://site:80/personal/last first/
.
Does anyone know why? The event handler feature is site
scoped and my understanding is that it should work on all subsites.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是个人网站不是“我的网站”主机的子网站。事实上,每个用户的个人网站都是一个独立的网站集。因此,基本上,您不仅需要为“我的网站”主机注册事件接收器,还需要为每个用户的个人网站注册事件接收器。
The problem is that personal sites are not subsites of My Site host. In fact each user's personal site is a site collection on its own. So basically you need to register your event receiver not only for My SIte host, but also for each user's personal site.
好的。由于您只能将功能“装订”到将来配置的站点定义,因此您需要一种方法来激活现有站点上的新功能。
因此,我发现并使用的修复如下:
新闻源的默认页面是
http://site:80/default.aspx
。如果您创建事件接收器并将其范围限定为“站点”并将其全局部署或部署到该 Web 应用程序,则它将在基本网站集上运行。每个个人网站都是一个网站集,并且具有该功能,但需要在每个个人网站集上激活它。因此,在 default.aspx 页面中,您可以放置以下内容,这将激活该功能(如果尚未激活)。
您还需要编辑 web.config 文件以允许内联代码为此页面运行。希望这有帮助。
Ok. Because you can only 'staple' features to site definitions which will be provisioned in the future, you need a way to activate new features on existing sites.
So, the fix I discovered and used follows:
The default page for the newsfeed is
http://site:80/default.aspx
. If you create an event receiver and scope it for 'site' and deploy it globally or to that web application, then it will work on the base site collection. Each personal site is a site collection and has the feature but it needs to be activated on each personal site collection.So, in the default.aspx page, you place the following which will activate the feature if it has not yet been activated.
You also need to edit the web.config file in order to allow inline code to run for this page. Hope this helps.