Is there a way to include hyperlink to some external HTTP URL in Scaladoc? - scala

Using Scaladoc, is there a way to include hyperlink to some external HTTP URL ?
using Javadoc this was easy.. but I am having trouble figuring out the syntax for Scaladoc. I looked here: https://wiki.scala-lang.org/display/SW/Writing+Documentation, but came up dry.
Say I want to link to an external resource like this > https://en.wikipedia.org/wiki/Aardvark < in my documentation. What is the markup I should use ?

You can try this :
External links: [[http://scala-lang.org Scala web site]] becomes Scala
web site. The URL part must start with a scheme name (like http:) and
must not contain white space. The name part (Scala web site) is
optional.

Related

How to get rid of the hash symbol (`#`) in the URL in UI5-routing?

Starting the 1.83.x/1.84.x OpenUI5 versions there is a possibility to omit the hash symbol (#) from the browser routing URL.
The new URL-format vs. the old-one:
https://openui5.hana.ondemand.com/topic/1b6dcd39a6a74f528b27ddb22f15af0d
https://sapui5.hana.ondemand.com/#/topic/1b6dcd39a6a74f528b27ddb22f15af0d
I've checked the OpenUI5 documentation but could not find how to get rid of this # in the URL.
Is it somewhere in manifest.json?
The OpenUI5 Demo Kit is using a custom Router in order to improve its SEO. See commit 4614eb0.
Routing without # is not officially supported yet. There is an enhancement request though: https://github.com/SAP/openui5/issues/2993

How to specify SonarQube rule description as a markdown/html resource file instead of using annotation?

I have my custom rule, let's say with AEM-1 key. So, as it is done here, I make my AEM-1.html resource file with some simple html content and it does not get's picked up by SonarQube 5.1. It refuses to start, because no description is provided for the rule.
I tried different packages names, tried to look for convention in source code etc. What's missing? Is there any documentation on that?
The naming convention is org/sonar/l10n/{plugin key}_{language}/rules/{repository key}/{rule key}.html.
It was documented in http://docs.sonarqube.org/display/DEV/Internationalization at the time rule descriptions supported localization. That's not the case anymore since version 4.2, but these HTML bundles are still supported.
The correct way since version 4.3 is to use the low-level API org.sonar.api.server.rule.RulesDefinition. It allows you to implement any kind over layer over it (xml, json, annotations, ...).

Retrieving a java element's javadoc url in Eclipse

Is there an API method in Eclipse to retrieve the URL for the Javadoc of an element?
I noticed that org.eclipse.jdt.ui.JavaUI appears to have a static function that accomplishes just that. You feed it an element and it returns the URL if it exists.
The problem I have is that I'm wanting to use this in connection with a plugin I'm using in Eclipse. You generally can't access the JDT classes unless you go somewhat roundabout it and this is discouraged by the Eclipse developers. So my question is is there another (easy) way to get the Javadoc URL for an element that doesn't require me to go too far out of my way?
If you parse the source code, you can get the class hierarchy. Then can access by using the same URL: http://docs.oracle.com/javase/6/docs/api/ plus the class path. For example, http://docs.oracle.com/javase/6/docs/api/java/util/ArrayList.html for ArrayList class.

Unicode normalization in GWT [duplicate]

I tried
s=Normalizer.normalize(s, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "");
But it seems that GWT API doesn't provide such fonction.
I tried also :
s=s.replace("é",e);
But it doesn't work either
The scenario is I'am trying to générate token from the clicked Widget's text for the history management
You can take ASCII folding filter from Lucene and add to your project. You can just take foldToASCII() method from ASCIIFoldingFilter (the method does not have any dependencies). There is also a patch in Jira that has a full class for that without any dependencies - see here. It should be compiled by GWT without any problems. License should be also OK, since it is Apache License, but don't quote me on it - you should ask a real lawyer.
#okrasz, the foldToASCII() worked but I found a shorter one Transform a String to URL standard String in Java

Making GWT application crawlable by a search engine

I want to use the #! token to make my GWT application crawlable, as described here:
http://code.google.com/web/ajaxcrawling/
There is a GWT sample app available online that uses this, for example:
http://gwt.google.com/samples/Showcase/Showcase.html#!CwRadioButton
Will serve the following static webpage to the googlebot:
http://gwt.google.com/samples/Showcase/Showcase.html?_escaped_fragment_=CwRadioButton
I want my GWT app to do something similar. In short, I'd like to serve a different flavor of the page whenever the _escaped_fragment_ parameter is found in the URL.
What should I modify in order for the server to serve something else (a static page, or a page dynamically generated through a headless browser like HTML Unit)? I'm guessing it could be the web.xml file, but I'm not sure.
(Note: I thought of checking the Showcase app provided with the GWT SDK, but unfortunately it doesn't seem to support serving static files on _escaped_fragment_ and it doesn't use the #! token..)
If you want to use web.xml, then I think it won't work with a servlet-mapping, because the url-patterns ignore the get parameters. (Not 100% sure, if there is another way to make this possible.)
You could of course map Showcase.html to a servlet, and in that servlet decide what to do, based on the get parameter "_escaped_fragment_". But it's a little bit expensive to call a Servlet just to serve a static page for the majority of the requests (not too bad, but still. You could set cache headers, if you're sure that it doesn't change).
Or you could have an Apache or something in front of your server - but I understand, I wouldn't like to have to do that either. Maybe your JavaEE server (which one are you using BTW?) provides some mechanism for URL filtering before the request gets passed on to the web container - I'd like to know that, too!
Found my answer! The Showcase sample supporting crawlable hyperlinks is in the following branch:
http://code.google.com/p/google-web-toolkit/source/browse/branches/crawlability/samples/showcase/?r=7726
It defines a filter in the web.xml to redirect URLs with the _escaped_fragment_ token to the output of HTML Unit.