JWare Logo  “Strategies in (*)ability” [iDareMedia] [JWare] [PET] [CI-Dashboard]
<JWare/AntXtras Foundation>

 [home]    [overview] [download] [learning] [problems] [ourplans]    [contacts] [legalese

[guide] $shorten:UG

home » learning » guides » valueuris » $shorten: 

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.

Parameters

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 “...”).

Examples

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}}"/>

Related Topics

SourceForge.net Logo
Copyright ©2005-2006 iDare Media, Inc. All rights reserved.
 
JWare/AntXtras uses software developed by and on behalf of the Apache Software Foundation, http://www.apache.org/.
All other product names mentioned on this website are trademarks of their respective owners; refer to full legalese statement.