spring view template skinning - spring

How can I implement a css based template skin for spring MVC app. Also, is it possible to change the template path for spring MVC file at runtime to load completely different theme based on user selection or url called?

Take a look at Spring Themes. Also, there are other options:
You may change class of <body>, for example, and have different themes as it is done in Dojo.
You may load stylesheets as alternate and switch them with JS.

Related

What is the best way to create a new blank UI while keeping the ABP Framework infrastructure?

In a Multitenancy B2C application, the interface created by the Application Startup Template applies well to the backoffice, but for the storefront website I think it would be necessary to create a blank UI project (angular or MVC).
What would be the best practice for keep the ABP infrastructure that provides functionality such as customization by Tenant, Tag Hellpers, Proxies, Localization, etc. without bringing unnecessary dependencies such as JS libraries and other components like menus, datatables, sidebars?
What you are looking for is a Public application template. Abp framework is created modularity in mind so that you can use modules in each other if they are developed in modular way.
I don't think it is feasable to say "add these projects and libraries".
However, you can check the microservice demo, PublicWebSite application at abp-samples to see which libraries are added so that you can modify an empty project as you desire.
Overriding a View Component The ABP Framework, pre-built themes and modules define some re-usable view components. These view components can be replaced just like a page described above.
https://docs.abp.io/en/abp/latest/UI/AspNetCore/Customization-User-Interface#overriding-a-view-component
Replacing ALL UI Theme Package with your custom Project by copy the Basic Theme (from Github).
MVC https://community.abp.io/articles/creating-a-new-ui-theme-by-copying-the-basic-theme-for-mvc-ui-yt9b18io
Blazor https://community.abp.io/articles/creating-a-new-ui-theme-by-copying-the-basic-theme-for-blazor-ui-qaf5ho1b
Or check these others links https://community.abp.io/articles/changing-ui-theme-for-abp-mvc-razor-pages-ui-ravx6a0o.

spring boot admin UI customization

I would like to customize the spring boot admin ui to put some custom urls for healthcheck.I didn't find any examples on altering the UI like adding some tabs or putting some urls etx.
I found some documentation under http://codecentric.github.io/spring-boot-admin/current/ but it wasn't helpfull.
Any help on this would be really appreciated
Spring boot admin uses vue.js for frontend.
It is possible to add custom views to the ui. The views must be implemented as Vue.js components.
The JavaScript-Bundle and CSS-Stylesheet must be placed on the classpath at /META-INF/spring-boot-admin-server-ui/extensions/{name}/ so the server can pick them up. The spring-boot-admin-sample-custom-ui module contains a sample which has the necessary maven setup to build such a module.
The custom extension registers itself by calling SBA.use() and need to expose a install() function, which is called by the ui when setting up the routes. The install() function receives the following parameters in order to register views and/or callbacks:

How to render html page dynamically with all its includes from database

we are developing application in spring boot where the html css and js are gonna render from database or some other storage location like cache.
Is there any framework already existing to implement this?
If yes for render .jsp file dynamically, how to render css and js dependency also dynamically?
This post shows how to implement a Thymeleaf view resolver that gets the templates from database. You can tweak it to your needs (jsp's or whatever)

Dynamic Tiles Template with Spring 3.0

I'm currently developping an application with Spring 3 and Tiles 2.
I have a question regarding Tiles and the dynamic contents.
I would like to have a "header" template, that contains a menu that is populated with database information.
As the menu is available through the application, i would like not to put the information in the request controller.
Do you have any information ?
Thanks
The solution was to use a ViewPreparer on the menu definition.
Check out this tutorial that can help you with
spring to tiles integration,
definitions with wildcards,
implementing a fallback pattern using the OptionsRenderer, and
definitions composition.
http://tech.finn.no/the-ultimate-view-tiles-3/

What is sitemesh

I have seen Sitemesh used with Spring and Freemarker(FTL). So I want to know what is Sitemesh and its use with FTL, with example.
#see: http://www.opensymphony.com/sitemesh/
What Is It?
SiteMesh is a web-page layout and decoration framework and web- application integration framework to aid in creating large sites consisting of many pages for which a consistent look/feel, navigation and layout scheme is required.
SiteMesh intercepts requests to any static or dynamically generated HTML page requested through the web-server, parses the page, obtains properties and data from the content and generates an appropriate final page with modifications to the original. This is based upon the well-known GangOfFour Decorator design pattern.
SiteMesh can also include entire HTML pages as a Panel within another page. This is similar to a Server-Side Include, except that the HTML document will be modified to create a visual window (using the document's Meta-data as an aid) within a page. Using this feature, Portal type web sites can be built very quickly and effectively. This is based upon the well-known GangOfFour Composite design pattern.
SiteMesh is built using Java 2 with Servlet, JSP and XML technologies. This makes it ideal for use with J2EE applications, however it can be integrated with server-side web architectures that are not Java based such as CGI (Perl/Python/C/C++/etc), PHP, ColdFusion, etc...
SiteMesh is very extensible and is designed in a way in which it is easy to extend for custom needs.
sitemesh is a web page layout framework.
OpenSymphony doesn't seem to be around anymore, so the best documentation for Sitemesh I've seen is available through their Wiki and as the Readme on their Github repository.
I would caution that if you're interested in using Sitemesh, or at least understanding its structure in a project, Sitemesh2 and Sitemesh3 have significant differences in their structure and implementation, though they work conceptually the same way.

Resources