The company I work for is considering using the EndNote API to connect a proprietary DB system to EndNote. We would need to allow users to link records in our database with records in an EndNote database.
To this end, I have looked through the EndNote API, and found IUIDatabase:: Display(), but there doesn’t seem to be any callback we can use for when users select a record in EndNote. Am I missing something, or does the API really not have this functionality?
Edit: After rereading my post, I realized I may not have been totally clear. What I’m looking for: once a user selects a record in EndNote, I need to get a callback with a unique identifier for that record. Then our proprietary system stores that unique ID. Later, the user of our system asks to see the EndNote record again, and the ID is passed back into EndNote, highlighting/bringing up the details for the record.
Is this possible?
You can call IUIDatabase::GetRecords and have it return an IRecordList of the currently selected references.
If you have the Record Number for the references you need to select you can use IDatabase::GetRecordID so you can then display those references in EndNote.
Thanks for your prompt reply. I guess I overlooked IUIDatabase::GetRecords.
The next step is passing the record number back into IDatabase::GetRecordID, from which I get an IString of the record ID. But IUIDatabase:: Display requires an IRecordList, and I can’t tell how to get an object of that type from the record ID. Of course I can’t instantiate the interface, and I’ve been going through the API docs again looking for the function to use, to no avail.
There should be sample plugins in the RDK file you downloaded. Here is a snip from the ConvertHTMLTag sample:
if( pIUIService->GetLibrary(pIUIService->kFrontMost,&pFrontMostWindow) != kServiceNoErr ) return;
if( pFrontMostWindow->GetRecords(pFrontMostWindow->kShowing,&pRecordList) != kServiceNoErr ) return;
Yes, I’ve looked through the sample projects. Using GetRecords to get the IRecordList of displayed records is not a problem, I’m already doing that, thanks to your first post on this thread.
What I’m asking is how do I turn those record IDs back into an IRecordList? Put another way, I’m successfully serializing records, but now I need to deserialize them back into an IRecordList, so they can be passed back to DIsplay.
You can use IDatabaseService::GetOpenDatabases to get an IDatabaseList. You can then use IDatabaseList::NewRecordList to create a new IRecordList. You can then use IRecordList::AddRecord with the RecordID.