orcid_client 0.2.3 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +120 -43
  3. data/lib/orcid_client/api.rb +1 -1
  4. data/lib/orcid_client/author.rb +2 -49
  5. data/lib/orcid_client/date.rb +3 -3
  6. data/lib/orcid_client/external_identifier.rb +1 -1
  7. data/lib/orcid_client/notification.rb +3 -5
  8. data/lib/orcid_client/version.rb +1 -1
  9. data/lib/orcid_client/work.rb +23 -28
  10. data/lib/orcid_client.rb +2 -0
  11. data/orcid_client.gemspec +5 -4
  12. data/resources/{common_2.0_rc3/common-2.0_rc3.xsd → common_2.0/common-2.0.xsd} +68 -49
  13. data/resources/{common_2.0_rc3/samples/common-2.0_rc3.xml → common_2.0/samples/common-2.0.xml} +1 -1
  14. data/resources/notification_2.0/README.md +123 -0
  15. data/resources/notification_2.0/notification-custom-2.0.xsd +38 -0
  16. data/resources/notification_2.0/notification-permission-2.0.xsd +134 -0
  17. data/resources/{notification_2.0_rc3/samples/notification-custom-2.0_rc3.xml → notification_2.0/samples/notification-custom-2.0.xml} +3 -3
  18. data/resources/{notification_2.0_rc3/samples/notification-permission-2.0_rc3.xml → notification_2.0/samples/notification-permission-2.0.xml} +2 -2
  19. data/resources/record_2.0/README.md +304 -0
  20. data/resources/{record_2.0_rc3/activities-2.0_rc3.xsd → record_2.0/activities-2.0.xsd} +79 -46
  21. data/resources/{record_2.0_rc3/address-2.0_rc3.xsd → record_2.0/address-2.0.xsd} +1 -1
  22. data/resources/{record_2.0_rc3/bulk-2.0_rc3.xsd → record_2.0/bulk-2.0.xsd} +12 -12
  23. data/resources/{record_2.0_rc3/education-2.0_rc3.xsd → record_2.0/education-2.0.xsd} +5 -5
  24. data/resources/{record_2.0_rc3/email-2.0_rc3.xsd → record_2.0/email-2.0.xsd} +3 -1
  25. data/resources/{record_2.0_rc3/employment-2.0_rc3.xsd → record_2.0/employment-2.0.xsd} +5 -5
  26. data/resources/{record_2.0_rc3/error-2.0_rc3.xsd → record_2.0/error-2.0.xsd} +0 -0
  27. data/resources/{record_2.0_rc3/funding-2.0_rc3.xsd → record_2.0/funding-2.0.xsd} +5 -49
  28. data/resources/{record_2.0_rc3/history-2.0_rc3.xsd → record_2.0/history-2.0.xsd} +1 -1
  29. data/resources/{record_2.0_rc3/keyword-2.0_rc3.xsd → record_2.0/keyword-2.0.xsd} +2 -2
  30. data/resources/{record_2.0_rc3/other-name-2.0_rc3.xsd → record_2.0/other-name-2.0.xsd} +2 -2
  31. data/resources/{record_2.0_rc3/peer-review-2.0_rc3.xsd → record_2.0/peer-review-2.0.xsd} +4 -4
  32. data/resources/record_2.0/peer-review-guide-v2.0.md +131 -0
  33. data/resources/{record_2.0_rc3/person-2.0_rc3.xsd → record_2.0/person-2.0.xsd} +8 -21
  34. data/resources/{record_2.0_rc3/person-external-identifier-2.0_rc3.xsd → record_2.0/person-external-identifier-2.0.xsd} +1 -1
  35. data/resources/{record_2.0_rc3/personal-details-2.0_rc3.xsd → record_2.0/personal-details-2.0.xsd} +5 -7
  36. data/resources/{record_2.0_rc3/preferences-2.0_rc3.xsd → record_2.0/preferences-2.0.xsd} +1 -1
  37. data/resources/{record_2.0_rc3/record-2.0_rc3.xsd → record_2.0/record-2.0.xsd} +16 -23
  38. data/resources/{record_2.0_rc3/researcher-url-2.0_rc3.xsd → record_2.0/researcher-url-2.0.xsd} +2 -2
  39. data/resources/{record_2.0_rc3/samples/activities-2.0_rc3.xml → record_2.0/samples/read_samples/activities-2.0.xml} +24 -12
  40. data/resources/{record_2.0_rc3/samples/address-2.0_rc3.xml → record_2.0/samples/read_samples/address-2.0.xml} +1 -1
  41. data/resources/{record_2.0_rc3/samples/addresses-2.0_rc3.xml → record_2.0/samples/read_samples/addresses-2.0.xml} +1 -1
  42. data/resources/{record_2.0_rc3/samples/biography-2.0_rc3.xml → record_2.0/samples/read_samples/biography-2.0.xml} +2 -2
  43. data/resources/record_2.0/samples/read_samples/bulk-work-error.xml +45 -0
  44. data/resources/{record_2.0_rc3/samples/credit-name-2.0_rc3.xml → record_2.0/samples/read_samples/credit-name-2.0.xml} +2 -2
  45. data/resources/{record_2.0_rc3/samples/education-full-2.0_rc3.xml → record_2.0/samples/read_samples/education-2.0.xml} +1 -1
  46. data/resources/{record_2.0_rc3/samples/education-2.0_rc3.xml → record_2.0/samples/read_samples/education-full-2.0.xml} +12 -2
  47. data/resources/record_2.0/samples/read_samples/educations-2.0.xml +52 -0
  48. data/resources/{record_2.0_rc3/samples/email-2.0_rc3.xml → record_2.0/samples/read_samples/email-2.0.xml} +2 -2
  49. data/resources/{record_2.0_rc3/samples/emails-2.0_rc3.xml → record_2.0/samples/read_samples/emails-2.0.xml} +3 -3
  50. data/resources/{record_2.0_rc3/samples/employment-full-2.0_rc3.xml → record_2.0/samples/read_samples/employment-2.0.xml} +1 -1
  51. data/resources/{record_2.0_rc3/samples/employment-2.0_rc3.xml → record_2.0/samples/read_samples/employment-full-2.0.xml} +14 -4
  52. data/resources/record_2.0/samples/read_samples/employments-2.0.xml +52 -0
  53. data/resources/{record_2.0_rc3/samples/error-2.0_rc3.xml → record_2.0/samples/read_samples/error-2.0.xml} +1 -1
  54. data/resources/{record_2.0_rc3/samples/external-identifier-2.0_rc3.xml → record_2.0/samples/read_samples/external-identifier-2.0.xml} +3 -2
  55. data/resources/{record_2.0_rc3/samples/external-identifiers-2.0_rc3.xml → record_2.0/samples/read_samples/external-identifiers-2.0.xml} +5 -3
  56. data/resources/{record_2.0_rc3/samples/funding-full-2.0_rc3.xml → record_2.0/samples/read_samples/funding-2.0.xml} +2 -2
  57. data/resources/{record_2.0_rc3/samples/funding-2.0_rc3.xml → record_2.0/samples/read_samples/funding-full-2.0.xml} +13 -3
  58. data/resources/record_2.0/samples/read_samples/fundings-2.0.xml +138 -0
  59. data/resources/{record_2.0_rc3/samples/history-2.0_rc3.xml → record_2.0/samples/read_samples/history-2.0.xml} +1 -1
  60. data/resources/{record_2.0_rc3/samples/keyword-2.0_rc3.xml → record_2.0/samples/read_samples/keyword-2.0.xml} +1 -1
  61. data/resources/{record_2.0_rc3/samples/keywords-2.0_rc3.xml → record_2.0/samples/read_samples/keywords-2.0.xml} +1 -1
  62. data/resources/{record_2.0_rc3/samples/name-2.0_rc3.xml → record_2.0/samples/read_samples/name-2.0.xml} +1 -1
  63. data/resources/{record_2.0_rc3/samples/other-name-2.0_rc3.xml → record_2.0/samples/read_samples/other-name-2.0.xml} +1 -1
  64. data/resources/{record_2.0_rc3/samples/other-names-2.0_rc3.xml → record_2.0/samples/read_samples/other-names-2.0.xml} +1 -1
  65. data/resources/{record_2.0_rc3/samples/peer-review-full-2.0_rc3.xml → record_2.0/samples/read_samples/peer-review-2.0.xml} +1 -1
  66. data/resources/{record_2.0_rc3/samples/peer-review-2.0_rc3.xml → record_2.0/samples/read_samples/peer-review-full-2.0.xml} +18 -8
  67. data/resources/record_2.0/samples/read_samples/peer-reviews-2.0.xml +73 -0
  68. data/resources/{record_2.0_rc3/samples/person-2.0_rc3.xml → record_2.0/samples/read_samples/person-2.0.xml} +1 -1
  69. data/resources/{record_2.0_rc3/samples/personal-details-2.0_rc3.xml → record_2.0/samples/read_samples/personal-details-2.0.xml} +1 -1
  70. data/resources/{record_2.0_rc3/samples/preferences-2.0_rc3.xml → record_2.0/samples/read_samples/preferences-2.0.xml} +1 -1
  71. data/resources/{record_2.0_rc3/samples/record-2.0_rc3.xml → record_2.0/samples/read_samples/record-2.0.xml} +73 -85
  72. data/resources/{record_2.0_rc3/samples/researcher-url-2.0_rc3.xml → record_2.0/samples/read_samples/researcher-url-2.0.xml} +1 -1
  73. data/resources/{record_2.0_rc3/samples/researcher-urls-2.0_rc3.xml → record_2.0/samples/read_samples/researcher-urls-2.0.xml} +1 -1
  74. data/resources/record_2.0/samples/read_samples/search-2.0.xml +14 -0
  75. data/resources/{record_2.0_rc3/samples/work-full-2.0_rc3.xml → record_2.0/samples/read_samples/work-2.0.xml} +5 -5
  76. data/resources/{record_2.0_rc3/samples/work-2.0_rc3.xml → record_2.0/samples/read_samples/work-full-2.0.xml} +14 -4
  77. data/resources/record_2.0/samples/read_samples/works-2.0.xml +146 -0
  78. data/resources/record_2.0/samples/write_sample/address-2.0.xml +6 -0
  79. data/resources/{record_2.0_rc3/samples/bulk-work-2.0_rc3.json → record_2.0/samples/write_sample/bulk-work-2.0.json} +55 -55
  80. data/resources/{record_2.0_rc3/samples/bulk-work-2.0_rc3.xml → record_2.0/samples/write_sample/bulk-work-2.0.xml} +18 -11
  81. data/resources/record_2.0/samples/write_sample/education-2.0.xml +30 -0
  82. data/resources/record_2.0/samples/write_sample/employment-2.0.xml +30 -0
  83. data/resources/record_2.0/samples/write_sample/external-identifier-2.0.xml +11 -0
  84. data/resources/record_2.0/samples/write_sample/funding-2.0.xml +44 -0
  85. data/resources/record_2.0/samples/write_sample/keyword-2.0.xml +7 -0
  86. data/resources/record_2.0/samples/write_sample/other-name-2.0.xml +6 -0
  87. data/resources/record_2.0/samples/write_sample/peer-review-full-2.0.xml +48 -0
  88. data/resources/record_2.0/samples/write_sample/peer-review-simple-2.0.xml +32 -0
  89. data/resources/record_2.0/samples/write_sample/researcher-url-2.0.xml +7 -0
  90. data/resources/record_2.0/samples/write_sample/work-full-2.0.xml +54 -0
  91. data/resources/record_2.0/samples/write_sample/work-simple-2.0.xml +18 -0
  92. data/resources/{record_2.0_rc3/search-2.0_rc3.xsd → record_2.0/search-2.0.xsd} +6 -26
  93. data/resources/{record_2.0_rc3/work-2.0_rc3.xsd → record_2.0/work-2.0.xsd} +8 -129
  94. data/spec/api_spec.rb +3 -3
  95. data/spec/external_identifier_spec.rb +2 -2
  96. data/spec/fixtures/external_identifier.xml +1 -1
  97. data/spec/fixtures/vcr_cassettes/OrcidClient/external_identifier/delete/should_delete_external_identifier.yml +17 -5
  98. data/spec/fixtures/vcr_cassettes/OrcidClient/external_identifier/post/should_create_external_identifier.yml +19 -7
  99. data/spec/fixtures/vcr_cassettes/OrcidClient/notifications/delete/should_delete_notification.yml +19 -6
  100. data/spec/fixtures/vcr_cassettes/OrcidClient/notifications/get/should_get_notification.yml +20 -6
  101. data/spec/fixtures/vcr_cassettes/OrcidClient/notifications/post/should_create_notification.yml +90 -25
  102. data/spec/fixtures/vcr_cassettes/OrcidClient/works/delete/should_delete_work.yml +17 -5
  103. data/spec/fixtures/vcr_cassettes/OrcidClient/works/get/should_get_works.yml +554 -543
  104. data/spec/fixtures/vcr_cassettes/OrcidClient/works/post/should_create_work.yml +90 -25
  105. data/spec/fixtures/vcr_cassettes/OrcidClient/works/put/should_update_work.yml +99 -28
  106. data/spec/fixtures/vcr_cassettes/OrcidClient_Notification/data.yml +72 -17
  107. data/spec/fixtures/vcr_cassettes/OrcidClient_Notification/schema/validates_data.yml +70 -17
  108. data/spec/fixtures/vcr_cassettes/OrcidClient_Notification/schema/validates_item_type_work.yml +72 -14
  109. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/literal.yml +72 -20
  110. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/multiple_titles.yml +72 -20
  111. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/valid.yml +72 -23
  112. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/with_ORCID_IDs.yml +75 -133
  113. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/data.yml +72 -23
  114. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/publication_date.yml +72 -23
  115. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_ORCID_IDs_for_contributors.yml +75 -133
  116. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_data.yml +72 -23
  117. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_work_type_data-set.yml +72 -20
  118. data/spec/fixtures/work.xml +4 -2
  119. data/spec/notification_spec.rb +4 -4
  120. data/spec/work_spec.rb +6 -6
  121. metadata +122 -80
  122. data/lib/orcid_client/metadata.rb +0 -128
  123. data/resources/notification_2.0_rc3/notification-custom-2.0_rc3.xsd +0 -32
  124. data/resources/notification_2.0_rc3/notification-permission-2.0_rc3.xsd +0 -128
  125. data/resources/record_2.0_rc3/deprecated-2.0_rc3.xsd +0 -80
  126. data/resources/record_2.0_rc3/internal-2.0_rc3.xsd +0 -199
  127. data/resources/record_2.0_rc3/samples/deprecated-2.0_rc3.xml +0 -13
  128. data/resources/record_2.0_rc3/samples/search-2.0_rc3.xml +0 -368
  129. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/citation.yml +0 -50
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
3
  xmlns:sch="http://purl.oclc.org/dsdl/schematron" elementFormDefault="qualified"
4
4
  targetNamespace="http://www.orcid.org/ns/common" xmlns:common="http://www.orcid.org/ns/common">
5
5
  <xs:annotation>
@@ -164,7 +164,7 @@
164
164
  </xs:annotation>
165
165
 
166
166
  <xs:sequence>
167
- <xs:element name="name" type="common:non-empty-string" />
167
+ <xs:element name="name" type="common:long-text" />
168
168
  <xs:element name="address" type="common:organization-address" />
169
169
  <xs:element name="disambiguated-organization" type="common:disambiguated-organization"
170
170
  minOccurs="0" maxOccurs="1" />
@@ -177,12 +177,12 @@
177
177
  </xs:documentation>
178
178
  </xs:annotation>
179
179
  <xs:sequence>
180
- <xs:element minOccurs="1" name="city" type="common:non-empty-string">
180
+ <xs:element minOccurs="1" name="city" type="common:long-text">
181
181
  <xs:annotation>
182
182
  <xs:documentation>City</xs:documentation>
183
183
  </xs:annotation>
184
184
  </xs:element>
185
- <xs:element minOccurs="0" name="region" type="common:non-empty-string">
185
+ <xs:element minOccurs="0" name="region" type="common:long-text">
186
186
  <xs:annotation>
187
187
  <xs:documentation>Region within a country</xs:documentation>
188
188
  </xs:annotation>
@@ -816,7 +816,7 @@
816
816
  </xs:documentation>
817
817
  </xs:annotation>
818
818
  <xs:restriction base="xs:string">
819
- <xs:pattern value="APP-[\da-zA-Z]{16}" />
819
+ <xs:pattern value="(APP-[\da-zA-Z]{16}|(\d{4}-){3,}\d{3}[\dX])" />
820
820
  </xs:restriction>
821
821
  </xs:simpleType>
822
822
 
@@ -827,7 +827,7 @@
827
827
  </xs:annotation>
828
828
  <xs:restriction base="xs:string">
829
829
  <xs:pattern
830
- value="http://([^/]*orcid\.org|localhost.*/orcid-web)/client/APP-[\da-zA-Z]{16}" />
830
+ value="http://([^/]*orcid\.org|localhost.*/orcid-web)/client/(APP-[\da-zA-Z]{16}|(\d{4}-){3,}\d{3}[\dX])" />
831
831
  </xs:restriction>
832
832
  </xs:simpleType>
833
833
 
@@ -943,6 +943,7 @@
943
943
  </xs:documentation>
944
944
  </xs:annotation>
945
945
  <xs:restriction base="xs:string">
946
+ <xs:maxLength value="350" />
946
947
  <xs:pattern value="[^@]+@[^\.]+\..+" />
947
948
  </xs:restriction>
948
949
  </xs:simpleType>
@@ -1042,35 +1043,7 @@
1042
1043
  </xs:element>
1043
1044
  </xs:sequence>
1044
1045
  </xs:sequence>
1045
- </xs:complexType>
1046
-
1047
- <xs:simpleType name="scope-path-type">
1048
- <xs:annotation>
1049
- <xs:documentation>See the ORCID Knowledgebase for a complete
1050
- description of ORCID Scopes and related documentation:
1051
- http://support.orcid.org/knowledgebase/articles/120162-orcid-scopes.
1052
- </xs:documentation>
1053
- </xs:annotation>
1054
- <xs:restriction base="xs:string">
1055
- <xs:enumeration value="/activities/update" />
1056
- <xs:enumeration value="/authenticate" />
1057
- <xs:enumeration value="/funding/create" />
1058
- <xs:enumeration value="/funding/read-limited" />
1059
- <xs:enumeration value="/funding/update" />
1060
- <xs:enumeration value="/orcid-bio/external-identifiers/create" />
1061
- <xs:enumeration value="/orcid-bio/read-limited" />
1062
- <xs:enumeration value="/orcid-bio/update" />
1063
- <xs:enumeration value="/orcid-patents/update" />
1064
- <xs:enumeration value="/orcid-patents/create" />
1065
- <xs:enumeration value="/orcid-patents/read-limited" />
1066
- <xs:enumeration value="/orcid-profile/read-limited" />
1067
- <xs:enumeration value="/orcid-works/create" />
1068
- <xs:enumeration value="/orcid-works/read-limited" />
1069
- <xs:enumeration value="/orcid-works/update" />
1070
- <xs:enumeration value="/person/update" />
1071
- <xs:enumeration value="/read-limited" />
1072
- </xs:restriction>
1073
- </xs:simpleType>
1046
+ </xs:complexType>
1074
1047
 
1075
1048
  <xs:simpleType name="iso-3166-country">
1076
1049
  <xs:annotation>
@@ -1353,7 +1326,7 @@
1353
1326
 
1354
1327
  <xs:simpleType name="short-text">
1355
1328
  <xs:annotation>
1356
- <xs:documentation>A non-empty string that has a maximum size of 2084
1329
+ <xs:documentation>A non-empty string that has a maximum size of 500
1357
1330
  characters
1358
1331
  </xs:documentation>
1359
1332
  </xs:annotation>
@@ -1362,6 +1335,28 @@
1362
1335
  </xs:restriction>
1363
1336
  </xs:simpleType>
1364
1337
 
1338
+ <xs:simpleType name="string-150">
1339
+ <xs:annotation>
1340
+ <xs:documentation>A non-empty string that has a maximum size of 150
1341
+ characters
1342
+ </xs:documentation>
1343
+ </xs:annotation>
1344
+ <xs:restriction base="common:non-empty-string">
1345
+ <xs:maxLength value="150" />
1346
+ </xs:restriction>
1347
+ </xs:simpleType>
1348
+
1349
+ <xs:simpleType name="string-200">
1350
+ <xs:annotation>
1351
+ <xs:documentation>A non-empty string that has a maximum size of 200
1352
+ characters
1353
+ </xs:documentation>
1354
+ </xs:annotation>
1355
+ <xs:restriction base="xs:string">
1356
+ <xs:maxLength value="200" />
1357
+ </xs:restriction>
1358
+ </xs:simpleType>
1359
+
1365
1360
  <xs:simpleType name="string-255">
1366
1361
  <xs:annotation>
1367
1362
  <xs:documentation>A non-empty string that has a maximum size of 255
@@ -1373,6 +1368,17 @@
1373
1368
  </xs:restriction>
1374
1369
  </xs:simpleType>
1375
1370
 
1371
+ <xs:simpleType name="string-350">
1372
+ <xs:annotation>
1373
+ <xs:documentation>A non-empty string that has a maximum size of 350
1374
+ characters
1375
+ </xs:documentation>
1376
+ </xs:annotation>
1377
+ <xs:restriction base="common:non-empty-string">
1378
+ <xs:maxLength value="350" />
1379
+ </xs:restriction>
1380
+ </xs:simpleType>
1381
+
1376
1382
  <xs:simpleType name="string-1000">
1377
1383
  <xs:annotation>
1378
1384
  <xs:documentation>A non-empty string that has a maximum size of 1000
@@ -1393,7 +1399,7 @@
1393
1399
  <xs:restriction base="common:non-empty-string">
1394
1400
  <xs:maxLength value="2084" />
1395
1401
  </xs:restriction>
1396
- </xs:simpleType>
1402
+ </xs:simpleType>
1397
1403
 
1398
1404
  <xs:complexType name="string-with-lang-code">
1399
1405
  <xs:annotation>
@@ -1416,10 +1422,21 @@
1416
1422
  </xs:documentation>
1417
1423
  </xs:annotation>
1418
1424
  <xs:restriction base="xs:string">
1419
- <xs:maxLength value="5000"></xs:maxLength>
1425
+ <xs:maxLength value="5000" />
1420
1426
  </xs:restriction>
1421
1427
  </xs:simpleType>
1422
1428
 
1429
+ <xs:simpleType name="long-text">
1430
+ <xs:annotation>
1431
+ <xs:documentation>Must contain one or more charaters that are not a
1432
+ space, carriage return or linefeed
1433
+ </xs:documentation>
1434
+ </xs:annotation>
1435
+ <xs:restriction base="common:non-empty-string">
1436
+ <xs:maxLength value="4000" />
1437
+ </xs:restriction>
1438
+ </xs:simpleType>
1439
+
1423
1440
  <xs:complexType name="credit-name">
1424
1441
  <xs:annotation>
1425
1442
  <xs:documentation>The name to use for the researcher or contributor
@@ -1435,9 +1452,7 @@
1435
1452
  </xs:documentation>
1436
1453
  </xs:annotation>
1437
1454
  <xs:simpleContent>
1438
- <xs:extension base="common:non-empty-string">
1439
- <xs:attribute name="visibility" type="common:visibility" />
1440
- </xs:extension>
1455
+ <xs:extension base="common:string-150" />
1441
1456
  </xs:simpleContent>
1442
1457
  </xs:complexType>
1443
1458
 
@@ -1450,13 +1465,16 @@
1450
1465
  </xs:annotation>
1451
1466
  </xs:element>
1452
1467
 
1453
- <xs:element name="subtitle">
1454
- <xs:complexType mixed="true">
1455
- <xs:annotation>
1456
- <xs:documentation>If the work has a subtitle, include it here.
1457
- </xs:documentation>
1458
- </xs:annotation>
1459
- </xs:complexType>
1468
+ <xs:element name="subtitle">
1469
+ <xs:annotation>
1470
+ <xs:documentation>If the work has a subtitle, include it here.
1471
+ </xs:documentation>
1472
+ </xs:annotation>
1473
+ <xs:simpleType>
1474
+ <xs:restriction base="xs:string">
1475
+ <xs:maxLength value="1000"/>
1476
+ </xs:restriction>
1477
+ </xs:simpleType>
1460
1478
  </xs:element>
1461
1479
 
1462
1480
  <xs:element name="translated-title">
@@ -1620,5 +1638,6 @@
1620
1638
  <xs:restriction base="common:string-1000">
1621
1639
  <xs:pattern value="(ringgold:|issn:|orcid-generated:|fundref:|publons:)([0-9a-zA-Z\^._~:/?#\[\]@!$&amp;'()*+,;=-]){2,}" />
1622
1640
  </xs:restriction>
1623
- </xs:simpleType>
1641
+ </xs:simpleType>
1642
+
1624
1643
  </xs:schema>
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <common:application-group-orcid
3
3
  xmlns:common="http://www.orcid.org/ns/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
- xsi:schemaLocation="http://www.orcid.org/ns/common ../common-2.0_rc3.xsd ">
4
+ xsi:schemaLocation="http://www.orcid.org/ns/common ../common-2.0.xsd ">
5
5
  <common:uri>http://orcid.org/8888-8888-8888-8880</common:uri>
6
6
  <common:path>8888-8888-8888-8880</common:path>
7
7
  <common:host>orcid.org</common:host>
@@ -0,0 +1,123 @@
1
+
2
+ #ORCID API v2.0_rc1 Notifications Permission Guide
3
+ Starting in v2.0_rc1, the ORCID API supports new functionality to enable member organizations to add permission requests to a user's ORCID Inbox. These requests provide a "snapshot" example of the type of activities that will be added to the user's ORCID record as a result of granting the permission.
4
+
5
+ _**User-friendly implementation detail**: Several fields described below are displayed directly to the end user. The ORCID user interface is currently available in 10+ languages, and emails sent to the user are also presented in the user's language of choice. The language preference of the user is available via the ORCID API, and is always public. We strongly recommend that you read and consider the user's language when providing messages to them, providing user-displayed fields in their preferred language when feasible._
6
+
7
+ ##Notifications Permission XML
8
+ XML for the ```permission``` notifications follows the [notification-permission-2.0_rc1.xsd](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/notification_2.0_rc1/notification-permission-2.0_rc1.xsd) and consists of the following sections:
9
+
10
+ - **notification:notification-type**: The type of notification - for this type of notification, the value is always ```permission```.
11
+
12
+ - **notification:authorization-url**: This field is the URL string that you would call if you were asking for the permission from the user from your own application. It is formatted as a URL string, using the format found for the call [GET OAUTH/AUTHORIZE](http://members.orcid.org/api/get-oauthauthorize). _Note: one may specify only the URL path if desired. This approach is useful if you want to use identical code in multiple environments, for example on the ORCID Sandbox and Production environments._
13
+
14
+ - **notification:notification-subject**: DISPLAYED TO END USER. A plain text value for describing to the user the type of items that you'll plan to add to his/her record once permission is granted. This value should be short (fewer than 25 characters), and can be a bit more descriptive, for example, "your recent publications", or "validated affiliations", or it can simply mirror the value used for ```notification:item-type``` below (education, employment, etc. You should assume that this text will be used in the middle of a sentence _(for example, the message subject line of "Add &lt;notification:item-type&gt; to your ORCID record")_, so you should use discretion on capitalization and length.
15
+
16
+ - **notification:notification-intro**: DISPLAYED TO END USER. A short message that will be included in the inbox message to the end-user. This message will be presented before the list of activities that you have included in the message. Your intro message should not exceed 1000 characters.
17
+
18
+
19
+
20
+ **notification:items block**
21
+
22
+ Consists of one or more ```notification:item``` elements, which contain the following sub-elements:
23
+
24
+ - **notification:item-type**: The type of ORCID item represented by this ```item``` element. Choosen from the following: ```education```, ```employment```, ```funding```, or ```work```.
25
+
26
+ - **notification:item-name**: DISPLAYED TO END USER. The name that should be shown to the end user to describe the item. This field is usually the name of the item that might be added once permission is granted (for example, the title of an article), but it also could include other identifying information, for example, _"Article Title (as published in journal ABC)"_, where "(as published in journal ABC)" is additional infomration that the client application would like to present to the user.
27
+
28
+ - **notification:external-identifier**: DISPLAYED TO END USER. An external identifier for the item. While this field is not required, it is very helpful information to provide to the end user, as it distinguishes the item from others that may be similar. Note that, when adding the item to the ORCID record, at least one external identifier is required, even if an internal reference identifier is used for this purpose.
29
+
30
+ For an example XML file, see [notification-permission-2.0_rc1.xml](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/notification_2.0_rc1/samples/notification-permission-2.0_rc1.xml)
31
+
32
+ ***Note:*** *Sample files contain system-generated elements/attributes that are returned when reading items from ORCID. The following items should not be included when posting items to ORCID. These fields will be present when reading notifications using this API:*
33
+
34
+ - **put-code** - ORCID_internal identifier for this notification. _(exception: you must include the put-code when updating items using the PUT method to update an item previously added)_
35
+ - **source** - the system will inlcude your client application as the source
36
+ - **created-date** - date that you created this notification; automatically assigned by the system
37
+ - **sent-date** - date that the notification was sent to the end user from the inbox _(note that usually inbox messages are sent in batch to the user at an interval that the user specifies.)_
38
+ - **read-date** - date that the user read your notification in the ORCID Inbox, OR took action on the notification sent through the users email
39
+ - **actioned-date** - Date the user took action on the notification _(note that some notifications will not have explicit actions, in this case, reading the notification would update both the read & actioned date)_.
40
+ - **archived-date** - date that the user archived your notification
41
+
42
+
43
+ ##Notifications Permission Reference
44
+ ```permission``` notifications are available only in ORCID API v2.0_rcX, which uses a slightly different data structure from previous API versions.
45
+
46
+ In v2.0_rcX, items are read, added, and modified on an individual basis (rather than as a list), using a ```put-code```, which is a system-generated identifier used within the ORCID database.
47
+
48
+ The ```put-code``` for a specific item can be obtained by reading notifications.
49
+
50
+ Other notable differences between v2.0_rcX previous versions include:
51
+
52
+ - An explicit ```DELETE``` method is used to remove record items
53
+
54
+ ###Request a notification access token
55
+
56
+ Authorized client applications may obtain a notification access token from the ORCID server (using a 2-legged, or "client_credentials" OAuth flow) as described below. If your client is not yet authorized, please [contact support](http://orcid.org/help/contact-us) to request this feature to be turned on for your client.
57
+
58
+ _Please note that ORCID reserves the right to limit the client applications with authorization to send messages directly to ORCID iD holders using the ORCID Inbox._
59
+
60
+ **Resource URL**
61
+
62
+ | Environment | Resource URL |
63
+ | ----------- | ------------ |
64
+ |Developers Sandbox | https://api.sandbox.orcid.org/oauth/token |
65
+ | Production Registry | https://api.orcid.org/oauth/token |
66
+
67
+ **Paramaters**
68
+
69
+ | Field | Value|
70
+ | ---- | ---- |
71
+ | client_id<br/>*required* | The client id value &lt;client-id&gt; from ORCID client application registration |
72
+ | client_secret<br/>*required* | The client secret value &lt;client-secret&gt; from ORCID client application registration |
73
+ | scope<br/>*required* | The authorization scope for the requested access token. Value must be ```/premium-notification``` |
74
+ | grant_type<br/>*required* | Specifies the authorization mechanism for the granting the access token. Value for this call must be ```client_credentials``` |
75
+
76
+ **Header**
77
+
78
+ | Field | Value|
79
+ | ---- | ---- |
80
+ | Accept<br/>_required_ | The format for the call response. Must be ```Accept: application/json``` |
81
+
82
+ ###REST API for notifications
83
+ | Action | HTTP method | Scope | URL |
84
+ |-------------------------|-------------|--------------------------|----------------------------------------------------------|
85
+ | Add a notification | POST | /premium-notification | http://api.sandbox.orcid.org/v2.0_rc1/[ORCID]/notification-permission |
86
+ | Read a notification | GET | /premium-notification | http://api.sandbox.orcid.org/v2.0_rc1/[ORCID]/notification-permission/[PUT-CODE] |
87
+ | Flag an unread notification as archived | DELETE | /premium-notification | http://api.sandbox.orcid.org/v2.0_rc1/[ORCID]/notification-permission/[PUT-CODE] |
88
+
89
+ - **[ORCID]** is the ORCID iD for the record, formatted as XXXX-XXXX-XXXX-XXXX
90
+ - **[PUT-CODE]** is the ```put-code``` attribute for the specific ```notification``` that you wish to read or modify.
91
+
92
+ ###Example cURL Statements
93
+ ####Request a notification access token
94
+ ```
95
+ curl -i -L -H 'Accept: application/json' \
96
+ -d 'client_id=APP-...' \
97
+ -d 'client_secret=...' \
98
+ -d 'scope=/premium-notification' \
99
+ -d 'grant_type=client_credentials' \
100
+ 'http://api.sandbox.orcid.org/oauth/token'
101
+ ```
102
+
103
+ ####Add a notification
104
+ ```
105
+ curl -i -H 'Authorization: Bearer ...' \
106
+ -H 'Content-Type: application/orcid+xml' \
107
+ -X POST -d '@[FILE-PATH]/notification-permission.xml' \
108
+ https://api.sandbox.orcid.org/v2.0_rc1/[ORCID]/notification-permission
109
+ ```
110
+
111
+ ####Read a notification
112
+ ```
113
+ curl -i -H 'Authorization: Bearer ...' \
114
+ -H 'Content-Type: application/orcid+xml' \
115
+ https://api.sandbox.orcid.org/v2.0_rc1/[ORCID]/notification-permission/[PUT-CODE]
116
+ ```
117
+
118
+ ####Flag an unread notification as archived
119
+ ```
120
+ curl -i -H 'Authorization: Bearer ...' \
121
+ -H 'Content-Type: application/orcid+xml' \
122
+ -X DELETE https://api.sandbox.orcid.org/v2.0_rc1/[ORCID]/notification-permission/[PUT-CODE]
123
+ ```
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
3
+ targetNamespace="http://www.orcid.org/ns/notification" xmlns:notification="http://www.orcid.org/ns/notification"
4
+ xmlns:common="http://www.orcid.org/ns/common"
5
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
6
+ xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.1">
7
+ <xs:import namespace="http://www.orcid.org/ns/common" schemaLocation="../common_2.0/common-2.0.xsd" />
8
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="../xml.xsd"/>
9
+ <xs:element name="notification">
10
+ <xs:complexType>
11
+ <xs:sequence>
12
+ <xs:element name="notification-type">
13
+ <xs:simpleType>
14
+ <xs:restriction base="xs:string">
15
+ <xs:enumeration value="custom"/>
16
+ </xs:restriction>
17
+ </xs:simpleType>
18
+ </xs:element>
19
+ <xs:element name="subject">
20
+ <xs:simpleType>
21
+ <xs:restriction base="xs:string">
22
+ <xs:maxLength value="200" />
23
+ </xs:restriction>
24
+ </xs:simpleType>
25
+ </xs:element>
26
+ <xs:element type="xs:string" name="body-text"/>
27
+ <xs:element type="xs:string" name="body-html"/>
28
+ <xs:element ref="common:created-date" minOccurs="0"/>
29
+ <xs:element ref="common:sent-date"/>
30
+ <xs:element ref="common:read-date" minOccurs="0"/>
31
+ <xs:element ref="common:archived-date" minOccurs="0"/>
32
+ <xs:element ref="common:source" minOccurs="0"/>
33
+ </xs:sequence>
34
+ <xs:attribute name="put-code" type="common:put-code" use="optional" />
35
+ <xs:attribute ref="xml:lang" use="optional" />
36
+ </xs:complexType>
37
+ </xs:element>
38
+ </xs:schema>
@@ -0,0 +1,134 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema attributeFormDefault="unqualified"
3
+ elementFormDefault="qualified" targetNamespace="http://www.orcid.org/ns/notification"
4
+ xmlns:notification="http://www.orcid.org/ns/notification" xmlns:common="http://www.orcid.org/ns/common"
5
+ xmlns:activities="http://www.orcid.org/ns/activities" xmlns:xs="http://www.w3.org/2001/XMLSchema"
6
+ xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.1">
7
+ <xs:import namespace="http://www.orcid.org/ns/common"
8
+ schemaLocation="../common_2.0/common-2.0.xsd" />
9
+ <xs:import namespace="http://www.orcid.org/ns/activities"
10
+ schemaLocation="../record_2.0/activities-2.0.xsd" />
11
+
12
+ <xs:element name="notifications">
13
+ <xs:annotation>
14
+ <xs:documentation>Notification container</xs:documentation>
15
+ </xs:annotation>
16
+ <xs:complexType>
17
+ <xs:sequence>
18
+ <xs:element name="notification" type="notification:notification"
19
+ minOccurs="0" maxOccurs="unbounded" />
20
+ </xs:sequence>
21
+ </xs:complexType>
22
+ </xs:element>
23
+
24
+ <xs:element name="notification">
25
+ <xs:annotation>
26
+ <xs:documentation>Notification element
27
+ </xs:documentation>
28
+ </xs:annotation>
29
+ <xs:complexType>
30
+ <xs:complexContent>
31
+ <xs:extension base="notification:notification"></xs:extension>
32
+ </xs:complexContent>
33
+ </xs:complexType>
34
+ </xs:element>
35
+
36
+ <xs:complexType name="notification">
37
+ <xs:sequence>
38
+ <xs:element name="notification-type" type="notification:notification-type" />
39
+ <xs:element name="authorization-url" type="notification:authorization-url" />
40
+ <xs:element ref="notification:notification-subject" />
41
+ <xs:element ref="notification:notification-intro" />
42
+ <xs:element name="items" type="notification:items" />
43
+ <xs:element ref="common:created-date" minOccurs="0" />
44
+ <xs:element ref="common:sent-date" minOccurs="0" />
45
+ <xs:element ref="common:read-date" minOccurs="0" />
46
+ <xs:element name="actioned-date" type="notification:actioned-date"
47
+ minOccurs="0" />
48
+ <xs:element ref="common:archived-date" minOccurs="0" />
49
+ <xs:element ref="common:source" minOccurs="0" />
50
+ </xs:sequence>
51
+ <xs:attribute name="put-code" type="common:put-code"
52
+ use="optional" />
53
+ </xs:complexType>
54
+
55
+ <xs:simpleType name="notification-type">
56
+ <xs:restriction base="xs:string">
57
+ <xs:enumeration value="permission" />
58
+ </xs:restriction>
59
+ </xs:simpleType>
60
+
61
+ <xs:complexType name="authorization-url">
62
+ <xs:sequence>
63
+ <xs:choice>
64
+ <xs:sequence>
65
+ <xs:element name="uri" type="xs:anyURI" />
66
+ <xs:element name="path" type="xs:string" minOccurs="0" />
67
+ </xs:sequence>
68
+ <xs:element name="path" type="xs:string" />
69
+ </xs:choice>
70
+ <xs:element name="host" type="xs:string" minOccurs="0" />
71
+ </xs:sequence>
72
+ </xs:complexType>
73
+
74
+ <xs:element name="notification-subject">
75
+ <xs:annotation>
76
+ <xs:documentation>The subject line for the message (displayed to the
77
+ end user)
78
+ </xs:documentation>
79
+ </xs:annotation>
80
+ <xs:simpleType>
81
+ <xs:restriction base="xs:string" />
82
+ </xs:simpleType>
83
+ </xs:element>
84
+ <xs:element name="notification-intro">
85
+ <xs:annotation>
86
+ <xs:documentation>A text-only introductory message to be displayed to
87
+ the end user, and displayed before the example list of items.
88
+ </xs:documentation>
89
+ </xs:annotation>
90
+ <xs:simpleType>
91
+ <xs:restriction base="xs:string">
92
+ <xs:maxLength value="1000" />
93
+ </xs:restriction>
94
+ </xs:simpleType>
95
+ </xs:element>
96
+ <xs:complexType name="items">
97
+ <xs:sequence>
98
+ <xs:element name="item" type="notification:item"
99
+ maxOccurs="unbounded" />
100
+ </xs:sequence>
101
+ </xs:complexType>
102
+ <xs:complexType name="item">
103
+ <xs:sequence>
104
+ <xs:element name="item-type" type="notification:activity-type" />
105
+ <xs:element name="item-name">
106
+ <xs:simpleType>
107
+ <xs:restriction base="xs:string">
108
+ <xs:maxLength value="1000" />
109
+ </xs:restriction>
110
+ </xs:simpleType>
111
+ </xs:element>
112
+ <xs:element ref="common:external-id" minOccurs="0" />
113
+ </xs:sequence>
114
+ </xs:complexType>
115
+ <xs:simpleType name="activity-type">
116
+ <xs:restriction base="xs:string">
117
+ <xs:enumeration value="education"></xs:enumeration>
118
+ <xs:enumeration value="employment"></xs:enumeration>
119
+ <xs:enumeration value="funding"></xs:enumeration>
120
+ <xs:enumeration value="work"></xs:enumeration>
121
+ <xs:enumeration value="peer-review"></xs:enumeration>
122
+ </xs:restriction>
123
+ </xs:simpleType>
124
+ <xs:complexType name="actioned-date">
125
+ <xs:annotation>
126
+ <xs:documentation>The date time when the user took action on the
127
+ notification.
128
+ </xs:documentation>
129
+ </xs:annotation>
130
+ <xs:simpleContent>
131
+ <xs:extension base="xs:dateTime" />
132
+ </xs:simpleContent>
133
+ </xs:complexType>
134
+ </xs:schema>
@@ -19,7 +19,7 @@
19
19
  -->
20
20
  <notification:notification put-code="1"
21
21
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
- xsi:schemaLocation="http://www.orcid.org/ns/notification ../notification-custom-2.0_rc3.xsd"
22
+ xsi:schemaLocation="http://www.orcid.org/ns/notification ../notification-custom-2.0.xsd"
23
23
  xmlns:notification="http://www.orcid.org/ns/notification"
24
24
  xmlns:common="http://www.orcid.org/ns/common"
25
25
  xml:lang="en-gb">
@@ -32,7 +32,7 @@
32
32
  This is an email with <em>important</em> info.
33
33
  </p>]]>
34
34
  </notification:body-html>
35
- <common:created-date>2014-01-01T09:17:56</common:created-date>
35
+ <common:created-date>2014-01-01T09:17:56</common:created-date>
36
36
  <common:sent-date>2014-01-01T14:45:32</common:sent-date>
37
37
  <common:source>
38
38
  <common:source-orcid>
@@ -42,4 +42,4 @@
42
42
  </common:source-orcid>
43
43
  <common:source-name>Member 1</common:source-name>
44
44
  </common:source>
45
- </notification:notification>
45
+ </notification:notification>
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
2
  <!--
3
3
 
4
4
  =============================================================================
@@ -17,7 +17,7 @@
17
17
  =============================================================================
18
18
 
19
19
  -->
20
- <notification:notification put-code="1" xsi:schemaLocation="http://www.orcid.org/ns/notification ../notification-permission-2.0_rc3.xsd" xmlns:common="http://www.orcid.org/ns/common" xmlns:notification="http://www.orcid.org/ns/notification" xmlns:activities="http://www.orcid.org/ns/activities" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
20
+ <notification:notification put-code="1" xsi:schemaLocation="http://www.orcid.org/ns/notification ../notification-permission-2.0.xsd" xmlns:common="http://www.orcid.org/ns/common" xmlns:notification="http://www.orcid.org/ns/notification" xmlns:activities="http://www.orcid.org/ns/activities" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
21
21
  <notification:notification-type>permission</notification:notification-type>
22
22
  <notification:authorization-url>
23
23
  <!-- API user can specify just the path if they want, and leave out the uri element. -->