示例#1
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);
        }
示例#2
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);
        }
示例#3
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);
        }
示例#4
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);
        }
示例#5
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);
        }