Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import nc.mairie.pdc.User
- import nc.mairie.pdc.Role
- import nc.mairie.pdc.UserRole
- import nc.mairie.pdc.Document
- import nc.mairie.pdc.TypeDeDemande
- class BootStrap {
- def springSecurityService
- def init = { servletContext ->
- def adminRole = Role.findByAuthority('ROLE_ADMIN') ?: new Role(authority: 'ROLE_ADMIN').save(flush: true)
- def agentAccueilRole = Role.findByAuthority('ROLE_AGENT_ACCUEIL') ?: new Role(authority: 'ROLE_AGENT_ACCUEIL').save(flush: true)
- def chefServiceRole = Role.findByAuthority('ROLE_CHEF_SERVICE') ?: new Role(authority: 'ROLE_CHEF_SERVICE').save(flush: true)
- def instructeurRole = Role.findByAuthority('ROLE_INSTRUCTEUR') ?: new Role(authority: 'ROLE_INSTRUCTEUR').save(flush: true)
- def visiteurRole = Role.findByAuthority('ROLE_VISITEUR') ?: new Role(authority: 'ROLE_VISITEUR').save(flush: true)
- def adminUser = User.findByUsername('admin') ?: new User(
- username: 'admin',
- password: 'mitija',
- enabled: true).save(flush: true)
- if (!adminUser.authorities.contains(adminRole)) {
- UserRole.create adminUser, adminRole
- }
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Note descriptive sommaire','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Note descriptive sommaire',
- isUnder200m2: 'Yes').save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Plan de situation','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Plan de situation',
- isUnder200m2: 'Yes').save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Plan de masse et d\'implantation','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Plan de masse et d\'implantation',
- isUnder200m2: 'Yes').save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Plan de travaux aux 1/50ème et au 1/10ème côté','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Plan de travaux aux 1/50ème et au 1/10ème côté',
- isUnder200m2: 'Yes').save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Note descriptive sommaire','No') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Note descriptive sommaire',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Plan de situation','No') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Plan de situation',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Plan de masse et d\'implantation','No') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Plan de masse et d\'implantation',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Plan de travaux aux 1/50ème et au 1/10ème côté','No') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Plan de travaux aux 1/50ème et au 1/10ème côté',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Eau et assainissement','No') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Eau et assainissement',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.EMPTY,'Volet paysager','No') ?: new Document(
- typeDeDemande: TypeDeDemande.EMPTY,
- documentName: 'Volet paysager',
- isUnder200m2: 'No',
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Note descriptive sommaire','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Note descriptive sommaire',
- isUnder200m2: 'Yes',
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Plan de situation','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Plan de situation',
- isUnder200m2: 'Yes',
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Plan de masse et d\'implantation','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Plan de masse et d\'implantation',
- isUnder200m2: 'Yes',
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Plan de travaux aux 1/50ème et au 1/10ème côté','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Plan de travaux aux 1/50ème et au 1/10ème côté',
- isUnder200m2: 'Yes',
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Eau et assainissement','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Eau et assainissement',
- isUnder200m2: 'Yes',
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Plans de sécurité','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Plans de sécurité',
- isUnder200m2: 'Yes',
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Identité et engagement d\'un bureau d\'étude spécialisé en sécurité','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Identité et engagement d\'un bureau d\'étude spécialisé en sécurité',
- isUnder200m2: 'Yes',
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Etude en sécurité','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Etude en sécurité',
- isUnder200m2: 'Yes',
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Note descriptive sommaire','No') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Note descriptive sommaire',
- isUnder200m2: 'No',
- isValidArchitecte: true,
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Plan de situation','No') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Plan de situation',
- isUnder200m2: 'No',
- isValidArchitecte: true,
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Plan de masse et d\'implantation','No') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Plan de masse et d\'implantation',
- isUnder200m2: 'No',
- isValidArchitecte: true,
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Plan de travaux aux 1/50ème et au 1/10ème côté','No') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Plan de travaux aux 1/50ème et au 1/10ème côté',
- isUnder200m2: 'No',
- isValidArchitecte: true,
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Eau et assainissement','No') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Eau et assainissement',
- isUnder200m2: 'No',
- isValidArchitecte: true,
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Plans de sécurité','No') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Plans de sécurité',
- isUnder200m2: 'No',
- isValidArchitecte: true,
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Identité et engagement d\'un bureau d\'étude spécialisé en sécurité','No') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Identité et engagement d\'un bureau d\'étude spécialisé en sécurité',
- isUnder200m2: 'No',
- isValidArchitecte: true,
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Etude en sécurité','No') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Etude en sécurité',
- isUnder200m2: 'No',
- isValidArchitecte: true,
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.ERP,'Volet paysager','No') ?: new Document(
- typeDeDemande: TypeDeDemande.ERP,
- documentName: 'Volet paysager',
- isUnder200m2: 'No',
- isValidArchitecte: true,
- isValidOrganism: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Note descriptive sommaire','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Note descriptive sommaire',
- isUnder200m2: 'Yes').save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Plan de situation','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Plan de situation',
- isUnder200m2: 'Yes').save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Plan de masse et d\'implantation','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Plan de masse et d\'implantation',
- isUnder200m2: 'Yes').save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Plan de travaux aux 1/50ème et au 1/10ème côté','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Plan de travaux aux 1/50ème et au 1/10ème côté',
- isUnder200m2: 'Yes').save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Eau et assainissement','Yes') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Eau et assainissement',
- isUnder200m2: 'Yes').save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Plan des infrastructure télécom','No') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Plan des infrastructure télécom',
- isUnder200m2: 'No',
- isValidOPT: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Note descriptive sommaire','No') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Note descriptive sommaire',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Plan de situation','No') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Plan de situation',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Plan de masse et d\'implantation','No') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Plan de masse et d\'implantation',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Plan de travaux aux 1/50ème et au 1/10ème côté','No') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Plan de travaux aux 1/50ème et au 1/10ème côté',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Eau et assainissement','No') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Eau et assainissement',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Volet paysager','No') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Volet paysager',
- isUnder200m2: 'No',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.IMMEUBLE,'Plan des infrastructure télécom','No') ?: new Document(
- typeDeDemande: TypeDeDemande.IMMEUBLE,
- documentName: 'Plan des infrastructure télécom',
- isUnder200m2: 'No',
- isValidOPT: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.HYDROCARBURE,'Note descriptive sommaire','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.HYDROCARBURE,
- documentName: 'Note descriptive sommaire',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.HYDROCARBURE,'Plan de situation','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.HYDROCARBURE,
- documentName: 'Plan de situation',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.HYDROCARBURE,'Plan de masse et d\'implantation','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.HYDROCARBURE,
- documentName: 'Plan de masse et d\'implantation',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.HYDROCARBURE,'Plan de travaux aux 1/50ème et au 1/10ème côté','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.HYDROCARBURE,
- documentName: 'Plan de travaux aux 1/50ème et au 1/10ème côté',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.HYDROCARBURE,'Eau et assainissement','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.HYDROCARBURE,
- documentName: 'Eau et assainissement',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.HYDROCARBURE,'Volet paysager','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.HYDROCARBURE,
- documentName: 'Volet paysager',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.HYDROCARBURE,'Récépissé de déclaration','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.HYDROCARBURE,
- documentName: 'Récépissé de déclaration',
- isUnder200m2: 'Any',
- isValidArchitecte: true,
- isValidOPT: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.COMMERCIAL,'Note descriptive sommaire','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.COMMERCIAL,
- documentName: 'Note descriptive sommaire',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.COMMERCIAL,'Plan de situation','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.COMMERCIAL,
- documentName: 'Plan de situation',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.COMMERCIAL,'Plan de masse et d\'implantation','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.COMMERCIAL,
- documentName: 'Plan de masse et d\'implantation',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.COMMERCIAL,'Plan de travaux aux 1/50ème et au 1/10ème côté','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.COMMERCIAL,
- documentName: 'Plan de travaux aux 1/50ème et au 1/10ème côté',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.COMMERCIAL,'Eau et assainissement','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.COMMERCIAL,
- documentName: 'Eau et assainissement',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.COMMERCIAL,'Volet paysager','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.COMMERCIAL,
- documentName: 'Volet paysager',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- Document.findByTypeDeDemandeAndDocumentNameAndIsUnder200m2(TypeDeDemande.COMMERCIAL,'Décision du président de l\'Assemblée de Province','Any') ?: new Document(
- typeDeDemande: TypeDeDemande.COMMERCIAL,
- documentName: 'Décision du président de l\'Assemblée de Province',
- isUnder200m2: 'Any',
- isValidArchitecte: true).save(flush: true)
- }
- def destroy = {
- }
- }
Add Comment
Please, Sign In to add comment