Statistics
| Revision:

root / web-presentation / trunk / eneraptor-web-presentation / grails-app / conf / BootStrap.groovy @ 86

History | View | Annotate | Download (1.29 KB)

1 86 alexbesir
import com.eneraptor.presentation.Content;
2
3
class BootStrap {
4
5
    def init = { servletContext ->
6
7
                if(!Content.findByContentId('about')) {
8
                        Content toSave = new Content(contentId: 'about', contentHTML: '<p>No content.</p>')
9
                        System.out.println("[eneraptor] Creating content 'about' for the first time...")
10
                        toSave.save()
11
                }
12
13
                if(!Content.findByContentId('faq')) {
14
                        Content toSave = new Content(contentId: 'faq', contentHTML: '<p>No content.</p>')
15
                        System.out.println("[eneraptor] Creating content 'faq' for the first time...")
16
                        toSave.save()
17
                }
18
19
                if(!Content.findByContentId('team')) {
20
                        Content toSave = new Content(contentId: 'team', contentHTML: '<p>No content.</p>')
21
                        System.out.println("[eneraptor] Creating content 'team' for the first time...")
22
                        toSave.save()
23
                }
24
25
                if(!Content.findByContentId('contact')) {
26
                        Content toSave = new Content(contentId: 'contact', contentHTML: '<p>No content.</p>')
27
                        System.out.println("[eneraptor] Creating content 'contact' for the first time...")
28
                        toSave.save()
29
                }
30
31
                if(!Content.findByContentId('style')) {
32
                        Content toSave = new Content(contentId: 'style', contentHTML: '<p>No content.</p>')
33
                        System.out.println("[eneraptor] Creating content 'style' for the first time...")
34
                        toSave.save()
35
                }
36
37
    }
38
    def destroy = {
39
    }
40
}