BibDesk EZProxy Support
Adding EZProxy support to BibDesk looks pretty straightforward.
Currently it looks like bibdesk/BDSKWebParser.m has a method called “itemsFromDocument” which is responsible for extracting certain data from a document. This includes webType, which is an enum identifying which repository the data came from (ACM, WoS, etc). This is then used to choose an appropriate parser for the document.
(Note: I’ve added /* Some code skipped */ comments where I’ve cut out some code)
+ (NSArray *)itemsFromDocument:(DOMDocument *)domDocument fromURL:(NSURL *)url error:(NSError **)outError{
BDSKASSERT(self == [BDSKWebParser class]);
/* ... some code skipped ... */
int webType = [self webTypeOfDocument:domDocument xmlDocument:xmlDoc fromURL:url];
Class parserClass = webParserClassForType(webType);
BDSKASSERT(parserClass != [BDSKWebParser class]);
// don't return nil here; this may be the Google Scholar homepage or something, and we don't want to display an error message for it
// this may lead to some false negatives if the heuristics for canParseDocument::: change.
if (Nil == parserClass)
return [NSArray array];
return [parserClass itemsFromDocument:domDocument xmlDocument:xmlDoc fromURL:url error:outError];
This in turn calls “webTypeOfDocument” which iterates through all the parsers and returns the first successful one,
+ (int)webTypeOfDocument:(DOMDocument *)domDocument xmlDocument:(NSXMLDocument *)xmlDocument fromURL:(NSURL *)url{
/* Some code skipped */
if([BDSKACMDLParser canParseDocument:domDocument xmlDocument:xmlDocument fromURL:url])
return BDSKACMDLWebType;
/* Some code skipped */
return BDSKUnknownWebType;
}
For the ACM example, this is in bibdesk/BDSKACMDLParser.m
I tried a simple test which appears to work. I’m no Objective C coder but I imagine it would be straightforward to write this well (e.g., make it data-driven so users can define their own sets of domains to append to repository domains; replace the hardcoded strings with const’s; probably refactor the whole URL-repository testing and parsing code as it looks like there’s a lot of tight coupling all over the place)
+ (BOOL)canParseDocument:(DOMDocument *)domDocument xmlDocument:(NSXMLDocument *)xmlDocument fromURL:(NSURL *)url{
if ([[url host] caseInsensitiveCompare:@"portal.acm.org"] != NSOrderedSame){
/* [GARETH] Test support for ezproxy */
if ([[url host] caseInsensitiveCompare:@"portal.acm.org.ezproxy.sussex.ac.uk"] != NSOrderedSame){
return NO;
}
}
/* Some code skipped */
—
Some useful links:
I’d also like to use a real QuickLook window that will allow me to scroll and zoom with multitouch, like in Apple’s Preview.app, or Papers by Mekentosj. However, I suspect that I could only implement that with something like the upcoming Snow Leopard’s alleged multi touch framework. Alternatively this “Cocoa Multi-Touch Framework for Mac OS X” might be of use,
http://hci.rwth-aachen.de/multitouch
I think the current preview is part of FileView,
http://code.google.com/p/fileview/
I think this has information about how to implement QL functionality,
http://developer.apple.com/documentation/userexperience/Conceptual/Quicklook_Programming_Guide/Introduction/Introduction.html
QuickLook is supported in BibDesk by pressing the standard Cmd-Y, and I think this is probably sufficient (though it would be great if this window were to replace the current thumbnail view – i.e., an embedded as opposed to floating QL window were constantly available and active for scrolling etc.)
http://developer.apple.com/documentation/UserExperience/Conceptual/Quicklook_Programming_Guide/QLArchitecture/QLArchitecture.html#//apple_ref/doc/uid/TP40005020-CH4-SW5
“The consumer portion of Quick Look has three components: a document reader (consisting of a custom view and panel), display bundles for that reader, and an SPI to enable communication with the client. Each of these components has a specific role to play in support of the consumer:
Document reader—Quick Look implements a view (NSView) and panel (NSPanel) customized for displaying document previews. Along with the preview content, the view might include (at the client’s option) controls for manipulating the preview, such as page-forward, page-backward, start playing, rewind, and text-search. A client application can embed this view in its user interface if it chooses.”
I think I observed some kind of bug, where the size and position of my QL window was forgotten everytime I closed it, though I now think that behaviour disappeared when I had the QL window already open then clicked on another (local file or remote url) attachment in the entry. The new file opened in th QL window, which I was then able to close & reopen with the same dimensions and position.
[EDIT: 20090604] I think this bug only manifests when you click on a BibDesk entry and issue the QuickLook action (cmd-Y), rather than when you issue it on an individual file attachment (in the Side Preview window.)
On hitting cmd-Y the following call-stack is executed,
BDSKApplication.m:88BDSKApplication sendAction()
BibDocument_Actions.m:1089
previewAction()
theURLs = [self selectedFileURLs];
The following are also interesting,
BibDocument.m:3313
#pragma mark FVFileView
BibDocument_DataSource.m:1743
#pragma mark FVFileView data source and delegate
BDSKEditor.m:1531
#pragma mark FVFileView support
BibDocument.h:144
IBOutlet FVFileView *sideFileView;
I think ultimately it comes down to FVFileView.m or FVPreviewer.m
Hi,
I run (with ITS) the ezproxy service here at Sussex. Just came across this via a Google Search. Looks like great stuff
Haven’t come across BibDesk before, have added it to my growing list of bib management software I need to check out.
http://delicious.com/ckeene/bib_management
Cheers
Chris
HI Chris,
Thanks for the comments – and the link to your delicious page, I’m off to check out Bookends now.
Cheers!
TODO:
I want to drag a PDF file / URL onto the window and have it auto-create a new publication for me. Could this be automated somehow by understanding templates other than PubMed?
—
Auto-Fill-In Title and Author when iporting a pdf
http://sourceforge.net/mailarchive/forum.php?thread_name=E1MGZ0c-00060G-Ph%403bkjzd1.ch3.sourceforge.com&forum_name=bibdesk-rfes
Why can’t I create a new record by dragging a PDF file into the reference window?
http://sourceforge.net/apps/mediawiki/bibdesk/index.php?title=FAQ#Why_can.27t_I_create_a_new_record_by_dragging_a_PDF_file_into_the_reference_window.3F
Hmm.
When I drag and drop an ezproxy URL from Safari into BibDesk I only see the authentication page as attachment to my publication, not the final resource (e.g., PDF)
That’s fair enough for the first time, but I expect to be able to authenticate so subsequent opens of this document reveal the final resource, not the authentication page each time.
I suspect there’s some problem with the way cookies are not shared throughout the application. Perhaps each new window is treated like a new browser without any previous history. Instead they should all share the same data, so that if I open an ezproxy window and authenticate then all subsequent URLs that go through the same proxy should automatically use the same authentication data.
There is a way to open a bookmarked URL such as portal.acm.org.ezproxy.sussex.ac.uk which requires me to authenticate. This open in the External / Web panel on the left hand side of BibDesk.
I think subsequent opens of ezproxy URLs will then not require further authentication until program restart.
Here’s a scenario that works fine, presumably because going through the initial Publication->New from web somehow allows cookies to be shared with other publications,
Start BibDesk
Publication->New from Web
http://doi.acm.org.ezproxy.sussex.ac.uk/10.1145/1375761.1375762
Enter authentication details.
Cancel publication addition.
In Safari, load the same URL.
Click Display Format -> BibDesk
Select all from pop up window.
Copy.
Now in BibDesk,
Publication -> New from clipboard
Attachment automatically loads without requiring authentication again.
QuickLook loads page without requiring further authentication.
Right click on attachment, select Download and Replace.
Back in Safari,
Click on PDF link. PDF opens in browser.
Drag URL into BibDesk publication attachment.
In BibDesk,
Right click on attachment and select Download and Replace.
Further requirements for BibDesk:
Parsing ACM publications from their webpage (this could be implemented as an Apple Script, to take the current tab as the source, and BibDesk as the destination.)
Automatically copy and add keywords.
Automatically copy and add abstract.
Automatically generate cite-key (overwrite the ACM key with our own.)
Another issue: parsing Science Direct
e.g.,
http://www.sciencedirect.com/science/article/B6VD0-45P0BRS-5T/2/2cdd249f163c48addfcc8fd836595f6a
Export Format -> BibTeX Format
@article{ReedDoke1990169,
title = “An industry survey of emerging prototyping methodologies”,
journal = “Information & Management”,
volume = “18″,
number = “4″,
pages = “169 – 176″,
year = “1990″,
note = “”,
issn = “0378-7206″,
doi = “DOI: 10.1016/0378-7206(90)90037-I”,
url = “http://www.sciencedirect.com/science/article/B6VD0-45P0BRS-5T/2/2cdd249f163c48addfcc8fd836595f6a”,
author = “E. Reed Doke”,
keywords = “Prototype”,
keywords = “Prototyping Methodologies”,
keywords = “Prototyping Methodology Taxonomy”,
keywords = “System Design”
}
BibDesk:
Publication -> New from clipboard
This will only add the final keyword. It looks like BibDesk assumes only a single keyword line, and overwrites the previous data with the most recent line. This is clearly a bug.