private void finalizeCodeActivity_Finalize_ExecuteCode(object sender, EventArgs e)
        {
            string name       = this.GetBinding <string>("Name");
            string editorType = this.GetBinding <string>("EditorType");

            string filename = PageTemplateFeatureFacade.GetNewPageTemplateFeaturePath(name, editorType);

            var template = new XhtmlDocument();

            template.Head.Add("");
            template.Body.Add(new XElement(Namespaces.Xhtml + "p", ""));

            C1File.WriteAllText(filename, template.ToString());

            this.CloseCurrentView();
            this.RefreshRootEntityToken();

            this.ExecuteAction(PageTemplateFeatureEntityToken.BuildFeatureEntityToken(name),
                               new WorkflowActionToken(typeof(EditPageTemplateFeatureWorkflow)));
        }
Beispiel #2
0
        public IEnumerable <Element> GetChildren(EntityToken entityToken, SearchToken seachToken)
        {
            if (entityToken.Id == PageTemplateFeatureEntityToken.RootFolderId)
            {
                foreach (string pageTemplateFeratureFilename in this.PageTemplateFeatureFilenames)
                {
                    string filename    = Path.GetFileName(pageTemplateFeratureFilename);
                    string featureName = Path.GetFileNameWithoutExtension(filename);

                    bool isHtml = Path.GetExtension(filename) == ".html";

                    Element featureElement = new Element(_context.CreateElementHandle(
                                                             PageTemplateFeatureEntityToken.BuildFeatureEntityToken(featureName)))
                    {
                        VisualData = new ElementVisualizedData
                        {
                            Label   = featureName,
                            ToolTip = filename,
                            Icon    = PageTemplateFeatureIcon
                        }
                    };

                    featureElement.AddAction(new ElementAction(new ActionHandle(new WorkflowActionToken(WorkflowFacade.GetWorkflowType("Composite.Plugins.Elements.ElementProviders.PageTemplateFeatureElementProvider.EditPageTemplateFeatureWorkflow"), PermissionTypePredefined.Edit)))
                    {
                        VisualData = new ActionVisualizedData
                        {
                            Label          = StringResourceSystemFacade.GetString("Composite.Plugins.PageTemplateFeatureElementProvider", "ElementProvider.EditTemplateFeature"),
                            ToolTip        = StringResourceSystemFacade.GetString("Composite.Plugins.PageTemplateFeatureElementProvider", "ElementProvider.EditTemplateFeatureToolTip"),
                            Icon           = PageTemplateFeatureIconEdit,
                            Disabled       = false,
                            ActionLocation = ActionLocation.EditPrimaryActionLocation
                        }
                    });

                    featureElement.AddAction(new ElementAction(new ActionHandle(new WorkflowActionToken(WorkflowFacade.GetWorkflowType("Composite.Plugins.Elements.ElementProviders.PageTemplateFeatureElementProvider.DeletePageTemplateFeatureWorkflow"), PermissionTypePredefined.Delete)))
                    {
                        VisualData = new ActionVisualizedData
                        {
                            Label          = StringResourceSystemFacade.GetString("Composite.Plugins.PageTemplateFeatureElementProvider", "ElementProvider.DeleteTemplateFeature"),
                            ToolTip        = StringResourceSystemFacade.GetString("Composite.Plugins.PageTemplateFeatureElementProvider", "ElementProvider.DeleteTemplateFeatureToolTip"),
                            Icon           = PageTemplateFeatureIconDelete,
                            Disabled       = false,
                            ActionLocation = ActionLocation.DeletePrimaryActionLocation
                        }
                    });

                    featureElement.AddAction(new ElementAction(new ActionHandle(new WorkflowActionToken(WorkflowFacade.GetWorkflowType("Composite.Plugins.Elements.ElementProviders.PageTemplateFeatureElementProvider.TogglePageTemplateFeatureEditorWorkflow"), PermissionTypePredefined.Edit)))
                    {
                        VisualData = new ActionVisualizedData
                        {
                            Label               = StringResourceSystemFacade.GetString("Composite.Plugins.PageTemplateFeatureElementProvider", "ElementProvider.EditVisually"),
                            ToolTip             = StringResourceSystemFacade.GetString("Composite.Plugins.PageTemplateFeatureElementProvider", "ElementProvider.EditVisuallyToolTip"),
                            Icon                = PageTemplateFeatureIconEdit,
                            Disabled            = false,
                            ActionCheckedStatus = isHtml ? ActionCheckedStatus.Checked : ActionCheckedStatus.Unchecked,
                            ActionLocation      = new ActionLocation
                            {
                                ActionType  = ActionType.Other,
                                IsInFolder  = false,
                                IsInToolbar = false,
                                ActionGroup = PrimaryFolderToolsActionGroup
                            },
                        }
                    });

                    yield return(featureElement);
                }

                yield break;
            }

            yield break;
        }