On Sep 30, 2008, at 1:06 PM, [EMAIL PROTECTED] wrote:
> + /** Truncates string to an acceptable length. **/
> + private String truncate(final String query){
> +
> + // generic.sesam defines a default value of 256
> + final int length = Integer.parseInt(
> +
> context
> .getDataModel
> ().getSite
> ().getSiteConfiguration().getProperty("sesat.query.characterLimit"));
> +
> + return length < query.length()
> + ? query.substring(0, length)
> + : query;
> + }
Should this be intelligent enough to close any parantheses or similar,
in case there are any open after truncating?
E.g. queries like
"<some very long text> and so forth"
will with the above code become
"<some very long text and
Maybe is should count the different magic characters and close them?
This is probably not very urgent, though. Might be suitable for 2.18?
--
Magne
_______________________________________________
Kernel-development mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-development