You are here

class views_oai_pmh_metadata_type in Views OAI-PMH 7.2

Same name and namespace in other branches
  1. 6.2 plugins/includes/views_oai_pmh_metadata_type.inc \views_oai_pmh_metadata_type

Provides a mechanism for defining the OAI metadata types. Create an instance of this class with the values set, add it to the global array $GLOBALS['views_oai_pmh'] and the module will handle the rest.

We use the separate file views_oai_pmh_metadata_type_definitions.inc to create the metadata type definitions.

Hierarchy

Expanded class hierarchy of views_oai_pmh_metadata_type

File

plugins/includes/views_oai_pmh_metadata_type.inc, line 15
Definition of the views_oai_pmh_metadata_type class.

View source
class views_oai_pmh_metadata_type {

  /**
   * The metadata prefix value used in the OAI-PMH request. This will be the same as the object's key in the $GLOBALS['views_oai_pmh'] array.
   * @var type
   */
  public $metadata_prefix;

  /**
   * A descriptive name of the data format.
   * @var type
   */
  public $name;

  /**
   * An array of the elements pertaining to this data format.
   * @var array
   */
  public $elements;

  /**
   * The Drupal theme implementation for this data type's fields.
   * @var string
   */
  public $field_theme = 'views_oai_pmh_row_misc_fields';

  /**
   * The Drupal theme implementation for this data type's records.
   * @var string
   */
  public $record_theme = 'views_oai_pmh_record';

  /**
   * The handler implementation for this data type.
   * @var string
   */
  public $handler = 'views_oai_pmh_plugin_row_misc';

  /**
   * The index of the style plugin related to this data format, as defined in 'views_oai_pmh.views.inc'.
   * @var string
   */
  public $style_plugin;

  /**
   * The index of the row plugin related to this data format, as defined in 'views_oai_pmh.views.inc'.
   * @var string
   */
  public $row_plugin;

  /**
   * The group name for elements in the Views form relating to this data format, e.g. 'oai_dc_fields' for Dublin Core fields.
   * @var string
   */
  public $form_group_name;

  /**
   * A string of help text describing this metadata type.
   * @var string
   */
  public $help;

  /**
   * An object of type views_oai_pmh_xml_node that acts as the root element of each OAI record in the generated XML.
   * @var object
   */
  public $base_xml_node;

  /**
   * Class constructor.
   */
  public function __construct($metadata_prefix, $name = '', $elements = array(), $style_plugin = '', $row_plugin = '', $form_group_name = '', $help = '') {

    // Populate the object properties.
    $this->metadata_prefix = $metadata_prefix;
    $this->name = $name;
    $this->elements = $elements;
    $this->style_plugin = $style_plugin;
    $this->row_plugin = $row_plugin;
    $this->form_group_name = $form_group_name;
    $this->help = $help;
    $this->base_xml_node = NULL;

    // Add the 'none' option to the elements list along with its translation.
    $this->elements['none'] = t('None');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
views_oai_pmh_metadata_type::$base_xml_node public property An object of type views_oai_pmh_xml_node that acts as the root element of each OAI record in the generated XML.
views_oai_pmh_metadata_type::$elements public property An array of the elements pertaining to this data format.
views_oai_pmh_metadata_type::$field_theme public property The Drupal theme implementation for this data type's fields.
views_oai_pmh_metadata_type::$form_group_name public property The group name for elements in the Views form relating to this data format, e.g. 'oai_dc_fields' for Dublin Core fields.
views_oai_pmh_metadata_type::$handler public property The handler implementation for this data type.
views_oai_pmh_metadata_type::$help public property A string of help text describing this metadata type.
views_oai_pmh_metadata_type::$metadata_prefix public property The metadata prefix value used in the OAI-PMH request. This will be the same as the object's key in the $GLOBALS['views_oai_pmh'] array.
views_oai_pmh_metadata_type::$name public property A descriptive name of the data format.
views_oai_pmh_metadata_type::$record_theme public property The Drupal theme implementation for this data type's records.
views_oai_pmh_metadata_type::$row_plugin public property The index of the row plugin related to this data format, as defined in 'views_oai_pmh.views.inc'.
views_oai_pmh_metadata_type::$style_plugin public property The index of the style plugin related to this data format, as defined in 'views_oai_pmh.views.inc'.
views_oai_pmh_metadata_type::__construct public function Class constructor.