
Applies to: NW 2004 SE SP9 and above, developed and tested on NW2004SSP18.
Summary: After Portal upgrade the roles were removed from users, now the requirement was to assign roles to users in two different ways. First requirement was that, there is Role1 which is given to some Users now the Role2 is to be assigned to all the users who have the previous Role i.e. Role1. Second Requirement was to give a user all the roles of some other user.
Preconditions:
The following are the preconditions that we need.
Before Deploying our Web Dynpro Application we should check whether the configuration settings for the J2EE server and for the SDM server are entered correctly in the Netweaver Developer Studio or not. To check the server settings, we have to choose the menu path Window => Preferences=> SAP J2EE Engine
Web Dynpro:
Web Dynpro is a client-independent programming model of the SAP NetWeaver technology platform for developing user interfaces for professional business applications. It is based on the model view controller paradim which ensures that the business logic is separated from the presentation logic. This architecture is visible in the Web Dynpro perspective of the SAP NetWeaver Developer Studio (NWDS).
Web Dynpro helps you with the development of Web applications by:
User Management Engine (UME) :
The user management engine (UME) offers a comprehensive API to manage user, roles, groups and the associates access control lists (ACLs). The implementation is based on the Portal Content Directory (PCD) and inherits some of its characteristics.
The UME API works with persisted data and the data has to be consistent on different portal nodes. This makes calls to the UME API rather complex. Performance often depends on the structure that is used to represent the data and is also affected by the cluster-communication to synchronize the collaborating nodes.
Package com.sap.security.api
For details about the classes please refer com.sap.security.api Class Hierarchy (Security (Netweaver 2004S SPS 09))
Now as we are familiar with the Interfaces and classes which are to be used, let us discuss about the development setup.
The Development Setup:
The first thing which we need to do is to finalize the development setup. Since we are developing a Web Dynpro application. We need to create the Development Components (DCs) for Web Dynpro application.
Step 1: Create a New WebDynpro Application Project
For creating a new WebDynpro Application project:
Development Components:
For this scenario, I have created two DCs one as the portal application project and the other for including external libraries.
Before proceeding, I would like to say you can create External Library DC same as step 1 only thing which will differ is the value of DC type earlier it was Web Dynpro now choose DC type to “External Library”.
The structure of DCs for development
Create Web Dynpro Component, Views, Window.
The structure of DC will look like.
RoleTransferView : In this view there are two EVS which are pre populated with portal roles one for Assigned role and another for New role. Now suppose,
Layout and Outline of RoleTransferView:
TransferByUser View : In this view there are two InputFields one for Assigned user and another for new user. Now Suppose.
layout and Outline of TransferByUser View:
TransferByRole View Layout and Outline:
In Property Tab of all the three views ADD the Required Controllers
Create Simple Type for EVS:
For creating simple types follow Creating Extended Value Selector (EVS) - Static and Dynamic in Web Dynpro for Java
Browse the type property of assignedRole context value attribute and choose the Simple Type created.
Repeat the same for newRole value attribute too and choose the simple type created.
And Map them with the InputField for assigned role and new role resp. in TransferRoleView.
For newRoleName value attribute make the calculated property as true.
Do the same for RoleName value attribute, and Map both (newRoleName and RoleName) with the Textviews in the TransferRoleView layout .
For removeRole value attribute the type property is Boolean and Map this with the checkbox in the TransferRoleView layout.
Code in wdDoInit() of RoleTransferView for populating the EVS with portal roles.
Code in getRoleName() to get the display text of EVS as the value for the Textview UI in RoleTransferView.
Code in getNewRolename() to get the display text of EVS as the value for the Textview UI in RoleTransferView.
Code under onActionassignRole() which is assign to “Assign”button of RoleTransferView.
Code under onActionassignRole which is assign to “Assign” button of TransferByUser view.
Embed the views (RoleTransferView and TransferByUser) in TransferByRole view as Tab Contents.
Create WebDynpro application, Build and deploy the DCs and then run.
Output Screen will look like:
Related Contents
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |