コード例 #1
0
        internal override void Add_MODS(TextWriter results)
        {
            if (titleInfo.Title.Length == 0)
            {
                return;
            }

            results.Write("<mods:subject");
            base.Add_ID(results);
            if (!String.IsNullOrEmpty(language))
            {
                results.Write(" lang=\"" + language + "\"");
            }
            if (!String.IsNullOrEmpty(authority))
            {
                results.Write(" authority=\"" + authority + "\"");
            }
            results.Write(">\r\n");

            titleInfo.Add_MODS(results);

            base.Add_Base_MODS(results);

            results.Write("</mods:subject>\r\n");
        }
コード例 #2
0
        internal void Add_MODS(TextWriter Results)
        {
            if (((title != null) && (title.Title.Length > 0)) || ((identifiers != null) && (identifiers.Count > 0)) ||
                (!String.IsNullOrEmpty(sobekcm_id)) || (!String.IsNullOrEmpty(url)) ||
                (!String.IsNullOrEmpty(publisher)) || ((notes != null) && (notes.Count > 0)) ||
                ((names != null) && (names.Count > 0)))
            {
                // Start this related item
                Results.Write("<mods:relatedItem");
                Add_ID(Results);
                switch (Relationship)
                {
                case Related_Item_Type_Enum.Host:
                    Results.Write(" type=\"host\"");
                    break;

                case Related_Item_Type_Enum.OtherFormat:
                    Results.Write(" type=\"otherFormat\"");
                    break;

                case Related_Item_Type_Enum.OtherVersion:
                    Results.Write(" type=\"otherVersion\"");
                    break;

                case Related_Item_Type_Enum.Preceding:
                    Results.Write(" type=\"preceding\"");
                    break;

                case Related_Item_Type_Enum.Succeeding:
                    Results.Write(" type=\"succeeding\"");
                    break;
                }
                Results.WriteLine(">");

                // Write all the identifiers
                if (identifiers != null)
                {
                    foreach (Identifier_Info thisIdentifier in identifiers)
                    {
                        thisIdentifier.Add_MODS(Results);
                    }
                }

                // Add the location information
                if (!String.IsNullOrEmpty(url))
                {
                    Results.Write("<mods:location>\r\n");
                    Results.Write("<mods:url");
                    if (!String.IsNullOrEmpty(displayLabel))
                    {
                        Results.Write(" displayLabel=\"" + Convert_String_To_XML_Safe(displayLabel) + "\"");
                    }
                    Results.Write(">" + Convert_String_To_XML_Safe(url) + "</mods:url>\r\n");
                    Results.Write("</mods:location>\r\n");
                }

                // Add the list of names
                if (names != null)
                {
                    foreach (Name_Info thisName in names)
                    {
                        thisName.Add_MODS(false, Results);
                    }
                }

                // Add the list of notes
                if (notes != null)
                {
                    foreach (Note_Info thisNote in notes)
                    {
                        thisNote.Add_MODS(Results);
                    }
                }

                // Add the publisher name, if that exists
                if ((!String.IsNullOrEmpty(publisher)) || (!String.IsNullOrEmpty(start_date)) || (!String.IsNullOrEmpty(end_date)))
                {
                    Results.Write("<mods:Origin_Info>\r\n");
                    if (!String.IsNullOrEmpty(publisher))
                    {
                        Results.Write("<mods:publisher>" + Convert_String_To_XML_Safe(publisher) + "</mods:publisher>\r\n");
                    }
                    if (!String.IsNullOrEmpty(start_date))
                    {
                        Results.Write("<mods:dateIssued point=\"start\">" + Convert_String_To_XML_Safe(start_date) + "</mods:dateIssued>\r\n");
                    }
                    if (!String.IsNullOrEmpty(end_date))
                    {
                        Results.Write("<mods:dateIssued point=\"end\">" + Convert_String_To_XML_Safe(end_date) + "</mods:dateIssued>\r\n");
                    }
                    Results.Write("</mods:Origin_Info>\r\n");
                }

                // Add the UFDC ID, if it exists
                if (!String.IsNullOrEmpty(sobekcm_id))
                {
                    Results.WriteLine("<mods:recordInfo>");
                    Results.WriteLine("<mods:recordIdentifier source=\"ufdc\">" + sobekcm_id + "</mods:recordIdentifier>");
                    Results.WriteLine("</mods:recordInfo>");
                }


                // Write the title
                if ((title != null) && (title.Title.Length > 0))
                {
                    title.Add_MODS(Results);
                }

                // End this related item
                Results.WriteLine("</mods:relatedItem>");
            }
        }