ProjX reads the menu configuration from the database. It's not needed to build the menu manually. You configure/map your workscreens and create access roles like administrator, developer, user. You have to assign your screens to roles, e.g., a developer has access to all screens, an administrator has access to all application screens but not to development screens, and so on.
The ProjX application supports multiuser applications out of the box without writing one line source code.
Be sure that your database has the following tables: USERS, ROLES, WOKSCREENS, USER_ROLE, ROLE_WOSC and following views: V_ACCESSRULES, V_USERROLES, V_USERSCREENS.
Add the object com.sibvisions.apps.server.object.DBWorkScreenAccess to your session life cycle object:
public IWorkScreenAccess getWorkScreenAccess() throws Exception { DBWorkScreenAccess dbwsac = (DBWorkScreenAccess)get("workScreenAccess"); if (dbwsac == null) { dbwsac = new DBWorkScreenAccess(); dbwsac.setDBDataSource(getDBAccess()); put("workScreenAccess", dbwsac); } return dbwsac; }
The DBWorkScreen class implements the IAccessController interface and you should configure the accesscontroller in your config.xml:
<accesscontroller>com.sibvisions.apps.server.object.DBWorkScreenAccess</accesscontroller>
The access controller reads V_ACCESSRULES and checks the access to life cycle objects.
After successful configuration, map your screens. The workscreens table should be self explained:
Name TYPE -------------- ------------- ID NUMBER(16) TEXT VARCHAR2(200) SIDEBAR_TEXT VARCHAR2(200) MENU_STRUCTURE VARCHAR2(200) IMAGE VARCHAR2(200) SIDEBAR_IMAGE VARCHAR2(200) SEQUENCE NUMBER(16) CLASSNAME VARCHAR2(200) LIFECYCLENAME VARCHAR2(200) SHORTCUT VARCHAR2(1)
And don't forget the role assignment per user. It's a simple n:m relation.