Ejemplo n.º 1
0
 public void RemoveVersion(FoxmlDatastreamVersion version)
 {
     if (versionsList.Contains(version))
     {
         versionsList.Remove(version);
     }
 }
Ejemplo n.º 2
0
 public void AddVersion(FoxmlDatastreamVersion version)
 {
     if (!versionsList.Contains(version))
     {
         versionsList.Add(version);
     }
 }
Ejemplo n.º 3
0
        private void DoTheFOXML(ObjDigital obj)
        {
            var title = obj.titulo;

            // Construir os headers
            foxml            = new FoxmlDigitalObject("1.1", this.pid);
            foxml.properties = new FoxmlObjectProperties();
            foxml.properties.AddProperty(new FoxmlProperty("info:fedora/fedora-system:def/model#state", "A"));
            foxml.properties.AddProperty(new FoxmlProperty("info:fedora/fedora-system:def/model#label", title));

            // Add the DC datastream
            DublinCoreExporter dcXml;
            MetsExporter       metsXml;

            if (obj.GetType() == typeof(ObjDigSimples))
            {
                ObjDigSimples objSimples = obj as ObjDigSimples;
                metsXml = new MetsExporter(objSimples, userName, new string[] { "Ingestão do documento " + this.pid });
                dcXml   = new DublinCoreExporter(obj as ObjDigSimples);
            }
            else
            {
                ObjDigComposto objComposto = obj as ObjDigComposto;
                metsXml = new MetsExporter(objComposto, userName, new string[] { "Ingestão do documento " + this.pid });
                dcXml   = new DublinCoreExporter(obj as ObjDigComposto);
            }

            FoxmlDatastream        dcStream  = new FoxmlDatastream("DC", FoxmlDatastreamState.Active, FoxmlControlGroup.InlineXML, true);
            FoxmlDatastreamVersion dcStream1 = new FoxmlDatastreamVersion("DC.0", "http://www.openarchives.org/OAI/2.0/oai_dc/", "text/xml", "Metadados em Dublin Core", null, null);

            dcStream1.inlineXML     = dcXml.DublinCore;
            dcStream1.contentDigest = new FoxmlContentDigest(FoxmlChecksumTypes.DEFAULT, null);
            dcStream.AddVersion(dcStream1);
            foxml.AddDatastream(dcStream);

            // Add the RELS-EXT datastream
            FoxmlDatastream        relsStream  = new FoxmlDatastream("RELS-EXT", FoxmlDatastreamState.Active, FoxmlControlGroup.InlineXML, true);
            FoxmlDatastreamVersion relsStream1 = new FoxmlDatastreamVersion("RELS-EXT.0", "info:fedora/fedora-system:FedoraRELSExt-1.0", "application/rdf+xml", "RDF Statements about this object", null, null);

            relsStream1.inlineXML = GetRdf(this.pid, this.nmspace);
            relsStream.AddVersion(relsStream1);
            foxml.AddDatastream(relsStream);

            // Add the METS datastream for this document
            FoxmlDatastream        metsStream  = new FoxmlDatastream("METS", FoxmlDatastreamState.Active, FoxmlControlGroup.InlineXML, true);
            FoxmlDatastreamVersion metsStream1 = new FoxmlDatastreamVersion("METS.0", "http://www.loc.gov/METS/", "text/xml", "Metadados adicionais em METS", null, null);

            metsStream1.inlineXML     = metsXml.METS;
            metsStream1.contentDigest = new FoxmlContentDigest(FoxmlChecksumTypes.DEFAULT, null);
            metsStream.AddVersion(metsStream1);
            foxml.AddDatastream(metsStream);

            // Add the content datastreams
            FoxmlDatastream        datastream;
            FoxmlDatastreamVersion dsversion;

            if (obj.GetType() == typeof(ObjDigSimples))
            {
                int           cnt        = 1;
                ObjDigSimples objSimples = obj as ObjDigSimples;

                foreach (Anexo s in objSimples.fich_associados)
                {
                    string uName = s.dataStreamID;
                    datastream = new FoxmlDatastream(uName, FoxmlDatastreamState.Active, FoxmlControlGroup.ExternallyReferenceContent, true);
                    dsversion  = new FoxmlDatastreamVersion(uName + ".0", null, s.mimeType, null, null, null);
                    dsversion.contentLocation = new FoxmlContentLocation(s.url, "URL");
                    dsversion.contentDigest   = new FoxmlContentDigest(FoxmlChecksumTypes.DEFAULT, null);
                    datastream.AddVersion(dsversion);
                    foxml.AddDatastream(datastream);
                    cnt++;
                }
            }
        }
Ejemplo n.º 4
0
 public void RemoveVersion(FoxmlDatastreamVersion version) {
     if (versionsList.Contains(version))
         versionsList.Remove(version);
 }
Ejemplo n.º 5
0
 public void AddVersion(FoxmlDatastreamVersion version) {
     if (!versionsList.Contains(version))
         versionsList.Add(version);
 }