|
ConcatenateFilter Examples
|
The ConcatenateFilter is used to join string elements either statically or dynamically via the use
of nested prepend and/or append strings or string filters. It is used in several demos:
- In the LookupSearchSource demo to extend a url path to enable a search on framework tree nodes that contain
Javadoc and Example sub links.
<StringFilter class="com.raritantechnologies.utils.filter.ConcatenateFilter"
prependString="" appendString="/Example" />
- In the HTMLFilter demo as part of a
composite string filter that edits the internal links in the documentation javadoc pages to enable the tab controls seen
above to be persisted and to provide context sensitive "Example" tabs.
<!-- ConcantenateFilter used as composite filter via its <AppendFilter> -->
<!-- Element and as the LookupStringFilter <OutputFilter> Element -->
<!-- to prepend the http example= parameter. -->
<StringFilter class="com.raritantechnologies.utils.filter.ConcatenateFilter" >
<!-- ======================================================================= -->
<!-- The LookupStringFilter uses the ExampleTreeSource to determine which -->
<!-- class links in a Javadoc page have associated Example pages. (The -->
<!-- RegExprStringFilter is used to extract the class name from the input -->
<!-- href path to be used as a query value to the LookupSearchSource). If -->
<!-- the result has an ExampleLink/href attribute, this link will -->
<!-- be appended to the final output of the composite string filter with -->
<!-- the appropriate http request parameter prepended. -->
<!-- ======================================================================= -->
<AppendFilter class="com.raritantechnologies.utils.filter.LookupStringFilter"
searchSource="ExampleTreeSource"
queryField="name"
outputField="ExampleLink/href"
returnOnNull="EMPTY" >
<InputFilter class="com.raritantechnologies.utils.filter.RegExprStringFilter"
inPattern="(.*)/([A-Za-z]*)\.html"
outPattern="$2" />
<OutputFilter class="com.raritantechnologies.utils.filter.ConcatenateFilter"
prependString="&example=" />
</AppendFilter>
</StringFilter>