Select a user and store his ID
Hello guys !
I want to select a list of users in a form and store them in the database.
In my project the user wants to select some projects (create a video / create a website / create a poster / ....), Each "project" has his own object in Database. For each project the user should be able to select a list of user who will be in charge of the project.
My first attempt was to only store the user ID, I create a list of Long in my database. But it does not realy fulfill my needs:
When I display my list in a page or for an export I don't want to have to load the user name.
Then I choose to create an object wich consist of an ID and string (a "displayName": firstname + lastname), then when I load my data I can have the name without extra steps. I created a "UserEntry" with the two variables, and I want to use this "Object" as an attribut of many other bdm objects (All the projects)
At first I have select the userEntry, with the relation type as a "Composition", but I can't have two differents object's attributs that refers to my UserEntry.
I changed the relation type to "Association" but now I can't create / update the "userEntry" if it's not already created.
So my question is : Do you have a nice way to select a list of users and save it in the BDM ?
If you want to retrieve a set of information all in one single API call maybe creating a REST API extension is a good option. You can provide all required information when calling the API and inside the custom API code you can call the various Engine APIs (including Identity API and BDM API) to get the information you need, format them and returns everything in the HTTP answer as JSON.
Hello again Antoine.
You already helped me for an other question (For the DAO), I kinda solve my issue. The difficulty come from the BDM model where you can't create a Object and use it in many places as a composition.