Data Table Customization as per need

 

DataTable({
"scrollY" : "700px",
"scrollX" : "100%",
"scrollCollapse" : true,
"paging" : false,
"searching" : false,
"bAutoWidth": true,
"bScrollAutoCss": true,
"bProcessing": true,
"bRetrieve": true,
"bJQueryUI": true,
"autoWidth": true,
"ordering": false,
"bInfo" : false,
"order": [[ 2, "asc" ]],
fixedColumns : {
 leftColumns : 10
}
})

Spring Security Customization in grails

http://keyboarddays.blogspot.com/2014/04/grails-spring-security-plugin-manual.html

LogOut: default set for post method

<g:remoteLink class="logout" controller="logout" method="post" asynchronous="false" onSuccess="location.reload()">Logout</g:remoteLink>

in config.groovy

grails.plugin.springsecurity.logout.postOnly = false

now simple logout will works

def springSecurityService

def passwordEncoder
def user = User.findByUsername("harry");

def isLoggable = passwordEncoder.isPasswordValid(user.password, thepasswordtocheck, null)
//add this if you want to log the user then
springSecurityService.reauthenticate(user.username);

def isLoggedIn = springSecurityService.isLoggedIn();

Set in your Config.groovy:

1
grails.plugin.springsecurity.rememberMe.alwaysRemember = true

I would add also set

grails.plugin.springsecurity.rememberMe.cookieName
grails_remember_me'
grails.plugin.springsecurity.rememberMe.key = 'anewrandomkey'
def rememberMeServices

def user = User.findByUsername("harry");

springSecurityService.reauthenticate(user.username);

rememberMeServices.onLoginSuccess(request, response, springSecurityService.getAuthentication());

postgres db error or broken postgress healer or fix or recovery

https://lxadm.com/Repairing_broken_PostgreSQL_databases_/_tables

https://www.endpoint.com/blog/2016/09/19/pghealer-repairing-postgres-problems

http://www.pateldenish.com/2016/09/recovering-corrupted-postgres-database.html

https://www.postgresql.org/docs/current/continuous-archiving.html

https://www.postgresql.org/docs/current/high-availability.html

Grails BuildConfig.groovy, difference between build, compile, and runtime?

  • build – dependency that is only needed by the build process
  • runtime – dependency that is needed to run the application, but not compile it e.g. JDBC implementation for specific database vendor. This would not typically be needed at compile-time because code depends only the JDBC API, rather than a specific implementation thereof
  • compile – dependency that is needed at both compile-time and runtime. This is the most common case
  • provided – dependency that is needed at compile-time but should not be packaged with the app (usually because it is provided by the container). An example is the Servlet API

Database Dynamic with Live Database

 

 
def indexNext(Integer max){
		println params
		params.max = Math.min(max ?: 10, 100)
        params.max=params.length
        params.offset=params.start ?:0

		def jsonMap=[:]
		
		def rows=[]
		jsonMap.draw=params.draw
		jsonMap.recordsTotal=BlogPosts.count().toString()
		jsonMap.recordsFiltered=BlogPosts.count().toString()
		def postlist=BlogPosts.createCriteria().setMaxResults(10).setFirstResult(params.start.toInteger()).list()
        println postlist
		postlist.each{
			def row=[]
			row<