Roo custom finders in java classes - spring

I want to create a custom finder in my roo application. Most of the previous questions recommend creating the finders in the java classes, but I couldn't find the code to implement that and how to use it in my views or auto create the view.

Create your finders using finder add command.
Then customize the JSP page, the controller handler method and the finder method as needed.

Related

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:

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/

Codeigniter librarys vs core classes

I need to create some functionality that will be used by nearly all my controllers.
So I need to create a custom class. Now do I do this as a Core class? Or as a library? How do these differ?
I use the core class override technique when there's some behavior of one of the core classes that I want to change project wide. A great example of this is using Jamie Rumbelow's model class in /core/MY_Model.
For functionality that will be USED in each controller, I build a library to perform those functions and autoload it, then call the functions from that library as needed.
You want a library is you are developing a class. For simple functions, create a helper. If you are developing functionality that interacts with your database, create a model.
Add your custom helpers and libraries in you application folder.

Can EntityObject be used to directly generate a view for various scaffolds?

When I add a strongly typed view I see my Entities listed in the Model class dropdown. But, if I select an entity and Scaffold, say List, I get a runtime error of object reference not set to an instance of an object.
In past projects I created a Service layer that called LINQ using CRUD. Then I consumed this service in my Controller and manually created the Views from the resulting service classes. It would be a lot easier if MVC just did all that for me.
Is it possible to directly create scaffold views from concrete classes inheriting EntityObject?
Simple answer : Yes.
I just tried the following test case...
New Project
Create EDMX
Build
Add Controller (With Read/Write actions and views using entity framework
pick Model class and context (the thing normally suffixed with 'entities'
click add
run - it works
EDIT: added MVC Scaffolding too...
open package manager
Install-Package MvcScaffolding
Add Controller (MVC Scaffolding controller With read/write actions & views using EF COde)
Build and Run : Also works.

Pluggable pages in a Spring MVC application

I'm developing a Spring application which needs to support pluggable modules - add the JAR to the classpath and it will automatically find and load the module's Spring application context XML. This part is already working.
The problem right now is figuring out a way for the modules to provide custom JSP pages. Each module will require a configuration page, which contains form fields specific to that module.
How can I use Spring MVC to implement such pluggable pages? It should work something like so, that the module's JAR file contains the configuration page (as JSP) and its Spring MVC controller, which the surrounding application will then include into the rest of the application (maybe as a JSP fragment inside the application's page template).
If this cannot be done with Spring MVC and JSP, then what would be a good alternative?
Try adding a ResourceBundleViewResolver config to each pluggable module (not sure if having multiple resolvers will work or not, but it allows you to define views via the classpath, not specific locations. See http://static.springsource.org/spring/docs/current/reference/view.html.
If having multiple resolvers in your modules don't work, then try ResourceBundleViewResolver in the main app config, and then have all pluggable modules follow the same view location setup internally to the JARs.

Resources