Web services 通过Web服务将SharePoint文档列表添加到快速启动
我正在SharePoint中通过一个C#.Net应用程序使用Webservice List.AddList方法创建文档库。(见下文) 我希望它们出现在创建它们的站点下的快速启动菜单中,而不仅仅是“所有站点内容”菜单 我已经看过Lists.UpdateList()方法,但运气不好 有人知道如何通过Web服务做到这一点吗?(无法手动完成,因为要更改的列表太多) 我正在使用最新版本的SharePoint Server和Web服务Web services 通过Web服务将SharePoint文档列表添加到快速启动,web-services,sharepoint,Web Services,Sharepoint,我正在SharePoint中通过一个C#.Net应用程序使用Webservice List.AddList方法创建文档库。(见下文) 我希望它们出现在创建它们的站点下的快速启动菜单中,而不仅仅是“所有站点内容”菜单 我已经看过Lists.UpdateList()方法,但运气不好 有人知道如何通过Web服务做到这一点吗?(无法手动完成,因为要更改的列表太多) 我正在使用最新版本的SharePoint Server和Web服务 谢谢:)我相信您的看法是正确的,即QuickLaunch上的设置不能通过
谢谢:)我相信您的看法是正确的,即QuickLaunch上的
设置不能通过web服务使用。在listProperties
中为UpdateList
设置OnQuickLaunch
,这是我想尝试的,但听起来好像不起作用
如果您的列表不存在,我建议使用列表模板创建一个功能,使用OnQuickLaunch=“true”
并通过AddListFromFeature
添加列表。您的另一个选择似乎是编写自己的服务,通过对象模型设置属性。最好是先创建一个SPList对象,然后执行OnQuickLaunch=“true”。不要忘记更新命令
Example:
Guid listID = Guid.Empty;
listID = siteObject.Lists.Add("Title","Description",listTemplateObject);
//This will work:
SPList thisList = siteObject.Lists[ListID];
thisList.OnQuickLaunch = true;
thisList.Update();
我还没有真正尝试过QuickLaunch,因为我一直在阅读的文档中没有提到它,我发现它与lists.UpdateList方法一起工作。谢谢你!
Example:
Guid listID = Guid.Empty;
listID = siteObject.Lists.Add("Title","Description",listTemplateObject);
//This will work:
SPList thisList = siteObject.Lists[ListID];
thisList.OnQuickLaunch = true;
thisList.Update();
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndProperties = xmlDoc.CreateNode(XmlNodeType.Element, "List", "");
XmlAttribute ndQuickLaunchAttrib = (XmlAttribute)xmlDoc.CreateNode(XmlNodeType.Attribute, "OnQuickLaunch", "");
ndQuickLaunchAttrib.Value = "True";
ndProperties.Attributes.Append(ndQuickLaunchAttrib);
XmlNode ndReturn = proxy.UpdateList("12345", ndProperties, null, null, null, null);