Hi,
I've got a strange problem.
I adjusted the HTML filter to accept notes:// schemes as we have a notes environment in our company and would like to link to notes documents from Clearspace.
After doing this, the href is not replaced by # but the notes:// scheme itself is removed and replaced with a / causing the URL be be understood as a URL within the clearspace server.
I have tested this on the same version localled and encounter no problems, so have to assume that it's a configuration issue but cannot find where this behaviour is located.
I see the issue in 2.5.11 and 3.0.2 as well.
Any ideas?
Thanks,
Ben.
BTW,
I've looked at this document: http://www.jivesoftware.com/jivespace/docs/DOC-4454
and have followed all the steps to no avail. Again, works in some environments, but not others.
Thanks,
Ben.
Hi Ben,
I was able to make this work in my environment. Did you make the setting in both the URL and HTML filters? Are those filters turned on? Did you make the change to the /template/global/content-picker.ftl template?
Regards,
Karl
Hi Karl,
I made all those configurations.
I'm able to insert notes:// links using the insert link interface.
When I save, the URL is not converted to a # character as would happen if
it wasn't disabled.
I don't know where it would remove the scheme but keep the rest of the URL
and this has worked in some environments (same version) and not others,
hence why I think it must be a configuration issue.
I have the possibility of debugging, but by the time it gets to the
DBDocument class, the URL has already been stripped of its scheme.
I'm guessing it is a filter that's doing it, but I believe they're both
configured as suggested.
Interestingly, the URL filter doesn't seem to change the behaviour in any
way:
globalRenderManager.HTMLFilter.allowedSchemesString =
http://,https://,ftp://,mailto:,notes://,
globalRenderManager.HTMLFilter.enabled = true
globalRenderManager.UrlFilter.enabled = true
globalRenderManager.UrlFilter.schemes =
http://,https://,mailto://,ftp://,notes://
Thanks,
Ben.
This e-mail, including attachments, is intended for the person(s) or
company named and may contain confidential and/or legally privileged
information. Unauthorized disclosure, copying or use of this information
may be unlawful and is prohibited. If you are not the intended recipient,
please delete this message and notify the sender.
All incoming and outgoing e-mail messages are stored in the Swiss Re
Electronic Message Repository. If you do not wish the retention of
potentially private e-mails by Swiss Re, we strongly advise you not to use
the Swiss Re e-mail account for any private, non-business related
communications.
Do you have the same result when you insert a link with the "Insert Link" interface vs. simply typing the link into the body of the text?
Hi Karl,
I've tried both. methods.
When I check the HTML code the link is correct, it's only during the save
which the URL is rewritten and then editing the document again, and viewing
the source shows that the URL is broken.
Is that even a filter that does that, or do filters just work when
displaying the content?
Thanks,
Ben.
This e-mail, including attachments, is intended for the person(s) or
company named and may contain confidential and/or legally privileged
information. Unauthorized disclosure, copying or use of this information
may be unlawful and is prohibited. If you are not the intended recipient,
please delete this message and notify the sender.
All incoming and outgoing e-mail messages are stored in the Swiss Re
Electronic Message Repository. If you do not wish the retention of
potentially private e-mails by Swiss Re, we strongly advise you not to use
the Swiss Re e-mail account for any private, non-business related
communications.
Ben,
The filters are applied to data as it is being read from the database and output to the user. If you look at the content in the database, it should appear as you submitted it.
One possibility is that if you added the links first, then made the change to allow the notes:// URL scheme, the original rendered content may be cached without the links. A cache flush or system restart would resolve the issue in this case.
Regards,
Karl
To clarify your comments above: you have seen this working on 2.5.11 and 3.0.2? Or was it a slightly different version?
Hi Karl,
Here are the results of my tests to date:
| Stack | App Version | Database | Tomcat | Java | Result |
|---|---|---|---|---|---|
| SBS 3.0.2 | 2.5.11 | postgres (SBS 3.0.2) | SBS 3.0.2 | SBS 3.0.2 | works |
| SBS 3.0.2 | 3.0.2 | postgres (SBS 3.0.2) | SBS 3.0.2 | SBS 3.0.2 | doesn't work |
| SBS 3.0.2 | 2.5.9 | Oracle 10g RAC SP2 | SBS 3.0.2 | SBS 3.0.2 | works |
| Swiss Re install | 2.5.9 | Oracle 10g RAC SP2 | 6.0.18 | 1.6.0_12 | doesn't work |
| Local maven project | 2.5.9 | postgres 8.3 | 6.0.18 | 1.6.0_13 | works |
| Local maven project | 2.5.11 | postgres 8.3 | 6.0.18 | 1.6.0_13 | works |
| Local maven project | 3.0.2 | postgres 8.3 | 6.0.18 | 1.6.0_13 | works |
"doesn't work" indicates where the notes:// URI is stripped from the content. "works" indicates where it doesn't get stripped.
I am able to debug in the SBS 3.0.2 stack version which doesn't work to try and locate the configuration which might be causing this. Given that it's in the data, it must be occurring during the save process. Any idea where a good place would be to create a breakpoint to try and follow the save process?
Thanks and Kind Regards,
Ben.
Given the thoroughness of your test plan, is it safe to assume that you are creating the same content in the same manner on each instance? I'm looking for anything that would be different between the instances which might cause this to behave in slightly different ways.
My other question: did you make these changes to the system properties table, or via the Spaces > Settings > Filters and Macros page? If you changed the system properties directly, you need to restart your server for the changes to take effect.
As far as debugging goes, I would recommend setting a breakpoint on the execute() method for the URLFilter, HTMLFilter, and DocCreateAction classes. This way you should be able to see the content as it gets passed through the different stages of filters.
Hi Karl,
I've found the problem.
It seems to be an issue with the com.jivesoftware.community.renderer.impl.v2.TinyMCESupport.reformatLinks method.
Specifically, the "isRelativeLink" method call returns true for notes:// links as the Java net URL class does not recognise the URI.
As a result, the absolutifyLink method is called, which has the following effect on the notes links.
It gets the base URL for SBS (Let's say baseHost/basePath)
It splits the link using "/" as the split character. Notes://therest results in ["Notes:", "", "therest"] (Note the empty string array element)
It then rebuild the URL by appending the base Path and then the rest of the URL, however, if it encounters an empty array element, it starts building the link from scratch.
In every case, it disregards the basePath of SBS due to the empty string array.
It prepands the baseHost to the built link.
It finally compares the resulting URL against the baseURL of SBS.
Now, here's the reason why it sometimes works and sometimes doesn't.
In the environments where I have SBS running in the root, it rewrites the URL as the baseHost has been prepended to the link and there's no basePath to match. The link is broken.
In the environment where I have SBS running on a none root path, it doesn't rewrite the URL as the baseURL is not matched as the basePath was removed during the link build. The link remains unchanged.
In summary,
I think the link should probably not be treated as a relative link, so the com.jivesoftware.community.renderer.impl.v2.TinyMCESupport.isRelativeLink method is ultimately at fault in this issue.
Please let me know what you would propose. I have also repeated this issue on SBS 3.0.3. Any protocols will be affacted that are not http, file and jar would have this problem.
Thanks and Kind Regards,
Ben Chiad.
Hi Benjamin,
Just wanted to clarify the results of your testing here:
Is this a correct understanding?
Regards,
Karl
That's correct.
Except that the URL is rewritten to
http://baseurl/url The notes:// protocol is also removed
The reason why it works when not using the root context is that there is a check at the end to ensure the URL contains the root and it doesn't as the "instance" is removed during the rebuilding of the URL. When the root context is used, there is no "instance" part in the URL so the check is passed and the URL is rewritten.
Regardless, the isRelative check is returning a false positive due to the way the check is being made as the MalforedURL exception is being thrown by the URL class because it doesn't recognise the protocol and not because it has no protocol.
This should be easily be repeatable with any none standard url.
Kind Regards,
Ben
Thanks for the detailed troubleshooting, Ben. I went ahead and filed this as a bug: CS-13555 - Non-standard URL rewriting wrong when app is deployed in root context.
Thanks Karl,
Please keep in mind that the (relativeURL) bug is also existent for none root context deployments, as the URL is rewritten but is found to be invalid at the end (as the base url is not found) and as a result the original URL is simply returned.
What release has this bug been targeted for?
Kind Regards,
Ben.
Hi Ben,
The bug has not yet passed through our weekly QA triage, so it has not been assigned to a specific release yet.
Regards,
Karl
Hi Benjamin,
I ran this by our QA manager to ensure that it is scheduled for a release. Right now it should be targeted for the August release.
Regards,
Karl
Hey Benjamin,
I am following up on this one. I think in the grand scheme of things this comes across as a minor bug for our engineering team, but we understand the importance it has to the success of your community. I'll see what can be done about this.
Regards,
Karl
Jive combines the most powerful features of collaboration software, community software,
social networking software & social media monitoring into the leading SBS solution.
© Copyright 2000–2010 Jive Software. All rights reserved.
915 SW Stark St., Suite 400, Portland, OR 97205
Sales: 877-495-3700 | General: 503-295-3700
Privacy Policy | Sitemap | Jobs | Contact Us