Ignore:
Timestamp:
Oct 26, 2010, 3:19:22 PM (10 years ago)
Author:
robert@…
Message:

Implemented clone feature in template editor (ticket #6), added a rest call 'getUser' and added webflow to the application.properties again.

Location:
trunk/grails-app/domain/dbnp/studycapturing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/studycapturing/Study.groovy

    r976 r996  
    2929        List assays
    3030        boolean published = false // Determines whether a study is private (only accessable by the owner and writers) or published (also visible to readers)
    31         boolean publicstudy = false  // Determines whether anonymous users are allowed to see this study. This has only effect when published = true
     31    boolean publicstudy = false  // Determines whether anonymous users are allowed to see this study. This has only effect when published = true
    3232       
    3333        static hasMany = [             
  • trunk/grails-app/domain/dbnp/studycapturing/Template.groovy

    r976 r996  
    22
    33import dbnp.authentication.SecUser
     4import dbnp.authentication.AuthenticationService
    45
    56/**
     
    3738
    3839        static hasMany = [fields: TemplateField]
    39 
    4040        static mapping = {
    4141        }
     
    7777                // name(unique:['entity'])
    7878
     79        }
     80
     81        public Template() {
     82                super()
     83        }
     84
     85        /**
     86         * Creates a clone of the given other template and also copies its owner
     87         *
     88         * @param       otherTemplate
     89         */
     90        public Template( Template otherTemplate) {
     91                this()
     92
     93                //authenticationService = new AuthenticationService()
     94
     95                this.name = otherTemplate.name + " (Copy)"
     96                this.description = otherTemplate.description
     97                this.entity = otherTemplate.entity
     98                this.owner = otherTemplate.owner
     99
     100                // The fields are copied by reference
     101                this.fields = otherTemplate.fields
     102        }
     103
     104        /**
     105         * Creates a clone of the given other template. The currently logged in user
     106         * is set as the owner
     107         * @param       otherTemplate
     108         */
     109        public Template( Template otherTemplate, SecUser owner ) {
     110                this()
     111
     112                //authenticationService = new AuthenticationService()
     113
     114                this.name = otherTemplate.name + " (Copy)"
     115                this.description = otherTemplate.description
     116                this.entity = otherTemplate.entity
     117                this.owner = owner
     118
     119                // The fields are copied by reference
     120                this.fields = []
     121                otherTemplate.fields.each {
     122                        this.fields.add( it )
     123                }
    79124        }
    80125
Note: See TracChangeset for help on using the changeset viewer.