Saving modified TimeProfiles/TimeProfileAppointmentRecurChildItem

What’s the proper way to save TimeProfiles to the config?

I’ve tried the ConfigAPIClient but it doesn’t support TimeProfiles. I realize AddTimeProfileServerTask and RemoveTimeProfileServerTask exist but there’s no obvious way to initialize those classes and bind them to ther server.

It’s also unclear on what way to fetch TimeProfiles in the docs. I’ve found this way successful but if there’s a better way I’d be glad to hear it:

var managementServer = new ManagementServer(Configuration.Instance.ServerFQID.ServerId);
var timeProfiles = managementServer.TimeProfileFolder.TimeProfiles;

One of the news for MIP SDK 2018R1 is -

It is now possible to create and modify times profiles via the class VideoOS.Platform.ConfigurationItems.TimeProfile.

Yes I know. The documentation does not cover how to save the TimeProfile after modifying it. Please read my question again and don’t hesitate to ask if anything is unclear.

I call it a news of MIP SDK 2018R1, but that is inaccurate (sorry), it would require an XProtect 2018 R1 (c-code) server. With the server in place you will be able to do time profiles in the Config API Client sample. If you have this in place I am in doubt whether you still might need further on the strongly type classes, let me know what you find.

I’m running 2018 R1 Corporate. The ConfigApiClient returns error when I’m trying to modify time profiles.

What is the error you see?

Could you guys make a sample for TimeProfile modification? The documentation is really fuzzy.

The error is caused by the sample application attempting to save the child-item, it should save the item including child-items. Save should be performed on the time-profile not the individual appointment.

I did an experiment (I do not want to call it a sample):

ManagementServer mgt = new ManagementServer(EnvironmentManager.Instance.MasterSite.ServerId);
TimeProfile tp = mgt.TimeProfileFolder.TimeProfiles.FirstOrDefault();
tp.TimeProfileAppointmentRecurChildItems.FirstOrDefault().Subject = "Testing";
tp.Save();

Yup, that works.. It was too simple for me to see. Thanks a bunch!