Beispiel #1
0
 /**
  * Initialize model with the following fields:
  * - Active
  * - CommentInternal
  * - DescMarkup
  * - DescText
  * - Language
  * - LinkLicence
  * - LinkLogo
  * - LinkSign
  * - MimeType
  * - NameLong
  * - PodAllowed
  * - SortOrder
  *
  * @return void
  */
 protected function _init()
 {
     $active = new Opus_Model_Field('Active');
     $active->setCheckbox(true);
     $comment_internal = new Opus_Model_Field('CommentInternal');
     $comment_internal->setTextarea(true);
     $desc_markup = new Opus_Model_Field('DescMarkup');
     $desc_markup->setTextarea(true);
     $desc_text = new Opus_Model_Field('DescText');
     $desc_text->setTextarea(true);
     $licence_language = new Opus_Model_Field('Language');
     if (Zend_Registry::isRegistered('Available_Languages') === true) {
         $licence_language->setDefault(Zend_Registry::get('Available_Languages'));
     }
     $licence_language->setSelection(true);
     $licence_language->setMandatory(true);
     $link_licence = new Opus_Model_Field('LinkLicence');
     $link_licence->setMandatory(true)->setValidator(new Zend_Validate_NotEmpty());
     $link_logo = new Opus_Model_Field('LinkLogo');
     $link_sign = new Opus_Model_Field('LinkSign');
     $mime_type = new Opus_Model_Field('MimeType');
     $name_long = new Opus_Model_Field('NameLong');
     $name_long->setMandatory(true)->setValidator(new Zend_Validate_NotEmpty());
     $sort_order = new Opus_Model_Field('SortOrder');
     $pod_allowed = new Opus_Model_Field('PodAllowed');
     $pod_allowed->setCheckbox(true);
     $this->addField($active)->addField($comment_internal)->addField($desc_markup)->addField($desc_text)->addField($licence_language)->addField($link_licence)->addField($link_logo)->addField($link_sign)->addField($mime_type)->addField($name_long)->addField($sort_order)->addField($pod_allowed);
 }
Beispiel #2
0
 /**
  * Initialize model with fields.
  *
  * @return void
  */
 protected function _init()
 {
     $title = new Opus_Model_Field('Title');
     $title->setMandatory(true)->setValidator(new Zend_Validate_NotEmpty());
     $infobox = new Opus_Model_Field('Infobox');
     $infobox->setTextarea(true);
     $visible = new Opus_Model_Field('Visible');
     $visible->setCheckbox(true);
     $sortOrder = new Opus_Model_Field('SortOrder');
     $sortOrder->setValidator(new Zend_Validate_Int());
     $this->addField($title)->addField($infobox)->addField($visible)->addField($sortOrder);
 }
Beispiel #3
0
 /**
  * Initialize model with fields.
  *
  * @return void
  */
 protected function _init()
 {
     $part2B = new Opus_Model_Field('Part2B');
     $part2T = new Opus_Model_Field('Part2T');
     $part2T->setMandatory(true)->setValidator(new Zend_Validate_NotEmpty());
     $part1 = new Opus_Model_Field('Part1');
     $scope = new Opus_Model_Field('Scope');
     $type = new Opus_Model_Field('Type');
     $ref_name = new Opus_Model_Field('RefName');
     $ref_name->setMandatory(true)->setValidator(new Zend_Validate_NotEmpty());
     $comment = new Opus_Model_Field('Comment');
     $active = new Opus_Model_Field('Active');
     $active->setCheckbox(true);
     $this->addField($part2B)->addField($part2T)->addField($part1)->addField($scope)->addField($type)->addField($ref_name)->addField($comment)->addField($active);
 }
Beispiel #4
0
 /**
  * Sets up field by analyzing collection content table metadata.
  *
  * @return void
  */
 protected function _init()
 {
     $fields = array('Number', 'Name', 'OaiSubset', 'RoleId', 'Role', 'RoleName', 'RoleDisplayFrontdoor', 'RoleVisibleFrontdoor', 'DisplayFrontdoor', 'VisiblePublish');
     foreach ($fields as $field) {
         $field = new Opus_Model_Field($field);
         $this->addField($field);
     }
     $visible = new Opus_Model_Field('Visible');
     $visible->setCheckbox(true);
     $this->addField($visible);
     // Add a field to hold collection specific theme.
     $theme = new Opus_Model_Field('Theme');
     $theme->setSelection(true);
     $this->addField($theme);
     /**
      * External fields.
      */
     $children = new Opus_Model_Field('Children');
     $children->setMultiplicity('*');
     $this->addField($children);
     // Contains the path back to the root node.
     $parents = new Opus_Model_Field('Parents');
     $parents->setMultiplicity('*');
     $this->addField($parents);
     /*
      * Fields used to define the position of new nodes.
      */
     $positionKeys = array('Root', 'FirstChild', 'LastChild', 'NextSibling', 'PrevSibling');
     $positionKey = new Opus_Model_Field('PositionKey');
     $positionKey->setDefault($positionKeys);
     $this->addField($positionKey);
     $positionId = new Opus_Model_Field('PositionId');
     $this->addField($positionId);
     $pending_nodes = new Opus_Model_Field('PendingNodes');
     $pending_nodes->setMultiplicity('*');
     $this->addField($pending_nodes);
 }
Beispiel #5
0
 /**
  * Initialize model with the following fields:
  * - name
  * - address
  * - city
  * - phone
  * - dnbContactId
  * - is_grantor
  *
  * @return void
  */
 protected function _init()
 {
     $name = new Opus_Model_Field('Name');
     $name->setMandatory(true)->setValidator(new Zend_Validate_NotEmpty());
     $department = new Opus_Model_Field('Department');
     $address = new Opus_Model_Field('Address');
     $city = new Opus_Model_Field('City');
     $city->setMandatory(true)->setValidator(new Zend_Validate_NotEmpty());
     $phone = new Opus_Model_Field('Phone');
     $dnb_contact_id = new Opus_Model_Field('DnbContactId');
     $is_grantor = new Opus_Model_Field('IsGrantor');
     $is_grantor->setCheckbox(true);
     $is_publisher = new Opus_Model_Field('IsPublisher');
     $is_publisher->setCheckbox(true);
     $this->addField($name)->addField($department)->addField($address)->addField($city)->addField($phone)->addField($dnb_contact_id)->addField($is_grantor)->addField($is_publisher);
 }
Beispiel #6
0
 /**
  * Initialize model with the following values:
  * - Institute
  * - Role
  * - SortOrder
  *
  * @return void
  */
 protected function _init()
 {
     $modelClass = $this->_modelClass;
     if (is_null($this->getId()) === false) {
         $this->setModel(new $modelClass($this->_primaryTableRow->{$this->_modelKey}));
     }
     $role = new Opus_Model_Field('Role');
     $role->setSelection(true);
     $role->setMandatory(false);
     // TODO change later maybe
     $role->setDefault(array('advisor' => 'advisor', 'author' => 'author', 'contributor' => 'contributor', 'editor' => 'editor', 'referee' => 'referee', 'other' => 'other', 'translator' => 'translator', 'submitter' => 'submitter'));
     $sortOrder = new Opus_Model_Field('SortOrder');
     $allowEmailContact = new Opus_Model_Field('AllowEmailContact');
     $allowEmailContact->setCheckbox(true);
     $this->addField($role)->addField($sortOrder)->addField($allowEmailContact);
 }
Beispiel #7
0
 /**
  * Initialize model.
  * 
  * @return void
  */
 protected function _init()
 {
     // Attributes, which are defined by the database schema.
     $name = new Opus_Model_Field('Name');
     $name->setMandatory(true)->setValidator(new Zend_Validate_NotEmpty());
     $this->addField($name);
     $oaiName = new Opus_Model_Field('OaiName');
     $oaiName->setMandatory(true)->setValidator(new Zend_Validate_NotEmpty());
     $this->addField($oaiName);
     $position = new Opus_Model_Field('Position');
     $this->addField($position);
     // Attributes for defining visibility.
     $visible = new Opus_Model_Field('Visible');
     $visible->setCheckbox(true);
     $this->addField($visible);
     $visibleBrowsingStart = new Opus_Model_Field('VisibleBrowsingStart');
     $visibleBrowsingStart->setCheckbox(true);
     $this->addField($visibleBrowsingStart);
     $visibleFrontdoor = new Opus_Model_Field('VisibleFrontdoor');
     $visibleFrontdoor->setCheckbox(true);
     $this->addField($visibleFrontdoor);
     $visibleOai = new Opus_Model_Field('VisibleOai');
     $visibleOai->setCheckbox(true);
     $this->addField($visibleOai);
     // Attributes for defining output formats.
     $displayBrowsing = new Opus_Model_Field('DisplayBrowsing');
     $this->addField($displayBrowsing);
     $displayFrontdoor = new Opus_Model_Field('DisplayFrontdoor');
     $this->addField($displayFrontdoor);
     // Field to be removed.  See ticket OPUSVIER-2155.
     $displayOai = new Opus_Model_Field('DisplayOai');
     $this->addField($displayOai);
     // Virtual attributes, which depend on other tables.
     $rootCollection = new Opus_Model_Field('RootCollection');
     $this->addField($rootCollection);
 }