void CheckClearCache(Item item)
 {
     if (item != null && item.TemplateID.Equals(Templates.RedirectMap.ID) && !JobsHelper.IsPublishing())
     {
         RedirectsCache.Reset();
     }
 }
Beispiel #2
0
        public void OnItemCreated(object sender, EventArgs args)
        {
            if (JobsHelper.IsPublishing())
            {
                return;
            }
            var item = Event.ExtractParameter <ItemCreatedEventArgs>(args, 0).Item;

            if (CanExecute(item))
            {
                var workflow = GetSiteWorkflow(item);
                if (workflow != null)
                {
                    Workflow             = workflow.WorkflowID;
                    DefaultWorkflowState = GetWorkflowState(workflow);
                    using (EditContext editContext = new EditContext(item))
                    {
                        item[FieldIDs.Workflow]        = Workflow;
                        item[FieldIDs.DefaultWorkflow] = Workflow;
                        item[FieldIDs.WorkflowState]   = DefaultWorkflowState;
                    }
                }
            }
        }