Esempio n. 1
0
        public static RepositoryItem CreateFolder(long idFather, dtoFolderName dto, lm.Comol.Core.DomainModel.litePerson person, DateTime date, String ipAddress, String proxyIpAddress, RepositoryType type, Int32 idCommunity)
        {
            RepositoryItem folder = RepositoryItem.CreateBaseItem(idFather, ItemType.Folder, dto.Name, "", "", true, DisplayMode.downloadOrPlay, dto.IsVisible, person, date, ipAddress, proxyIpAddress, type, idCommunity);

            folder.AllowUpload = dto.AllowUpload;
            return(folder);
        }
Esempio n. 2
0
 public ItemAssignments(lm.Comol.Core.DomainModel.litePerson person, String ipAddress, String proxyIpAddress, DateTime?date = null)
 {
     CreateMetaInfo(person, ipAddress, proxyIpAddress, date);
 }
Esempio n. 3
0
        private static RepositoryItem CreateBaseItem(long idFather, ItemType itemType, String name, String extension, String url, Boolean isDownloadable, DisplayMode mode, Boolean isVisible, lm.Comol.Core.DomainModel.litePerson person, DateTime date, String ipAddress, String proxyIpAddress, RepositoryIdentifier identifier)
        {
            RepositoryItem item = new RepositoryItem();

            item.AllowUpload     = false;
            item.Availability    = ItemAvailability.available;
            item.CloneOf         = 0;
            item.CloneOfUniqueId = Guid.Empty;
            item.ContentType     = "";
            item.CreateMetaInfo(person.Id, ipAddress, proxyIpAddress, date);
            item.DeletedSize     = 0;
            item.Description     = "";
            item.DisplayMode     = mode;
            item.DisplayOrder    = 0;
            item.Downloaded      = 0;
            item.IdCommunity     = (identifier.Type == RepositoryType.Community) ? identifier.IdCommunity : 0;
            item.Repository      = identifier;
            item.IdFolder        = idFather;
            item.IsDownloadable  = isDownloadable;
            item.IsFile          = (itemType != ItemType.Folder);
            item.IsInternal      = false;
            item.UniqueId        = Guid.NewGuid();
            item.UniqueIdVersion = item.UniqueId;
            item.VersionsSize    = 0;
            item.Name            = name;
            item.Extension       = extension;
            item.Url             = url;
            item.IsVirtual       = false;
            item.IsVisible       = isVisible;
            item.Number          = 0;
            item.IdOwner         = person.Id;
            item.Size            = 0;
            item.Status          = ItemStatus.Active;
            item.Tags            = "";
            item.Thumbnail       = "";
            item.AutoThumbnail   = false;
            item.Type            = itemType;
            item.Module          = null;
            return(item);
        }
Esempio n. 4
0
 private static RepositoryItem CreateBaseItem(long idFather, ItemType itemType, String name, String extension, String url, Boolean isDownloadable, DisplayMode mode, Boolean isVisible, lm.Comol.Core.DomainModel.litePerson person, DateTime date, String ipAddress, String proxyIpAddress, RepositoryType type, Int32 idCommunity)
 {
     return(CreateBaseItem(idFather, itemType, name, extension, url, isDownloadable, mode, isVisible, person, date, ipAddress, proxyIpAddress, RepositoryIdentifier.Create(type, idCommunity)));
 }
Esempio n. 5
0
        private static RepositoryItem CreateBaseItem(long idFather, dtoUploadedItem dto, Boolean isDownloadable, DisplayMode mode, lm.Comol.Core.DomainModel.litePerson person, DateTime date, String ipAddress, String proxyIpAddress, RepositoryIdentifier identifier)
        {
            RepositoryItem item = RepositoryItem.CreateBaseItem(idFather, dto.Type, dto.Name, dto.Extension, "", isDownloadable, mode, dto.IsVisible, person, date, ipAddress, proxyIpAddress, identifier);

            item.UniqueId        = dto.UniqueId;
            item.UniqueIdVersion = dto.UniqueId;
            item.Size            = dto.Size;
            item.ContentType     = dto.ContentType;
            item.IsDownloadable  = isDownloadable;
            item.Type            = dto.Type;
            switch (dto.Type)
            {
            case ItemType.Multimedia:
            case ItemType.ScormPackage:
                item.Availability = ItemAvailability.transfer;
                item.Status       = ItemStatus.Active;
                break;

            default:
                item.Availability = ItemAvailability.available;
                item.Status       = ItemStatus.Active;
                break;
            }
            return(item);
        }
Esempio n. 6
0
 private static RepositoryItem CreateBaseItem(long idFather, dtoUploadedItem dto, Boolean isDownloadable, DisplayMode mode, lm.Comol.Core.DomainModel.litePerson person, DateTime date, String ipAddress, String proxyIpAddress, RepositoryType type, Int32 idCommunity)
 {
     return(CreateBaseItem(idFather, dto, isDownloadable, mode, person, date, ipAddress, proxyIpAddress, RepositoryIdentifier.Create(type, idCommunity)));
 }
Esempio n. 7
0
        public static RepositoryItem CreateFile(dtoUploadedItem dto, Boolean isDownloadable, DisplayMode mode, lm.Comol.Core.DomainModel.litePerson person, DateTime date, String ipAddress, String proxyIpAddress, RepositoryIdentifier identifier, Object obj, long idObject, Int32 idObjectType, Int32 idModule, String moduleCode, Int32 idModuleAjaxAction, Int32 idModuleAction = 0)
        {
            RepositoryItem item = RepositoryItem.CreateBaseItem(0, dto, isDownloadable, mode, person, date, ipAddress, proxyIpAddress, identifier.Type, identifier.IdCommunity);

            item.IsInternal                = true;
            item.Module                    = new ItemModuleSettings();
            item.Module.ModuleCode         = moduleCode;
            item.Module.IdObjectType       = idObjectType;
            item.Module.IdObject           = idObject;
            item.Module.IdModuleAction     = idModuleAction;
            item.Module.FullyQualifiedName = obj.GetType().FullName;
            item.Module.IdModuleAjaxAction = idModuleAjaxAction;
            return(item);
        }
Esempio n. 8
0
 public static RepositoryItem CreateFile(long idFather, dtoUploadedItem dto, Boolean isDownloadable, DisplayMode mode, lm.Comol.Core.DomainModel.litePerson person, DateTime date, String ipAddress, String proxyIpAddress, RepositoryIdentifier identifier)
 {
     return(RepositoryItem.CreateBaseItem(idFather, dto, isDownloadable, mode, person, date, ipAddress, proxyIpAddress, identifier));
 }
Esempio n. 9
0
 public static RepositoryItem CreateLink(long idFather, dtoUrlItem dto, lm.Comol.Core.DomainModel.litePerson person, DateTime date, String ipAddress, String proxyIpAddress, RepositoryType type, Int32 idCommunity)
 {
     return(RepositoryItem.CreateBaseItem(idFather, ItemType.Link, dto.Name, "", dto.Address, true, DisplayMode.downloadOrPlay, dto.IsVisible, person, date, ipAddress, proxyIpAddress, type, idCommunity));
 }
Esempio n. 10
0
        public dtoBaseRepositoryItem(liteRepositoryItem item, lm.Comol.Core.DomainModel.litePerson owner = null, lm.Comol.Core.DomainModel.litePerson modifiedBy = null, String unknownUser = "")
        {
            Id              = item.Id;
            Deleted         = item.Deleted;
            IdFolder        = item.IdFolder;
            UniqueId        = item.UniqueId;
            IdVersion       = item.IdVersion;
            UniqueIdVersion = item.UniqueIdVersion;
            IdCommunity     = item.IdCommunity;
            Type            = item.Type;
            Name            = item.Name;
            Extension       = item.Extension;
            Url             = item.Url;
            ContentType     = item.ContentType;
            IsFile          = item.IsFile;
            IdOwner         = item.IdOwner;


            if (owner == null || owner.TypeID == (int)lm.Comol.Core.DomainModel.UserTypeStandard.Guest)
            {
                OwnerName = unknownUser;
            }
            else
            {
                OwnerName = owner.SurnameAndName;
            }

            CreatedOn    = (item.CreatedOn.HasValue ? item.CreatedOn.Value : (item.ModifiedOn.HasValue ? item.ModifiedOn.Value : DateTime.Now));
            IdModifiedBy = item.IdModifiedBy;
            if (owner == null || owner.TypeID == (int)lm.Comol.Core.DomainModel.UserTypeStandard.Guest)
            {
                OwnerName = unknownUser;
            }
            else
            {
                OwnerName = owner.SurnameAndName;
            }
            ModifiedOn = item.ModifiedOn;
            if (modifiedBy == null || modifiedBy.TypeID == (int)lm.Comol.Core.DomainModel.UserTypeStandard.Guest)
            {
                ModifiedBy = unknownUser;
            }
            else
            {
                ModifiedBy = modifiedBy.SurnameAndName;
            }

            Size            = item.Size;
            VersionsSize    = item.VersionsSize;
            DeletedSize     = item.DeletedSize;
            Description     = item.Description;
            Tags            = item.Tags;
            IsDownloadable  = item.IsDownloadable;
            CloneOf         = item.CloneOf;
            CloneOfUniqueId = item.CloneOfUniqueId;
            Repository      = item.Repository;
            #region "Folder"
            AllowUpload = item.AllowUpload;
            FolderType  = (item.IsFile ? lm.Comol.Core.FileRepository.Domain.FolderType.none : Domain.FolderType.standard);
            #endregion
            #region "Visibility"
            IsVisible    = item.IsVisible;
            DisplayOrder = item.DisplayOrder;
            Availability = item.Availability;
            Status       = item.Status;
            #endregion
            #region "Special data"
            HasVersions     = item.HasVersions;
            RevisionsNumber = item.RevisionsNumber;
            DisplayMode     = item.DisplayMode;
            AutoThumbnail   = item.AutoThumbnail;
            Thumbnail       = item.Thumbnail;
            PreviewTime     = item.PreviewTime;
            Time            = item.Time;
            Number          = item.Number;
            #endregion
            IdPlayer   = item.IdPlayer;
            Downloaded = item.Downloaded;
            IsInternal = item.IsInternal;
            Module     = item.Module;
            IsVirtual  = item.IsVirtual;
        }
Esempio n. 11
0
 public dtoRepositoryItem(liteRepositoryItem item, dtoRepositoryItem father = null, lm.Comol.Core.DomainModel.litePerson owner = null, lm.Comol.Core.DomainModel.litePerson modifiedBy = null, String unknownUser = "")
     : base(item, owner, modifiedBy, unknownUser)
 {
     Children = new List <dtoRepositoryItem>();
     Father   = father;
 }