Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/backup/cc/cc_lib/cc_metadata.php
Go to the documentation of this file.
00001 <?php
00002 // This file is part of Moodle - http://moodle.org/
00003 //
00004 // Moodle is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // Moodle is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00016 
00029 class intended_user_role {
00030     const LEARNER               = 'Learner';
00031     const INSTRUCTOR            = 'Instructor';
00032     const MENTOR                = 'Mentor';
00033 }
00034 
00035 class technical_role {
00036     const AUTHOR                = 'author';
00037     const PUBLISHER             = 'publisher';
00038     const UNKNOWN               = 'unknown';
00039     const INITIATOR             = 'initiator';
00040     const TERMINATOR            = 'terminator';
00041     const VALIDATOR             = 'validator';
00042     const EDITOR                = 'editor';
00043     const GRAPHICAL_DESIGNER    = 'graphical designer';
00044     const TECHNICAL_IMPLEMENTER = 'technical implementer';
00045     const CONTENT_PROVIDER      = 'content provider';
00046     const TECHNICAL_VALIDATOR   = 'technical validator';
00047     const EDUCATION_VALIDATOR   = 'educational validator';
00048     const SCRIPT_WRITER         = 'script writer';
00049     const INSTRUCTIONAL_DESIGNER= 'instructional designer';
00050     const SUBJET_MATTER_EXPERT  = 'subject matter expert';
00051 }
00052 
00053 
00054 class rights_copyright {
00055     const   YES                  = 'yes';
00056     const   NO                   = 'no';
00057 }
00058 
00059 
00060 class rights_cost {
00061     const   YES                  = 'yes';
00062     const   NO                   = 'no';
00063 }
00064 
00065 
00066 // Language identifier (as defined in ISO 639-1, ISO 639-2, and ISO 3166-1)
00067 class language_lom {
00068     const   US_ENGLISH           = 'en-US';
00069     const   GB_ENGLISH           = 'en-GB';
00070     const   AR_SPANISH           = 'es-AR';
00071     const   GR_GREEK             = 'el-GR';
00072 
00073 }
00074 
00075 
00076 
00081 class cc_metadata_manifest implements cc_i_metadata_manifest {
00082 
00083 
00084     public  $arraygeneral   = array();
00085     public  $arraytech      = array();
00086     public  $arrayrights    = array();
00087     public  $arraylifecycle = array();
00088 
00089 
00090     public function add_metadata_general($obj){
00091         if (empty($obj)){
00092             throw new Exception('Medatada Object given is invalid or null!');
00093         }
00094         !is_null($obj->title)? $this->arraygeneral['title']=$obj->title:null;
00095         !is_null($obj->language)? $this->arraygeneral['language']=$obj->language:null;
00096         !is_null($obj->description)? $this->arraygeneral['description']=$obj->description:null;
00097         !is_null($obj->keyword)? $this->arraygeneral['keyword']=$obj->keyword:null;
00098         !is_null($obj->coverage)? $this->arraygeneral['coverage']=$obj->coverage:null;
00099         !is_null($obj->catalog)? $this->arraygeneral['catalog']=$obj->catalog:null;
00100         !is_null($obj->entry)? $this->arraygeneral['entry']=$obj->entry:null;
00101     }
00102 
00103     public function add_metadata_technical($obj){
00104         if (empty($obj)){
00105             throw new Exception('Medatada Object given is invalid or null!');
00106         }
00107         !is_null($obj->format)? $this->arraytech['format']=$obj->format:null;
00108     }
00109 
00110 
00111     public function add_metadata_rights($obj){
00112         if (empty($obj)){
00113             throw new Exception('Medatada Object given is invalid or null!');
00114         }
00115         !is_null($obj->copyright)? $this->arrayrights['copyrightAndOtherRestrictions']=$obj->copyright:null;
00116         !is_null($obj->description)? $this->arrayrights['description']=$obj->description:null;
00117         !is_null($obj->cost)? $this->arrayrights['cost']=$obj->cost:null;
00118 
00119     }
00120 
00121 
00122     public function add_metadata_lifecycle($obj){
00123         if (empty($obj)){
00124             throw new Exception('Medatada Object given is invalid or null!');
00125         }
00126         !is_null($obj->role)? $this->arraylifecycle['role']=$obj->role:null;
00127         !is_null($obj->entity)? $this->arraylifecycle['entity']=$obj->entity:null;
00128         !is_null($obj->date)? $this->arraylifecycle['date']=$obj->date:null;
00129 
00130     }
00131 
00132 }
00133 
00134 
00139 class cc_metadata_lifecycle{
00140 
00141     public $role             = array();
00142     public $entity           = array();
00143     public $date             = array();
00144 
00145     public function set_role($role){
00146         $this->role[] = array($role);
00147     }
00148     public function set_entity($entity){
00149         $this->entity[] = array($entity);
00150     }
00151     public function set_date($date){
00152         $this->date[] = array($date);
00153     }
00154 
00155 
00156 }
00157 
00162 class cc_metadata_rights {
00163 
00164     public $copyright        = array();
00165     public $description      = array();
00166     public $cost             = array();
00167 
00168     public function set_copyright($copy){
00169         $this->copyright[] = array($copy);
00170     }
00171     public function set_description ($des,$language){
00172         $this->description[] = array($language,$des);
00173     }
00174     public function set_cost($cost){
00175         $this->cost[] = array($cost);
00176     }
00177 
00178 }
00179 
00180 
00185 class cc_metadata_technical {
00186 
00187     public  $format         = array();
00188 
00189 
00190     public function set_format($format){
00191         $this->format[] = array($format);
00192     }
00193 
00194 }
00195 
00196 
00201 class cc_metadata_general {
00202 
00203     public  $title          = array();
00204     public  $language       = array();
00205     public  $description    = array();
00206     public  $keyword        = array();
00207     public  $coverage       = array();
00208     public  $catalog        = array();
00209     public  $entry          = array();
00210 
00211 
00212 
00213     public function set_coverage ($coverage,$language){
00214         $this->coverage[] = array($language,$coverage);
00215     }
00216     public function set_description ($description,$language){
00217         $this->description[] = array($language,$description);
00218     }
00219     public function set_keyword ($keyword,$language){
00220         $this->keyword[] = array($language,$keyword);
00221     }
00222     public function set_language ($language){
00223         $this->language[] = array($language);
00224     }
00225     public function set_title ($title,$language){
00226         $this->title[] = array($language,$title);
00227     }
00228     public function set_catalog ($cat){
00229         $this->catalog[] = array($cat);
00230     }
00231     public function set_entry ($entry){
00232         $this->entry[] = array($entry);
00233     }
00234 
00235 
00236 }
 All Data Structures Namespaces Files Functions Variables Enumerations