SharePoint 中是否有某种方法可以根据每个用户更改文档库视图?

发布于 2024-08-13 09:05:56 字数 140 浏览 3 评论 0原文

我们正在使用 WSS 3.0,我被要求看看用户是否可以为每个用户设置默认视图。有谁知道有什么方法(编程或通过 GUI 本身)让用户能够基于每个用户更改默认视图?经过 30 分钟的谷歌搜索和在管理菜单中摸索,结果毫无结果。如果不是,这是 MOSS 2007 的功能吗?

We are using WSS 3.0 and I was asked to see if users can set default views on a per-user basis. Is anyone aware of any method (programatic or through the GUI itself) to give users the ability to change default views on a per-user basis? The 30 minutes of googling and poking around in the administrative menus turned out to be unfruitful. If not, is this a feature of MOSS 2007?

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

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

发布评论

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

评论(2

想你只要分分秒秒 2024-08-20 09:05:56

您可能想要研究受众,这是 MOSS 2007 中的功能。
不幸的是,它在 WSS 3.0 中不可用。

这是一个合理的概述。 SharePoint 2007 中的用户配置文件和受众群体定位

You probably want to look into audiences which is functionality in MOSS 2007.
Unfortunately it's not available in WSS 3.0

Here's a reasonable overview. User Profiles and Audience Targeting in SharePoint 2007

半﹌身腐败 2024-08-20 09:05:56

如果您使用的是 WSS 3.0,则可以使用 Web 部件以编程方式切换或修改视图,该 Web 部件获取 ListViewWebPart 并动态修改查询或视图。这是我用来过滤任何给定视图的内容的一些示例代码:

    private ListViewWebPart GetListViewWebPart()
    {
        ListViewWebPart webPart = new ListViewWebPart();

        foreach (WebPart wp in WebPartManager.WebParts)
        {
            if (wp.GetType() == typeof(ListViewWebPart))
            {
                webPart = (ListViewWebPart)wp;
            }
        }
        return webPart;
    }


    private void ApplyStrategySecurity(string camlFilter)
    {
        // Get the listview webpart
        ListViewWebPart wp = GetListViewWebPart();

        // Apply the query to the listview
        XmlDocument doc = new XmlDocument();
        doc.LoadXml(wp.ListViewXml);
        if (camlFilter.Length > 0)
        {
            XmlNode queryNode = doc.SelectSingleNode("//Query");
            XmlNode whereNode = queryNode.SelectSingleNode("Where");
            if (whereNode != null)
                queryNode.RemoveChild(whereNode);
            XmlNode newNode = doc.CreateNode(XmlNodeType.Element, "Where", string.Empty);
            newNode.InnerXml = camlFilter;
            queryNode.AppendChild(newNode);
        }
        wp.ListViewXml = doc.OuterXml;
    }

If you're working in WSS 3.0, you can programmatically swtich or modify views by using a webpart which gets the ListViewWebPart and modifies the query or view on the fly. Here is some sample code I am using to filter the contents of any given view:

    private ListViewWebPart GetListViewWebPart()
    {
        ListViewWebPart webPart = new ListViewWebPart();

        foreach (WebPart wp in WebPartManager.WebParts)
        {
            if (wp.GetType() == typeof(ListViewWebPart))
            {
                webPart = (ListViewWebPart)wp;
            }
        }
        return webPart;
    }


    private void ApplyStrategySecurity(string camlFilter)
    {
        // Get the listview webpart
        ListViewWebPart wp = GetListViewWebPart();

        // Apply the query to the listview
        XmlDocument doc = new XmlDocument();
        doc.LoadXml(wp.ListViewXml);
        if (camlFilter.Length > 0)
        {
            XmlNode queryNode = doc.SelectSingleNode("//Query");
            XmlNode whereNode = queryNode.SelectSingleNode("Where");
            if (whereNode != null)
                queryNode.RemoveChild(whereNode);
            XmlNode newNode = doc.CreateNode(XmlNodeType.Element, "Where", string.Empty);
            newNode.InnerXml = camlFilter;
            queryNode.AppendChild(newNode);
        }
        wp.ListViewXml = doc.OuterXml;
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文