Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6995487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:01:55+00:00 2026-05-27T20:01:55+00:00

I need to develop a application for a user’s management in a IT Project.

  • 0

I need to develop a application for a user’s management in a IT Project. This is done in order to learn Grails. I have some problem to start with :

In my sample app, a user has many tasks, belongs to a project, have many holiday status, belongs to the Resource planning and thats it. (kind of requirements!)

Now….. When it comes to domain modeling, how I actually model this? I came up the solution of modeling something like this :

class User { 
        //relationships. . . . 
        static belongsTo = [ company : Company, role : Role, resource : Resource] 
        static hasMany = [ holidays : Holiday, tasks : Tasks ] 
        Profile profile 
        Project project 
        String login 
        String password 
        static constraints = { 
                login(unique:true,size:6..15) 
                profile(nullable:true) 
        } 
        String toString() { 
                this.login 
        } 
} 

Now taking advantage of Grails scaffolding. I generated the view, hmmm well thats where I got struck!

With this model in place, clearly when creating a new User., I need to give away project details, resource details. Even though I can change the view as I need, for example I need only two fields say login and password for the new User to register my site. But as per data modeling, how I can handle other fields like Profile, Project and other relationships. This sounds complicated! I know i’m a newbie to both web development and I want your suggestions and how do I proceed with this?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:01:56+00:00Added an answer on May 27, 2026 at 8:01 pm

    You need to override the save action in your controller and fill those additional fields there.

    Try adding the following code in UserController:

    def save = {
        def userInstance = User.get(params.id)
        if (!userInstance) {
            userInstance = new User()
    
            // here you can fill in additional fields:
            userInstance.profile = myMethodToGetTheProfile()
            userInstance.project = myMethodToGetTheProject()
            ...
        }
        userInstance.properties = params
        if (userInstance.save(flush: true)) {
            flash.message = message(code: 'default.created.message', args: [message(code: 'User.propertyName.label', default: 'User'), userInstance.id])}
            redirect(action: session.lastActionName ?: "list", controller: session.lastControllerName ?: controllerName)
        } else {
            render(view: "form", model: [userInstance: userInstance, mode: 'edit'])
        }
    }
    

    The implementation of methods to get the default project depends on your app’s logic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to develop a simple application that allows the user to write some
I need to develop some sort of application featuring Editing Movie slices, Adding and
My problem is I need to develop a sales application to be used on
I need to develop a windows application with .NET 3.5 that needs to have
My company is to develop a touchscreen application. We have some prior experience with
I need to develop this kind of application, i'm using php and mysql first
Folks, I have one application to develop in which I need notification when the
If I need to develop JavaFx application with rich user interface (3D shapes ...
I need to develop a browser based application that record the user screen, much
I want develop an application on windows mobile. In this app, i need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.