Search the FirstSpirit Knowledge Base
Hello All,
I need to find the FirstSpirit server version in FSM module code.
As per the access API documentation, i can read the version information in FS 5.1 with the below code.
SpecialistsBroker broker = connection.getBroker();
String serverVersion = broker.requestSpecialist(ServerInformationAgent.TYPE).getServerVersion().getFullVersionString();
but i can't find the ServerInformationAgent in FS 4.2, is it possible to read the server version information in FS 4.2?
Thanks in advance!
Hello Kavin,
in FS 4.2 you can find the server version information in the Project:
p = context.getProject();
context.logInfo("Major: " + p.getMajorVersion());
context.logInfo("Minor: " + p.getMinorVersion());
context.logInfo("Build: " + p.getServerBuild());
Best regards,
Donato
Hello Kavin,
in FS 4.2 you can find the server version information in the Project:
p = context.getProject();
context.logInfo("Major: " + p.getMajorVersion());
context.logInfo("Minor: " + p.getMinorVersion());
context.logInfo("Build: " + p.getServerBuild());
Best regards,
Donato
Thank you Donato Marro,
According to the API documentation, getMajorVersion() returns the "major server version info (creation/importing time)".
I am little bit confusion in this documentation. What is it mean "version info of creation/importing time"?
will return current server version or server version of project created?
Can i use the same code in FS 5.1 also?
Hi Kavin,
sorry, you are right. The server version will be the version at creation/importing time of the project. So if you have updated the server in the meantime, you won't get the current server version.
You can use the same code in FS 5.1.
Regards,
Donato