public SkinControlPackageWriter(SkinControlInfo skinControl, PackageInfo package)
     : base(package)
 {
     _SkinControl = skinControl;
     BasePath = Path.Combine("DesktopModules", package.Name.ToLower()).Replace("/", "\\");
     AppCodePath = Path.Combine("App_Code", package.Name.ToLower()).Replace("/", "\\");
 }
 public SkinControlPackageWriter(PackageInfo package)
     : base(package)
 {
     _SkinControl = SkinControlController.GetSkinControlByPackageID(package.PackageID);
     BasePath = Path.Combine("DesktopModules", package.Name.ToLower()).Replace("/", "\\");
     AppCodePath = Path.Combine("App_Code", package.Name.ToLower()).Replace("/", "\\");
 }
 public override void ReadManifest(XPathNavigator manifestNav)
 {
     SkinControl = CBO.DeserializeObject<SkinControlInfo>(new StringReader(manifestNav.InnerXml));
     if (Log.Valid)
     {
         Log.AddInfo(Util.MODULE_ReadSuccess);
     }
 }
 public SkinControlPackageWriter(XPathNavigator manifestNav, InstallerInfo installer)
 {
     _SkinControl = new SkinControlInfo();
     Package = new PackageInfo(installer);
     ReadLegacyManifest(manifestNav, true);
     Package.Description = Null.NullString;
     Package.Version = new Version(1, 0, 0);
     Package.PackageType = "SkinObject";
     Package.License = Util.PACKAGE_NoLicense;
     BasePath = Path.Combine("DesktopModules", Package.Name.ToLower()).Replace("/", "\\");
     AppCodePath = Path.Combine("App_Code", Package.Name.ToLower()).Replace("/", "\\");
 }
 public static int SaveSkinControl(SkinControlInfo skinControl)
 {
     int skinControlID = skinControl.SkinControlID;
     Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController();
     if (skinControlID == Null.NullInteger)
     {
         skinControlID = dataProvider.AddSkinControl(skinControl.PackageID, skinControl.ControlKey, skinControl.ControlSrc, skinControl.SupportsPartialRendering, UserController.GetCurrentUserInfo().UserID);
         objEventLog.AddLog(skinControl, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINCONTROL_CREATED);
     }
     else
     {
         dataProvider.UpdateSkinControl(skinControl.SkinControlID, skinControl.PackageID, skinControl.ControlKey, skinControl.ControlSrc, skinControl.SupportsPartialRendering, UserController.GetCurrentUserInfo().UserID);
         objEventLog.AddLog(skinControl, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINCONTROL_UPDATED);
     }
     return skinControlID;
 }
Example #6
0
        public static int SaveSkinControl(SkinControlInfo skinControl)
        {
            int skinControlID = skinControl.SkinControlID;

            Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController();
            if (skinControlID == Null.NullInteger)
            {
                skinControlID = dataProvider.AddSkinControl(skinControl.PackageID, skinControl.ControlKey, skinControl.ControlSrc, skinControl.SupportsPartialRendering, UserController.GetCurrentUserInfo().UserID);
                objEventLog.AddLog(skinControl, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINCONTROL_CREATED);
            }
            else
            {
                dataProvider.UpdateSkinControl(skinControl.SkinControlID, skinControl.PackageID, skinControl.ControlKey, skinControl.ControlSrc, skinControl.SupportsPartialRendering, UserController.GetCurrentUserInfo().UserID);
                objEventLog.AddLog(skinControl, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINCONTROL_UPDATED);
            }
            return(skinControlID);
        }
 public override void Install()
 {
     try
     {
         InstalledSkinControl = SkinControlController.GetSkinControlByKey(SkinControl.ControlKey);
         if (InstalledSkinControl != null)
         {
             SkinControl.SkinControlID = InstalledSkinControl.SkinControlID;
         }
         SkinControl.PackageID = Package.PackageID;
         SkinControl.SkinControlID = SkinControlController.SaveSkinControl(SkinControl);
         Completed = true;
         Log.AddInfo(string.Format(Util.MODULE_Registered, SkinControl.ControlKey));
     }
     catch (Exception ex)
     {
         Log.AddFailure(ex);
     }
 }
 public static void DeleteSkinControl(SkinControlInfo skinControl)
 {
     dataProvider.DeleteSkinControl(skinControl.SkinControlID);
     Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController();
     objEventLog.AddLog(skinControl, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINCONTROL_DELETED);
 }
 public static int AddPackage(PackageInfo package, bool includeDetail)
 {
     int packageID = provider.AddPackage(package.PortalID, package.Name, package.FriendlyName, package.Description, package.PackageType, package.Version.ToString(3), package.License, package.Manifest, package.Owner, package.Organization,
     package.Url, package.Email, package.ReleaseNotes, package.IsSystemPackage, UserController.GetCurrentUserInfo().UserID);
     Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController();
     objEventLog.AddLog(package, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.PACKAGE_CREATED);
     if (includeDetail)
     {
         Locale locale;
         LanguagePackInfo languagePack;
         switch (package.PackageType)
         {
             case "Auth_System":
                 AuthenticationInfo authSystem = new AuthenticationInfo();
                 authSystem.AuthenticationType = package.Name;
                 authSystem.IsEnabled = Null.NullBoolean;
                 authSystem.PackageID = packageID;
                 AuthenticationController.AddAuthentication(authSystem);
                 break;
             case "Container":
             case "Skin":
                 SkinPackageInfo skinPackage = new SkinPackageInfo();
                 skinPackage.SkinName = package.Name;
                 skinPackage.PackageID = packageID;
                 skinPackage.SkinType = package.PackageType;
                 SkinController.AddSkinPackage(skinPackage);
                 break;
             case "CoreLanguagePack":
                 locale = Localization.Localization.GetLocale(PortalController.GetCurrentPortalSettings().DefaultLanguage);
                 languagePack = new LanguagePackInfo();
                 languagePack.PackageID = packageID;
                 languagePack.LanguageID = locale.LanguageID;
                 languagePack.DependentPackageID = -2;
                 LanguagePackController.SaveLanguagePack(languagePack);
                 break;
             case "ExtensionLanguagePack":
                 locale = Localization.Localization.GetLocale(PortalController.GetCurrentPortalSettings().DefaultLanguage);
                 languagePack = new LanguagePackInfo();
                 languagePack.PackageID = packageID;
                 languagePack.LanguageID = locale.LanguageID;
                 languagePack.DependentPackageID = Null.NullInteger;
                 LanguagePackController.SaveLanguagePack(languagePack);
                 break;
             case "Module":
                 DesktopModuleInfo desktopModule = new DesktopModuleInfo();
                 desktopModule.PackageID = packageID;
                 desktopModule.ModuleName = package.Name;
                 desktopModule.FriendlyName = package.FriendlyName;
                 desktopModule.FolderName = package.Name;
                 desktopModule.Description = package.Description;
                 desktopModule.Version = package.Version.ToString(3);
                 desktopModule.SupportedFeatures = 0;
                 int desktopModuleId = DesktopModuleController.SaveDesktopModule(desktopModule, false, true);
                 if (desktopModuleId > Null.NullInteger)
                 {
                     DesktopModuleController.AddDesktopModuleToPortals(desktopModuleId);
                 }
                 break;
             case "SkinObject":
                 SkinControlInfo skinControl = new SkinControlInfo();
                 skinControl.PackageID = packageID;
                 skinControl.ControlKey = package.Name;
                 SkinControlController.SaveSkinControl(skinControl);
                 break;
         }
     }
     return packageID;
 }
Example #10
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// AddSkinControl adds a new Module Control to the system
        /// </summary>
        /// <remarks>
        /// </remarks>
        ///	<param name="ControlKey">The key for this control in the Definition</param>
        ///	<param name="ControlSrc">Te source of ths control</param>
        /// <history>
        /// [cnurse]	05/26/2008	created
        /// </history>
        /// -----------------------------------------------------------------------------
        private static void AddSkinControl(string ControlKey, string PackageName, string ControlSrc)
        {

            // check if skin control exists
            SkinControlInfo skinControl = SkinControlController.GetSkinControlByKey(ControlKey);
            if (skinControl == null)
            {
                PackageInfo package = new PackageInfo();
                package.Name = PackageName;
                package.FriendlyName = string.Concat(ControlKey, "SkinObject");
                package.PackageType = "SkinObject";
                package.Version = new Version(1, 0, 0);
                LegacyUtil.ParsePackageName(package);

                int PackageId = PackageController.AddPackage(package, false);

                skinControl = new SkinControlInfo();

                skinControl.PackageID = PackageId;
                skinControl.ControlKey = ControlKey;
                skinControl.ControlSrc = ControlSrc;
                skinControl.SupportsPartialRendering = false;

                SkinControlController.SaveSkinControl(skinControl);
            }
        }
Example #11
0
 public static void DeleteSkinControl(SkinControlInfo skinControl)
 {
     dataProvider.DeleteSkinControl(skinControl.SkinControlID);
     Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController();
     objEventLog.AddLog(skinControl, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINCONTROL_DELETED);
 }