You could try something similar to the following (C#):
var documentMetaData = new DocumentMetaData(); // assign properties to documentMetaData m_QmsClient.SaveDocumentMetaData(documentMetaData);
The thing is, I'm not sure exactly what the management console sets as the metadata when you browse to the documents tab. You might want to copy a file, browse to that tab, grab the newly created DocumentMetaData object for that document, serialise it and see exactly which properties are needed as a minimum.
I imagine it's simply documentMetaData.UserDocument.FolderID (should be the same as the FolderID of the folder that it's in) and documentMetaData.UserDocument.Name (should be the same as the document's filename), but I'm not 100% sure on this.
Michael, Thanks for your reply.
I've tried your suggestion, but it didn't appear to work (completely). I tried to create a new DocumentMetaData object based on an existing one. That code is pasted below. While the SaveDocumentMetaData is successful, GetUserDocuments returns null when I try to retrieve the document again.
However, after the SaveDocumentMetaData I do see a .Meta file on the file system. So I'm getting closer but QMS API doesn't seem to recognize the new metadata I created.
DocumentFolder documentFolder = m_QmsClient.GetUserDocumentFolders(m_QvsGuid, DocumentFolderScope.Administrators);
DocumentMetaData dmd = new DocumentMetaData();
dmd.QVSID = m_QvsGuid;
dmd.Scope = DocumentMetaDataScope.DocumentInfo;
dmd.UserDocument = new DocumentNode();
dmd.UserDocument.Type = DocumentType.User;
dmd.UserDocument.RelativePath = relativePath;
dmd.UserDocument.Name = documentName;
dmd.UserDocument.FolderID = documentFolder.ID;
dmd.UserDocument.ID = Guid.NewGuid();
DocumentMetaData.DocumentMetaDataDocumentInfo dmddi = new DocumentMetaData.DocumentMetaDataDocumentInfo();
dmddi.Attributes = new List<DocumentAttribute>();
dmd.DocumentInfo = dmddi;
before you call GetUserDocuments?
Thinking about it, calling:
might generate the default metadata for the new documents automatically - I'm not sure though.
Hopefully one/both of these will do the trick!
Thank you very much. I searched QMSAPIDocumentation.chm and came across this comment in the Examples section. So it appears clearing UserDocumentList does the trick.
// clear the QMS's QVS object cache from user document listings
// so that the any new user documents can be discovered