[MGNLETK-29] LinkUtil fails to generate links in the multi site environment Created: 25/May/10 Updated: 03/Jul/14 Resolved: 07/Jun/10 |
|
| Status: | Closed |
| Project: | Extended Templating Kit (closed) |
| Component/s: | None |
| Affects Version/s: | 1.3.1 |
| Fix Version/s: | 1.3.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Ernst Bunders | Assignee: | Jan Haderka |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | multisite, vpro | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
Inside my AbstractSyndFeedGenerator implementation I run a query on some content nodes, and then for each node create a SyndEntry where I use info.magnolia.link.LinkUtil.createAbsoluteLink(content) to create the rss item link. This causes a stack trace, which I include. I traced the problem to info.magnolia.module.extendedtemplatingkit.CrossSiteAbsolutePathTransformer.prefixLink(String linkStr). I had some communication about this with Jan, who suggested I should use LinkUtil.createExternalLink(). But this method does not know how to resolve the hostname (based on multi site configuration), and it also does not know how the links to pages in the site should be created. I hope this information is sufficient. If not, i will supply what is required. |
| Comments |
| Comment by Ernst Bunders [ 26/May/10 ] |
|
Some files that demonstrate what code causes our problem with the rss. |
| Comment by Ernst Bunders [ 26/May/10 ] |
|
for completeness: the configuration xml |
| Comment by Jan Haderka [ 26/May/10 ] |
|
This issue is fixed by changes made for |
| Comment by Jan Haderka [ 27/May/10 ] |
|
All the issues are still undergoing testing, but if you want to test as well (and I would really appreciate that): Thanks Jan |
| Comment by Ernst Bunders [ 28/May/10 ] |
|
Yes, the rss seems to be working again, calling: and using: sb.append(link); this creates a link like: When I use LinkUtil.createExternalLink(content), I see that the link is created with the hostname linked to the site, like: One remark: port numbers are ignored, so if you run the app on a non-standard (80) port, the links won't work. Not a big deal, but worth mentioning. I also tried both variations from: But..... When i open the site like |
| Comment by Jan Haderka [ 28/May/10 ] |
|
Actually you should use the LinkUtil.createExternalLink(Content) since it is now site aware and will generate the complete URL for you. As for the port, in the domain configuration in your site you can now (apart from the name of the domain) specify port, protocol and context. If you have more then one domain, the one matching the current domain will be used. If none matches the current, the first one will be used. |
| Comment by Ernst Bunders [ 01/Jun/10 ] |
|
I just checked the links again, and can report that both in the rss feeds and in the site (when opened from admin central) work ok. magnolia-core-4.3.2-20100528.163321-7.jar Let's hope we can switch back to stable versions again soon... |