Created
March 6, 2012 12:30
-
-
Save olivermt/1986019 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def doAddEntity() { | |
| withStandard { StandardVersion standard -> | |
| StandardEntity entity = new StandardEntity() | |
| entity.initialPopulation(params.entity.name, params.entity.description, params.list("attribute.name"), params.list("attribute.description"), params.list("attribute.required"), params.list("attribute.dataType"), standard) | |
| if (entity.validate()) { | |
| entity.save(flush: true) | |
| entity.updateEntityChildren(params.list('standardEntity.id'), params.list('standardEntity.required'), params.list('standardEntity.plurality')) | |
| entity.updateEnumChildren(params.list('standardEnum.id'), params.list('standardEnum.required'),) | |
| redirect(action: "showEntity", id: entity.id) | |
| return | |
| } | |
| // println entity.errors | |
| def model = populateEntityModel(standard) | |
| model.standard = standard | |
| model.entity = entity | |
| render(view: "addEntity", model: model) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment