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.

  1. 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
  2. Then save the Enterprises.csv file.

  3. Open data/Organizations.csv, and add the following Organization:

    SampleBookSupply,SampleBookSupply,Sample Book Supply,1,US~TX~Dallas~~~~455 Valley View~~~75056~~~,
  4. Then save the Organizations.csv file.

  5. 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.

  6. Once opened, add the following line:

    SupplierRole,ZBKS.SupplierRoleType,SampleBookSupply,SampleBookSupply,,1
  7. Then save the Roles.csv file.

  8. Open data/Users.csv and add the following line:

    SupplierUser,SampleBookSupply,All,SupplierUser@notrealemail.com,Jane,,Smith,1,US,en
  9. Then save the Users.csv file.

  10. Open data/UserAssociations.csv and add the following line:

    SupplierUser,9123,SampleBookSupply,SupplierRole,9123,SampleBookSupply,SampleBookSupply,,1

  11. Then save the UserAssociations.csv file.

  12. 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.

  13. 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.

  14. 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>
  15. 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