/// <summary> Returns flag that indicates this citation section writer /// will be writing alues to the output stream </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Item"> Digital resource to analyze for data to write </param> public bool Has_Data_To_Write(CitationElement ElementInfo, BriefItemInfo Item) { // Look for a match in the item description BriefItem_DescriptiveTerm firstCreator = Item.Get_Description("Creator"); return((firstCreator != null) && (firstCreator.Values.Count > 0)); }
/// <summary> Returns flag that indicates this citation section writer /// will be writing alues to the output stream </summary> /// <param name="Item"> Digital resource to analyze for data to write </param> /// <param name="ElementInfo"> Additional possible data about this citation element </param> public bool Has_Data_To_Write(CitationElement ElementInfo, BriefItemInfo Item) { // Look for a match in the item description BriefItem_DescriptiveTerm firstSpatial = Item.Get_Description("Hierarchical Spatial"); return((firstSpatial != null) && (firstSpatial.Values.Count > 0)); }
/// <summary> Wites a section of citation from a provided digital resource </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Output"> Response stream for the item viewer to write directly to </param> /// <param name="Item"> Digital resource with all the data to write </param> /// <param name="LeftColumnWidth"> Number of pixels of the left column, or the definition terms </param> /// <param name="SearchLink"> Beginning of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="SearchLinkEnd"> End of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> public void Write_Citation_Section(CitationElement ElementInfo, StringBuilder Output, BriefItemInfo Item, int LeftColumnWidth, string SearchLink, string SearchLinkEnd, Custom_Tracer Tracer, Navigation_Object CurrentRequest) { string displayLabel = "Aggregations"; Output.AppendLine(" <dt class=\"sbk_CivAGGGR_Element\" style=\"width:" + LeftColumnWidth + "px;\" >" + displayLabel + ": </dt>"); Output.Append(" <dd class=\"sbk_CivAGGR_Element\" style=\"margin-left:" + LeftColumnWidth + "px;\" >"); bool first = true; foreach (string code in Item.Behaviors.Aggregation_Code_List) { // Get the aggregation by code Item_Aggregation_Related_Aggregations aggr = UI_ApplicationCache_Gateway.Aggregations[code]; // If it found the aggr stuff if (aggr != null) { // Go to a new line if not the first if (first) { first = false; } else { Output.AppendLine("<br />"); } // Write this Output.AppendLine("<a href=\"" + CurrentRequest.Base_URL + code + "\">" + HttpUtility.HtmlEncode(aggr.Name) + "</a>"); } } Output.AppendLine("</dd>"); Output.AppendLine(); }
/// <summary> Wites a section of citation from a provided digital resource </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Output"> Response stream for the item viewer to write directly to </param> /// <param name="Item"> Digital resource with all the data to write </param> /// <param name="LeftColumnWidth"> Number of pixels of the left column, or the definition terms </param> /// <param name="SearchLink"> Beginning of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="SearchLinkEnd"> End of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> public void Write_Citation_Section(CitationElement ElementInfo, StringBuilder Output, BriefItemInfo Item, int LeftColumnWidth, string SearchLink, string SearchLinkEnd, Custom_Tracer Tracer, Navigation_Object CurrentRequest) { BriefItem_DescriptiveTerm creatorList = Item.Get_Description("Creator"); bool first_creator = true; string displayLabel = (String.IsNullOrEmpty(ElementInfo.DisplayTerm)) ? "Creators" : ElementInfo.DisplayTerm; Output.AppendLine(" <dt class=\"sbk_CivCREATOR_Element\" style=\"width:" + LeftColumnWidth + "px;\" >" + displayLabel + ": </dt>"); Output.Append(" <dd class=\"sbk_CivCREATOR_Element\" style=\"margin-left:" + LeftColumnWidth + "px;\" >"); // Determine if ths standard itemprop was overriden string itemProp = (!String.IsNullOrWhiteSpace(ElementInfo.ItemProp)) ? ElementInfo.ItemProp : "creator"; // Determine if the standard search code was overriden string searchCode = (!String.IsNullOrWhiteSpace(ElementInfo.SearchCode)) ? ElementInfo.SearchCode : "AU"; foreach (BriefItem_DescTermValue thisValue in creatorList.Values) { // Was this the first? if (first_creator) { first_creator = false; } else { Output.AppendLine("<br />"); } // It is possible a different search term is valid for this item, so check it string searchTerm = (!String.IsNullOrWhiteSpace(thisValue.SearchTerm)) ? thisValue.SearchTerm : thisValue.Value; Output.Append("<span itemprop=\"" + itemProp + "\">" + SearchLink.Replace("<%VALUE%>", search_link_from_value(searchTerm)).Replace("<%CODE%>", searchCode) + display_text_from_value(thisValue.Value) + SearchLinkEnd); if (!String.IsNullOrEmpty(thisValue.Authority)) { Output.Append(" ( " + display_text_from_value(thisValue.Authority) + " ) "); } if (!String.IsNullOrEmpty(thisValue.SubTerm)) { Output.Append(" ( <i>" + display_text_from_value(thisValue.SubTerm) + "</i> ) "); } Output.AppendLine("</span>"); } Output.AppendLine("</dd>"); Output.AppendLine(); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as RelatedArtifact; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (TypeElement != null) { dest.TypeElement = (Code <Hl7.Fhir.Model.RelatedArtifact.RelatedArtifactType>)TypeElement.DeepCopy(); } if (DisplayElement != null) { dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); } if (CitationElement != null) { dest.CitationElement = (Hl7.Fhir.Model.FhirString)CitationElement.DeepCopy(); } if (UrlElement != null) { dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); } if (Document != null) { dest.Document = (Hl7.Fhir.Model.Attachment)Document.DeepCopy(); } if (Resource != null) { dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); } return(dest); }
/// <summary> Wites a section of citation from a provided digital resource </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Output"> Response stream for the item viewer to write directly to </param> /// <param name="Item"> Digital resource with all the data to write </param> /// <param name="LeftColumnWidth"> Number of pixels of the left column, or the definition terms </param> /// <param name="SearchLink"> Beginning of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="SearchLinkEnd"> End of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> public void Write_Citation_Section(CitationElement ElementInfo, StringBuilder Output, BriefItemInfo Item, int LeftColumnWidth, string SearchLink, string SearchLinkEnd, Custom_Tracer Tracer, Navigation_Object CurrentRequest) { // Set the default (since this always displays) string rights_statement = "All applicable rights reserved by the source institution and holding location."; string rights_image = String.Empty; string uri = String.Empty; const string SEE_TEXT = "See License Deed"; // Look for a match in the item description BriefItem_DescriptiveTerm rightsTerm = Item.Get_Description("Rights Management"); if ((rightsTerm != null) && (rightsTerm.Values.Count > 0)) { rights_statement = rightsTerm.Values[0].Value; if ((rightsTerm.Values[0].URIs != null) && (rightsTerm.Values[0].URIs.Count == 1)) { uri = rightsTerm.Values[0].URIs[0]; switch (uri) { case "http://creativecommons.org/licenses/by-nc-nd/3.0/": rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Nc_Nd_Img; break; case "http://creativecommons.org/licenses/by-nc-sa/3.0/": rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Nc_Sa_Img; break; case "http://creativecommons.org/licenses/by-nc/3.0/": rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Nc_Img; break; case "http://creativecommons.org/licenses/by-nd/3.0/": rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Nd_Img; break; case "http://creativecommons.org/licenses/by-sa/3.0/": rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Sa_Img; break; case "http://creativecommons.org/licenses/by/3.0/": rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Img; break; case "http://creativecommons.org/publicdomain/zero/1.0/": rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_Zero_Img; break; } } } string displayLabel = (String.IsNullOrEmpty(ElementInfo.DisplayTerm)) ? "Rights Management" : ElementInfo.DisplayTerm; Output.AppendLine(" <dt class=\"sbk_CivRIGHTS_Element\" style=\"width:" + LeftColumnWidth + "px;\" >" + displayLabel + ": </dt>"); Output.Append(" <dd class=\"sbk_CivRIGHTS_Element\" style=\"margin-left:" + LeftColumnWidth + "px;\"><span itemprop=\"rights\">"); if ((rights_statement.IndexOf("http://") == 0) || (rights_statement.IndexOf("https://") == 0)) { Output.Append("<a href=\"" + rights_statement + "\" target=\"RIGHTS\" >" + rights_statement + "</a>"); } else { // Show the rights image? if (String.IsNullOrEmpty(rights_image)) { if (!String.IsNullOrEmpty(uri)) { Output.Append(rights_statement + " ( <a href=\"" + uri + "\" alt=\"" + SEE_TEXT + "\" target=\"license\">link</a> )"); } else { Output.Append(rights_statement); } } else { // Since the image is derived from the URI, there must be a URI here Output.Append("<a href=\"" + uri + "\" alt=\"" + SEE_TEXT + "\" target=\"cc_license\"><img src=\"" + rights_image + "\" /></a> " + rights_statement); } } Output.AppendLine("</span></dd>"); Output.AppendLine(); }
/// <summary> Returns flag that indicates this citation section writer /// will be writing values to the output stream </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Item"> Digital resource to analyze for data to write </param> /// <returns>TRUE if there is a value to write</returns> public bool Has_Data_To_Write(CitationElement ElementInfo, BriefItemInfo Item) { // Always show SOME rights return(true); }
/// <summary> Wites a section of citation from a provided digital resource </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Output"> Response stream for the item viewer to write directly to </param> /// <param name="Item"> Digital resource with all the data to write </param> /// <param name="LeftColumnWidth"> Number of pixels of the left column, or the definition terms </param> /// <param name="SearchLink"> Beginning of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="SearchLinkEnd"> End of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> public void Write_Citation_Section(CitationElement ElementInfo, StringBuilder Output, BriefItemInfo Item, int LeftColumnWidth, string SearchLink, string SearchLinkEnd, Custom_Tracer Tracer) { string displayLabel = (String.IsNullOrEmpty(ElementInfo.DisplayTerm)) ? "Spatial Coverage" : ElementInfo.DisplayTerm; Output.AppendLine(" <dt class=\"sbk_CivSPATIAL_COVERAGE_Element\" style=\"width:" + LeftColumnWidth + "px;\" >" + displayLabel + ": </dt>"); Output.Append(" <dd class=\"sbk_CivSPATIAL_COVERAGE_Element\" style=\"margin-left:" + LeftColumnWidth + "px;\">"); int spatial_count = 1; while (true) { // Determine the term to use string term = "Hierarchical Spatial"; if (spatial_count > 1) { term = term + " (" + spatial_count + ")"; } // Look for the match BriefItem_DescriptiveTerm thisSpatial = Item.Get_Description(term); // If no match, break out of this while loop if ((thisSpatial == null) || (thisSpatial.Values == null)) { break; } // Past the first complex spatial subject? if (spatial_count > 1) { Output.AppendLine("<br />"); } // Step through each subterm StringBuilder spatial_builder = new StringBuilder(); foreach (BriefItem_DescTermValue thisValue in thisSpatial.Values) { if (spatial_builder.Length > 0) { spatial_builder.Append(" -- "); } switch (thisValue.SubTerm) { case "Continent": case "Province": case "Region": case "Territory": case "City Section": case "Island": case "Area": spatial_builder.Append(thisValue.Value); break; case "Country": spatial_builder.Append(SearchLink.Replace("<%VALUE%>", HttpUtility.HtmlEncode(thisValue.Value.Replace("&", "&").Replace("&", "").Replace(" ", " ")).Replace(",", "").Replace("&", "&").Replace("&", "").Replace(" ", "+")).Replace("<%CODE%>", "CO") + thisValue.Value + SearchLinkEnd); break; case "State": spatial_builder.Append(SearchLink.Replace("<%VALUE%>", HttpUtility.HtmlEncode(thisValue.Value.Replace("&", "&").Replace("&", "").Replace(" ", " ")).Replace(",", "").Replace("&", "&").Replace("&", "").Replace(" ", "+")).Replace("<%CODE%>", "ST") + thisValue.Value + SearchLinkEnd); break; case "County": spatial_builder.Append(SearchLink.Replace("<%VALUE%>", HttpUtility.HtmlEncode(thisValue.Value.Replace("&", "&").Replace("&", "").Replace(" ", " ")).Replace(",", "").Replace("&", "&").Replace("&", "").Replace(" ", "+")).Replace("<%CODE%>", "CT") + thisValue.Value + SearchLinkEnd); break; case "City": spatial_builder.Append(SearchLink.Replace("<%VALUE%>", HttpUtility.HtmlEncode(thisValue.Value.Replace("&", "&").Replace("&", "").Replace(" ", " ")).Replace(",", "").Replace("&", "&").Replace("&", "").Replace(" ", "+")).Replace("<%CODE%>", "CI") + thisValue.Value + SearchLinkEnd); break; } } // Display this Output.Append(" " + spatial_builder); // Move to check the next spatial spatial_count++; } Output.AppendLine("</dd>"); Output.AppendLine(); }
/// <summary> Wites a section of citation from a provided digital resource </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Output"> Response stream for the item viewer to write directly to </param> /// <param name="Item"> Digital resource with all the data to write </param> /// <param name="LeftColumnWidth"> Number of pixels of the left column, or the definition terms </param> /// <param name="SearchLink"> Beginning of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="SearchLinkEnd"> End of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> public void Write_Citation_Section(CitationElement ElementInfo, StringBuilder Output, BriefItemInfo Item, int LeftColumnWidth, string SearchLink, string SearchLinkEnd, Custom_Tracer Tracer, Navigation_Object CurrentRequest) { bool first_coordinate = true; string displayLabel = (String.IsNullOrEmpty(ElementInfo.DisplayTerm)) ? "Coordinates" : ElementInfo.DisplayTerm; Output.AppendLine(" <dt class=\"sbk_CivCOORDINATES_Element\" style=\"width:" + LeftColumnWidth + "px;\" >" + displayLabel + ": </dt>"); Output.Append(" <dd class=\"sbk_CivCOORDINATES_Element\" style=\"margin-left:" + LeftColumnWidth + "px;\" >"); // Add the points first if (Item.GeoSpatial.Point_Count > 0) { for (int i = 0; i < Item.GeoSpatial.Point_Count; i++) { // Was this the first? if (first_coordinate) { first_coordinate = false; } else { Output.AppendLine("<br />"); } // Add this coordiante if (Item.GeoSpatial.Points[i].Label.Length > 0) { Output.Append(" <span itemprop=\"geo\" itemscope itemtype=\"http://schema.org/GeoCoordinates\"><span itemprop=\"latitude\">" + Item.GeoSpatial.Points[i].Latitude + "</span> x <span itemprop=\"longitude\">" + Item.GeoSpatial.Points[i].Longitude + "</span> ( <span itemprop=\"name\">" + HttpUtility.HtmlEncode(Item.GeoSpatial.Points[i].Label) + "</span> )</span>"); } else { Output.Append(" <span itemprop=\"geo\" itemscope itemtype=\"http://schema.org/GeoCoordinates\"><span itemprop=\"latitude\">" + Item.GeoSpatial.Points[i].Latitude + "</span> x <span itemprop=\"longitude\">" + Item.GeoSpatial.Points[i].Longitude + "</span></span>"); } } } // If there is a single polygon ,add it if (Item.GeoSpatial.Polygon_Count == 1) { // If not the first, add for (int i = 0; i < Item.GeoSpatial.Polygon_Count; i++) { // Was this the first? if (first_coordinate) { first_coordinate = false; } else { Output.AppendLine("<br />"); } // Get the polygon and draw it BriefItem_Coordinate_Polygon polygon = Item.GeoSpatial.Polygons[i]; StringBuilder polygonBuilder = new StringBuilder(); foreach (BriefItem_Coordinate_Point thisPoint in polygon.Edge_Points) { if (polygonBuilder.Length > 0) { polygonBuilder.Append(", " + thisPoint.Latitude + " x " + thisPoint.Longitude); } else { polygonBuilder.Append(thisPoint.Latitude + " x " + thisPoint.Longitude); } } if (polygon.Label.Length > 0) { polygonBuilder.Append(" ( " + HttpUtility.HtmlEncode(polygon.Label) + " )"); } if (polygonBuilder.ToString().Trim().Length > 0) { Output.Append(" " + polygonBuilder); } } } Output.AppendLine("</dd>"); Output.AppendLine(); }
/// <summary> Returns flag that indicates this citation section writer /// will be writing alues to the output stream </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Item"> Digital resource to analyze for data to write </param> public bool Has_Data_To_Write(CitationElement ElementInfo, BriefItemInfo Item) { return((Item.GeoSpatial != null) && ((Item.GeoSpatial.Point_Count > 0) || (Item.GeoSpatial.Polygon_Count > 0))); }
/// <summary> Wites a section of citation from a provided digital resource </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Output"> Response stream for the item viewer to write directly to </param> /// <param name="Item"> Digital resource with all the data to write </param> /// <param name="LeftColumnWidth"> Number of pixels of the left column, or the definition terms </param> /// <param name="SearchLink"> Beginning of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="SearchLinkEnd"> End of the search link that can be used to allow the web patron to select a term and run a search against this instance </param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> public void Write_Citation_Section(CitationElement ElementInfo, StringBuilder Output, BriefItemInfo Item, int LeftColumnWidth, string SearchLink, string SearchLinkEnd, Custom_Tracer Tracer) { // This should never get called currently throw new NotImplementedException(); }
/// <summary> Returns flag that indicates this citation section writer /// will be writing alues to the output stream </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Item"> Digital resource to analyze for data to write </param> public bool Has_Data_To_Write(CitationElement ElementInfo, BriefItemInfo Item) { return(false); }
/// <summary> Returns flag that indicates this citation section writer /// will be writing values to the output stream </summary> /// <param name="ElementInfo"> Additional possible data about this citation element </param> /// <param name="Item"> Digital resource to analyze for data to write </param> /// <returns>TRUE if there is a value to write</returns> public bool Has_Data_To_Write(CitationElement ElementInfo, BriefItemInfo Item) { return((Item.Behaviors != null) && (Item.Behaviors.Aggregation_Code_List != null) && (Item.Behaviors.Aggregation_Code_List.Count > 0)); }