This is the code for both plugin and component integration, the method ServerInfo() is called:
* For Plugin - At beginning of Plugin Init(), after check that Env id Admin or SC, because I need to disable (not enable) plugin if server type is less than Pro+
* For Component - Just after login that can be both manned or not
Freddy
/// =======================================================================================
///
/// Informazioni sul Server
///
/// =======================================================================================
public sealed class ServerProductInfo
{
public string Name { get; internal set; } = string.Empty;
public int NumType { get; internal set; } = 0;
public int NumCode { get; internal set; } = 0;
public string Type { get; internal set; } = string.Empty;
public string SLC { get; internal set; } = string.Empty;
public int Major { get; internal set; } = 0;
public int Minor { get; internal set; } = 0;
}
/// =======================================================================================
///
/// Tipi di Server XProtect
///
/// =======================================================================================
public enum ServerType
{
Express = 250,
Professional = 300,
Enterprise = 400,
EssentialPlus = 440,
ExpressPlus = 460,
ProfessionalPlus = 480,
Expert = 500,
Corporate = 600
}
/// ///////////////////////////////////////////////////////////////////////////////////////
///
/// Estrae le Informazioni sul Server attuale
///
///
/// ///////////////////////////////////////////////////////////////////////////////////////
public static ServerProductInfo ServerInfo()
{
Item server = Configuration.Instance.GetItemsByKind(Kind.Server)[0];
if (server == null) return null;
//ProductVersion in XPE is formatted [0-9].[0-9][a-z] eg 8.5a
//ProductVersion in XPCO is formatted [0-9].[0-9].[0-9].[0-9] eg 6.1.0.1
//ServerType is Express = 250, Professional = 300, Enterprise = 400, ( Expert = 500, Corporate = 600 )
// - 440 - Essential+, 460 - Express +, 480 - Professional +
ServerProductInfo ServerInfo = new ServerProductInfo();
if (server.Properties.ContainsKey(“ProductVersion”))
{
string productVersionString = server.Properties[“ProductVersion”];
string[] s = productVersionString.Split(‘.’);
if (int.TryParse(s[0], out int major))
ServerInfo.Major = major;
if (int.TryParse(s[1].Substring(0, 1), out int minor))
ServerInfo.Minor = minor;
}
if (server.Properties.ContainsKey(“ProductName”))
ServerInfo.Name = server.Properties[“ProductName”];
if (server.Properties.ContainsKey(“ServerType”))
if (int.TryParse(server.Properties[“ServerType”], out int numType))
ServerInfo.NumType = numType;
if (server.Properties.ContainsKey(“ProductCode”))
if (int.TryParse(server.Properties[“ProductCode”], out int numCode))
ServerInfo.NumCode = numCode;
if (server.Properties.ContainsKey(“SLC”))
ServerInfo.SLC = server.Properties[“SLC”];
if (ServerInfo.NumType >= (int)ServerType.Express && ServerInfo.NumType <= (int)ServerType.Corporate)
{
ServerInfo.Type = ((ServerType)ServerInfo.NumType).ToString();
}
return ServerInfo;
}
Da: Milestone Developer Forum <noreply@milestonesys.com>
Inviato: lunedì 22 agosto 2022 15:26
A: frediano.dicarlo@secursys-sas.it
Oggetto: Peter Posselt Vergmann ti ha risposto: XProtect Server Type
I agree that it is not ideal that the object returned does not contain the exact same information in the different environments, but in general the MIP API has been implemented to expose the data available on each platform, so that an extra request to the server will not be needed, and thus the list of properties on some item types might differ between the different environments. As to the old response I am sorry that it did not state this, but it was not clear from your question whether it was about a SC, MC or EVS plugin and thus the answer was probably based on one of the other environments. But yes, I agree that a disclaimer about different environments would have been in place. Finally, I would really like to figure out how your code could have worked in the past in a Smart Client plugin. As I mention I have checked the source code history of Smart Client and it has never contained such properties. Can you confirm that you are using the following code and that VideoOS.Platform.SDK is not referenced from the project? List lServ = Configuration.Instance.GetItemsByKind(Kind.Server); Item server = lServ[0]; string productVersionString = server.Properties[“ProductVersion”]; string servertypeString = server.Properties[“ServerType”]; Kind regards, Peter
<https://developer.milestonesys.com/0050O0000071w1D?fromEmail=1&s1oid=00D200000008Uid&s1nid=0DB0O000000Kzmh&s1uid=0050O00000728pt&s1ext=0&emkind=chatterCommentNotification&emtm=1661174753210>
Peter Posselt Vergmann <https://developer.milestonesys.com/0050O0000071w1D?fromEmail=1&s1oid=00D200000008Uid&s1nid=0DB0O000000Kzmh&s1uid=0050O00000728pt&s1ext=0&emkind=chatterCommentNotification&emtm=1661174753210> (Milestone Systems)
I agree that it is not ideal that the object returned does not contain the exact same information in the different environments, but in general the MIP API has been implemented to expose the data available on each platform, so that an extra request to the server will not be needed, and thus the list of properties on some item types might differ between the different environments.
As to the old response I am sorry that it did not state this, but it was not clear from your question whether it was about a SC, MC or EVS plugin and thus the answer was probably based on one of the other environments. But yes, I agree that a disclaimer about different environments would have been in place.
Finally, I would really like to figure out how your code could have worked in the past in a Smart Client plugin. As I mention I have checked the source code history of Smart Client and it has never contained such properties.
Can you confirm that you are using the following code and that VideoOS.Platform.SDK is not referenced from the project?
List lServ = Configuration.Instance.GetItemsByKind(Kind.Server);
Item server = lServ[0];
string productVersionString = server.Properties[“ProductVersion”];
string servertypeString = server.Properties[“ServerType”];
Kind regards,
Peter
<https://developer.milestonesys.com/0D73X000009SPFl?fromEmail=1&s1oid=00D200000008Uid&s1nid=0DB0O000000Kzmh&s1uid=0050O00000728pt&s1ext=0&emkind=chatterCommentNotification&emtm=1661174753210>
o rispondi a questa email
In risposta a
XProtect Server Type
<https://developer.milestonesys.com/0050O00000728pt?fromEmail=1&s1oid=00D200000008Uid&s1nid=0DB0O000000Kzmh&s1uid=0050O00000728pt&s1ext=0&emkind=chatterCommentNotification&emtm=1661174753210>
Frediano Maria Di Carlo <https://developer.milestonesys.com/0050O00000728pt?fromEmail=1&s1oid=00D200000008Uid&s1nid=0DB0O000000Kzmh&s1uid=0050O00000728pt&s1ext=0&emkind=chatterCommentNotification&emtm=1661174753210>
<https://developer.milestonesys.com/0D73X000009SIVN?fromEmail=1&s1oid=00D200000008Uid&s1nid=0DB0O000000Kzmh&s1uid=0050O00000728pt&s1ext=0&emkind=chatterCommentNotification&emtm=1661174753210> mercoledì, luglio 27, 2022 4:04 PM
Rie,
starting from 2022R1 the properties ‘ProductVersion’ and ‘ServerType’ are missing, how I can get such information?
Many Thanks,
Freddy
<https://developer.milestonesys.com/0050O00000728pt?fromEmail=1&s1oid=00D200000008Uid&s1nid=0DB0O000000Kzmh&s1uid=0050O00000728pt&s1ext=0&emkind=chatterCommentNotification&emtm=1661174753210>
Frediano Maria Di Carlo <https://developer.milestonesys.com/0050O00000728pt?fromEmail=1&s1oid=00D200000008Uid&s1nid=0DB0O000000Kzmh&s1uid=0050O00000728pt&s1ext=0&emkind=chatterCommentNotification&emtm=1661174753210>
Peter,
first of all it is hard to accept that same method will return different values depending on use of plugin or component integration.
Second I can confirm that my client plugin is working well before 2022 release, for this reason he is going to Essen with 2021R2.
Last but not least, you are affirming that we cannot trust technical support responses: https://developer.milestonesys.com/s/question/0D53X00008T1Z8rSAF/xprotect-server-type … this is serious.
Regards,
Frediano
Da: Milestone Developer Forum <noreply@milestonesys.com mailto:[noreply@milestonesys.com](mailto:noreply@milestonesys.com)\ >
Inviato: lunedì 22 agosto 2022 13:28
A: frediano.dicarlo@secursys-sas.it mailto:[frediano.dicarlo@secursys-sas.it](mailto:frediano.dicarlo@secursys-sas.it)\
Oggetto: Peter Posselt Vergmann ti ha risposto: XProtect Server Type
Hi again, I tested with 2021 R1 (both SC and server) and still could not get the ProductVersion and ServerType properties on the server item returned by Configuration.Instance.GetItemsByKind(Kind.Server). I also checked the source