aboutsummaryrefslogtreecommitdiff
path: root/app/views/oer/oai/listRecords.php
blob: 5abab3732dc15ed5a6709e8e7e3564007ad447b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?= '<?xml version="1.0" encoding="UTF-8"?>' ?>
<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/
  http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
  <responseDate><?= htmlReady($currentDate) ?></responseDate>
  <? if ($set): ?>
  <request verb=<?='"'.$verb.'"' ?> from=<?= '"'.$currentDate.'"' ?> 
    metadataPrefix=<?= '"'.$metadataPrefix.'"' ?> set=<?= '"'.$set.'"' ?>> 
    <?= htmlReady($request_url) ?>
  </request>
  <? else: ?>
  <request verb=<?='"'.$verb.'"' ?> from=<?= '"'.$currentDate.'"' ?> 
    identifier=<?= '"'.$metadataPrefix.'"' ?>> 
    <?= htmlReady($request_url) ?>
  </request>
  <? endif ?>
  <ListRecords>
    <? foreach ($records as $key => $targetMaterial) : ?>
    <record> 
    <header>
      <identifier><?=htmlReady($targetMaterial->id)?></identifier> 
      <datestamp><?= gmdate(DATE_ATOM, $targetMaterial->mkdate)?></datestamp>
      <? foreach ($tag_collection[$key] as $tag) : ?>
      <setSpec> <?= htmlReady($tag) ?> </setSpec>
      <? endforeach ?>
      
      
    </header>
    <metadata>
    
    <lom xmlns="http://ltsc.ieee.org/xsd/LOM"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM
      http://ltsc.ieee.org/xsd/lomv1.0/lom.xsd">
    <general>
      <identifier>
      <? foreach ($tag_collection[$key] as $tag) : ?>
      <catalog><?= htmlReady($tag) ?></catalog>
      <? endforeach ?>
   
        <entry><?=htmlReady($targetMaterial->id)?></entry>
      </identifier>
      <title>
        <string language="de"><?= htmlReady($targetMaterial->name) ?></string>
      </title>
      <language>de</language>
      <description>
              <string language="de"><?= htmlReady($targetMaterial->description) ?></string>
      </description>
      <keyword>
      <? foreach ($tag_collection[$key] as $tag) : ?>
      <string language="de"><?= htmlReady($tag) ?></string>
      <? endforeach ?>
      </keyword>
      
    </general>

    <lifeCycle>
      <version>
        <string language="de">1.0</string>
      </version>
      <contribute>
        <role>
          <source>LOMv1.0</source>
          <value>Author</value>
        </role>
        <entity>
          <?= htmlReady($vcards[$key]) ?>
        </entity>
        <date>
          <dateTime><?= gmdate(DATE_ATOM, $targetMaterial->chdate) ?></dateTime>
        </date>
      </contribute>
    </lifeCycle>

    <technical>
      <format><?= htmlReady($targetMaterial->content_type) ?></format>
      <location><?= $controller->url_for("market/download/".$targetMaterial->id) ?></location>
    </technical>

    <educational>
      <learningResourceType>
        <source>LREv3.0</source>
        <value><?= htmlReady($targetMaterial->content_type) ?></value>
      </learningResourceType>
    </educational>

    <rights>
      <copyrightAndOtherRestrictions>
        <source>LOMv1.0</source>
        <value>yes</value>
      </copyrightAndOtherRestrictions>
      <description>
        <string language="xt-lic"><?= htmlReady($targetMaterial->license) ?></string>
      </description>
    </rights>

  </lom>
  </metadata>
  </record>
    <? endforeach ?>
   
 </ListRecords>
</OAI-PMH>