/// <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> Adds this new value to this citation element </summary>
        /// <param name="Value"> Value as a simple string </param>
        public BriefItem_DescTermValue Add_Value(string Value)
        {
            if (Values == null)
            {
                Values = new List <BriefItem_DescTermValue>();
            }

            BriefItem_DescTermValue newValue = new BriefItem_DescTermValue(Value);

            Values.Add(newValue);
            return(newValue);
        }
        /// <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 notes
            if (Original.Bib_Info.Notes_Count > 0)
            {
                Note_Info statementOfResponsibility = null;
                foreach (Note_Info thisNote in Original.Bib_Info.Notes)
                {
                    if (thisNote.Note_Type != Note_Type_Enum.NONE)
                    {
                        // Statement of responsibilty will be printed at the very end
                        if (thisNote.Note_Type == Note_Type_Enum.StatementOfResponsibility)
                        {
                            statementOfResponsibility = thisNote;
                        }
                        else
                        {
                            if (thisNote.Note_Type != Note_Type_Enum.InternalComments)
                            {
                                BriefItem_DescTermValue newAbstract = New.Add_Description("Note", thisNote.Note);
                                newAbstract.SubTerm = thisNote.Note_Type_Display_String;

                                if (!String.IsNullOrWhiteSpace(thisNote.Display_Label))
                                {
                                    newAbstract.SubTerm = thisNote.Display_Label;
                                }
                            }
                        }
                    }
                    else
                    {
                        New.Add_Description("Note", thisNote.Note);
                    }
                }

                // If there was a statement of responsibility, add it now
                if (statementOfResponsibility != null)
                {
                    New.Add_Description("Note", statementOfResponsibility.Note).SubTerm = statementOfResponsibility.Note_Type_Display_String;
                }
            }

            return(true);
        }
示例#6
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 abstracts
            if (Original.Bib_Info.Abstracts_Count > 0)
            {
                foreach (Abstract_Info thisAbstract in Original.Bib_Info.Abstracts)
                {
                    BriefItem_DescTermValue newAbstract = New.Add_Description("Abstract", thisAbstract.Abstract_Text);

                    if (!String.IsNullOrWhiteSpace(thisAbstract.Display_Label))
                    {
                        newAbstract.SubTerm = thisAbstract.Display_Label;
                    }

                    if (!String.IsNullOrWhiteSpace(thisAbstract.Language))
                    {
                        newAbstract.Language = thisAbstract.Language;
                    }
                }
            }

            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 main entity first
            if (Original.Bib_Info.hasMainEntityName)
            {
                // Is this a conference?
                if (Original.Bib_Info.Main_Entity_Name.Name_Type == Name_Info_Type_Enum.Conference)
                {
                    if (!String.IsNullOrWhiteSpace(Original.Bib_Info.Main_Entity_Name.Full_Name))
                    {
                        New.Add_Description("Conference", Original.Bib_Info.Main_Entity_Name.ToString());
                    }
                }
                else
                {
                    // Build the full name and info
                    Name_Info     thisName    = Original.Bib_Info.Main_Entity_Name;
                    StringBuilder nameBuilder = new StringBuilder();
                    if (!String.IsNullOrWhiteSpace(thisName.Full_Name))
                    {
                        nameBuilder.Append(thisName.Full_Name.Replace("|", " -- "));
                    }
                    else
                    {
                        if (!String.IsNullOrWhiteSpace(thisName.Family_Name))
                        {
                            if (!String.IsNullOrWhiteSpace(thisName.Given_Name))
                            {
                                nameBuilder.Append(thisName.Family_Name + ", " + thisName.Given_Name);
                            }
                            else
                            {
                                nameBuilder.Append(thisName.Family_Name);
                            }
                        }
                        else
                        {
                            nameBuilder.Append(!String.IsNullOrWhiteSpace(thisName.Given_Name) ? thisName.Given_Name : "unknown");
                        }
                    }

                    // This is all that should be searched
                    string searchTerm = nameBuilder.ToString();

                    // Add the display form and dates
                    if (thisName.Display_Form.Length > 0)
                    {
                        nameBuilder.Append(" ( " + thisName.Display_Form + " )");
                    }
                    if (thisName.Dates.Length > 0)
                    {
                        nameBuilder.Append(", " + thisName.Dates);
                    }

                    // Add this now
                    BriefItem_DescTermValue descTerm = New.Add_Description("Creator", nameBuilder.ToString());

                    // Add with the sub-roles as well
                    string roles = thisName.Role_String;
                    if (!String.IsNullOrWhiteSpace(roles))
                    {
                        descTerm.SubTerm = roles;
                    }

                    // Was the search term different than the actual name?
                    if (searchTerm != nameBuilder.ToString())
                    {
                        descTerm.SearchTerm = searchTerm;
                    }
                }
            }

            // Add all the other names attached
            if (Original.Bib_Info.Names_Count > 0)
            {
                foreach (Name_Info thisName in Original.Bib_Info.Names)
                {
                    // Is this a conference?
                    if (thisName.Name_Type == Name_Info_Type_Enum.Conference)
                    {
                        if (!String.IsNullOrWhiteSpace(thisName.Full_Name))
                        {
                            New.Add_Description("Conference", thisName.ToString());
                        }
                    }
                    else
                    {
                        // Build the full name and info
                        StringBuilder nameBuilder = new StringBuilder();
                        if (!String.IsNullOrWhiteSpace(thisName.Full_Name))
                        {
                            nameBuilder.Append(thisName.Full_Name.Replace("|", " -- "));
                        }
                        else
                        {
                            if (!String.IsNullOrWhiteSpace(thisName.Family_Name))
                            {
                                if (!String.IsNullOrWhiteSpace(thisName.Given_Name))
                                {
                                    nameBuilder.Append(thisName.Family_Name + ", " + thisName.Given_Name);
                                }
                                else
                                {
                                    nameBuilder.Append(thisName.Family_Name);
                                }
                            }
                            else
                            {
                                nameBuilder.Append(!String.IsNullOrWhiteSpace(thisName.Given_Name) ? thisName.Given_Name : "unknown");
                            }
                        }

                        // This is all that should be searched
                        string searchTerm = nameBuilder.ToString();

                        // Add the display form and dates
                        if (thisName.Display_Form.Length > 0)
                        {
                            nameBuilder.Append(" ( " + thisName.Display_Form + " )");
                        }
                        if (thisName.Dates.Length > 0)
                        {
                            nameBuilder.Append(", " + thisName.Dates);
                        }

                        // Add this now
                        BriefItem_DescTermValue descTerm = New.Add_Description("Creator", nameBuilder.ToString());

                        // Add with the sub-roles as well
                        string roles = thisName.Role_String;
                        if (!String.IsNullOrWhiteSpace(roles))
                        {
                            descTerm.SubTerm = roles;
                        }

                        // Was the search term different than the actual name?
                        if (searchTerm != nameBuilder.ToString())
                        {
                            descTerm.SearchTerm = searchTerm;
                        }
                    }
                }
            }

            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);
        }