on 01-09-2007 2:47 PM
Hi,
I wanted to write a java code that will fetch me the Portal Version.
I have installed the Portal 6.0 SP9
I came across this code in the jar
"com.sap.portal.runtime.system.clusterinformation_api.jar"
private File getVersionRootDir()
{
IClusterInformation clusterInfo = (IClusterInformation)PortalRuntime.getRuntimeResources().getService("com.sap.portal.runtime.system.clusterinformation.clusterinformation");
String serverRootDir = clusterInfo.getSAPJ2EEServerDirectory();
return new File(serverRootDir, "../../portal_misc/versions");
}
Now i went through the class IClusterInformation which is an interface.
Here it is an abstarct class
public abstract String getSAPJ2EEServerDirectory();
I wanted to get the implementation of this method.
Thank
Manoj
Hi Manoj,
Can you please let me know the jar file that has to be included to access the class IClusterInformation.
Thanks,
Sudhir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudhir,
I did not get the class IClusterInformation.
But if you want to get the Portal version you could do the folloiwng
Try to get the following System property form the J2EE server.
System.getProperty("sys.global.dir");
Here you will get the path
/usr/sap/<SAPSID>/SYS/global.
Form here write Java code to do the followign
String sysGlobalDir = System.getProperty("sys.global.dir");
if (sysGlobalDir == null)
{
// aRequest.getLogger().warning(this, "getVersionRootDir(): system property sys.global.dir not set.");
System.out.println( "getVersionRootDir(): system property sys.global.dir not set.");
} else
{
versionRootDir = new File(sysGlobalDir, "portal_versions");
}
if (versionRootDir != null && versionRootDir.exists())
{
File versionTxtFile = new File(versionRootDir, "version_id.txt");
if (versionTxtFile.exists())
{
portalVersion = getVersionNumber(versionTxtFile);
} else
{
System.err.println("FILE DOES NOT EXIST");
}
}
implement the getVersionNumber() funmction to read the line form the file version_id.txt.
Hope this helps
Regards
Manoj
Hi,
Have a look at class com.sapportals.portal.prt.runtime.PortalRuntime. There is a method getVersion(). I think this is what you need.
Regards
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.