-
Notifications
You must be signed in to change notification settings - Fork 2
/
ir_citation.module
1313 lines (1194 loc) · 158 KB
/
ir_citation.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* @file
* This is the main module file for the ir_citation module
* @author
* William Panting
*/
/**
* The menu entries for this module.
* @return $menu_entries
* An arrray of the items to be added to the drupal menu
*/
function ir_citation_menu() {
$menu_entries= array();
//demo page
$menu_entries['citation demo']=array(
'title' => 'citation demo',
'description' => 'citation demo',
'page callback' => 'ir_citation_cite',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM
);
return $menu_entries;
}
/**
* This function will be the test be for citation generation.
* It will generate the web page with citations.
*/
function ir_citation_cite() {
//init
module_load_include('inc', 'ir_citation', 'ir_citation');
$output = test_api();
ir_citation_run_demo_includes();
//removed due to conflict with oo api
//load_citeproc_javascript();
//redo of citeproc's demo with mods->json conversion
$output=$output . ir_citation_get_demo_html();
return $output;
}
/**
* This function is being used to test the api
*/
function test_api() {
module_load_include('inc', 'ir_citation', 'ir_citation.api');
$test= new IslandoraCitationAPI();
$output='';
//adding metadata from pid
$alias='fedoraPidNewAPITest';
$pid='Awill:258';
//$test->addMetaData($alias, $pid, 'pid');
//adding metadata from mods
$alias='modsNewAPITest';
$mods=file_get_contents(drupal_get_path('module', 'ir_citation') . '/demo/testMods.xml');
$test->addMetaData($alias, $mods, 'mods');
//strait in
$type='abbreviation';
$alias='abbreviationNewAPITest';
$abbreviation_alias=$alias;
$content='{"U.S. Bureau of the Census":"U.S. Bureau of the Census"}';
$var_type="institution";
$test->addData($type, $alias, $content, $var_type);
$tmp=$test->getContent($alias);
//dsm($tmp);
$type='csl';
$alias='cslNewAPITest';
$csl_alias=$alias;
$content="<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" default-locale=\"en-US-x-sort-ja-alalc97\"> <info> <title>Chicago Manual of Style (Author-Date format)</title> <id>http://www.zotero.org/styles/chicago-author-date</id> <link rel=\"self\" href=\"http://www.zotero.org/styles/chicago-author-date\" /> <author> <name>Julian Onions</name> <email>julian.onions@gmail.com</email> </author> <category citation-format=\"author-date\" /> <category field=\"generic-base\" /> <updated>2009-08-10T04:49:00+09:00</updated> <summary>The author-date variant of the Chicago style</summary> <link href=\"http://www.chicagomanualofstyle.org/tools_citationguide.html\" rel=\"documentation\" /> </info> <locale> <terms> <term name=\"and others\"></term> <term name=\"contributor\"></term> </terms> </locale> <macro name=\"secondary-contributors\"> <choose> <if match=\"none\" type=\"chapter\"> <group delimiter=\". \"> <choose> <if variable=\"author\"> <names variable=\"editor\"> <label form=\"verb-short\" prefix=\" \" suffix=\". \" text-case=\"capitalize-first\" /> <name and=\"text\" delimiter=\", \" /> </names> </if> </choose> <choose> <if match=\"any\" variable=\"author editor\"> <names variable=\"translator\"> <label form=\"verb-short\" prefix=\" \" suffix=\". \" text-case=\"capitalize-first\" /> <name and=\"text\" delimiter=\", \" /> </names> </if> </choose> </group> </if> </choose> </macro> <macro name=\"container-contributors\"> <choose> <if type=\"chapter\"> <group delimiter=\", \" prefix=\",\"> <choose> <if variable=\"author\"> <names variable=\"editor\"> <label form=\"verb-short\" prefix=\" \" suffix=\". \" text-case=\"lowercase\" /> <name and=\"text\" delimiter=\", \" /> </names> </if> </choose> <choose> <if match=\"any\" variable=\"author editor\"> <names variable=\"translator\"> <label form=\"verb-short\" prefix=\" \" suffix=\". \" text-case=\"lowercase\" /> <name and=\"text\" delimiter=\", \" /> </names> </if> </choose> </group> </if> </choose> </macro> <macro name=\"anon\"> <choose> <if match=\"none\" variable=\"author editor translator\"> <text form=\"short\" term=\"anonymous\" text-case=\"capitalize-first\" /> </if> </choose> </macro> <macro name=\"editor\"> <names variable=\"editor\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" name-as-sort-order=\"first\" sort-separator=\", \" /> <label form=\"short\" prefix=\", \" suffix=\".\" /> </names> </macro> <macro name=\"translator\"> <names variable=\"translator\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" name-as-sort-order=\"first\" sort-separator=\", \" /> <label form=\"verb-short\" prefix=\", \" suffix=\".\" /> </names> </macro> <macro name=\"recipient\"> <choose> <if type=\"personal_communication\"> <choose> <if variable=\"genre\"> <text text-case=\"capitalize-first\" variable=\"genre\" /> </if> <else> <text term=\"letter\" text-case=\"capitalize-first\" /> </else> </choose> </if> </choose> <names delimiter=\", \" variable=\"recipient\"> <label form=\"verb\" prefix=\" \" suffix=\" \" text-case=\"lowercase\" /> <name and=\"text\" delimiter=\", \" /> </names> </macro> <macro name=\"contributors\"> <names variable=\"author\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" /> <label form=\"verb-short\" prefix=\", \" suffix=\".\" text-case=\"lowercase\" /> <substitute> <text macro=\"editor\" /> <text macro=\"translator\" /> </substitute> </names> <text macro=\"anon\" /> <text macro=\"recipient\" /> </macro> <macro name=\"headline-contributor\"> <names variable=\"contributor\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" name-as-sort-order=\"first\" sort-separator=\", \" et-al-use-first=\"1\" et-al-min=\"2\"/> <et-al term=\"and others\"/> <label form=\"verb-short\" prefix=\", \" suffix=\".\" text-case=\"lowercase\" /> </names> </macro> <macro name=\"headline-author\"> <names variable=\"author\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" name-as-sort-order=\"first\" sort-separator=\", \" et-al-use-first=\"1\" et-al-min=\"2\"/> <et-al term=\"and others\"/> <label form=\"verb-short\" prefix=\", \" suffix=\".\" text-case=\"lowercase\" /> <substitute> <text macro=\"editor\" /> <text macro=\"translator\" /> </substitute> </names> <text macro=\"anon\" /> <text macro=\"recipient\" /> </macro> <macro name=\"contributors-short\"> <names variable=\"author\"> <name and=\"text\" delimiter=\", \" form=\"short\" /> <substitute> <names variable=\"editor\" /> <names variable=\"translator\" /> </substitute> </names> <text macro=\"anon\" /> </macro> <macro name=\"interviewer\"> <names delimiter=\", \" variable=\"interviewer\"> <label form=\"verb\" prefix=\" \" suffix=\" \" text-case=\"capitalize-first\" /> <name and=\"text\" delimiter=\", \" /> </names> </macro> <macro name=\"archive\"> <group delimiter=\". \"> <text text-case=\"capitalize-first\" variable=\"archive_location\" /> <text variable=\"archive\" /> <text variable=\"archive-place\" /> </group> </macro> <macro name=\"access\"> <group delimiter=\". \"> <choose> <if match=\"any\" type=\"graphic report\"> <text macro=\"archive\" /> </if> <else-if match=\"none\" type=\"book thesis chapter article-journal article-newspaper article-magazine\"> <text macro=\"archive\" /> </else-if> </choose> <text prefix=\"doi:\" variable=\"DOI\" /> <text variable=\"URL\" /> </group> </macro> <macro name=\"title\"> <choose> <if match=\"none\" variable=\"title\"> <choose> <if match=\"none\" type=\"personal_communication\"> <text text-case=\"capitalize-first\" variable=\"genre\" /> </if> </choose> </if> <else-if type=\"book\"> <text font-style=\"italic\" variable=\"title\" /> </else-if> <else> <text variable=\"title\" /> </else> </choose> </macro> <macro name=\"edition\"> <choose> <if match=\"any\" type=\"book chapter\"> <choose> <if is-numeric=\"edition\"> <group delimiter=\" \"> <number form=\"ordinal\" variable=\"edition\" /> <text form=\"short\" suffix=\".\" term=\"edition\" /> </group> </if> <else> <text suffix=\".\" variable=\"edition\" /> </else> </choose> </if> </choose> </macro> <macro name=\"locators\"> <choose> <if type=\"article-journal\"> <text prefix=\" \" variable=\"volume\" /> <text prefix=\", no. \" variable=\"issue\" /> </if> <else-if type=\"book\"> <group delimiter=\". \" prefix=\". \"> <group> <text form=\"short\" suffix=\". \" term=\"volume\" text-case=\"capitalize-first\" /> <number form=\"numeric\" variable=\"volume\" /> </group> <group> <number form=\"numeric\" variable=\"number-of-volumes\" /> <text form=\"short\" plural=\"true\" prefix=\" \" suffix=\".\" term=\"volume\" /> </group> </group> </else-if> </choose> </macro> <macro name=\"locators-chapter\"> <choose> <if type=\"chapter\"> <group prefix=\", \"> <text suffix=\":\" variable=\"volume\" /> <text variable=\"page\" /> </group> </if> </choose> </macro> <macro name=\"locators-article\"> <choose> <if type=\"article-newspaper\"> <group delimiter=\", \" prefix=\", \"> <group> <text suffix=\" \" variable=\"edition\" /> <text prefix=\" \" term=\"edition\" /> </group> <group> <text form=\"short\" suffix=\". \" term=\"section\" /> <text variable=\"section\" /> </group> </group> </if> <else-if type=\"article-journal\"> <text prefix=\": \" variable=\"page\" /> </else-if> </choose> </macro> <macro name=\"point-locators\"> <group> <choose> <if locator=\"page\" match=\"none\"> <label form=\"short\" strip-periods=\"false\" suffix=\" \" variable=\"locator\" /> </if> </choose> <text variable=\"locator\" /> </group> </macro> <macro name=\"container-prefix\"> <text term=\"in\" text-case=\"capitalize-first\" /> </macro> <macro name=\"container-title\"> <choose> <if type=\"chapter\"> <text macro=\"container-prefix\" suffix=\" \" /> </if> </choose> <text font-style=\"italic\" variable=\"container-title\" /> </macro> <macro name=\"publisher\"> <group delimiter=\": \"> <text variable=\"publisher-place\" /> <text variable=\"publisher\" /> </group> </macro> <macro name=\"date\"> <date variable=\"issued\"> <date-part name=\"year\" /> </date> </macro> <macro name=\"day-month\"> <date variable=\"issued\"> <date-part name=\"month\" /> <date-part name=\"day\" prefix=\" \" /> </date> </macro> <macro name=\"collection-title\"> <text variable=\"collection-title\" /> <text prefix=\" \" variable=\"collection-number\" /> </macro> <macro name=\"event\"> <group> <text suffix=\" \" term=\"presented at\" /> <text variable=\"event\" /> </group> </macro> <macro name=\"description\"> <group delimiter=\". \"> <text macro=\"interviewer\" /> <text text-case=\"capitalize-first\" variable=\"medium\" /> </group> <choose> <if match=\"none\" variable=\"title\"> </if> <else-if type=\"thesis\"> </else-if> <else> <text prefix=\". \" text-case=\"capitalize-first\" variable=\"genre\" /> </else> </choose> </macro> <macro name=\"issue\"> <choose> <if type=\"article-journal\"> <text macro=\"day-month\" prefix=\" (\" suffix=\")\" /> </if> <else-if type=\"speech\"> <group delimiter=\", \" prefix=\" \"> <text macro=\"event\" /> <text macro=\"day-month\" /> <text variable=\"event-place\" /> </group> </else-if> <else-if match=\"any\" type=\"article-newspaper article-magazine\"> <text macro=\"day-month\" prefix=\", \" /> </else-if> <else> <group delimiter=\", \" prefix=\". \"> <choose> <if type=\"thesis\"> <text text-case=\"capitalize-first\" variable=\"genre\" /> </if> </choose> <text macro=\"publisher\" /> <text macro=\"day-month\" /> </group> </else> </choose> </macro> <macro name=\"headline\"> <choose> <if variable=\"contributor\"> <text macro=\"headline-contributor\"/> </if> <else> <text macro=\"headline-author\"/> </else> </choose> </macro> <citation disambiguate-add-givenname=\"true\" disambiguate-add-names=\"true\" disambiguate-add-year-suffix=\"true\" et-al-min=\"4\" et-al-subsequent-min=\"4\" et-al-subsequent-use-first=\"1\" et-al-use-first=\"1\"> <layout delimiter=\"; \" prefix=\"(\" suffix=\")\"> <group delimiter=\", \"> <group delimiter=\" \"> <text macro=\"contributors-short\" /> <text macro=\"date\" /> </group> <text macro=\"point-locators\" /> </group> </layout> </citation> <bibliography entry-spacing=\"0\" et-al-min=\"11\" et-al-use-first=\"7\" hanging-indent=\"true\" subsequent-author-substitute=\"\"> <sort> <key macro=\"headline\" names-min=\"1\" names-use-first=\"1\" sort=\"ascending\"/> <key variable=\"issued\" sort=\"descending\"/> </sort> <layout> <text macro=\"headline\" display=\"block\"/> <group display=\"left-margin\"> <text macro=\"date\" /> </group> <group display=\"right-inline\"> <group suffix=\".\"> <text macro=\"title\" /> <text macro=\"description\" /> <text macro=\"secondary-contributors\" prefix=\". \" /> <text macro=\"container-title\" prefix=\". \" /> <text macro=\"container-contributors\" /> <text macro=\"locators-chapter\" /> <text macro=\"edition\" prefix=\". \" /> <text macro=\"locators\" /> <text macro=\"collection-title\" prefix=\". \" /> <text macro=\"issue\" /> <text macro=\"locators-article\" /> <text macro=\"access\" prefix=\". \" /> </group> <group prefix=\" (\" suffix=\")\" delimiter=\" \"> <choose> <if variable=\"contributor\"> <text prefix=\"co-author among: \" macro=\"contributors\"/> </if> <else> <text prefix=\"co-authorship: \" macro=\"contributors\"/> </else> </choose> </group> </group> </layout> </bibliography></style>";
$test->addData($type, $alias, $content);
$test->getContent($alias);
$type='metadata';
$alias='metadataNewAPITest';
//need to get api prefix
$prefix= $test->getJavaScriptPrefix();
$content='{
"id": "' .
$prefix . $alias . '",
"title": "\u6c11\u6cd5",
"multi":{
"_keys":{
"title": {
"ja-alalc97": "Minp\u014d",
"en": "Japanese Civil Code"
}
}
},
"type": "legislation"
}';
$test->addData($type, $alias, $content);
$test->getContent($alias);
$meta_data_alias=$alias;//keep this after metadata
$type='bibliography_list';
$content=array($meta_data_alias);//keep this after metadata
$alias='bibliography_listNewAPITest';
$bibliography_list_alias=$alias;
$test->addData($type, $alias, $content);
$test->getContent($alias);
$type='citation';
$content='{
"citationItems": [
{
"id":"' . $prefix . $meta_data_alias . '"
}
]}';
$alias='citationNewAPITest';
$test->addData($type, $alias, $content);
$test->getContent($alias);
$type='bibliography_selector';
$alias='bibliography_selectorNewAPITest';
$bibliography_selector_alias=$alias;
$content='{"select" : [{"field" : "type","value" : "book"}]}';
$test->addData($type, $alias, $content);
$test->getContent($alias);
//adding constructed basic citation
$citation_object_alias='basicCitationNewAPITest';
$test->loadBasicCitationObject($meta_data_alias, $citation_object_alias);
//test the SUPER AUTOMATIC FUNCTION
$csl="<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" default-locale=\"en-US-x-sort-ja-alalc97\"> <info> <title>Chicago Manual of Style (Author-Date format)</title> <id>http://www.zotero.org/styles/chicago-author-date</id> <link rel=\"self\" href=\"http://www.zotero.org/styles/chicago-author-date\" /> <author> <name>Julian Onions</name> <email>julian.onions@gmail.com</email> </author> <category citation-format=\"author-date\" /> <category field=\"generic-base\" /> <updated>2009-08-10T04:49:00+09:00</updated> <summary>The author-date variant of the Chicago style</summary> <link href=\"http://www.chicagomanualofstyle.org/tools_citationguide.html\" rel=\"documentation\" /> </info> <locale> <terms> <term name=\"and others\"></term> <term name=\"contributor\"></term> </terms> </locale> <macro name=\"secondary-contributors\"> <choose> <if match=\"none\" type=\"chapter\"> <group delimiter=\". \"> <choose> <if variable=\"author\"> <names variable=\"editor\"> <label form=\"verb-short\" prefix=\" \" suffix=\". \" text-case=\"capitalize-first\" /> <name and=\"text\" delimiter=\", \" /> </names> </if> </choose> <choose> <if match=\"any\" variable=\"author editor\"> <names variable=\"translator\"> <label form=\"verb-short\" prefix=\" \" suffix=\". \" text-case=\"capitalize-first\" /> <name and=\"text\" delimiter=\", \" /> </names> </if> </choose> </group> </if> </choose> </macro> <macro name=\"container-contributors\"> <choose> <if type=\"chapter\"> <group delimiter=\", \" prefix=\",\"> <choose> <if variable=\"author\"> <names variable=\"editor\"> <label form=\"verb-short\" prefix=\" \" suffix=\". \" text-case=\"lowercase\" /> <name and=\"text\" delimiter=\", \" /> </names> </if> </choose> <choose> <if match=\"any\" variable=\"author editor\"> <names variable=\"translator\"> <label form=\"verb-short\" prefix=\" \" suffix=\". \" text-case=\"lowercase\" /> <name and=\"text\" delimiter=\", \" /> </names> </if> </choose> </group> </if> </choose> </macro> <macro name=\"anon\"> <choose> <if match=\"none\" variable=\"author editor translator\"> <text form=\"short\" term=\"anonymous\" text-case=\"capitalize-first\" /> </if> </choose> </macro> <macro name=\"editor\"> <names variable=\"editor\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" name-as-sort-order=\"first\" sort-separator=\", \" /> <label form=\"short\" prefix=\", \" suffix=\".\" /> </names> </macro> <macro name=\"translator\"> <names variable=\"translator\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" name-as-sort-order=\"first\" sort-separator=\", \" /> <label form=\"verb-short\" prefix=\", \" suffix=\".\" /> </names> </macro> <macro name=\"recipient\"> <choose> <if type=\"personal_communication\"> <choose> <if variable=\"genre\"> <text text-case=\"capitalize-first\" variable=\"genre\" /> </if> <else> <text term=\"letter\" text-case=\"capitalize-first\" /> </else> </choose> </if> </choose> <names delimiter=\", \" variable=\"recipient\"> <label form=\"verb\" prefix=\" \" suffix=\" \" text-case=\"lowercase\" /> <name and=\"text\" delimiter=\", \" /> </names> </macro> <macro name=\"contributors\"> <names variable=\"author\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" /> <label form=\"verb-short\" prefix=\", \" suffix=\".\" text-case=\"lowercase\" /> <substitute> <text macro=\"editor\" /> <text macro=\"translator\" /> </substitute> </names> <text macro=\"anon\" /> <text macro=\"recipient\" /> </macro> <macro name=\"headline-contributor\"> <names variable=\"contributor\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" name-as-sort-order=\"first\" sort-separator=\", \" et-al-use-first=\"1\" et-al-min=\"2\"/> <et-al term=\"and others\"/> <label form=\"verb-short\" prefix=\", \" suffix=\".\" text-case=\"lowercase\" /> </names> </macro> <macro name=\"headline-author\"> <names variable=\"author\"> <name and=\"text\" delimiter=\", \" delimiter-precedes-last=\"always\" name-as-sort-order=\"first\" sort-separator=\", \" et-al-use-first=\"1\" et-al-min=\"2\"/> <et-al term=\"and others\"/> <label form=\"verb-short\" prefix=\", \" suffix=\".\" text-case=\"lowercase\" /> <substitute> <text macro=\"editor\" /> <text macro=\"translator\" /> </substitute> </names> <text macro=\"anon\" /> <text macro=\"recipient\" /> </macro> <macro name=\"contributors-short\"> <names variable=\"author\"> <name and=\"text\" delimiter=\", \" form=\"short\" /> <substitute> <names variable=\"editor\" /> <names variable=\"translator\" /> </substitute> </names> <text macro=\"anon\" /> </macro> <macro name=\"interviewer\"> <names delimiter=\", \" variable=\"interviewer\"> <label form=\"verb\" prefix=\" \" suffix=\" \" text-case=\"capitalize-first\" /> <name and=\"text\" delimiter=\", \" /> </names> </macro> <macro name=\"archive\"> <group delimiter=\". \"> <text text-case=\"capitalize-first\" variable=\"archive_location\" /> <text variable=\"archive\" /> <text variable=\"archive-place\" /> </group> </macro> <macro name=\"access\"> <group delimiter=\". \"> <choose> <if match=\"any\" type=\"graphic report\"> <text macro=\"archive\" /> </if> <else-if match=\"none\" type=\"book thesis chapter article-journal article-newspaper article-magazine\"> <text macro=\"archive\" /> </else-if> </choose> <text prefix=\"doi:\" variable=\"DOI\" /> <text variable=\"URL\" /> </group> </macro> <macro name=\"title\"> <choose> <if match=\"none\" variable=\"title\"> <choose> <if match=\"none\" type=\"personal_communication\"> <text text-case=\"capitalize-first\" variable=\"genre\" /> </if> </choose> </if> <else-if type=\"book\"> <text font-style=\"italic\" variable=\"title\" /> </else-if> <else> <text variable=\"title\" /> </else> </choose> </macro> <macro name=\"edition\"> <choose> <if match=\"any\" type=\"book chapter\"> <choose> <if is-numeric=\"edition\"> <group delimiter=\" \"> <number form=\"ordinal\" variable=\"edition\" /> <text form=\"short\" suffix=\".\" term=\"edition\" /> </group> </if> <else> <text suffix=\".\" variable=\"edition\" /> </else> </choose> </if> </choose> </macro> <macro name=\"locators\"> <choose> <if type=\"article-journal\"> <text prefix=\" \" variable=\"volume\" /> <text prefix=\", no. \" variable=\"issue\" /> </if> <else-if type=\"book\"> <group delimiter=\". \" prefix=\". \"> <group> <text form=\"short\" suffix=\". \" term=\"volume\" text-case=\"capitalize-first\" /> <number form=\"numeric\" variable=\"volume\" /> </group> <group> <number form=\"numeric\" variable=\"number-of-volumes\" /> <text form=\"short\" plural=\"true\" prefix=\" \" suffix=\".\" term=\"volume\" /> </group> </group> </else-if> </choose> </macro> <macro name=\"locators-chapter\"> <choose> <if type=\"chapter\"> <group prefix=\", \"> <text suffix=\":\" variable=\"volume\" /> <text variable=\"page\" /> </group> </if> </choose> </macro> <macro name=\"locators-article\"> <choose> <if type=\"article-newspaper\"> <group delimiter=\", \" prefix=\", \"> <group> <text suffix=\" \" variable=\"edition\" /> <text prefix=\" \" term=\"edition\" /> </group> <group> <text form=\"short\" suffix=\". \" term=\"section\" /> <text variable=\"section\" /> </group> </group> </if> <else-if type=\"article-journal\"> <text prefix=\": \" variable=\"page\" /> </else-if> </choose> </macro> <macro name=\"point-locators\"> <group> <choose> <if locator=\"page\" match=\"none\"> <label form=\"short\" strip-periods=\"false\" suffix=\" \" variable=\"locator\" /> </if> </choose> <text variable=\"locator\" /> </group> </macro> <macro name=\"container-prefix\"> <text term=\"in\" text-case=\"capitalize-first\" /> </macro> <macro name=\"container-title\"> <choose> <if type=\"chapter\"> <text macro=\"container-prefix\" suffix=\" \" /> </if> </choose> <text font-style=\"italic\" variable=\"container-title\" /> </macro> <macro name=\"publisher\"> <group delimiter=\": \"> <text variable=\"publisher-place\" /> <text variable=\"publisher\" /> </group> </macro> <macro name=\"date\"> <date variable=\"issued\"> <date-part name=\"year\" /> </date> </macro> <macro name=\"day-month\"> <date variable=\"issued\"> <date-part name=\"month\" /> <date-part name=\"day\" prefix=\" \" /> </date> </macro> <macro name=\"collection-title\"> <text variable=\"collection-title\" /> <text prefix=\" \" variable=\"collection-number\" /> </macro> <macro name=\"event\"> <group> <text suffix=\" \" term=\"presented at\" /> <text variable=\"event\" /> </group> </macro> <macro name=\"description\"> <group delimiter=\". \"> <text macro=\"interviewer\" /> <text text-case=\"capitalize-first\" variable=\"medium\" /> </group> <choose> <if match=\"none\" variable=\"title\"> </if> <else-if type=\"thesis\"> </else-if> <else> <text prefix=\". \" text-case=\"capitalize-first\" variable=\"genre\" /> </else> </choose> </macro> <macro name=\"issue\"> <choose> <if type=\"article-journal\"> <text macro=\"day-month\" prefix=\" (\" suffix=\")\" /> </if> <else-if type=\"speech\"> <group delimiter=\", \" prefix=\" \"> <text macro=\"event\" /> <text macro=\"day-month\" /> <text variable=\"event-place\" /> </group> </else-if> <else-if match=\"any\" type=\"article-newspaper article-magazine\"> <text macro=\"day-month\" prefix=\", \" /> </else-if> <else> <group delimiter=\", \" prefix=\". \"> <choose> <if type=\"thesis\"> <text text-case=\"capitalize-first\" variable=\"genre\" /> </if> </choose> <text macro=\"publisher\" /> <text macro=\"day-month\" /> </group> </else> </choose> </macro> <macro name=\"headline\"> <choose> <if variable=\"contributor\"> <text macro=\"headline-contributor\"/> </if> <else> <text macro=\"headline-author\"/> </else> </choose> </macro> <citation disambiguate-add-givenname=\"true\" disambiguate-add-names=\"true\" disambiguate-add-year-suffix=\"true\" et-al-min=\"4\" et-al-subsequent-min=\"4\" et-al-subsequent-use-first=\"1\" et-al-use-first=\"1\"> <layout delimiter=\"; \" prefix=\"(\" suffix=\")\"> <group delimiter=\", \"> <group delimiter=\" \"> <text macro=\"contributors-short\" /> <text macro=\"date\" /> </group> <text macro=\"point-locators\" /> </group> </layout> </citation> <bibliography entry-spacing=\"0\" et-al-min=\"11\" et-al-use-first=\"7\" hanging-indent=\"true\" subsequent-author-substitute=\"\"> <sort> <key macro=\"headline\" names-min=\"1\" names-use-first=\"1\" sort=\"ascending\"/> <key variable=\"issued\" sort=\"descending\"/> </sort> <layout> <text macro=\"headline\" display=\"block\"/> <group display=\"left-margin\"> <text macro=\"date\" /> </group> <group display=\"right-inline\"> <group suffix=\".\"> <text macro=\"title\" /> <text macro=\"description\" /> <text macro=\"secondary-contributors\" prefix=\". \" /> <text macro=\"container-title\" prefix=\". \" /> <text macro=\"container-contributors\" /> <text macro=\"locators-chapter\" /> <text macro=\"edition\" prefix=\". \" /> <text macro=\"locators\" /> <text macro=\"collection-title\" prefix=\". \" /> <text macro=\"issue\" /> <text macro=\"locators-article\" /> <text macro=\"access\" prefix=\". \" /> </group> <group prefix=\" (\" suffix=\")\" delimiter=\" \"> <choose> <if variable=\"contributor\"> <text prefix=\"co-author among: \" macro=\"contributors\"/> </if> <else> <text prefix=\"co-authorship: \" macro=\"contributors\"/> </else> </choose> </group> </group> </layout> </bibliography></style>";
/*
//citation
$auto_span=$test->getCitationHTMLFromPIDAndCSL($csl, array('Awill:258'));
//dsm($auto_span);
$output .= $auto_span;
//bibliography
$auto_span=$test->getCitationHTMLFromPIDAndCSL($csl, array('Awill:258', 'Awill:259'));
//dsm($auto_span);
$output .= $auto_span;
*/
//get a bibliography
$bib_span=$test->getCitationHTML($csl_alias, array('bibliography_list' => $bibliography_list_alias, 'citation' => NULL),
array('bibliography_slector' => NULL,
'abbreviations' => $abbreviation_alias
));
$output .=$bib_span;
//get a citation
$cite_span=$test->getCitationHTML($csl_alias, array('bibliography_list' => NULL, 'citation' => $citation_object_alias), array(
'bibliography_slector' => NULL,
'abbreviations' => $abbreviation_alias
));
$output .=$cite_span;
$test->addENUS();
/*
//data duplication test
//citation
$auto_span=$test->getCitationHTMLFromPIDAndCSL($csl, array('Awill:258'));
//dsm($auto_span);
$output .= $auto_span;
//bibliography
$auto_span=$test->getCitationHTMLFromPIDAndCSL($csl, array('Awill:258', 'Awill:259'));
//dsm($auto_span);
$output .= $auto_span;
$test->addENUS();
$type='bibliography_selector';
$alias='bibliography_selectorNewAPITestDataDuplicated';
$bibliography_selector_alias=$alias;
$content='{"select" : [{"field" : "type","value" : "book"}]}';
$test->addData($type, $alias, $content);
$test->getContent($alias);
//strait in abbreviation
$type='abbreviation';
$alias='abbreviationNewAPITestDataDuplication';
$abbreviation_alias=$alias;
$content='{"U.S. Bureau of the Census":"U.S. Bureau of the Census"}';
$var_type="institution";
$test->addData($type, $alias, $content, $var_type);
$tmp=$test->getContent($alias);
//dsm($tmp);
//get a citation
$cite_span=$test->getCitationHTML($csl_alias, array('bibliography_list' => NULL, 'citation' => $citation_object_alias), array(
'bibliography_slector' => NULL,
'abbreviations' => $abbreviation_alias
));
$output .=$cite_span;
*/
//stuff in here to test localization getters
$lang="en-US";
$locale="<locale xml:lang=\"en\" xmlns=\"http://purl.org/net/xbiblio/csl\"> <style-options punctuation-in-quote=\"true\"/> <date form=\"text\"> <date-part name=\"month\" suffix=\" \"/> <date-part name=\"day\" suffix=\", \"/> <date-part name=\"year\"/> </date> <date form=\"numeric\"> <date-part name=\"year\"/> <date-part name=\"month\" form=\"numeric\" prefix=\"-\" range-delimiter=\"/\"/> <date-part name=\"day\" prefix=\"-\" range-delimiter=\"/\"/> </date> <terms> <term name=\"document-number-label\">No.</term> <term name=\"document-number-authority-suffix\">Doc.</term> <term name=\"un-sales-number-label\">U.N. Sales No.</term> <term name=\"collection-number-label\">No.</term> <term name=\"open-quote\">\u201c</term> <term name=\"close-quote\">\u201d</term> <term name=\"open-inner-quote\">\u2018</term> <term name=\"close-inner-quote\">\u2019</term> <term name=\"ordinal-01\">st</term> <term name=\"ordinal-02\">nd</term> <term name=\"ordinal-03\">rd</term> <term name=\"ordinal-04\">th</term> <term name=\"long-ordinal-01\">first</term> <term name=\"long-ordinal-02\">second</term> <term name=\"long-ordinal-03\">third</term> <term name=\"long-ordinal-04\">fourth</term> <term name=\"long-ordinal-05\">fifth</term> <term name=\"long-ordinal-06\">sixth</term> <term name=\"long-ordinal-07\">seventh</term> <term name=\"long-ordinal-08\">eighth</term> <term name=\"long-ordinal-09\">ninth</term> <term name=\"long-ordinal-10\">tenth</term> <term name=\"at\">at</term> <term name=\"in\">in</term> <term name=\"ibid\">ibid</term> <term name=\"accessed\">accessed</term> <term name=\"retrieved\">retrieved</term> <term name=\"from\">from</term> <term name=\"forthcoming\">forthcoming</term> <term name=\"references\"> <single>reference</single> <multiple>references</multiple> </term> <term name=\"references\" form=\"short\"> <single>ref</single> <multiple>refs</multiple> </term> <term name=\"no date\">n.d.</term> <term name=\"and\">and</term> <term name=\"et-al\">et al.</term> <term name=\"interview\">interview</term> <term name=\"letter\">letter</term> <term name=\"anonymous\">anonymous</term> <term name=\"anonymous\" form=\"short\">anon.</term> <term name=\"and others\">and others</term> <term name=\"in press\">in press</term> <term name=\"online\">online</term> <term name=\"cited\">cited</term> <term name=\"internet\">internet</term> <term name=\"presented at\">presented at the</term> <term name=\"ad\">AD</term> <term name=\"bc\">BC</term> <term name=\"season-01\">Spring</term> <term name=\"season-02\">Summer</term> <term name=\"season-03\">Autumn</term> <term name=\"season-04\">Winter</term> <term name=\"with\">with</term> <!-- CATEGORIES --> <term name=\"anthropology\">anthropology</term> <term name=\"astronomy\">astronomy</term> <term name=\"biology\">biology</term> <term name=\"botany\">botany</term> <term name=\"chemistry\">chemistry</term> <term name=\"engineering\">engineering</term> <term name=\"generic-base\">generic base</term> <term name=\"geography\">geography</term> <term name=\"geology\">geology</term> <term name=\"history\">history</term> <term name=\"humanities\">humanities</term> <term name=\"literature\">literature</term> <term name=\"math\">math</term> <term name=\"medicine\">medicine</term> <term name=\"philosophy\">philosophy</term> <term name=\"physics\">physics</term> <term name=\"psychology\">psychology</term> <term name=\"sociology\">sociology</term> <term name=\"science\">science</term> <term name=\"political_science\">political science</term> <term name=\"social_science\">social science</term> <term name=\"theology\">theology</term> <term name=\"zoology\">zoology</term> <!-- LONG LOCATOR FORMS --> <term name=\"book\"> <single>book</single> <multiple>books</multiple> </term> <term name=\"chapter\"> <single>chapter</single> <multiple>chapters</multiple> </term> <term name=\"column\"> <single>column</single> <multiple>columns</multiple> </term> <term name=\"figure\"> <single>figure</single> <multiple>figures</multiple> </term> <term name=\"folio\"> <single>folio</single> <multiple>folios</multiple> </term> <term name=\"issue\"> <single>number</single> <multiple>numbers</multiple> </term> <term name=\"line\"> <single>line</single> <multiple>lines</multiple> </term> <term name=\"note\"> <single>note</single> <multiple>notes</multiple> </term> <term name=\"opus\"> <single>opus</single> <multiple>opera</multiple> </term> <term name=\"page\"> <single>page</single> <multiple>pages</multiple> </term> <term name=\"paragraph\"> <single>paragraph</single> <multiple>paragraph</multiple> </term> <term name=\"part\"> <single>part</single> <multiple>parts</multiple> </term> <term name=\"section\"> <single>section</single> <multiple>sections</multiple> </term> <term name=\"volume\"> <single>volume</single> <multiple>volumes</multiple> </term> <term name=\"edition\"> <single>edition</single> <multiple>editions</multiple> </term> <term name=\"verse\"> <single>verse</single> <multiple>verses</multiple> </term> <term name=\"sub verbo\"> <single>sub verbo</single> <multiple>s.vv</multiple> </term> <!-- SHORT LOCATOR FORMS --> <term name=\"book\" form=\"short\">bk.</term> <term name=\"chapter\" form=\"short\">chap.</term> <term name=\"column\" form=\"short\">col.</term> <term name=\"figure\" form=\"short\">fig.</term> <term name=\"folio\" form=\"short\">f.</term> <term name=\"issue\" form=\"short\">no.</term> <term name=\"opus\" form=\"short\">op.</term> <term name=\"page\" form=\"short\"> <single>p.</single> <multiple>pp.</multiple> </term> <term name=\"paragraph\" form=\"short\">para.</term> <term name=\"part\" form=\"short\">pt.</term> <term name=\"section\" form=\"short\">sec.</term> <term name=\"sub verbo\" form=\"short\"> <single>s.v.</single> <multiple>s.vv.</multiple> </term> <term name=\"verse\" form=\"short\"> <single>v.</single> <multiple>vv.</multiple> </term> <term name=\"volume\" form=\"short\"> <single>vol.</single> <multiple>vols.</multiple> </term> <term name=\"edition\">edition</term> <term name=\"edition\" form=\"short\">ed.</term> <!-- SYMBOL LOCATOR FORMS --> <term name=\"paragraph\" form=\"symbol\"> <single>¶</single> <multiple>¶¶</multiple> </term> <term name=\"section\" form=\"symbol\"> <single>§</single> <multiple>§§</multiple> </term> <!-- LONG ROLE FORMS --> <term name=\"author\"> <single></single> <multiple></multiple> </term> <term name=\"editor\"> <single>editor</single> <multiple>editors</multiple> </term> <term name=\"translator\"> <single>translator</single> <multiple>translators</multiple> </term> <!-- SHORT ROLE FORMS --> <term name=\"author\" form=\"short\"> <single></single> <multiple></multiple> </term> <term name=\"editor\" form=\"short\"> <single>ed.</single> <multiple>eds.</multiple> </term> <term name=\"translator\" form=\"short\"> <single>tran.</single> <multiple>trans.</multiple> </term> <!-- VERB ROLE FORMS --> <term name=\"editor\" form=\"verb\">edited by</term> <term name=\"translator\" form=\"verb\">translated by</term> <term name=\"recipient\" form=\"verb\">to</term> <term name=\"interviewer\" form=\"verb\">interview by</term> <!-- SHORT VERB ROLE FORMS --> <term name=\"editor\" form=\"verb-short\">ed.</term> <term name=\"translator\" form=\"verb-short\">trans.</term> <!-- LONG MONTH FORMS --> <term name=\"month-01\">January</term> <term name=\"month-02\">February</term> <term name=\"month-03\">March</term> <term name=\"month-04\">April</term> <term name=\"month-05\">May</term> <term name=\"month-06\">June</term> <term name=\"month-07\">July</term> <term name=\"month-08\">August</term> <term name=\"month-09\">September</term> <term name=\"month-10\">October</term> <term name=\"month-11\">November</term> <term name=\"month-12\">December</term> <!-- SHORT MONTH FORMS --> <term name=\"month-01\" form=\"short\">Jan.</term> <term name=\"month-02\" form=\"short\">Feb.</term> <term name=\"month-03\" form=\"short\">Mar.</term> <term name=\"month-04\" form=\"short\">Apr.</term> <term name=\"month-05\" form=\"short\">May</term> <term name=\"month-06\" form=\"short\">Jun.</term> <term name=\"month-07\" form=\"short\">Jul.</term> <term name=\"month-08\" form=\"short\">Aug.</term> <term name=\"month-09\" form=\"short\">Sep.</term> <term name=\"month-10\" form=\"short\">Oct.</term> <term name=\"month-11\" form=\"short\">Nov.</term> <term name=\"month-12\" form=\"short\">Dec.</term> </terms></locale>";
$tmp=$test->getAliasList(array('type' => 'locale'));
//dsm($tmp);
$tmp=$test->getAliasList(array('type' => 'locale', 'content' => $locale));
//dsm($tmp);
$tmp=$test->getContent($lang);
//dsm($tmp);
$tmp=$test->getAliasList();
//dsm($tmp);
$tmp=$test->getAliasList(array('content' => '{"select" : [{"field" : "type","value" : "book"}]}'));
//dsm($tmp);
$tmp=$test->getAliasList(array('type' => 'citation'));
//dsm($tmp);
$tmp=$test->getAliasList(array('content' => '{"select" : [{"field" : "type","value" : "book"}]}', 'type' => 'bibliography_selector'));
//dsm($tmp);
$test->loadCiteprocJavascript();
return $output;
}
/**
* This funciton will include all the variables in javascript needed for the demo.
* It uses the module's API.
* The data came from the citeproc-js demo
*/
function ir_citation_run_demo_includes() {
module_load_include('inc', 'ir_citation', 'ir_citation');
//demo case
//bibliography lists
load_bibliography_list_for_javascript(array("ITEM-1", "ITEM-3", "ITEM-4", "ITEM-5", "ITEM-6", "ITEM-7", "ITEM-8", "ITEM-9"), 'chicago_author_date_listing');
load_bibliography_list_for_javascript(array("ITEM-1", "ITEM-2", "ITEM-3", "ITEM-4", "ITEM-5", "ITEM-6"), 'ieee');
load_bibliography_list_for_javascript(array("ITEM-1", "ITEM-2", "ITEM-3", "ITEM-4", "ITEM-5", "ITEM-6"), 'chicago_fullnote_bibliography2');
$bibliography_selector='{"select" : [{"field" : "type","value" : "book"}]}';
$variable_name='test';
load_bibliography_selector($bibliography_selector, $variable_name);
//citation objects
$variable_name='citationCAD1';
$json='{"citationItems":[{"id":"ITEM-1"}],"properties":{"noteIndex": 1}}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationCAD2';
$json='{
"citationItems": [
{
"id": "ITEM-2"
}
],
"properties": {
"noteIndex": 2
}}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationCAD3';
$json='{
"citationItems": [
{
"id": "ITEM-3"
}
],
"properties": {
"noteIndex": 3
}}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationCAD4';
$json='{
"citationItems": [
{
"id": "ITEM-4"
}
],
"properties": {
"noteIndex": 4
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationCAD5';
$json='{
"citationItems": [
{
"id": "ITEM-5"
}
],
"properties": {
"noteIndex": 5
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationCAD6';
$json='{
"citationItems": [
{
"id": "ITEM-6"
}
],
"properties": {
"noteIndex": 6
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationCAD7';
$json='{
"citationItems": [
{
"id": "ITEM-21"
}
],
"properties": {
"noteIndex": 7
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB1';
$json='{
"citationItems": [
{
"id": "ITEM-6",
"label": "page",
"locator": "223"
}
],
"properties": {
"noteIndex": 1
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB2';
$json='{
"citationItems": [
{
"id": "ITEM-6"
},
{
"id": "ITEM-10",
"label": "page",
"locator": "685"
},
{
"id": "ITEM-11",
"label": "page",
"locator": "388"
},
{
"id": "ITEM-12",
"label": "page",
"locator": "359"
},
{
"id": "ITEM-10",
"label": "page",
"locator": "690"
},
{
"id": "ITEM-11",
"label": "page",
"locator": "393"
},
{
"id": "ITEM-12",
"label": "page",
"locator": "364"
},
{
"id": "ITEM-6",
"locator": "15",
"prefix":"<i>but see</i>"
}
],
"properties": {
"noteIndex": 2
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB3';
$json='{
"citationItems": [
{
"id": "ITEM-13",
"locator":"90",
"label":"section"
},
{
"id": "ITEM-14",
"locator":"7",
"label":"section"
},
{
"id": "ITEM-15",
"locator":"731-32",
"label":"page"
},
{
"id": "ITEM-16"
}
],
"properties": {
"noteIndex": 3
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB4';
$json='{
"citationItems": [
{
"id": "ITEM-2"
}
],
"properties": {
"noteIndex": 4
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB5';
$json='{
"citationItems": [
{
"id": "ITEM-2",
"label":"page",
"locator":"482"
},
{
"id": "ITEM-13",
"locator":"395",
"label":"section"
},
{
"id": "ITEM-1",
"label":"page",
"locator":"25"
},
{
"id": "ITEM-1"
},
{
"id": "ITEM-1",
"label":"page",
"locator":"112"
}
],
"properties": {
"noteIndex": 5
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB6';
$json='{
"citationItems": [
{
"id": "ITEM-16"
}
],
"properties": {
"noteIndex": 6
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB7';
$json='{
"citationItems": [
{
"id": "ITEM-17",
"label":"paragraph",
"locator":"6"
},
{
"id": "ITEM-18",
"label":"page",
"locator":"983"
}
],
"properties": {
"noteIndex": 7
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB8';
$json='{
"citationItems": [
{
"id": "ITEM-19",
"suffix":"(appeal taken from Scot.)"
}
],
"properties": {
"noteIndex": 8
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB9';
$json='{
"citationItems": [
{
"id": "ITEM-20",
"suffix":"(appeal taken from B.C.)"
}
],
"properties": {
"noteIndex": 9
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB10';
$json='{
"citationItems": [
{
"id": "ITEM-3",
"prefix":"<b>En sinn Scholl beschéngt ass, da Mamm frësch blénken hun?</b> <i>See, e.g.</i>"
},
{
"prefix":"<b>Der mä gutt Dach, eng onser bléit geplot mä.</b> <i>See generally</i>",
"id": "ITEM-3",
"suffix":"<b>(Iwer Engel Milliounen nei fu, blëtzen néierens d\'Gaassen rou do.)</b>"
}
],
"properties": {
"noteIndex": 10
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
$variable_name='citationBB11';
$json='{
"citationItems": [
{
"id": "ITEM-13",
"label":"section",
"locator":"1"
}
],
"properties": {
"noteIndex": 11
}
}';
load_citeproc_citation_object_for_javascript($json, $variable_name);
//mods to json
$variable_name='ITEM-21';
$cite_mods=file_get_contents(drupal_get_path('module', 'ir_citation') . '/demo/testMods.xml');
load_citeproc_json_from_mods($variable_name, $cite_mods);
//fedora grab test [success]
//load_meta_data_from_fedora_pid('Awill:258', $variable_name);
//strait json
$variable_name='ITEM-1';
$citeproc_json='{
"id": "ITEM-1",
"title":"Boundaries of Dissent: Protest and State Power in the Media Age",
"author": [
{
"family": "D\'Arcus",
"given": "Bruce",
"static-ordering": false
}
],
"note":"The apostrophe in Bruce\'s name appears in proper typeset form.",
"publisher": "Routledge",
"publisher-place": "New York",
"issued": {
"date-parts":[
[2006]
]
},
"type": "book"
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-2';
$citeproc_json='{
"id": "ITEM-2",
"author": [
{
"family": "Barnett",
"given": "Frank G.",
"suffix": "Jr.",
"comma-suffix": true,
"static-ordering": false
}
],
"title":"Getting Property Right: \"Informal\" Mortgages in the Japanese Courts",
"container-title":"Pacific Rim Law & Policy Journal",
"volume": "18",
"page": "463-509",
"issued": {
"date-parts":[
[2009, 8]
]
},
"type": "article-journal",
"note": "Note the flip-flop behavior of the quotations marks around \"informal\" in the title of this citation. This works for quotation marks in any style locale. Oh, and, uh, these notes illustrate the formatting of annotated bibliographies (!)."
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-3';
$citeproc_json='{
"id": "ITEM-3",
"title":"Key Process Conditions for Production of C<sub>4</sub> Dicarboxylic Acids in Bioreactor Batch Cultures of an Engineered <i>Saccharomyces cerevisiae</i> Strain",
"note":"This cite illustrates the rich text formatting capabilities in the new processor, as well as page range collapsing (in this case, applying the collapsing method required by the Chicago Manual of Style). Also, as the IEEE example above partially illustrates, we also offer robust handling of particles such as \"van\" and \"de\" in author names.",
"author": [
{
"family": "Zelle",
"given": "Rintze M."
},
{
"family": "Hulster",
"given": "Erik",
"non-dropping-particle":"de"
},
{
"family": "Kloezen",
"given": "Wendy"
},
{
"family":"Pronk",
"given":"Jack T."
},
{
"family": "Maris",
"given":"Antonius J.A.",
"non-dropping-particle":"van"
}
],
"container-title": "Applied and Environmental Microbiology",
"issued":{
"date-parts":[
[2010, 2]
]
},
"page": "744-750",
"volume":"76",
"issue": "3",
"DOI":"10.1128/AEM.02396-09",
"type": "article-journal"
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-4';
$citeproc_json='{
"id": "ITEM-4",
"author": [
{
"family": "Razlogova",
"given": "Elena"
}
],
"title": "Radio and Astonishment: The Emergence of Radio Sound, 1920-1926",
"type": "speech",
"event": "Society for Cinema Studies Annual Meeting",
"event-place": "Denver, CO",
"note":"All styles in the CSL repository are supported by the new processor, including the popular Chicago styles by Elena.",
"issued": {
"date-parts": [
[
2002,
5
]
]
}
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-5';
$citeproc_json='{
"id": "ITEM-5",
"author": [
{
"family": "\u68b6\u7530",
"given": "\u5c06\u53f8",
"multi":{
"_key":{
"ja-alalc97":{
"family": "Kajita",
"given": "Shoji"
}
}
}
},
{
"family": "\u89d2\u6240",
"given": "\u8003",
"multi":{
"_key":{
"ja-alalc97":{
"family": "Kakusho",
"given": "Takashi"
}
}
}
},
{
"family": "\u4e2d\u6fa4",
"given": "\u7be4\u5fd7",
"multi":{
"_key":{
"ja-alalc97":{
"family": "Nakazawa",
"given": "Atsushi"
}
}
}
},
{
"family": "\u7af9\u6751",
"given": "\u6cbb\u96c4",
"multi":{
"_key":{
"ja-alalc97":{
"family": "Takemura",
"given": "Haruo"
}
}
}
},
{
"family": "\u7f8e\u6fc3",
"given": "\u5c0e\u5f66",
"multi":{
"_key":{
"ja-alalc97":{
"family": "Mino",
"given": "Michihiko"
}
}
}
},
{
"family": "\u9593\u702c",
"given": "\u5065\u4e8c",
"multi":{
"_key":{
"ja-alalc97":{
"family": "Mase",
"given": "Kenji"
}
}
}
}
],
"title": "\u9ad8\u7b49\u6559\u80b2\u6a5f\u95a2\u306b\u304a\u3051\u308b\u6b21\u4e16\u4ee3\u6559\u80b2\u5b66\u7fd2\u652f\u63f4\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u69cb\u7bc9\u306b\u5411\u3051\u3066",
"multi":{
"_keys":{
"title":{
"ja-alalc97": "K\u014dt\u014d ky\u014diku ni okeru jisedai ky\u014diku gakush\u016b shien puratto f\u014dmu no k\u014dchiku ni mukete",
"en": "Toward the Development of Next-Generation Platforms for Teaching and Learning in Higher Education"
},
"container-title":{
"ja-alalc97": "Nihon ky\u014diku k\u014dgaku ronbunshi",
"en": "Journal of the Japan Educational Engineering Society"
}
}
},
"container-title": "\u65e5\u672c\u6559\u80b2\u5de5\u5b66\u4f1a\u8ad6\u6587\u8a8c",
"volume": "31",
"issue": "3",
"page": "297-305",
"issued": {
"date-parts": [
[
2007,
12
]
]
},
"note": "Note the transformations to which this cite is subjected in the samples above, and the fact that it appears in the correct sort position in all rendered forms. Selection of multi-lingual content can be configured in the style, permitting one database to serve a multi-lingual author in all languages in which she might publish.",
"type": "article-journal"
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-6';
$citeproc_json='{
"id": "ITEM-6",
"title":"Evaluating Components of International Migration: Consistency of 2000 Nativity Data",
"note": "This cite illustrates the formatting of institutional authors. Note that there is no \"and\" between the individual author and the institution with which he is affiliated.",
"author": [
{
"family": "Malone",
"given": "Nolan J.",
"static-ordering": false
},
{
"literal": "U.S. Bureau of the Census"
}
],
"publisher": "Routledge",
"publisher-place": "New York",
"issued": {
"date-parts":[
[2001, 12, 5]
]
},
"type": "book"
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-7';
$citeproc_json='{
"id": "ITEM-7",
"title": "True Crime Radio and Listener Disenchantment with Network Broadcasting, 1935-1946",
"author":[
{
"family": "Razlogova",
"given": "Elena"
}
],
"container-title": "American Quarterly",
"volume": "58",
"page": "137-158",
"issued": {
"date-parts": [
[2006, 3]
]
},
"type": "article-journal"
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-8';
$citeproc_json='{
"id": "ITEM-8",
"title": "The Guantanamobile Project",
"container-title": "Vectors",
"volume": "1",
"author":[
{
"family": "Razlogova",
"given": "Elena"
},
{
"family": "Lynch",
"given": "Lisa"
}
],
"issued": {
"season": 3,
"date-parts": [
[2005]
]
},
"type": "article-journal"
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-9';
$citeproc_json='{
"id": "ITEM-9",
"container-title": "FEMS Yeast Research",
"volume": "9",
"issue": "8",
"page": "1123-1136",
"title": "Metabolic engineering of <i>Saccharomyces cerevisiae</i> for production of carboxylic acids: current status and challenges",
"contributor":[
{
"family": "Zelle",
"given": "Rintze M."
}
],
"author": [
{
"family": "Abbott",
"given": "Derek A."
},
{
"family": "Zelle",
"given": "Rintze M."
},
{
"family":"Pronk",
"given":"Jack T."
},
{
"family": "Maris",
"given":"Antonius J.A.",
"non-dropping-particle":"van"
}
],
"issued": {
"season": "2",
"date-parts": [
[
2009,
6,
6
]
]
},
"type": "article-journal"
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-10';
$citeproc_json='{
"container-title": "N.Y.2d",
"id": "ITEM-10",
"issued": {
"date-parts": [
[
"1989"
]
]
},
"page": "683",
"title": "People v. Taylor",
"type": "legal_case",
"volume": 73
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-11';
$citeproc_json='{
"container-title": "N.E.2d",
"id": "ITEM-11",
"issued": {
"date-parts": [
[
"1989"
]
]
},
"page": "386",
"title": "People v. Taylor",
"type": "legal_case",
"volume": 541
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-12';
$citeproc_json='{
"container-title": "N.Y.S.2d",
"id": "ITEM-12",
"issued": {
"date-parts": [
[
"1989"
]
]
},
"page": "357",
"title": "People v. Taylor",
"type": "legal_case",
"volume": 543
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-13';
$citeproc_json='{
"id": "ITEM-13",
"title": "\u6c11\u6cd5",
"multi":{
"_keys":{
"title": {
"ja-alalc97": "Minp\u014d",
"en": "Japanese Civil Code"
}
}
},
"type": "legislation"
}';
load_metadata_object_for_javascript($variable_name, $citeproc_json);
$variable_name='ITEM-14';
$citeproc_json='{
"id": "ITEM-14",
"title": "Clayton Act",
"container-title": "ch.",
"number": 323,
"issued": {
"date-parts": [
[
1914
]