Hi,
i'm writting a plugin for a online Database. The search plugin works very well.
But the "Get information for selection" in the "advanced" menu does nothing.
i can't find information on this menu, could someone help me ??
Thank you so much
Bobino
New Plugin : problem with "Get information for selection" me
Re: New Plugin : problem with "Get information for selection" me
Hi Bobino,
When using the "Get information for selection" the entire record is sent to the plug-in, so the 'keyword' attribute is not filled and you have to pull out the preferred data from the records field that you would like to search on. The code in the "searchFor:sender:" method would be something like this:
Hope that helps if you have any other questions don't hesitate to ask.
When using the "Get information for selection" the entire record is sent to the plug-in, so the 'keyword' attribute is not filled and you have to pull out the preferred data from the records field that you would like to search on. The code in the "searchFor:sender:" method would be something like this:
Code: Select all
NSString *urlString= nil;
// This is the regular search from the keyword window.
if ([searchDict objectForKey:@"keyword"]) {
urlString = [searchDict objectForKey:@"keyword"];
}
// Otherwise it's a record and I want a specific field so I try the best ones first, like UPC that will give me a unique record.
else if ([searchDict objectForKey:@"upc"]) {
urlString = [searchDict objectForKey:@"upc"];
}
else if ([searchDict objectForKey:@"title"] && [searchDict objectForKey:@"director"]) {
urlString = [NSString stringWithFormat:@"%@+%@", [searchDict objectForKey:@"title"], [searchDict objectForKey:@"director"]];
}
else if ([searchDict objectForKey:@"title"]) {
urlString = [searchDict objectForKey:@"title"];
}
else if ([searchDict objectForKey:@"director"]) {
urlString = [searchDict objectForKey:@"director"];
}
else {
[sender searchReturnedNumberOfResults:0 sender:self];
}
// Here you would continue with your regular code and run the search using urlString as the search keyword.
Re: New Plugin : problem with "Get information for selection" me
perfect !!
thks
thks