Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Lotus Notes links
in Liferay 6.2 I could save link in Wiki page with reference to Lotus Notes document, (for example notes://main.srv.com/43257C5100268612)
But now in Liferay 7 wiki page remove all links which started from "notes://" after page is saved.
Do you have idea how I can switch off href validation or what ever is removing "notes://" links?
If you're using the Creole format for Wiki, you'll need to extend and
override the CreoleWikiEngine implementation (provided via the
com.liferay.wiki.engine.creole
bundle) with your own that
handles non-HTTP protocol links in a more intelligent way.
If you're using the HTML format for Wiki, the link removal is done by
the com.liferay.portal.security.antisamy
module, so
you'll need to disable it by adding it to the component blacklist. If
you want it to take effect immediately without having to restart the
server, you will also want to manually stop the bundle using GoGo shell.
Thank you so much, Minhchau,
I will check it out and let you know the results.
Hi Minhchau,
thank you, your tips help me alot,
also my LF version is GA5, but I managed to switch off component using GoGo shell,
Also I would like modify security module instead of stopping it,
I'm sure that in file
./modules/apps/foundation/portal-security/portal-security-antisamy/src/main/resources/META-INF/resources/sanitizer-configuration.xml
tag
<regexp name="offsiteURL" value="(\s)*((ht|f)tp(s?)://|mailto:)[\p{L}\p{N}]+[\p{L}\p{N}\p{Zs}\.\#@\$%\+&;:\-_~,\?=/!\(\)]*(\s)*"/>
define validation rules for wiki tags,
and if I modify it to
<regexp name="offsiteURL" value="(\s)*((ht|f)tp(s?)://|mailto:|notes://)[\p{L}\p{N}]+[\p{L}\p{N}\p{Zs}\.\#@\$%\+&;:\-_~,\?=/!\(\)]*(\s)*"/>
then wiki page let me save notes links with working AntiSamy module On.
Do you know if it possible to overwrite and can you please direct me to tutorials how to do that?
Thank you so much.
Dzmitry Paferau:Do you know if it possible to overwrite and can you please direct me to tutorials how to do that?
In theory, there are a few options available to you.
The first solution would be to update the configuration.
- Create a configuration file named com.liferay.portal.security.antisamy.configuration.AntiSamyConfiguration.cfg,
providing a different file name as the value for the
configurationFileURL
configuration key - Place this configuration file in
${liferay.home}/osgi/configs
- Create a bundle fragment for the
com.liferay.portal.security.antisamy
module which provides that updated file at the location specified inconfigurationFileURL
- Place this bundle fragment in
${liferay.home}/osgi/modules
(or${liferay.home}/deploy
, which will ultimately copy it to this location)
The second solution would be to use a marketplace override as
described in the Overriding
lpkg files article, though the first step (creating the updated
com.liferay.portal.security.antisamy.jar
binary to add to
the ${liferay.home}/osgi/marketplace/override
folder) has
a few variations.
- You can achieve the equivalent of a WAR overlay (though in this case, it's technically a JAR overlay) by following the tutorial that David Nebinger provides in his blog post, Extending Liferay OSGi modules
- You can extract the existing binary from
${liferay.home}/osgi/marketplace/Liferay Foundation.lpkg
and manually add your updatedsanitizer-configuration.xml
to it - You can clone/fork the com-liferay-portal-security repository and rebuild the module from source (starting from the appropriate commit corresponding to your release version) with your update
Minhchau,
awesome!
Thank you!
Powered by Liferay™