Using spsList to set document metadata

  • 19 February 2007
  • 1 reply
  • 2 views

Badge +1
Hi

A question regarding sharepoint integration, specifically updating meta-data pertaining to sharepoint documents using the spsList class / assembly.

Using the wizard generates a piece of code similar to

if (! (_spsList.SetDocumentMetaData(
_site,
_sharepointFolder,
_sharepointFile,
xml,
ref errorMessage)))

most of the arguments are self explanatory, and working fine

the piece of xml that is passed is

<Column Name="Client Name" Description="">Craig</Column>

This works fine

However, what I want to be able to do it to pass many values at once, rather than calling the web service many times. I tried passing a piece of xml in similar to this -

<Column Name="Client Name" Description="">Craig</Column>
<Column Name="Client Type" Description="">Private</Column>
<Column Name="Amount" Description="">1000</Column>

with no success. Although i didn't get an error, the meta-data was not updated at all.

There are a couple of reasons I would like to pass in all of the meta-data values at once. Firstly for performance - calling the web service once rather than many times (10 or more) will be much more effecient. Secondly, I have document versioning turned on in sharepoint. Each web service call produces a new version of the document, so I end up with 10+ versions when updating the meta-data - not efficient in terms of storage or searching for previous versions.

Could you tell me how I can update all of my meta-data with a single web-service call please.

Thanks

1 reply

Badge +9
Hi Criag,

If you run the SPS2003 Document Wizard and choose the option to set Metadata, you will notice that you are able to bind multiple process values to the SPS document metadata.

Also note that if you go to CodeView, you can see that the metadata values are updated in a single call.

Take note that the values are encapulated within the <MetaData></MetaData> tags.

Let me know if this helps you get this working.

Cheers,

Johnny

Reply