Skip navigation
This discussion is archived

Contentbase Device

4032 Views 8 Replies Latest reply: Nov 2, 2010 3:51 AM by Jim Mellor RSS
Minas Morgul Calculating status...
Currently Being Moderated
Oct 8, 2010 8:18 AM
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)
  • Nicholas Stokes Level 2 Level 2 (490 points)
    Currently Being Moderated
    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
    8 Core Mac Pro, Mac OS X (10.6.4)
  • Jamie Hodge Calculating status...
    Currently Being Moderated
    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.
  • Nicholas Stokes Level 2 Level 2 (490 points)
    Currently Being Moderated
    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
    8 Core Mac Pro, Mac OS X (10.6.4)
  • John F. Whitehead Level 2 Level 2 (380 points)
    Currently Being Moderated
    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.
    MacBook Pro, Mac OS X (10.6.4)
  • Jim Mellor Calculating status...
    Currently Being Moderated
    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!
    Mac OS X (10.6.4)
  • Jim Mellor Level 1 Level 1 (15 points)
    Currently Being Moderated
    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*
    Mac OS X (10.5.2)
  • Jamie Hodge Level 1 Level 1 (15 points)
    Currently Being Moderated
    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.
  • Jim Mellor Level 1 Level 1 (15 points)
    Currently Being Moderated
    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.
    Mac Plus, Mac OS 8.6 or Earlier

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.