This ruby script requires two Ruby 1.9, and two rubygems: highline and capybara:
gem install highline capybara
Be sure to replace the placeholder at the end of the script with your KC Application URL, like "https://my.kc.app/kra-dev/".
To ad-hoc route (FYI) a list of documents to one individual, just execute:
ruby adhoc-fyi.rb <principal name of recipient> <document id> ...
For example, to FYI documents 75352 and 75350 to user quickstart:
sam@mint6510:~/code/KATTS-810$ ruby adhoc-fyi.rb quickstart 75352 75350
NetID: srawlins
Password: ****************
AdHoc Requests have been sent for 75352.
AdHoc Requests have been sent for 75350.
If listing all of your document IDs in a line is difficult, you can instead create a file with newline-separated document IDs, and alter the script to read these in with:
documents = File.readlines(file_name).map(&:chomp)
Or if it's a comma-separated list of document IDs:
documents = File.read(file_name).split(",")
Good luck.
Why is this better than just writing a struts action that iterates over a list of document numbers and calls sendAdHocRequests() from the document service? Seems like that would go a million times faster and you would have the ability to utilize a system user for sending the requests instead of "srawlins"