/// <summary> Saves the data stored in this instance of the
        /// element to the provided bibliographic object </summary>
        /// <param name="Bib"> Object into which to save this element's data </param>
        public override void Save_To_Bib(SobekCM_Item Bib)
        {
            if (base.thisBox.Text.Trim().Length > 0)
            {
                Thesis_Dissertation_Info thesisInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                if (thesisInfo == null)
                {
                    thesisInfo = new Thesis_Dissertation_Info();
                    Bib.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
                }

                try
                {
                    thesisInfo.Graduation_Date = Convert.ToDateTime(base.thisBox.Text.Trim());
                }
                catch
                {
                }
            }
            else
            {
                Thesis_Dissertation_Info thesisInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                if (thesisInfo != null)
                {
                    thesisInfo.Graduation_Date = null;
                }
            }
        }
        /// <summary> Saves the data rendered by this element to the provided bibliographic object during postback </summary>
        /// <param name="Bib"> Object into which to save the user's data, entered into the html rendered by this element </param>
        public override void Save_To_Bib(SobekCM_Item Bib)
        {
            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            foreach (string thisKey in getKeys)
            {
                if (thisKey.IndexOf(html_element_name.Replace("_", "")) == 0)
                {
                    Thesis_Dissertation_Info etdInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

                    string value = HttpContext.Current.Request.Form[thisKey];
                    if (value.Length > 0)
                    {
                        if (etdInfo == null)
                        {
                            etdInfo = new Thesis_Dissertation_Info();
                            Bib.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, etdInfo);
                        }
                        etdInfo.Committee_Co_Chair = value;
                    }
                    else
                    {
                        if (etdInfo != null)
                        {
                            etdInfo.Committee_Co_Chair = String.Empty;
                        }
                    }
                    return;
                }
            }
        }
        /// <summary> Saves the constants to the bib id </summary>
        /// <param name="Bib"> Object into which to save this element's constant data </param>
        public override void Save_Constant_To_Bib(SobekCM_Item Bib)
        {
            if ((DefaultValues != null) && (DefaultValues.Count > 0))
            {
                Thesis_Dissertation_Info etdInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                if (etdInfo == null)
                {
                    etdInfo = new Thesis_Dissertation_Info();
                    Bib.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, etdInfo);
                }
                switch (DefaultValues[0].ToLower())
                {
                case "bachelors":
                    etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors;
                    break;

                case "doctorate":
                    etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate;
                    break;

                case "masters":
                    etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters;
                    break;

                case "post-doctoratee":
                    etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.PostDoctorate;
                    break;

                default:
                    etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Unknown;
                    break;
                }
            }
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                Acronym = "Enter the discipline(s) for this thesis/dissertation";
            }

            // Is there an ETD object?
            Thesis_Dissertation_Info etdInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            if ((etdInfo == null) || (etdInfo.Degree_Disciplines_Count == 0))
            {
                render_helper(Output, String.Empty, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
            }
            else
            {
                if (etdInfo.Degree_Disciplines_Count == 1)
                {
                    render_helper(Output, etdInfo.Degree_Disciplines[0], Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
                }
                else
                {
                    render_helper(Output, etdInfo.Degree_Disciplines, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
                }
            }
        }
        /// <summary> Saves the data stored in this instance of the
        /// element to the provided bibliographic object </summary>
        /// <param name="Bib"> Object into which to save this element's data </param>
        public override void Save_To_Bib(SobekCM_Item Bib)
        {
            string level = base.thisBox.Text.Trim();

            if (level.Length > 0)
            {
                Thesis_Dissertation_Info thesisInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                if (thesisInfo == null)
                {
                    thesisInfo = new Thesis_Dissertation_Info();
                    Bib.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
                }

                switch (level)
                {
                case "Masters":
                    thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters;
                    break;

                case "Doctorate":
                    thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate;
                    break;
                }
            }
        }
Exemplo n.º 6
0
		/// <summary> Flag indicates if this active reader/writer needs to append schema reference information
		/// to the METS XML header by analyzing the contents of the digital resource item </summary>
		/// <param name="METS_Item"> Package with all the metadata to save</param>
		/// <returns> TRUE if the schema should be attached, otherwise fALSE </returns>
		public bool Schema_Reference_Required_Package(SobekCM_Item METS_Item)
		{
			Thesis_Dissertation_Info thesisInfo = METS_Item.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
			if (thesisInfo == null)
				return false;

			return thesisInfo.hasData;
		}
Exemplo n.º 7
0
		/// <summary> Flag indicates if this active reader/writer will write a dmdSec </summary>
		/// <param name="METS_Item"> Package with all the metadata to save</param>
		/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
		/// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
		public bool Include_dmdSec(SobekCM_Item METS_Item, Dictionary<string, object> Options)
		{
			// Ensure this metadata module extension exists and has data
			Thesis_Dissertation_Info thesisInfo = METS_Item.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
			if ((thesisInfo == null) || (!thesisInfo.hasData))
				return false;
			return true;
		}
        /// <summary> Prepares the bib object for the save, by clearing the
        /// existing data in this element's related field. </summary>
        /// <param name="Bib"> Existing Bib object </param>
        public override void Prepare_For_Save(SobekCM_Item Bib)
        {
            Thesis_Dissertation_Info thesisInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            if (thesisInfo != null)
            {
                thesisInfo.Committee_Chair = String.Empty;
            }
        }
        /// <summary> Saves the data stored in this instance of the
        /// element to the provided bibliographic object </summary>
        /// <param name="Bib"> Object to populate this element from </param>
        public override void Populate_From_Bib(SobekCM_Item Bib)
        {
            Thesis_Dissertation_Info thesisInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            if (thesisInfo != null)
            {
                base.thisBox.Text = thesisInfo.Committee_Chair;
            }
        }
        /// <summary> Prepares the bib object for the save, by clearing any existing data in this element's related field(s) </summary>
        /// <param name="Bib"> Existing digital resource object which may already have values for this element's data field(s) </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        public override void Prepare_For_Save(SobekCM_Item Bib, User_Object Current_User)
        {
            Thesis_Dissertation_Info etdInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            if (etdInfo != null)
            {
                etdInfo.Clear_Degree_Disciplines();
            }
        }
Exemplo n.º 11
0
		/// <summary> Writes the dmdSec for the entire package to the text writer </summary>
		/// <param name="Output_Stream">Stream to which the formatted text is written </param>
		/// <param name="METS_Item">Package with all the metadata to save</param>
		/// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
		/// <returns>TRUE if successful, otherwise FALSE </returns>
		public virtual bool Write_dmdSec(TextWriter Output_Stream, SobekCM_Item METS_Item, Dictionary<string, object> Options)
		{
			// Ensure this metadata module extension exists and has data
			Thesis_Dissertation_Info thesisInfo = METS_Item.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
			if ((thesisInfo == null) || (!thesisInfo.hasData))
				return true;
			
	 		Output_Stream.WriteLine("<etd:etd>");
			if (!String.IsNullOrEmpty(thesisInfo.Committee_Chair))
				Output_Stream.WriteLine("<etd:committeeChair>" + Convert_String_To_XML_Safe(thesisInfo.Committee_Chair) + "</etd:committeeChair>");
			if (!String.IsNullOrEmpty(thesisInfo.Committee_Co_Chair))
				Output_Stream.WriteLine("<etd:committeeCoChair>" + Convert_String_To_XML_Safe(thesisInfo.Committee_Co_Chair) + "</etd:committeeCoChair>");
			if (thesisInfo.Committee_Members_Count > 0)
			{
				foreach (string thisCommitteeMember in thesisInfo.Committee_Members)
				{
					Output_Stream.WriteLine("<etd:committeeMember>" + Convert_String_To_XML_Safe(thisCommitteeMember) + "</etd:committeeMember>");
				}
			}
			if (thesisInfo.Graduation_Date.HasValue)
			{
				string encoded_date = thesisInfo.Graduation_Date.Value.Year + "-" + thesisInfo.Graduation_Date.Value.Month.ToString().PadLeft(2, '0') + "-" + thesisInfo.Graduation_Date.Value.Day.ToString().PadLeft(2, '0');
				Output_Stream.WriteLine("<etd:graduationDate>" + encoded_date + "</etd:graduationDate>");
			}
			if (!String.IsNullOrEmpty(thesisInfo.Degree))
				Output_Stream.WriteLine("<etd:degree>" + Convert_String_To_XML_Safe(thesisInfo.Degree) + "</etd:degree>");

			if (thesisInfo.Degree_Disciplines_Count > 0)
			{
				foreach (string thisDiscipline in thesisInfo.Degree_Disciplines)
				{
					Output_Stream.WriteLine("<etd:degreeDiscipline>" + Convert_String_To_XML_Safe(thisDiscipline) + "</etd:degreeDiscipline>");
				}
			}

			if (thesisInfo.Degree_Divisions_Count > 0)
			{
				foreach (string thisDivision in thesisInfo.Degree_Divisions)
				{
					Output_Stream.WriteLine("<etd:degreeDivision>" + Convert_String_To_XML_Safe(thisDivision) + "</etd:degreeDivision>");
				}
			}

			if (!String.IsNullOrEmpty(thesisInfo.Degree_Grantor))
				Output_Stream.WriteLine("<etd:degreeGrantor>" + Convert_String_To_XML_Safe(thesisInfo.Degree_Grantor) + "</etd:degreeGrantor>");
			if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors)
				Output_Stream.WriteLine("<etd:degreeLevel>Bachelors</etd:degreeLevel>");
			if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters)
				Output_Stream.WriteLine("<etd:degreeLevel>Masters</etd:degreeLevel>");
			if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate)
				Output_Stream.WriteLine("<etd:degreeLevel>Doctorate</etd:degreeLevel>");
			if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.PostDoctorate)
				Output_Stream.WriteLine("<etd:degreeLevel>Post-Doctorate</etd:degreeLevel>");
			Output_Stream.WriteLine("</etd:etd>");
			return true;
		}
        /// <summary> Writes the dmdSec for the entire package to the text writer </summary>
        /// <param name="Output_Stream">Stream to which the formatted text is written </param>
        /// <param name="METS_Item">Package with all the metadata to save</param>
        /// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
        /// <returns>TRUE if successful, otherwise FALSE </returns>
        /// <remarks>This utilized the DC writer in the base class and just adds the ETD information </remarks>
        public override bool Write_dmdSec(System.IO.TextWriter Output_Stream, SobekCM_Item METS_Item, Dictionary <string, object> Options)
        {
            // Write the base stuff
            base.Write_dmdSec(Output_Stream, METS_Item, Options);

            // Ensure this metadata module extension exists and has data
            Thesis_Dissertation_Info thesisInfo = METS_Item.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            if ((thesisInfo == null) || (!thesisInfo.hasData))
            {
                return(true);
            }

            // Add the ETD stuff if the ETD metadata module exists
            if (!String.IsNullOrEmpty(thesisInfo.Degree))
            {
                Output_Stream.WriteLine("<thesis.degree.name>" + Convert_String_To_XML_Safe(thesisInfo.Degree) + "</thesis.degree.name>");
            }

            if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors)
            {
                Output_Stream.WriteLine("<thesis.degree.level>Bachelors</thesis.degree.level>");
            }
            if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters)
            {
                Output_Stream.WriteLine("<thesis.degree.level>Masters</thesis.degree.level>");
            }
            if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate)
            {
                Output_Stream.WriteLine("<thesis.degree.level>Doctorate</thesis.degree.level>");
            }
            if (thesisInfo.Degree_Level == Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.PostDoctorate)
            {
                Output_Stream.WriteLine("<thesis.degree.level>Post-Doctorate</thesis.degree.level>");
            }

            if (thesisInfo.Degree_Disciplines_Count > 0)
            {
                foreach (string thisDiscipline in thesisInfo.Degree_Disciplines)
                {
                    Output_Stream.WriteLine("<thesis.degree.discipline>" + Convert_String_To_XML_Safe(thisDiscipline) + "</thesis.degree.discipline>");
                }
            }


            if (!String.IsNullOrEmpty(thesisInfo.Degree_Grantor))
            {
                Output_Stream.WriteLine("<thesis.degree.grantor>" + Convert_String_To_XML_Safe(thesisInfo.Degree_Grantor) + "</thesis.degree.grantor>");
            }



            return(true);
        }
        /// <summary> Saves the data stored in this instance of the
        /// element to the provided bibliographic object </summary>
        /// <param name="Bib"> Object to populate this element from </param>
        public override void Populate_From_Bib(SobekCM_Item Bib)
        {
            Thesis_Dissertation_Info thesisInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            if (thesisInfo != null)
            {
                if (thesisInfo.Graduation_Date.HasValue)
                {
                    base.thisBox.Text = thesisInfo.Graduation_Date.Value.ToShortDateString();
                }
            }
        }
Exemplo n.º 14
0
 /// <summary> Saves the constants to the bib id </summary>
 /// <param name="Bib"> Object into which to save this element's constant data </param>
 public override void Save_Constant_To_Bib(SobekCM_Item Bib)
 {
     if ((DefaultValues != null) && (DefaultValues.Count > 0))
     {
         Thesis_Dissertation_Info etdInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
         if (etdInfo == null)
         {
             etdInfo = new Thesis_Dissertation_Info();
             Bib.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, etdInfo);
         }
         etdInfo.Degree_Grantor = DefaultValues[0];
     }
 }
Exemplo n.º 15
0
        /// <summary> Saves the data rendered by this element to the provided bibliographic object during postback </summary>
        /// <param name="Bib"> Object into which to save the user's data, entered into the html rendered by this element </param>
        public override void Save_To_Bib(SobekCM_Item Bib)
        {
            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            foreach (string thisKey in getKeys)
            {
                if (thisKey.IndexOf(html_element_name.Replace("_", "")) == 0)
                {
                    Thesis_Dissertation_Info etdInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

                    string value = HttpContext.Current.Request.Form[thisKey].Trim().ToLower();
                    if (value.Length > 0)
                    {
                        if (etdInfo == null)
                        {
                            etdInfo = new Thesis_Dissertation_Info();
                            Bib.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, etdInfo);
                        }
                        switch (value)
                        {
                        case "bachelors":
                            etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors;
                            break;

                        case "doctorate":
                            etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate;
                            break;

                        case "masters":
                            etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters;
                            break;

                        case "post-doctoratee":
                            etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.PostDoctorate;
                            break;

                        default:
                            etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Unknown;
                            break;
                        }
                    }
                    else
                    {
                        if (etdInfo != null)
                        {
                            etdInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Unknown;
                        }
                    }
                    return;
                }
            }
        }
        /// <summary> Saves the data stored in this instance of the
        /// element to the provided bibliographic object </summary>
        /// <param name="Bib"> Object into which to save this element's data </param>
        public override void Save_To_Bib(SobekCM_Item Bib)
        {
            if (base.thisBox.Text.Trim().Length > 0)
            {
                Thesis_Dissertation_Info thesisInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                if (thesisInfo == null)
                {
                    thesisInfo = new Thesis_Dissertation_Info();
                    Bib.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
                }

                thesisInfo.Degree_Discipline = base.thisBox.Text.Trim();
            }
        }
        /// <summary> Saves the data stored in this instance of the
        /// element to the provided bibliographic object </summary>
        /// <param name="Bib"> Object to populate this element from </param>
        public override void Populate_From_Bib(SobekCM_Item Bib)
        {
            Thesis_Dissertation_Info thesisInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            if (thesisInfo != null)
            {
                switch (thesisInfo.Degree_Level)
                {
                case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate:
                    base.thisBox.Text = "Doctorate";
                    break;

                case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters:
                    base.thisBox.Text = "Masters";
                    break;
                }
            }
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                Acronym = "Enter the name of the committee co-chair for this thesis/dissertation";
            }

            // Is there an ETD object?
            string valueToDisplay            = string.Empty;
            Thesis_Dissertation_Info etdInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            if (etdInfo != null)
            {
                valueToDisplay = etdInfo.Committee_Co_Chair;
            }

            render_helper(Output, valueToDisplay, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
        }
Exemplo n.º 19
0
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                Acronym = "Select the level of this degree";
            }

            // Is there an ETD object?
            string valueToDisplay            = string.Empty;
            Thesis_Dissertation_Info etdInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            if (etdInfo != null)
            {
                switch (etdInfo.Degree_Level)
                {
                case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors:
                    valueToDisplay = "Bachelors";
                    break;

                case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate:
                    valueToDisplay = "Doctorate";
                    break;

                case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters:
                    valueToDisplay = "Masters";
                    break;

                case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.PostDoctorate:
                    valueToDisplay = "Post-Doctorate";
                    break;
                }
            }

            render_helper(Output, valueToDisplay, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
        }
        /// <summary> Map one or more data elements from the original METS-based object to the
        /// BriefItem object </summary>
        /// <param name="Original"> Original METS-based object </param>
        /// <param name="New"> New object to populate some data from the original </param>
        /// <returns> TRUE if successful, FALSE if an exception is encountered </returns>
        public bool MapToBriefItem(SobekCM_Item Original, BriefItemInfo New)
        {
            // Try to get the thesis/dissertation metadata
            Thesis_Dissertation_Info thesisInfo = Original.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;

            // Add the thesis/dissertation data if it exists
            if ((thesisInfo != null) && (thesisInfo.hasData))
            {
                // Add the degree information
                if (!String.IsNullOrEmpty(thesisInfo.Degree))
                {
                    if (thesisInfo.Degree_Level != Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Unknown)
                    {
                        switch (thesisInfo.Degree_Level)
                        {
                        case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors:
                            New.Add_Description("Degree", "Bachelor's ( " + thesisInfo.Degree + ")");
                            break;

                        case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters:
                            New.Add_Description("Degree", "Master's ( " + thesisInfo.Degree + ")");
                            break;

                        case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate:
                            New.Add_Description("Degree", "Doctorate ( " + thesisInfo.Degree + ")");
                            break;

                        case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.PostDoctorate:
                            New.Add_Description("Degree", "Post-Doctorate ( " + thesisInfo.Degree + ")");
                            break;
                        }
                    }
                    else
                    {
                        New.Add_Description("Degree", thesisInfo.Degree);
                    }
                }
                else if (thesisInfo.Degree_Level != Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Unknown)
                {
                    switch (thesisInfo.Degree_Level)
                    {
                    case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors:
                        New.Add_Description("Degree", "Bachelor's");
                        break;

                    case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters:
                        New.Add_Description("Degree", "Master's");
                        break;

                    case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate:
                        New.Add_Description("Degree", "Doctorate");
                        break;

                    case Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.PostDoctorate:
                        New.Add_Description("Degree", "Post-Doctorate");
                        break;
                    }
                }

                // Add the degree grantor
                if (!String.IsNullOrEmpty(thesisInfo.Degree_Grantor))
                {
                    New.Add_Description("Degree Grantor", thesisInfo.Degree_Grantor);
                }

                // Add the degree divisions
                if (thesisInfo.Degree_Divisions_Count > 0)
                {
                    foreach (string thisDivision in thesisInfo.Degree_Divisions)
                    {
                        New.Add_Description("Degree Divisions", thisDivision);
                    }
                }

                // Add the degree disciplines
                if (thesisInfo.Degree_Disciplines_Count > 0)
                {
                    foreach (string thisDiscipline in thesisInfo.Degree_Disciplines)
                    {
                        New.Add_Description("Degree Disciplines", thisDiscipline);
                    }
                }

                // Add the committee chair
                if (!String.IsNullOrEmpty(thesisInfo.Committee_Chair))
                {
                    New.Add_Description("Committee Chair", thesisInfo.Committee_Chair);
                }

                // Add the committee co-chair
                if (!String.IsNullOrEmpty(thesisInfo.Committee_Co_Chair))
                {
                    New.Add_Description("Committee Co-Chair", thesisInfo.Committee_Co_Chair);
                }

                // Add all the committee members
                if (thesisInfo.Committee_Members_Count > 0)
                {
                    foreach (string thisMember in thesisInfo.Committee_Members)
                    {
                        New.Add_Description("Committee Members", thisMember);
                    }
                }
            }

            return(true);
        }
Exemplo n.º 21
0
        /// <summary>  </summary>
        /// <param name="thisElement"></param>
        /// <param name="Bib"></param>
        /// <returns></returns>
        private int Get_Bib_Element_Count(abstract_Element thisElement, SobekCM_Item Bib)
        {
            switch (thisElement.Type)
            {
            case Element_Type.Abstract:
                return(Bib.Bib_Info.Abstracts_Count);

            case Element_Type.Affiliation:
                return(Bib.Bib_Info.Affiliations_Count);

            case Element_Type.Aggregations:
                return(Bib.Behaviors.Aggregation_Count > 0 ? 1 : 0);

            case Element_Type.Attribution:
                return(Bib.Bib_Info.Notes.Count(thisNote => thisNote.Note_Type == Note_Type_Enum.funding));

            case Element_Type.BibID:
                return(1);

            case Element_Type.Classification:
                return(Bib.Bib_Info.Classifications_Count);

            case Element_Type.Contributor:
                int contributor_count = 0;
                if ((Bib.Bib_Info.Main_Entity_Name.hasData) && (Bib.Bib_Info.Main_Entity_Name.Roles.Count > 0) && ((Bib.Bib_Info.Main_Entity_Name.Roles[0].Role.ToUpper() == "CONTRIBUTOR") || (Bib.Bib_Info.Main_Entity_Name.Roles[0].Role.ToUpper() == "CTB")))
                {
                    contributor_count++;
                }
                contributor_count += Bib.Bib_Info.Names.Count(thisName => (thisName.Roles.Count > 0) && ((thisName.Roles[0].Role.ToUpper() == "CONTRIBUTOR") || (thisName.Roles[0].Role.ToUpper() == "CTB")));
                return(contributor_count);

            case Element_Type.Coordinates:
                GeoSpatial_Information geoInfo = Bib.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                if (geoInfo == null)
                {
                    return(0);
                }
                return((geoInfo.Point_Count > 0) || (geoInfo.Polygon_Count > 0) ? 1 : 0);

            case Element_Type.Creator:
                if ((thisElement.Display_SubType != "simple") || (((Creator_Simple_Element)thisElement).Contributor_Exists == false))
                {
                    return(Bib.Bib_Info.Main_Entity_Name.hasData
                                       ? Bib.Bib_Info.Names.Count + 1
                                       : Bib.Bib_Info.Names.Count);
                }

                int non_contributor_count = 0;
                if ((Bib.Bib_Info.Main_Entity_Name.hasData) && ((Bib.Bib_Info.Main_Entity_Name.Roles.Count == 0) || ((Bib.Bib_Info.Main_Entity_Name.Roles[0].Role.ToUpper() != "CONTRIBUTOR") && (Bib.Bib_Info.Main_Entity_Name.Roles[0].Role.ToUpper() != "CTB"))))
                {
                    non_contributor_count++;
                }
                non_contributor_count += Bib.Bib_Info.Names.Count(thisName => (thisName.Roles.Count == 0) || ((thisName.Roles[0].Role.ToUpper() != "CONTRIBUTOR") && (thisName.Roles[0].Role.ToUpper() != "CTB")));
                return(non_contributor_count);

            case Element_Type.CreatorNotes:
                return(Bib.METS_Header.Creator_Individual_Notes_Count > 0 ? 1 : 0);

            case Element_Type.Date:
                return(Bib.Bib_Info.Origin_Info.Date_Issued.Length == 0 ? 0 : 1);

            case Element_Type.DateCopyrighted:
                return(Bib.Bib_Info.Origin_Info.Date_Copyrighted.Length > 0 ? 1 : 0);

            case Element_Type.DescriptionStandard:
                return(Bib.Bib_Info.Record.Description_Standard.Length > 0 ? 1 : 0);

            case Element_Type.Donor:
                return(Bib.Bib_Info.Donor.Full_Name.Length > 0 ? 1 : 0);

            case Element_Type.Edition:
                return(Bib.Bib_Info.Origin_Info.Edition.Length > 0 ? 1 : 0);

            case Element_Type.EncodingLevel:
                return(Bib.Bib_Info.EncodingLevel.Length > 0 ? 1 : 0);

            case Element_Type.EAD:
                return((Bib.Bib_Info.Location.EAD_URL.Length > 0) || (Bib.Bib_Info.Location.EAD_Name.Length > 0) ? 1 : 0);

            case Element_Type.Error:
                return(0);

            case Element_Type.ETD_CommitteeChair:
                Thesis_Dissertation_Info thesisInfo = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                return((thesisInfo != null) && (thesisInfo.Committee_Chair.Length > 0) ? 1 : 0);

            case Element_Type.ETD_CommitteeCoChair:
                Thesis_Dissertation_Info thesisInfo2 = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                return((thesisInfo2 != null) && (thesisInfo2.Committee_Co_Chair.Length > 0) ? 1 : 0);

            case Element_Type.ETD_CommitteeMember:
                Thesis_Dissertation_Info thesisInfo3 = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                return((thesisInfo3 != null) ? thesisInfo3.Committee_Members_Count : 0);

            case Element_Type.ETD_Degree:
                Thesis_Dissertation_Info thesisInfo4 = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                return((thesisInfo4 != null) && (thesisInfo4.Degree.Length > 0) ? 1 : 0);

            case Element_Type.ETD_DegreeDiscipline:
                Thesis_Dissertation_Info thesisInfo5 = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                return((thesisInfo5 != null) && (thesisInfo5.Degree_Discipline.Length > 0) ? 1 : 0);

            case Element_Type.ETD_DegreeGrantor:
                Thesis_Dissertation_Info thesisInfo6 = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                return((thesisInfo6 != null) && (thesisInfo6.Degree_Grantor.Length > 0) ? 1 : 0);

            case Element_Type.ETD_DegreeLevel:
                Thesis_Dissertation_Info thesisInfo7 = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                return((thesisInfo7 != null) && (thesisInfo7.Degree_Level != Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Unknown) ? 1 : 0);

            case Element_Type.ETD_GraduationDate:
                Thesis_Dissertation_Info thesisInfo8 = Bib.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                return((thesisInfo8 != null) && (thesisInfo8.Graduation_Date.HasValue) ? 1 : 0);

            case Element_Type.FCLA_Flags:
                return(1);

            case Element_Type.FDA_Account:
                DAITSS_Info daitssInfo = Bib.Get_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY) as DAITSS_Info;
                return(daitssInfo != null && daitssInfo.Account.Trim().Length > 0 ? 1 : 0);

            case Element_Type.FDA_SubAccount:
                DAITSS_Info daitssInfo2 = Bib.Get_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY) as DAITSS_Info;
                return(daitssInfo2 != null && daitssInfo2.SubAccount.Trim().Length > 0 ? 1 : 0);

            case Element_Type.FDA_Project:
                DAITSS_Info daitssInfo3 = Bib.Get_Metadata_Module(GlobalVar.DAITSS_METADATA_MODULE_KEY) as DAITSS_Info;
                return(daitssInfo3 != null && daitssInfo3.Project.Trim().Length > 0 ? 1 : 0);

            case Element_Type.Format:
                return(Bib.Bib_Info.Original_Description.Extent.Length > 0 ? 1 : 0);

            case Element_Type.Frequency:
                return(Bib.Bib_Info.Origin_Info.Frequencies_Count);

            case Element_Type.Genre:
                return(Bib.Bib_Info.Genres_Count);

            case Element_Type.Holding:
                return(1);

            case Element_Type.Wordmark:
                return(Bib.Behaviors.Wordmark_Count > 0 ? 1 : 0);

            case Element_Type.Identifier:
                return(Bib.Bib_Info.Identifiers_Count);

            case Element_Type.Language:
                return(Bib.Bib_Info.Languages.Count(thisLanguage => thisLanguage.Language_Text.Length > 0));

            case Element_Type.MainThumbnail:
                return(Bib.Behaviors.Main_Thumbnail.Length > 0 ? 1 : 0);

            case Element_Type.Manufacturer:
                return(Bib.Bib_Info.Manufacturers_Count);

            case Element_Type.Note:
                return(Bib.Bib_Info.Notes.Count(thisNote => thisNote.Note_Type != Note_Type_Enum.statement_of_responsibility));

            case Element_Type.OtherURL:
                return((Bib.Bib_Info.Location.Other_URL.Length > 0) || (Bib.Bib_Info.Location.Other_URL_Note.Length > 0) ? 1 : 0);

            case Element_Type.PALMM_Code:
                return(1);

            case Element_Type.Publisher:
                return(Bib.Bib_Info.Publishers_Count);

            case Element_Type.Publication_Place:
                if (Bib.Bib_Info.Publishers_Count > 0)
                {
                    if (Bib.Bib_Info.Publishers.SelectMany(thisName => thisName.Places).Any(thisPlace => thisPlace.Place_Text.Length > 0))
                    {
                        return(1);
                    }
                }
                return(0);

            case Element_Type.RecordOrigin:
                return(Bib.Bib_Info.Record.Record_Origin.Length > 0 ? 1 : 0);

            case Element_Type.RecordStatus:
                return(1);

            case Element_Type.RelatedItem:
                return(Bib.Bib_Info.RelatedItems_Count);

            case Element_Type.Rights:
                return(Bib.Bib_Info.Access_Condition.Text.Length > 0 ? 1 : 0);

            case Element_Type.Scale:
                if (Bib.Bib_Info.Subjects.Where(thisSubject => thisSubject.Class_Type == Subject_Info_Type.Cartographics).Any(thisSubject => ((Subject_Info_Cartographics)thisSubject).Scale.Length > 0))
                {
                    return(1);
                }
                return(0);

            case Element_Type.SerialHierarchy:
                return(Bib.Behaviors.Serial_Info.Count > 0 ? 1 : 0);

            case Element_Type.Source_Institution:
                return(1);

            case Element_Type.Source_Note:
                return(Bib.Bib_Info.Notes.Count(thisNote => thisNote.Note_Type == Note_Type_Enum.source));

            case Element_Type.Spatial:
                int hierSubjectCount = 0;
                if (thisElement.Display_SubType == "dublincore")
                {
                    foreach (Subject_Info thisSubject in Bib.Bib_Info.Subjects)
                    {
                        if (thisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial)
                        {
                            hierSubjectCount++;
                        }
                        else if (thisSubject.Class_Type == Subject_Info_Type.Standard)
                        {
                            Subject_Info_Standard standSubject = (Subject_Info_Standard)thisSubject;
                            if ((standSubject.Genres_Count == 0) && (standSubject.Occupations_Count == 0) && (standSubject.Topics_Count == 0))
                            {
                                hierSubjectCount++;
                            }
                        }
                    }
                }
                else
                {
                    hierSubjectCount += Bib.Bib_Info.Subjects.Count(thisSubject => thisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial);
                }

                return(hierSubjectCount);

            case Element_Type.Structure_Map:
                return(1);

            case Element_Type.Subject:
                bool standard = true;
                if ((thisElement.Display_SubType == "simple") || (thisElement.Display_SubType == "dublincore"))
                {
                    if (((Subject_Simple_Element)thisElement).Seperate_Dublin_Core_Spatial_Exists)
                    {
                        standard = false;
                    }
                }
                int subjectCount = 0;
                if (standard)
                {
                    subjectCount += Bib.Bib_Info.Subjects.Count(thisSubject => (thisSubject.Class_Type == Subject_Info_Type.Standard) || (thisSubject.Class_Type == Subject_Info_Type.TitleInfo) || (thisSubject.Class_Type == Subject_Info_Type.Name));
                }
                else
                {
                    foreach (Subject_Info thisSubject in Bib.Bib_Info.Subjects)
                    {
                        switch (thisSubject.Class_Type)
                        {
                        case Subject_Info_Type.TitleInfo:
                            subjectCount++;
                            break;

                        case Subject_Info_Type.Name:
                            subjectCount++;
                            break;

                        case Subject_Info_Type.Standard:
                            Subject_Info_Standard standSubject = (Subject_Info_Standard)thisSubject;
                            if ((standSubject.Topics_Count > 0) || (standSubject.Occupations_Count > 0) || (standSubject.Genres_Count > 0))
                            {
                                subjectCount++;
                            }
                            break;
                        }
                    }
                }
                return(subjectCount);

            case Element_Type.TargetAudience:
                return(Bib.Bib_Info.Target_Audiences.Any(thisTarget => thisTarget.Authority != "marctarget") ? 1 : 0);

            case Element_Type.Temporal:
                return(Bib.Bib_Info.TemporalSubjects_Count);

            case Element_Type.Title:
                return(1);

            case Element_Type.Title_Other:
                int title_count = 0;
                if (Bib.Bib_Info.Main_Title.Subtitle.Length > 0)
                {
                    title_count++;
                }

                if ((Bib.Bib_Info.hasSeriesTitle) && (Bib.Bib_Info.SeriesTitle.Title.Length > 0))
                {
                    title_count++;
                }

                if (Bib.Bib_Info.Other_Titles_Count > 0)
                {
                    title_count += Bib.Bib_Info.Other_Titles.Count(thisTitle => thisTitle.Title.Length > 0);
                }
                return(title_count);

            case Element_Type.Type:
                return(1);

            case Element_Type.VID:
                return(1);

            case Element_Type.Viewer:
                return(Bib.Behaviors.Views_Count);

            case Element_Type.VRA_CulturalContext:
                VRACore_Info vraInfo = Bib.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;
                return(vraInfo != null ? vraInfo.Cultural_Context_Count : 0);

            case Element_Type.VRA_Inscription:
                VRACore_Info vraInfo2 = Bib.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;
                return(vraInfo2 != null ? vraInfo2.Inscription_Count : 0);

            case Element_Type.VRA_Material:
                VRACore_Info vraInfo3 = Bib.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;
                return(vraInfo3 != null ? vraInfo3.Material_Count : 0);

            case Element_Type.VRA_Measurement:
                VRACore_Info vraInfo4 = Bib.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;
                return(vraInfo4 != null ? vraInfo4.Measurement_Count : 0);

            case Element_Type.VRA_StateEdition:
                VRACore_Info vraInfo5 = Bib.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;
                return(vraInfo5 != null ? vraInfo5.State_Edition_Count : 0);

            case Element_Type.VRA_StylePeriod:
                VRACore_Info vraInfo6 = Bib.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;
                return(vraInfo6 != null ? vraInfo6.Style_Period_Count : 0);

            case Element_Type.VRA_Technique:
                VRACore_Info vraInfo7 = Bib.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;
                return(vraInfo7 != null ? vraInfo7.Technique_Count : 0);

            case Element_Type.Web_Skin:
                return(Bib.Behaviors.Web_Skin_Count > 0 ? 1 : 0);

            case Element_Type.ZT_Class:
                Zoological_Taxonomy_Info darwinCoreInfo = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo != null && darwinCoreInfo.Class.Length > 0  ? 1 : 0);

            case Element_Type.ZT_CommonName:
                Zoological_Taxonomy_Info darwinCoreInfo2 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo2 != null && darwinCoreInfo2.Common_Name.Length > 0  ? 1 : 0);

            case Element_Type.ZT_Family:
                Zoological_Taxonomy_Info darwinCoreInfo3 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo3 != null && darwinCoreInfo3.Family.Length > 0  ? 1 : 0);

            case Element_Type.ZT_Genus:
                Zoological_Taxonomy_Info darwinCoreInfo4 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo4 != null && darwinCoreInfo4.Genus.Length > 0  ? 1 : 0);

            case Element_Type.ZT_HigherClassification:
                Zoological_Taxonomy_Info darwinCoreInfo5 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo5 != null && darwinCoreInfo5.Higher_Classification.Length > 0  ? 1 : 0);

            case Element_Type.ZT_Kingdom:
                Zoological_Taxonomy_Info darwinCoreInfo6 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo6 != null && darwinCoreInfo6.Kingdom.Length > 0  ? 1 : 0);

            case Element_Type.ZT_Order:
                Zoological_Taxonomy_Info darwinCoreInfo7 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo7 != null && darwinCoreInfo7.Order.Length > 0  ? 1 : 0);

            case Element_Type.ZT_Phylum:
                Zoological_Taxonomy_Info darwinCoreInfo8 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo8 != null && darwinCoreInfo8.Phylum.Length > 0  ? 1 : 0);

            case Element_Type.ZT_ScientificName:
                Zoological_Taxonomy_Info darwinCoreInfo9 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo9 != null && darwinCoreInfo9.Scientific_Name.Length > 0  ? 1 : 0);

            case Element_Type.ZT_SpecificEpithet:
                Zoological_Taxonomy_Info darwinCoreInfo10 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo10 != null && darwinCoreInfo10.Specific_Epithet.Length > 0  ? 1 : 0);

            case Element_Type.ZT_TaxonRank:
                Zoological_Taxonomy_Info darwinCoreInfo11 = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
                return(darwinCoreInfo11 != null && darwinCoreInfo11.Taxonomic_Rank.Length > 0  ? 1 : 0);

            default:
                return(0);
            }
        }
Exemplo n.º 22
0
		/// <summary> Reads the dmdSec at the current position in the XmlTextReader and associates it with the 
		/// entire package  </summary>
		/// <param name="Input_XmlReader"> Open XmlReader from which to read the metadata </param>
		/// <param name="Return_Package"> Package into which to read the metadata</param>
		/// <param name="Options"> Dictionary of any options which this METS section reader may utilize</param>
		/// <returns> TRUE if successful, otherwise FALSE</returns>
		public bool Read_dmdSec(XmlReader Input_XmlReader, SobekCM_Item Return_Package, Dictionary<string, object> Options)
		{
			// Ensure this metadata module extension exists
			Thesis_Dissertation_Info thesisInfo = Return_Package.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
			if (thesisInfo == null)
			{
				thesisInfo = new Thesis_Dissertation_Info();
				Return_Package.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
			}

			// Loop through reading each XML node
			do
			{
				// If this is the end of this section, return
				if ((Input_XmlReader.NodeType == XmlNodeType.EndElement) && ((Input_XmlReader.Name == "METS:mdWrap") || (Input_XmlReader.Name == "mdWrap")))
					return true;

				// get the right division information based on node type
				if (Input_XmlReader.NodeType == XmlNodeType.Element)
				{
					string name = Input_XmlReader.Name.ToLower();
					if (name.IndexOf("palmm:") == 0)
						name = name.Substring(6);
					if (name.IndexOf("etd:") == 0)
						name = name.Substring(4);

					switch (name)
					{
						case "committeechair":
							Input_XmlReader.Read();
							if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
							{
								thesisInfo.Committee_Chair = Input_XmlReader.Value.Trim();
							}
							break;

						case "committeecochair":
							Input_XmlReader.Read();
							if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
							{
								thesisInfo.Committee_Co_Chair = Input_XmlReader.Value.Trim();
							}
							break;

						case "committeemember":
							Input_XmlReader.Read();
							if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
							{
								thesisInfo.Add_Committee_Member(Input_XmlReader.Value);
							}
							break;

						case "graduationdate":
							Input_XmlReader.Read();
							if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
							{
								DateTime convertedDate;
								if (DateTime.TryParse(Input_XmlReader.Value, out convertedDate))
								{
									thesisInfo.Graduation_Date = convertedDate;
								}
							}
							break;

						case "degree":
							Input_XmlReader.Read();
							if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
							{
								thesisInfo.Degree = Input_XmlReader.Value;
							}
							break;

						case "degreediscipline":
							Input_XmlReader.Read();
							if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
							{
								string degreeDiscipline = Input_XmlReader.Value;
								if (degreeDiscipline.IndexOf(";") > 0)
								{
									string[] splitter = degreeDiscipline.Split(";".ToCharArray());
									foreach (string thisSplit in splitter)
										thesisInfo.Add_Degree_Discipline(thisSplit);
								}
								else
								{
									thesisInfo.Add_Degree_Discipline(degreeDiscipline);
								}
							}
							break;

						case "degreedivision":
							Input_XmlReader.Read();
							if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
							{
								string degreeDivision = Input_XmlReader.Value;
								if (degreeDivision.IndexOf(";") > 0)
								{
									string[] splitter = degreeDivision.Split(";".ToCharArray());
									foreach (string thisSplit in splitter)
										thesisInfo.Add_Degree_Division(thisSplit);
								}
								else
								{
									thesisInfo.Add_Degree_Division(degreeDivision);
								}
							}
							break;


						case "degreegrantor":
							Input_XmlReader.Read();
							if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
							{
								thesisInfo.Degree_Grantor = Input_XmlReader.Value;
							}
							break;

						case "degreelevel":
							Input_XmlReader.Read();
							if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
							{
								string temp = Input_XmlReader.Value.ToLower();
								if ((temp == "doctorate") || (temp == "doctoral"))
									thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate;
								if ((temp == "masters") || (temp == "master's"))
									thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters;
								if ((temp == "bachelors") || ( temp ==  "bachelor's"))
									thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors;
								if ((temp == "post-doctorate") || ( temp ==  "post-doctoral"))
									thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors;

							}
							break;
					}
				}
			} while (Input_XmlReader.Read());

			return true;
		}
        /// <summary> Reads the Dublin Core-compliant section of XML and stores the data in the provided digital resource </summary>
        /// <param name="R"> XmlTextReader from which to read the dublin core data </param>
        /// <param name="BibInfo"> Digital resource object to save the data to </param>
        /// <param name="Return_Package"> The return package, if this is reading a top-level section of dublin core </param>
        public static void Read_Simple_Dublin_Core_Info(XmlReader R, Bibliographic_Info BibInfo, SobekCM_Item Return_Package)
        {
            while (R.Read())
            {
                if ((R.NodeType == XmlNodeType.EndElement) && ((R.Name == "METS:mdWrap") || (R.Name == "mdWrap")))
                {
                    return;
                }

                if (R.NodeType == XmlNodeType.Element)
                {
                    switch (R.Name)
                    {
                    case "dc:contributor":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Add_Named_Entity(R.Value.Trim(), "Contributor");
                        }
                        break;

                    case "dc:coverage":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            Subject_Info_Standard thisSubject = new Subject_Info_Standard();
                            thisSubject.Add_Geographic(R.Value.Trim());
                            BibInfo.Add_Subject(thisSubject);
                        }
                        break;

                    case "dc:creator":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            if (BibInfo.Main_Entity_Name.hasData)
                            {
                                BibInfo.Add_Named_Entity(R.Value.Trim());
                            }
                            else
                            {
                                BibInfo.Main_Entity_Name.Full_Name = R.Value.Trim();
                            }
                        }
                        break;

                    case "dc:date":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Origin_Info.Date_Issued = R.Value.Trim();
                        }
                        break;

                    case "dc:description":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Add_Note(R.Value.Trim());
                        }
                        break;

                    case "dc:format":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Original_Description.Extent = R.Value.Trim();
                        }
                        break;

                    case "dc:identifier":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Add_Identifier(R.Value.Trim());
                        }
                        break;

                    case "dc:language":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Add_Language(R.Value.Trim());
                        }
                        break;

                    case "dc:publisher":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Add_Publisher(R.Value.Trim());
                        }
                        break;

                    case "dc:relation":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            Related_Item_Info newRelatedItem = new Related_Item_Info();
                            newRelatedItem.Main_Title.Title = R.Value.Trim();
                            BibInfo.Add_Related_Item(newRelatedItem);
                        }
                        break;

                    case "dc:rights":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Access_Condition.Text = R.Value.Trim();
                        }
                        break;

                    case "dc:source":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Add_Note(R.Value, Note_Type_Enum.source);
                        }
                        break;

                    case "dc:subject":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            if (R.Value.IndexOf(";") > 0)
                            {
                                string[] splitter = R.Value.Split(";".ToCharArray());
                                foreach (string thisSplit in splitter)
                                {
                                    BibInfo.Add_Subject(thisSplit.Trim(), String.Empty);
                                }
                            }
                            else
                            {
                                BibInfo.Add_Subject(R.Value.Trim(), String.Empty);
                            }
                        }
                        break;

                    case "dc:title":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            if (BibInfo.Main_Title.Title.Length == 0)
                            {
                                BibInfo.Main_Title.Title = R.Value.Trim();
                            }
                            else
                            {
                                BibInfo.Add_Other_Title(R.Value.Trim(), Title_Type_Enum.alternative);
                            }
                        }
                        break;

                    case "dc:type":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0))
                        {
                            BibInfo.Type.Add_Uncontrolled_Type(R.Value.Trim());
                        }
                        break;

                    case "thesis.degree.name":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0) && (Return_Package != null))
                        {
                            // Ensure the thesis object exists and is added
                            Thesis_Dissertation_Info thesisInfo = Return_Package.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                            if (thesisInfo == null)
                            {
                                thesisInfo = new Thesis_Dissertation_Info();
                                Return_Package.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
                            }

                            thesisInfo.Degree = R.Value.Trim();
                        }
                        break;

                    case "thesis.degree.level":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0) && (Return_Package != null))
                        {
                            // Ensure the thesis object exists and is added
                            Thesis_Dissertation_Info thesisInfo = Return_Package.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                            if (thesisInfo == null)
                            {
                                thesisInfo = new Thesis_Dissertation_Info();
                                Return_Package.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
                            }

                            string temp = R.Value.Trim().ToLower();
                            if ((temp == "doctorate") || (temp == "doctoral"))
                            {
                                thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Doctorate;
                            }
                            if ((temp == "masters") || (temp == "master's"))
                            {
                                thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Masters;
                            }
                            if ((temp == "bachelors") || (temp == "bachelor's"))
                            {
                                thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors;
                            }
                            if ((temp == "post-doctorate") || (temp == "post-doctoral"))
                            {
                                thesisInfo.Degree_Level = Thesis_Dissertation_Info.Thesis_Degree_Level_Enum.Bachelors;
                            }
                        }
                        break;

                    case "thesis.degree.discipline":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0) && (Return_Package != null))
                        {
                            // Ensure the thesis object exists and is added
                            Thesis_Dissertation_Info thesisInfo = Return_Package.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                            if (thesisInfo == null)
                            {
                                thesisInfo = new Thesis_Dissertation_Info();
                                Return_Package.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
                            }

                            thesisInfo.Add_Degree_Discipline(R.Value.Trim());
                        }
                        break;

                    case "thesis.degree.grantor":
                        R.Read();
                        if ((R.NodeType == XmlNodeType.Text) && (R.Value.Trim().Length > 0) && (Return_Package != null))
                        {
                            // Ensure the thesis object exists and is added
                            Thesis_Dissertation_Info thesisInfo = Return_Package.Get_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY) as Thesis_Dissertation_Info;
                            if (thesisInfo == null)
                            {
                                thesisInfo = new Thesis_Dissertation_Info();
                                Return_Package.Add_Metadata_Module(GlobalVar.THESIS_METADATA_MODULE_KEY, thesisInfo);
                            }

                            thesisInfo.Degree_Grantor = R.Value.Trim();
                        }
                        break;
                    }
                }
            }
        }