/// <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)
        {
            // Add the HOLDING LOCATION information
            if ((Original.Bib_Info.hasLocationInformation) && (!String.IsNullOrWhiteSpace(Original.Bib_Info.Location.Holding_Name)))
            {
                // Add the source institution
                BriefItem_DescTermValue sourceValue = New.Add_Description("Holding Location", Original.Bib_Info.Location.Holding_Name);

                // Was the code present, and active?
                if (!String.IsNullOrWhiteSpace(Original.Bib_Info.Location.Holding_Code))
                {
                    if ((Engine_ApplicationCache_Gateway.Codes != null) && (Engine_ApplicationCache_Gateway.Codes.isValidCode("i" + Original.Bib_Info.Location.Holding_Code)))
                    {
                        Item_Aggregation_Related_Aggregations sourceAggr = Engine_ApplicationCache_Gateway.Codes["i" + Original.Bib_Info.Location.Holding_Code];
                        if (sourceAggr.Active)
                        {
                            sourceValue.Add_URI("[%BASEURL%]" + "i" + Original.Bib_Info.Location.Holding_Code + "[%URLOPTS%]");
                        }

                        // Was there an external link on this agggreation?
                        if (!String.IsNullOrWhiteSpace(sourceAggr.External_Link))
                        {
                            sourceValue.Add_URI(sourceAggr.External_Link);
                        }
                    }
                }
            }

            return(true);
        }
示例#2
0
        /// <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)
        {
            // If not URL, jsut return
            if (String.IsNullOrEmpty(Original.Bib_Info.Location.Other_URL))
            {
                return(true);
            }

            string mainEntry = Original.Bib_Info.Location.Other_URL;

            if (!String.IsNullOrEmpty(Original.Bib_Info.Location.Other_URL_Note))
            {
                mainEntry = Original.Bib_Info.Location.Other_URL_Note;
            }

            // Add this other URL
            BriefItem_DescTermValue otherUrlObj = New.Add_Description("Other Item", mainEntry);

            otherUrlObj.Add_URI(Original.Bib_Info.Location.Other_URL);

            // Add display label, if one exists
            if (!String.IsNullOrEmpty(Original.Bib_Info.Location.Other_URL_Display_Label))
            {
                otherUrlObj.SubTerm = Original.Bib_Info.Location.Other_URL_Display_Label;
            }

            return(true);
        }
示例#3
0
        /// <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)
        {
            // Add the RIGHTS STATEMENT
            if (!String.IsNullOrWhiteSpace(Original.Bib_Info.Access_Condition.Text))
            {
                string value = Original.Bib_Info.Access_Condition.Text;
                string uri   = String.Empty;

                if (value.IndexOf("[cc by-nc-nd]") >= 0)
                {
                    value = value.Replace("[cc by-nc-nd]", String.Empty);
                    uri   = "http://creativecommons.org/licenses/by-nc-nd/3.0/";
                }
                if (value.IndexOf("[cc by-nc-sa]") >= 0)
                {
                    value = value.Replace("[cc by-nc-sa]", String.Empty);
                    uri   = "http://creativecommons.org/licenses/by-nc-sa/3.0/";
                }
                if (value.IndexOf("[cc by-nc]") >= 0)
                {
                    value = value.Replace("[cc by-nc]", String.Empty);
                    uri   = "http://creativecommons.org/licenses/by-nc/3.0/";
                }
                if (value.IndexOf("[cc by-nd]") >= 0)
                {
                    value = value.Replace("[cc by-nd]", String.Empty);
                    uri   = "http://creativecommons.org/licenses/by-nd/3.0/";
                }
                if (value.IndexOf("[cc by-sa]") >= 0)
                {
                    value = value.Replace("[cc by-sa]", String.Empty);
                    uri   = "http://creativecommons.org/licenses/by-sa/3.0/";
                }
                if (value.IndexOf("[cc by]") >= 0)
                {
                    value = value.Replace("[cc by]", String.Empty);
                    uri   = "http://creativecommons.org/licenses/by/3.0/";
                }
                if (value.IndexOf("[cc0]") >= 0)
                {
                    value = value.Replace("[cc0]", String.Empty);
                    uri   = "http://creativecommons.org/publicdomain/zero/1.0/";
                }

                BriefItem_DescTermValue rightsVal = New.Add_Description("Rights Management", value);
                if (uri.Length > 0)
                {
                    rightsVal.Add_URI(uri);
                }
            }

            return(true);
        }
        /// <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)
        {
            // Add the RELATED ITEMS
            if (Original.Bib_Info.RelatedItems_Count > 0)
            {
                foreach (Related_Item_Info relatedItem in Original.Bib_Info.RelatedItems)
                {
                    // Determine the field to display
                    string relatedDisplay = String.Empty;
                    if ((!String.IsNullOrWhiteSpace(relatedItem.URL)) && (!String.IsNullOrWhiteSpace(relatedItem.URL_Display_Label)))
                    {
                        relatedDisplay = relatedItem.URL_Display_Label;
                    }
                    else if (!String.IsNullOrWhiteSpace(relatedItem.Main_Title.Title))
                    {
                        relatedDisplay = relatedItem.Main_Title.Title;
                    }
                    else if (!String.IsNullOrWhiteSpace(relatedItem.URL))
                    {
                        relatedDisplay = relatedItem.URL;
                    }

                    // If nothing to display, move to next one
                    if (relatedDisplay.Length == 0)
                    {
                        continue;
                    }

                    // Add this related item
                    BriefItem_DescTermValue relatedObj = New.Add_Description("Related Item", relatedDisplay);

                    // Add the relationship
                    switch (relatedItem.Relationship)
                    {
                    case Related_Item_Type_Enum.Host:
                        relatedObj.SubTerm = "Host material";
                        break;

                    case Related_Item_Type_Enum.OtherFormat:
                        relatedObj.SubTerm = "Other format";
                        break;

                    case Related_Item_Type_Enum.OtherVersion:
                        relatedObj.SubTerm = "Other version";
                        break;

                    case Related_Item_Type_Enum.Preceding:
                        relatedObj.SubTerm = "Preceded by";
                        break;

                    case Related_Item_Type_Enum.Succeeding:
                        relatedObj.SubTerm = "Succeeded by";
                        break;
                    }

                    // Add the URI if one was indicated
                    if (!String.IsNullOrWhiteSpace(relatedItem.URL))
                    {
                        relatedObj.Add_URI(relatedItem.URL);
                    }
                    else if (!String.IsNullOrWhiteSpace(relatedItem.SobekCM_ID))
                    {
                        relatedObj.Add_URI("[%BASEURL%]" + relatedItem.SobekCM_ID.Replace("_", "/") + "[%URLOPTS%]");
                    }
                }
            }

            return(true);
        }