Example #1
0
 public void PerformBeforeStoreUpdate()
 {
     if (ReferenceToInformation == null)
     {
         ReferenceToInformation = OIP.ReferenceToInformation.CreateDefault();
     }
     this.ReferenceToInformation.Title              = this.Title;
     ReferenceToInformation.URL                     = DefaultViewSupport.GetDefaultViewURL(this);
     this.LocationCollection.IsCollectionFiltered   = true;
     this.CategoryCollection.IsCollectionFiltered   = true;
     this.ImageGroupCollection.IsCollectionFiltered = true;
     if (Excerpt == null)
     {
         Excerpt = "";
     }
     if (Excerpt.Length > 200)
     {
         Excerpt = Excerpt.Substring(0, 200);
     }
     SetProfileImageAsFeaturedImage();
     if (Published == default(DateTime))
     {
         Published = DateTime.UtcNow.Date;
     }
 }
Example #2
0
 public void PerformBeforeStoreUpdate()
 {
     if (ReferenceToInformation == null)
     {
         ReferenceToInformation = OIP.ReferenceToInformation.CreateDefault();
     }
     this.ReferenceToInformation.Title = this.Title;
     ReferenceToInformation.URL        = DefaultViewSupport.GetDefaultViewURL(this);
 }
Example #3
0
 public void PerformBeforeStoreUpdate()
 {
     if (ReferenceToInformation == null)
     {
         ReferenceToInformation = OIP.ReferenceToInformation.CreateDefault();
     }
     this.ReferenceToInformation.Title = this.Title;
     ReferenceToInformation.URL        = DefaultViewSupport.GetDefaultViewURL(this);
     FeaturedImage = ImagesCollection.CollectionContent.FirstOrDefault();
 }
Example #4
0
        public bool PerformAddOperation(string commandName, InformationSourceCollection sources, string requesterLocation, HttpFileCollection files)
        {
            if (ImageTitle == "")
            {
                throw new InvalidDataException("Image title is mandatory");
            }
            //IInformationObject container = sources.GetDefaultSource().RetrieveInformationObject();
            Image        image = Image.CreateDefault();
            VirtualOwner owner = VirtualOwner.FigureOwner(this);

            image.SetLocationAsOwnerContent(owner, image.ID);
            image.Title = ImageTitle;
            StorageSupport.StoreInformationMasterFirst(image, owner, true);
            DefaultViewSupport.CreateDefaultViewRelativeToRequester(requesterLocation, image, owner);
            return(true);
        }
Example #5
0
 public void PerformBeforeStoreUpdate()
 {
     if (ReferenceToInformation == null)
     {
         ReferenceToInformation = ReferenceToInformation.CreateDefault();
     }
     ReferenceToInformation.Title = this.Location.LocationName;
     ReferenceToInformation.URL   = DefaultViewSupport.GetDefaultViewURL(this);
     if (String.IsNullOrEmpty(Location.Latitude.TextValue))
     {
         Location.Latitude.TextValue = "0";
     }
     if (String.IsNullOrEmpty(Location.Longitude.TextValue))
     {
         Location.Longitude.TextValue = "0";
     }
 }
Example #6
0
        public bool PerformAddOperation(string commandName, InformationSourceCollection sources, string requesterLocation, HttpFileCollection files)
        {
            if (CategoryName == "")
            {
                throw new InvalidDataException("Category name is mandatory");
            }
            Category     category = new Category();
            VirtualOwner owner    = VirtualOwner.FigureOwner(this);

            category.SetLocationAsOwnerContent(owner, category.ID);
            category.CategoryName = CategoryName;
            StorageSupport.StoreInformationMasterFirst(category, owner, true);
            DefaultViewSupport.CreateDefaultViewRelativeToRequester(requesterLocation, category, owner);
            //BlogContainer blogContainer = BlogContainer.RetrieveFromOwnerContent(owner, "default");
            //blogContainer.AddNewBlogPost(blog);
            //StorageSupport.StoreInformation(blogContainer);
            CategoryName = "";
            return(true);
        }
Example #7
0
        public bool PerformAddOperation(string commandName, InformationSourceCollection sources, string requesterLocation, HttpFileCollection files)
        {
            if (ActivityName == "")
            {
                throw new InvalidDataException("Activity name is mandatory");
            }
            Activity     activity = Activity.CreateDefault();
            VirtualOwner owner    = VirtualOwner.FigureOwner(this);

            activity.SetLocationAsOwnerContent(owner, activity.ID);
            activity.ActivityName = ActivityName;
            activity.ReferenceToInformation.Title = activity.ActivityName;
            activity.ReferenceToInformation.URL   = DefaultViewSupport.GetDefaultViewURL(activity);
            StorageSupport.StoreInformationMasterFirst(activity, owner, true);
            DefaultViewSupport.CreateDefaultViewRelativeToRequester(requesterLocation, activity, owner);
            //ActivitySummaryContainer summaryContainer = ActivitySummaryContainer.RetrieveFromOwnerContent(owner, "default");
            //summaryContainer.AddNewActivity(activity);
            //StorageSupport.StoreInformation(summaryContainer);
            return(true);
        }
Example #8
0
        public bool PerformAddOperation(string commandName, InformationSourceCollection sources, string requesterLocation, HttpFileCollection files)
        {
            if (Title == "")
            {
                throw new InvalidDataException("Blog title is mandatory");
            }
            Blog         blog  = Blog.CreateDefault();
            VirtualOwner owner = VirtualOwner.FigureOwner(this);

            blog.SetLocationAsOwnerContent(owner, blog.ID);
            blog.Title = Title;
            blog.ReferenceToInformation.Title = blog.Title;
            blog.ReferenceToInformation.URL   = DefaultViewSupport.GetDefaultViewURL(blog);
            blog.Published = DateTime.Now;
            StorageSupport.StoreInformationMasterFirst(blog, owner, true);
            DefaultViewSupport.CreateDefaultViewRelativeToRequester(requesterLocation, blog, owner);
            //BlogContainer blogContainer = BlogContainer.RetrieveFromOwnerContent(owner, "default");
            //blogContainer.AddNewBlogPost(blog);
            //StorageSupport.StoreInformation(blogContainer);
            Title = "";
            return(true);
        }
Example #9
0
 public void PerformBeforeStoreUpdate()
 {
     if (ReferenceToInformation == null)
     {
         ReferenceToInformation = OIP.ReferenceToInformation.CreateDefault();
     }
     ReferenceToInformation.Title = this.ActivityName;
     ReferenceToInformation.URL   = DefaultViewSupport.GetDefaultViewURL(this);
     this.LocationCollection.IsCollectionFiltered   = true;
     this.CategoryCollection.IsCollectionFiltered   = true;
     this.ImageGroupCollection.IsCollectionFiltered = true;
     if (Excerpt == null)
     {
         Excerpt = "";
     }
     if (Excerpt.Length > 200)
     {
         Excerpt = Excerpt.Substring(0, 200);
     }
     if (this.StartingTime == default(DateTime))
     {
         StartingTime = DateTime.UtcNow.Date;
     }
 }
Example #10
0
        public bool PerformAddOperation(string commandName, InformationSourceCollection sources, string requesterLocation, HttpFileCollection files)
        {
            if (LocationName == "")
            {
                throw new InvalidDataException("Location name is mandatory");
            }
            //IInformationObject container = sources.GetDefaultSource().RetrieveInformationObject();
            AddressAndLocation location = AddressAndLocation.CreateDefault();

            VirtualOwner owner = VirtualOwner.FigureOwner(this);

            location.SetLocationAsOwnerContent(owner, location.ID);
            location.Location.LocationName        = LocationName;
            location.ReferenceToInformation.Title = location.Location.LocationName;
            location.ReferenceToInformation.URL   = DefaultViewSupport.GetDefaultViewURL(location);
            StorageSupport.StoreInformationMasterFirst(location, owner, true);
            DefaultViewSupport.CreateDefaultViewRelativeToRequester(requesterLocation, location, owner);

            //LocationContainer locationContainer = LocationContainer.RetrieveFromOwnerContent(owner, "Locations");
            //// Referencelocation etag in place
            //location.MasterETag = location.ETag;
            //locationContainer.Locations.CollectionContent.Add(location);
            //StorageSupport.StoreInformation(locationContainer);

            //AccountContainer accountContainer = container as AccountContainer;
            //GroupContainer groupContainer = container as GroupContainer;
            //if (accountContainer != null)
            //{
            //    accountContainer.AccountModule.LocationCollection.CollectionContent.Add(location);
            //} else if(groupContainer != null)
            //{
            //    //groupContainer.Locations.CollectionContent.Add(location);
            //}
            //StorageSupport.StoreInformation(container);
            return(true);

            /*
             * location.Address = Address;
             * location.Location.Longitude.TextValue = this.Longitude;
             * location.Location.Latitude.TextValue = this.Latitude;
             * location.Location.LocationName = this.LocationName;
             * container.AccountModule.LocationCollection.CollectionContent.Add(location);
             * StorageSupport.StoreInformation(container);
             * VirtualOwner owner = VirtualOwner.FigureOwner(this);
             * MapContainer mapContainer = MapContainer.RetrieveFromOwnerContent(owner, "default");
             * mapContainer.MapMarkers.CollectionContent.Clear();
             * mapContainer.MapMarkers.CollectionContent.AddRange(
             *  container.AccountModule.LocationCollection.CollectionContent.
             *      Select(loc =>
             *                 {
             *                     MapMarker marker = MapMarker.CreateDefault();
             *                     marker.Location = loc.Location;
             *                     marker.LocationText = string.Format("{0},{1}",
             *                                                         loc.Location.Latitude.TextValue,
             *                                                         loc.Location.Longitude.TextValue);
             *                     return marker;
             *                 }));
             * StorageSupport.StoreInformation(mapContainer);
             * LocationName = "";
             * Address = StreetAddress.CreateDefault();
             * Longitude = "";
             * Latitude = "";
             */
            return(true);
        }