cancel
Showing results for 
Search instead for 
Did you mean: 

How to use IUserfactory in Webdynpro?

Former Member
0 Kudos

Hello All,

I need to develop a report fetching some data from the UME in Portals

I am suppose to use the method IUserfactory.getUniqueIDs to fetch all the users in the User Management Engine.

But when I place this methode in wdinit() for a view controller I get a parsing issue - obviously It must not be able to search for the API . So how should I go about doing the same.

Best Regards,

Roby...

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Robert,

Have you added the com.sap.security.api.iuser jar file in your project.

Else you have to import the required jar files manually in "java build path" of the project.

Right click project, open properties, open java build path, click on libraries, click on add external jars, in the eclipse folder, search for the iuser jar and add the jar. click ok and then rebuild your project.

Chintan.

Former Member
0 Kudos

Hello Chintan,

>>> Have you added the com.sap.security.api.iuser jar file in your project.

No I have not added

And when I perform the steps mentioned below

>>>Right click project, open properties, open java build path, click on libraries, click on add external jars, in the eclipse folder,

I have the following folders

examples

features

plugins

readme

tools

Could you please help me locate the iuser jar files plss .

Best Regards,

Roby ...

chintan_virani
Active Contributor
0 Kudos

Which version of NWDS you are using?

You should get the following tabs when you click on Java Build Path: Source, Projects, Libraries & Order and Export.

Are you doing a right click on your project in NWDS???

Chintan

chintan_virani
Active Contributor
0 Kudos

Rob,

You will need to add the following jars com.sap.security.api.jar & com.sap.security.api.perm.jar and you can find them on following location on you hard drive:-

<Path where you have installed IDE for eg: C:\Program Files\IDE>\IDE70\eclipse\plugins\com.sap.tc.ap_2.0.0\comp\SAP-JEE\DCs\sap.com\com.sap.security.api.sda\_comp\gen\default\public\default\lib\java

Former Member
0 Kudos

Hi,

Right click project, open properties, open java build path

Click on ADD Variable

Select WD Runtime--> Click Extend

Select com.sap.security.api.jar

Click OK

Now come to your implementaion page and open context menu and select organize imports.

Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

I have performed the steps mentioned by you and also performed the organise import and now able to use the IUserfactory .

But now the problem is I am not able to find the method which can fetch me all the users.

Unable to get this statement IUserfactory.getUniqueIDs()

I am using NWDS Version: 7.0.09

Best Regards,

Roby..

Former Member
0 Kudos
Former Member
0 Kudos

Hi AyyapaRaj,

I have an issue - when I write this statement

ISearchResult irsch = IUserFactory.getUniqueIDs() ;

I get an error saying that getUniqueIDs() is not static.

So when I try to instantiate IUserFactory I get an error saying it cannot be intantiated.

Best Regards,

Roby..

chintan_virani
Active Contributor
0 Kudos

Try this

IUserFactory userFactory = UMFactory.getUserFactory();

try

{

ISearchResult searchResult = userFactory.getUniqueIDs();

}

catch (UMException e)

{

// TODO: handle exception

}

Former Member
0 Kudos

Chintan. Thanks this works.

But where in the Javadocs u have found this ?

Best Regards,

Roby..

chintan_virani
Active Contributor
Former Member
0 Kudos

Hi Chintan,

I created a simple Java project and created a simple Java Class with the following code

public class NumberofUsers {

public static void main (String[] args) {

IUserFactory userFactory = UMFactory.getUserFactory();

try

{

ISearchResult isearchresult = userFactory.getUniqueIDs();

System.out.println(isearchresult);

}

catch ( Exception e )

{

}

}

I am gettting the following error when I run the program

java.lang.NoClassDefFoundError: com/sap/tc/logging/Location

at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:178)

at NumberofUsers.main(NumberofUsers.java:21)

Exception in thread "main"

Former Member
0 Kudos

Hi Robert,

Try doing this:

Right Click on Project>Properties>WebDynpro References-->Sharing References

Add this entry

PORTAL:com/sap/tc/logging/Location

Regards,

Murtuza

Answers (1)

Answers (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hello Bala,

The links which you have given donot open .

I am getting following error in all the pages

The specified thread [XXXXXXX] was not found.

So please check and let me know plss.

Regards,

Rob..

chintan_virani
Active Contributor
0 Kudos

I don't know why this thing happens but I have faced this and I just remove the extra ? from the URL in address window and it works.

Chintan.