在 SharePoint 3 文档库中的新项目事件上显示自定义表单?
对于添加到特定文档库的每个新文档,显示自定义表单的最佳方式是什么?
我希望用户对添加文档将导致的某些操作有一定的控制权 - 特别是在任务列表中为用户创建的任务,贡献用户必须在提交之前确定这些任务。
通过工作流或事件处理程序来执行此操作的最佳方法是?
问候 哞
Which is the best way to display a custom form for each new document being added to a specific document library?
I want the user to have some control over some actions that adding the document will cause - specifically, tasks created for users in a Task List, which the contributing user will have to OK before committing.
Is the best way to do this via a Workflow or an event handler?
Regards
Moo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于 SharePoint Server 2007:
专用内容类型和事件处理程序的组合将为您提供对流程的最大控制权(也更易于调试)。 工作流程最适合“简单”的操作,并且更难执行复杂的操作。
工作流程允许站点管理员更灵活地将工作流程分配给不同的库。
将您的内容类型和事件处理程序整合到可以部署的功能中。 将内容类型分配给列表将允许您获取标准表单创建的任何数据(请记住,您可以为真正复杂/自定义数据输入创建自定义字段)并执行任何所需的操作,包括基于项目创建任务。
For SharePoint server 2007:
A combination of a specialised content type and an event handler will give you the most control of the process (easier to debug too). A workflow is best for "easy" actions and is harder to make complex actions happen.
A workflow allows for more flexibility in assigning the workflow to different libraries by site admins.
Roll your content type and event handler into a feature that can be deployed. Assigning the content type to a list will allow you to take any data created by the standard form (remember you can create custom fields for really complex/custom data entry) and take any action required, including creating tasks based on the item.
感谢您的回答,这就是我正在研究的路线,但不幸的是我还没有找到一种方法使其适用于文档库 - 仅列表。
我遇到的问题是,在文档库上的 ItemAdded、ItemAdding、ItemCheckingIn 或 ItemCheckedIn 事件中保存 SPUtility.Redirect 根本不会执行任何操作,因为没有与事件相关的页面 - 它的所有后端代码都是触发时未链接到 Web 上下文,因为此时执行繁重工作的不是网页,而是 Office 集成。
我遇到的所有示例似乎都依赖于在事件触发时显示 EditForm.aspx 或 NewForm.aspx 页面的事实,当然这里的情况并非如此。
这也导致了我无法扩展 EditForm.aspx 或 CheckIn.aspx 页面来执行我想要的操作的问题,因为 Office 2007 绕过了这两个页面。
因此,目前对我来说唯一的选择是通过工作流程来完成它:/
任何进一步的提示都会很棒。
Thanks for the answer, thats the route I was investigating but unfortunately I haven't found a way to make it work for Document Libraries - only Lists.
The problem I have come across is that aving a SPUtility.Redirect in the ItemAdded, ItemAdding, ItemCheckingIn or ItemCheckedIn event on the document library doesn't do anything at all, because there is no page related to the events - its all backend code being fired that is not linked to a web context, because its not the webpage doing the heavy lifting at that point but the Office integration.
All of the examples I have come across seem to rely on the fact that the EditForm.aspx or NewForm.aspx page is being displayed at the time the event is fired, which of course is not the case here.
This also leads to the problem that I cannot extend the EditForm.aspx or the CheckIn.aspx page to do what I want either, because Office 2007 circumvents both of these.
So, the only option left open to me at the moment is doing it through a workflow :/
Any further tips would be fantastic.
我可能不明白你的问题,但这与你想要做的很接近吗?
http://msdn.microsoft.com/en-us/library/ms550037。 aspx
如果不是,这在什么方面是不足的?
I may not understand your question, but is this close to what you're trying to do?
http://msdn.microsoft.com/en-us/library/ms550037.aspx
If not, in what way does this come up short?
将新表单 url 设置为适当值的新“内容类型”应该可以解决问题。
不幸的是,您可能无法通过事件处理程序或工作流程实现您想要的目标。 理想情况下,您希望用户在库中添加新项目后立即显示表单,并且自定义内容类型即可解决问题。
亲切的问候,
A new "Content Type" with its New Form url set to the appropriate value should do the trick.
Unfortunately you may not be able to achieve what you are trying to with an Event Handler or a Workflow. You would ideally want the form to show up as soon as the user adds a new item to the library and a custom content type will do the trick.
Kind regards,