简体   繁体   English

使用Web服务在SharePoint中进行ContentType和网站列迁移

[英]ContentTypes and Site Column migration in SharePoint using web service

I am trying to migrate a content type from a sharepoint site in one environment to another. 我正在尝试将内容类型从一个环境中的共享点站点迁移到另一个环境。 For this reason, I need to use web services. 因此,我需要使用Web服务。 At this point, I am able to get some of the content types metadata via the web service. 至此,我可以通过Web服务获取某些内容类型元数据。 But I am not sure if I am getting all the metadata. 但是我不确定是否要获取所有元数据。 I am using the Webs.GetContentTypes() method to do this. 我正在使用Webs.GetContentTypes()方法来执行此操作。

In the next step, I need to figure out the site columns that are associated with this content type, import these columns, and associate the content type with these imported columns. 在下一步中,我需要找出与该内容类型关联的站点列,导入这些列,然后将内容类型与这些导入的列关联。

I am looking to figure out the following: 我正在寻找以下内容:

  1. How do I know what site columns are associated with a given content type via web service? 我如何知道哪些站点列通过Web服务与给定的内容类型相关联? Or do I need to create a custom web service? 还是我需要创建自定义Web服务?
  2. How can I be sure that I have all the information required to reconstruct the content type in the destination server? 如何确定我拥有在目标服务器中重构内容类型所需的所有信息?

Any help in any capacity will greatly be appreciated. 任何能力的帮助将不胜感激。 Thank you in advance. 先感谢您。

The answer to both your question lay here: http://msdn.microsoft.com/en-us/library/webs.webs.getcontenttype(v=office.12).aspx (check out the remarks section as well) 这两个问题的答案都在这里: http : //msdn.microsoft.com/zh-cn/library/webs.webs.getcontenttype (v = office.12).aspx (也请参阅“备注”部分)

Once you have the ID for the content type that you need details for, call the Webs.GetContentType(ID) method on the that ct. 获得需要详细信息的内容类型的ID后,请在该ct上调用Webs.GetContentType(ID)方法。 You should get the schema xml ie all the info you need to create your content type somewhere else. 您应该获得架构xml,即在其他位置创建内容类型所需的所有信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM