Your post is the longest one, ever :).
Technically you can use Uri (115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-en-gb.aspx) to build SEO Uri (http://yoursite/115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-en-gb.aspx)
If you want to use the hierarchical Uri, then your only option is to extend Entry with a property named HierarchicalUri, then add a controller with an action to return your CustomEntry with UrlResolver.GetUrl(ContentReference) to get the value of HierarchicalUri.
I haven't tried that myself, but that should be doable.
/Q
Hi Quan,
My goal here was to make your longest initial post. Did I achieve my goal?
In seriousness, we do use Hierarchical UIL's. You'd mentioned using UrlResolver.GetUrl(ContentReference) however this won't work in a console application correct? We have a custom home built Faceted Search and we'd like to index this data using our current existing code. In order to do this we'll need to get this data indexed using a console application. UrlResolver.GetUrl(ContentReference) only works in the main website episerver project, not the api correct?
-Paul
I'm not sure about UrlResolver - need to take a look at the code to see if it has dependencies on HttpContext (I think it hasn't, but I can be wrong). - but if you can't use it, simply write your code to get the Hierarchical. It's easy enough: get the IContent from ContentReference, cast it to IRoutable to get the UriSegment, then continue with its parent until you reach the Starting point.
/Q
When you referece to IContent, ContentReference and IRoutable, I believe all of these are native Episerver classes/methods. I'm using the Episerver API in a console application like the documentation below. This doesn't reference any of these classes/methods as, correct me if I'm wrong, I believe these exist only in the native Episerver website projects, not in console applications that use the API.
http://world.episerver.com/documentation/Items/Episerver-Service-API/
Am I going about this wrong? Should I use Nuget to include the Episerver reference in my console application, and run this with Episerver CMS attached to my project? This would allow me to use IContent, ContentReference and IRoutable class methods. I just don't know if this is supported.
-Paul
Hi Everyone,
I'm currently able to return an entry from the API however, I don't see anyway to get the full url without getting the parent product/nodes to build the url which wouldn't be efficient.
Here's my code so far.
I'm using the models right out of the github api sample located here: https://github.com/episerver/ServiceApi-Client/tree/master/EPiServer.ServiceApi.Client/Models/Catalog.
The, API call to '/episerverapi/commerce/entries/{entryCode}' returns this json.
Again, I'm looking to get the full url of the given entry. Any idea how to do this without doing additional calls to the parents to get the permalink of each parent product/node?
Thanks,
Paul