on 12-19-2006 9:40 AM
Hi All,
I am trying to fetch the list of documents, properties, log on/logoff functionality with an iUser ex: epuser, through java code.
The list of docs are presented in the Documents Folder with teh following sample code
|
RID rid = RID.getRID("/documents");
String userName = "epuser";
IUserFactory userFactory = UMFactory.getUserFactory();
com.sap.security.api.IUser userNew;
userNew = userFactory.getUser(userName);
com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(userNew);
ctx.setUser(user);
IResource res = null;
res = ResourceFactory.getInstance().getResource(rid, ctx);
wnen i am trying to fetch all the docs and the corresponding properties by passing " cmadmin_service " as an user name. i am getting the right results. But when i tried with "epuser " i am getting the output as Service Authentication value false.
Then i added epuser in the System Principal--->System User. still i am not getting the right results.
plz help me how to make this epuser as service authenticated user like cmadmin_service user
Hi phani,
I have no direct solution but you should check the service permissions of the resources you are trying to fetch. The exception sounds like there is the problem. Go to the Details of the CM-Resource and Select Settings-->Service Permissions.
Does the epuser has the necessary permissions for your operations?
Another thing is the way you are creating users:
The WPUMFactory has a special factory-method for creating service users. Perhaps this is a better aproach:
WPUMFactory.getServiceUserFactory().getServiceUser(user);
Best regards,
Stefan Brauneis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think you should use <i>serviceContext</i> to get the service user context. THis works for sure:
IResourceFactory m_Factory = ResourceFactory.getInstance();
IResourceContext context = m_Factory.getServiceContext("cmadmin_service");
RID rid = RID.getRID("/documents");
IResource res = m_Factory.getResource(rid, context);
A long time ago (~EP6 SP2) I was also trying to add a service user with no success, so now I just use the <i>cmadmin_service</i> user...
Romano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.