Velocity DisplayTool doesn't work - velocity

Is any way to use Velocity DisplayTool in ODT template (rendered with XdocReport). I linked libraries with maven but when i render report from template I see tag $display.stripTags(Object), it seems that velocity does not recognize this tag.
Is there a need to make special configuration in xml, I use spring but I don't want velocity view resolver bean as it is in many solutions.
Ideas?

The $display variable will only be available within your template if you have added it to the velocity context.
There are 2 ways I know you can do this:
You can add an instance of the display tool to the context as a variable before rendering the template
You can create an xml configuration file and configure a ToolManager (example)

Related

How to make IntelliJ Idea stop warning about certain attributes?

I'm developing a Vue app using UI Kit which implies using various custom attributes like uk-grid, uk-icon, uk-navbar etc (in Vue single file components' templates). For each one, IntelliJ gives me a warning like
Warning:(7, 52) Attribute uk-icon is not allowed here
How can I tell IntelliJ not to do this? Googling the warning haven't brought any sane results which makes me think there's no ready-to-use package for this (for this particular UI Kit), so the question is: how to make Idea not to warn about a custom list of attributes? But I'll be glad to be wrong and if there is a better solution, please let me know.
Update: like lena has suggested, pressing alt+enter suggests helpful options, including adding attribute to the list of custom attributes. However, wildcard suggestion didn't work for me: the below screenshot illustrates settings that make v-localize attrbute be recognized, but uk--prefixed attribute are still highlighted with warning:
You can add uk-* attributes to Custom HTML tag attributes list in HTML | Unknown HTML tag attribute inspection; the easiest way to do this is using Add to custom HTML attributes quickfix available on Alt+Enter:
Note that IDEA recognizes Vuikit components and directives out of the box - did you consider using it instead of pure UIKit?

Velocity template that output multiple files

Is there any way to write a velocity template that outputs multiple files in different paths.
I am making a velocity template that generates a Vue.js component file which has its html in a separate file.
For example.. creating Vue component with the name Sidebar will generate:
./components/Sidebar.vue
./components/templates/sidebar.template.html
No. You would typically use two different templates, but you would merge them with the same context.
Documentations are usually generated using specific tools that extract objects/methods formatted comments to produce html. Such a tool would typically run on the generated component.

Call one velocity content to another velocity template

Can we call one velocity template to another template to reuse the code?
For example i have one velocity template where common code is there and that common code i want to use in another velocity template.
Please suggest.
That's precisely the purpose of the #parse directive.
Please check the Velocity Users Guide.

dojo internalize html templates

When using filter and pagination plugins for EnhancedGrid, the HTML templates for the same are loaded from dojox\grid\enhanced\templates.
Is there any way by which I can avoid the server requests for these HTML files by making them part of the Enhanced Grid's inline javascript?
You should make a custom dojo build that creates one js file as a result. follow this instructions from a previous QA:
How to build Dojo into a single file, given a list of dependencies?
EDIT:
The build should add those html files inline, but doesn't. I googled a bit and found this link related to your problem:
http://grokbase.com/t/dojo/dojo-interest/121e536t64/enhancedgrid-filter-problem
It suggests a fix using this link
http://dojo-toolkit.33424.n3.nabble.com/Custom-build-including-CSS-and-HTML-files-td3536573.html
Citation:
If you are using the AMD style of module definition, then you can specify a text dependency like so:
define(["dojo/text!some/file.html", "other/module"],
function(template, otherModule){
...
// to use the contents of the html file, treat template as if it were a normal string
someNode.innerHTML = template;
...
});
The build system should automatically convert the text dependency to an inline string literal. Most Dojo files are already formatted to use this feature, but I can't account for dojox modules. I'm not sure whether similar functionality is possible with the dojo.require/dojo.provide system of dependency declaration.
I have got the solution. Those struglling from this issue pls. note that there is bug with Dojo 1.7.1 and we need to use Dojo 1.8.3 and use internStrings option with the build command. You should see HTML files being interned in the build-report.

Dojo custom widget with external JavaScript libraries dependency

I'm developing a custom Dojo widget which in fact acts as a wrapper for Timeline JS library (http://www.simile-widgets.org/timeline/).
Is there a possibility to include the required JS code for Timeline in the custom dojo widget or must I include manually in my "index.html"??
Thanks in advance.
Do you have control over the Timeline source code, that is, are you hosting it yourself?
If this is the case you could turn the dependency into a dojo module by inserting an appropriate dojo.provide call on the top or you could just straight up copy-and-paste everything inside your MyWidget.js source file.
If this is all ends up too compicated for you to consider it worth it, adding the script tag by hand on the index.html is not that bad (given how base Javascript actually doesn't have a real module system you could use instead)