all files / src/ ItemMaps.js

100% Statements 14/14
100% Branches 0/0
100% Functions 0/0
100% Lines 14/14
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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
'use strict';
 
var log = require('./Log.js').Logger('libZotero:ItemMaps');
 
var ItemMaps = {};
 
ItemMaps.fieldMap = {
	'itemType'				: 'Item Type',
	'title'					: 'Title',
	'dateAdded'				: 'Date Added',
	'dateModified'			: 'Date Modified',
	'source'				: 'Source',
	'notes'					: 'Notes',
	'tags'					: 'Tags',
	'attachments'			: 'Attachments',
	'related'				: 'Related',
	'url'					: 'URL',
	'rights'				: 'Rights',
	'series'				: 'Series',
	'volume'				: 'Volume',
	'issue'					: 'Issue',
	'edition'				: 'Edition',
	'place'					: 'Place',
	'publisher'				: 'Publisher',
	'pages'					: 'Pages',
	'ISBN'					: 'ISBN',
	'publicationTitle'		: 'Publication',
	'ISSN'					: 'ISSN',
	'date'					: 'Date',
	'year'					: 'Year',
	'section'				: 'Section',
	'callNumber'			: 'Call Number',
	'archive'				: 'Archive',
	'archiveLocation'		: 'Loc. in Archive',
	'libraryCatalog'		: 'Library Catalog',
	'distributor'			: 'Distributor',
	'extra'					: 'Extra',
	'journalAbbreviation'	: 'Journal Abbr',
	'DOI'					: 'DOI',
	'accessDate'			: 'Accessed',
	'seriesTitle'			: 'Series Title',
	'seriesText'			: 'Series Text',
	'seriesNumber'			: 'Series Number',
	'institution'			: 'Institution',
	'reportType'			: 'Report Type',
	'code'					: 'Code',
	'session'				: 'Session',
	'legislativeBody'		: 'Legislative Body',
	'history'				: 'History',
	'reporter'				: 'Reporter',
	'court'					: 'Court',
	'numberOfVolumes'		: '# of Volumes',
	'committee'				: 'Committee',
	'assignee'				: 'Assignee',
	'patentNumber'			: 'Patent Number',
	'priorityNumbers'		: 'Priority Numbers',
	'issueDate'				: 'Issue Date',
	'references'			: 'References',
	'legalStatus'			: 'Legal Status',
	'codeNumber'			: 'Code Number',
	'artworkMedium'			: 'Medium',
	'number'				: 'Number',
	'artworkSize'			: 'Artwork Size',
	'repository'			: 'Repository',
	'videoRecordingType'	: 'Recording Type',
	'interviewMedium'		: 'Medium',
	'letterType'			: 'Type',
	'manuscriptType'		: 'Type',
	'mapType'				: 'Type',
	'scale'					: 'Scale',
	'thesisType'			: 'Type',
	'websiteType'			: 'Website Type',
	'audioRecordingType'	: 'Recording Type',
	'label'					: 'Label',
	'presentationType'		: 'Type',
	'meetingName'			: 'Meeting Name',
	'studio'				: 'Studio',
	'runningTime'			: 'Running Time',
	'network'				: 'Network',
	'postType'				: 'Post Type',
	'audioFileType'			: 'File Type',
	'versionNumber'			: 'Version Number',
	'system'				: 'System',
	'company'				: 'Company',
	'conferenceName'		: 'Conference Name',
	'encyclopediaTitle'		: 'Encyclopedia Title',
	'dictionaryTitle'		: 'Dictionary Title',
	'language'				: 'Language',
	'programmingLanguage'	: 'Language',
	'university'			: 'University',
	'abstractNote'			: 'Abstract',
	'websiteTitle'			: 'Website Title',
	'reportNumber'			: 'Report Number',
	'billNumber'			: 'Bill Number',
	'codeVolume'			: 'Code Volume',
	'codePages'				: 'Code Pages',
	'dateDecided'			: 'Date Decided',
	'reporterVolume'		: 'Reporter Volume',
	'firstPage'				: 'First Page',
	'documentNumber'		: 'Document Number',
	'dateEnacted'			: 'Date Enacted',
	'publicLawNumber'		: 'Public Law Number',
	'country'				: 'Country',
	'applicationNumber'		: 'Application Number',
	'forumTitle'			: 'Forum/Listserv Title',
	'episodeNumber'			: 'Episode Number',
	'blogTitle'				: 'Blog Title',
	'caseName'				: 'Case Name',
	'nameOfAct'				: 'Name of Act',
	'subject'				: 'Subject',
	'proceedingsTitle'		: 'Proceedings Title',
	'bookTitle'				: 'Book Title',
	'shortTitle'			: 'Short Title',
	'docketNumber'			: 'Docket Number',
	'numPages'				: '# of Pages',
	'note'					: 'Note',
	'numChildren'			: '# of Children',
	'addedBy'				: 'Added By',
	'creator'				: 'Creator'
};
 
ItemMaps.typeMap = {
	'note'					: 'Note',
	'attachment'			: 'Attachment',
	'book'					: 'Book',
	'bookSection'			: 'Book Section',
	'journalArticle'		: 'Journal Article',
	'magazineArticle'		: 'Magazine Article',
	'newspaperArticle'		: 'Newspaper Article',
	'thesis'				: 'Thesis',
	'letter'				: 'Letter',
	'manuscript'			: 'Manuscript',
	'interview'				: 'Interview',
	'film'					: 'Film',
	'artwork'				: 'Artwork',
	'webpage'				: 'Web Page',
	'report'				: 'Report',
	'bill'					: 'Bill',
	'case'					: 'Case',
	'hearing'				: 'Hearing',
	'patent'				: 'Patent',
	'statute'				: 'Statute',
	'email'					: 'E-mail',
	'map'					: 'Map',
	'blogPost'				: 'Blog Post',
	'instantMessage'		: 'Instant Message',
	'forumPost'				: 'Forum Post',
	'audioRecording'		: 'Audio Recording',
	'presentation'			: 'Presentation',
	'videoRecording'		: 'Video Recording',
	'tvBroadcast'			: 'TV Broadcast',
	'radioBroadcast'		: 'Radio Broadcast',
	'podcast'				: 'Podcast',
	'computerProgram'		: 'Computer Program',
	'conferencePaper'		: 'Conference Paper',
	'document'				: 'Document',
	'encyclopediaArticle'	: 'Encyclopedia Article',
	'dictionaryEntry'		: 'Dictionary Entry'
};
 
ItemMaps.creatorMap = {
	'author'			: 'Author',
	'contributor'		: 'Contributor',
	'editor'			: 'Editor',
	'translator'		: 'Translator',
	'seriesEditor'		: 'Series Editor',
	'interviewee'		: 'Interview With',
	'interviewer'		: 'Interviewer',
	'director'			: 'Director',
	'scriptwriter'		: 'Scriptwriter',
	'producer'			: 'Producer',
	'castMember'		: 'Cast Member',
	'sponsor'			: 'Sponsor',
	'counsel'			: 'Counsel',
	'inventor'			: 'Inventor',
	'attorneyAgent'		: 'Attorney/Agent',
	'recipient'			: 'Recipient',
	'performer'			: 'Performer',
	'composer'			: 'Composer',
	'wordsBy'			: 'Words By',
	'cartographer'		: 'Cartographer',
	'programmer'		: 'Programmer',
	'reviewedAuthor'	: 'Reviewed Author',
	'artist'			: 'Artist',
	'commenter'			: 'Commenter',
	'presenter'			: 'Presenter',
	'guest'				: 'Guest',
	'podcaster'			: 'Podcaster'
};
 
ItemMaps.hideFields = [
	'mimeType',
	'linkMode',
	'charset',
	'md5',
	'mtime',
	'version',
	'key',
	'collections',
	'relations',
	'parentItem',
	'contentType',
	'filename',
	'tags'
];
 
ItemMaps.noEditFields = [
	'accessDate',
	'modified',
	'filename',
	'dateAdded',
	'dateModified'
];
 
ItemMaps.itemTypeImageSrc = {
	'note'					: 'note',
	'attachment'			: 'attachment-pdf',
	'attachmentPdf'			: 'attachment-pdf',
	'attachmentWeblink'		: 'attachment-web-link',
	'attachmentSnapshot'	: 'attachment-snapshot',
	'attachmentFile'		: 'attachment-file',
	'attachmentLink'		: 'attachment-link',
	'book'					: 'book',
	'bookSection'			: 'book_open',
	'journalArticle'		: 'page_white_text',
	'magazineArticle'		: 'layout',
	'newspaperArticle'		: 'newspaper',
	'thesis'				: 'report',
	'letter'				: 'email_open',
	'manuscript'			: 'script',
	'interview'				: 'comments',
	'film'					: 'film',
	'artwork'				: 'picture',
	'webpage'				: 'page',
	'report'				: 'report',
	'bill'					: 'page_white',
	'case'					: 'page_white',
	'hearing'				: 'page_white',
	'patent'				: 'page_white',
	'statute'				: 'page_white',
	'email'					: 'email',
	'map'					: 'map',
	'blogPost'				: 'layout',
	'instantMessage'		: 'page_white',
	'forumPost'				: 'page',
	'audioRecording'		: 'ipod',
	'presentation'			: 'page_white',
	'videoRecording'		: 'film',
	'tvBroadcast'			: 'television',
	'radioBroadcast'		: 'transmit',
	'podcast'				: 'ipod_cast',
	'computerProgram'		: 'page_white_code',
	'conferencePaper'		: 'treeitem-conferencePaper',
	'document'				: 'page_white',
	'encyclopediaArticle'	: 'page_white',
	'dictionaryEntry'		: 'page_white'
};
 
ItemMaps.cslNameMap = {
	'author': 'author',
	'editor': 'editor',
	'bookAuthor': 'container-author',
	'composer': 'composer',
	'interviewer': 'interviewer',
	'recipient': 'recipient',
	'seriesEditor': 'collection-editor',
	'translator': 'translator'
};
 
ItemMaps.cslFieldMap = {
	'title': ['title', 'nameOfAct', 'caseName', 'subject'],
	'container-title': ['publicationTitle',  'reporter', 'code'], /* reporter and code should move to SQL mapping tables */
	'collection-title': ['seriesTitle', 'series'],
	'collection-number': ['seriesNumber'],
	'publisher': ['publisher', 'distributor'], /* distributor should move to SQL mapping tables */
	'publisher-place': ['place'],
	'authority': ['court'],
	'page': ['pages'],
	'volume': ['volume'],
	'issue': ['issue'],
	'number-of-volumes': ['numberOfVolumes'],
	'number-of-pages': ['numPages'],
	'edition': ['edition'],
	'versionNumber': ['version'],
	'section': ['section'],
	'genre': ['type', 'artworkSize'], /* artworkSize should move to SQL mapping tables, or added as a CSL variable */
	'medium': ['medium', 'system'],
	'archive': ['archive'],
	'archive_location': ['archiveLocation'],
	'event': ['meetingName', 'conferenceName'], /* these should be mapped to the same base field in SQL mapping tables */
	'event-place': ['place'],
	'abstract': ['abstractNote'],
	'URL': ['url'],
	'DOI': ['DOI'],
	'ISBN': ['ISBN'],
	'call-number': ['callNumber'],
	'note': ['extra'],
	'number': ['number'],
	'references': ['history'],
	'shortTitle': ['shortTitle'],
	'journalAbbreviation': ['journalAbbreviation'],
	'language': ['language']
};
 
ItemMaps.cslDateMap = {
	'issued': 'date',
	'accessed': 'accessDate'
};
 
ItemMaps.cslTypeMap = {
	'book': 'book',
	'bookSection': 'chapter',
	'journalArticle': 'article-journal',
	'magazineArticle': 'article-magazine',
	'newspaperArticle': 'article-newspaper',
	'thesis': 'thesis',
	'encyclopediaArticle': 'entry-encyclopedia',
	'dictionaryEntry': 'entry-dictionary',
	'conferencePaper': 'paper-conference',
	'letter': 'personal_communication',
	'manuscript': 'manuscript',
	'interview': 'interview',
	'film': 'motion_picture',
	'artwork': 'graphic',
	'webpage': 'webpage',
	'report': 'report',
	'bill': 'bill',
	'case': 'legal_case',
	'hearing': 'bill',                // ??
	'patent': 'patent',
	'statute': 'legislation',
	'email': 'personal_communication',
	'map': 'map',
	'blogPost': 'webpage',
	'instantMessage': 'personal_communication',
	'forumPost': 'webpage',
	'audioRecording': 'song',     // ??
	'presentation': 'speech',
	'videoRecording': 'motion_picture',
	'tvBroadcast': 'broadcast',
	'radioBroadcast': 'broadcast',
	'podcast': 'song',            // ??
	'computerProgram': 'book'     // ??
};
 
ItemMaps.citePaperJournalArticleURL = false;
 
module.exports = ItemMaps;