Example #1
0
        public void ContentType_Complex_RemoveProperty()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdComplex);

                var cb = new ContentTypeBuilder(null);

                cb.Type("ComplexTestContent")
                .Field("TestCount")
                .RemoveProperty("Indexing");

                cb.Apply();

                AssertContentTypeXml("ComplexTestContent", (document, manager) =>
                {
                    // the field should remain in the ctd
                    var field = document.SelectSingleNode("ns:ContentType/ns:Fields/ns:Field[@name='TestCount']", manager);
                    Assert.IsNotNull(field);

                    var childNode = field.SelectSingleNode("ns:Indexing", manager);

                    // the Indexing node should have been removed
                    Assert.IsNull(childNode, "The Indexing node should not be there anymore.");
                });
            });
        }
Example #2
0
        public void ContentType_Complex_RemoveConfig()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdComplex);

                var fs1 = ContentType.GetByName("ComplexTestContent").FieldSettings.Single(fs => fs.Name == "TestCount");
                Assert.AreEqual("123", fs1.DefaultValue);

                var cb = new ContentTypeBuilder(null);

                cb.Type("ComplexTestContent")
                .Field("TestCount")
                .RemoveConfiguration("Unknown")
                .RemoveConfiguration("DefaultValue");

                cb.Apply();

                fs1 = ContentType.GetByName("ComplexTestContent").FieldSettings.Single(fs => fs.Name == "TestCount");
                Assert.AreEqual(null, fs1.DefaultValue);

                // the other config value is intact
                Assert.AreEqual(FieldVisibility.Hide, fs1.VisibleBrowse);
            });
        }
Example #3
0
        public void ContentType_Complex_RemoveConfig_Empty()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdComplex);

                var cb = new ContentTypeBuilder(null);

                cb.Type("ComplexTestContent")
                .Field("TestCount")
                .RemoveConfiguration("VisibleBrowse")
                .RemoveConfiguration("DefaultValue");

                cb.Apply();

                AssertContentTypeXml("ComplexTestContent", (document, manager) =>
                {
                    // the field should remain in the ctd
                    var field = document.SelectSingleNode("ns:ContentType/ns:Fields/ns:Field[@name='TestCount']", manager);
                    Assert.IsNotNull(field);

                    var configNode = field.SelectSingleNode("ns:Configuration", manager);

                    // the config node should have been removed
                    Assert.IsNull(configNode, "The Configuration node should not be there anymore.");
                });
            });
        }
Example #4
0
        public void ContentType_Simple_AddField()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdSimple);

                var cb = new ContentTypeBuilder(null);

                cb.Type("SimpleTestContent")
                .Field("TestText", "ShortText")
                .DefaultValue("default text");

                cb.Apply();

                var fs1 = ContentType.GetByName("SimpleTestContent").FieldSettings.First(fs => fs.Name == "TestText");

                Assert.AreEqual("default text", fs1.DefaultValue);
            });
        }
Example #5
0
        public void ContentType_Simple_FieldConfiguration()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdSimple);

                var cb = new ContentTypeBuilder(null);

                cb.Type("SimpleTestContent")
                .Field("TestCount")
                .DefaultValue("64326");

                cb.Apply();

                var fs1 = ContentType.GetByName("SimpleTestContent").FieldSettings.First(fs => fs.Name == "TestCount");

                Assert.AreEqual("64326", fs1.DefaultValue);
            });
        }
Example #6
0
        public void ContentType_Simple_RemoveField_Standalone()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdSimple);

                var fs1 = ContentType.GetByName("SimpleTestContent").FieldSettings.First(fs => fs.Name == "TestCount");
                Assert.IsNotNull(fs1);

                var cb = new ContentTypeBuilder(null);

                cb.Type("SimpleTestContent")
                .RemoveField("TestCount");

                cb.Apply();

                fs1 = ContentType.GetByName("SimpleTestContent").FieldSettings.FirstOrDefault(fs => fs.Name == "TestCount");
                Assert.IsNull(fs1);
            });
        }
Example #7
0
        public void ContentType_Simple_HeaderProperties()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdSimple);

                var cb = new ContentTypeBuilder(null);

                cb.Type("SimpleTestContent")
                .DisplayName("Test SimpleTestContent x")
                .Description("Test SimpleTestContent Description x");

                cb.Apply();

                var ct1 = ContentType.GetByName("SimpleTestContent");

                Assert.AreEqual("Test SimpleTestContent x", ct1.DisplayName);
                Assert.AreEqual("Test SimpleTestContent Description x", ct1.Description);
            });
        }
Example #8
0
        public void ContentType_Simple_FieldProperties()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdSimple);

                var cb = new ContentTypeBuilder(null);

                cb.Type("SimpleTestContent")
                .Field("TestCount")
                .DisplayName("Test TestCount DisplayName")
                .Description("Test TestCount Description");

                cb.Apply();

                var fs1 = ContentType.GetByName("SimpleTestContent").FieldSettings.First(fs => fs.Name == "TestCount");

                Assert.AreEqual("Test TestCount DisplayName", fs1.DisplayNameStoredValue);
                Assert.AreEqual("Test TestCount Description", fs1.DescriptionStoredValue);
            });
        }
Example #9
0
        public void ContentType_Complex_FieldConfiguration()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdComplex);

                var cb = new ContentTypeBuilder(null);

                cb.Type("ComplexTestContent")
                .Field("TestCount")
                .DefaultValue("64326")
                .VisibleBrowse(FieldVisibility.Show)
                .VisibleEdit(FieldVisibility.Advanced)
                .VisibleNew(FieldVisibility.Hide)
                .ReadOnly()
                .Field("ValidFrom")
                .Configure("DateTimeMode", "Date")
                .FieldIndex(567)
                .Compulsory()
                .ControlHint("mycustomcontrol");

                cb.Apply();

                var ct  = ContentType.GetByName("ComplexTestContent");
                var fs1 = ct.FieldSettings.First(fs => fs.Name == "TestCount");
                var fs2 = ct.FieldSettings.First(fs => fs.Name == "ValidFrom") as DateTimeFieldSetting;

                Assert.AreEqual("64326", fs1.DefaultValue);
                Assert.AreEqual(FieldVisibility.Show, fs1.VisibleBrowse);
                Assert.AreEqual(FieldVisibility.Advanced, fs1.VisibleEdit);
                Assert.AreEqual(FieldVisibility.Hide, fs1.VisibleNew);
                Assert.AreEqual(true, fs1.ReadOnly);

                Assert.AreEqual(DateTimeMode.Date, fs2.DateTimeMode);
                Assert.AreEqual(567, fs2.FieldIndex);
                Assert.AreEqual(true, fs2.Compulsory);
                Assert.AreEqual("mycustomcontrol", fs2.ControlHint);
            });
        }
Example #10
0
        public void ContentType_Complex_InsertFieldProperty()
        {
            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdComplex);

                var cb = new ContentTypeBuilder(null);

                // define properties in reverse order
                cb.Type("ComplexTestContent")
                .Field("ConfigField")
                .Description("desc")
                .DisplayName("disp");

                cb.Apply();

                var fs1 = ContentType.GetByName("ComplexTestContent").FieldSettings.Single(fs => fs.Name == "ConfigField");

                Assert.AreEqual("disp", fs1.DisplayName);
                Assert.AreEqual("desc", fs1.Description);
                Assert.AreEqual("default", fs1.DefaultValue);
            });
        }
Example #11
0
        public override void AddPatches(PatchBuilder builder)
        {
            builder
            .Install("0.0.4", "2021-06-09", "sensenet WebHooks")
            .DependsOn("SenseNet.Services", "7.7.22")
            .Action(context =>
            {
                #region String resource

                InstallStringResource("CtdResourcesWebHookSubscription.xml");

                #endregion

                #region Install CTD

                InstallCtd("WebHookSubscriptionCtd.xml");

                #endregion

                #region Content items

                CreateWebHooksContainer();

                #endregion
            });

            builder.Patch("0.0.1", "0.0.3", "2021-03-17", "Upgrades the WebHook component")
            .DependsOn("SenseNet.Services", "7.7.19")
            .Action(context =>
            {
                #region String resources

                var rb = new ResourceBuilder();

                rb.Content("CtdResourcesWebHookSubscription.xml")
                .Class("Ctd-WebHookSubscription")
                .Culture("en")
                .AddResource("DisplayName", "Webhook")
                .Culture("hu")
                .AddResource("DisplayName", "Webhook");

                rb.Apply();

                #endregion

                #region CTD changes

                var cb = new ContentTypeBuilder(context.GetService <ILogger <ContentTypeBuilder> >());

                cb.Type("WebHookSubscription")
                .Icon("Settings")
                .Field("WebHookPayload", "LongText")
                .DisplayName("$Ctd-WebHookSubscription,WebHookPayload-DisplayName")
                .Description("$Ctd-WebHookSubscription,WebHookPayload-Description")
                .VisibleBrowse(FieldVisibility.Show)
                .VisibleEdit(FieldVisibility.Show)
                .VisibleNew(FieldVisibility.Show)
                .FieldIndex(10)
                .ControlHint("sn:WebhookPayload")
                .Field("WebHookFilter")
                .FieldIndex(50)
                .Field("WebHookHeaders")
                .FieldIndex(40)
                .Field("Enabled")
                .FieldIndex(90)
                .Field("IsValid")
                .FieldIndex(30)
                .VisibleBrowse(FieldVisibility.Hide)
                .Field("InvalidFields")
                .RemoveConfiguration("FieldIndex")
                .VisibleBrowse(FieldVisibility.Hide)
                .VisibleEdit(FieldVisibility.Hide)
                .VisibleNew(FieldVisibility.Hide)
                .Field("SuccessfulCalls")
                .FieldIndex(20)
                .Field("WebHookHttpMethod")
                .DefaultValue("POST");

                cb.Apply();

                #endregion

                #region Content items

                CreateWebHooksContainer();

                #endregion
            });

            builder.Patch("0.0.3", "0.0.4", "2021-06-09", "Upgrades the WebHook component")
            .DependsOn("SenseNet.Services", "7.7.22")
            .Action(context =>
            {
                // Do nothing, this is just a version update, because the CTD change (richtext type
                // change of the Description field) is already handled by the Services component patch.
            });
        }
Example #12
0
        public override void AddPatches(PatchBuilder builder)
        {
            builder.Patch("7.7.11", "7.7.12", "2020-09-7", "Upgrades sensenet content repository.")
            .Action(context =>
            {
                #region CTD changes

                var cb = new ContentTypeBuilder();

                cb.Type("Settings")
                .Field("Description", "LongText")
                .VisibleBrowse(FieldVisibility.Hide)
                .VisibleEdit(FieldVisibility.Show)
                .VisibleNew(FieldVisibility.Show);

                cb.Apply();

                #endregion

                #region Settings Description field changes

                SetSettingsDescription("Indexing", "In this Settings file you can customize the indexing behavior (for example the text extractor used in case of different file types) of the system.");
                SetSettingsDescription("Logging", "Contains logging-related settings, for example which events are sent to the trace. You can control tracing by category: switch on or off writing messages in certain categories to the trace channel.");
                SetSettingsDescription("MailProcessor", "The content list Inbox feature requires an Exchange or POP3 server configuration and other settings related to connecting libraries to a mailbox.");
                SetSettingsDescription("OAuth", "When users log in using one of the configured OAuth providers (like Google or Facebook), these settings control the type and place of the newly created users.");
                SetSettingsDescription("OfficeOnline", "To open or edit Office documents in the browser, the system needs to know the address of the Office Online Server that provides the user interface for the feature. In this section you can configure that and other OOS-related settings.");
                SetSettingsDescription("Sharing", "Content sharing related options.");
                SetSettingsDescription("TaskManagement", "When the Task Management module is installed, this is the place where you can configure the connection to the central task management service.");
                SetSettingsDescription("UserProfile", "When a user is created, and the profile feature is enabled (in the app configuration), they automatically get a profile – a workspace dedicated to the user’s personal documents and tasks. In this setting section you can customize the content type and the place of this profile.");

                void SetSettingsDescription(string name, string description)
                {
                    var settings = Content.Load("/Root/System/Settings/" + name + ".settings");
                    if (settings == null)
                    {
                        return;
                    }
                    settings["Description"] = description;
                    settings.SaveSameVersion();
                }

                #endregion

                #region App changes

                var app1 = Content.Load("/Root/(apps)/Folder/Add");
                if (app1 != null)
                {
                    app1["Scenario"] = string.Empty;
                    app1.SaveSameVersion();
                }

                var app2 = Content.Load("/Root/(apps)/ContentType/Edit");
                if (app2 == null)
                {
                    var parent = RepositoryTools.CreateStructure("/Root/(apps)/ContentType") ??
                                 Content.Load("/Root/(apps)/ContentType");

                    app2 = Content.CreateNew("ClientApplication", parent.ContentHandler, "Edit");
                    app2["DisplayName"]         = "$Action,Edit";
                    app2["Scenario"]            = "ContextMenu";
                    app2["Icon"]                = "edit";
                    app2["RequiredPermissions"] = "See;Open;OpenMinor;Save";
                    app2.Save();

                    // set app permissions
                    var developersGroupId = NodeHead.Get("/Root/IMS/BuiltIn/Portal/Developers")?.Id ?? 0;
                    var aclEditor         = SecurityHandler.SecurityContext.CreateAclEditor();
                    aclEditor
                    .Allow(app2.Id, Identifiers.AdministratorsGroupId,
                           false, PermissionType.RunApplication);
                    if (developersGroupId > 0)
                    {
                        aclEditor.Allow(app2.Id, developersGroupId,
                                        false, PermissionType.RunApplication);
                    }

                    aclEditor.Apply();
                }

                #endregion
            });

            builder.Patch("7.7.12", "7.7.13", "2020-09-23", "Upgrades sensenet content repository.")
            .Action(context =>
            {
                #region String resources

                var rb = new ResourceBuilder();

                rb.Content("CtdResourcesAB.xml")
                .Class("Ctd-BinaryFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Binary field")
                .Culture("hu")
                .AddResource("DisplayName", "Bináris mező");

                rb.Content("CtdResourcesCD.xml")
                .Class("Ctd-ChoiceFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Choice field")
                .Culture("hu")
                .AddResource("DisplayName", "Választó mező")
                .Class("Ctd-CurrencyFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Currency field")
                .Culture("hu")
                .AddResource("DisplayName", "Pénzérték mező")
                .Class("Ctd-DateTimeFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "DateTime field")
                .Culture("hu")
                .AddResource("DisplayName", "Dátum mező");

                rb.Content("CtdResourcesEF.xml")
                .Class("Ctd-FieldControlTemplate")
                .Culture("en")
                .AddResource("DisplayName", "FieldControlTemplate")
                .AddResource("Description", "A type for FieldControl templates.")
                .Culture("hu")
                .AddResource("DisplayName", "Mező vezérlő sablon")
                .AddResource("Description", "Mező vezérlő sablont tároló fájl")
                .Class("Ctd-FieldControlTemplates")
                .Culture("en")
                .AddResource("DisplayName", "FieldControlTemplates")
                .AddResource("Description", "This is the container type for ContentViews. Instances are allowed only at /Root/Global/fieldcontroltemplates.")
                .Culture("hu")
                .AddResource("DisplayName", "Mező vezérlő sablonok")
                .AddResource("Description", "Mező vezérlő sablonokat tároló mappa. Csak egy lehet, itt: /Root/Global/fieldcontroltemplates.");

                rb.Content("CtdResourcesGH.xml")
                .Class("Ctd-HyperLinkFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Hyperlink field")
                .Culture("hu")
                .AddResource("DisplayName", "Hivatkozás mező");


                rb.Content("CtdResourcesIJK.xml")
                .Class("Ctd-Image")
                .Culture("en")
                .AddResource("DisplayName", "Image")
                .AddResource("Name-DisplayName", "Name")
                .Culture("hu")
                .AddResource("DisplayName", "Kép")
                .AddResource("Name-DisplayName", "Név")
                .Class("Ctd-IntegerFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Integer field")
                .Culture("hu")
                .AddResource("DisplayName", "Egész szám mező");

                rb.Content("CtdResourcesLM.xml")
                .Class("Ctd-LongTextFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Longtext field")
                .Culture("hu")
                .AddResource("DisplayName", "Hosszú szöveges mező");

                rb.Content("CtdResourcesNOP.xml")
                .Class("Ctd-NullFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Null field")
                .Culture("hu")
                .AddResource("DisplayName", "Null mező")
                .Class("Ctd-NumberFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Number field")
                .Culture("hu")
                .AddResource("DisplayName", "Szám mező")
                .Class("Ctd-PasswordFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Password field")
                .Culture("hu")
                .AddResource("DisplayName", "Jelszó mező")
                .Class("Ctd-PermissionChoiceFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Permission choice field")
                .Culture("hu")
                .AddResource("DisplayName", "Jogosultság választó mező");

                rb.Content("CtdResourcesRS.xml")
                .Class("Ctd-ReferenceFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Reference field")
                .Culture("hu")
                .AddResource("DisplayName", "Referencia mező")
                .Class("Ctd-ShortTextFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "ShortText field")
                .Culture("hu")
                .AddResource("DisplayName", "Rövid szöveges mező");

                rb.Content("CtdResourcesTZ.xml")
                .Class("Ctd-Workspace")
                .Culture("en")
                .AddResource("Name-DisplayName", "Name")
                .Culture("hu")
                .AddResource("Name-DisplayName", "Név")
                .Class("Ctd-TextFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Text field")
                .Culture("hu")
                .AddResource("DisplayName", "Szöveges mező")
                .Class("Ctd-UserControl")
                .Culture("en")
                .AddResource("DisplayName", "User control")
                .AddResource("Description", "A type for storing ASP.NET user controls.")
                .Culture("hu")
                .AddResource("DisplayName", "Egyéni vezérlőelem")
                .AddResource("Description", "ASP.NET user control tárolására.")
                .Class("Ctd-ViewBase")
                .Culture("en")
                .AddResource("DisplayName", "View base")
                .AddResource("Description", "An abstract type for ContentList views.")
                .AddResource("IsDefault-DisplayName", "Default")
                .AddResource("IsDefault-Description",
                             "Whether this is the default view on the parent ContentList.")
                .AddResource("Template-DisplayName", "Markup template")
                .AddResource("Template-Description", "The Xslt template used to generate the view.")
                .AddResource("FilterXml-DisplayName", "Filtering")
                .AddResource("FilterXml-Description", "Define filtering rules for the view.")
                .AddResource("EnableAutofilters-DisplayName", "Enable autofilters")
                .AddResource("EnableAutofilters-Description",
                             "If autofilters are enabled system content will be filtered from the query.")
                .AddResource("EnableLifespanFilter-DisplayName", "Enable lifespan filter")
                .AddResource("EnableLifespanFilter-Description",
                             "If lifespan filter is enabled only valid content will be in the result.")
                .AddResource("Hidden-Description",
                             "The view won't show in the selector menu if checked. (If unsure, leave unchecked).")
                .AddResource("QueryTop-DisplayName", "Top")
                .AddResource("QueryTop-Description",
                             "If you do not want to display all content please specify here a value greater than 0.")
                .AddResource("QuerySkip-DisplayName", "Skip")
                .AddResource("QuerySkip-Description",
                             "If you do not want to display the first several content please specify here a value greater than 0.")
                .AddResource("Icon-DisplayName", "Icon identifier")
                .AddResource("Icon-Description", "The string identifier of the View's icon.")
                .Culture("hu")
                .AddResource("DisplayName", "View base")
                .AddResource("Description", "Minden view (listanézet) őse.")
                .AddResource("IsDefault-DisplayName", "Alapértelmezett")
                .AddResource("IsDefault-Description", "Legyen ez az alapértelmezett listanézet..")
                .AddResource("Template-DisplayName", "Sablon")
                .AddResource("Template-Description", "A listát generáló xslt sablon.")
                .AddResource("FilterXml-DisplayName", "Szűrés")
                .AddResource("FilterXml-Description", "A listanézet szűrési feltételei.")
                .AddResource("EnableAutofilters-DisplayName", "Automata szűrések bekapcsolása")
                .AddResource("EnableAutofilters-Description",
                             "Ha be van kapcsolva, a rendszer fájlok kiszűrésre kerülnek.")
                .AddResource("EnableLifespanFilter-DisplayName", "Élettartam szűrés")
                .AddResource("EnableLifespanFilter-Description",
                             "Ha be van kapcsolva, akkor csak az időben aktuális elemek jelennek meg.")
                .AddResource("Hidden-Description",
                             "Ha be van pipálva, akkor a listanézet nem jelenik meg a választhatók között a felületen.")
                .AddResource("QueryTop-DisplayName", "Elemszám")
                .AddResource("QueryTop-Description",
                             "Ha nem akarja az összes elemet megjeleníteni, írjon be egy nullánál nagyobb számot.")
                .AddResource("QuerySkip-DisplayName", "Kihagyott elemek")
                .AddResource("QuerySkip-Description",
                             "Ha a lista első valahány elemét ki szeretné hagyni a megjelenítésből, írja be az elhagyni kívánt elemek számát.")
                .AddResource("Icon-DisplayName", "Ikon azonosító")
                .AddResource("Icon-Description", "Név amely a listanézet ikonját azonosítja.")
                .Class("Ctd-WebContent")
                .Culture("en")
                .AddResource("DisplayName", "Web Content (structured web content)")
                .AddResource("Description", "Web Content is the base type for structured web content.")
                .AddResource("ReviewDate-DisplayName", "Review date")
                .AddResource("ReviewDate-Description", "")
                .AddResource("ArchiveDate-DisplayName", "Archive date")
                .AddResource("ArchiveDate-Description", "")
                .Culture("hu")
                .AddResource("DisplayName", "Webes tartalom")
                .AddResource("Description", "")
                .AddResource("ReviewDate-DisplayName", "Ellenőrzés dátuma")
                .AddResource("ReviewDate-Description", "")
                .AddResource("ArchiveDate-DisplayName", "Archiválás dátuma")
                .AddResource("ArchiveDate-Description", "")
                .Class("Ctd-XmlFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Xml field")
                .Culture("hu")
                .AddResource("DisplayName", "Xml mező")
                .Class("Ctd-XsltApplication")
                .Culture("en")
                .AddResource("DisplayName", "Xslt application")
                .AddResource("Description", "Xslt rendering application.")
                .AddResource("Binary-DisplayName", "Xslt template")
                .AddResource("Binary-Description", "Upload or enter the Xslt template to be used in rendering.")
                .AddResource("MimeType-DisplayName", "MIME type")
                .AddResource("MimeType-Description",
                             "Sets HTTP MIME type of the output stream. Default value: application/xml.")
                .AddResource("OmitXmlDeclaration-DisplayName", "OmitXmlDeclaration")
                .AddResource("OmitXmlDeclaration-Description",
                             "Sets a value indicating whether to write XML declaration.")
                .AddResource("ResponseEncoding-DisplayName", "Response encoding")
                .AddResource("ResponseEncoding-Description",
                             "Sets the text encoding to use. Default value: UTF-8.")
                .AddResource("WithChildren-DisplayName", "With children")
                .AddResource("WithChildren-Description",
                             "Sets a value indicating whether to render content with all children Default value: true.")
                .AddResource("Cacheable-DisplayName", "Application is cached")
                .AddResource("Cacheable-Description",
                             "If set the output of the application will be cached. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Switching off application cache may cause performance issues!</i></div>")
                .AddResource("CacheableForLoggedInUser-DisplayName",
                             "Application is cached for logged in users")
                .AddResource("CacheableForLoggedInUser-Description",
                             "If set the output of the application will be cached for logged in users. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Switching off application cache may cause performance issues!</i></div>")
                .AddResource("CacheByPath-DisplayName", "Request path influences caching")
                .AddResource("CacheByPath-Description",
                             "Defines whether the requested content path is included in the cache key. When unchecked application output is preserved regardless of the page's current context content or request path. Check it if you want to cache application output depending on the requested context content.")
                .AddResource("CacheByParams-DisplayName", "Url query params influence caching")
                .AddResource("CacheByParams-Description",
                             "Defines whether the url query params are also included in the cache key. When unchecked application output is preserved regardless of changing url params.")
                .AddResource("CacheByLanguage-DisplayName", "Language influences caching")
                .AddResource("CacheByLanguage-Description",
                             "Defines whether the language code is also included in the cache key. When unchecked application output is preserved regardless of the language that the users use to browse the site.")
                .AddResource("CacheByHost-DisplayName", "Host influences caching")
                .AddResource("CacheByHost-Description",
                             "Defines whether the URL-host (e.g. 'example.com') is also included in the cache key. When unchecked application output is preserved regardless of the host that the users use to browse the site.")
                .AddResource("AbsoluteExpiration-DisplayName", "Absolute expiration")
                .AddResource("AbsoluteExpiration-Description",
                             "Given in seconds. The application will be refreshed periodically with the given time period. -1 means that the value is defined by 'AbsoluteExpirationSeconds' setting in the web.config.")
                .AddResource("SlidingExpirationMinutes-DisplayName", "Sliding expiration")
                .AddResource("SlidingExpirationMinutes-Description",
                             "Given in seconds. The application is refreshed when it has not been accessed for the given seconds. -1 means that the value is defined by 'SlidingExpirationSeconds' setting in the web.config.")
                .AddResource("CustomCacheKey-DisplayName", "Custom cache key")
                .AddResource("CustomCacheKey-Description",
                             "Defines a custom cache key independent of requested path and query params. Useful when the same static output is rendered at various pages. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>For experts only! Leave empty if unsure.</i></div>")
                .Culture("hu")
                .AddResource("DisplayName", "Xslt alkalmazás")
                .AddResource("Description",
                             "Alkalmazás, amely XSLT segítségével jeleníti meg az aktuális tartalmat.")
                .AddResource("Binary-DisplayName", "Xslt sablon")
                .AddResource("Binary-Description", "Adja meg az xslt sablont a megjelenítéshez.")
                .AddResource("MimeType-DisplayName", "MIME type")
                .AddResource("MimeType-Description",
                             "Beállítja a kimeneti stream HTTP MIME type-ját. Alapértelmezett érték: <i>alkalmazás/xml</i>.")
                .AddResource("OmitXmlDeclaration-DisplayName", "Xml deklaráció kihagyása")
                .AddResource("OmitXmlDeclaration-Description",
                             "Megadhatja, hogy kihagyjuk-e az xml deklarációt.")
                .AddResource("ResponseEncoding-DisplayName", "Kimeneti stream kódolás")
                .AddResource("ResponseEncoding-Description",
                             "Beállítja a szöveg kódolását. Alapértelmezett érték: <i>UTF-8</i>.")
                .AddResource("WithChildren-DisplayName", "Gyermek tartalmak")
                .AddResource("WithChildren-Description",
                             "Ha be van állítva, a gyermek elemek is szerepelni fognak az oldalon.")
                .AddResource("Cacheable-DisplayName", "Az oldal kerüljön be a gyorsítótárba")
                .AddResource("Cacheable-Description",
                             "Ha be van állítva, az oldal kimenete bekerül a gyorsítótárba<div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Ennek kikapcsolása nagy terhelés alatt sebesség-problémákat okozhat!</i></div>")
                .AddResource("CacheableForLoggedInUser-DisplayName",
                             "Az oldal kerüljön be a gyorsítótárba belépett felhasználók számára.")
                .AddResource("CacheableForLoggedInUser-Description",
                             "Ha be van állítva, az oldal kimenete bekerül a gyorsítótárba belépett felhasználók számára. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Ennek kikapcsolása nagy terhelés alatt sebesség-problémákat okozhat!</i></div>")
                .AddResource("CacheByPath-DisplayName", "Az aktuális tartalom befolyásolja a cache-elést")
                .AddResource("CacheByPath-Description",
                             "Ha be van állítva, a kért tartalom útvonala (Path) befolyásolja a gyorsítótárat. Ha nincs, az oldal kimenete ugyanaz lesz, függetlenül az aktuális tartalomtól.")
                .AddResource("CacheByParams-DisplayName", "URL paraméterek befolyásolják a gyorsítótárat")
                .AddResource("CacheByParams-Description",
                             "Ha nincs bekapcsolva, az oldal kimenete ugyanaz lesz, függetlenül az URL paraméterektől.")
                .AddResource("CacheByLanguage-DisplayName", "A nyelv befolyásolja a gyorsítótárat")
                .AddResource("CacheByLanguage-Description",
                             "Ha nincs bekapcsolva, az oldal kimenete ugyanaz lesz, függetlenül attól, hogy a felhasználó milyen nyelven nézi az oldalt.")
                .AddResource("CacheByHost-DisplayName", "A host befolyásolja a gyorsítótárat")
                .AddResource("CacheByHost-Description",
                             "Ha nincs bekapcsolva, az oldal kimenete ugyanaz lesz, függetlenül attól, hogy a felhasználó milyen url-host-ról nézi az oldalt.")
                .AddResource("AbsoluteExpiration-DisplayName", "Abszolút gyorsítótár lejárat")
                .AddResource("AbsoluteExpiration-Description",
                             "Másodpercben megadott lejárat. Az oldal rendszeresen frissülni fog a megadott idő után. <br />-1 azt jelenti, hogy az értéket az <i>AbsoluteExpirationSeconds</i> web.config beállítás határozza meg.")
                .AddResource("SlidingExpirationMinutes-DisplayName", "Csúszó gyorsítótár lejárat")
                .AddResource("SlidingExpirationMinutes-Description",
                             "Másodpercben megadott lejárat. Az oldal frissülni fog, ha nem érkezett rá kérés a megadott időn belül. <br />-1 azt jelenti, hogy az értéket az <i>SlidingExpirationSeconds</i> web.config beállítás határozza meg.")
                .AddResource("CustomCacheKey-DisplayName", "Egyedi gyorsítótár (cache) kulcs")
                .AddResource("CustomCacheKey-Description",
                             "Megadhat egyedi gyorsítótár kulcsot, függetlenül az aktuális tartalomtól és URL paraméterektől. Akkor érdemes használni, ha ugyanazt a statikus tartalmat szeretné megjeleníteni több különböző oldalon. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Csak adminisztrátoroknak. Hagyja üresen, ha nem biztos a dologban.</i></div>")
                .Class("Ctd-YesNoFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Yes/No field")
                .Culture("hu")
                .AddResource("DisplayName", "Igen/nem mező");

                rb.Apply();

                #endregion

                #region CTD changes

                var cb = new ContentTypeBuilder();

                cb.Type("CalendarEvent")
                .Field("StartDate")
                .DefaultValue("@@currenttime@@")
                .Field("EndDate")
                .DefaultValue("@@currenttime@@");
                cb.Type("GenericContent")
                .Field("ValidFrom")
                .DefaultValue("@@currenttime@@")
                .Field("ValidTill")
                .DefaultValue("@@currenttime@@");

                cb.Type("Link")
                .Field("Url")
                .DefaultValue("https://");

                cb.Type("User")
                .Field("LoginName")
                .VisibleEdit(FieldVisibility.Hide)
                .Field("Email")
                .VisibleBrowse(FieldVisibility.Show)
                .VisibleEdit(FieldVisibility.Hide)
                .VisibleNew(FieldVisibility.Show)
                .Field("BirthDate")
                .DefaultValue("@@currenttime@@");

                cb.Type("Group")
                .Field("AllRoles")
                .VisibleBrowse(FieldVisibility.Hide)
                .VisibleEdit(FieldVisibility.Hide)
                .VisibleNew(FieldVisibility.Hide)
                .Field("DirectRoles")
                .VisibleBrowse(FieldVisibility.Hide)
                .VisibleEdit(FieldVisibility.Hide)
                .VisibleNew(FieldVisibility.Hide);

                cb.Apply();

                #endregion

                #region Permission changes

                SecurityHandler.SecurityContext.CreateAclEditor()
                .Allow(NodeHead.Get("/Root/Localization").Id, Identifiers.OwnersGroupId, false,
                       PermissionType.Save, PermissionType.Delete)
                .Apply();

                #endregion
            });

            builder.Patch("7.7.13", "7.7.14", "2020-11-19", "Upgrades sensenet content repository.")
            .Action(context =>
            {
                #region CTD changes

                var cb = new ContentTypeBuilder();

                cb.Type("ListItem")
                .Field("ModifiedBy")
                .VisibleEdit(FieldVisibility.Hide);

                cb.Type("User")
                .Field("BirthDate")
                .DefaultValue("");

                cb.Apply();

                #endregion
            });

            builder.Patch("7.7.14", "7.7.16", "2020-12-08", "Upgrades sensenet content repository.")
            .Action(context =>
            {
                #region CTD changes

                var cb = new ContentTypeBuilder();

                // We can set the new regex only if the current regex is the old default
                // (otherwise we do not want to overwrite a custom regex).
                // NOTE: in the old regex below the & character appears as is (in the middle
                // of the first line), but in the new const we had to replace it with &amp;
                // to let the patch algorithm set the correct value in the XML.

                const string oldUrlRegex = "^(http|https)\\://([a-zA-Z0-9\\.\\-]+(\\:[a-zA-Z0-9\\.&%\\$\\-]+)*@)*((25[0-5]|" +
                                           "2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}" +
                                           "[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}" +
                                           "[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|" +
                                           "localhost|([a-zA-Z0-9\\-]+\\.)*[a-zA-Z0-9\\-]+(\\.(com|edu|gov|int|mil|net|org|biz|" +
                                           "arpa|info|name|pro|aero|coop|museum|hu|[a-zA-Z]{2})){0,1})(\\:[0-9]+)*((\\#|/)($|" +
                                           "[a-zA-Z0-9\\.\\,\\?\\'\\\\\\+&%\\$#\\=~_\\-]+))*$";
                const string newUrlRegex = "^(https?|ftp)\\://([a-zA-Z0-9\\.\\-]+(\\:[a-zA-Z0-9\\.&amp;%\\$\\-]+)*@)*((25[0-5]|" +
                                           "2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}" +
                                           "[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}" +
                                           "[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|" +
                                           "localhost|([a-zA-Z0-9\\-]+\\.)*[a-zA-Z0-9\\-]+(\\.(com|edu|gov|int|mil|net|org|biz|" +
                                           "arpa|info|name|pro|aero|coop|museum|hu|[a-zA-Z]{2})){0,1})(\\:[0-9]+)*" +
                                           "(\\/[\\w\\-\\@\\/\\(\\)]*){0,1}((\\?|\\#)(($|[\\w\\.\\,\\'\\\\\\+&amp;" +
                                           "%\\$#\\=~_\\-\\(\\)]+)*)){0,1}$";

                var currentRegex =
                    ((ShortTextFieldSetting)ContentType.GetByName("Link").GetFieldSettingByName("Url")).Regex;

                // replace the regex only if it was the original default
                if (string.Equals(oldUrlRegex, currentRegex, StringComparison.Ordinal))
                {
                    cb.Type("Link")
                    .Field("Url")
                    .Configure("Regex", newUrlRegex);
                }

                cb.Apply();

                #endregion

                #region Content changes

                // create the new public admin user
                if (User.PublicAdministrator == null)
                {
                    var publicAdmin          = Content.CreateNew("User", OrganizationalUnit.Portal, "PublicAdmin");
                    publicAdmin["Enabled"]   = true;
                    publicAdmin["FullName"]  = "PublicAdmin";
                    publicAdmin["LoginName"] = "PublicAdmin";
                    publicAdmin.Save();
                }

                #endregion
            });

            builder.Patch("7.7.16", "7.7.17", "2021-01-25", "Upgrades sensenet content repository.")
            .Action(context =>
            {
                #region CTD changes

                const string ctDefaultValue = @"&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;
&lt;ContentType name=""MyType"" parentType=""GenericContent"" handler=""SenseNet.ContentRepository.GenericContent"" xmlns=""http://schemas.sensenet.com/SenseNet/ContentRepository/ContentTypeDefinition""&gt;
  &lt;DisplayName&gt;MyType&lt;/DisplayName&gt;
  &lt;Description&gt;&lt;/Description&gt;
  &lt;Icon&gt;Content&lt;/Icon&gt;
  &lt;AllowIncrementalNaming&gt;true&lt;/AllowIncrementalNaming&gt;
  &lt;AllowedChildTypes&gt;ContentTypeName1,ContentTypeName2&lt;/AllowedChildTypes&gt;
  &lt;Fields&gt;
    &lt;Field name=""ShortTextField"" type=""ShortText""&gt;
      &lt;DisplayName&gt;ShortTextField&lt;/DisplayName&gt;
      &lt;Description&gt;&lt;/Description&gt;
      &lt;Configuration&gt;
        &lt;MaxLength&gt;100&lt;/MaxLength&gt;
        &lt;MinLength&gt;0&lt;/MinLength&gt;
        &lt;Regex&gt;[a-zA-Z0-9]*$&lt;/Regex&gt;
        &lt;ReadOnly&gt;false&lt;/ReadOnly&gt;
        &lt;Compulsory&gt;false&lt;/Compulsory&gt;
        &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
        &lt;VisibleBrowse&gt;Show|Hide&lt;/VisibleBrowse&gt;
        &lt;VisibleEdit&gt;Show|Hide&lt;/VisibleEdit&gt;
        &lt;VisibleNew&gt;Show|Hide&lt;/VisibleNew&gt;
      &lt;/Configuration&gt;
    &lt;/Field&gt;
    &lt;Field name=""LongTextField"" type=""LongText""&gt;
      &lt;DisplayName&gt;LongTextField&lt;/DisplayName&gt;
      &lt;Description&gt;&lt;/Description&gt;
      &lt;Configuration&gt;
        &lt;MaxLength&gt;100&lt;/MaxLength&gt;
        &lt;MinLength&gt;0&lt;/MinLength&gt;
        &lt;TextType&gt;LongText|RichText&lt;/TextType&gt;
        &lt;ReadOnly&gt;false&lt;/ReadOnly&gt;
        &lt;Compulsory&gt;false&lt;/Compulsory&gt;
        &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
        &lt;VisibleBrowse&gt;Show|Hide&lt;/VisibleBrowse&gt;
        &lt;VisibleEdit&gt;Show|Hide&lt;/VisibleEdit&gt;
        &lt;VisibleNew&gt;Show|Hide&lt;/VisibleNew&gt;
      &lt;/Configuration&gt;
    &lt;/Field&gt;
    &lt;Field name=""NumberField"" type=""Number""&gt;
      &lt;DisplayName&gt;NumberField&lt;/DisplayName&gt;
      &lt;Description&gt;&lt;/Description&gt;
      &lt;Configuration&gt;
        &lt;MinValue&gt;0&lt;/MinValue&gt;
        &lt;MaxValue&gt;100.5&lt;/MaxValue&gt;
        &lt;Digits&gt;2&lt;/Digits&gt;
        &lt;ReadOnly&gt;false&lt;/ReadOnly&gt;
        &lt;Compulsory&gt;false&lt;/Compulsory&gt;
        &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
        &lt;VisibleBrowse&gt;Show|Hide&lt;/VisibleBrowse&gt;
        &lt;VisibleEdit&gt;Show|Hide&lt;/VisibleEdit&gt;
        &lt;VisibleNew&gt;Show|Hide&lt;/VisibleNew&gt;
      &lt;/Configuration&gt;
    &lt;/Field&gt;
    &lt;Field name=""IntegerField"" type=""Integer""&gt;
      &lt;DisplayName&gt;IntegerField&lt;/DisplayName&gt;
      &lt;Description&gt;&lt;/Description&gt;
      &lt;Configuration&gt;
        &lt;MinValue&gt;0&lt;/MinValue&gt;
        &lt;MaxValue&gt;100&lt;/MaxValue&gt;
        &lt;ReadOnly&gt;false&lt;/ReadOnly&gt;
        &lt;Compulsory&gt;false&lt;/Compulsory&gt;
        &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
        &lt;VisibleBrowse&gt;Show|Hide&lt;/VisibleBrowse&gt;
        &lt;VisibleEdit&gt;Show|Hide&lt;/VisibleEdit&gt;
        &lt;VisibleNew&gt;Show|Hide&lt;/VisibleNew&gt;
      &lt;/Configuration&gt;
    &lt;/Field&gt;
    &lt;Field name=""BooleanField"" type=""Boolean""&gt;
      &lt;DisplayName&gt;BooleanField&lt;/DisplayName&gt;
      &lt;Description&gt;&lt;/Description&gt;
      &lt;Configuration&gt;
        &lt;ReadOnly&gt;false&lt;/ReadOnly&gt;
        &lt;Compulsory&gt;false&lt;/Compulsory&gt;
        &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
        &lt;VisibleBrowse&gt;Show|Hide&lt;/VisibleBrowse&gt;
        &lt;VisibleEdit&gt;Show|Hide&lt;/VisibleEdit&gt;
        &lt;VisibleNew&gt;Show|Hide&lt;/VisibleNew&gt;
      &lt;/Configuration&gt;
    &lt;/Field&gt;
    &lt;Field name=""ChoiceField"" type=""Choice""&gt;
      &lt;DisplayName&gt;ChoiceField&lt;/DisplayName&gt;
      &lt;Description&gt;&lt;/Description&gt;
      &lt;Configuration&gt;
        &lt;AllowMultiple&gt;false&lt;/AllowMultiple&gt;
        &lt;AllowExtraValue&gt;false&lt;/AllowExtraValue&gt;
        &lt;Options&gt;
          &lt;Option selected=""true""&gt;1&lt;/Option&gt;
          &lt;Option&gt;2&lt;/Option&gt;
        &lt;/Options&gt;
        &lt;ReadOnly&gt;false&lt;/ReadOnly&gt;
        &lt;Compulsory&gt;false&lt;/Compulsory&gt;
        &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
        &lt;VisibleBrowse&gt;Show|Hide&lt;/VisibleBrowse&gt;
        &lt;VisibleEdit&gt;Show|Hide&lt;/VisibleEdit&gt;
        &lt;VisibleNew&gt;Show|Hide&lt;/VisibleNew&gt;
      &lt;/Configuration&gt;
    &lt;/Field&gt;
    &lt;Field name=""DateTimeField"" type=""DateTime""&gt;
      &lt;DisplayName&gt;DateTimeField&lt;/DisplayName&gt;
      &lt;Description&gt;&lt;/Description&gt;
      &lt;Configuration&gt;
        &lt;DateTimeMode&gt;DateAndTime&lt;/DateTimeMode&gt;
        &lt;Precision&gt;Second&lt;/Precision&gt;
        &lt;ReadOnly&gt;false&lt;/ReadOnly&gt;
        &lt;Compulsory&gt;false&lt;/Compulsory&gt;
        &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
        &lt;VisibleBrowse&gt;Show|Hide&lt;/VisibleBrowse&gt;
        &lt;VisibleEdit&gt;Show|Hide&lt;/VisibleEdit&gt;
        &lt;VisibleNew&gt;Show|Hide&lt;/VisibleNew&gt;
      &lt;/Configuration&gt;
    &lt;/Field&gt;
    &lt;Field name=""ReferenceField"" type=""Reference""&gt;
      &lt;DisplayName&gt;ReferenceField&lt;/DisplayName&gt;
      &lt;Description&gt;&lt;/Description&gt;
      &lt;Configuration&gt;
        &lt;AllowMultiple&gt;true&lt;/AllowMultiple&gt;
        &lt;AllowedTypes&gt;
          &lt;Type&gt;Type1&lt;/Type&gt;
          &lt;Type&gt;Type2&lt;/Type&gt;
        &lt;/AllowedTypes&gt;
        &lt;SelectionRoot&gt;
          &lt;Path&gt;/Root/Path1&lt;/Path&gt;
          &lt;Path&gt;/Root/Path2&lt;/Path&gt;
        &lt;/SelectionRoot&gt;
        &lt;DefaultValue&gt;/Root/Path1,/Root/Path2&lt;/DefaultValue&gt;
        &lt;ReadOnly&gt;false&lt;/ReadOnly&gt;
        &lt;Compulsory&gt;false&lt;/Compulsory&gt;
        &lt;VisibleBrowse&gt;Show|Hide&lt;/VisibleBrowse&gt;
        &lt;VisibleEdit&gt;Show|Hide&lt;/VisibleEdit&gt;
        &lt;VisibleNew&gt;Show|Hide&lt;/VisibleNew&gt;
      &lt;/Configuration&gt;
    &lt;/Field&gt;
    &lt;Field name=""BinaryField"" type=""Binary""&gt;
      &lt;DisplayName&gt;BinaryField&lt;/DisplayName&gt;
      &lt;Description&gt;&lt;/Description&gt;
      &lt;Configuration&gt;
        &lt;IsText&gt;true&lt;/IsText&gt;
        &lt;ReadOnly&gt;false&lt;/ReadOnly&gt;
        &lt;Compulsory&gt;false&lt;/Compulsory&gt;
        &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
        &lt;VisibleBrowse&gt;Show|Hide&lt;/VisibleBrowse&gt;
        &lt;VisibleEdit&gt;Show|Hide&lt;/VisibleEdit&gt;
        &lt;VisibleNew&gt;Show|Hide&lt;/VisibleNew&gt;
      &lt;/Configuration&gt;
    &lt;/Field&gt;
  &lt;/Fields&gt;
&lt;/ContentType&gt;";

                var cb = new ContentTypeBuilder();

                cb.Type("ContentType")
                .Field("Binary")
                .DefaultValue(ctDefaultValue);

                cb.Apply();

                #endregion
            });

            builder.Patch("7.7.17", "7.7.18", "2021-02-17", "Upgrades sensenet content repository.")
            .Action(context =>
            {
                #region String resources

                var rb = new ResourceBuilder();

                rb.Content("CtdResourcesQ.xml")
                .Class("Ctd-Query")
                .Culture("en")
                .AddResource("UiFilters-DisplayName", "UI filters")
                .AddResource("UiFilters-Description", "Technical field for filter data.")
                .Culture("hu")
                .AddResource("UiFilters-DisplayName", "UI szűrők")
                .AddResource("UiFilters-Description", "Technikai mező szűrő adatoknak.");

                rb.Content("ActionResources.xml")
                .Class("Action")
                .Culture("en")
                .AddResource("Browse", "Details");

                rb.Apply();

                #endregion

                #region CTD changes

                var cb = new ContentTypeBuilder();

                cb.Type("Query")
                .Field("UiFilters", "LongText")
                .DisplayName("$Ctd-Query,UiFilters-DisplayName")
                .Description("$Ctd-Query,UiFilters-Description")
                .VisibleBrowse(FieldVisibility.Hide)
                .VisibleEdit(FieldVisibility.Hide)
                .VisibleNew(FieldVisibility.Hide);

                cb.Type("File")
                .Field("Size")
                .ControlHint("sn:FileSize");

                cb.Apply();

                #endregion
            });
        }
Example #13
0
        public void ContentType_ChangeFieldType_LongText()
        {
            Content CreateTestContent(string contentTypeName, Node parent)
            {
                var testContent = Content.CreateNew(contentTypeName, parent, Guid.NewGuid().ToString());

                testContent["LongText1"] = $"{contentTypeName} longtext value";
                testContent.Save();
                return(testContent);
            }

            void AssertProperties(FieldSetting fs, string displayName, string description,
                                  bool compulsory, FieldVisibility visibleEdit, string controlHint)
            {
                Assert.AreEqual("RichText", fs.ShortName);
                Assert.AreEqual(displayName, fs.DisplayName);
                Assert.AreEqual(description, fs.Description);
                Assert.AreEqual(compulsory, fs.Compulsory);
                Assert.AreEqual(visibleEdit, fs.VisibleEdit);
                Assert.AreEqual(controlHint, fs.ControlHint);
            }

            Test(() =>
            {
                ContentTypeInstaller.InstallContentType(CtdTextEditor);
                ContentTypeInstaller.InstallContentType(CtdTextEditorSibling);
                ContentTypeInstaller.InstallContentType(CtdTextEditorChild1);
                ContentTypeInstaller.InstallContentType(CtdTextEditorChild2);
                ContentTypeInstaller.InstallContentType(CtdTextEditorChild3);

                var fs1 = ContentType.GetByName(CtdTextEditorName).FieldSettings.First(fs => fs.Name == "LongText1");
                Assert.AreEqual("LongText", fs1.ShortName);

                // create text content and fill the field
                var parent = new SystemFolder(Repository.Root);
                parent.Save();

                var testContent1 = CreateTestContent(CtdTextEditorName, parent);
                var testContent2 = CreateTestContent(CtdTextEditorSiblingName, parent);
                var testContent3 = CreateTestContent(CtdTextEditorChild1Name, parent);
                var testContent4 = CreateTestContent(CtdTextEditorChild2Name, parent);
                var testContent5 = CreateTestContent(CtdTextEditorChild3Name, parent);

                var cb = new ContentTypeBuilder(null);

                // change field type and set a couple of additional properties
                cb.ChangeFieldType("LongText1", "RichText")
                .Type(CtdTextEditorName)
                .Field("LongText1")
                .DisplayName("My rich text field")
                .Compulsory()
                .VisibleEdit(FieldVisibility.Hide);

                cb.Apply();

                fs1     = ContentType.GetByName(CtdTextEditorName).FieldSettings.Single(fs => fs.Name == "LongText1");
                var fs2 = ContentType.GetByName(CtdTextEditorSiblingName).FieldSettings.Single(fs => fs.Name == "LongText1");
                var fs3 = ContentType.GetByName(CtdTextEditorChild1Name).FieldSettings.Single(fs => fs.Name == "LongText1");
                var fs4 = ContentType.GetByName(CtdTextEditorChild2Name).FieldSettings.Single(fs => fs.Name == "LongText1");
                var fs5 = ContentType.GetByName(CtdTextEditorChild3Name).FieldSettings.Single(fs => fs.Name == "LongText1");

                // check new and preserved properties
                AssertProperties(fs1, "My rich text field", "Preserved desc",
                                 true, FieldVisibility.Hide, "abc");
                AssertProperties(fs2, null, "Sibling desc",
                                 false, FieldVisibility.Show, "sibling");
                AssertProperties(fs3, "My rich text field", "Preserved desc",
                                 true, FieldVisibility.Hide, "abc");
                AssertProperties(fs4, "My rich text field", "TextEditorChild2 desc",
                                 true, FieldVisibility.Hide, "def");
                AssertProperties(fs5, "My rich text field", "TextEditorChild2 desc",
                                 true, FieldVisibility.Hide, "ghi");

                testContent1 = Content.Load(testContent1.Id);
                testContent2 = Content.Load(testContent2.Id);
                testContent3 = Content.Load(testContent3.Id);
                testContent4 = Content.Load(testContent4.Id);
                testContent5 = Content.Load(testContent5.Id);

                Assert.AreEqual($"{CtdTextEditorName} longtext value", ((RichTextFieldValue)testContent1["LongText1"]).Text);
                Assert.AreEqual($"{CtdTextEditorSiblingName} longtext value", ((RichTextFieldValue)testContent2["LongText1"]).Text);
                Assert.AreEqual($"{CtdTextEditorChild1Name} longtext value", ((RichTextFieldValue)testContent3["LongText1"]).Text);
                Assert.AreEqual($"{CtdTextEditorChild2Name} longtext value", ((RichTextFieldValue)testContent4["LongText1"]).Text);
                Assert.AreEqual($"{CtdTextEditorChild3Name} longtext value", ((RichTextFieldValue)testContent5["LongText1"]).Text);
            });
        }
Example #14
0
        public override void AddPatches(PatchBuilder builder)
        {
            builder.Patch("7.7.11", "7.7.12", "2020-09-7", "Upgrades sensenet content repository.")
            .Action(context =>
            {
                #region CTD changes

                var cb = new ContentTypeBuilder();

                cb.Type("Settings")
                .Field("Description", "LongText")
                .VisibleBrowse(FieldVisibility.Hide)
                .VisibleEdit(FieldVisibility.Show)
                .VisibleNew(FieldVisibility.Show);

                cb.Apply();

                #endregion

                #region Settings Description field changes

                SetSettingsDescription("Indexing", "In this Settings file you can customize the indexing behavior (for example the text extractor used in case of different file types) of the system.");
                SetSettingsDescription("Logging", "Contains logging-related settings, for example which events are sent to the trace. You can control tracing by category: switch on or off writing messages in certain categories to the trace channel.");
                SetSettingsDescription("MailProcessor", "The content list Inbox feature requires an Exchange or POP3 server configuration and other settings related to connecting libraries to a mailbox.");
                SetSettingsDescription("OAuth", "When users log in using one of the configured OAuth providers (like Google or Facebook), these settings control the type and place of the newly created users.");
                SetSettingsDescription("OfficeOnline", "To open or edit Office documents in the browser, the system needs to know the address of the Office Online Server that provides the user interface for the feature. In this section you can configure that and other OOS-related settings.");
                SetSettingsDescription("Sharing", "Content sharing related options.");
                SetSettingsDescription("TaskManagement", "When the Task Management module is installed, this is the place where you can configure the connection to the central task management service.");
                SetSettingsDescription("UserProfile", "When a user is created, and the profile feature is enabled (in the app configuration), they automatically get a profile – a workspace dedicated to the user’s personal documents and tasks. In this setting section you can customize the content type and the place of this profile.");

                void SetSettingsDescription(string name, string description)
                {
                    var settings = Content.Load("/Root/System/Settings/" + name + ".settings");
                    if (settings == null)
                    {
                        return;
                    }
                    settings["Description"] = description;
                    settings.SaveSameVersion();
                }

                #endregion

                #region App changes

                var app1 = Content.Load("/Root/(apps)/Folder/Add");
                if (app1 != null)
                {
                    app1["Scenario"] = string.Empty;
                    app1.SaveSameVersion();
                }

                var app2 = Content.Load("/Root/(apps)/ContentType/Edit");
                if (app2 == null)
                {
                    var parent = RepositoryTools.CreateStructure("/Root/(apps)/ContentType") ??
                                 Content.Load("/Root/(apps)/ContentType");

                    app2 = Content.CreateNew("ClientApplication", parent.ContentHandler, "Edit");
                    app2["DisplayName"]         = "$Action,Edit";
                    app2["Scenario"]            = "ContextMenu";
                    app2["Icon"]                = "edit";
                    app2["RequiredPermissions"] = "See;Open;OpenMinor;Save";
                    app2.Save();

                    // set app permissions
                    var developersGroupId = NodeHead.Get("/Root/IMS/BuiltIn/Portal/Developers")?.Id ?? 0;
                    var aclEditor         = SecurityHandler.SecurityContext.CreateAclEditor();
                    aclEditor
                    .Allow(app2.Id, Identifiers.AdministratorsGroupId,
                           false, PermissionType.RunApplication);
                    if (developersGroupId > 0)
                    {
                        aclEditor.Allow(app2.Id, developersGroupId,
                                        false, PermissionType.RunApplication);
                    }

                    aclEditor.Apply();
                }

                #endregion
            });

            builder.Patch("7.7.12", "7.7.13", "2020-09-23", "Upgrades sensenet content repository.")
            .Action(context =>
            {
                #region String resources

                var rb = new ResourceBuilder();

                rb.Content("CtdResourcesAB.xml")
                .Class("Ctd-BinaryFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Binary field")
                .Culture("hu")
                .AddResource("DisplayName", "Bináris mező");

                rb.Content("CtdResourcesCD.xml")
                .Class("Ctd-ChoiceFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Choice field")
                .Culture("hu")
                .AddResource("DisplayName", "Választó mező")
                .Class("Ctd-CurrencyFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Currency field")
                .Culture("hu")
                .AddResource("DisplayName", "Pénzérték mező")
                .Class("Ctd-DateTimeFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "DateTime field")
                .Culture("hu")
                .AddResource("DisplayName", "Dátum mező");

                rb.Content("CtdResourcesEF.xml")
                .Class("Ctd-FieldControlTemplate")
                .Culture("en")
                .AddResource("DisplayName", "FieldControlTemplate")
                .AddResource("Description", "A type for FieldControl templates.")
                .Culture("hu")
                .AddResource("DisplayName", "Mező vezérlő sablon")
                .AddResource("Description", "Mező vezérlő sablont tároló fájl")
                .Class("Ctd-FieldControlTemplates")
                .Culture("en")
                .AddResource("DisplayName", "FieldControlTemplates")
                .AddResource("Description", "This is the container type for ContentViews. Instances are allowed only at /Root/Global/fieldcontroltemplates.")
                .Culture("hu")
                .AddResource("DisplayName", "Mező vezérlő sablonok")
                .AddResource("Description", "Mező vezérlő sablonokat tároló mappa. Csak egy lehet, itt: /Root/Global/fieldcontroltemplates.");

                rb.Content("CtdResourcesGH.xml")
                .Class("Ctd-HyperLinkFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Hyperlink field")
                .Culture("hu")
                .AddResource("DisplayName", "Hivatkozás mező");


                rb.Content("CtdResourcesIJK.xml")
                .Class("Ctd-Image")
                .Culture("en")
                .AddResource("DisplayName", "Image")
                .AddResource("Name-DisplayName", "Name")
                .Culture("hu")
                .AddResource("DisplayName", "Kép")
                .AddResource("Name-DisplayName", "Név")
                .Class("Ctd-IntegerFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Integer field")
                .Culture("hu")
                .AddResource("DisplayName", "Egész szám mező");

                rb.Content("CtdResourcesLM.xml")
                .Class("Ctd-LongTextFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Longtext field")
                .Culture("hu")
                .AddResource("DisplayName", "Hosszú szöveges mező");

                rb.Content("CtdResourcesNOP.xml")
                .Class("Ctd-NullFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Null field")
                .Culture("hu")
                .AddResource("DisplayName", "Null mező")
                .Class("Ctd-NumberFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Number field")
                .Culture("hu")
                .AddResource("DisplayName", "Szám mező")
                .Class("Ctd-PasswordFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Password field")
                .Culture("hu")
                .AddResource("DisplayName", "Jelszó mező")
                .Class("Ctd-PermissionChoiceFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Permission choice field")
                .Culture("hu")
                .AddResource("DisplayName", "Jogosultság választó mező");

                rb.Content("CtdResourcesRS.xml")
                .Class("Ctd-ReferenceFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Reference field")
                .Culture("hu")
                .AddResource("DisplayName", "Referencia mező")
                .Class("Ctd-ShortTextFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "ShortText field")
                .Culture("hu")
                .AddResource("DisplayName", "Rövid szöveges mező");

                rb.Content("CtdResourcesTZ.xml")
                .Class("Ctd-Workspace")
                .Culture("en")
                .AddResource("Name-DisplayName", "Name")
                .Culture("hu")
                .AddResource("Name-DisplayName", "Név")
                .Class("Ctd-TextFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Text field")
                .Culture("hu")
                .AddResource("DisplayName", "Szöveges mező")
                .Class("Ctd-UserControl")
                .Culture("en")
                .AddResource("DisplayName", "User control")
                .AddResource("Description", "A type for storing ASP.NET user controls.")
                .Culture("hu")
                .AddResource("DisplayName", "Egyéni vezérlőelem")
                .AddResource("Description", "ASP.NET user control tárolására.")
                .Class("Ctd-ViewBase")
                .Culture("en")
                .AddResource("DisplayName", "View base")
                .AddResource("Description", "An abstract type for ContentList views.")
                .AddResource("IsDefault-DisplayName", "Default")
                .AddResource("IsDefault-Description",
                             "Whether this is the default view on the parent ContentList.")
                .AddResource("Template-DisplayName", "Markup template")
                .AddResource("Template-Description", "The Xslt template used to generate the view.")
                .AddResource("FilterXml-DisplayName", "Filtering")
                .AddResource("FilterXml-Description", "Define filtering rules for the view.")
                .AddResource("EnableAutofilters-DisplayName", "Enable autofilters")
                .AddResource("EnableAutofilters-Description",
                             "If autofilters are enabled system content will be filtered from the query.")
                .AddResource("EnableLifespanFilter-DisplayName", "Enable lifespan filter")
                .AddResource("EnableLifespanFilter-Description",
                             "If lifespan filter is enabled only valid content will be in the result.")
                .AddResource("Hidden-Description",
                             "The view won't show in the selector menu if checked. (If unsure, leave unchecked).")
                .AddResource("QueryTop-DisplayName", "Top")
                .AddResource("QueryTop-Description",
                             "If you do not want to display all content please specify here a value greater than 0.")
                .AddResource("QuerySkip-DisplayName", "Skip")
                .AddResource("QuerySkip-Description",
                             "If you do not want to display the first several content please specify here a value greater than 0.")
                .AddResource("Icon-DisplayName", "Icon identifier")
                .AddResource("Icon-Description", "The string identifier of the View's icon.")
                .Culture("hu")
                .AddResource("DisplayName", "View base")
                .AddResource("Description", "Minden view (listanézet) őse.")
                .AddResource("IsDefault-DisplayName", "Alapértelmezett")
                .AddResource("IsDefault-Description", "Legyen ez az alapértelmezett listanézet..")
                .AddResource("Template-DisplayName", "Sablon")
                .AddResource("Template-Description", "A listát generáló xslt sablon.")
                .AddResource("FilterXml-DisplayName", "Szűrés")
                .AddResource("FilterXml-Description", "A listanézet szűrési feltételei.")
                .AddResource("EnableAutofilters-DisplayName", "Automata szűrések bekapcsolása")
                .AddResource("EnableAutofilters-Description",
                             "Ha be van kapcsolva, a rendszer fájlok kiszűrésre kerülnek.")
                .AddResource("EnableLifespanFilter-DisplayName", "Élettartam szűrés")
                .AddResource("EnableLifespanFilter-Description",
                             "Ha be van kapcsolva, akkor csak az időben aktuális elemek jelennek meg.")
                .AddResource("Hidden-Description",
                             "Ha be van pipálva, akkor a listanézet nem jelenik meg a választhatók között a felületen.")
                .AddResource("QueryTop-DisplayName", "Elemszám")
                .AddResource("QueryTop-Description",
                             "Ha nem akarja az összes elemet megjeleníteni, írjon be egy nullánál nagyobb számot.")
                .AddResource("QuerySkip-DisplayName", "Kihagyott elemek")
                .AddResource("QuerySkip-Description",
                             "Ha a lista első valahány elemét ki szeretné hagyni a megjelenítésből, írja be az elhagyni kívánt elemek számát.")
                .AddResource("Icon-DisplayName", "Ikon azonosító")
                .AddResource("Icon-Description", "Név amely a listanézet ikonját azonosítja.")
                .Class("Ctd-WebContent")
                .Culture("en")
                .AddResource("DisplayName", "Web Content (structured web content)")
                .AddResource("Description", "Web Content is the base type for structured web content.")
                .AddResource("ReviewDate-DisplayName", "Review date")
                .AddResource("ReviewDate-Description", "")
                .AddResource("ArchiveDate-DisplayName", "Archive date")
                .AddResource("ArchiveDate-Description", "")
                .Culture("hu")
                .AddResource("DisplayName", "Webes tartalom")
                .AddResource("Description", "")
                .AddResource("ReviewDate-DisplayName", "Ellenőrzés dátuma")
                .AddResource("ReviewDate-Description", "")
                .AddResource("ArchiveDate-DisplayName", "Archiválás dátuma")
                .AddResource("ArchiveDate-Description", "")
                .Class("Ctd-XmlFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Xml field")
                .Culture("hu")
                .AddResource("DisplayName", "Xml mező")
                .Class("Ctd-XsltApplication")
                .Culture("en")
                .AddResource("DisplayName", "Xslt application")
                .AddResource("Description", "Xslt rendering application.")
                .AddResource("Binary-DisplayName", "Xslt template")
                .AddResource("Binary-Description", "Upload or enter the Xslt template to be used in rendering.")
                .AddResource("MimeType-DisplayName", "MIME type")
                .AddResource("MimeType-Description",
                             "Sets HTTP MIME type of the output stream. Default value: application/xml.")
                .AddResource("OmitXmlDeclaration-DisplayName", "OmitXmlDeclaration")
                .AddResource("OmitXmlDeclaration-Description",
                             "Sets a value indicating whether to write XML declaration.")
                .AddResource("ResponseEncoding-DisplayName", "Response encoding")
                .AddResource("ResponseEncoding-Description",
                             "Sets the text encoding to use. Default value: UTF-8.")
                .AddResource("WithChildren-DisplayName", "With children")
                .AddResource("WithChildren-Description",
                             "Sets a value indicating whether to render content with all children Default value: true.")
                .AddResource("Cacheable-DisplayName", "Application is cached")
                .AddResource("Cacheable-Description",
                             "If set the output of the application will be cached. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Switching off application cache may cause performance issues!</i></div>")
                .AddResource("CacheableForLoggedInUser-DisplayName",
                             "Application is cached for logged in users")
                .AddResource("CacheableForLoggedInUser-Description",
                             "If set the output of the application will be cached for logged in users. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Switching off application cache may cause performance issues!</i></div>")
                .AddResource("CacheByPath-DisplayName", "Request path influences caching")
                .AddResource("CacheByPath-Description",
                             "Defines whether the requested content path is included in the cache key. When unchecked application output is preserved regardless of the page's current context content or request path. Check it if you want to cache application output depending on the requested context content.")
                .AddResource("CacheByParams-DisplayName", "Url query params influence caching")
                .AddResource("CacheByParams-Description",
                             "Defines whether the url query params are also included in the cache key. When unchecked application output is preserved regardless of changing url params.")
                .AddResource("CacheByLanguage-DisplayName", "Language influences caching")
                .AddResource("CacheByLanguage-Description",
                             "Defines whether the language code is also included in the cache key. When unchecked application output is preserved regardless of the language that the users use to browse the site.")
                .AddResource("CacheByHost-DisplayName", "Host influences caching")
                .AddResource("CacheByHost-Description",
                             "Defines whether the URL-host (e.g. 'example.com') is also included in the cache key. When unchecked application output is preserved regardless of the host that the users use to browse the site.")
                .AddResource("AbsoluteExpiration-DisplayName", "Absolute expiration")
                .AddResource("AbsoluteExpiration-Description",
                             "Given in seconds. The application will be refreshed periodically with the given time period. -1 means that the value is defined by 'AbsoluteExpirationSeconds' setting in the web.config.")
                .AddResource("SlidingExpirationMinutes-DisplayName", "Sliding expiration")
                .AddResource("SlidingExpirationMinutes-Description",
                             "Given in seconds. The application is refreshed when it has not been accessed for the given seconds. -1 means that the value is defined by 'SlidingExpirationSeconds' setting in the web.config.")
                .AddResource("CustomCacheKey-DisplayName", "Custom cache key")
                .AddResource("CustomCacheKey-Description",
                             "Defines a custom cache key independent of requested path and query params. Useful when the same static output is rendered at various pages. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>For experts only! Leave empty if unsure.</i></div>")
                .Culture("hu")
                .AddResource("DisplayName", "Xslt alkalmazás")
                .AddResource("Description",
                             "Alkalmazás, amely XSLT segítségével jeleníti meg az aktuális tartalmat.")
                .AddResource("Binary-DisplayName", "Xslt sablon")
                .AddResource("Binary-Description", "Adja meg az xslt sablont a megjelenítéshez.")
                .AddResource("MimeType-DisplayName", "MIME type")
                .AddResource("MimeType-Description",
                             "Beállítja a kimeneti stream HTTP MIME type-ját. Alapértelmezett érték: <i>alkalmazás/xml</i>.")
                .AddResource("OmitXmlDeclaration-DisplayName", "Xml deklaráció kihagyása")
                .AddResource("OmitXmlDeclaration-Description",
                             "Megadhatja, hogy kihagyjuk-e az xml deklarációt.")
                .AddResource("ResponseEncoding-DisplayName", "Kimeneti stream kódolás")
                .AddResource("ResponseEncoding-Description",
                             "Beállítja a szöveg kódolását. Alapértelmezett érték: <i>UTF-8</i>.")
                .AddResource("WithChildren-DisplayName", "Gyermek tartalmak")
                .AddResource("WithChildren-Description",
                             "Ha be van állítva, a gyermek elemek is szerepelni fognak az oldalon.")
                .AddResource("Cacheable-DisplayName", "Az oldal kerüljön be a gyorsítótárba")
                .AddResource("Cacheable-Description",
                             "Ha be van állítva, az oldal kimenete bekerül a gyorsítótárba<div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Ennek kikapcsolása nagy terhelés alatt sebesség-problémákat okozhat!</i></div>")
                .AddResource("CacheableForLoggedInUser-DisplayName",
                             "Az oldal kerüljön be a gyorsítótárba belépett felhasználók számára.")
                .AddResource("CacheableForLoggedInUser-Description",
                             "Ha be van állítva, az oldal kimenete bekerül a gyorsítótárba belépett felhasználók számára. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Ennek kikapcsolása nagy terhelés alatt sebesség-problémákat okozhat!</i></div>")
                .AddResource("CacheByPath-DisplayName", "Az aktuális tartalom befolyásolja a cache-elést")
                .AddResource("CacheByPath-Description",
                             "Ha be van állítva, a kért tartalom útvonala (Path) befolyásolja a gyorsítótárat. Ha nincs, az oldal kimenete ugyanaz lesz, függetlenül az aktuális tartalomtól.")
                .AddResource("CacheByParams-DisplayName", "URL paraméterek befolyásolják a gyorsítótárat")
                .AddResource("CacheByParams-Description",
                             "Ha nincs bekapcsolva, az oldal kimenete ugyanaz lesz, függetlenül az URL paraméterektől.")
                .AddResource("CacheByLanguage-DisplayName", "A nyelv befolyásolja a gyorsítótárat")
                .AddResource("CacheByLanguage-Description",
                             "Ha nincs bekapcsolva, az oldal kimenete ugyanaz lesz, függetlenül attól, hogy a felhasználó milyen nyelven nézi az oldalt.")
                .AddResource("CacheByHost-DisplayName", "A host befolyásolja a gyorsítótárat")
                .AddResource("CacheByHost-Description",
                             "Ha nincs bekapcsolva, az oldal kimenete ugyanaz lesz, függetlenül attól, hogy a felhasználó milyen url-host-ról nézi az oldalt.")
                .AddResource("AbsoluteExpiration-DisplayName", "Abszolút gyorsítótár lejárat")
                .AddResource("AbsoluteExpiration-Description",
                             "Másodpercben megadott lejárat. Az oldal rendszeresen frissülni fog a megadott idő után. <br />-1 azt jelenti, hogy az értéket az <i>AbsoluteExpirationSeconds</i> web.config beállítás határozza meg.")
                .AddResource("SlidingExpirationMinutes-DisplayName", "Csúszó gyorsítótár lejárat")
                .AddResource("SlidingExpirationMinutes-Description",
                             "Másodpercben megadott lejárat. Az oldal frissülni fog, ha nem érkezett rá kérés a megadott időn belül. <br />-1 azt jelenti, hogy az értéket az <i>SlidingExpirationSeconds</i> web.config beállítás határozza meg.")
                .AddResource("CustomCacheKey-DisplayName", "Egyedi gyorsítótár (cache) kulcs")
                .AddResource("CustomCacheKey-Description",
                             "Megadhat egyedi gyorsítótár kulcsot, függetlenül az aktuális tartalomtól és URL paraméterektől. Akkor érdemes használni, ha ugyanazt a statikus tartalmat szeretné megjeleníteni több különböző oldalon. <div class='ui-helper-clearfix sn-dialog-editportlet-warning'><img class='sn-icon sn-icon16 sn-floatleft' src='/Root/Global/images/icons/16/warning.png' /><i>Csak adminisztrátoroknak. Hagyja üresen, ha nem biztos a dologban.</i></div>")
                .Class("Ctd-YesNoFieldSetting")
                .Culture("en")
                .AddResource("DisplayName", "Yes/No field")
                .Culture("hu")
                .AddResource("DisplayName", "Igen/nem mező");

                rb.Apply();

                #endregion

                #region CTD changes

                var cb = new ContentTypeBuilder();

                cb.Type("CalendarEvent")
                .Field("StartDate")
                .DefaultValue("@@currenttime@@")
                .Field("EndDate")
                .DefaultValue("@@currenttime@@");
                cb.Type("GenericContent")
                .Field("ValidFrom")
                .DefaultValue("@@currenttime@@")
                .Field("ValidTill")
                .DefaultValue("@@currenttime@@");

                cb.Type("Link")
                .Field("Url")
                .DefaultValue("https://");

                cb.Type("User")
                .Field("LoginName")
                .VisibleEdit(FieldVisibility.Hide)
                .Field("Email")
                .VisibleBrowse(FieldVisibility.Show)
                .VisibleEdit(FieldVisibility.Hide)
                .VisibleNew(FieldVisibility.Show)
                .Field("BirthDate")
                .DefaultValue("@@currenttime@@");

                cb.Type("Group")
                .Field("AllRoles")
                .VisibleBrowse(FieldVisibility.Hide)
                .VisibleEdit(FieldVisibility.Hide)
                .VisibleNew(FieldVisibility.Hide)
                .Field("DirectRoles")
                .VisibleBrowse(FieldVisibility.Hide)
                .VisibleEdit(FieldVisibility.Hide)
                .VisibleNew(FieldVisibility.Hide);

                cb.Apply();

                #endregion

                #region Permission changes

                SecurityHandler.SecurityContext.CreateAclEditor()
                .Allow(NodeHead.Get("/Root/Localization").Id, Identifiers.OwnersGroupId, false,
                       PermissionType.Save, PermissionType.Delete)
                .Apply();

                #endregion
            });
        }