/// <summary> Constructor for a new instance of the LOM_Context_Element class </summary>
 public LOM_Context_Element() : base("Context", "lom_context")
 {
     Repeatable = false;
     PossibleSelectItems.Clear();
     PossibleSelectItems.Add("Group");
     SecondLabel = String.Empty;
 }
        /// <summary> Constructor for a new instance of the Downloads_Element class </summary>
        public Downloads_Element()
            : base("Downloads", "download")
        {
            Repeatable = true;
            PossibleSelectItems.Clear();

            SecondLabel = "Label";
        }
Ejemplo n.º 3
0
        /// <summary> Constructor for a new instance of the Holding_Element class </summary>
        public Holding_Element()
            : base("Holding Location", "holding")
        {
            Repeatable = false;
            PossibleSelectItems.Add("");
            ClearTextboxOnComboboxChange = true;

            // Get the codes to display in the source
            codeToNameDictionary = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            if (UI_ApplicationCache_Gateway.Aggregations != null)
            {
                SortedList <string, string> tempItemList = new SortedList <string, string>(StringComparer.OrdinalIgnoreCase);
                foreach (string thisType in UI_ApplicationCache_Gateway.Aggregations.All_Types)
                {
                    if (thisType.IndexOf("Institution") >= 0)
                    {
                        ReadOnlyCollection <Item_Aggregation_Related_Aggregations> matchingAggr = UI_ApplicationCache_Gateway.Aggregations.Aggregations_By_Type(thisType);
                        foreach (Item_Aggregation_Related_Aggregations thisAggr in matchingAggr)
                        {
                            if (thisAggr.Code.Length > 1)
                            {
                                if ((thisAggr.Code[0] == 'i') || (thisAggr.Code[0] == 'I'))
                                {
                                    if (!tempItemList.ContainsKey(thisAggr.Code.Substring(1)))
                                    {
                                        codeToNameDictionary[thisAggr.Code.Substring(1).ToUpper()] = thisAggr.Name;
                                        tempItemList.Add(thisAggr.Code.Substring(1), thisAggr.Code.Substring(1));
                                    }
                                }
                                else
                                {
                                    if (!tempItemList.ContainsKey(thisAggr.Code))
                                    {
                                        codeToNameDictionary[thisAggr.Code.ToUpper()] = thisAggr.Name;
                                        tempItemList.Add(thisAggr.Code, thisAggr.Code);
                                    }
                                }
                            }
                        }
                    }
                }

                IList <string> keys = tempItemList.Keys;
                foreach (string thisKey in keys)
                {
                    PossibleSelectItems.Add(tempItemList[thisKey].ToUpper());
                    if (codeToNameDictionary.ContainsKey(thisKey))
                    {
                        Add_Code_Statement_Link(thisKey, codeToNameDictionary[thisKey]);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary> Constructor for a new instance of the Container_Element class </summary>
        public Container_Element()
            : base("Physical Container", "container")
        {
            Repeatable = true;
            PossibleSelectItems.Clear();
            PossibleSelectItems.Add(String.Empty);
            PossibleSelectItems.Add("Folder");
            PossibleSelectItems.Add("Divider");
            PossibleSelectItems.Add("Box");
            PossibleSelectItems.Add("Shelf");
            PossibleSelectItems.Add("Room");

            SecondLabel = "Label";
        }
Ejemplo n.º 5
0
        /// <summary> Constructor for a new instance of the Disposition_Advice_Element class </summary>
        public Disposition_Advice_Element()
            : base("Disposition Advice", "disposition_advice")
        {
            Repeatable = false;
            PossibleSelectItems.Clear();

            List <Disposition_Option> futureTypes = UI_ApplicationCache_Gateway.Settings.Disposition_Options;

            PossibleSelectItems.Add(String.Empty);
            foreach (Disposition_Option thisType in futureTypes)
            {
                PossibleSelectItems.Add(thisType.Future);
            }

            SecondLabel = "Notes";
        }
Ejemplo n.º 6
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)
            {
                const string DEFAULT_ACRONYM = "Holding location for the physical material, if this is a digital manifestation of a physical item.  Otherwise, the institution holding the digital version.";
                switch (CurrentLanguage)
                {
                case Web_Language_Enum.English:
                    Acronym = DEFAULT_ACRONYM;
                    break;

                case Web_Language_Enum.Spanish:
                    Acronym = DEFAULT_ACRONYM;
                    break;

                case Web_Language_Enum.French:
                    Acronym = DEFAULT_ACRONYM;
                    break;

                default:
                    Acronym = DEFAULT_ACRONYM;
                    break;
                }
            }

            // This should always have a blank value
            if (!PossibleSelectItems.Contains(String.Empty))
            {
                PossibleSelectItems.Insert(0, String.Empty);
            }

            // Check the user to see if this should be limited
            bool          some_set_as_selectable = false;
            List <string> possibles = new List <string> {
                Bib.Bib_Info.Location.Holding_Code.ToUpper()
            };

            if ((!Current_User.Is_Internal_User) && (Current_User.PermissionedAggregations != null))
            {
                // Are there aggregationPermissions set aside for the user?
                List <User_Permissioned_Aggregation> allAggrs = Current_User.PermissionedAggregations;

                foreach (User_Permissioned_Aggregation thisAggr in allAggrs)
                {
                    if (thisAggr.CanSelect)
                    {
                        some_set_as_selectable = true;
                        string code = thisAggr.Code.ToUpper();
                        if ((code.Length > 1) && (code[0] == 'I'))
                        {
                            code = code.Substring(1);
                        }
                        if ((PossibleSelectItems.Contains(code)) && (!possibles.Contains(code)))
                        {
                            possibles.Add(code);
                        }
                    }
                }
            }

            string holding_code = Bib.Bib_Info.Location.Holding_Code.ToUpper();

            if (some_set_as_selectable)
            {
                render_helper(Output, holding_code, possibles, Bib.Bib_Info.Location.Holding_Name, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL, false);
            }
            else
            {
                render_helper(Output, holding_code, Bib.Bib_Info.Location.Holding_Name, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
            }
        }
Ejemplo n.º 7
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)
            {
                const string DEFAULT_ACRONYM = "Enter information about the institution which created the digital manifestation or entered this bibliographic data.";
                switch (CurrentLanguage)
                {
                case Web_Language_Enum.English:
                    Acronym = DEFAULT_ACRONYM;
                    break;

                case Web_Language_Enum.Spanish:
                    Acronym = DEFAULT_ACRONYM;
                    break;

                case Web_Language_Enum.French:
                    Acronym = DEFAULT_ACRONYM;
                    break;

                default:
                    Acronym = DEFAULT_ACRONYM;
                    break;
                }
            }

            // Check the user to see if this should be limited
            bool          some_set_as_selectable = false;
            List <string> possibles = new List <string> {
                Bib.Bib_Info.Source.Code.ToUpper()
            };

            if ((!Current_User.Is_Internal_User) && (Current_User.PermissionedAggregations != null))
            {
                // Are there aggregationPermissions set aside for the user?
                List <User_Permissioned_Aggregation> allAggrs = Current_User.PermissionedAggregations;

                foreach (User_Permissioned_Aggregation thisAggr in allAggrs.Where(ThisAggr => ThisAggr.CanSelect))
                {
                    some_set_as_selectable = true;
                    string code = thisAggr.Code.ToUpper();
                    if ((code.Length > 1) && (code[0] == 'I'))
                    {
                        code = code.Substring(1);
                    }
                    if ((PossibleSelectItems.Contains(code)) && (!possibles.Contains(code)))
                    {
                        possibles.Add(code);
                    }
                }
            }

            // Determine the current value to show
            string source_code = Bib.Bib_Info.Source.Code.ToUpper();

            // Render this
            if (some_set_as_selectable)
            {
                render_helper(Output, source_code, possibles, Bib.Bib_Info.Source.Statement, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL, false);
            }
            else
            {
                render_helper(Output, source_code, Bib.Bib_Info.Source.Statement, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
            }
        }
        /// <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)
            {
                const string defaultAcronym = "Select files to make downloadable and provide labels for them.";
                switch (CurrentLanguage)
                {
                case Web_Language_Enum.English:
                    Acronym = defaultAcronym;
                    break;

                case Web_Language_Enum.Spanish:
                    Acronym = defaultAcronym;
                    break;

                case Web_Language_Enum.French:
                    Acronym = defaultAcronym;
                    break;

                default:
                    Acronym = defaultAcronym;
                    break;
                }
            }

            // Clear the list of possible download-eligible files
            PossibleSelectItems.Clear();
            PossibleSelectItems.Add(String.Empty);

            // Add the actual downloads from this package
            List <string>            files          = new List <string>();
            List <string>            labels         = new List <string>();
            List <abstract_TreeNode> downloadGroups = Bib.Divisions.Download_Tree.Pages_PreOrder;

            foreach (Page_TreeNode thisDownload in downloadGroups)
            {
                if (thisDownload.Files.Count > 0)
                {
                    string base_file = thisDownload.Files[0].File_Name_Sans_Extension.ToLower();
                    if (!PossibleSelectItems.Contains(base_file + ".*"))
                    {
                        PossibleSelectItems.Add(base_file + ".*");
                    }

                    if (!files.Contains(base_file + ".*"))
                    {
                        files.Add(base_file + ".*");
                        labels.Add(thisDownload.Label);
                    }
                }
            }

            // Now, add all the other download-eligible files
            ReadOnlyCollection <string> otherFiles = Bib.Web.Get_Download_Eligible_Files(UI_ApplicationCache_Gateway.Settings.Servers.Image_Server_Network + Bib.Web.AssocFilePath);

            foreach (string thisOtherFile in otherFiles)
            {
                if (!PossibleSelectItems.Contains(thisOtherFile))
                {
                    PossibleSelectItems.Add(thisOtherFile);
                }
            }

            if (files.Count == 0)
            {
                render_helper(Output, String.Empty, String.Empty, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL, false);
            }
            else
            {
                render_helper(Output, files, labels, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
            }
        }