How is product specific static content used in Cobalt?

Product specific static content is kept in a different location than Platform static content, but products still use the Platform stuff. For any given product, how are these two sets merged in deployed environments? How are they merged locally?

Best Answer

  • As you said, each product has their own folder in the StaticContent project. Beneath this folder, products have to follow a very specific directory structure to ensure that their static content is deployed correctly. At deploy time, an Ant script is invoked which merges the Platform and product static content files. A couple of tasks are performed during the merge process: - Product javascript and images are copied over into the Platform folder (collisions between products are avoided because of the strict directory structure) - Product CSS files are appended to the end of the platform CSS files and are copied back into the product file - Some JavaScript files are concatenated together into one file, depending on the entries in the Ant script. - All JavaScript and CSS files are minified. When working locally, there is a Powershell script for each product which does much of the same thing as the Ant deployment script does... This should be used for merging/deploying a product's static content locally. CM also has a developer Ant script which is meant to be used locally and can be used if preferred, however I'm not sure how many use this script locally. When deployed, the static content web application will serve up the correct product file based on the product being requested. [Here is a good document][1] describing the build/deploy process as well as what happens when a request hits the Static Content server. [1]:
    http://tfsnpt.int.thomson.com/Cobalt%20Platform/Documents/On%20boarding/Modules%20(AKA%20verticals)/Static%20Content%20Module/Cobalt%20Platform%20Static%20Content.docx