Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            main.SetPageType(Main.PageType.Content);
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeBrowseUtils.js");
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/jquery-1.2.6.min.js");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                              "ResizeContentPanel('browseContentPanel', 258);ResizeBrowseDivs();");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                              "ResizeContentPanel('browseContentPanel', 258);ResizeBrowseDivs();");

            if (!IsPostBack)
            {
                // Retrieve the pages for the item
                String itemIDString = Request.QueryString["ItemID"] as String;
                int    itemID;
                if (itemIDString != null)
                {
                    if (Int32.TryParse(itemIDString, out itemID))
                    {
                        BHLProvider provider = new BHLProvider();

                        // If this is a Botanicus item, make sure the PDF actually exists.
                        // Remove the DownloadUrl if it does not.
                        Data.Item item = provider.ItemSelectByBarcodeOrItemID(itemID, null);
                        if (!String.IsNullOrEmpty(item.DownloadUrl) && item.ItemSourceID == 2)
                        {
                            // This is kludgy... should find a better way to do this
                            String pdfLocation = item.DownloadUrl.Replace("http://www.botanicus.org/", "\\\\server\\").Replace('/', '\\');
                            if (provider.GetFileAccessProvider(ConfigurationManager.AppSettings["UseRemoteFileAccessProvider"] == "true").FileExists(pdfLocation))
                            {
                                item.DownloadUrl = ConfigurationManager.AppSettings["PdfAuthUrl"] != null?String.Format(ConfigurationManager.AppSettings["PdfAuthUrl"], item.BarCode) : String.Empty;
                            }
                            else
                            {
                                item.DownloadUrl = String.Empty;
                            }
                        }

                        if (String.IsNullOrEmpty(item.DownloadUrl))
                        {
                            litDownloadLink.Text = ConfigurationManager.AppSettings["PdfGenDownloadNone"].ToString();
                        }
                        else if (item.ItemSourceID == 1)
                        {
                            litDownloadLink.Text = String.Format(ConfigurationManager.AppSettings["PdfGenDownloadIA"], item.BarCode, item.BarCode);
                        }
                        else
                        {
                            litDownloadLink.Text = String.Format(ConfigurationManager.AppSettings["PdfGenDownloadBotanicus"], item.DownloadUrl);
                        }

                        // Get the page information for this item
                        CustomGenericList <Data.Page> pages = provider.PageMetadataSelectByItemID(itemID);

                        dlPages.DataSource = pages;
                        dlPages.DataBind();
                    }
                }
            }
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeBrowseUtils.js");
     ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                       "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");
     ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                       "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     rssFeed.FeedLocation = ConfigurationManager.AppSettings["projectUpdatesFeedLocation"];
     ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeBrowseUtils.js");
     ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                       "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");
     ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                       "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");
 }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Main main = (Main)Page.Master;

            titleSelectionContentPanel.SetTableID("titleSelectionContentPanel");
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/jquery-1.2.6.min.js");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                              "ResizeContentPanel('titleSelectionContentPanel', 258);");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                              "ResizeContentPanel('titleSelectionContentPanel', 258);");
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlLink cssLnk = new HtmlLink();

            cssLnk.Attributes.Add("rel", "stylesheet");
            cssLnk.Attributes.Add("type", "text/css");
            cssLnk.Href = "http://jqueryui.com/latest/themes/base/ui.all.css";
            Page.Header.Controls.Add(cssLnk);
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js");
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.js");

            if (IsPostBack)
            {
                if (ViewState["SearchCriteria"] != null)
                {
                    _searchCriteria = (TitleSearchCriteria)ViewState["SearchCriteria"];
                    _isExactSearch  = (bool)ViewState["IsExactSearch"];
                    _orderBy        = (TitleSearchOrderBy)ViewState["OrderBy"];
                    _sortOrder      = (SortOrder)ViewState["SortOrder"];
                }
                pagingUserControl.Visible = true;
            }
            else
            {
                pagingUserControl.Visible = false;

                BHLProvider bp = new BHLProvider();

                CustomGenericList <Institution> institutions = bp.InstituationSelectAll();

                listInstitutions.DataSource = institutions;
                listInstitutions.DataBind();
            }

            String redirect = Request.QueryString["redir"] as String;

            if (redirect != null)
            {
                if (redirect.ToLower() == "p")
                {
                    litHeader.Text    = "Pagination";
                    liImport.Visible  = false;
                    divImport.Visible = false;
                    HyperLinkField linkField = (HyperLinkField)gvwResults.Columns[2];
                    linkField.NavigateUrl = "/Admin/Paginator.aspx";
                    linkField.DataNavigateUrlFormatString = "/Admin/Paginator.aspx?TitleID={0}";
                    _redirectUrl = "/Admin/Paginator.aspx?TitleID=";
                }
            }

            errorControl.Visible = false;
            Page.SetFocus(titleTextBox);
            Page.Title = "BHL Admin - Title Search";
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeBrowseUtils.js");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                              "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                              "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");

            Response.Cookies["CallingUrl"].Value = Request.Url.ToString();

            adminLabel.Visible = true;            //Helper.IsAdmin( Request );
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Main main = (Main)Page.Master;

            main.SetPageType(Main.PageType.Content);

            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeBrowseUtils.js");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                              "ResizeContentPanel('browseContentPanel', 258);ResizeBrowseDivs();");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                              "ResizeContentPanel('browseContentPanel', 258);ResizeBrowseDivs();");

            String institutionCode = String.Empty;

            if (this.Request.Cookies["ddlContributors"] != null)
            {
                institutionCode = this.Request.Cookies["ddlContributors"].Value;
            }
            String languageCode = String.Empty;

            if (this.Request.Cookies["ddlLanguage"] != null)
            {
                languageCode = this.Request.Cookies["ddlLanguage"].Value;
            }

            int  startDate;
            int  endDate;
            bool startFlag = false;

            if (int.TryParse(Request.QueryString["start"], out startDate) == false)
            {
                startDate = int.Parse(ConfigurationManager.AppSettings["browseByYearDefaultStart"]);
                startFlag = true;
            }
            if (int.TryParse(Request.QueryString["enddate"], out endDate) == false)
            {
                if (startFlag)
                {
                    endDate = int.Parse(ConfigurationManager.AppSettings["browseByYearDefaultEnd"]);
                }
                else
                {
                    endDate = DateTime.Now.Year;
                }
            }

            titleLiteral.Text = GenerateDateList(startDate, endDate, institutionCode, languageCode);
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeBrowseUtils.js");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                              "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                              "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");

            string searchTerm = String.Empty;
            string searchLang = String.Empty;
            string titleMax   = "0";
            string authorMax  = "0";
            string nameMax    = "0";
            string subjectMax = "0";

            if (Request["SearchTerm"] != null)
            {
                searchTerm = Request["SearchTerm"].ToString();
                if (Request["lang"] != null)
                {
                    searchLang = Request["lang"].ToString();
                }
                if (Request["tMax"] != null)
                {
                    titleMax = Request["tMax"].ToString();
                }
                if (Request["aMax"] != null)
                {
                    authorMax = Request["aMax"].ToString();
                }
                if (Request["nMax"] != null)
                {
                    nameMax = Request["nMax"].ToString();
                }
                if (Request["sMax"] != null)
                {
                    subjectMax = Request["sMax"].ToString();
                }
                Response.Cookies.Add(new HttpCookie("nameSearchLang", searchLang));
                searchResultsLabel.Text = searchTerm;
                PerformSearch(searchTerm, searchLang, titleMax, authorMax, nameMax, subjectMax);
            }
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            main.SetPageType(Main.PageType.Content);
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeBrowseUtils.js");
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/jquery-1.2.6.min.js");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                              "ResizeContentPanel('browseContentPanel', 258);ResizeBrowseDivs();");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                              "ResizeContentPanel('browseContentPanel', 258);ResizeBrowseDivs();");

            Data.PageSummaryView              ps        = null;
            CustomGenericList <Data.Item>     items     = null;
            CustomGenericList <Data.Creator>  creators  = null;
            CustomGenericList <Data.TitleTag> titleTags = null;
            CustomGenericList <Data.Title_TitleIdentifier> titleIdentifiers  = null;
            CustomGenericList <Data.TitleAssociation>      titleAssociations = null;

            Data.Title title    = null;
            bool       showData = false;
            int        titleId  = 0;

            if (Request["titleid"] != null)
            {
                if (!int.TryParse(Request.QueryString["titleid"], out titleId))
                {
                    // Request seems to have included a MARCBibID instead of a TitleId
                    Data.PageSummaryView psBib = bhlProvider.PageTitleSummarySelectByBibID(Request.QueryString["titleid"].ToString());
                    if (psBib != null)
                    {
                        titleId = psBib.TitleID;
                    }
                }
                showData = true;
            }

            if (!showData && Request.QueryString["oclc"] != null)
            {
                // Get the title id associated with the OCLC identifier
                Data.Title_TitleIdentifier titleTitleId = bhlProvider.Title_TitleIdentifierSelectByIdentifierValue(Request.QueryString["oclc"].ToString());
                if (titleTitleId != null)
                {
                    titleId = titleTitleId.TitleID;
                }
                showData = true;
            }

            if (showData)
            {
                hidTitleID.Value = titleId.ToString();

                // Check to make sure this title hasn't been replaced.  If it has, redirect
                // to the appropriate titleid.
                title = bhlProvider.TitleSelect(titleId);
                if (title.RedirectTitleID != null)
                {
                    Response.Redirect("/bibliography/" + title.RedirectTitleID.ToString());
                    Response.End();
                }

                // Set the title for the COinS
                COinSControl1.TitleID = titleId;

                ps = bhlProvider.PageTitleSummarySelectByTitleId(titleId);
                if (ps == null)
                {
                    Response.Redirect("/TitleNotFound.aspx");
                    Response.End();
                }
                Barcode           = ps.BarCode;
                creators          = bhlProvider.CreatorSelectByTitleId(titleId);
                items             = bhlProvider.ItemSelectByTitleId(titleId);
                titleTags         = bhlProvider.TitleTagSelectTagTextByTitleId(titleId);
                titleIdentifiers  = bhlProvider.Title_TitleIdentifierSelectByTitleID(titleId);
                titleAssociations = bhlProvider.TitleAssociationSelectByTitleId(titleId, true);

                if (titleAssociations.Count == 0)
                {
                    associationsDiv.Visible = false;
                }
                else
                {
                    associationsDiv.Visible         = true;
                    associationsRepeater.DataSource = titleAssociations;
                    associationsRepeater.DataBind();
                }

                foreach (Data.Item item in items)
                {
                    // Populate empty volume descriptions with default text
                    if (item.Volume == String.Empty || item.Volume == null)
                    {
                        if (items.Count == 1)
                        {
                            item.Volume = "View Book";
                        }
                        if (items.Count > 1)
                        {
                            item.Volume = "(no volume description)";
                        }
                    }

                    // Make sure all Botanicus PDFs actually exist.  Remove the DownloadUrl for any that do not.
                    if (item.DownloadUrl != String.Empty && item.ItemSourceID == 2)
                    {
                        // This is kludgy... should find a better way to do this
                        String pdfLocation = item.DownloadUrl.Replace("http://www.botanicus.org/", "\\\\server\\").Replace('/', '\\');
                        if (new BHLProvider().GetFileAccessProvider(ConfigurationManager.AppSettings["UseRemoteFileAccessProvider"] == "true").FileExists(pdfLocation))
                        {
                            item.DownloadUrl = ConfigurationManager.AppSettings["PdfAuthUrl"] != null?String.Format(ConfigurationManager.AppSettings["PdfAuthUrl"], item.BarCode) : String.Empty;
                        }
                        else
                        {
                            item.DownloadUrl = String.Empty;
                        }
                    }
                }

                // Look for an OCLC identifier (use the first one... might need to account for multiple at some point)
                bool oclcFound = false;
                foreach (Data.Title_TitleIdentifier titleIdentifier in titleIdentifiers)
                {
                    if (String.Compare(titleIdentifier.IdentifierName, "OCLC", StringComparison.CurrentCultureIgnoreCase) == 0)
                    {
                        localLibraryLink.NavigateUrl += "wcpa/oclc/";
                        if (titleIdentifier.IdentifierValue.ToLower().StartsWith("ocm"))
                        {
                            //strip the "ocm" from the beginning of the value.
                            localLibraryLink.NavigateUrl += titleIdentifier.IdentifierValue.Substring(3);
                        }
                        else
                        {
                            localLibraryLink.NavigateUrl += titleIdentifier.IdentifierValue;
                        }
                        oclcFound = true;
                        break;
                    }
                }

                if (!oclcFound)
                {
                    string truncatedTitle = "";
                    if (title.FullTitle.Length > 220)
                    {
                        truncatedTitle = title.FullTitle.Substring(0, 220);
                        truncatedTitle = truncatedTitle.Substring(0, truncatedTitle.LastIndexOf(" "));
                    }
                    else
                    {
                        truncatedTitle = title.FullTitle;
                    }
                    localLibraryLink.NavigateUrl += "search?q=" + truncatedTitle.Replace(" ", "+") + "&qt=owc_search";
                }

                Master.Page.Title = "Biodiversity Heritage Library: Information about '" + ps.FullTitle + "'";
                //descriptionLiteral.Text = title.TitleDescription;
                publicationInfoLiteral.Text = title.PublicationDetails;
                fullTitleLiteral.Text       = title.FullTitle + " " + (title.PartNumber ?? "") + " " + (title.PartName ?? "");
                if (title.CallNumber == null || title.CallNumber.Length == 0)
                {
                    callNumberPanel.Visible = false;
                }
                else
                {
                    callNumberLiteral.Text = title.CallNumber;
                }

                if (titleTags == null || titleTags.Count == 0)
                {
                    subjectPanel.Visible = false;
                }
                else
                {
                    int           k  = titleTags.Count - 1;
                    int           i  = 0;
                    StringBuilder sb = new StringBuilder();
                    foreach (Data.TitleTag titleTag in titleTags)
                    {
                        sb.Append("<a href='/subject/");
                        sb.Append(Server.UrlEncode(titleTag.TagText));
                        sb.Append("'>");
                        sb.Append(titleTag.TagText);
                        sb.Append("</a>");

                        if (i + 1 <= k)
                        {
                            sb.Append(", ");
                        }
                        i++;
                    }
                    subjectLiteral.Text = sb.ToString();
                }

                itemRepeater.DataSource = items;
                itemRepeater.DataBind();

                CustomGenericList <Data.Creator> authors           = new CustomGenericList <Data.Creator>();
                CustomGenericList <Data.Creator> additionalAuthors = new CustomGenericList <Data.Creator>();
                foreach (Data.Creator creator in creators)
                {
                    if (creator.CreatorRoleTypeForTitle >= 1 && creator.CreatorRoleTypeForTitle <= 3)
                    {
                        authors.Add(creator);
                    }
                    else
                    {
                        additionalAuthors.Add(creator);
                    }
                }
                authorsRepeater.DataSource = authors;
                authorsRepeater.DataBind();
                additionalAuthorsRepeater.DataSource = additionalAuthors;
                additionalAuthorsRepeater.DataBind();

                //Data.Institution institution = bhlProvider.InstitutionSelectByItemID( ps.ItemID );
                //if ( institution != null )
                //{
                //    if ( institution.InstitutionUrl != null && institution.InstitutionUrl.Trim().Length > 0 )
                //    {
                //        HyperLink link = new HyperLink();
                //        link.Text = institution.InstitutionName;
                //        link.NavigateUrl = institution.InstitutionUrl;
                //        link.Target = "_blank";
                //        attributionPlaceHolder.Controls.Add( link );
                //    }
                //    else
                //    {
                //        Literal literal = new Literal();
                //        literal.Text = institution.InstitutionName;
                //        attributionPlaceHolder.Controls.Add( literal );
                //    }
                //}

                if (Helper.IsAdmin(Request))
                {
                    editTitleLink.NavigateUrl = "/Admin/TitleEdit.aspx?id=" + titleId.ToString();
                }
                else
                {
                    editTitleLink.Visible = false;
                }

                // Get the full MARC details
                bool   marcFound = false;
                String filepath  = ps.MarcXmlLocation;
                bool   test      = (ConfigurationManager.AppSettings["UseRemoteFileAccessProvider"] == "true");
                if (new BHLProvider().GetFileAccessProvider(ConfigurationManager.AppSettings["UseRemoteFileAccessProvider"] == "true").FileExists(filepath))
                {
                    marcFound = true;
                }
                else
                {
                    // File not found in primary location, so look in alternate location (Botanicus files in alt location)
                    filepath = ps.MarcXmlAltLocation;
                    if (new BHLProvider().GetFileAccessProvider(ConfigurationManager.AppSettings["UseRemoteFileAccessProvider"] == "true").FileExists(filepath))
                    {
                        marcFound = true;
                    }
                }

                if (marcFound)
                {
                    string marcXML = new BHLProvider().GetFileAccessProvider(ConfigurationManager.AppSettings["UseRemoteFileAccessProvider"] == "true").GetFileText(filepath);

                    XmlDocument  xml    = new XmlDocument();
                    StringReader reader = new StringReader(marcXML);
                    xml.Load(reader);

                    // Set up the XSL resolver that we'll use to extract the text from the xml
                    XmlUrlResolver resolver = new XmlUrlResolver();
                    resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;
                    System.Xml.Xsl.XslTransform xslTransform = new System.Xml.Xsl.XslTransform();

                    // Format the MARC XML into a "readable" format
                    xslTransform.Load(Request.PhysicalApplicationPath + "xsl\\MARC21transformEnglish.xsl", resolver);
                    StringWriter output = new StringWriter();
                    xslTransform.Transform(xml, null, output, resolver);
                    litExpanded.Text = output.ToString();

                    // Format the MARC XML into a "flat" MARC format
                    xslTransform.Load(Request.PhysicalApplicationPath + "xsl\\MARC21transformMARC.xsl", resolver);
                    output = new StringWriter();
                    xslTransform.Transform(xml, null, output, resolver);
                    litMarc.Text = output.ToString();

                    viewcontrol.Visible = true;
                }
                else
                {
                    viewcontrolnomarc.Visible = true;
                }

                // Get the BibTex citations for this title
                try
                {
                    hypBibTex.NavigateUrl += title.TitleID.ToString();
                    litBibTeX.Text         = bhlProvider.TitleBibTeXGetCitationStringForTitleID(title.TitleID).Replace("\n", "<br>").Replace("\r", "<br>");
                }
                catch
                {
                    hypBibTex.Visible = false;
                    litBibTeX.Text    = "Error retrieving BibTex citations for this title.";
                }

                // Get the EndNote citation for this title
                try
                {
                    hypEndNote.NavigateUrl += title.TitleID.ToString();
                    litEndNote.Text         = bhlProvider.TitleEndNoteGetCitationStringForTitleID(title.TitleID,
                                                                                                  ConfigurationManager.AppSettings["ItemPageUrl"].ToString()).Replace("\n", "<br>").Replace("\r", "<br>");
                }
                catch
                {
                    hypEndNote.Visible = false;
                    litEndNote.Text    = "Error retrieving EndNote citations for this title.";
                }
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            main.SetPageType(Main.PageType.Content);
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeBrowseUtils.js");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                              "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                              "ResizeBrowseDivs();ResizeContentPanel('browseContentPanel', 258);");

            String institutionCode = String.Empty;

            if (this.Request.Cookies["ddlContributors"] != null)
            {
                institutionCode = this.Request.Cookies["ddlContributors"].Value;
            }

            String languageCode = String.Empty;

            if (this.Request.Cookies["ddlLanguage"] != null)
            {
                languageCode = this.Request.Cookies["ddlLanguage"].Value;
            }

            if (Request.QueryString["tagText"] != null)
            {
                tagText = Request.QueryString["tagText"];
            }

            // If we're referred here by the search page and the "secondary titles" flag was set,
            // then include secondary titles in the search.
            String includeSecondaryTitles = String.Empty;

            if (Request.UrlReferrer != null)
            {
                if (Request.UrlReferrer.LocalPath.ToLower().Contains("search.aspx") &&
                    Request.UrlReferrer.Query.ToLower().Contains("sec=1"))
                {
                    includeSecondaryTitles = "1";
                }
            }
            CustomGenericList <Data.Title> list = bhlProvider.TitleSelectByTagTextInstitutionAndLanguage(tagText, institutionCode, languageCode, includeSecondaryTitles);
            //titleRepeater.DataSource = list;
            //titleRepeater.DataBind();

            string headerText = list.Count + " Title";

            if (list.Count != 1)
            {
                headerText += "s";
            }
            headerText          += " tagged with \"" + tagText + "\"";
            pageHeaderLabel.Text = headerText;

            foreach (Data.Title title in list)
            {
                HtmlGenericControl li = new HtmlGenericControl("li");
                li.InnerHtml = "<a href=\"/bibliography/" + title.TitleID.ToString() + "\" class=\"booktitle\">" + title.FullTitle +
                               " " + (title.PartNumber ?? "") + " " + (title.PartName ?? "") +
                               "</a><br />" +
                               "Publication Info: " + title.PublicationDetails + "<br />" +
                               "Contributed By: " + title.InstitutionName + "<br/>" +
                               "Tags: ";
                foreach (string tag in title.Tags)
                {
                    li.InnerHtml += "<a href=\"/subject/" + tag + "\" class=\"TitleTag\">" + tag +
                                    "</a>&nbsp;&nbsp;";
                }
                titleList.Controls.Add(li);
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //authorListContentPanel.SetTableID("authorListContentPanel");
            authorContentPanel.SetTableID("authorDetailContentPanel");
            //Page.Master.Page.Header.Controls.Add(ControlGenerator.GetScriptControl("/Scripts/ResizeContentPanelUtils.js"));
            //ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeContentPanelUtils.js");
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "/Scripts/ResizeBrowseUtils.js");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onload",
                                                              "ResizeContentPanel('authorDetailContentPanel', 258);ResizeBrowseDivs();");
            ControlGenerator.AddAttributesAndPreserveExisting(main.Body, "onresize",
                                                              "ResizeContentPanel('authorDetailContentPanel', 258);ResizeBrowseDivs();");
            //CustomGenericList<Data.Creator> creators = bhlProvider.CreatorSelectAll();
            //authorsDropDownList.DataSource = creators;
            //authorsDropDownList.DataTextField = "CreatorName";
            //authorsDropDownList.DataValueField = "CreatorId";
            //authorsDropDownList.DataBind();
            //authorsDropDownList.Attributes.Add("onchange",
            //                          "location.href='/creator/' + this.options[selectedIndex].value");


            if (Request["CreatorId"] != null)
            {
                int creatorId = 0;
                try
                {
                    creatorId = int.Parse(Request["CreatorId"]);
                }
                catch
                {
                    CreatorNotFound();
                }
                Data.Creator c = bhlProvider.CreatorSelectAuto(creatorId);
                if (c == null)
                {
                    CreatorNotFound();
                }

                //authorsDropDownList.SelectedValue = c.CreatorID.ToString();
                creatorNameLiteral.Text = c.MARCCreator_a;
                if (c.MARCCreator_b != null)
                {
                    creatorNameLiteral.Text += " " + c.MARCCreator_b;
                }
                if (c.DOB != null && c.DOB != "")
                {
                    lifespanLiteral.Text = c.DOB;
                }
                if (c.DOD != null && c.DOD != "")
                {
                    if (lifespanLiteral.Text != "")
                    {
                        lifespanLiteral.Text += " - " + c.DOD;
                    }
                    else
                    {
                        lifespanLiteral.Text += "Died " + c.DOD;
                    }
                }
                else if (lifespanLiteral.Text != "")
                {
                    lifespanLiteral.Text = "Born " + lifespanLiteral.Text;
                }
                if (lifespanLiteral.Text != "")
                {
                    lifespanLiteral.Text = "(" + lifespanLiteral.Text + ")";
                }

                // If we're referred here by the search page and the "secondary titles" flag was set,
                // then include secondary titles in the search.
                String includeSecondaryTitles = String.Empty;
                if (Request.UrlReferrer != null)
                {
                    if (Request.UrlReferrer.LocalPath.ToLower().Contains("search.aspx") &&
                        Request.UrlReferrer.Query.ToLower().Contains("sec=1"))
                    {
                        includeSecondaryTitles = "1";
                    }
                }
                titlesRepeater.DataSource = bhlProvider.TitleSelectByCreator(c.CreatorID, includeSecondaryTitles);
                titlesRepeater.DataBind();

                biographyLiteral.Text = c.Biography;
            }
        }