Skip to content

Commit

Permalink
1.2.1 Support for h2, and set as default database for a quicker start…
Browse files Browse the repository at this point in the history
…. Various fixes.
  • Loading branch information
mfakih294 committed Jan 30, 2020
1 parent 334ef5b commit e215cae
Show file tree
Hide file tree
Showing 47 changed files with 281 additions and 258 deletions.
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ dependencies {
compile 'org.grails.plugins:grails-markdown:3.0.0'
compile 'org.grails.plugins:iCalendar:0.6.4'

compile 'org.grails.plugins:external-config:1.4.0'


// compile "org.grails.plugins:feeds:1.6"

Expand Down Expand Up @@ -146,4 +148,7 @@ tasks.withType(Test) {
war {
version ""
archiveName = "nibras.war"
}
}



23 changes: 17 additions & 6 deletions grails-app/conf/application.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ grails.plugin.springsecurity.userLookup.userDomainClassName = 'security.User'
grails.plugin.springsecurity.userLookup.authorityJoinClassName = 'security.UserRole'
grails.plugin.springsecurity.authority.className = 'security.Role'
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
[pattern: '/', access: ['permitAll']],
// [pattern: '/', access: ['permitAll']],
// [pattern: '/**', access: ['permitAll']],
[pattern: '/error', access: ['permitAll']],
[pattern: '/index', access: ['permitAll']],
Expand All @@ -20,12 +20,13 @@ grails.plugin.springsecurity.controllerAnnotations.staticRules = [
[pattern: '/assets/**', access: ['permitAll']],
[pattern: '/**/js/**', access: ['permitAll']],
[pattern: '/**/plugins/**', access: ['permitAll']],
[pattern: '/**/console/**', access: ['permitAll']],
[pattern: '/**/static/console/**', access: ['permitAll']],
// [pattern: '/**/console/**', access: ['permitAll']],
// [pattern: '/**/static/console/**', access: ['permitAll']],
[pattern: '/**/page/heartbeat/**', access: ['permitAll']],
[pattern: '/**/sync/**', access: ['permitAll']],
[pattern: '/**/css/**', access: ['permitAll']],
// [pattern: '/**/slides/**', access: ['permitAll']],
[pattern: '/**/fonts/**', access: ['permitAll']],
[pattern: '/**/images/**', access: ['permitAll']],
[pattern: '/**/favicon.ico', access: ['permitAll']]
]
Expand All @@ -38,9 +39,19 @@ grails.plugin.springsecurity.filterChain.chainMap = [
[pattern: '/**/js/**', filters: 'none'],
[pattern: '/**/css/**', filters: 'none'],
[pattern: '/**/images/**', filters: 'none'],
[pattern: '/**/favicon.ico', filters: 'none']
// [pattern: '/**', filters: 'JOINED_FILTERS']
[pattern: '/**/fonts/**', filters: 'none'],
[pattern: '/**/favicon.ico', filters: 'none'],
// [pattern: '/**', filters: 'none']
[pattern: '/**', filters: 'JOINED_FILTERS'] // comment the line above and uncomment this line to enable security
]

// todo: war file
grails.project.war.file = "/dev/${appName}.war"
grails.project.war.file = "/dev/${appName}.war"

grails.config.locations = [
"classpath:myconfig.properties",
"file:///nbr/myconfig.properties",
"file:${catalina.base}/myconfig.properties",
"~//myconfig.properties"
]

20 changes: 10 additions & 10 deletions grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ grails:
info:
app:
name: nibras
version: 1.0.6
version: 1.2.0
grailsVersion: '@info.app.grailsVersion@'
server:
contextPath: '/nibras'
Expand Down Expand Up @@ -112,12 +112,8 @@ hibernate:
environments:
h2:
dataSource:
pooled: true
jmxExport: true
driverClassName: org.h2.Driver
url: jdbc:h2:./db/h2Db;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
username: sa
password: ''
dbCreate: update
url: jdbc:h2:../db/nibras;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
properties:
jmxEnabled: true
initialSize: 5
Expand Down Expand Up @@ -162,7 +158,7 @@ environments:
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
production2:
mysql:
dataSource:
dbCreate: update
jndiName: java:comp/env/jdbc/db_nibras2
Expand All @@ -186,7 +182,8 @@ environments:
testWhileIdle: true
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED test:
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
test:
dataSource:
dbCreate: update
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
Expand Down Expand Up @@ -214,4 +211,7 @@ environments:
testWhileIdle: true
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
# - classpath:'@info.app.grailsVersion@'.groovy
# - classpath:myconfig.yml

6 changes: 3 additions & 3 deletions grails-app/controllers/ker/PageController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class PageController {
[
['All journal', 'J', 'Jcal', 'from Journal t where id > 0', 'select count(*) from Journal', 1],
['All plans', 'P', 'Pcal', 'from Planner t where id > 0', 'select count(*) from Planner', 1],
['All tasks with due dates', 'T', 'Tcal', 'from Task t where endDate is not null', 'select count(*) from Task t where endDate is not null', 1],
// ['All tasks with due dates', 'T', 'Tcal', 'from Task t where endDate is not null', 'select count(*) from Task t where endDate is not null', 1],
['All tasks', 'T', 'Tall', 'from Task t where id > 0', 'select count(*) from Task t', 0],
['All notes', 'N', 'Nall', 'from IndexCard t where id > 0', 'select count(*) from IndexCard t', 0],
['All resources', 'R', 'Rall', 'from Book t where id > 0', 'select count(*) from Book t', 0],
Expand Down Expand Up @@ -174,7 +174,7 @@ class PageController {
['tasks.enabled', 'yes'],
['resources.enabled', 'yes'],
['fullCalendar.enabled', 'yes'],
['rangeCalendar.enabled', 'no'],
['rangeCalendar.enabled', 'yes'],
['coursePanel.enabled', 'yes'],
['commandBar.enabled', 'yes'],
['enable.kanban', 'yes'],
Expand All @@ -194,7 +194,7 @@ class PageController {
['default.language', 'en'],
['updateResultSet.max-items', '100'],
['accordion.east.default.panel', '1'],
['accordion.west.default.panel', '1'],
['accordion.west.default.panel', '0'],
['planner.homepage.default-type', 'knb'],
['repository.languages', 'ar,fa,fr,en'],
['repository.languages.RTL', 'ar,fa'],
Expand Down
1 change: 1 addition & 0 deletions grails-app/domain/cmn/Setting.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Setting { // entity id = 51
}

static mapping = {
// table "SETTINGS"
value(sqlType: 'longtext')
summary(sqlType: 'longtext')
description(sqlType: 'longtext')
Expand Down
2 changes: 1 addition & 1 deletion grails-app/domain/security/Role.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Role implements Serializable {
}

static mapping = {
table 'security_role'
table 'SECURITY_ROLE'
cache true
}
}
2 changes: 1 addition & 1 deletion grails-app/domain/security/User.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class User implements Serializable {
}

static mapping = {
table 'security_user'
table 'SECURITY_USER'
password column: '`password`'
}

Expand Down
2 changes: 1 addition & 1 deletion grails-app/domain/security/UserRole.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class UserRole implements Serializable {
}

static mapping = {
table 'security_user_role'
table 'SECURITY_USER_ROLE'
id composite: ['user', 'role']
version false
}
Expand Down
1 change: 1 addition & 0 deletions grails-app/init/nibras/BootStrap.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class BootStrap {

def init = { servletContext ->


def adminRole = new Role(authority: 'ROLE_ADMIN').save()

def testUser = new User(username: 'nibras', password: 'nibras').save()
Expand Down
4 changes: 2 additions & 2 deletions grails-app/views/appCalendar/main.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
weekNumbers: true,
weekNumbersWithinDays: true,
weekNumberCalculation: 'ISO',
events:"/nibras/export/allCalendarEvents",
events:"${request.contextPath}/export/allCalendarEvents",
selectable: true,
selectHelper: true,
Expand Down Expand Up @@ -166,7 +166,7 @@
end: arg.end
};
jQuery('#logArea').html(title);
jQuery('#logArea2').load('/nibras/operation/addNewFromCalendar', {
jQuery('#logArea2').load('${request.contextPath}/operation/addNewFromCalendar', {
title: title,
start: moment(arg.start).format('DD.MM.YYYY HH:mm'),//arg.start.getDate() + '.' + arg.start.getMonth() + '.'+ (parseInt(arg.start.getYear()) + 1900),
end: moment(arg.end).format('DD.MM.YYYY HH:mm')//,//arg.start.getDate() + '.' + arg.start.getMonth() + '.'+ (parseInt(arg.start.getYear()) + 1900),
Expand Down
6 changes: 3 additions & 3 deletions grails-app/views/appCourse/_north.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

%{--<td style="padding: 1px !important; margin-left: 9px; color: white;">--}%

%{--<a href="/nibras/sync/rssPile"--}%
%{--<a href="${request.contextPath}/sync/rssPile"--}%
%{--class="fg-button-icon-left"--}%
%{--style="" target="_blank">--}%
%{--<span style="color: white" class="ui-icon ui-icon-signal"></span>--}%
Expand Down Expand Up @@ -147,15 +147,15 @@
// this['value'] = 'on'
this['checked'] = true
// console.log(this.attr('value'));
jQuery('#logRegion').load('/nibras/generics/selectOnly/' + this['name'].split('-')[2] + this['name'].split('-')[1]);
jQuery('#logRegion').load('${request.contextPath}/generics/selectOnly/' + this['name'].split('-')[2] + this['name'].split('-')[1]);
});
})
$('#deselectAll').click(function (e) {
$("input[name^='select-']").each(function () {
this['checked'] = false
// console.log(this.attr('value'));
jQuery('#logRegion').load('/nibras/generics/deselectOnly/' + this['name'].split('-')[2] + this['name'].split('-')[1]);
jQuery('#logRegion').load('${request.contextPath}/generics/deselectOnly/' + this['name'].split('-')[2] + this['name'].split('-')[1]);
});
})
</script>
6 changes: 3 additions & 3 deletions grails-app/views/appCourse/_regions.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
jQuery("#chosenTagsArt").chosen({allow_single_deselect: true, no_results_text: "None found"});
// jQuery("#addXcdFormNgs").relatedSelects({
// onChangeLoad: '/nibras/generics/fetchCoursesForDepartment',
// onChangeLoad: '${request.contextPath}/generics/fetchCoursesForDepartment',
// defaultOptionText: '',
// selects: {
// 'department.id': {loadingMessage: ''},
Expand All @@ -321,15 +321,15 @@
// });
jQuery("#addArticleFormNgs").relatedSelects({
onChangeLoad: '/nibras/generics/fetchCoursesForDepartment',
onChangeLoad: '${request.contextPath}/generics/fetchCoursesForDepartment',
defaultOptionText: '',
selects: {
'department.id': {loadingMessage: ''},
'course.id': {loadingMessage: ''}
}
});
jQuery("#addXcdFormNgs").relatedSelects({
onChangeLoad: '/nibras/generics/fetchWritingsForCourse',
onChangeLoad: '${request.contextPath}/generics/fetchWritingsForCourse',
defaultOptionText: '',
selects: {
'course.id': {loadingMessage: ''},
Expand Down
8 changes: 4 additions & 4 deletions grails-app/views/appCourse/main.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

<script type="text/javascript">
// $.address.state('/nibras/')
// $.address.state('${request.contextPath}/')
$.address.externalChange(function (event) {
// do something depending on the event.value property, e.g.
// $('#content').load(event.value + '.xml');
Expand Down Expand Up @@ -241,10 +241,10 @@
// increaseArea: '-20%' // optional
// });
// jQuery('#searchForm').load('/nibras/generics/hqlSearchForm/T')
jQuery('#tagCloud').load('/nibras/report/tagCloud')
// jQuery('#searchForm').load('${request.contextPath}/generics/hqlSearchForm/T')
jQuery('#tagCloud').load('${request.contextPath}/report/tagCloud')
// jQuery('#centralArea').load('/nibras/generics/recentRecords')
// jQuery('#centralArea').load('${request.contextPath}/generics/recentRecords')
// jQuery('#quickAddTextField').select();
// jQuery('#quickAddTextField').focus();
Expand Down
6 changes: 3 additions & 3 deletions grails-app/views/appKanban/_north.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

%{--<td style="padding: 1px !important; margin-left: 9px; color: white;">--}%

%{--<a href="/nibras/sync/rssPile"--}%
%{--<a href="${request.contextPath}/sync/rssPile"--}%
%{--class="fg-button-icon-left"--}%
%{--style="" target="_blank">--}%
%{--<span style="color: white" class="ui-icon ui-icon-signal"></span>--}%
Expand Down Expand Up @@ -146,15 +146,15 @@
// this['value'] = 'on'
this['checked'] = true
// console.log(this.attr('value'));
jQuery('#logRegion').load('/nibras/generics/selectOnly/' + this['name'].split('-')[2] + this['name'].split('-')[1]);
jQuery('#logRegion').load('${request.contextPath}/generics/selectOnly/' + this['name'].split('-')[2] + this['name'].split('-')[1]);
});
})
$('#deselectAll').click(function (e) {
$("input[name^='select-']").each(function () {
this['checked'] = false
// console.log(this.attr('value'));
jQuery('#logRegion').load('/nibras/generics/deselectOnly/' + this['name'].split('-')[2] + this['name'].split('-')[1]);
jQuery('#logRegion').load('${request.contextPath}/generics/deselectOnly/' + this['name'].split('-')[2] + this['name'].split('-')[1]);
});
})
</script>
8 changes: 4 additions & 4 deletions grails-app/views/appKanban/_regions.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
%{--<h3>T / context</h3>--}%
<table border="1" style="margin: 10px; width: 98%; border: #496779; border-collapse: collapse;">
<thead>
<th></th>
<th>T*</th>
<g:each in="${mcs.Task.executeQuery('select t.context from Task t where t.bookmarked = 1 group by t.context order by t.context.code')}"
var="d">
<th>@<b>${d.code}</b></th>
Expand Down Expand Up @@ -259,7 +259,7 @@
jQuery("#chosenTagsArt").chosen({allow_single_deselect: true, no_results_text: "None found"});
// jQuery("#addXcdFormNgs").relatedSelects({
// onChangeLoad: '/nibras/generics/fetchCoursesForDepartment',
// onChangeLoad: '${request.contextPath}/generics/fetchCoursesForDepartment',
// defaultOptionText: '',
// selects: {
// 'department.id': {loadingMessage: ''},
Expand All @@ -268,15 +268,15 @@
// });
jQuery("#addArticleFormNgs").relatedSelects({
onChangeLoad: '/nibras/generics/fetchCoursesForDepartment',
onChangeLoad: '${request.contextPath}/generics/fetchCoursesForDepartment',
defaultOptionText: '',
selects: {
'department.id': {loadingMessage: ''},
'course.id': {loadingMessage: ''}
}
});
jQuery("#addXcdFormNgs").relatedSelects({
onChangeLoad: '/nibras/generics/fetchWritingsForCourse',
onChangeLoad: '${request.contextPath}/generics/fetchWritingsForCourse',
defaultOptionText: '',
selects: {
'course.id': {loadingMessage: ''},
Expand Down
8 changes: 4 additions & 4 deletions grails-app/views/appKanban/main.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

<script type="text/javascript">
// $.address.state('/nibras/')
// $.address.state('${request.contextPath}/')
$.address.externalChange(function (event) {
// do something depending on the event.value property, e.g.
// $('#content').load(event.value + '.xml');
Expand Down Expand Up @@ -240,10 +240,10 @@
// increaseArea: '-20%' // optional
// });
// jQuery('#searchForm').load('/nibras/generics/hqlSearchForm/T')
jQuery('#tagCloud').load('/nibras/report/tagCloud')
// jQuery('#searchForm').load('${request.contextPath}/generics/hqlSearchForm/T')
jQuery('#tagCloud').load('${request.contextPath}/report/tagCloud')
// jQuery('#centralArea').load('/nibras/generics/recentRecords')
// jQuery('#centralArea').load('${request.contextPath}/generics/recentRecords')
// jQuery('#quickAddTextField').select();
// jQuery('#quickAddTextField').focus();
Expand Down
Loading

0 comments on commit e215cae

Please sign in to comment.