Xinet Automation in the Command Line

Posted by Robert Sullivan on Wed, Apr 15, 2009 @ 09:52 AM
Some people actually prefer to work from the command line in a terminal window.
I know! Can Ya' believe it!
There are somethings that just aren't in the GUI and there are some things you
can just do faster in a terminal window. That is assuming you can type faster
than me.

I had a client call in looking for a way to create a series of "Move Actions"
but wanted to do it as a batch somehow. I couldn't get him a 'batch create' for a
WebNative Venture action, but... command line creation fit the bill.

The idea was for remote users to have an Uploader Application and one of the
mandatory data fields was the client name. The Trigger set would do a 'Compare Action'
and then call a Move to-client-name, within the folder structure. So it's going to be
an automated filing system with Triggers for uploaded assets.

In the folder path: /usr/etc/webnative/actions/
are all of the default Venture action categories, (copy, email, move...) and any
custom action categories we can create ourselves. Within each specific category folder
are the scripts for that action and a settings folder that has a config file for each
action we create.

Here is a sample move action called: "Acme Widgets Incoming"

If I look at that setting from the command line it looks like this:
# cat "Acme Widgets Incoming"
[base]
desc=File asset in client folder Acme
[arg0]
value=/Volumes/Raid/Studio/Acme_Widgets/Incoming
[arg1]
value=O
#
It's pretty simple once you compare the GUI to the code settings.
desc is the description of the action
arg0, value, is the destination path we want to move the asset into.
arg1, value=O, is the 'Overwrite' selection.
This value could be 'A' for 'Append Unique Number' or 'F' for Fail
You just need to understand the argument options and the code translation. Now obviously
the different action categories will have other argument options, you just need to review
each one to know the 'value' to assign.

So back to my client's need to create multiple actions quickly. Consistency in the folder
structure and nomenclature is part of the key. All we do is create one 'master' move action
in the WebNative browser window. "Acme Widgets Incoming"
From the command line copy the master to the next client name and then edit the value path.
Done.

In the terminal window navigate to the action settings folder.
   cd /usr/etc/webnative/actions/move/settings
Copy paste the master setting to the new client name.
   cp "Acme Widgets Incoming" "Spacely Sprockets Incoming"
Edit the new setting "Spacely Sprockets Incoming" for the correct path-to-folder.
     value=/Volumes/Raid/Studio/Acme_Widgets/Incoming
becomes:
     value=/Volumes/Raid/Studio/Spacely_Sprockets/Incoming
 
If you need to create a lot of actions that do the same thing to unique paths, this is the
quickest way to go. The command line is not for everybody but for those that know their way
around, its another powerful way to work with the Xinet Venture database. My client now has over
300 move actions, to file uploaded assets into the correct client folder automatically.
All done by lunch time..!
So what's for dessert?

-Sully 

Tags: database, Xinet, how to, workflow