| “Strategies in (*)ability” | [iDareMedia] [JWare] [PET] [CI-Dashboard] |
The $shorten: value uri tries to shorten a long string in a display friendly manner. This uri is most useful for shortening long file paths into something easily readable in build logs or email messages. This uri functions independent of the AntX shortlocations defaults flag. You must explicitly install this value uri’s handler; read the Examples section to see how this is done.
The general form of the uri is: $shorten:string[?[maxlength][,,[left|right][,,ellipses]]] where string is the long string to be shortened, maxlength is the longest the string and ellipses can be (defaults to 41), left|right tell the handler which end of the string should be removed (defaults to left for best results with paths), and ellipses is the string to use as the ellipses marker (defaults to “...”).
1) The following snippet declares the default scheme name for the shorten uri handler: $shorten:. This is usually done by an “init” target or at the project’s top level.
<manageuris action="install">
<parameter name="shorten"
value="com.idaremedia.antx.valueuri.ShortenStringURIHandler"/>
</manageuris>
2) The following snippet uses shorten to limit the length of the path string used in a feedback message.
<emit msgid="msg.generating.apidocs" msgarg1="${$shorten:@{html}}"/>