on 09-28-2007 11:38 AM
Hi Everybody,
Can anyone tell how to fetch the Connection properties like server name, repository name at runtime by Specifying the System Alias I have created in the Portal.
I have made a webService in which I am trying to connect to MDM ,using system Alias. I dont want to do any hard coding, To connect to MDM I need the following three parameters:
Server Name
Repository Name
Repository Port
if any body have tried it or have some clue about it, please let me know.
Even a small clue in this direction would be a great help.
Best Regards,
Namrta Mahajan
Hi Namrata,
may be you can use ISystem class for this
Thanks
Ninad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Namrta,
I mailed you jar file and found a sample code which I am giving bellow tell me if you have any problem.
ISystems systemSrv = (ISystems)PortalRuntime.getRuntimeResources().getService(ISystems.KEY);
String systemId= systemSrv.systemSrv.getSystemId("alias1");
Hashtable env =
new
Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,IPcdContext.PCD_INITIAL_CONTEXT_FACTORY); env.put(IPcdContext.PCD_PERSONALIZATION_PRINCIPAL,
request.getUser()); env.put(Context.SECURITY_PRINCIPAL, request.getUser());
env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
InitialContext iCtx = null;
try
{
iCtx = new InitialContext(env);
ISystem result =(ISystem)iCtx.lookup(sysId);
//get system attributes
java.util.Enumeration enum =
result.getAttributeIds();
//get user mapping object
ISystemUserMappingData userMappingData =
result.getUserMappingData(user);
}catch(javax.naming.NamingException e)
Thanks
Ninad
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.