Revision: 29206
          http://sourceforge.net/p/bibdesk/svn/29206
Author:   hofman
Date:     2025-04-26 21:38:42 +0000 (Sat, 26 Apr 2025)
Log Message:
-----------
Scripting support for SRU server info

Modified Paths:
--------------
    trunk/bibdesk/BDSKServerInfo+Scripting.m
    trunk/bibdesk/Scripting/BibDesk.sdef

Modified: trunk/bibdesk/BDSKServerInfo+Scripting.m
===================================================================
--- trunk/bibdesk/BDSKServerInfo+Scripting.m    2025-04-26 16:47:28 UTC (rev 
29205)
+++ trunk/bibdesk/BDSKServerInfo+Scripting.m    2025-04-26 21:38:42 UTC (rev 
29206)
@@ -68,6 +68,10 @@
         [info setValue:[self recordSyntax] forKey:@"recordSyntax"];
         [info setValue:[self resultEncoding] forKey:@"resultEncoding"];
         [info setValue:[NSNumber numberWithBool:[self removeDiacritics]] 
forKey:@"removeDiacritics"];
+    } else if ([self isSRU]) {
+        [info setValue:[self host] forKey:@"host"];
+        [info setValue:[self port] forKey:@"port"];
+        [info setValue:[self recordSyntax] forKey:@"recordSyntax"];
     } else if ([self isISI]) {
         [info setValue:[self username] forKey:@"username"];
         [info setValue:[NSNumber numberWithBool:[self isLite]] forKey:@"lite"];
@@ -113,6 +117,13 @@
                 [serverInfo setResultEncoding:value];
             if ((number = [info valueForKey:@"removeDiacritics"]))
                 [serverInfo setRemoveDiacritics:[number boolValue]];
+        } else if ([serverType isEqualToString:BDSKSearchGroupSRU]) {
+            if (host)
+                [serverInfo setHost:host];
+            if (port)
+                [serverInfo setPort:port];
+            if ((value = [info valueForKey:@"recordSyntax"]))
+                [serverInfo setRecordSyntax:value];
         } else if ([serverType isEqualToString:BDSKSearchGroupISI]) {
             if ((value = [info valueForKey:@"username"]))
                 [serverInfo setUsername:value];
@@ -147,6 +158,8 @@
         isValid = NO;
     else if ([serverInfo isZoom] && ([NSString isEmptyString:[serverInfo 
host]] || [[serverInfo port] integerValue] == 0))
         isValid = NO;
+    else if ([serverInfo isSRU] && [NSString isEmptyString:[serverInfo host]])
+        isValid = NO;
     for (NSString *key in info) {
         if (isValid == NO) break;
         value = validatedValue = [info valueForKey:key];

Modified: trunk/bibdesk/Scripting/BibDesk.sdef
===================================================================
--- trunk/bibdesk/Scripting/BibDesk.sdef        2025-04-26 16:47:28 UTC (rev 
29205)
+++ trunk/bibdesk/Scripting/BibDesk.sdef        2025-04-26 21:38:42 UTC (rev 
29206)
@@ -1812,14 +1812,18 @@
                 description="Z3950 search server.">
                 <cocoa string-value="zoom"/>
             </enumerator>
-            <enumerator name="WOS" code="WOK "
-                description="Web of Science search server.">
-                <cocoa string-value="isi"/>
+            <enumerator name="SRU" code="SRU "
+                description="SRU search server.">
+                <cocoa string-value="sru"/>
             </enumerator>
             <enumerator name="DBLP" code="DBLP"
                 description="DBLP search server.">
                 <cocoa string-value="dblp"/>
             </enumerator>
+            <enumerator name="WOS" code="WOK "
+                description="Web of Science search server.">
+                <cocoa string-value="isi"/>
+            </enumerator>
         </enumeration>
         
         <enumeration name="field type" code="FTyp">

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to