Do you work with large quantities of Intralink objects? - renaming, adding attributes, importing, exporting, etc?
» Find out if scripting can help you . . .
Scripting in Intralink is similar to mapkeys in Pro/E or macros in other programs. You can record a few clicks and commands, then play them back again.
One great benefit is that you can edit the 'source code' of these little java files and then re-compile them to produce custom programs.
I've used scripting to do some jobs that would otherwise approach the boundaries of tedium, including:
- adding legacy attribute values to thousands of parts, in preparation for...
- renaming these parts one by one (with no naming patterns, so you couldn't do a mass rename)
The benefit of scripting over SQL methods (which I couldn't find for these tasks anyway) is that it mimics real-life behaviour, (ie: client access to the Intralink server) so there's less chance of problems occurring at a lower level.
You can create your own lists of tasks for the script to carry out, plus monitor progress on the client.
Here's a quick crash course in scripting, not by any means a comprehensive guide, but at least it can get you started.
You can get more documentation in your Intralink help files, etc. Note: these notes refer specifically to Intralink 3.3 on Windows, but the principles will apply to other platforms.
To start with, press Ctrl+S from any Intralink screen.
You'll be presented with the Scripting dialog box. From here you can access playback, recording, recompile and various other features. They're pretty self-explanatory.
Recording is the first tab you'll need. This is where you can store the commands you want to automate.
If we use the batch rename as an example, you'd do this:
- Type a filename in the box
(Notes: put a descriptive name, not starting with a number. You don't need to add a suffix, this will be done for you.)
- Press Start
- Select an object
- Perform the renaming operation
- Press Stop when you're done
- The script should then be compiled.
You can easily re-run the fun with the Playback tab, which may be useful for a repetitive sequence of operations. To access more power, though, you'll be looking at editing and recompiling your own custom script...
The .java file [see notes below] created by Recording can be opened in a text editor (like Editpad or Notepad)
As you edit it, you'll notice a few program conventions:
- // denotes a comment
- { and } start and end blocks of code
- recorded commands are in the form IL.select( "PIV", etc....
It's fairly easy to modify values in your recorded script - to perform the same operations on different objects, for instance.
In the rename example above, I obtained the list of objects to rename, then used a javascript program to compile these with the Intralink script.
Imagine it as a Mail Merge(!) - where the script is a form letter and you plug in different values for each object (name, rev, version, etc...).
Once you've created your new master script, you need to convert it so Intralink can understand.
That's where the Recompile tab comes into play:
- Recompile and select the correct filename (eg: rename.java)
- Hit the button and go... (hopefully you won't get errors!)
Then play your script and sit back in amazement as hours of work are compressed to minutes !!
To troubleshoot, use the Watch window to see a script step through its commands.
Messages and errors are available if required. For example, you may try to rename on object to a name that already exists. The script will stop and inform you of the conflict.
Scripting Part 2 takes this further, with more applications for Intralink Scripting.
Ed-02-Sep-04
Notes about the script files...
The .java source files are stored in PDM_LDB_PATH\.proi\.data\user.data\source\ - these can be edited with any text editor.
Any compiled .class files are stored in PDM_LDB_PATH\.proi\.data\user.data\lib\ - don't touch these.
PS - also see this article on Pro/Files magazine on the same subject.