This discussion is locked
Minas Morgul

Q: Contentbase Device

In Proximity Artbox, a Contentbase device was one that allowed infinite versions of the same exact named file to be loaded in as completely separate assets. This was accomplished because the file directory structure underneath the root folder of a Contentbase consisted of sequentially numbered folders in a hexidecimal format. As each file was uploaded into Artbox as an asset, and into a Contentbase, it would be renamed with a unique hex number, and that number would be tracked in the asset's metadata. So you could upload an asset with the same filename a thousand times, and a thousand unique hex filenames would be created. That's how you were able to have multiple assets with the exact same name. They all had unique asset ID's and filenames.

Final Cut Server already comes with a few Contentbase type devices. The most obvious is the Proxy device. Ever notice how the Proxy device isn't included in the devices tab of the FCS Preferences Panel? Also, Contentbase is not an option when you try and add a new device. To create a Contentbase, do the following:

1. Create one of those 'bundle' type folders with the name of your new Contentbase. FCS will only use a 'dot bundle' file as a CB. So it's 'mkdir NewDeviceName.bundle'

2. Go into the Java App, and in Administration - Devices, create a new device of type 'Contentbase'.

3. Point it at the full path and file name of the 'dot-bundle' file you created, and when you gve it a name and save it, you have a new Contentbase that you can use.

Final Cut Server automatically appends a '-1, -2, -3, etc...' when you try and upload same named files into a regular Filesystem device. But with a Contentbase, you can keep the exact same file name. That unique hex file name is for internal purposes only. If you download that asset or copy it someplace, it will come out with it's original file name, NOT the hex name.

macbook, Mac OS X (10.5.2)

Posted on Oct 8, 2010 8:18 AM

Close

Q: Contentbase Device

  • All replies
  • Helpful answers

  • by Nicholas Stokes,

    Nicholas Stokes Nicholas Stokes Oct 8, 2010 12:29 PM in response to Minas Morgul
    Level 2 (490 points)
    Oct 8, 2010 12:29 PM in response to Minas Morgul
    John:

    This is a great post. Would you mind elaborating on the performance benefits 1 can have with deploying a Contentbase Device over a File System device.

    Lastly, anyway you know of that you can determine programmatically what the full filesystem path is for a asset that is stored on a Content Base?

    Thanks for your help in advanced.


    Nicholas Stokes
    XPlatform Consulting
  • by Jamie Hodge,

    Jamie Hodge Jamie Hodge Oct 12, 2010 2:18 AM in response to Nicholas Stokes
    Level 1 (15 points)
    Oct 12, 2010 2:18 AM in response to Nicholas Stokes
    The path can be derived from the number that precedes the title of the relevant child asset. i.e. 1234_Title.
  • by Nicholas Stokes,

    Nicholas Stokes Nicholas Stokes Oct 12, 2010 9:12 AM in response to Jamie Hodge
    Level 2 (490 points)
    Oct 12, 2010 9:12 AM in response to Jamie Hodge
    Really do you have some code that will calculate this path? I am very keen on understand how you can determine this path.


    Let me know.


    Nicholas Stokes
    XPlatform Consulting
  • by John F. Whitehead,

    John F. Whitehead John F. Whitehead Oct 12, 2010 3:32 PM in response to Minas Morgul
    Level 2 (380 points)
    Oct 12, 2010 3:32 PM in response to Minas Morgul
    It doesn't have to be a bundle; that just blocks it from looking like a directory to the Finder.
  • by Jim Mellor,

    Jim Mellor Jim Mellor Oct 29, 2010 12:25 PM in response to Nicholas Stokes
    Level 1 (15 points)
    Oct 29, 2010 12:25 PM in response to Nicholas Stokes
    This Ruby script should do the trick. Save this as a file and run it passing the arguments asset id and the link type.

    I called my script get_path.rb and made sure the mode was executable first. You may also need the ruby gem REXML.

    For instance, to get the proxy location of asset (link type 4)

    /path/to/script/get_path.rb 6918 4

    <source>
    #!/usr/bin/env ruby

    require 'rexml/document'; include REXML

    asset_id = 'ARGV[0]'
    rep_id = 'ARGV[1]'

    fcsinstalldir = "/Library/Application\\ Support/Final\\ Cut\\ Server/"
    fcs_client = "#{fcsinstalldir}Final\\ Cut\\ Server.bundle/Contents/MacOS/fcsvr_client"

    mdValXmlResultDoc = Document.new(`#{fcs_client} listparentlinks /asset/#{asset_id} --xml --linktype #{rep_id}`)
    asset_path = XPath.match(mdValXmlResultDoc, "//[@id=\"ADDRESS\"]/string/.").first.text

    mdValXmlResultDoc = Document.new(`#{fcs_client} getmd #{asset_path} --xml`)
    lcb_id = XPath.match(mdValXmlResultDoc, "//[@id=\"LCBID"]/bigint/.").first.text.toi
    lcb_path = lcbid.tos(16).rjust(16, "0")

    lcbpatharray = lcb_path.scan(/.{2}/).reverse
    decodelcbpath = "#{lcbpath_array[1]}/#{lcb_path_array[2]}/#{lcbpath}/"
    assetpath.sub!("#{lcb_id}", decodelcbpath)

    p asset_path
    </source>

    Have fun!
  • by Jim Mellor,

    Jim Mellor Jim Mellor Oct 29, 2010 3:18 PM in response to Jim Mellor
    Level 1 (15 points)
    Oct 29, 2010 3:18 PM in response to Jim Mellor
    Whoops I made some mistakes. You wanna ignore the quotes around the argument array, lines 5&6 should be:

    *asset_id = ARGV[0]*
    *rep_id = ARGV[1]*

    Also on the subject of quotes you can remove the " 's from the output by changing the last line to

    *puts asset_path*
  • by Jamie Hodge,

    Jamie Hodge Jamie Hodge Nov 2, 2010 2:00 AM in response to Jim Mellor
    Level 1 (15 points)
    Nov 2, 2010 2:00 AM in response to Jim Mellor
    Thank you Jim for sharing. It's good to see actual solutions being posted. Is anyone working on a larger FCS Ruby library? I am an am interested in sharing/discussing.
  • by Jim Mellor,

    Jim Mellor Jim Mellor Nov 2, 2010 3:51 AM in response to Jamie Hodge
    Level 1 (15 points)
    Nov 2, 2010 3:51 AM in response to Jamie Hodge
    Hi Jamie - right, I was keen to release a couple of code examples on these forums which have previously been a bit light on actual solutions, as you describe, to see if this is the right place to share them. I fully agree it would be great to see more contributions, code examples, integration ideas from the community.