2007-10-11 17:06:08 +00:00
|
|
|
require "functions.pl";
|
2007-10-10 21:48:12 +00:00
|
|
|
|
|
|
|
#create or resume session
|
2008-04-15 18:56:13 +00:00
|
|
|
CGI::Session->name($config->{"page_cookie_name"});
|
2007-10-29 16:47:16 +00:00
|
|
|
$query = new CGI;
|
2007-12-17 22:52:36 +00:00
|
|
|
$session = new CGI::Session;
|
2007-10-10 21:48:12 +00:00
|
|
|
|
2007-10-29 15:00:40 +00:00
|
|
|
@userinfo = get_userinfo_from_sid($session->id);
|
2007-10-10 21:48:12 +00:00
|
|
|
|
2008-04-27 21:18:29 +00:00
|
|
|
my $doc = XML::LibXML::Document->new( "1.0", "UTF-8" );
|
|
|
|
|
|
|
|
my $page = get_page_array(@userinfo);
|
|
|
|
|
2008-04-30 09:57:24 +00:00
|
|
|
$page->setNamespace( $config->{"xml_namespace_xforms"}, "xforms", 0);
|
|
|
|
$page->setNamespace( $config->{"xml_namespace_xsd"}, "xsd", 0);
|
|
|
|
$page->setNamespace( $config->{"xml_namespace_xsi"}, "xsi", 0);
|
|
|
|
$page->setNamespace( $config->{"xml_namespace_dcterms"}, "dcterms", 0 );
|
2008-04-27 21:18:29 +00:00
|
|
|
|
|
|
|
my $instance = XML::LibXML::Element->new( "instance" );
|
2008-04-30 09:57:24 +00:00
|
|
|
$instance->setNamespace( $config->{"xml_namespace_xforms"}, "xforms");
|
2008-04-27 21:18:29 +00:00
|
|
|
|
|
|
|
my $video = XML::LibXML::Element->new( "video" );
|
|
|
|
|
2008-04-30 09:57:24 +00:00
|
|
|
sub getElementDC
|
|
|
|
{
|
|
|
|
my $node = XML::LibXML::Element->new( shift );
|
|
|
|
$node->setNamespace( $config->{"xml_namespace_dcterms"}, "dcterms" );
|
|
|
|
$node->setNamespace( $config->{"xml_namespace_xsi"}, "xsi", 0 );
|
|
|
|
$node->setAttributeNS( $config->{"xml_namespace_xsi"}, "type", shift );
|
|
|
|
return $node;
|
|
|
|
}
|
|
|
|
|
2008-05-02 07:38:43 +00:00
|
|
|
$video->appendChild( getElementDC( "title", "xsd:normalizedString") );
|
2008-04-30 09:57:24 +00:00
|
|
|
$video->appendChild( getElementDC( "alternative", "xsd:normalizedString") );
|
2008-05-02 07:38:43 +00:00
|
|
|
$video->appendChild( getElementDC( "abstract", "xsd:string") );
|
|
|
|
$video->appendChild( getElementDC( "spatial", "xsd:normalizedString") );
|
|
|
|
$video->appendChild( getElementDC( "subject", "xsd:normalizedString") );
|
|
|
|
$video->appendChild( getElementDC( "temporal", "xsd:date") );
|
|
|
|
$video->appendChild( getElementDC( "language", "xsd:language") );
|
|
|
|
|
|
|
|
$video->appendChild( getElementDC( "creator", "xsd:normalizedString") );
|
2008-04-30 09:57:24 +00:00
|
|
|
$video->appendChild( getElementDC( "contributor", "xsd:normalizedString") );
|
|
|
|
$video->appendChild( getElementDC( "created", "xsd:date") );
|
2008-05-02 07:38:43 +00:00
|
|
|
|
2008-04-30 09:57:24 +00:00
|
|
|
$video->appendChild( getElementDC( "hasFormat", "xsd:normalizedString") );
|
|
|
|
$video->appendChild( getElementDC( "hasPart", "xsd:normalizedString") );
|
|
|
|
$video->appendChild( getElementDC( "isFormatOf", "xsd:normalizedString") );
|
|
|
|
$video->appendChild( getElementDC( "isPartOf", "xsd:normalizedString") );
|
|
|
|
$video->appendChild( getElementDC( "references", "xsd:normalizedString") );
|
|
|
|
$video->appendChild( getElementDC( "replaces", "xsd:normalizedString") );
|
2008-05-02 07:38:43 +00:00
|
|
|
|
2008-04-30 09:57:24 +00:00
|
|
|
$video->appendChild( getElementDC( "rightsHolder", "xsd:normalizedString") );
|
|
|
|
$video->appendChild( getElementDC( "source", "xsd:normalizedString") );
|
2008-05-02 07:38:43 +00:00
|
|
|
$video->appendChild( getElementDC( "license", "xsd:normalizedString") );
|
2008-05-11 03:09:53 +00:00
|
|
|
|
2008-05-11 16:30:59 +00:00
|
|
|
$node = XML::LibXML::Element->new( "data" );
|
|
|
|
$node->setNamespace( $config->{"xml_namespace_xsi"}, "xsi", 0 );
|
|
|
|
$node->setAttributeNS( $config->{"xml_namespace_xsi"}, "type", "xsd:base64Binary" );
|
|
|
|
$video->appendChild( $node );
|
2008-04-29 14:07:28 +00:00
|
|
|
|
2008-04-27 21:18:29 +00:00
|
|
|
$instance->appendChild($video);
|
|
|
|
|
|
|
|
$page->appendChild($instance);
|
|
|
|
|
|
|
|
$doc->setDocumentElement($page);
|
|
|
|
|
|
|
|
output_page($doc);
|