Hi there,

just found out that
 <map:serialize status-code="{statusCode}" />

kept giving me a statuscode 200 no matter what the value of statusCode was.

as it turns out the SerializeNodeBuilder will in it's buildNode do:
>         this.node = new SerializeNode(
>             type,
>             VariableResolverFactory.getResolver(config.getAttribute("src", 
> null), this.manager),
>             
> VariableResolverFactory.getResolver(config.getAttribute("mime-type", null), 
> this.manager),
>             config.getAttributeAsInteger("status-code", -1)
>         );

which I read as: @src and @mime-type can but @status-code can-not be
resolved from variables

from an end-user POV this difference in handling is quite arbitrary
(meaning: if there are good considerations for this we should document
them well)


other examples of non-resolvable attributes:

> ./ActionSetNodeBuilder.java:  "name"
> 
> ./ActNodeBuilder.java:        "set"
> ./ActNodeBuilder.java:        "name"
> ./ActNodeBuilder.java:        "src"
> 
> ./CallNodeBuilder.java:       "resource"
> ./CallNodeBuilder.java:       "function"
> ./CallNodeBuilder.java:       "continuation"
> 
> ./HandleErrorsNodeBuilder.java:       "type"
> ./HandleErrorsNodeBuilder.java:       "when"
> 
> ./FlowNodeBuilder.java:       "language"
> 
> ./MatchNodeBuilder.java:      "pattern"
> ./MatchNodeBuilder.java:      "name"
> 
> ./MountNodeBuilder.java:      "check-reload"
> ./MountNodeBuilder.java:      "pass-through"
> 
> ./PipelineNodeBuilder.java:   "internal-only"
> 
> ./RedirectToNodeBuilder.java: "resource"
> ./RedirectToNodeBuilder.java: "target"
> ./RedirectToNodeBuilder.java: "session"
> ./RedirectToNodeBuilder.java: "global"
> ./RedirectToNodeBuilder.java: "permanent"
> 
> ./ReadNodeBuilder.java:       "mime-type"
> ./ReadNodeBuilder.java:       "status-code"
> 
> ./SerializeNodeBuilder.java:  "mime-type"
> ./SerializeNodeBuilder.java:  "status-code"
> 
> ./ScriptNodeBuilder.java:    "src"
> 
> ./SitemapLanguage.java:       "logger"
> ./SitemapLanguage.java:       "role"
> ./SitemapLanguage.java:       "class"
> 
> ./ViewNodeBuilder.java:       "from-label"
> ./ViewNodeBuilder.java:       "from-position"


# based on the naieve lookup through
$ cd  src/java/org/apache/cocoon/components/treeprocessor/sitemap/;
$ find -type f |xargs grep 'config\.get' | grep -v '\.svn' | grep -v
VariableResolverFactory > ~/UnresolvedSitemapAttributes.txt


anyone any opinion on these?

maybe it makes sense to look at these with our "rule of least
surprise"-glasses on?

regards,
-marc=
-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
[EMAIL PROTECTED]                              [EMAIL PROTECTED]

Reply via email to