Adding a New User
In order to make use of this new Role Type, we have to add:
new Role with this Role Type
new User to associate with the new Role
new UserAssociation which maps the new User to the new Role
new Enterprise and Organization for everything to belong to
Each construct has its own file in the dataset. First, we will add the Enterprise.
Open data/Enterprises.csv from the Bookstore_dataset project, and add the following Enterprise:
SampleBookSupply,Sample Book Supply,1,US~TX~Dallas~~~~455 Valley View~~~75056~~~,US~TX~Dallas~~~~455 Valley View~~~75056~~~,,,,MONDAY,America/Chicago
Then save the Enterprises.csv file.
Open data/Organizations.csv, and add the following Organization:
SampleBookSupply,SampleBookSupply,Sample Book Supply,1,US~TX~Dallas~~~~455 Valley View~~~75056~~~,
Then save the Organizations.csv file.
To open data/Roles.csv (CSV files), right-click on it, and select Open With > Text Editor to open it inside Studio. You can also open it within Studio by dragging the file into the workspace area.
Once opened, add the following line:
SupplierRole,ZBKS.SupplierRoleType,SampleBookSupply,SampleBookSupply,,
1
Then save the Roles.csv file.
Open data/Users.csv and add the following line:
SupplierUser,SampleBookSupply,All,SupplierUser
@notrealemail
.com,Jane,,Smith,
1
,US,en
Then save the Users.csv file.
Open data/UserAssociations.csv and add the following line:
SupplierUser,
9123
,SampleBookSupply,SupplierRole,
9123
,SampleBookSupply,SampleBookSupply,,
1
Then save the UserAssociations.csv file.
Now we can load the dataset to submit everything that was just added. In the Ant tile, double-click the load-data target under the Bookstore_dataset project. You should see a BUILD SUCCESSFUL message once it completes.
In order for this new SupplierUser to be able to login, we have to create a desktop configuration for its Role Type in Bookstore's UI Meta Model. Open the MPT editor, and select the root element in the Outline tree. Then click the UiMetaModel tab.
We are going to give the same menu for the ZBKS.SupplierRoleType, so add this XML:
<
WebInfo
>
...
<
RoleTypeUiConfig
menuType
=
"tree"
>
<
RoleTypeRef
>
<
IntrinsicRoleType
>ZBKS.SupplierRoleType</
IntrinsicRoleType
>
</
RoleTypeRef
>
<
WebActionGroupRef
name
=
"SampleMenuGroup"
/>
</
RoleTypeUiConfig
>
</
WebInfo
>
As you can see, it uses the same SampleMenuGroup, which includes the 4 menu items that we have seen when logging in as BookstoreUser. Save the MP