Xsanity Sanity for Apple's Xsan and Final Cut Server.
  
Wednesday, May 22 2013 @ 02:46 AM EDT
Topics
Storage (39)
People (1)
Xsan (103)
How To (26)
User Functions
Username:

Password:

Don't have an account yet? Sign up as a New User
Who's Online
Guest Users: 15
Sponsorship

Xsanity is proudly sponsored by:

Tekserve
The Old Reliable Mac Shop

Write XML triggers too early

 
Post new topic   Reply to topic    Xsanity Forums Forum Index -> General FCS Discussion
View previous topic :: View next topic  
Author Message
peterk
Could work for Apple
Could work for Apple


Joined: 18 Mar 2008
Posts: 50

PostPosted: Tue Apr 28, 2009 12:45 pm    Post subject: Write XML triggers too early Reply with quote

Hi,

I have set up a watcher with two responses:
Copy
WriteXML

It downloads a file from a folder, puts it to the Library and I need to export XML AT THE END of the process. I need to have an Asset ID in the .xml file.
The problem is that WriteXML reponse is fired just after copy is finished and before FCS sets all the metadata fields.
My xml file that is created in this Watcher doesn't contain metadata I need and is different than xml. file created from the same asset when it is in FCS already (and finished).

My task:
I am watching remote ftp folder with incoming .mpg files. Each mpg file on ftp has a counterpart - .xml file with the same name as the .mpg file.
I need to download .mpg to FCS, then .xml and set my custom meta data fields in a new asset to values from remote xml file.
I have written a ruby script that downloads the xml from remote site and creates a new xml (in FCS 'Read XML' format). I am calling my ruby script in my watcher (actually in place where is WriteXML - this is just for testing for now) with parameters "[Title]""[Asset ID]". I need to know Asset ID for xml I need to read in FCS. The problem is that Asset ID in this case is not the same Asset ID as when FCS finishes all processes with the asset being created.
I have couple of ideas how to fix it, but I would like to keep it as simple as possible, and this seems to be the simplest way ...
Any ideas ?

Thank you.


Peter
Back to top
View user's profile Send private message
MattG
Xsan Master
Xsan Master


Joined: 15 Apr 2005
Posts: 456

PostPosted: Tue Apr 28, 2009 5:14 pm    Post subject: Reply with quote

You need to trigger the Write XML not from the Watcher, but from a Subscription. Simply subscribe to the "Created" event of an Asset. This way, as soon as the Watcher has completed its copy and made an asset for the new file, it will fire the "Created" subscription and provide a Write XML with the Asset ID inside of it.
Back to top
View user's profile Send private message Visit poster's website
peterk
Could work for Apple
Could work for Apple


Joined: 18 Mar 2008
Posts: 50

PostPosted: Wed Apr 29, 2009 12:23 am    Post subject: Reply with quote

Hi Matt, yes that was one solution I considered, but it will be triggred for every Create event. I used a WriteXML just to test what is in metadata of asset when it is calling. I need to call external script instead of WriteXML to which I need to pass [Title] and [AssetID], the script then downloads and transform some xml to xml for FCS (not every asset have this xml attached). So I need to trigger script after my copy response, but not before metadata are set.
I have a workaround: I created an auxiliray metadata field that I set to TRUE in the resposne that is copying file. I subscribed to this MD and it calls my ruby srcript that does the rest. Workaround, but no so elegant as I wanted .. Anyway, I would appreciate any other idea.
Thank you.
Back to top
View user's profile Send private message
peterk
Could work for Apple
Could work for Apple


Joined: 18 Mar 2008
Posts: 50

PostPosted: Wed Apr 29, 2009 11:21 am    Post subject: Reply with quote

Hi,

I just want to add my solution:
I created a subscription that checks for: "myMetadatSet" Im setting when uploading asset from ftp and for my auxiliary MD field "MDisSet" I also set when uploading from ftp.
When these conditions are true I run my ruby script with prameters [FileName] [Asset ID].
- script is triggered only when asset is uploaded, it also sets MDisSet to FALSE
- script is not triggered when asset is modificated or uploaded to FCS client with "myMetadatSet".
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Xsanity Forums Forum Index -> General FCS Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Best Viewed on a Mac | Suggested Browser: Whatever floats yer boat.