Login  Register

Re: NAML Feedback

Posted by Hugo <Nabble> on Mar 28, 2012; 4:27am
URL: https://support.nabble.com/NAML-Feedback-tp7377071p7412297.html

DavidJCobb wrote

PROBLEM: Strings that contain null

Great feedback. As you realized, our code throws a NullPointerException when a "null" value is printed together with other information in the output stream (in your case, it was printed together with line breaks). This exception has an important role in the code because it brings bugs to the attention of the developer (you don't want nulls to be printed when NAML is building a page, for example). But your case is different and the exception becomes indeed a problem. So we have created a new command called "null_exception_to_null" that catches the NullPointerException and prints a single "null" to the stream. Here is some code that works:
<macro name="test">
	<n.safe_default to="No bug" text="[n.crlf/][n.null/]"/>
</macro>

<macro name="safe_default" parameters="to,text" >
	<n.default to="[n.to/]" text="[n.null_exception_to_null.text/]"/>
</macro>
The name of this new command is a bit strange, but we couldn't find anything better (suggestions?). It should solve your problem though.
DavidJCobb wrote

PROBLEM: Some HTML tags are not recognized

You can introduce new tags with the "static" tag, just like this:
<static>
  thead
  tfoot
</static>
Each line represents a new tag that you want to use.
DavidJCobb wrote

SUGGESTION: Arbitrary node lists

This is possible, but we need a way to select arbitrary nodes in the database and retrieve them as a list. We believe the solution is to use our tag table, which is pretty much like a label that is applied to a node or user (think of labels in Gmail). So somehow you would stick a label in some nodes and then use a filter to retrieve them. Would this solve your problem?
DavidJCobb wrote

QUESTION about translations

That's correct, "T" tags are used for translations. Basically, if you wrap a string with <t>...</t> tags, you tell the code that a replacement for that text may be available. Here is an example: imagine a macro that has this text:
... <t>some text</t>...
If no translation is available, this is not a problem at all. The code will simply use the text between the T tags. But you may override that code with:
<translation><from>some text</from><to>SoMe TeXt</to></translation>
you can even override the translation with:
<override_translation><from>some text</from><to>s-o-m-e t-e-x-t</to></override_translation>
This is nice because Nabble has some ready-to-use translations, but you can use the last case above to customize it even more.
DavidJCobb wrote

SUGGESTION: Reading cookies from NAML

We just added a new command called "get_cookie_value", which can be used like this:
<n.get_cookie_value name="mycookie"/>
DavidJCobb wrote

PROBLEM: Error pages don't escape tags

I was not able to reproduce this. Please let me know if you have a URL or some steps to reproduce it.
DavidJCobb wrote

SUGGESTION: Control over unhandled exception output

I am investigating this and will come with a solution soon.