Skip to content

Commit

Permalink
Set some default author roles based on field
Browse files Browse the repository at this point in the history
  • Loading branch information
aurimasv committed Apr 18, 2012
1 parent 101950d commit c205551
Showing 1 changed file with 46 additions and 6 deletions.
52 changes: 46 additions & 6 deletions RIS-ProCite.js
Expand Up @@ -530,10 +530,24 @@ function processTag(item, tag, value, properties) {
// primary author (patent: inventor)
// store Zotero "creator type" in temporary variable
var tempType;
if (item.itemType == "patent") {
tempType = "inventor";
} else {
tempType = "author";
switch(item.itemType) {
case "artwork":
tempType = "artist";
break;
case "audioRecording":
tempType = "performer";
break;
case 'bill':
tempType = "sponsor";
break;
case "patent":
tempType = "inventor";
break;
case "computerProgram":
tempType = 'programmer';
break;
default:
tempType = "author";
}

//this could have been supplied in the properties
Expand All @@ -545,8 +559,21 @@ function processTag(item, tag, value, properties) {
addAuthor(item, value, ['editor']);
break;
case "A2":
var tempType = ['editor'];
var tempType;
switch(item.itemType) {
case 'bill':
tempType = 'sponsor';
break;
case 'case':
tempType = 'contributor';
break;
default:
tempType = 'editor';
}
tempType = [tempType]
case "A3":
/**TODO: split these up*/
case "A4":
// contributing author (patent: assignee)
if (item.itemType == "patent") {
if (item.assignee) {
Expand All @@ -557,8 +584,21 @@ function processTag(item, tag, value, properties) {
item.assignee = value;
}
} else {
if(!tempType) {
var tempType;
switch(item.itemType) {
case 'book':
case 'bookSection':
case 'conferencePaper':
tempType = 'series-editor';
break;
default:
tempType = 'contributor';
}
tempType = [tempType];
}
var tempType = getProperty(properties, 'creatorType') ||
tempType || ['contributor'];
tempType;
addAuthor(item, value, tempType);
}
break;
Expand Down

0 comments on commit c205551

Please sign in to comment.