示例#1
0
        private void LookupLocation([NotNull] LoadLocationQuery message)
        {
            // first, generate Location from SharePoint object
            _log.Debug("Entered LocationActor-LookupLocation");

            var locations = new List <Location>();

            var location = message.Location;

            Location parent;

            if (location.Scope == Core.Models.Enums.Scope.Farm)
            {
                locations.AddRange(dataService.LoadFarmAndWebApps(out parent));
            }
            else
            {
                locations.AddRange(dataService.LoadNonFarmLocationAndChildren(location, out parent));
            }

            Sender.Tell(new Core.Messages.Tasks.LocationsLoaded(
                            message.TaskId,
                            parent,
                            locations));
        }
示例#2
0
        private void HandleLocationsLoaded([NotNull] LocationsLoaded message)
        {
            TrackLocationsProcessed(message);
#if DEBUG
            var dbgMsg = new FeatureAdmin.Messages.LogMessage(Core.Models.Enums.LogLevel.Debug,
                                                              string.Format("Debug Load progress: {0}", StatusReport)
                                                              );
            eventAggregator.PublishOnUIThread(dbgMsg);
#endif
            // if web apps are loaded, load children
            if (message.Parent.Scope == Enums.Scope.Farm)
            {
                foreach (Location l in message.ChildLocations)
                {
                    if (l.Scope == Enums.Scope.WebApplication)
                    {
                        // initiate read of locations
                        var loadWebAppChildren = new LoadLocationQuery(Id, l);
                        LoadTask(loadWebAppChildren);
                    }
                }
            }

            if (Preparations.Completed && FarmFeatureDefinitions.Completed)
            {
                // publish locations to wpf
                eventAggregator.PublishOnUIThread(message);
            }
            else
            {
                tempLocationStore.Add(message);
            }

            SendProgress();
        }
示例#3
0
        private void InitiateLoadTask(Location startLocation)
        {
            repository.Clear();

            // initiate read of all feature definitions
            var fdQuery = new LoadFeatureDefinitionQuery(Id);

            featureDefinitionActor.Tell(fdQuery);

            // initiate read of locations
            var loadQuery = new LoadLocationQuery(Id, startLocation);

            LoadTask(loadQuery);
        }
示例#4
0
        private void HandlyLoadLocationQuery([NotNull] LoadLocationQuery message)
        {
            _log.Debug("Entered LocationActor-LookupLocationHandlyLoadLocationQuery");

            var location = message.Location;

            if (location.Scope == Core.Models.Enums.Scope.Farm)
            {
                Sender.Tell(dataService.LoadFarmAndWebApps());
            }
            else
            {
                Sender.Tell(dataService.LoadNonFarmLocationAndChildren(location));
            }
        }
示例#5
0
        private void InitiateLoadTask(Location startLocation)
        {
            // initiate clean all feature definition and location collections
            var clearMessage = new ClearItems(Id);

            eventAggregator.PublishOnUIThread(clearMessage);

            // initiate read of all feature definitions
            var fdQuery = new LoadFeatureDefinitionQuery(Id);

            featureDefinitionActor.Tell(fdQuery);

            // initiate read of locations
            var loadQuery = new LoadLocationQuery(Id, startLocation);

            LoadTask(loadQuery);
        }
示例#6
0
        private void LoadTask([NotNull] LoadLocationQuery loadQuery)
        {
            _log.Debug("Entered LoadTask");

            var locationId = loadQuery.Location.Id;

            if (!locationActors.ContainsKey(locationId))
            {
                IActorRef newLocationActor =
                    Context.ActorOf(Context.DI().Props <LocationActor>());

                locationActors.Add(locationId, newLocationActor);

                newLocationActor.Tell(loadQuery);
            }
            else
            {
                locationActors[locationId].Tell(loadQuery);
            }
        }
示例#7
0
        private void LookupLocation([NotNull] LoadLocationQuery message)
        {
            // first, generate Location from SharePoint object
            _log.Debug("Entered LocationActor-LookupLocation");

            var location = message.Location;

            Core.Messages.Tasks.LocationsLoaded loadedMessage;

            if (location.Scope == Core.Models.Enums.Scope.Farm)
            {
                loadedMessage = dataService.LoadFarmAndWebApps();
            }
            else
            {
                loadedMessage = dataService.LoadNonFarmLocationAndChildren(location);
            }

            Sender.Tell(loadedMessage);
        }
示例#8
0
        private void HandleLocationsLoaded([NotNull] LocationsLoaded message)
        {
            TrackLocationsProcessed(message);

            // if web apps are loaded, load children
            if (message.Parent.Scope == Enums.Scope.Farm)
            {
                foreach (Location l in message.ChildLocations)
                {
                    if (l.Scope == Enums.Scope.WebApplication)
                    {
                        // initiate read of locations
                        var loadWebAppChildren = new LoadLocationQuery(Id, l);
                        LoadTask(loadWebAppChildren);
                    }
                }
            }

            repository.AddLoadedLocations(message);

            SendProgress();
        }