从SSIS包中的SharePoint OData订阅源访问额外信息

时间:2016-10-06 13:08:17

标签: sharepoint ssis rss odata

我继承了一个SSIS项目,该项目包含40多个独立的包,可以读取各种Sharepoint列表中的数据。连接都是OData Feeds。 Feed是所有文件列表。我正在尝试访问每个文件的URL,但该信息似乎不在SSIS可以读取的Feed部分中。

当我查看从Feed返回的数据时,我只看到"属性的子项内的信息。"有没有办法从Feed访问其他信息?特别是" src"在内容节点中。

我正在使用VS 2015来编辑软件包。

以下是我尝试阅读的Feed示例:

<feed 
  xml:base="http://www.sharepointURL.com/consumer/_vti_bin/listdata.svc/" 
  xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" 
  xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" 
  xmlns="http://www.w3.org/2005/Atom">
<title type="text">ConsumerInquiryLibrary</title>
<id>http://www.sharepointURL.com/consumer/_vti_bin/listdata.svc/ConsumerInquiryLibrary</id>
<updated>2016-10-05T19:27:55Z</updated>
<link rel="self" title="ConsumerInquiryLibrary" href="ConsumerInquiryLibrary" />
<entry m:etag="W/&quot;1&quot;">
  <id>http://www.sharepointURL.com/consumer/_vti_bin/listdata.svc/ConsumerInquiryLibrary(3)</id>
  <title type="text"></title>
  <updated>2009-01-26T13:55:24-05:00</updated>
  <author>
    <name />
  </author>
  <link m:etag="&quot;{00000000-0000-0000-0000-000000000000},1&quot;" rel="edit-media" title="ConsumerInquiryLibraryItem" href="ConsumerInquiryLibrary(3)/$value" />
  <link rel="edit" title="ConsumerInquiryLibraryItem" href="ConsumerInquiryLibrary(3)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="ConsumerInquiryLibrary(3)/CreatedBy" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="ConsumerInquiryLibrary(3)/ModifiedBy" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CheckedOutTo" type="application/atom+xml;type=entry" title="CheckedOutTo" href="ConsumerInquiryLibrary(3)/CheckedOutTo" />
  <category term="Microsoft.SharePoint.DataService.ConsumerInquiryLibraryItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />

  <!-- I need access to the URL In the following Node -->
  <content type="application/octetstream" src="http://www.sharepointURL.com/consumer/Consumer%20Inquiry%20Library/DocumentTitle.pdf" />
  <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
  <!-- It appears I only have access to the following elements -->
    <d:Id m:type="Edm.Int32">3</d:Id>
    <d:ContentTypeID>00000000-0000-0000-0000-000000000000</d:ContentTypeID>
    <d:ContentType>Document</d:ContentType>
    <d:Created m:type="Edm.DateTime">2009-01-26T13:55:24</d:Created>
    <d:CreatedById m:type="Edm.Int32">20</d:CreatedById>
    <d:Modified m:type="Edm.DateTime">2009-01-26T13:55:24</d:Modified>
    <d:ModifiedById m:type="Edm.Int32">20</d:ModifiedById>
    <d:CopySource m:null="true"></d:CopySource>
    <d:ApprovalStatus>0</d:ApprovalStatus>
    <d:Path>/xxx/yyy</d:Path>
    <d:CheckedOutToId m:type="Edm.Int32" m:null="true"></d:CheckedOutToId>
    <d:Name>DocumentTitle.pdf</d:Name>
    <d:VirusStatus>42282</d:VirusStatus>
    <d:IsCurrentVersion m:type="Edm.Boolean">true</d:IsCurrentVersion>
    <d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
    <d:Version>1.0</d:Version>
    <d:Title m:null="true"></d:Title>
  <!--  End of the elements I can access-->
  </m:properties>
</entry>
</feed>

1 个答案:

答案 0 :(得分:0)

在完成项目的许多其他方面后,我终于回到了这个问题。

我查看了Feed中的所有可用数据,并提出了一个可行的解决方案。

我能够将“Path”属性与站点的基本URL(通过项目参数传递)和“Name”一起使用来构建文件读取器。

一个包下来,44个去!