예제 #1
0
        public static RetentionTrigger GetFirstManualEventTrigger(IRecordsManagerClient client)
        {
            //Illustrates the following:
            //*Paging results by using IClientPagedItems
            //*Filtering results to a specific type of trigger

            int  page         = 1;
            int  pageSize     = 10;
            bool hasMorePages = false;
            IClientPagedItems <RetentionTrigger> pagedTriggers = null;
            RetentionTrigger trigger = null;

            do
            {
                pagedTriggers = client.GetTriggers(page, pageSize);

                hasMorePages = page++ < pagedTriggers.PageCount;

                trigger = pagedTriggers.Items
                          .Where(item => (item.TriggerType == RetentionTriggerType.Event) && (item.Recurrence == RetentionEventRecurrence.Manual))
                          .FirstOrDefault();
            } while (hasMorePages && (trigger == null));

            return(trigger);
        }
예제 #2
0
        public static RetentionTrigger GetTriggerByTitle(IRecordsManagerClient client, string title)
        {
            //Get Trigger By Title
            //Searching for triggers by Title, using a case-insensitive comparison on the returned results

            int              page           = 1;
            int              pageSize       = 10;
            bool             hasMorePages   = false;
            StringComparison caseComparison = StringComparison.OrdinalIgnoreCase; //Ignore casing
            IClientPagedItems <RetentionTrigger> pagedTriggers = null;
            RetentionTrigger trigger = null;

            do
            {
                pagedTriggers = client.SearchTriggers(title, page, pageSize);

                hasMorePages = page++ < pagedTriggers.PageCount;

                trigger = pagedTriggers.Items
                          .Where(item => (item.TriggerType == RetentionTriggerType.Event) &&
                                 (item.Recurrence == RetentionEventRecurrence.Manual) &&
                                 (item.Title.Equals(title, caseComparison)))
                          .FirstOrDefault();
            }while (hasMorePages && (trigger == null));

            return(trigger);
        }
        private static void GetTriggerById(string url, string user, string pwd)
        {
            RestApiIntegrations.Credentials = new System.Net.NetworkCredential(user, pwd);

            RestApiIntegrations.InfoLifecycleServerUrl = new Uri(url, UriKind.Absolute);

            long triggerId = 13;

            RetentionTrigger trigger = RestApiIntegrations.GetTriggerById(triggerId);
        }
        private static void CreateEventOccurrence(string url)
        {
            //Create a new client using default network credentials
            IRecordsManagerClient client = RecordsManagerClientFactory.Create(url);

            //Currently for a production scenario, you would need to get the retention trigger by ID
            //This sample finds the first manual, event-based, retention trigger and uses that instead.
            RetentionTrigger retentionTrigger = RetentionTriggerIntegrations.GetFirstManualEventTrigger(client);

            //Create an event occurrence for the specified trigger using the specified property name & value
            EventOccurrence eventOccurrence = EventOccurrenceIntegration.CreatePropertyEventOccurrence(client, retentionTrigger.Id, "LoanNumber", "12345");
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter the URL for your Information Lifecycle server...");

            string url = Console.ReadLine();

            //Create a new client using default network credentials
            IRecordsManagerClient client = new RecordsManagerClient(url);

            //Currently for a production scenario, you would need to get the retention trigger by ID
            //This sample finds the first manual, event-based, retention trigger and uses that instead.
            RetentionTrigger retentionTrigger = RetentionTriggerIntegrations.GetFirstManualEventTrigger(client);

            //Create an event occurrence for the specified trigger using the specified property name & value
            EventOccurrence eventOccurrence = EventOccurrenceIntegration.CreatePropertyEventOccurrence(client, retentionTrigger.Id, "LoanNumber", "12345");
        }
        private static void CreateEventOccurrence(string url, string user, string pwd)
        {
            RestApiIntegrations.Credentials = new System.Net.NetworkCredential(user, pwd);

            RestApiIntegrations.InfoLifecycleServerUrl = new Uri(url, UriKind.Absolute);

            RetentionTrigger trigger = RestApiIntegrations.GetFirstManualEventTrigger();

            EventOccurrence eventOccurrence = new EventOccurrence();

            eventOccurrence.EventDate      = DateTime.SpecifyKind(DateTime.Parse("1/15/2015"), DateTimeKind.Local);
            eventOccurrence.TargetType     = EventOccurrenceTargetType.Property;
            eventOccurrence.TargetProperty = "EmployeeId";
            eventOccurrence.TargetValue    = "12345";
            eventOccurrence.EventTriggerId = trigger.Id;

            eventOccurrence = RestApiIntegrations.CreateEventOccurrence(eventOccurrence);
        }