Exemple #1
0
        public static void Initialize()
        {
            try
            {
                // Remove current symlinks
                //SNDK.IO.RemoveSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_html) + "sxul");

                // Create symlinks
                //SNDK.IO.CreateSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sXUL/resources/html", SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_html) + "sxul");

                // Create default usergroups
                UsergroupUser =	SorentoLib.Usergroup.AddBuildInUsergroup (new Guid ("cee43668-e44b-4675-b18d-3b297a84b953"), "sXUL User");
                UsergroupModerator = SorentoLib.Usergroup.AddBuildInUsergroup (new Guid ("f54caf98-59ad-4082-b235-0d7965dd1816"), "sXUL Moderator");
                UsergroupEditor = SorentoLib.Usergroup.AddBuildInUsergroup (new Guid ("90a8ab5f-5353-416f-b245-4ad568330927"), "sXUL Editor");
                UsergroupAuthor = SorentoLib.Usergroup.AddBuildInUsergroup (new Guid ("573e0d91-3bee-490f-b400-6ea0ad7b5470"), "sCMS Author");
                UsergroupAdministrator = SorentoLib.Usergroup.AddBuildInUsergroup (new Guid ("6321156a-ff6a-4e01-a5bd-87e904baa45f"), "sCMS Administrator");

                // GARBAGE COLLECTOR
                SorentoLib.Services.Events.ServiceGarbageCollector += EventhandlerServiceGarbageCollector;

            }
            catch (Exception exception)
            {
                // LOG: LogDebug.ExceptionUnknown
                SorentoLib.Services.Logging.LogDebug (string.Format (SorentoLib.Strings.LogDebug.ExceptionUnknown, "SXUL.INITIALIZE", exception.Message));
            }
        }
Exemple #2
0
        public static void Initialize()
        {
            try
            {
                // Remove current symlinks
                //SNDK.IO.RemoveSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_html) + "sxul");

                // Create symlinks
                //SNDK.IO.CreateSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sXUL/resources/html", SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_html) + "sxul");

                // Create default usergroups
                UsergroupUser          = SorentoLib.Usergroup.AddBuildInUsergroup(new Guid("cee43668-e44b-4675-b18d-3b297a84b953"), "sXUL User");
                UsergroupModerator     = SorentoLib.Usergroup.AddBuildInUsergroup(new Guid("f54caf98-59ad-4082-b235-0d7965dd1816"), "sXUL Moderator");
                UsergroupEditor        = SorentoLib.Usergroup.AddBuildInUsergroup(new Guid("90a8ab5f-5353-416f-b245-4ad568330927"), "sXUL Editor");
                UsergroupAuthor        = SorentoLib.Usergroup.AddBuildInUsergroup(new Guid("573e0d91-3bee-490f-b400-6ea0ad7b5470"), "sCMS Author");
                UsergroupAdministrator = SorentoLib.Usergroup.AddBuildInUsergroup(new Guid("6321156a-ff6a-4e01-a5bd-87e904baa45f"), "sCMS Administrator");

                // GARBAGE COLLECTOR
                SorentoLib.Services.Events.ServiceGarbageCollector += EventhandlerServiceGarbageCollector;
            }
            catch (Exception exception)
            {
                // LOG: LogDebug.ExceptionUnknown
                SorentoLib.Services.Logging.LogDebug(string.Format(SorentoLib.Strings.LogDebug.ExceptionUnknown, "SXUL.INITIALIZE", exception.Message));
            }
        }
Exemple #3
0
        public static void Initalize()
        {
            SorentoLib.Runtime.WatchApplicationFiles ();

            UsergroupGuest = Usergroup.AddBuildInUsergroup (new Guid ("2b46cce5-0234-4fb7-a226-acc676a093c9"), "Guest");
            UsergroupUser = Usergroup.AddBuildInUsergroup (new Guid ("476b824f-86a1-4d8d-baff-f341b110ef08"), "User");
            UsergroupModerator = Usergroup.AddBuildInUsergroup (new Guid ("76b80364-bc8f-4177-8c08-26697ac8dfbd"), "Moderator");
            UsergroupAuthor =	Usergroup.AddBuildInUsergroup (new Guid ("8016152c-bb4c-4af0-ad4e-8867f196e334"), "Author");
            UsergroupEditor =	Usergroup.AddBuildInUsergroup (new Guid ("c7be09c5-e23f-4a9f-b218-28b982299a54"), "Editor");
            UsergroupAdministrator = Usergroup.AddBuildInUsergroup (new Guid ("c76e32de-7e4c-4152-868f-e450d0a6c145"), "Administrator");

            // Subscribe to events.
            SorentoLib.Services.Events.ServiceConfigChanged += EventhandlerServiceConfigChanged;
            SorentoLib.Services.Events.ServiceGarbageCollector += EventhandlerServiceGarbageCollector;
            SorentoLib.Services.Events.ServiceStatsUpdate += EventhandlerServiceStatsUpdate;

            // Initalize Addins who needs it.
            foreach (SorentoLib.Addins.IInit init in AddinManager.GetExtensionObjects (typeof(SorentoLib.Addins.IInit)))
            {
            }
        }
Exemple #4
0
        public static Usergroup Load(Guid id)
        {
            Usergroup result = Usergroup.BuiltInUsergroups.Find (delegate (Usergroup u) { return u.Id == id;});

            if (result == null)
            {
                try
                {
                    Hashtable item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (Services.Datastore.Get<XmlDocument> (DatastoreAisle, id.ToString ()).SelectSingleNode ("(//sorentolib.usergroup)[1]")));
                    result = new Usergroup ();

                    result._id = new Guid ((string)item["id"]);

                    if (item.ContainsKey ("createtimestamp"))
                    {
                        result._createtimestamp = int.Parse ((string)item["createtimestamp"]);
                    }

                    if (item.ContainsKey ("updatetimestamp"))
                    {
                        result._updatetimestamp = int.Parse ((string)item["updatetimestamp"]);
                    }

                    if (item.ContainsKey ("type"))
                    {
                        result._type = SNDK.Convert.StringToEnum<SorentoLib.Enums.UsergroupType> ((string)item["type"]);
                    }

                    if (item.ContainsKey ("name"))
                    {
                        result._name = (string)item["name"];
                    }

                    if (item.ContainsKey ("status"))
                    {
                        result._status = SNDK.Convert.StringToEnum<SorentoLib.Enums.UsergroupStatus> ((string)item["status"]);
                    }

                    if (item.ContainsKey ("scope"))
                    {
                        result._scope = (string)item["scope"];
                    }
                }
                catch (Exception exception)
                {
                    // LOG: LogDebug.ExceptionUnknown
                    Services.Logging.LogDebug (string.Format (Strings.LogDebug.ExceptionUnknown, "SORENTOLIB.USER", exception.Message));

                    // EXCEPTION: Excpetion.UsergroupLoad
                    throw new Exception (string.Format (Strings.Exception.UsergroupLoad, id));
                }
            }

            return result;
        }
Exemple #5
0
        public static Usergroup FromXmlDocument(XmlDocument xmlDocument)
        {
            Hashtable item;
            Usergroup result;

            try
            {
                item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (xmlDocument.SelectSingleNode ("(//sorentolib.usergroup)[1]")));
            }
            catch
            {
                item = (Hashtable)SNDK.Convert.FromXmlDocument (xmlDocument);
            }

            if (item.ContainsKey ("id"))
            {
                try
                {
                    result = Usergroup.Load (new Guid ((string)item["id"]));
                }
                catch
                {
                    result = new Usergroup ();
                    result._id = new Guid ((string)item["id"]);
                }
            }
            else
            {
                // EXCEPTION: Exception.UsergroupFromXMLDocument
                throw new Exception (Strings.Exception.UsergroupFromXMLDocument);
            }

            if (item.ContainsKey ("type"))
            {
                result._type = SNDK.Convert.StringToEnum<SorentoLib.Enums.UsergroupType> ((string)item["type"]);
            }

            if (item.ContainsKey ("name"))
            {
                result._name = (string)item["name"];
            }

            if (item.ContainsKey ("status"))
            {
                result._status = SNDK.Convert.StringToEnum<SorentoLib.Enums.UsergroupStatus> ((string)item["status"]);
            }

            if (item.ContainsKey ("scope"))
            {
                result._scope = (string)item["scope"];
            }

            return result;
        }
Exemple #6
0
        public static void Initialize()
        {
            try
            {
                // Set defaults
                SetDefaults ();

                sConsole.Menu.AddCategory ("scms", "Content Management", 10);
                sConsole.Menu.AddItem ("scms", "content", "Content", "/scms/content/", 1);
                sConsole.Menu.AddItem ("scms", "styling", "Construction", "/scms/construction/", 2);
                sConsole.Menu.AddItem ("scms", "settings", "Settings", "/scms/settings/", 3);

                // Remove current symlinks
                SNDK.IO.RemoveSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sConsole/resources/content/scms");
                SNDK.IO.RemoveSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sConsole/resources/includes/scms");
                SNDK.IO.RemoveSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sConsole/resources/xml/scms");

                // Create symlinks
                SNDK.IO.CreateSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sCMS/resources/content", SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sConsole/resources/content/scms");
                SNDK.IO.CreateSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sCMS/resources/htdocs", SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sConsole/resources/includes/scms");
                SNDK.IO.CreateSymlink (SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sCMS/resources/xml", SorentoLib.Services.Config.Get<string> (SorentoLib.Enums.ConfigKey.path_addins) + "sConsole/resources/xml/scms");

                Include.Add (sConsole.Enums.IncludeType.Javascript, "/includes/scms/js/scms.js", "SCMS", 101);
                Include.Add (sConsole.Enums.IncludeType.Javascript, "/includes/sndk/includes/codemirror/mode/css/css.js", "SCMS", 101);
                Include.Add (sConsole.Enums.IncludeType.Javascript, "/includes/sndk/includes/codemirror/mode/javascript/javascript.js", "SCMS", 101);
                Include.Add (sConsole.Enums.IncludeType.Javascript, "/includes/sndk/includes/codemirror/mode/htmlmixed/htmlmixed.js", "SCMS", 101);
                Include.Add (sConsole.Enums.IncludeType.Javascript, "/includes/sndk/includes/codemirror/mode/xml/xml.js", "SCMS", 101);

                Include.Add (sConsole.Enums.IncludeType.Javascript, "/includes/sndk/includes/tinymce/tiny_mce.js", "SCMS", 101);

                // Set default usergroups
            //			UsergroupGuest = Usergroup.AddBuildInUsergroup (new Guid ("10de93c3-4d70-445a-8457-97beefd6809d"), "sCMS Guest");
            //			UsergroupUser = Usergroup.AddBuildInUsergroup (new Guid ("50176827-ae08-42cf-aefb-2db768a9b9e1"), "sCMS User");
            //			UsergroupModerator = Usergroup.AddBuildInUsergroup (new Guid ("a9754690-646c-4971-96cd-ba16716dcfe4"), "sCMS Moderator");
                UsergroupEditor =	Usergroup.AddBuildInUsergroup (new Guid ("a0a2cf36-fa74-43a7-8f5f-34aa837cccef"), "sCMS Editor");
                UsergroupAuthor =	Usergroup.AddBuildInUsergroup (new Guid ("20e8185e-18a2-4178-a99a-157c2a360426"), "sCMS Author");
                UsergroupAdministrator = Usergroup.AddBuildInUsergroup (new Guid ("3b9ca3c0-67e9-4750-aacf-51b8faa4527f"), "sCMS Administrator");

                // Create default media

            //				string xml = "<sorentolib.media>" +
            //					"<id type=\"string\">" +
            //						"<![CDATA[2d5ac75f-8438-4bca-b45a-5e2c4ade613e]]>" +
            //					"</id>" +
            //					"<type type=\"string\">" +
            //						"<![CDATA[Public]]>" +
            //					"</type>" +
            //					"<mimetype type=\"string\">" +
            //						"<![CDATA[image/svg+xml]]>" +
            //					"</mimetype>" +
            //					"<path type=\"string\">" +
            //						"<![CDATA[console/includes/scms/css/images/icons/process-stop.svg]]>" +
            //					"</path>	" +
            //					"</sorentolib.media>";
            //
            //				DefaultMedia = Media.FromXmlDocument (SNDK.Convert.StringToXmlDocument (xml));

                // GARBAGE COLLECTOR
                SorentoLib.Services.Events.ServiceGarbageCollector += EventhandlerServiceGarbageCollector;

            }
            catch (Exception exception)
            {
                // LOG: LogDebug.ExceptionUnknown
                SorentoLib.Services.Logging.LogDebug (string.Format (SorentoLib.Strings.LogDebug.ExceptionUnknown, "SCMS.INITIALIZE", exception.Message));
            }
        }
Exemple #7
0
 public bool Authenticate(Usergroup usergroup)
 {
     return Authenticate (usergroup.Id);
 }