Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add NLM Identifier and openAccess properties to SZNAltmetricArticle

Update Mac OS X demo app layout
  • Loading branch information...
commit f69b3823a2076688da020c608b11ad276d271376 1 parent 2ce8570
@vtourraine vtourraine authored
View
3  Examples/SZNAltmetricDemoOSX/SZNAltmetricDemoOSX/SZNAppDelegate.h
@@ -16,9 +16,12 @@
@property (nonatomic, weak) IBOutlet NSTextField *DOITextField;
@property (nonatomic, weak) IBOutlet NSTextField *scoreTextField;
@property (nonatomic, weak) IBOutlet NSImageView *scoreImageView;
+@property (nonatomic, weak) IBOutlet NSProgressIndicator *progressIndicator;
@property (nonatomic, strong) SZNAltmetricArticle *representedArticle;
- (IBAction)fetchArticle:(id)sender;
+- (IBAction)openArticleURL:(id)sender;
+- (IBAction)openDetailsURL:(id)sender;
@end
View
13 Examples/SZNAltmetricDemoOSX/SZNAltmetricDemoOSX/SZNAppDelegate.m
@@ -18,13 +18,26 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
- (IBAction)fetchArticle:(id)sender
{
+ [self.progressIndicator startAnimation:sender];
[[SZNAltmetricAPIClient sharedClient] fetchArticleWithDOI:self.DOITextField.stringValue success:^(SZNAltmetricArticle *article) {
self.representedArticle = article;
self.scoreImageView.image = [[NSImage alloc] initWithContentsOfURL:article.imageLargeURL];
+ [self.progressIndicator stopAnimation:sender];
} failure:^(NSError *error) {
NSLog(@"%s %@", __PRETTY_FUNCTION__, [error description]);
[[NSAlert alertWithError:error] runModal];
+ [self.progressIndicator stopAnimation:sender];
}];
}
+- (IBAction)openArticleURL:(id)sender
+{
+ [[NSWorkspace sharedWorkspace] openURL:self.representedArticle.articleURL];
+}
+
+- (IBAction)openDetailsURL:(id)sender
+{
+ [[NSWorkspace sharedWorkspace] openURL:self.representedArticle.detailsURL];
+}
+
@end
View
480 Examples/SZNAltmetricDemoOSX/SZNAltmetricDemoOSX/en.lproj/MainMenu.xib
@@ -20,6 +20,7 @@
<string>NSMenu</string>
<string>NSMenuItem</string>
<string>NSObjectController</string>
+ <string>NSProgressIndicator</string>
<string>NSTextField</string>
<string>NSTextFieldCell</string>
<string>NSUserDefaultsController</string>
@@ -1301,12 +1302,13 @@
<object class="NSWindowTemplate" id="972006081">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{335, 390}, {442, 503}}</string>
+ <string key="NSWindowRect">{{335, 390}, {653, 354}}</string>
<int key="NSWTFlags">1954021376</int>
<string key="NSWindowTitle">SZNAltmetricDemoOSX</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
+ <string key="NSWindowContentMinSize">{600, 350}</string>
<object class="NSView" key="NSWindowView" id="439893737">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
@@ -1314,10 +1316,10 @@
<object class="NSButton" id="398878416">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">265</int>
- <string key="NSFrame">{{309, 455}, {119, 32}}</string>
+ <string key="NSFrame">{{309, 306}, {119, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="947307993"/>
+ <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="541890488">
@@ -1343,7 +1345,7 @@
<object class="NSTextField" id="741115370">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 464}, {75, 17}}</string>
+ <string key="NSFrame">{{17, 315}, {75, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="346050211"/>
@@ -1380,7 +1382,7 @@
<object class="NSTextField" id="346050211">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">266</int>
- <string key="NSFrame">{{97, 461}, {210, 22}}</string>
+ <string key="NSFrame">{{97, 312}, {210, 22}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="398878416"/>
@@ -1413,52 +1415,10 @@
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
- <object class="NSTextField" id="947307993">
- <reference key="NSNextResponder" ref="439893737"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 395}, {78, 17}}</string>
- <reference key="NSSuperview" ref="439893737"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="396397178"/>
- <string key="NSReuseIdentifierKey">_NS:1535</string>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="546370497">
- <int key="NSCellFlags">68157504</int>
- <int key="NSCellFlags2">71304192</int>
- <string key="NSContents">Title:</string>
- <reference key="NSSupport" ref="351287099"/>
- <string key="NSCellIdentifier">_NS:1535</string>
- <reference key="NSControlView" ref="947307993"/>
- <reference key="NSBackgroundColor" ref="408594633"/>
- <reference key="NSTextColor" ref="1012213633"/>
- </object>
- <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
- </object>
- <object class="NSTextField" id="965514140">
- <reference key="NSNextResponder" ref="439893737"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 360}, {78, 17}}</string>
- <reference key="NSSuperview" ref="439893737"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="25331222"/>
- <string key="NSReuseIdentifierKey">_NS:1535</string>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="613125941">
- <int key="NSCellFlags">68157504</int>
- <int key="NSCellFlags2">71304192</int>
- <string key="NSContents">Score:</string>
- <reference key="NSSupport" ref="351287099"/>
- <string key="NSCellIdentifier">_NS:1535</string>
- <reference key="NSControlView" ref="965514140"/>
- <reference key="NSBackgroundColor" ref="408594633"/>
- <reference key="NSTextColor" ref="1012213633"/>
- </object>
- <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
- </object>
<object class="NSTextField" id="25331222">
<reference key="NSNextResponder" ref="439893737"/>
- <int key="NSvFlags">266</int>
- <string key="NSFrame">{{97, 357}, {328, 27}}</string>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{30, 54}, {180, 27}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="884517583"/>
@@ -1466,7 +1426,7 @@
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="991322573">
<int key="NSCellFlags">68157504</int>
- <int key="NSCellFlags2">272630784</int>
+ <int key="NSCellFlags2">138413056</int>
<string key="NSContents">##.##</string>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande-Bold</string>
@@ -1491,7 +1451,7 @@
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
<string>NeXT TIFF v4.0 pasteboard type</string>
</set>
- <string key="NSFrame">{{97, 167}, {180, 180}}</string>
+ <string key="NSFrame">{{30, 86}, {180, 180}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="747661773"/>
@@ -1503,7 +1463,7 @@
<string key="NSCellIdentifier">_NS:9</string>
<int key="NSAlign">0</int>
<int key="NSScale">0</int>
- <int key="NSStyle">0</int>
+ <int key="NSStyle">2</int>
<bool key="NSAnimates">NO</bool>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -1512,15 +1472,15 @@
<object class="NSTextField" id="396397178">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">266</int>
- <string key="NSFrame">{{97, 393}, {328, 22}}</string>
+ <string key="NSFrame">{{228, 241}, {500, 22}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="965514140"/>
+ <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="707248227">
- <int key="NSCellFlags">68157504</int>
- <int key="NSCellFlags2">272630784</int>
+ <int key="NSCellFlags">67108928</int>
+ <int key="NSCellFlags2">272631808</int>
<string key="NSContents">####</string>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande-Bold</string>
@@ -1537,7 +1497,7 @@
<object class="NSTextField" id="747661773">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 130}, {90, 17}}</string>
+ <string key="NSFrame">{{228, 206}, {90, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="887704791"/>
@@ -1558,15 +1518,15 @@
<object class="NSTextField" id="887704791">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">266</int>
- <string key="NSFrame">{{109, 130}, {316, 17}}</string>
+ <string key="NSFrame">{{320, 206}, {316, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="489602111"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="636461284">
- <int key="NSCellFlags">68157504</int>
- <int key="NSCellFlags2">-1874852864</int>
+ <int key="NSCellFlags">67108928</int>
+ <int key="NSCellFlags2">-1874851840</int>
<string key="NSContents">####</string>
<reference key="NSSupport" ref="351287099"/>
<object class="NSDateFormatter" key="NSFormatter" id="453137832">
@@ -1588,7 +1548,7 @@
<object class="NSTextField" id="489602111">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 105}, {90, 17}}</string>
+ <string key="NSFrame">{{228, 181}, {90, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="455521229"/>
@@ -1609,15 +1569,15 @@
<object class="NSTextField" id="455521229">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">266</int>
- <string key="NSFrame">{{109, 105}, {316, 17}}</string>
+ <string key="NSFrame">{{320, 181}, {316, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="701276379"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="252099549">
- <int key="NSCellFlags">68157504</int>
- <int key="NSCellFlags2">-1874852864</int>
+ <int key="NSCellFlags">67108928</int>
+ <int key="NSCellFlags2">-1874851840</int>
<string key="NSContents">####</string>
<reference key="NSSupport" ref="351287099"/>
<object class="NSDateFormatter" key="NSFormatter" id="803280586">
@@ -1639,7 +1599,7 @@
<object class="NSTextField" id="701276379">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 80}, {90, 17}}</string>
+ <string key="NSFrame">{{228, 156}, {90, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="633635273"/>
@@ -1660,15 +1620,15 @@
<object class="NSTextField" id="633635273">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">266</int>
- <string key="NSFrame">{{109, 80}, {316, 17}}</string>
+ <string key="NSFrame">{{320, 156}, {316, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
+ <reference key="NSNextKeyView" ref="202763222"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="980807179">
- <int key="NSCellFlags">68157504</int>
- <int key="NSCellFlags2">-1874852864</int>
+ <int key="NSCellFlags">67108928</int>
+ <int key="NSCellFlags2">-1874851840</int>
<string key="NSContents">####</string>
<reference key="NSSupport" ref="351287099"/>
<object class="NSDateFormatter" key="NSFormatter" id="592071403">
@@ -1687,13 +1647,157 @@
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
+ <object class="NSTextField" id="202763222">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{241, 121}, {77, 17}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="259857311"/>
+ <string key="NSReuseIdentifierKey">_NS:1535</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="956902677">
+ <int key="NSCellFlags">68157504</int>
+ <int key="NSCellFlags2">71304192</int>
+ <string key="NSContents">Article URL:</string>
+ <reference key="NSSupport" ref="351287099"/>
+ <string key="NSCellIdentifier">_NS:1535</string>
+ <reference key="NSControlView" ref="202763222"/>
+ <reference key="NSBackgroundColor" ref="408594633"/>
+ <reference key="NSTextColor" ref="1012213633"/>
+ </object>
+ <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+ </object>
+ <object class="NSTextField" id="259857311">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrame">{{320, 121}, {201, 17}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="848500127"/>
+ <string key="NSReuseIdentifierKey">_NS:1535</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="1054826354">
+ <int key="NSCellFlags">69206081</int>
+ <int key="NSCellFlags2">-1874851840</int>
+ <string key="NSContents">####</string>
+ <reference key="NSSupport" ref="351287099"/>
+ <string key="NSCellIdentifier">_NS:1535</string>
+ <reference key="NSControlView" ref="259857311"/>
+ <reference key="NSBackgroundColor" ref="408594633"/>
+ <reference key="NSTextColor" ref="1012213633"/>
+ </object>
+ <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+ </object>
+ <object class="NSTextField" id="848500127">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{238, 96}, {80, 17}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="224979840"/>
+ <string key="NSReuseIdentifierKey">_NS:1535</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="215868182">
+ <int key="NSCellFlags">68157504</int>
+ <int key="NSCellFlags2">71304192</int>
+ <string key="NSContents">Details URL:</string>
+ <reference key="NSSupport" ref="351287099"/>
+ <string key="NSCellIdentifier">_NS:1535</string>
+ <reference key="NSControlView" ref="848500127"/>
+ <reference key="NSBackgroundColor" ref="408594633"/>
+ <reference key="NSTextColor" ref="1012213633"/>
+ </object>
+ <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+ </object>
+ <object class="NSTextField" id="224979840">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrame">{{320, 96}, {201, 17}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="207139991"/>
+ <string key="NSReuseIdentifierKey">_NS:1535</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="357794871">
+ <int key="NSCellFlags">69206081</int>
+ <int key="NSCellFlags2">-1874851840</int>
+ <string key="NSContents">####</string>
+ <reference key="NSSupport" ref="351287099"/>
+ <string key="NSCellIdentifier">_NS:1535</string>
+ <reference key="NSControlView" ref="224979840"/>
+ <reference key="NSBackgroundColor" ref="408594633"/>
+ <reference key="NSTextColor" ref="1012213633"/>
+ </object>
+ <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+ </object>
+ <object class="NSButton" id="207139991">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{520, 112}, {119, 32}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="140510701"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="278958320">
+ <int key="NSCellFlags">67108864</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Open Article</string>
+ <reference key="NSSupport" ref="351287099"/>
+ <string key="NSCellIdentifier">_NS:9</string>
+ <reference key="NSControlView" ref="207139991"/>
+ <int key="NSButtonFlags">-2038284288</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+ </object>
+ <object class="NSButton" id="140510701">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{519, 87}, {121, 32}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="812404220">
+ <int key="NSCellFlags">67108864</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Open Details</string>
+ <reference key="NSSupport" ref="351287099"/>
+ <string key="NSCellIdentifier">_NS:9</string>
+ <reference key="NSControlView" ref="140510701"/>
+ <int key="NSButtonFlags">-2038284288</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+ </object>
+ <object class="NSProgressIndicator" id="19062232">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{430, 315}, {16, 16}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:945</string>
+ <int key="NSpiFlags">28938</int>
+ <double key="NSMaxValue">100</double>
+ </object>
</array>
- <string key="NSFrameSize">{442, 503}</string>
+ <string key="NSFrameSize">{653, 354}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="741115370"/>
</object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
+ <string key="NSMinSize">{600, 372}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
@@ -2433,6 +2537,30 @@
<int key="connectionID">556</int>
</object>
<object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">openArticleURL:</string>
+ <reference key="source" ref="976324537"/>
+ <reference key="destination" ref="207139991"/>
+ </object>
+ <int key="connectionID">630</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">openDetailsURL:</string>
+ <reference key="source" ref="976324537"/>
+ <reference key="destination" ref="140510701"/>
+ </object>
+ <int key="connectionID">631</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">progressIndicator</string>
+ <reference key="source" ref="976324537"/>
+ <reference key="destination" ref="19062232"/>
+ </object>
+ <int key="connectionID">633</int>
+ </object>
+ <object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: selection.self.score</string>
<reference key="source" ref="25331222"/>
@@ -2568,6 +2696,46 @@
</object>
<int key="connectionID">608</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: selection.self.articleURL</string>
+ <reference key="source" ref="259857311"/>
+ <reference key="destination" ref="944205278"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="259857311"/>
+ <reference key="NSDestination" ref="944205278"/>
+ <string key="NSLabel">value: selection.self.articleURL</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">selection.self.articleURL</string>
+ <object class="NSDictionary" key="NSOptions">
+ <string key="NS.key.0">NSNoSelectionPlaceholder</string>
+ <string key="NS.object.0">Undefined</string>
+ </object>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">624</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: selection.self.detailsURL</string>
+ <reference key="source" ref="224979840"/>
+ <reference key="destination" ref="944205278"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="224979840"/>
+ <reference key="NSDestination" ref="944205278"/>
+ <string key="NSLabel">value: selection.self.detailsURL</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">selection.self.detailsURL</string>
+ <object class="NSDictionary" key="NSOptions">
+ <string key="NS.key.0">NSNoSelectionPlaceholder</string>
+ <string key="NS.object.0">Undefined</string>
+ </object>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">625</int>
+ </object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@@ -3095,18 +3263,23 @@
<array class="NSMutableArray" key="children">
<reference ref="346050211"/>
<reference ref="398878416"/>
- <reference ref="25331222"/>
- <reference ref="947307993"/>
- <reference ref="965514140"/>
<reference ref="396397178"/>
<reference ref="741115370"/>
- <reference ref="747661773"/>
<reference ref="884517583"/>
+ <reference ref="25331222"/>
+ <reference ref="747661773"/>
<reference ref="887704791"/>
<reference ref="489602111"/>
<reference ref="455521229"/>
<reference ref="701276379"/>
<reference ref="633635273"/>
+ <reference ref="202763222"/>
+ <reference ref="259857311"/>
+ <reference ref="848500127"/>
+ <reference ref="224979840"/>
+ <reference ref="207139991"/>
+ <reference ref="140510701"/>
+ <reference ref="19062232"/>
</array>
<reference key="parent" ref="972006081"/>
</object>
@@ -3623,19 +3796,6 @@
<reference key="parent" ref="346050211"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">546</int>
- <reference key="object" ref="947307993"/>
- <array class="NSMutableArray" key="children">
- <reference ref="546370497"/>
- </array>
- <reference key="parent" ref="439893737"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">547</int>
- <reference key="object" ref="546370497"/>
- <reference key="parent" ref="947307993"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">548</int>
<reference key="object" ref="25331222"/>
<array class="NSMutableArray" key="children">
@@ -3673,19 +3833,6 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">573</int>
- <reference key="object" ref="965514140"/>
- <array class="NSMutableArray" key="children">
- <reference ref="613125941"/>
- </array>
- <reference key="parent" ref="439893737"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">574</int>
- <reference key="object" ref="613125941"/>
- <reference key="parent" ref="965514140"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">575</int>
<reference key="object" ref="396397178"/>
<array class="NSMutableArray" key="children">
@@ -3800,6 +3947,91 @@
<reference key="object" ref="592071403"/>
<reference key="parent" ref="980807179"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">612</int>
+ <reference key="object" ref="202763222"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="956902677"/>
+ </array>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">613</int>
+ <reference key="object" ref="259857311"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="1054826354"/>
+ </array>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">614</int>
+ <reference key="object" ref="1054826354"/>
+ <array class="NSMutableArray" key="children"/>
+ <reference key="parent" ref="259857311"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">616</int>
+ <reference key="object" ref="956902677"/>
+ <reference key="parent" ref="202763222"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">618</int>
+ <reference key="object" ref="848500127"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="215868182"/>
+ </array>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">619</int>
+ <reference key="object" ref="224979840"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="357794871"/>
+ </array>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">620</int>
+ <reference key="object" ref="357794871"/>
+ <array class="NSMutableArray" key="children"/>
+ <reference key="parent" ref="224979840"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">622</int>
+ <reference key="object" ref="215868182"/>
+ <reference key="parent" ref="848500127"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">626</int>
+ <reference key="object" ref="207139991"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="278958320"/>
+ </array>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">627</int>
+ <reference key="object" ref="278958320"/>
+ <reference key="parent" ref="207139991"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">628</int>
+ <reference key="object" ref="140510701"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="812404220"/>
+ </array>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">629</int>
+ <reference key="object" ref="812404220"/>
+ <reference key="parent" ref="140510701"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">632</int>
+ <reference key="object" ref="19062232"/>
+ <reference key="parent" ref="439893737"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -3949,8 +4181,6 @@
<string key="543.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="544.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="545.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="546.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="547.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="548.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="549.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="553.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3959,8 +4189,6 @@
<string key="559.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="57.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="573.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="574.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="575.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="576.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="58.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3982,6 +4210,19 @@
<string key="610.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1" key="611.IBDateFormatterBehaviorMetadataKey"/>
<string key="611.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="612.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="613.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="614.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="616.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="618.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="619.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="620.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="622.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="626.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="627.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="628.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="629.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="632.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="72.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="73.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="74.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3998,26 +4239,35 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">611</int>
+ <int key="maxID">633</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">SZNAppDelegate</string>
<string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">fetchArticle:</string>
- <string key="NS.object.0">id</string>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">fetchArticle:</string>
- <object class="IBActionInfo" key="NS.object.0">
+ <dictionary class="NSMutableDictionary" key="actions">
+ <string key="fetchArticle:">id</string>
+ <string key="openArticleURL:">id</string>
+ <string key="openDetailsURL:">id</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
+ <object class="IBActionInfo" key="fetchArticle:">
<string key="name">fetchArticle:</string>
<string key="candidateClassName">id</string>
</object>
- </object>
+ <object class="IBActionInfo" key="openArticleURL:">
+ <string key="name">openArticleURL:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="openDetailsURL:">
+ <string key="name">openDetailsURL:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="DOITextField">NSTextField</string>
+ <string key="progressIndicator">NSProgressIndicator</string>
<string key="scoreImageView">NSImageView</string>
<string key="scoreTextField">NSTextField</string>
<string key="window">NSWindow</string>
@@ -4027,6 +4277,10 @@
<string key="name">DOITextField</string>
<string key="candidateClassName">NSTextField</string>
</object>
+ <object class="IBToOneOutletInfo" key="progressIndicator">
+ <string key="name">progressIndicator</string>
+ <string key="candidateClassName">NSProgressIndicator</string>
+ </object>
<object class="IBToOneOutletInfo" key="scoreImageView">
<string key="name">scoreImageView</string>
<string key="candidateClassName">NSImageView</string>
View
4 Examples/SZNAltmetricDemoOSX/SZNAltmetricDemoOSXTests/classes/SZNAltmetricArticleTests.m
@@ -13,7 +13,7 @@ @implementation SZNAltmetricArticleTests
- (void)testArticleFromRespondeDictionary
{
- SZNAltmetricArticle *article = [SZNAltmetricArticle articleWithAPIResponseObject:@{@"added_on" : @(1324491937), @"altmetric_id" : @(1), @"ads_id" : @"ADS-123", @"doi" : @"DOI-123", @"arxiv_id" : @"arXiv-123", @"last_updated" : @(1324491938), @"pmid" : @"pmid-123", @"published_on" : @(1324491939), @"score" : @(42), @"images" : @{@"small" : @"http://test.com/small.jpg", @"medium" : @"http://test.com/medium.jpg", @"large" : @"http://test.com/large.jpg"}, @"title" : @"Article", @"details_url" : @"http://test.com/article/details", @"url" : @"http://test.com/article"}];
+ SZNAltmetricArticle *article = [SZNAltmetricArticle articleWithAPIResponseObject:@{@"added_on" : @(1324491937), @"altmetric_id" : @(1), @"ads_id" : @"ADS-123", @"doi" : @"DOI-123", @"arxiv_id" : @"arXiv-123", @"last_updated" : @(1324491938), @"nlmid" : @"NLM-123", @"pmid" : @"pmid-123", @"published_on" : @(1324491939), @"score" : @(42), @"images" : @{@"small" : @"http://test.com/small.jpg", @"medium" : @"http://test.com/medium.jpg", @"large" : @"http://test.com/large.jpg"}, @"is_oa" : @(YES), @"title" : @"Article", @"details_url" : @"http://test.com/article/details", @"url" : @"http://test.com/article"}];
STAssertNotNil(article, @"Article not created");
@@ -23,12 +23,14 @@ - (void)testArticleFromRespondeDictionary
STAssertEqualObjects(article.DOI, @"DOI-123", @"DOI not extracted");
STAssertEqualObjects(article.arXiv, @"arXiv-123", @"arXiv identifier not extracted");
STAssertEqualObjects(article.lastUpdated, [NSDate dateWithTimeIntervalSince1970:1324491938], @"Last updated not extracted");
+ STAssertEqualObjects(article.NLMIdentifier, @"NLM-123", @"NLM identifier not extracted");
STAssertEqualObjects(article.pubMedIdentifier, @"pmid-123", @"PubMed identifier not extracted");
STAssertEqualObjects(article.publishedOn, [NSDate dateWithTimeIntervalSince1970:1324491939], @"Published on not extracted");
STAssertEqualObjects(article.score, @(42), @"Score not extracted");
STAssertEqualObjects(article.imageSmallURL.absoluteString, @"http://test.com/small.jpg", @"Image small URL not extracted");
STAssertEqualObjects(article.imageMediumURL.absoluteString, @"http://test.com/medium.jpg", @"Image medium URL not extracted");
STAssertEqualObjects(article.imageLargeURL.absoluteString, @"http://test.com/large.jpg", @"Image large URL not extracted");
+ STAssertEqualObjects(article.openAccess, @(YES), @"Open Access not extracted");
STAssertEqualObjects(article.title, @"Article", @"Title not extracted");
STAssertEqualObjects(article.articleURL.absoluteString, @"http://test.com/article", @"Article URL not extracted");
STAssertEqualObjects(article.detailsURL.absoluteString, @"http://test.com/article/details", @"Details URL not extracted");
View
10 SZNAltmetric/SZNAltmetricArticle.h
@@ -50,6 +50,11 @@
@property (copy, nonatomic) NSString *arXiv;
/**
+ The NLM (National Library of Medicine) Identifier of the article.
+ */
+@property (copy, nonatomic) NSString *NLMIdentifier;
+
+/**
The PubMed Identifier of the article.
*/
@property (copy, nonatomic) NSString *pubMedIdentifier;
@@ -80,6 +85,11 @@
@property (strong, nonatomic) NSURL *imageSmallURL;
/**
+ The Open Access status (boolean) of the article.
+ */
+@property (strong, nonatomic) NSNumber *openAccess;
+
+/**
The URL of the article.
*/
@property (strong, nonatomic) NSURL *articleURL;
View
2  SZNAltmetric/SZNAltmetricArticle.m
@@ -34,12 +34,14 @@ + (SZNAltmetricArticle *)articleWithAPIResponseObject:(id)responseObject
article.DOI = responseObject[@"doi"];
article.arXiv = responseObject[@"arxiv_id"];
article.lastUpdated = [NSDate dateWithTimeIntervalSince1970:[responseObject[@"last_updated"] doubleValue]];
+ article.NLMIdentifier = responseObject[@"nlmid"];
article.PubMedIdentifier = responseObject[@"pmid"];
article.publishedOn = [NSDate dateWithTimeIntervalSince1970:[responseObject[@"published_on"] doubleValue]];
article.score = responseObject[@"score"];
article.imageLargeURL = [NSURL URLWithString:responseObject[@"images"][@"large"]];
article.imageMediumURL = [NSURL URLWithString:responseObject[@"images"][@"medium"]];
article.imageSmallURL = [NSURL URLWithString:responseObject[@"images"][@"small"]];
+ article.openAccess = responseObject[@"is_oa"];
article.title = responseObject[@"title"];
article.articleURL = [NSURL URLWithString:responseObject[@"url"]];
article.detailsURL = [NSURL URLWithString:responseObject[@"details_url"]];
Please sign in to comment.
Something went wrong with that request. Please try again.