Beispiel #1
0
        public virtual ChannelSettings Copy(TemplateDefinitionVersion version, litePerson person, String ipAddrees, String ipProxyAddress)
        {
            ChannelSettings n = new ChannelSettings();

            n.CreateMetaInfo(person, ipAddrees, ipProxyAddress);
            n.Version      = version;
            n.Channel      = Channel;
            n.MailSettings = MailSettings;
            n.IsEnabled    = IsEnabled;
            return(n);
        }
        public virtual TemplateModuleContent Copy(TemplateDefinitionVersion version, Boolean isActive)
        {
            TemplateModuleContent cp = new TemplateModuleContent();

            cp.Version  = version;
            cp.IsActive = isActive;

            cp.IdModule   = this.IdModule;
            cp.ModuleCode = this.ModuleCode;
            return(cp);
        }
        public virtual VersionPermission Copy(TemplateDefinition template, TemplateDefinitionVersion version, litePerson person, String ipAddrees, String ipProxyAddress)
        {
            VersionPermission n = new VersionPermission();

            n.CreateMetaInfo(person, ipAddrees, ipProxyAddress);
            n.Version          = version;
            n.Clone            = Clone;
            n.Edit             = Edit;
            n.ChangePermission = ChangePermission;
            n.Type             = Type;
            n.Template         = template;
            n.ToApply          = ToApply;
            return(n);
        }
        public virtual TemplateTranslation Copy(TemplateDefinitionVersion version, litePerson person, String ipAddress, String ipProxyAddress, String namePrefix = "")
        {
            TemplateTranslation t = new TemplateTranslation();

            t.CreateMetaInfo(person, ipAddress, ipProxyAddress);

            t.Version      = version;
            t.IdLanguage   = IdLanguage;
            t.LanguageCode = LanguageCode;
            t.Translation  = Translation.Copy();
            if (!String.IsNullOrEmpty(namePrefix))
            {
                t.Translation.Name = namePrefix + t.Translation.Name;
            }
            return(t);
        }
Beispiel #5
0
        public virtual TemplateDefinitionVersion Copy(TemplateDefinition template, litePerson person, String ipAddrees, String ipProxyAddress, String namePrefix = "")
        {
            TemplateDefinitionVersion tv = new TemplateDefinitionVersion();

            tv.CreateMetaInfo(person, ipAddrees, ipProxyAddress);

            tv.Template           = template;
            tv.DefaultTranslation = DefaultTranslation.Copy();
            if (!string.IsNullOrEmpty(namePrefix))
            {
                tv.DefaultTranslation.Name = namePrefix + tv.DefaultTranslation.Name;
            }
            tv.Status        = Status;
            tv.Owner         = person;
            tv.HasShortText  = HasShortText;
            tv.OnlyShortText = OnlyShortText;
            if (Translations != null)
            {
                foreach (TemplateTranslation tt in Translations.Where(t => t.Deleted == BaseStatusDeleted.None).ToList())
                {
                    tv.Translations.Add(tt.Copy(tv, person, ipAddrees, ipProxyAddress, namePrefix));
                }
            }
            if (ModulesForContent != null)
            {
                foreach (TemplateModuleContent mc in ModulesForContent.Where(t => t.Deleted == BaseStatusDeleted.None && t.IsActive).ToList())
                {
                    tv.ModulesForContent.Add(mc.Copy(tv, mc.IsActive));
                }
            }
            if (ChannelSettings != null)
            {
                foreach (ChannelSettings ns in ChannelSettings.Where(t => t.Deleted == BaseStatusDeleted.None).ToList())
                {
                    tv.ChannelSettings.Add(ns.Copy(tv, person, ipAddrees, ipProxyAddress));
                }
            }
            if (Permissions != null)
            {
                foreach (VersionPermission ns in Permissions.Where(t => t.Deleted == BaseStatusDeleted.None).ToList())
                {
                    switch (ns.Type)
                    {
                    case PermissionType.Community:
                        tv.Permissions.Add(((VersionCommunityPermission)ns).Copy(template, tv, person, ipAddrees, ipProxyAddress));
                        break;

                    case PermissionType.Module:
                        break;

                    case PermissionType.Owner:
                        tv.Permissions.Add(((VersionOwnerPermission)ns).Copy(template, tv, person, ipAddrees, ipProxyAddress));
                        break;

                    case PermissionType.Person:
                        tv.Permissions.Add(((VersionPersonPermission)ns).Copy(template, tv, person, ipAddrees, ipProxyAddress));
                        break;

                    case PermissionType.ProfileType:
                        tv.Permissions.Add(((VersionProfileTypePermission)ns).Copy(template, tv, person, ipAddrees, ipProxyAddress));
                        break;

                    case PermissionType.Role:
                        tv.Permissions.Add(((VersionRolePermission)ns).Copy(template, tv, person, ipAddrees, ipProxyAddress));
                        break;
                    }
                }
            }
            return(tv);
        }
Beispiel #6
0
 private Boolean IsValidForVersion(TemplateDefinitionVersion v)
 {
     return(v != null && v.ChannelSettings != null && v.ChannelSettings.Where(a => a.Deleted == BaseStatusDeleted.None).ToList().Where(a => lm.Comol.Core.DomainModel.PermissionHelper.CheckPermissionSoft((long)a.Channel, (long)Settings.Channel)).Any());
 }