From: Tim P <ti...@us...> - 2008-11-04 23:07:23
|
Update of /cvsroot/webmacro/webmacro/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv12714 Added Files: WebMacro.defaults Log Message: The default needs o be here for an ant free build --- NEW FILE: WebMacro.defaults --- # DO NOT EDIT THIS FILE -- Edit WebMacro.properties instead! # # This file contains the DEFAULT values for WebMacro CLASSIC. You can # set the actual live values in WebMacro.properties and that will # override the settings in this file. This file also contains examples # of how to set properties, which may be commented out. # # You can override any setting in this file by setting it # in WebMacro.properties. You can remove properties that are set in this # file by setting them to a null value in WebMacro.properties. # # Search order for properties is: # default properties file (WebMacro.defaults) # application properties file (WebMacro.properties or other) # servlet context arguments (2.2 and later, prefixed with org.webmacro) # system properties (prefixed with org.webmacro) ########################################################### # # BASIC CONFIGURATION: # # Character encoding. This is ONLY the encoding that is used to # parse templates. It does not determine the encoding that is # returned to the browser. WebMacro will translate templates from # this encoding to whatever encoding the browser requests. See # the FastWriter class to learn how to control output encoding. TemplateEncoding: UTF-8 TemplateOutputEncoding: UTF-8 # # Logging # # A whitespace separated list of org.webmacro.util.LogTarget # implementations that should should receive your log output. # # WebMacro comes with a default target, LogFile, which logs # to stderr (or a file if the LogFile setting is set, see below). # You can easily create your own implementations that log to your # custom logging system or to Log4J or whatever. LogTargets: org.webmacro.util.LogFile # LogLevel can be: ALL, DEBUG, INFO, NOTICE, WARNING, ERROR, or NONE # in order of most information to least information displayed. # The top level "LogLevel" setting controls the default log level # for any log. You can set specific levels for individual log types # by declaring a value for LogLevel.type. WebMacro itself has the # following types of log messages: # # log the log system itself # wm high level WebMacro behavior # servlet the servlet framework # resource things that load other things (eg: TemplateProvider) # context setting and evaluating properties in a context # engine messages about parsing and executing a tempalte # # There may be more types than that in your system, you can learn # what they are by setting the log level for "log" to INFO. LogLevel: ERROR #LogLevel.log: NOTICE #LogLevel.wm: NOTICE #LogLevel.servlet: NOTICE #LogLevel.resource: NOTICE #LogLevel.context: NOTICE #LogLevel.webcon: NOTICE #LogLevel.engine: NOTICE #LogLevel.directive: NOTICE #LogLevel.parser: NOTICE # LogTraceExceptions causes exception stack traces to be included in the log, # this causes exceptions to be verbose, but may point out the exact line # or method which is causing a fault. LogTraceExceptions: TRUE LogUsingServletLog: TRUE # the following 2 options are used by the org.webmacro.util.LogFile # log target. They do NOT specify system-wide logging options! # # Log format strings. This is a format string to be passed to MessageFormat. # If no format string is specified (the default, since the line below is # commented out), the string "{0,time}\t{1}\t{2}\t{3}" will be used if logging # to a file or to standard error, ,and the string "WebMacro:{1}\t{2}\t{3}" # will be used if logging to the servlet container log (if LogUsingServletLog # is true.) #LogFormat: {0,time}\t{1}\t{2}\t{3} # Use the following to log to a file rather than stderr. If your # standard error writes to a useful log already, you don't need this, # but many servlet runners simply eat standard error. #LogFile: /path/to/log/file # # Error Handling # # Set the template (relative to TemplateDirectory) used for errors. You # can edit this template to customize the way script failures appear # # This template is used by WMServlet, but you can use it for your own # servlets too. ErrorTemplate: error.wm ErrorVariable: error # Set the default ExceptionHandler, which gets control when an evaluation # exception is encountered. ExceptionHandler: org.webmacro.engine.DefaultEvaluationExceptionHandler ########################################################### # # ADVANCED CONFIGURATION # # Don't change these values unless you know what you're doing. They # allow you to fine-tune, extend, and customize WebMacro's behavior. # # Relaxed Directive Building. # # If set to true, text blocks produced by tools such as DreamWeaver # and other html editors will not choke the parse/build phase # when they introduce strings with a preceding # such as # #ffffff, #BeginDirective and #Comment. By default the property is # set to false. Therefore, WebMacro will fail fast on this type of text. RelaxedDirectiveBuilding: False # ResourceProviders are pluggable modules that are used to load # important data and code. You can create your own ResourceProviders # to add new modules to WebMacro, or replace existing modules. # They are all implementations of org.webmacro.broker.ResourceProvider Providers: Providers.template: org.webmacro.resource.TemplateProvider Providers.url: org.webmacro.resource.UrlProvider Providers.config: org.webmacro.resource.ConfigProvider Providers.directive: org.webmacro.directive.DirectiveProvider Providers.parser: org.webmacro.engine.ParserProvider Providers.encoder: org.webmacro.util.EncoderProvider # # Directives # # The DirectiveProvider uses these entries to load directives for the parser. # If you want to remove any of these, simply override the value of # Directive.xxx in your .properties file with an empty value. # You can add new directives by creating Directives.xxx values in your # Properties file, and you can also override the Directives property to # specify a list of directive classes. # Directives implement org.webmacro.directive.Directive # Directives: Directives.attribute: org.webmacro.directive.AttributeDirective Directives.const: org.webmacro.directive.AttributeDirective Directives.include: org.webmacro.directive.IncludeDirective Directives.parse: org.webmacro.directive.IncludeDirective Directives.set: org.webmacro.directive.SetDirective Directives.setprops: org.webmacro.directive.SetpropsDirective Directives.setblock: org.webmacro.directive.SetblockDirective Directives.macro: org.webmacro.directive.MacroDirective Directives.if: org.webmacro.directive.IfDirective Directives.text: org.webmacro.directive.TextDirective Directives.comment: org.webmacro.directive.CommentDirective Directives.foreach: org.webmacro.directive.ForeachDirective Directives.alternate: org.webmacro.directive.AlternateDirective Directives.param: org.webmacro.directive.ParamDirective Directives.type: org.webmacro.directive.TypeDirective Directives.default: org.webmacro.directive.DefaultDirective Directives.count: org.webmacro.directive.CountDirective Directives.bean: org.webmacro.directive.BeanDirective Directives.templet: org.webmacro.directive.TempletDirective Directives.eval: org.webmacro.directive.EvalDirective # # Directive Configuration # # # Should the #type directive be enabled? By default, yes it is. # When moving to a production environment, you should set this # to "false", so as not to incur the overhead of #type type.Enabled = true # # Configuration for #include and #parse # # NOTE: #parse has been deprecated. It is included for backwards # compatibility only. You should instead use: # #include as template "template.wm" # # # TemplateExtensions - a list of (comma-separated) file extensions # that are assumed to be templates when # #include is used without qualifing the # file type. By convention wmm is for WM macro library files. include.TemplateExtensions: .wm, .wmt, .tml, .tmpl, .wmm parse.TemplateExtensions: .wm, .wmt, .tml, .tmpl, .wmm ContextAutoLoaders.ContextTools: org.webmacro.broker.DefaultContextAutoLoader ContextAutoLoaders.WebContextTools: org.webmacro.broker.DefaultContextAutoLoader # The following are tools which are added to your WebContext. You can # customize your WebContext with special tools of your own by adding # them to this list of classes. The only requirement is that the class # be public, and have a public default constructor. The instance will # be shared betwen all instantiations of WebContext, so beware of # thread issues. If it implements the Macro interface it can gain # access to a copy of the Webcontext at runtime. The object will # appear in your WebContext as a variable named after its class, # minus the word "Tool" if it appears. So CGITool below becomes # the variable $CGI in your Template. # # The CGITool adds a $CGI variable with subproperties named after # the familiar CGI variable names, such as $CGI.QUERY_STRING, etc. # # The FormTool adds a $Form variable to your context, with subproperties # named after the available Form fieldnames. eg: $Form.Name would # return the value of HttpServletRequest.getParameterValues("Name")[0] # The FormList tool is similar, but returns the Form value as an array # rather than as a single entry (and is $FormList in the template). # # CookieTool creates a $Cookie variable which can be used to get and # set cookies by name. For example, $Cookie.Password # # SessionTool creates a $Session variable that resovles to the # HttpSession of the current request. WebContextTools: WebContextTools.CGI: org.webmacro.servlet.CGITool WebContextTools.Form: org.webmacro.servlet.FormTool WebContextTools.FormList: org.webmacro.servlet.FormListTool WebContextTools.Cookie: org.webmacro.servlet.CookieTool WebContextTools.Response: org.webmacro.servlet.ResponseTool WebContextTools.Request: org.webmacro.servlet.RequestTool WebContextTools.Session: org.webmacro.servlet.SessionTool ContextTools: ContextTools.Math: org.webmacro.servlet.MathTool ContextTools.Text: org.webmacro.servlet.TextTool ContextTools.Type: org.webmacro.servlet.TypeTool ContextTools.Variable: org.webmacro.servlet.VariableTool ContextTools.List: org.webmacro.servlet.ListTool # The following are the parsers available to WebMacro. The parser # which answers to "wm" will be used for most things, but you can # invoke a different parser by way of the #use directive, if it has # been included. These parsers all implement org.webmacro.engine.Parser Parsers: Parsers.wm: org.webmacro.parser.WMParser # # FastWriter Configuration # # This setting can be tuned for space/time trade-offs. FastWriter.DefaultBufferSize = 4096 # # Template caching # CachingProvider.template.CacheManager: org.webmacro.resource.ReloadingCacheManager CachingProvider.url.CacheManager: org.webmacro.resource.ReloadingCacheManager #CachingProvider.template.CacheManager: org.webmacro.resource.GenerationalCacheManager #CachingProvider.url.CacheManager: org.webmacro.resource.GenerationalCacheManager # # Encoding caching # Encoder.*.CacheManager: org.webmacro.resource.SimpleCacheManager #Encoder.*.CacheManager: org.webmacro.resource.GenerationalCacheManager PropertyOperator.CacheManager: org.webmacro.resource.SimpleCacheManager # ReloadingCacheManager properties (if used) # - An ExpireTime of 0 (zero) means WebMacro will never cache the resource # - A positive ExpireTime means WebMacro will re-fetch the resource every # X milliseconds (ie, 10000 is 10 seconds) # - A negative ExpireTime means WebMacro will only re-fetch resources # when they change. ReloadingCacheManager.*.ExpireTime: 30000 ReloadingCacheManager.*.ReloadOnChange: true # Advanced properties: ReloadingCacheManager.*.UseSoftReferences: TRUE # CheckForReloadDelay sets, how often a cached template should # be checked for reload at maximum. 0 (which is the default) means # to check on every request. Positive values stand for a period # of time in milliseconds. Templates are only checked once in this # interval. # 60 seconds for templates requested via http #CheckForReloadDelay.http=60000 # 10 seconds for normal file templates #CheckForReloadDelay.file=10000 # GenerationalCacheManager properties (if used) # Set reloading to true since we are in development mode by default. GenerationalCacheManager.*.ReloadOnChange: true # The refresh rate for incorporating changes to the mutable image GenerationalCacheManager.*.RefreshRate: 1000 # Classes that are restricted for use in templates RestrictedClasses=java.lang.Class # Methods of the Class class that are allowed in templates RestrictedClasses.AllowedMethods.java.lang.Class=\ getName,isArray,isPrimitive,isAssignableFrom,isInstance # Where does the servlet broker look for templates? Default is the servlet # root, but you could put WEB-INF/templates here. Servlet22Broker.TemplateLocation= # Default settings for DelegatingTemplateProvider # First some template loaders TemplateLoader.default=org.webmacro.resource.FileTemplateLoader TemplateLoader.file=org.webmacro.resource.FileTemplateLoader TemplateLoader.classpath=org.webmacro.resource.ClassPathTemplateLoader TemplateLoader.broker=org.webmacro.resource.BrokerTemplateLoader TemplateLoader.webapp=org.webmacro.resource.ServletContextTemplateLoader # This makes WM backwards compatible to old TemplatePath setting DelegatingTemplateProvider.EmulateTemplatePath: true # and a template loader factory TemplateLoaderFactory=org.webmacro.resource.DefaultTemplateLoaderFactory # To use it, uncomment the following settings #Providers.template: org.webmacro.resource.DelegatingTemplateProvider #TemplateLoaderPath.1=broker: # Define global "functions" which are available to every template # Example: # Functions.myFunc=org.webmacro.SomeClass.myFunkyMethod # If the class is not static, use # Function.myFunc.type=instance # You can even pass arguments to the constructor, like # Function.myFunc.args=[1, "two", [3, 4]] # [Probably not useful, but kind of cool. :} ] Functions.HTMLEscape=org.webmacro.util.HTMLEscaper.escape Functions.URLEncode=org.webmacro.servlet.TextTool.URLEncode Functions.URLDecode=org.webmacro.servlet.TextTool.URLDecode Functions.toList=org.webmacro.servlet.ListUtil.toList Functions.toBoolean=org.webmacro.util.CastUtil.toBoolean Functions.toByte=org.webmacro.util.CastUtil.toByte Functions.toChar=org.webmacro.util.CastUtil.toChar Functions.toDouble=org.webmacro.util.CastUtil.toDouble Functions.toFloat=org.webmacro.util.CastUtil.toFloat Functions.toInt=org.webmacro.util.CastUtil.toInt Functions.toLong=org.webmacro.util.CastUtil.toLong Functions.toShort=org.webmacro.util.CastUtil.toShort Functions.mod=org.webmacro.servlet.MathTool.mod Functions.min=org.webmacro.servlet.MathTool.min Functions.max=org.webmacro.servlet.MathTool.max Functions.pow=org.webmacro.servlet.MathTool.pow Functions.abs=org.webmacro.servlet.MathTool.abs Functions.replace=org.webmacro.servlet.TextTool.replace Functions.split=org.webmacro.servlet.TextTool.split Functions.join=org.webmacro.servlet.TextTool.join Functions.eval=org.webmacro.util.Eval.eval # To include global macro libraries, just put them into # a file at the location you usually load templates from # and put a space separated list after Macros.Include # Example: # Macros.Include: myGlobalMacros.wmm macros2.wmm ## NOTE: The following settings support the servlet org.webmacro.servlet.TemplateServlet ## Normally, these values will be used in the webmacro.properties file to suit # To process a template once once and to make its resultant context # available in every context: #GlobalTemplate.ContextName: global #GlobalTemplate.Resource: global.tml #SessionTemplate.ContextName: session #SessionTemplate.Resource: session.tml #RequestTemplate.ContextName: request #RequestTemplate.Resource: request.tml # If getPathInfo() returns null, use the following default template TemplateServlet.DefaultTemplate: index.tml |