Пример #1
0
 public MapSession(IMapObjects mapObjects)
     : this()
 {
     Id         = Guid.NewGuid();
     IsNew      = true;
     MapObjects = mapObjects;
 }
Пример #2
0
        public SPGlymaUser(SPWeb web, IMapObjects mapObjectBootstrapper)
        {
            Web = web;
            MapObjectBootstrapper = mapObjectBootstrapper;

            if (web.Properties.ContainsKey("Glyma.SecurityDatabaseServer") && web.Properties.ContainsKey("Glyma.SecurityDatabaseName") && web.Properties.ContainsKey("Glyma.SecurableContextId"))
            {
                SecurityDatabaseServer = web.Properties["Glyma.SecurityDatabaseServer"];
                SecurityDatabaseName   = web.Properties["Glyma.SecurityDatabaseName"];
                SecurableContextId     = int.Parse(web.Properties["Glyma.SecurableContextId"]);
            }

            using (SecurityDBDataContext dataContext = new SecurityDBDataContext(Connection))
            {
                var securableContext = (from dcSecurableContext in dataContext.SecurableContexts
                                        where dcSecurableContext.SecurableContextId == SecurableContextId
                                        select dcSecurableContext).FirstOrDefault();

                if (securableContext == null)
                {
                    return;
                }

                SecurableContextName = securableContext.SecurableContextName;
                SecurableContextUid  = securableContext.SecurableContextUid;
            }
        }
Пример #3
0
 public MapTransactionWrapper(IMapObjects mapObjects)
     : this()
 {
     MapObjects                = mapObjects;
     Core.SessionUid           = MapObjects.Session.Id;
     Core.User                 = MapObjects.Session.User;
     Core.TransactionTimestamp = DateTime.Now;
 }
Пример #4
0
        public void LoadNodeRecord(IMapObjects mapObjects, IDataReader record)
        {
            if (record["MapNodeUid"] != null && record["MapNodeUid"] != DBNull.Value)
            {
                MapNodeUid = (Guid)record["MapNodeUid"];
            }

            if (record["NodeUid"] != null && record["NodeUid"] != DBNull.Value)
            {
                NodeUid = (Guid)record["NodeUid"];
            }

            if (record["NodeOriginalId"] != null && record["NodeOriginalId"] != DBNull.Value)
            {
                NodeOriginalId = (string)record["NodeOriginalId"];
            }

            if (record["NodeTypeUid"] != null && record["NodeTypeUid"] != DBNull.Value)
            {
                NodeTypeUid = (Guid)record["NodeTypeUid"];
            }

            if (record["DomainUid"] != null && record["DomainUid"] != DBNull.Value)
            {
                DomainUid = (Guid)record["DomainUid"];
            }

            if (record["RootMapUid"] != null && record["RootMapUid"] != DBNull.Value)
            {
                RootMapUid = (Guid)record["RootMapUid"];
            }

            if (record["Created"] != null && record["Created"] != DBNull.Value)
            {
                Created = (DateTime)record["Created"];
            }

            if (record["Modified"] != null && record["Modified"] != DBNull.Value)
            {
                Modified = (DateTime)record["Modified"];
            }

            if (record["CreatedBy"] != null && record["CreatedBy"] != DBNull.Value)
            {
                CreatedByLogin = (string)record["CreatedBy"];

                CreatedBy = mapObjects.FindUsersName(CreatedByLogin);
            }

            if (record["ModifiedBy"] != null && record["ModifiedBy"] != DBNull.Value)
            {
                ModifiedByLogin = (string)record["ModifiedBy"];

                ModifiedBy = mapObjects.FindUsersName(ModifiedByLogin);
            }
        }
Пример #5
0
 public SessionFinalisation(IMapObjects mapObjects, Guid sessionId)
 {
     MapObjects = mapObjects;
     SessionId = sessionId;
 }
Пример #6
0
        public MapSchema(IMapObjects mapObjects)
        {
            MapObjects = mapObjects;

            LoadTypesFromDb();
        }
Пример #7
0
 public QueryNodes(IMapObjects mapObjects)
 {
     MapObjects = mapObjects;
 }
Пример #8
0
 public CreateRootMap(IMapObjects mapObjects)
 {
     MapObjects = mapObjects;
 }
Пример #9
0
 public MapParameters(IMapObjects mapObjects)
     : this()
 {
     MapObjects = mapObjects;
 }
Пример #10
0
        public void LoadNodeRecord(IMapObjects mapObjects, IDataReader record)
        {
            if (record["MapNodeUid"] != null && record["MapNodeUid"] != DBNull.Value)
            {
                MapNodeUid = (Guid)record["MapNodeUid"];
            }

            if (record["NodeUid"] != null && record["NodeUid"] != DBNull.Value)
            {
                NodeUid = (Guid)record["NodeUid"];
            }

            if (record["NodeOriginalId"] != null && record["NodeOriginalId"] != DBNull.Value)
            {
                NodeOriginalId = (string)record["NodeOriginalId"];
            }

            if (record["NodeTypeUid"] != null && record["NodeTypeUid"] != DBNull.Value)
            {
                NodeTypeUid = (Guid)record["NodeTypeUid"];
            }

            if (record["DomainUid"] != null && record["DomainUid"] != DBNull.Value)
            {
                DomainUid = (Guid)record["DomainUid"];
            }

            if (record["RootMapUid"] != null && record["RootMapUid"] != DBNull.Value)
            {
                RootMapUid = (Guid)record["RootMapUid"];
            }

            if (record["Created"] != null && record["Created"] != DBNull.Value)
            {
                Created = (DateTime)record["Created"];
            }

            if (record["Modified"] != null && record["Modified"] != DBNull.Value)
            {
                Modified = (DateTime)record["Modified"];
            }

            if (record["CreatedBy"] != null && record["CreatedBy"] != DBNull.Value)
            {
                CreatedByLogin = (string)record["CreatedBy"];

                CreatedBy = mapObjects.FindUsersName(CreatedByLogin);
            }

            if (record["ModifiedBy"] != null && record["ModifiedBy"] != DBNull.Value)
            {
                ModifiedByLogin = (string)record["ModifiedBy"];

                ModifiedBy = mapObjects.FindUsersName(ModifiedByLogin);
            }
        }
Пример #11
0
 public CreateRootMap(IMapObjects mapObjects)
 {
     MapObjects = mapObjects;
 }
Пример #12
0
        public void AddMetadataRecord(IMapObjects mapObjects, IDataReader record)
        {
            if (record["NodeUid"] != null && record["NodeUid"] != DBNull.Value)
            {
                DateTime?metadataCreated         = null;
                DateTime?metadataModified        = null;
                string   metadataCreatedBy       = null;
                string   metadataModifiedBy      = null;
                string   metadataCreatedByLogin  = null;
                string   metadataModifiedByLogin = null;

                if (record["Created"] != null && record["Created"] != DBNull.Value)
                {
                    metadataCreated = (DateTime)record["Created"];
                }

                if (record["Modified"] != null && record["Modified"] != DBNull.Value)
                {
                    metadataModified = (DateTime)record["Modified"];
                }

                if (Created > metadataCreated)
                {
                    if (record["CreatedBy"] != null && record["CreatedBy"] != DBNull.Value)
                    {
                        metadataCreatedByLogin = (string)record["CreatedBy"];

                        metadataCreatedBy = mapObjects.FindUsersName(metadataCreatedByLogin);
                    }

                    if (!string.IsNullOrEmpty(metadataCreatedByLogin))
                    {
                        Created        = metadataCreated;
                        CreatedBy      = metadataCreatedBy;
                        CreatedByLogin = metadataCreatedByLogin;
                    }
                }

                if (Modified < metadataModified)
                {
                    if (record["ModifiedBy"] != null && record["ModifiedBy"] != DBNull.Value)
                    {
                        metadataModifiedByLogin = (string)record["ModifiedBy"];

                        metadataModifiedBy = mapObjects.FindUsersName(metadataModifiedByLogin);
                    }

                    if (!string.IsNullOrEmpty(metadataModifiedByLogin))
                    {
                        Modified        = metadataModified;
                        ModifiedBy      = metadataModifiedBy;
                        ModifiedByLogin = metadataModifiedByLogin;
                    }
                }

                if (record["MetadataName"] != null && record["MetadataName"] != DBNull.Value)
                {
                    string metadataName = (string)record["MetadataName"];

                    if (record["MetadataValue"] != null & record["MetadataValue"] != DBNull.Value)
                    {
                        string metadataValue = (string)record["MetadataValue"];

                        Metadata[metadataName] = metadataValue;
                    }
                    else
                    {
                        Metadata[metadataName] = null;
                    }
                }
            }
        }
Пример #13
0
 public SessionFinalisation(IMapObjects mapObjects, Guid sessionId)
 {
     MapObjects = mapObjects;
     SessionId  = sessionId;
 }
Пример #14
0
 public MapSession(IMapObjects mapObjects, Guid sessionId)
     : this(mapObjects)
 {
     Id    = sessionId;
     IsNew = false;
 }
Пример #15
0
        public MapSchema(IMapObjects mapObjects)
        {
            MapObjects = mapObjects;

            LoadTypesFromDb();
        }
Пример #16
0
        public void AddMetadataRecord(IMapObjects mapObjects, IDataReader record)
        {
            if (record["NodeUid"] != null && record["NodeUid"] != DBNull.Value)
            {
                DateTime? metadataCreated = null;
                DateTime? metadataModified = null;
                string metadataCreatedBy = null;
                string metadataModifiedBy = null;
                string metadataCreatedByLogin = null;
                string metadataModifiedByLogin = null;

                if (record["Created"] != null && record["Created"] != DBNull.Value)
                {
                    metadataCreated = (DateTime)record["Created"];
                }

                if (record["Modified"] != null && record["Modified"] != DBNull.Value)
                {
                    metadataModified = (DateTime)record["Modified"];
                }

                if (Created > metadataCreated)
                {
                    if (record["CreatedBy"] != null && record["CreatedBy"] != DBNull.Value)
                    {
                        metadataCreatedByLogin = (string)record["CreatedBy"];

                        metadataCreatedBy = mapObjects.FindUsersName(metadataCreatedByLogin);
                    }

                    if (!string.IsNullOrEmpty(metadataCreatedByLogin))
                    {
                        Created = metadataCreated;
                        CreatedBy = metadataCreatedBy;
                        CreatedByLogin = metadataCreatedByLogin;
                    }
                }

                if (Modified < metadataModified)
                {
                    if (record["ModifiedBy"] != null && record["ModifiedBy"] != DBNull.Value)
                    {
                        metadataModifiedByLogin = (string)record["ModifiedBy"];

                        metadataModifiedBy = mapObjects.FindUsersName(metadataModifiedByLogin);
                    }

                    if (!string.IsNullOrEmpty(metadataModifiedByLogin))
                    {
                        Modified = metadataModified;
                        ModifiedBy = metadataModifiedBy;
                        ModifiedByLogin = metadataModifiedByLogin;
                    }
                }

                if (record["MetadataName"] != null && record["MetadataName"] != DBNull.Value)
                {
                    string metadataName = (string)record["MetadataName"];

                    if (record["MetadataValue"] != null & record["MetadataValue"] != DBNull.Value)
                    {
                        string metadataValue = (string)record["MetadataValue"];

                        Metadata[metadataName] = metadataValue;
                    }
                    else
                    {
                        Metadata[metadataName] = null;
                    }
                }
            }
        }
Пример #17
0
 public QueryNodes(IMapObjects mapObjects)
 {
     MapObjects = mapObjects;
 }
Пример #18
0
 public MapParameters(IMapObjects mapObjects)
     : this()
 {
     MapObjects = mapObjects;
 }