当前位置: 首页>>代码示例>>C#>>正文


C# SobekCM_Item.Add_Metadata_Module方法代码示例

本文整理汇总了C#中SobekCM.Resource_Object.SobekCM_Item.Add_Metadata_Module方法的典型用法代码示例。如果您正苦于以下问题:C# SobekCM_Item.Add_Metadata_Module方法的具体用法?C# SobekCM_Item.Add_Metadata_Module怎么用?C# SobekCM_Item.Add_Metadata_Module使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SobekCM.Resource_Object.SobekCM_Item的用法示例。


在下文中一共展示了SobekCM_Item.Add_Metadata_Module方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Save_To_Bib

        /// <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_Chair = value;
                    }
                    else
                    {
                        if (etdInfo != null)
                            etdInfo.Committee_Chair = String.Empty;
                    }
                    return;
                }
            }
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:30,代码来源:ETD_CommitteeChair_Element.cs

示例2: Read_dmdSec

        /// <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
            Sample_FavColor_Metadata_Module taxonInfo = Return_Package.Get_Metadata_Module(Sample_FavColor_Metadata_Module.Module_Name_Static) as Sample_FavColor_Metadata_Module;
            if (taxonInfo == null)
            {
                taxonInfo = new Sample_FavColor_Metadata_Module();
                Return_Package.Add_Metadata_Module(Sample_FavColor_Metadata_Module.Module_Name_Static, taxonInfo);
            }

            // 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();

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

                        case "additionalFavoriteColor":
                            Input_XmlReader.Read();
                            if ((Input_XmlReader.NodeType == XmlNodeType.Text) && (Input_XmlReader.Value.Trim().Length > 0))
                            {
                                taxonInfo.Other_Favorite_Color.Add(Input_XmlReader.Value.Trim());
                            }
                            break;
                    }
                }
            } while (Input_XmlReader.Read());

            return true;
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:51,代码来源:Sample_Custom_METS_Section_FavColor.cs

示例3: Save_To_Bib

        /// <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)
        {
            // Try to get any existing learning object metadata module
            LearningObjectMetadata lomInfo = Bib.Get_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY) as LearningObjectMetadata;

            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            foreach (string thisKey in getKeys.Where(thisKey => thisKey.IndexOf(html_element_name.Replace("_", "")) == 0))
            {
                // Get the value from the form element
                string value = HttpContext.Current.Request.Form[thisKey].Trim();
                if (value.Length > 0)
                {
                    // There is a value, so ensure learning object metadata does exist
                    if (lomInfo == null)
                    {
                        lomInfo = new LearningObjectMetadata();
                        Bib.Add_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY, lomInfo);
                    }

                    // Add the value
                    lomInfo.Add_LearningResourceType(value);

                }
            }
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:27,代码来源:LOM_ResourceType_Element.cs

示例4: Save_To_Bib

        /// <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)
                {
                    // Get the value from the combo box
                    string value = HttpContext.Current.Request.Form[thisKey].Trim();

                    // Try to get any existing learning object metadata module
                    LearningObjectMetadata lomInfo = Bib.Get_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY) as LearningObjectMetadata;

                    if (value.Length == 0)
                    {
                        // I fhte learning object metadata does exist, set it to undefined
                        if ( lomInfo != null )
                            lomInfo.InteractivityType = InteractivityTypeEnum.UNDEFINED;
                    }
                    else
                    {
                        // There is a value, so ensure learning object metadata does exist
                        if (lomInfo == null)
                        {
                            lomInfo = new LearningObjectMetadata();
                            Bib.Add_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY, lomInfo);
                        }

                        // Save the new value
                        switch ( value )
                        {
                            case level1_text:
                                lomInfo.InteractivityType = InteractivityTypeEnum.active;
                                break;

                            case level2_text:
                                lomInfo.InteractivityType = InteractivityTypeEnum.expositive;
                                break;

                            case level3_text:
                                lomInfo.InteractivityType = InteractivityTypeEnum.mixed;
                                break;
                        }
                    }
                    return;
                }
            }
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:50,代码来源:LOM_InteractivityType_Element.cs

示例5: Save_To_Bib

        /// <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)
        {
            // Try to get any existing learning object metadata module
            LearningObjectMetadata lomInfo = Bib.Get_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY) as LearningObjectMetadata;

            // Pull the standard values
            NameValueCollection form = HttpContext.Current.Request.Form;

            foreach (string thisKey in form.AllKeys)
            {
                if (thisKey.IndexOf("lomcontext_select") == 0)
                {
                    string diff = thisKey.Replace("lomcontext_select", "");
                    string select_value = form[thisKey];
                    string text_value = form["lomcontext_text" + diff];

                    if ((select_value.Length > 0) && (text_value.Length > 0))
                    {
                        // There is a value, so ensure learning object metadata does exist
                        if (lomInfo == null)
                        {
                            lomInfo = new LearningObjectMetadata();
                            Bib.Add_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY, lomInfo);
                        }

                        // Add the value
                        lomInfo.Add_Context(text_value, select_value);
                    }
                }
            }
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:33,代码来源:LOM_Context_Element.cs

示例6: Save_To_Bib

        /// <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)
        {
            // Try to get any existing metadata module
            VRACore_Info vraInfo = Bib.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;

            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            foreach (string thisKey in getKeys.Where(thisKey => thisKey.IndexOf(html_element_name.Replace("_", "")) == 0))
            {
                // Get the value from the form element
                string value = HttpContext.Current.Request.Form[thisKey].Trim();
                if (value.Length > 0)
                {
                    // There is a value, so ensure metadata does exist
                    if (vraInfo == null)
                    {
                        vraInfo = new VRACore_Info();
                        Bib.Add_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY, vraInfo);
                    }

                    // Add the value
                    vraInfo.Add_Technique(value);

                }
            }
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:27,代码来源:VRA_Technique_Element.cs

示例7: Save_To_Bib

        /// <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;
                }
            }
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:51,代码来源:ETD_DegreeLevel_Element.cs

示例8: Finish_Building_Item


//.........这里部分代码省略.........
                }

                // See if this can be described
                bool can_describe = false;
                foreach (DataRow thisRow in DatabaseInfo.Tables[1].Rows)
                {
                    int thisAggregationValue = Convert.ToInt16(thisRow["Items_Can_Be_Described"]);
                    if (thisAggregationValue == 0)
                    {
                        can_describe = false;
                        break;
                    }
                    if (thisAggregationValue == 2)
                    {
                        can_describe = true;
                    }
                }
                Package_To_Finalize.Behaviors.Can_Be_Described = can_describe;

                // Look for rights information to add
                if (mainItemRow["EmbargoEnd"] != DBNull.Value)
                {
                    try
                    {
                        DateTime embargoEnd = DateTime.Parse(mainItemRow["EmbargoEnd"].ToString());
                        string origAccessCode = mainItemRow["Original_AccessCode"].ToString();

                        // Is there already a RightsMD module in the item?
                        // Ensure this metadata module extension exists
                        RightsMD_Info rightsInfo = Package_To_Finalize.Get_Metadata_Module(GlobalVar.PALMM_RIGHTSMD_METADATA_MODULE_KEY) as RightsMD_Info;
                        if (rightsInfo == null)
                        {
                            rightsInfo = new RightsMD_Info();
                            Package_To_Finalize.Add_Metadata_Module(GlobalVar.PALMM_RIGHTSMD_METADATA_MODULE_KEY, rightsInfo);
                        }

                        // Add the data
                        rightsInfo.Access_Code_String = origAccessCode;
                        rightsInfo.Embargo_End = embargoEnd;
                    }
                    catch (Exception)
                    {

                    }
                }
            }

            // Look for user descriptions
            Tracer.Add_Trace("SobekCM_METS_Based_ItemBuilder.Finish_Building_Item", "Look for user descriptions (or tags)");
            foreach (DataRow thisRow in DatabaseInfo.Tables[0].Rows)
            {
                string first_name = thisRow["FirstName"].ToString();
                string nick_name = thisRow["NickName"].ToString();
                string last_name = thisRow["LastName"].ToString();
                int userid = Convert.ToInt32(thisRow["UserID"]);
                string tag = thisRow["Description_Tag"].ToString();
                int tagid = Convert.ToInt32(thisRow["TagID"]);
                DateTime dateAdded = Convert.ToDateTime(thisRow["Date_Modified"]);

                if (nick_name.Length > 0)
                {
                    Package_To_Finalize.Behaviors.Add_User_Tag(userid, nick_name + " " + last_name, tag, dateAdded, tagid);
                }
                else
                {
                    Package_To_Finalize.Behaviors.Add_User_Tag(userid, first_name + " " + last_name, tag, dateAdded, tagid);
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:67,代码来源:SobekCM_METS_Based_ItemBuilder.cs

示例9: Save_To_Bib

        /// <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)
        {
            // Try to get any existing VRAcore metadata module
            VRACore_Info vraInfo = Bib.Get_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY) as VRACore_Info;

            Dictionary<string, string> terms = new Dictionary<string, string>();
            Dictionary<string, string> schemes = new Dictionary<string, string>();

            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            foreach (string thisKey in getKeys)
            {
                if (thisKey.IndexOf(html_element_name.Replace("_", "") + "_first") == 0)
                {
                    string term = HttpContext.Current.Request.Form[thisKey];
                    string index = thisKey.Replace(html_element_name.Replace("_", "") + "_first", "");
                    terms[index] = term;
                }

                if (thisKey.IndexOf(html_element_name.Replace("_", "") + "_second") == 0)
                {
                    string scheme = HttpContext.Current.Request.Form[thisKey];
                    string index = thisKey.Replace(html_element_name.Replace("_", "") + "_second", "");
                    schemes[index] = scheme;
                }
            }

            // Were values found?
            if (terms.Count > 0)
            {
                // There is a value, so ensure VRAcore metadata does exist
                if (vraInfo == null)
                {
                    vraInfo = new VRACore_Info();
                    Bib.Add_Metadata_Module(GlobalVar.VRACORE_METADATA_MODULE_KEY, vraInfo);
                }

                // Add each value
                foreach (string index in terms.Keys)
                {
                    vraInfo.Add_Measurement( terms[index], schemes.ContainsKey(index) ? schemes[index] : String.Empty);
                }
            }
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:45,代码来源:VRA_Measurement_Element.cs

示例10: Save_To_Bib

        /// <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)
        {
            List<Coordinate_Point> points = new List<Coordinate_Point>();

            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            string latitude = String.Empty;
            foreach (string thisKey in getKeys)
            {
                if (thisKey.IndexOf(html_element_name.Replace("_", "") + "_first") == 0)
                {
                    latitude = HttpContext.Current.Request.Form[thisKey];
                }

                if (thisKey.IndexOf(html_element_name.Replace("_", "") + "_second") != 0) continue;

                string longitude = HttpContext.Current.Request.Form[thisKey];
                if ((latitude.Length > 0) && ( longitude.Length > 0 ))
                {
                    double latitude_double, longitude_double;
                    if ((Double.TryParse(latitude, out latitude_double)) && (Double.TryParse(longitude, out longitude_double)))
                        points.Add(new Coordinate_Point(latitude_double, longitude_double));
                    latitude = String.Empty;
                }
            }

            // GEt the geospatial metadata module
            if (points.Count > 0)
            {
                GeoSpatial_Information geoInfo = Bib.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                if (geoInfo == null)
                {
                    geoInfo = new GeoSpatial_Information();
                    Bib.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo);
                }

                foreach (Coordinate_Point thisPoint in points)
                {
                    geoInfo.Add_Point( thisPoint );
                }
            }
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:43,代码来源:Coordinates_Point_Element.cs

示例11: Save_To_Bib

        /// <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)
        {
            // Try to get any existing learning object metadata module
            LearningObjectMetadata lomInfo = Bib.Get_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY) as LearningObjectMetadata;

            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            foreach (string thisKey in getKeys)
            {
                if (thisKey.IndexOf(html_element_name.Replace("_", "")) == 0)
                {
                    // Get the value from the combo box
                    string value = HttpContext.Current.Request.Form[thisKey].Trim();
                    if (value.Length > 0)
                    {
                        // There is a value, so ensure learning object metadata does exist
                        if (lomInfo == null)
                        {
                            lomInfo = new LearningObjectMetadata();
                            Bib.Add_Metadata_Module(GlobalVar.IEEE_LOM_METADATA_MODULE_KEY, lomInfo);
                        }

                        // Save the new value
                        switch (value)
                        {
                            case level1_text:
                                lomInfo.Add_IntendedEndUserRole(IntendedEndUserRoleEnum.teacher);
                                break;

                            case level2_text:
                                lomInfo.Add_IntendedEndUserRole(IntendedEndUserRoleEnum.author);
                                break;

                            case level3_text:
                                lomInfo.Add_IntendedEndUserRole(IntendedEndUserRoleEnum.learner);
                                break;

                            case level4_text:
                                lomInfo.Add_IntendedEndUserRole(IntendedEndUserRoleEnum.manager);
                                break;
                        }
                    }
                }
            }
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:46,代码来源:LOM_IntendedUser_Element.cs

示例12: Add_Data


//.........这里部分代码省略.........
                    break;
                case Mapped_Fields.Creator_Given_Name:
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Name_Info lastNamedEntity = Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1];
                        if (lastNamedEntity.Given_Name.Length == 0)
                            lastNamedEntity.Given_Name = Data;
                        else
                        {
                            Name_Info newNameEntity = new Name_Info {Given_Name = Data};
                            Package.Bib_Info.Add_Named_Entity(newNameEntity);
                        }
                    }
                    else
                    {
                        Name_Info newNameEntity = new Name_Info {Given_Name = Data};
                        Package.Bib_Info.Add_Named_Entity(newNameEntity);
                    }
                    break;
                case Mapped_Fields.Creator_Role:
                    if (Package.Bib_Info.Names_Count > 0)
                    {
                        Name_Info thisCreator = Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1];
                        if ((thisCreator.Roles.Count == 1) && ((thisCreator.Roles[0].Role == "creator") || (thisCreator.Roles[1].Role == "contributor")))
                            thisCreator.Roles.Clear();
                        Package.Bib_Info.Names[Package.Bib_Info.Names_Count - 1].Add_Role(Data);
                    }
                    break;
                case Mapped_Fields.Cultural_Context:
                    VRACore_Info vraCoreInfo = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
                    if (vraCoreInfo == null)
                    {
                        vraCoreInfo = new VRACore_Info();
                        Package.Add_Metadata_Module("VRACore", vraCoreInfo);
                    }
                    vraCoreInfo.Add_Cultural_Context(Data);
                    break;
                case Mapped_Fields.Donor:
                    Package.Bib_Info.Donor.Full_Name = Data;
                    break;
                case Mapped_Fields.Genre:
                    Package.Bib_Info.Add_Genre(Data);
                    break;
                case Mapped_Fields.Genre_Authority:
                    if (Package.Bib_Info.Genres_Count > 0)
                    {
                        Package.Bib_Info.Genres[Package.Bib_Info.Genres_Count - 1].Authority = Data;
                    }
                    break;
                case Mapped_Fields.Holding_Code:
                    Package.Bib_Info.Location.Holding_Code = Data;
                    break;
                case Mapped_Fields.Holding_Statement:
                    Package.Bib_Info.Location.Holding_Name = Data;
                    break;
                case Mapped_Fields.Identifier:
                    Package.Bib_Info.Add_Identifier(Data);
                    break;
                case Mapped_Fields.Identifier_Type:
                    if (Package.Bib_Info.Identifiers_Count > 0)
                    {
                        Package.Bib_Info.Identifiers[Package.Bib_Info.Identifiers_Count - 1].Type = Data;
                    }
                    break;
                case Mapped_Fields.Inscription:
                    VRACore_Info vraCoreInfo8 = Package.Get_Metadata_Module("VRACore") as VRACore_Info;
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:67,代码来源:Bibliographic_Mapping.cs

示例13: Save_To_Bib

        /// <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)
        {
            Zoological_Taxonomy_Info zooInfo = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
            if (zooInfo == null)
                zooInfo = new Zoological_Taxonomy_Info();

            string[] getKeys = HttpContext.Current.Request.Form.AllKeys;
            foreach (string thisKey in getKeys)
            {
                if (thisKey.IndexOf("formzootaxonkingdom_") == 0)
                {
                    string diff = thisKey.Replace("formzootaxonkingdom_", "");

                    zooInfo.Kingdom = HttpContext.Current.Request.Form[thisKey];
                    zooInfo.Phylum = HttpContext.Current.Request.Form["formzootaxonphylum_" + diff].Trim();
                    zooInfo.Class = HttpContext.Current.Request.Form["formzootaxonclass_" + diff].Trim();
                    zooInfo.Order = HttpContext.Current.Request.Form["formzootaxonorder_" + diff].Trim();
                    zooInfo.Family = HttpContext.Current.Request.Form["formzootaxonfamily_" + diff].Trim();
                    zooInfo.Genus = HttpContext.Current.Request.Form["formzootaxongenus_" + diff].Trim();
                    zooInfo.Specific_Epithet = HttpContext.Current.Request.Form["formzootaxonspecies_" + diff].Trim();
                    zooInfo.Common_Name = HttpContext.Current.Request.Form["formzootaxoncommon_" + diff].Trim();

                    Bib.Add_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY, zooInfo);
                }
            }
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:28,代码来源:Zoological_Taxonomy_Form_Element.cs

示例14: Finish_Building_Item


//.........这里部分代码省略.........
                }

                // See if this can be described
                bool can_describe = false;
                foreach (DataRow thisRow in DatabaseInfo.Tables[1].Rows)
                {
                    int thisAggregationValue = Convert.ToInt16(thisRow["Items_Can_Be_Described"]);
                    if (thisAggregationValue == 0)
                    {
                        can_describe = false;
                        break;
                    }
                    if (thisAggregationValue == 2)
                    {
                        can_describe = true;
                    }
                }
                Package_To_Finalize.Behaviors.Can_Be_Described = can_describe;

                // Look for rights information to add
                if (mainItemRow["EmbargoEnd"] != DBNull.Value)
                {
                    try
                    {
                        DateTime embargoEnd = DateTime.Parse(mainItemRow["EmbargoEnd"].ToString());
                        string origAccessCode = mainItemRow["Original_AccessCode"].ToString();

                        // Is there already a RightsMD module in the item?
                        // Ensure this metadata module extension exists
                        RightsMD_Info rightsInfo = Package_To_Finalize.Get_Metadata_Module(GlobalVar.PALMM_RIGHTSMD_METADATA_MODULE_KEY) as RightsMD_Info;
                        if (rightsInfo == null)
                        {
                            rightsInfo = new RightsMD_Info();
                            Package_To_Finalize.Add_Metadata_Module(GlobalVar.PALMM_RIGHTSMD_METADATA_MODULE_KEY, rightsInfo);
                        }

                        // Add the data
                        rightsInfo.Access_Code_String = origAccessCode;
                        rightsInfo.Embargo_End = embargoEnd;
                    }
                    catch (Exception)
                    {

                    }
                }
            }

            // Look for user descriptions
            Tracer.Add_Trace("SobekCM_METS_Based_ItemBuilder.Finish_Building_Item", "Look for user descriptions (or tags)");
            foreach (DataRow thisRow in DatabaseInfo.Tables[0].Rows)
            {
                string first_name = thisRow["FirstName"].ToString();
                string nick_name = thisRow["NickName"].ToString();
                string last_name = thisRow["LastName"].ToString();
                int userid = Convert.ToInt32(thisRow["UserID"]);
                string tag = thisRow["Description_Tag"].ToString();
                int tagid = Convert.ToInt32(thisRow["TagID"]);
                DateTime dateAdded = Convert.ToDateTime(thisRow["Date_Modified"]);

                if (nick_name.Length > 0)
                {
                    Package_To_Finalize.Behaviors.Add_User_Tag(userid, nick_name + " " + last_name, tag, dateAdded, tagid);
                }
                else
                {
                    Package_To_Finalize.Behaviors.Add_User_Tag(userid, first_name + " " + last_name, tag, dateAdded, tagid);
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:67,代码来源:SobekCM_METS_Based_ItemBuilder.cs


注:本文中的SobekCM.Resource_Object.SobekCM_Item.Add_Metadata_Module方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。