Hi,
I'm new to PW programming and are trying to find my way around all the samples.
I'm trying to write a C# plugin for MS CONNECT that will use saved searches to copy out documents to the client.
I have figured out how to execute a saved search and retrieve a DataTable of the resulting documents. Nice!
Now (actually first) I would like to the a list of all the names of the saved searches. Can anyone put me in the right direction?
Next will be to execute the acutal copy...
Regards,
Krister
Never mind. I have figured it out!
/Krister
Owner consultant at Surell Consulting AB
Can you please share us so that we also get to know how to figure it out? Thank you.
Well, I found some code in a package I cannot share but the following snippts could be useful.
private static void LoadAllSavedSearches() { var bufferPointer = PWWrapper.aaApi_SQueryDataBufferSelectAll(); var count = PWWrapper.aaApi_DmsDataBufferGetCount(bufferPointer); for (var i = 0; i < count; i++) { var savedSearch = new SavedSearch(bufferPointer, i); _searchCache.Add(savedSearch.QueryId,savedSearch); } PWWrapper.aaApi_DmsDataBufferFree(bufferPointer); }
internal SavedSearch(IntPtr bufferPointer, int index) { QueryId = PWWrapper.aaApi_DmsDataBufferGetNumericProperty(bufferPointer, 1, index); UserId = PWWrapper.aaApi_DmsDataBufferGetNumericProperty(bufferPointer, 2, index); ParentQueryId = PWWrapper.aaApi_DmsDataBufferGetNumericProperty(bufferPointer, 3, index); HasCriteria = PWWrapper.aaApi_DmsDataBufferGetNumericProperty(bufferPointer, 4, index) != 0; HasSubItems = PWWrapper.aaApi_DmsDataBufferGetNumericProperty(bufferPointer, 5, index) != 0; Name = PWWrapper.aaApi_DmsDataBufferGetStringProperty(bufferPointer, 6, index); Description = PWWrapper.aaApi_DmsDataBufferGetStringProperty(bufferPointer, 7, index); ProjectId = PWWrapper.aaApi_DmsDataBufferGetNumericProperty(bufferPointer, 8, index); SearchObjectType = PWWrapper.aaApi_DmsDataBufferGetStringProperty(bufferPointer, 9, index); }
Thank you again.