Which template engine and Ajax framework/toolkit can load templates from JAR files? - ajax

Which Template-Engine and Ajax-Framework/-Toolkit is able to load template information from JAR-Files?

If you mean server-side template engines, you can get Velocity to load its templates from the classpath (which includes JAR files). Check out the section "Configuring the Resource Loaders (template loaders)" in the Developer Guide.

Take a look at http://www.ztemplates.org which is simple and easy to learn. This one allows you to put all related templates, javascript and css into one jar and use it transparently. Means you even have not to care about declaring the needed javascript in your page when using a provided component, as the framework does it for you.

Related

eXistDB HTML Templating files outside of current app

I’ve an eXistDB app set up with templating. Is it possible to make HTML Files outside of the app (in a different collection) use the same templating mechanisms to get the page header and styles and so on from my app?
Thank you!
Yes, you can use eXist's HTML templating feature in any of your collections, but as the set up section of the documentation states, you will need to ensure the following modules responsible for handling the templating functionality are in the new collection:
controller.xql
modules/view.xql
For simplicity's sake, you could just copy these files from your original collection into the target collection, and they should work identically.

generate html template engine i18n

I am searching for a solution to modularize static html files and to add multilanguage support. I want to generate static html files with gulp which are then served through an apache server.
I am now thinking about using the template engine marko to modularize html files and to prerender html files (handlebars would also be an option; jade is no option cause i don't like the syntax).
For multilanguage support i am thinking about to add an i18n plugin (for example https://www.npmjs.com/package/i18n). But this plugin needs an express server; also for multilanguage i want to prerender the files. Has anybody a hint for me which i18n plugin would best fit for me? Maybe also which one would best work together with marko and gulp?
The result should be html files generated inside /de and /en.
The following sample app might help: https://github.com/marko-js-samples/marko-koa-i18n
It is a server-based app that uses Koa and koa-i18n, but you can directly use i18n-2 to accomplish the same thing.
Disclaimer: I have not used i18n-2 or koa-i18n
A few things to note:
A custom tag is used to introduce a local variable that can be used to access the i18n bundle: (see: src/components/app-hello/template.marko and src/taglib/i18n-var-tag.js)
The i18n bundle is pulled out of out.global.i18n. See: Marko > Global Properties
The following Gulp plugin is currently out-of-date, but it might serve as a good starting point or you can submit a PR to improve it: https://github.com/viviangledhill/gulp-marko
In your case, you will want to prerender each template multiple times, each time with a different i18n bundle instance passed in as a global property.
If you would like more details please ask here or in the Gitter chat room: https://gitter.im/marko-js/marko
Hope that helps.

Jenkins UI customization

I want to change the look and feel(ui customization) of Jenkins. Also I would like to add new views(say like new html pages or web pages) with navigation to the required jenkins pages etc.
Please let me know if any single plugins will help me to do so.Any relevant information(how ever generic) will be very helpful.
Any suggestions or links or tutorials is also appreciated.
PS:- Pretty new to jenkins.The inputs from here will help me to add more details to the questions.
I am looking for documents or tutorials that specify Skinning Jenkins using plugins like :-
https://wiki.jenkins-ci.org/display/JENKINS/Simple+Theme+Plugin
https://wiki.jenkins-ci.org/display/JENKINS/jQuery+Plugin
https://wiki.jenkins-ci.org/display/JENKINS/jQuery+UI+Plugin
https://wiki.jenkins-ci.org/display/JENKINS/JSWidgets+Plugin
The plugin page is providing very little information on how to use these and the benefits and the extend to which the UI can be changed.
Any doc or link is appreciated.
Assuming you don't want to write a Jenkins plugin, for adding pages, the best suggestion I can make is to use an HTTP proxy such as NginX, and configure it so that the pages you want to add are plain html files, and Jenkins is proxied for the rest of them. To a visitor, they will look like they are all part of the same site; you could copy code from the head and body sections of Jenkins-served pages to include some of the navigation.
The Simple Theme Plugin, which you found, will let you do basic customization of the look and feel of Jenkins. I do that for my build server and proxy it using this configuration fragment for NginX. The relevant CSS is in this CSS file - toward the end, look for the // JENKINS CUSTOMIZATION comment.
We use the Simple theme plugin - pointed at a css file for the simple styling, and a JS file to fix a couple of DOM oddities (some of the tables in the new look and feel have mismatching column counts).
Those two files need only be hosted either a handy http server, or you can place them in usercontent.
You need only refresh the page in the browser to see the changes. Both files can then happily reference other files served up too.
Handy things to note:
Jenkins has jquery, parts of YUI loaded and prototype loaded - so you can use them in your scripts.
If while debugging, the refresh gets in the way then use the console to enter the following to temporarily stop it without pausing JS: refreshPart = function() {}
When making DOM tree changes to content that is refreshed - attach it to the layout updates with:
layoutUpdatecallback.add(my_function) - that way your changes are applied to new incoming content.

How to manage URLs in CodeIgniter so they can be updated in a single place

I believe Smarty templates has functionality built in that allows you to manage your site URLs from a config file so if something gets moved, you only have to update the URL in one place. Does this sort of functionality exist in CodeIgniter? If not, any pointers or examples on how/where to add it?
For example:
Instead of hard-coding the link it would be: Settings
But where would you want to set $links so that it was available everywhere? Or is it really best to just hard code them?
Take a look at the config class. It allows you to make custom config files.
It's not entirely made for URL's but you sure can use them.
The base url should be basically right at the start of /app/config/config.php, where app is the name of your codeigniter application folder. You access it through calls to the base_url() function.
Yes, it's called Routes, configuration located at config/routes.php. Documentation
If you ask about the rendered html of the links, then your best bet would be using site_url() in conjunction with constants, for example site_url(URL_SETTINGS);, there is no built in functionality for that, but I can say I don't think that is necessary as it would be used too rarely, but it would influence performance every single load.

MVC sitemap provider & css styling

Does anyone know how to customise the rendering of the MVC sitemap provider so my ul element has a specific css class?
Try MvcSiteMapProvider hosted on CodePlex. You should be able to fairly easily migrate your existing Sitemap file to the slightly different but essentially compatible format. This will give you the ability to output your sitemap using the simple Html.MvcSiteMap().SiteMap() helper method.
The source of the project includes the default templates which you can edit to produce any rendering you like...or just pass in the name of a template in accordance with MVC convention. The model types you'll be rendering are SiteMapHelperModel, SiteMapNodeModel and SiteMapNodeModelList (namespaces removed for terseness).
I appreciate this may not be exactly what you're after as it relies on a 3rd party tool but its a useful project that supports much more than just rendering sitemaps. You'll want version 3.0.0 for MVC3.
Dan

Resources