on 05-04-2007 8:49 AM
I'm new to WebDynpro Java and working on a WD which is protected by UME permissions.
How can I read normal UME Properties from the portal into my WD? How does this data binding work?
I already read the tutorial about the "Car rental application".
Code samples and links are welcome.
Thanks in advance.
Best regards,
Hartmut
I found the solution in another thread.
com.sap.security.api.util.IUMParameters params = UMFactory.getProperties();
params.get("ume.tpd.companies");
ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("<NodeName>.<AttribiuteName>");
IModifiableSimpleValueSet values=myType.getSVServices().getModifiableSimpleValueSet();
values.put("0",<FirstValuein the Parameter>);
values.put("1",<SecondValuein the Parameter>);
and bind the "DropDownByKey: UIELement dataSource to <NodeName>.<AttribiuteName>.
Thanks to Anilkumar Vippagunta.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you all for your replies.
I already knew this stuff about UME Permission, tutorials ...
My question was:
How can I read normal UME Properties from the portal into my WD? How does this data binding work?
Example:
I have a ume property in the portal (ume_user_dateofentry). How can I get it's value into an InputField?
I want to make some changes then and save it back to the ume property.
How does it work?
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hartmut,
You can use the following code for reading user details from UME.
ISearchResult rst = UMFactory.getUserFactory().getUniqueIDs();
IUserFactory usf = UMFactory.getUserFactory();
IUser iuser = null;
IUserListElement userElement = null;
int i = 0;
while (rst.hasNext()) {
iuser =
UMFactory.getUserFactory().getUser(rst.next().toString());
String email = iuser.getEmail();
String fname = iuser.getFirstName();
String lname = iuser.getLastName();
}
if you want to get the uniquename of the logged in portal user use this code.
String Username = "";
IWDClientUser wdUser = null;
try {
wdUser = WDClientUser.getCurrentUser();
} catch (WDUMException e) {
e.printStackTrace();
}
IUser user = wdUser.getSAPUser();
();
Username =user.getUniqueName();
regards
Anil
Hi Hartmut,
IUser user = WDUSER.getSAPUser();
IUserAccount[] acct = user.getUserAccounts();
strUserid = acct[0].getLogonUid();
I've provided the sample example for getting the logon id of the user. Similarly, you can retrieve other parameters too.
To use this functionality you need to add an external api jar to your project named core.security.api.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractButton;
import com.sap.tc.webdynpro.progmodel.api.WDVisibility;
import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractInputField;
import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
import com.sap.tc.webdynpro.services.sal.um.api.WDUMException;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!USER LOGIN RESTRICTIONS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
try
{
IWDClientUser user = WDClientUser.getCurrentUser();
int Strlen = user.toString().length();
String StrUser = user.toString().substring(19,Strlen-1);
if(user != null)
{
wdContext.current__Arch__Arm_Get_User_Cat_InputElement().setIm_User(StrUser);
wdThis.wdGetArchCompController().GetUserCat();
}
} catch(WDUMException e) {
e.printStackTrace();
}
finally
{
}
String UserCat = wdContext.node__Arch__Arm_Get_User_Cat_Input().nodeOutput().currentOutputElement().getEx_User_Cat();
// int StrlenCat = UserCat.toString().length();
// String UserCat1 = UserCat.substring(1,StrlenCat);
if (UserCat.equals("C"))
{
IWDAbstractButton IButton1,IButton2,IButton3;
IButton1 = (IWDAbstractButton)view.getElement("Buttons1");
IButton1.setVisible(WDVisibility.VISIBLE);
IButton1.setEnabled(true);
IButton2 = (IWDAbstractButton)view.getElement("Buttons2");
IButton2.setVisible(WDVisibility.VISIBLE);
IButton2.setEnabled(false);
IButton3 = (IWDAbstractButton)view.getElement("Buttons3");
IButton3.setVisible(WDVisibility.VISIBLE);
IButton3.setEnabled(false);
}
if (UserCat.equals("D"))
{
IWDAbstractButton IButton1,IButton2,IButton3;
IButton1 = (IWDAbstractButton)view.getElement("Buttons1");
IButton1.setVisible(WDVisibility.VISIBLE);
IButton1.setEnabled(false);
IButton2 = (IWDAbstractButton)view.getElement("Buttons2");
IButton2.setVisible(WDVisibility.VISIBLE);
IButton2.setEnabled(false);
IButton3 = (IWDAbstractButton)view.getElement("Buttons3");
IButton3.setVisible(WDVisibility.VISIBLE);
IButton3.setEnabled(true);
}
if (UserCat.equals("M"))
{
IWDAbstractButton IButton1,IButton2,IButton3;
IButton1 = (IWDAbstractButton)view.getElement("Buttons1");
IButton1.setVisible(WDVisibility.VISIBLE);
IButton1.setEnabled(false);
IButton2 = (IWDAbstractButton)view.getElement("Buttons2");
IButton2.setVisible(WDVisibility.VISIBLE);
IButton2.setEnabled(true);
IButton3 = (IWDAbstractButton)view.getElement("Buttons3");
IButton3.setVisible(WDVisibility.VISIBLE);
IButton3.setEnabled(false);
}
if (UserCat.equals("A"))
{
IWDAbstractButton IButton1,IButton2,IButton3;
IButton1 = (IWDAbstractButton)view.getElement("Buttons1");
IButton1.setVisible(WDVisibility.VISIBLE);
IButton1.setEnabled(true);
IButton2 = (IWDAbstractButton)view.getElement("Buttons2");
IButton2.setVisible(WDVisibility.VISIBLE);
IButton2.setEnabled(true);
IButton3 = (IWDAbstractButton)view.getElement("Buttons3");
IButton3.setVisible(WDVisibility.VISIBLE);
IButton3.setEnabled(true);
}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!LogOff!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
try
{
IWDClientUser user = WDClientUser.getCurrentUser();
WDClientUser.forceLogoffClientUser("");
}catch(WDUMException e) {
e.printStackTrace();
}
finally
{
}
This is my Code in my application. It will help you
thanks and regards
Ravi.Golla
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hartmut Buckenmayer,
Check the below links, hope they will be helpful
https://media.sdn.sap.com/javadocs/NW04/SP9/ume/index.html--->UME API Specification
https://www.sdn.sap.com/irj/sdn/developerareas/java?rid=/webcontent/uuid/adcfa85d-0501-0010-a398-80a... [original link is broken]
http://help.sap.com/saphelp_nw04/helpdata/en/cc/cdd93f130f9115e10000000a155106/frameset.htm-->Webdynpro UME coding
http://help.sap.com/saphelp_nw2004s/helpdata/en/f3/a64d401be96913e10000000a1550b0/frameset.htm
-->Protecting Access to the Web Dynpro Application Using UME Permissions
http://help.sap.com/saphelp_nw04/helpdata/en/a4/d39b3e09cdf313e10000000a114084/frameset.htm
-->Permissions, Actions, and UME Roles
i hope that helps.
regards
Anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.