Ejemplo n.º 1
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            CreateButton.Text = TheGlobalisationService.GetString("create_workflow_configuration");

            ((ButtonField)WorkflowConfigGridView.Columns[4]).Text = TheGlobalisationService.GetString("delete");

            WorkflowConfigGridView.DataSource = WorkflowConfigurationService.Instance.ListConfigurations();
            WorkflowConfigGridView.DataBind();

            if (IsPostBack)
            {
                return;
            }

            // Typically you'd inherit from WorkflowConfiguration to create your own config types and use the helper to get th
            // list of options here.
            // WorkflowConfigsDropDownList.DataSource = TheHelper.WorkflowConfigurationTypes();
            WorkflowConfigsDropDownList.DataSource = new List <Type> {
                typeof(WorkflowConfiguration)
            };


            WorkflowConfigsDropDownList.DataTextField  = "Name";
            WorkflowConfigsDropDownList.DataValueField = "AssemblyQualifiedName";

            WorkflowConfigsDropDownList.DataBind();
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Css.Designer.css", ClientDependencyType.Css);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.jquery-1.5.1.min.js", ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.jquery-ui-1.8.12.custom.min.js", ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.jquery.jsPlumb-1.3.2-all-min.js", ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.json2.js", ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.workflow.js", ClientDependencyType.Javascript);

            var userCssPath = IOHelper.MapPath("~/Workflow/userCss");


            foreach (var file in Directory.GetFiles(userCssPath))
            {
                var name = new FileInfo(file).Name;
                Header.Controls.Add(
                    new LiteralControl("<link type='text/css' rel='stylesheet' href='/Workflow/userCss/" + name + "' />"));
            }

            _workflowId = Convert.ToInt32(Request["id"]);

            SaveButton.Text = TheGlobalisationService.GetString("save_design_and_close");
            CloseWithoutSavingButton.Text = TheGlobalisationService.GetString("close_without_saving");
            TaskMessageLiteral.Text       = TheGlobalisationService.GetString("drag_and_drop_tasks");
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            SaveTaskPropertiesButton.Text = TheGlobalisationService.GetString("save_task_properties");

            var taskType = Request["AssemblyQualifiedTypeName"];
            var task     = TheTaskFactory.CreateTask(taskType);

            var queryItems = Request.QueryString.Keys.Cast <string>().ToDictionary <string, string, object>(queryStringKey => queryStringKey, queryStringKey => Request.QueryString[queryStringKey]);

            if (queryItems.ContainsKey("Id"))
            {
                queryItems["Id"] = new Guid((string)queryItems["Id"]);
            }

            TheHelper.SetProperties(task, queryItems);

            _ui = TheWorkflowEntityUiResolver.Resolve(task);

            foreach (var c in _ui.Render(task))
            {
                TaskPropertiesUiPanel.Controls.Add(c);
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.jquery-1.5.1.min.js", ClientDependencyType.Javascript);
            SaveTaskPropertiesButton.Text = TheGlobalisationService.GetString("save_task_properties");
        }
        protected void CreateCriteriaButtonClick(object sender, EventArgs e)
        {
            var workflowName = TheGlobalisationService.GetString("new_instantiation_criteria");

            Log.Debug(string.Format("Creating new workflow instantiation criteria '{0}'", workflowName));
            TheWorkflowInstantiationCriteriaService.CreateWorkflowInstantiationCriteria(workflowName);
        }
Ejemplo n.º 6
0
        protected void CreateButtonClick(object sender, EventArgs e)
        {
            var workflowName = string.Format("{0} - {1}", TheGlobalisationService.GetString("new_workflow"), DateTime.Now);

            Log.Info(string.Format("Creating new workflow '{0}' of type '{1}'", workflowName, WorkflowConfigsDropDownList.SelectedValue));

            TheWorkflowConfigurationService.CreateWorkflowConfiguration(workflowName, WorkflowConfigsDropDownList.SelectedValue);
        }
        public AnyoneDecisionWorkflowTaskEntityUi()
            : base()
        {
            UiAttributes.Add("class", "userDecisionTask");

            TransitionDescriptions.Add("approve", TheGlobalisationService.GetString("approve"));
            TransitionDescriptions.Add("reject", TheGlobalisationService.GetString("reject"));
        }
Ejemplo n.º 8
0
 protected void WorklowCriteriaRowDataBound(Object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType != DataControlRowType.Header)
     {
         return;
     }
     e.Row.Cells[0].Text = TheGlobalisationService.GetString("name");
 }
Ejemplo n.º 9
0
        public PublishDocumentsWorkflowTaskEntityUi()
            : base()
        {
            UiAttributes.Add("class", "publishDocumentsTask");


            TransitionDescriptions.Add("done", TheGlobalisationService.GetString("published"));
        }
Ejemplo n.º 10
0
        public UrlInstantiatorRestartWorkflowTaskEntityUi()
            : base()
        {
            UiAttributes.Add("class", "userDecisionTask");
            UiProperties.Add((IWorkflowUiProperty)CreateGlobalisedObject(typeof(UrlPropertyUi)));

            TransitionDescriptions.Add("restart_workflow", TheGlobalisationService.GetString("restart_workflow"));
        }
Ejemplo n.º 11
0
        protected override void  OnInit(EventArgs e)
        {
            base.OnInit(e);
            _workflowId = Convert.ToInt32(Request["id"]);

            SaveButton.Text = TheGlobalisationService.GetString("save_design_and_close");
            CloseWithoutSavingButton.Text = TheGlobalisationService.GetString("close_without_saving");
            TaskMessageLiteral.Text       = TheGlobalisationService.GetString("drag_and_drop_tasks");
        }
Ejemplo n.º 12
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            CriteriaGridView.DataSource = TheWorkflowInstantiationCriteriaService.List();

            CriteriaGridView.DataBind();

            ((ButtonField)CriteriaGridView.Columns[1]).Text = TheGlobalisationService.GetString("delete");
        }
Ejemplo n.º 13
0
        public UserDecisionWorkflowTaskEntityUi()
            : base()
        {
            UiAttributes.Add("class", "userDecisionTask");

            UiProperties.Add((IWorkflowUiProperty)CreateGlobalisedObject(typeof(UserPropertyUi)));

            TransitionDescriptions.Add("approve", TheGlobalisationService.GetString("approve"));
            TransitionDescriptions.Add("reject", TheGlobalisationService.GetString("reject"));
        }
Ejemplo n.º 14
0
        protected void WorklowConfigsRowDataBound(Object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.Header)
            {
                return;
            }

            e.Row.Cells[0].Text = TheGlobalisationService.GetString("description");
            e.Row.Cells[1].Text = TheGlobalisationService.GetString("type");
            e.Row.Cells[2].Text = TheGlobalisationService.GetString("active");
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            StartWorkflowButton.Text = TheGlobalisationService.GetString("send_to_workflow");

            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Util.js",
                                               ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Config.js",
                                               ClientDependencyType.Javascript);
        }
Ejemplo n.º 16
0
        protected void WorklowInstanceRowDataBound(Object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.Header)
            {
                return;
            }

            e.Row.Cells[0].Text = TheGlobalisationService.GetString("name");
            e.Row.Cells[1].Text = TheGlobalisationService.GetString("instantiation_time");
            e.Row.Cells[2].Text = TheGlobalisationService.GetString("running");
            e.Row.Cells[3].Text = TheGlobalisationService.GetString("current_task");
        }
        public InstantiatorEmailWorkflowTaskEntityUi() : base()

        {
            UiAttributes.Add("class", "basicEmailTask");

            UiProperties = new List <IWorkflowUiProperty>
            {
                (IWorkflowUiProperty)CreateGlobalisedObject(typeof(SubjectPropertyUi)),
                (IWorkflowUiProperty)CreateGlobalisedObject(typeof(FromPropertyUi)),
                (IWorkflowUiProperty)CreateGlobalisedObject(typeof(BodyPropertyUi))
            };

            TransitionDescriptions.Add("done", TheGlobalisationService.GetString("email_sent"));
        }
Ejemplo n.º 18
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            TheWorkflowRuntime.RunWorkflows();

            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Css.Grid.css", ClientDependencyType.Css);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Util.js", ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Config.js", ClientDependencyType.Javascript);


            CreateButton.Text = TheGlobalisationService.GetString("create_workflow_configuration");

            ((ButtonField)WorkflowConfigGridView.Columns[3]).Text = TheGlobalisationService.GetString("delete");
        }
Ejemplo n.º 19
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            RunWorkflowsButton.Text = TheGlobalisationService.GetString("run_workflows");

            if (Request["id"] == null || IsPostBack)
            {
                return;
            }

            TheWorkflowInstanceService.Instantiate(Convert.ToInt32(Request["id"]));
            CreatedWorkflowLiteral.Visible = true;

            CreatedWorkflowLiteral.Text = TheGlobalisationService.GetString("create_a_workflow");
        }
Ejemplo n.º 20
0
        protected void CreateCriteriaButtonClick(object sender, EventArgs e)
        {
            //if (Validator.IsTrial() || Validator.IsInvalid())
            //{
            //    var numConfigs = TheWorkflowInstantiationCriteriaService.List().Count;
            //    if (numConfigs > 0)
            //    {
            //        throw new Exception(TheGlobalisationService.GetString("only_one_config_in_trial"));
            //    }
            //}

            var workflowName = TheGlobalisationService.GetString("new_instantiation_criteria");

            Log.Debug(string.Format("Creating new workflow instantiation criteria '{0}'", workflowName));
            TheWorkflowInstantiationCriteriaService.CreateWorkflowInstantiationCriteria(workflowName);
        }
Ejemplo n.º 21
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            /* if (Validator.IsTrial() || Validator.IsInvalid())
             * {
             *  TrialLiteral.Visible = true;
             *  TrialLiteral.Text = string.Format("<p class='trialMode'>{0}</p>", TheGlobalisationService.GetString("trial_mode"));
             * } */

            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Css.Grid.css", ClientDependencyType.Css);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Util.js", ClientDependencyType.Javascript);

            CreateCriteriaButton.Text = TheGlobalisationService.GetString("create_new_criteria");
            ((ButtonField)CriteriaGridView.Columns[1]).Text = TheGlobalisationService.GetString("delete");
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            SaveCriteriaButton.Text = TheGlobalisationService.GetString("save_criteria");

            var criteriaId = Convert.ToInt32(Request["id"]);

            _instantiationCriteria = TheWorkflowInstantiationCriteriaService.GetCriteria(criteriaId);
            _entityUi = TheWorkflowEntityUiResolver.Resolve(_instantiationCriteria);

            foreach (var control in _entityUi.Render(_instantiationCriteria))
            {
                CiteriaControlsPanel.Controls.Add(control);
            }
        }
Ejemplo n.º 23
0
        protected void CreateButtonClick(object sender, EventArgs e)
        {
            //if (Validator.IsTrial() || Validator.IsInvalid())
            //{
            //    var numConfigs = TheWorkflowConfigurationService.ListConfigurations().Count;
            //    if(numConfigs > 0)
            //    {
            //        throw new Exception(TheGlobalisationService.GetString("only_one_config_in_trial"));
            //    }
            //}

            var workflowName = string.Format("{0} - {1}", TheGlobalisationService.GetString("new_workflow"), DateTime.Now);

            Log.Info(string.Format("Creating new workflow '{0}' of type '{1}'", workflowName, WorkflowConfigsDropDownList.SelectedValue));

            TheWorkflowConfigurationService.CreateWorkflowConfiguration(workflowName, WorkflowConfigsDropDownList.SelectedValue);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var u = umbraco.BusinessLogic.User.GetCurrent();

            var workflows = new List <IWorkflowConfiguration>();

            foreach (var criteria in TheWorkflowInstantiationCriteriaService.List())
            {
                var hydratedCriteria = TheWorkflowInstantiationCriteriaService.GetCriteria(criteria.Id);

                if (!hydratedCriteria.Active)
                {
                    continue;
                }
                if (!((UmbracoWorkflowInstantiationCriteria)hydratedCriteria).AllowManualInstantiation)
                {
                    continue;
                }
                if (!TheCriteriaValidationService.IsCriteriaValid((UmbracoWorkflowInstantiationCriteria)hydratedCriteria, u))
                {
                    continue;
                }

                workflows.Add(TheWorkflowConfigurationService.GetConfiguration(hydratedCriteria.WorkflowConfiguration));
            }


            if (workflows.Count == 0)
            {
                NoCriteriasLiteral.Text    = TheGlobalisationService.GetString("no_valid_workflow_instantiation_criteria");
                NoCriteriasLiteral.Visible = true;
            }
            else
            {
                AvailableCriteriaDropDownList.DataSource = workflows;

                AvailableCriteriaDropDownList.DataTextField  = "Name";
                AvailableCriteriaDropDownList.DataValueField = "Id";

                AvailableCriteriaDropDownList.DataBind();

                SendToWorkflowPanel.Visible = true;
            }
        }
Ejemplo n.º 25
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            SavePropertiesButton.Text = TheGlobalisationService.GetString("save_properties");

            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Util.js", ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Config.js", ClientDependencyType.Javascript);

            var id = Convert.ToInt32(Request["id"]);

            _config = TheWorkflowConfigurationService.GetConfiguration(id);
            _ui     = TheWorkflowEntityUiResolver.Resolve(_config);

            foreach (var control in _ui.Render(_config))
            {
                PropertiesUiPanel.Controls.Add(control);
            }
        }
Ejemplo n.º 26
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            TheWorkflowRuntime.RunWorkflows();

            _currentUser = User.GetCurrent();
            _isAdmin     = _currentUser.UserType.Alias.ToLower() == "admin";

            if (!_isAdmin)
            {
                FilterPanel.Visible = false;
            }

            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Css.Grid.css", ClientDependencyType.Css);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Util.js", ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Config.js", ClientDependencyType.Javascript);

            ((ButtonField)WorkflowInstancesGridView.Columns[9]).Text = TheGlobalisationService.GetString("delete");
        }
Ejemplo n.º 27
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            //if (Validator.IsTrial() || Validator.IsInvalid())
            //{
            //    TrialLiteral.Visible = true;
            //    TrialLiteral.Text = string.Format("<p class='trialMode'>{0}</p>", TheGlobalisationService.GetString("trial_mode"));
            //}

            TheWorkflowRuntime.RunWorkflows();

            _currentUser = User.GetCurrent();
            _isAdmin     = _currentUser.UserType.Alias.ToLower() == "admin";

            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Css.Grid.css", ClientDependencyType.Css);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Util.js", ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Config.js", ClientDependencyType.Javascript);

            ((ButtonField)WorkflowInstancesGridView.Columns[7]).Text = TheGlobalisationService.GetString("delete");
        }
Ejemplo n.º 28
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            //if (Validator.IsTrial() || Validator.IsInvalid())
            //{
            //    TrialLiteral.Visible = true;
            //    TrialLiteral.Text = string.Format("<p class='trialMode'>{0}</p>", TheGlobalisationService.GetString("trial_mode"));
            //}

            TheWorkflowRuntime.RunWorkflows();

            this.AddResourceToClientDependency("FergusonMoriyam.Workflow.Umbraco.Web.Ui.Css.Grid.css", ClientDependencyType.Css);
            this.AddResourceToClientDependency("FergusonMoriyam.Workflow.Umbraco.Web.Ui.Js.Util.js", ClientDependencyType.Javascript);
            this.AddResourceToClientDependency("FergusonMoriyam.Workflow.Umbraco.Web.Ui.Js.Config.js", ClientDependencyType.Javascript);


            CreateButton.Text = TheGlobalisationService.GetString("create_workflow_configuration");

            ((ButtonField)WorkflowConfigGridView.Columns[3]).Text = TheGlobalisationService.GetString("delete");
        }
Ejemplo n.º 29
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            SaveCriteriaButton.Text = TheGlobalisationService.GetString("save_criteria");

            var criteriaId = Convert.ToInt32(Request["id"]);

            _instantiationCriteria = TheWorkflowInstantiationCriteriaService.GetCriteria(criteriaId);

            Log.Debug(string.Format("Got criteria of type {0}", _instantiationCriteria.GetType()));

            _entityUi = TheWorkflowEntityUiResolver.Resolve(_instantiationCriteria);

            // if (IsPostBack) return;

            foreach (var control in _entityUi.Render(_instantiationCriteria))
            {
                CiteriaControlsPanel.Controls.Add(control);
            }
        }
Ejemplo n.º 30
0
        public TweetWorkflowTaskEntityUi()
            : base()
        {
            // Describe the workflow transition
            TransitionDescriptions.Add("done", TheGlobalisationService.GetString("task_was_tweeted"));

            // Decorate your task with a custom CSS class in the designer.
            // The workflow designer scans ~/umbraco/plugins/fmworkflow/css for custom CSS files and includes all of them.
            UiAttributes.Add("class", "tweetTask");

            // These properties explain how to present a Ui to get values for the public properties of the workflow task.
            // You can create globalised objects using:  (IWorkflowUiProperty)CreateGlobalisedObject(typeof(FromPropertyUi))

            UiProperties.Add((IWorkflowUiProperty)CreateGlobalisedObject(typeof(AccessTokenPropertyUi)));
            UiProperties.Add(new AccessTokenSecretPropertyUi());

            UiProperties.Add(new ConsumerKeyPropertyUi());
            UiProperties.Add(new ConsumerSecretPropertyUi());

            UiProperties.Add(new ShortUrlPropertyUi());
            UiProperties.Add(new TweetTextPropertyUi());
        }