Example #1
0
        public virtual void Initialize()
        {
            Cleanup();

            using (var context = new RSMDB.RSMDataModelDataContext())
            {
                var sysList = new List <RSMDB.ExternalSystem>()
                {
                    StageFactory.CreateExternalSystem(1, Constants.R1SMSystemName, RSMDB.ExternalSystemDirection.None),
                    StageFactory.CreateExternalSystem(2, "S2 Import", RSMDB.ExternalSystemDirection.Incoming),
                    StageFactory.CreateExternalSystem(3, "Track", RSMDB.ExternalSystemDirection.Outgoing),
                    StageFactory.CreateExternalSystem(4, "S2 Export", RSMDB.ExternalSystemDirection.Outgoing),
                    StageFactory.CreateExternalSystem(5, "PeopleSoft", RSMDB.ExternalSystemDirection.Incoming),
                };

                var settingsList = new List <RSMDB.Setting>()
                {
                    StageFactory.CreateSetting(1, "RuleEngineAllow", "Allow the R1SM rule engine to assign roles.", "false", 0, true, InputTypes.Checkbox, sysList[0]),
                    StageFactory.CreateSetting(2, "JobCodesFirst", "Show job codes before job titles when editing rules.", "false", 1, true, InputTypes.Checkbox, sysList[0]),
                    StageFactory.CreateSetting(3, "RequireAccessApproval", "Require approval of changes made by the rule engine", "false", 2, false, InputTypes.Checkbox, sysList[0]),
                    StageFactory.CreateSetting(4, "AdminPass", "New Admin Password", "Testing", 3, true, InputTypes.Password, sysList[0]),
                    StageFactory.CreateSetting(5, "LevelImport", "Allow importing of levels from S2.", "false", 1, true, InputTypes.Text, sysList[1]),
                    StageFactory.CreateSetting(6, "S2Import.ServiceAddress", "Appliance Address", "http://localhost", 2, true, InputTypes.Text, sysList[1]),
                    StageFactory.CreateSetting(7, "S2Import.PersonImport", "Allow importing of People from S2.", "true", 0, true, InputTypes.Checkbox, sysList[1]),
                    StageFactory.CreateSetting(8, "TrackExport.PersonExport", "Allow exporting of People to Track", "true", 0, true, InputTypes.Checkbox, sysList[2]),
                    StageFactory.CreateSetting(9, "TrackExport.LocationExport", "Allow exporting of Locations to Track", "true", 1, true, InputTypes.Checkbox, sysList[2]),
                    StageFactory.CreateSetting(10, "TrackExport.AccessExport", "Allow exporting of Access History to Track", "true", 2, true, InputTypes.Checkbox, sysList[2]),
                    StageFactory.CreateSetting(11, "S2Import.ServiceAccount", "S2 Service User Id", "asdfasasdfasd", 3, true, InputTypes.Text, sysList[1]),
                    StageFactory.CreateSetting(12, "S2Import.ServicePassword", "S2 Service Password", "admin", 4, true, InputTypes.Password, sysList[1]),
                    StageFactory.CreateSetting(13, "PersonExport", "Allow exporting of user data and roles to S2", "false", 0, false, InputTypes.Checkbox, sysList[1]),

                    StageFactory.CreateSetting(14, "S2Import.Repeat", "Allow S2 import task to repeat.", "true", 0, false, InputTypes.Checkbox, sysList[1]),
                    StageFactory.CreateSetting(15, "S2Import.RepeatInterval", "S2 import repeat interval in minutes.", "3", 0, false, InputTypes.Text, sysList[1]),
                    StageFactory.CreateSetting(16, "S2Import.LastAccessEvent", "Date time of last access record imported from S2.", "", 0, false, InputTypes.Text, sysList[1]),

                    StageFactory.CreateSetting(17, "TrackExport.ServiceAddress", "Appliance Address", "http://localhost", 2, true, InputTypes.Text, sysList[2]),
                    StageFactory.CreateSetting(18, "TrackExport.ServiceAccount", "Track Service User Id", "asdfasasdfasd", 3, true, InputTypes.Text, sysList[2]),
                    StageFactory.CreateSetting(19, "TrackExport.ServicePassword", "Track Service Password", "admin", 4, true, InputTypes.Password, sysList[2]),
                    StageFactory.CreateSetting(20, "TrackExport.LastAccessEvent", "Date time of last access record exported to Track.", "", 0, false, InputTypes.Text, sysList[2]),
                    StageFactory.CreateSetting(21, "TrackExport.SourceSystem", "System whose data will be exported to Track.", "", 0, false, InputTypes.Text, sysList[2]),
                    StageFactory.CreateSetting(22, "TrackExport.Repeat", "Allow Track export task to repeat.", "true", 0, false, InputTypes.Checkbox, sysList[2]),
                    StageFactory.CreateSetting(23, "TrackExport.RepeatInterval", "Track export repeat interval in minutes.", "3", 0, false, InputTypes.Text, sysList[2]),
                    StageFactory.CreateSetting(24, "TrackExport.LastAccessEvent", "Date time of last access record exported to Track.", "", 0, false, InputTypes.Text, sysList[2]),

                    StageFactory.CreateSetting(25, "S2Import.Contractors", "Comma delimited list of contractors to get from S2.", "S & B,Mustang", 0, false, InputTypes.Text, sysList[1]),
                };

                context.ExternalSystems.InsertAllOnSubmit(sysList);
                context.Settings.InsertAllOnSubmit(settingsList);
                context.SubmitChanges();
            }
        }
Example #2
0
        public virtual void Initialize()
        {
            Cleanup();

            using (var context = new RSMDB.RSMDataModelDataContext())
            {
                var sysList = new List <RSMDB.ExternalSystem>()
                {
                    StageFactory.CreateExternalSystem(1, Constants.R1SMSystemName, RSMDB.ExternalSystemDirection.None),
                    StageFactory.CreateExternalSystem(2, "S2 Import", RSMDB.ExternalSystemDirection.Incoming),
                    StageFactory.CreateExternalSystem(3, "Track", RSMDB.ExternalSystemDirection.Outgoing),
                    StageFactory.CreateExternalSystem(4, "S2 Export", RSMDB.ExternalSystemDirection.Outgoing),
                    StageFactory.CreateExternalSystem(5, "PeopleSoft", RSMDB.ExternalSystemDirection.Incoming),
                    StageFactory.CreateExternalSystem(6, "Lubrizol In", RSMDB.ExternalSystemDirection.Incoming),
                    StageFactory.CreateExternalSystem(7, "Lubrizol Out", RSMDB.ExternalSystemDirection.Outgoing),
                };

                var factory      = new StageFactory(context);
                var settingsList = new List <RSMDB.Setting>()
                {
                    factory.createSetting(sysList[0], R1Setting.DefaultPrefix, R1Setting.RuleEngineAllow),
                    factory.createSetting(sysList[0], R1Setting.DefaultPrefix, R1Setting.JobCodesFirst),
                    factory.createSetting(sysList[0], R1Setting.DefaultPrefix, R1Setting.RequireAccessApproval),
                    factory.createSetting(sysList[0], R1Setting.DefaultPrefix, R1Setting.AdminPass, "Testing"),

                    factory.createSetting(sysList[1], S2Import.DefaultPrefix, S2Import.ServiceAddress, "http://localhost"),
                    factory.createSetting(sysList[1], S2Import.DefaultPrefix, S2Import.PersonImport),
                    factory.createSetting(sysList[1], S2Import.DefaultPrefix, S2Import.ServiceAccount, "asdfasasdfasd"),
                    factory.createSetting(sysList[1], S2Import.DefaultPrefix, S2Import.ServicePassword),
                    factory.createSetting(sysList[1], S2Import.DefaultPrefix, S2Import.Repeat),
                    factory.createSetting(sysList[1], S2Import.DefaultPrefix, S2Import.RepeatInterval, "3"),
                    factory.createSetting(sysList[1], S2Import.DefaultPrefix, S2Import.LastAccessed),

                    factory.createSetting(sysList[1], S2PeopleImport.DefaultPrefix, S2PeopleImport.Available),
                    factory.createSetting(sysList[1], S2PeopleImport.DefaultPrefix, S2PeopleImport.Repeat),
                    factory.createSetting(sysList[1], S2PeopleImport.DefaultPrefix, S2PeopleImport.RepeatInterval),
                    factory.createSetting(sysList[1], S2PeopleImport.DefaultPrefix, S2PeopleImport.ServiceAddress, "http://10.1.1.234/goforms/nbapi"),
                    factory.createSetting(sysList[1], S2PeopleImport.DefaultPrefix, S2PeopleImport.ServiceAccount, "admin"),
                    factory.createSetting(sysList[1], S2PeopleImport.DefaultPrefix, S2PeopleImport.ServicePassword, "072159245241245031239120017047219193126250124056"),
                    factory.createSetting(sysList[1], S2PeopleImport.DefaultPrefix, S2PeopleImport.ImageImport),
                    factory.createSetting(sysList[1], S2PeopleImport.DefaultPrefix, S2PeopleImport.FieldsToUpdate, "FirstName,MiddleName,LastName,ExternalUpdated,Image,"
                                          + "udf1,udf2,udf3,udf4,udf5,udf6,udf7,udf8,udf9,udf10,udf11,udf12,udf13,udf14,udf15,udf16,udf17,udf18,udf19,udf20"),

                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.Available),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.Repeat),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.RepeatInterval),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.ServiceAddress, "http://localhost"),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.Account),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.Password),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.SourceSystem, ""),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.PersonExport),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.LocationExport),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.AccessExport),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.LastAccessEvent),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.LocationId),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.EventCode, ""),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.SysId, ""),
                    factory.createSetting(sysList[2], TrackExport.DefaultPrefix, TrackExport.DataSource, ""),

                    factory.createSetting(sysList[5], LubrizolImport.DefaultPrefix, LubrizolImport.Available),
                    factory.createSetting(sysList[5], LubrizolImport.DefaultPrefix, LubrizolImport.Repeat),
                    factory.createSetting(sysList[5], LubrizolImport.DefaultPrefix, LubrizolImport.RepeatInterval),
                    factory.createSetting(sysList[5], LubrizolImport.DefaultPrefix, LubrizolImport.SqlConnection),

                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.Available),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.Repeat),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.RepeatInterval),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.ServiceAddress),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.Account),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.Password),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.LastUpdated),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.SourceSystem),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.ActiveEmployeeLibrary),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.InactiveEmployeeLibrary),
                    factory.createSetting(sysList[6], LubrizolExport.DefaultPrefix, LubrizolExport.SqlConnection),
                };

                context.ExternalSystems.InsertAllOnSubmit(sysList);
                context.Settings.InsertAllOnSubmit(settingsList);
                context.SubmitChanges();
            }
        }