## Licensed to the Apache Software Foundation (ASF) under one ## or more contributor license agreements. See the NOTICE file ## distributed with this work for additional information ## regarding copyright ownership. The ASF licenses this file ## to you under the Apache License, Version 2.0 (the ## "License"); you may not use this file except in compliance ## with the License. You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, ## software distributed under the License is distributed on an ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ## KIND, either express or implied. See the License for the ## specific language governing permissions and limitations ## under the License. #title( 'ResourceTool' )

#set( $demo = $text.demo ) $demo.thisPage.insert("#doclink( 'ResourceTool' true )"). This tool is similar to the LinkTool in that most methods return a new object that has mostly the same methods as the original, allowing you to build up parameters elegantly and simply, rather than try to remember how to use methods with many parameters that must be in a specific order. So, you can access a resource with the key 'hello.whoever' in the 'otherStuff' bundle with one message argument like this:

  ${esc.d}text.hello.whoever.bundle('otherStuff').insert('World')
instead of like this:
  ${esc.d}text.get('hello.whoever','otherStuff', $null, 'World')
While the former is somewhat longer, it is much more understandable and flexible.

#demoTableStart() #set( $desc = 'Returns the resource with the specified name, if it exists.' ) #demo1( 'text' 'get' 9 $desc ) #set( $desc = 'Returns a list of the available keys.' ) #demo( 'text' 'hello.keys' $desc ) #set( $desc = 'Returns a new $text that will search only the specified bundle (if it exists) for the resource "foo".' ) #demo1( 'text.foo' 'bundle' 9 $desc ) #set( $quote = '' ) #set( $desc = 'Returns a new $text that will try to find the resource "foo" for the specified Locale.' ) #demo1( 'text.foo' 'locale' 9 $desc ) #set( $quote = '"' ) #set( $desc = 'Returns the resource "hello.whoever" with the specified value inserted.' ) #demo1( 'text.hello.whoever' 'insert' 9 $desc ) #set( $desc = 'Returns the resource "baz" with the specified values inserted.' ) #demo2( 'text.baz' 'insert' 9 $desc ) #demoCustom( 'text' )

$demo.mainExampleHeader


#if( $params.layout ) #end
#if( $params.demo ) $demo.mainResultsIntro:
  $render.eval($params.demo)
#end