-
Notifications
You must be signed in to change notification settings - Fork 103
Replace absolute links with relative links #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace absolute links with relative links #357
Conversation
_posts/2010-06-01-odata-workshops-in-raleigh-charlotte-atlanta-chicago-and-nyc.html
Show resolved
Hide resolved
_posts/2011-11-08-odata-service-validation-tool-update-19-new-rules.html
Show resolved
Hide resolved
...08-28-odataquerybuilder-a-cross-browser-javascript-library-for-building-odata-queries-3.html
Outdated
Show resolved
Hide resolved
KenitoInc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left comments on broken links. Not sure if they should be fixed in this PR or in a different PR
_posts/2011-10-25-odata-service-validation-tool-update-new-feature-and-rules.html
Show resolved
Hide resolved
_posts/2010-06-01-odata-workshops-in-raleigh-charlotte-atlanta-chicago-and-nyc.html
Show resolved
Hide resolved
_posts/2011-11-08-odata-service-validation-tool-update-19-new-rules.html
Show resolved
Hide resolved
_posts/2012-02-28-odata-service-validation-tool-update-ground-work-for-v3-support.html
Show resolved
Hide resolved
_posts/2014-12-15-advanced-odata-tutorial-with-simple-odata-client.html
Outdated
Show resolved
Hide resolved
...n-tech-china-releases-odata-producer-codegen-for-to-tap-the-gold-mine-of-corporate-data.html
Show resolved
Hide resolved
|
You could check the following instances of absolute URLs and confirm whether they've been retained as such intentionally:
<a href="https://www.odata.org/media/6652/%5bmc-csdl%5d%5b1%5d.htm#_Toc246717571">
<a href="https://www.odata.org/RoadShowRegistration">Register here</a>
<a href="https://www.odata.org/ ">https://www.odata.org/ </a>
<a href="https://www.odata.org/OData.html#canonicalurl">Canonical URL</a>
[<a href="https://www.odata.org/media/30002/json">OData:JSON</a>]
<a href="https://www.odata.org/media/30002/ODataAtomPayload">Atom Payload</a>
<a href="https://www.odata.org/media/16348/[mc-csdl].pdf">[CSDL]</a><a href="https://www.odata.org/media/16343/[mc-edmx].pdf">[EDMX]</a>
[<a href="https://www.odata.org/media/6652/[mc-csdl][1].htm">CDSL</a>]
<a href="https://www.odata.org/media/6655/[mc-apdsu][1].htm">normative OData specification</a>
<a href="http://odata.org/feedback">feedback</a>
<a href="http://odata.org/roadshow">OData Roadshow</a>
<a href="http://odata.org/mailing-list">OData Mailing list</a>
<strong><link rel="http://odata.org/delta" href="http://</strong> <strong>conferenceorganization/v1/</strong> <strong>sessions/?$deltatoken=B:405973881944444416</strong><strong>"/><br />
<a href="http://odata.org">http://odata.org</a>
<p>For example; the following specifies a value of “Home” for the “PhoneNumberType” ValueTerm applied to the “PhoneNumber” property of a customer:</p>
{% highlight xml %}<code> <metadata:properties xmlns:contact="http://odata.org/vocabularies/contact/v1"><p>For example; the following specifies the “StreetAddress”, “City”, “Region”, “Country” and “Postal Code” properties of an “Address” TypeTerm applied to a customer entity:</p>
{% highlight xml %}<code> <metadata:properties xmlns:contact="http://odata.org/vocabularies/contact/v1">
{% highlight xml %}<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0">
<edmx:AnnotationsReference Url="http://odata.org/ann/a">
<edmx:Include />
</edmx:AnnotationsReference>
<edmx:AnnotationsReference Url="http://odata.org/ann/b">
<edmx:Include TermNamespace="org.example.validation" />
<edmx:Include TermNamespace="org.example.display" Qualifier="Slate" />
</edmx:AnnotationsReference>
<edmx:DataServices ...>
</edmx:Edmx>
{% endhighlight %}
<p>All annotations from <code>http://odata.org/ann/a</code> are included. For <code>http://odata.org/ann/b</code>, only the following annotations are included:</p>
<p>Then this 'free floating' element is 'annotating' the Email property using the 'http://odata.org/vocabularies/constraints' vocabulary:</p>
<p><em><Annotation AppliesTo="http://server/service/$metadata/Properties('Namespace.Person.Email')"<br />
xmlns:validation="http://odata.org/vocabularies/constraints"><br />
<validation:Constraint m:Type="validation:Constraint" ><br />
<validation:Regex>^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,6}$.</validation:Regex><br />
<validation:ErrorMessage>Please enter a valid EmailAddress</validation:ErrorMessage><br />
</validation:Constraint><br />
</Annotation></em></p>
<p>Annotation by reference also neatly sidesteps issue (3), i.e. the object annotated is left structurally unchanged, which means we could use a similar approach to annotate data without breaking code (like a javascript path) that relies on a particular structure.</p>
<p>Another nice side-effect of this design is that you can use it 'inside' the CSDL too, simply by removing the address of the metadata service from the AppliesTo url - since we are in the CSDL we can us 'relative addressing':</p>
<p><em><Annotation AppliesTo="Properties('Namespace.Person.Email')"<br />
xmlns:validation="http://odata.org/vocabularies/constraints"><br />
<validation:Constraint m:Type="validation:Constraint" ><br />
<validation:Regex>^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,6}$.</validation:Regex><br />
<validation:ErrorMessage>Please enter a valid EmailAddress</validation:ErrorMessage><br />
</validation:Constraint><br />
</Annotation></em></p>
<p>Indeed if you have a separate file with many annotations for a particular model, you could group a series of annotations together like this:</p>
<p><em><Annotations AppliesTo="http://server/service/$metadata/"><br />
<Annotation AppliesTo="Properties('Namespace.Person.Email')"<br />
xmlns:validation="http://odata.org/vocabularies/constraints"><br />
<validation:Constraint m:Type="validation:Constraint" ><br />
<validation:Regex>^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,6}$.</validation:Regex><br />
<validation:ErrorMessage>Please enter a valid EmailAddress</validation:ErrorMessage><br />
</validation:Constraint><br />
</Annotation><br />
<Annotation AppliesTo="Properties('Namespace.Customer.Email')"<br />
xmlns:validation="http://odata.org/vocabularies/constraints"><br />
<validation:Constraint m:Type="validation:Constraint" ><br />
<validation:Regex>^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,6}$.</validation:Regex><br />
<validation:ErrorMessage>Please enter a valid EmailAddress</validation:ErrorMessage><br />
</validation:Constraint><br />
</Annotation><br />
</Annotations></em></p> |
|
@KenitoInc @habbes I came across the following dead links referencing odata.org when working on this PR:
I left the above links as they were. There was no sense in converting them into relative URLs if that too would result into 404s. I also didn't have a valid alternative I could change them to. |
@habbes
The following list comprises of links embedded in code/csdl snippets and they should be fine as is:
I replaced |
64836bf to
d1adb28
Compare
When one is running the site locally or on staging, the Bootstrap CSS file as well as other source files are referenced from the OData.org website. This makes it difficult to identify any issues that might exist (e.g., files missing locally or on staging) until the site is already published. By replacing absolute links with relative links, it makes it possible to run the site from any particular environment in isolation. The isolation makes is possible to pick out any issues before they make it to production.
Here's the absolute URL for the Bootstrap CSS file in _includes/head.html:

An important thing to note about the Bootstrap CSS file referenced from the OData.org website is that it was not under source control. It appears like it was pushed to the site directly - probably using ftp. In addition, it's not a replica of any of the officially available versions of bootstrap.min.css:

More about bootswatch here: https://bootswatch.com/
The CSS file with the custom changes has now been added to the repo and is built together with other source files.
Below is a table of the absolute URLs substituted with relative URLs with checks done to confirm that each relative link loads the expected page - no 404s:
In addition, an additional yaml file _config_staging.yml was added. That file the site URL set to the staging endpoint:
The _config_staging.yml file is used when building the site for staging deployment as follows:
When the
configoption is specified in this manner, jekyll will apply the specified config file when building site:transformed to:
Known dead links referencing odata.org
I left the above links as they were. There was no sense in converting them into relative URLs if that too would result into 404s.