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 RcSystem.properties file (e.g. Windows location = c:\user\{username}\.RcTools\RcSystem.properties) to the parameter called “org.rescarta.dct.preConvertJavaScriptFile=” for example…


org.rescarta.dct.preConvertJavaScriptFile=C:/myjavasrcipts/metadata/RcPreConvert.js

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 http://software.rescarta.org/apidocs/rc-sdk>http://software.rescarta.org/apidocs/rc-sdk</a> and Class RcObjectMetadata for more detailed information on variable names.

Personal tools
Namespaces
Variants
Actions
Navigation
User Resources
Developer Resources
Toolbox