How do I include a required context in a ctools content type plugin? I need to include a subject type as a required context for a ctools content type plugin? How and where is context set for the ctools plugin?
You can define the required context in the plugin definition array. Use the 'required context' key and the ctools_context_required class.

Here are a few lines of stripped down code you can find in the CTools Plugin Example module:

/**
 * Plugins are described by creating a $plugin array which will be used
 * by the system that includes this file.
 */
$plugin = array(
  'title' =&gt; t('Simplecontext content type'),
  'description' =&gt; t('Simplecontext content type - works with a simplecontext context.'),
  'required context' =&gt; new ctools_context_required(t('Simplecontext'), 'simplecontext'),
);