Hi Samuli,
Thanks for your reply.
Please find the code in which you can find the deprecated function "system = landscape.getEPSystem(alias);"
in this line in NWDS 7.31 i am getting as deprecated .So please let me know the replacement for this line.
Also everytime the application is deployed it going to the else part and showing error due deprecated function.
public SAPData getSAPData(String alias) {
SAPData sapData = null;
String userUniqueName = null;
// get query user uniqueName
userUniqueName = PortalUtil.getRequesterPortalUniqueName();
ISystemLandscapeService service = (ISystemLandscapeService) PortalRuntime.getRuntimeResources().getService(ISystemLandscapeService.KEY);
IDesigntimeSystemLandscapeService desTimeSLService = service.getIDesigntimeSystemLandscapeService();
try {
ILandscapeService landscape = (ILandscapeService) PortalRuntime.getRuntimeResources().getService(ILandscapeService.KEY);
IEPSystem system = null;
if (userUniqueName != null) {
// modified 10.11.2010 to query with username instead of uniqueId
IUser user = (IUser)UMFactory.getUserFactory().getUserByUniqueName(userUniqueName);
system = landscape.getEPSystem(alias, user);
//landscape.getSystem(alias, user);
} else {
system = landscape.getEPSystem(alias);
//IUser user = (IUser)UMFactory.getUserFactory().getUserByUniqueName(userUniqueName);
// system = landscape.getEPSystem(alias, user);
}
if (system != null) {
sapData = new SAPData();
sapData.setAlias(alias);
IUser user = (IUser)UMFactory.getUserFactory().getUserByUniqueName(userUniqueName);
String desc = system.getDescription(Locale.ENGLISH);
if(desc.equals("")) desc = null;
sapData.setDescription(desc);
Enumeration keyEnum = system.getAttributeKeys().elements();
boolean sidFound = false;
while (keyEnum.hasMoreElements()) {
String attributeName = (String) keyEnum.nextElement();
//System.err.println("attributename: " + attributeName + " value: " + system.getAttribute(attributeName));
if(attributeName.equals("ashost"))
{
//sapSourceDAO.setAlias(alias);
sapData.setAsHost(system.getAttribute(attributeName));
}
else if(attributeName.equals("mshost"))
{
sapData.setMsHost(system.getAttribute(attributeName));
}else if(attributeName.equals("group"))
{
sapData.setGroup(system.getAttribute(attributeName));
}else if(attributeName.equals("sysnr"))
{
sapData.setSysNr(system.getAttribute(attributeName));
}
else if(attributeName.equals("ServerPort"))
{
sapData.setServerPort(system.getAttribute(attributeName));
}
// added 5.8.2011 first check sid from variable SAPSYSTEMNAME and if not found from SAPApplicationr3name
else if (attributeName.equals("SAPSYSTEMNAME")) {
//System.err.println("attribute sapsystemname found. value: " + system.getAttribute(attributeName));
sapData.setName(system.getAttribute(attributeName));
sidFound = true;
} else if(!sidFound && attributeName.equals("SAPApplicationr3name")) {
sapData.setName(system.getAttribute(attributeName));
sidFound = true;
}else if(!sidFound && attributeName.equals("r3name")) {
sapData.setName(system.getAttribute(attributeName));
}
else if(attributeName.equals("client"))
{
sapData.setClient(system.getAttribute(attributeName));
} else if (attributeName.equals("SystemAlias")) {
//System.err.println("Logical system name is: " + system.getAttribute(attributeName));
//sapSourceDAO.setLogicalSystemName(system.getAttribute(attributeName));
} else if (attributeName.equals("AuthenticationURL")) {
sapData.setUrl(system.getAttribute(attributeName));
}
}
} else {
System.err.println("system with alias: " + alias + " is null. Alias and/or user may be incorrect or portal system landscape permissions may be incorrectly configured.");
return null;
}
} catch (UMException e) {
e.printStackTrace();
} finally {
}
return sapData;
}
Thanks®ards,
Bharanidharan