Data Conversion Tool JavaScript

From ResCarta Software Wiki
Jump to: navigation, search

You are able to add additional custom JavaScript to the Data Conversion process by creating some JavaScript and telling the Data Conversion Tool where to find it.

To use a custom script you must add the path to the file in your file (e.g. Windows location = c:\user\{username}\.RcTools\ to the parameter called “org.rescarta.dct.preConvertJavaScriptFile=” for example…


NOTE: the file location above is correct. You will need to use the “/” instead of the windows “\” separator.

RcPreConvert.js importClass(org.rescarta.metadata.RcMetadataSubject); function rcPreConvert(sourceDirOrFile, rcObjectMetadata) { rcObjectMetadata.setAggregator("SK" + rcObjectMetadata.getAggregator().substring(2,8)); rcObjectMetadata.setTitle(rcObjectMetadata.getTitle() + " modified by JavaScript"); rcObjectMetadata.setNote("From " + sourceDirOrFile.getPath()); rcObjectMetadata.getSubjects().add(new RcMetadataSubject(rcObjectMetadata ,"LCSH", "Subject from JavaScript")); } Note: See <a></a> and Class RcObjectMetadata for more detailed information on variable names.

Personal tools
User Resources
Developer Resources