public override void Bind(IEditorService service)
        {
            service.RegisterCustomNotifier(this);
            try
            {
                _fsvc = (IFusionService)service.GetService((int)ServiceType.Fusion);
                if (service.CurrentConnection.ProviderName.ToUpper() == "MAESTRO.HTTP")
                {
                    _baseUrl = service.GetCustomProperty("BaseUrl").ToString(); //NOXLATE

                    if (!_baseUrl.EndsWith("/"))                                //NOXLATE
                    {
                        _baseUrl += "/";                                        //NOXLATE
                    }
                }
            }
            catch
            {
                throw new NotSupportedException(Strings.IncompatibleConnection);
            }
            _edsvc = service;
            _edsvc.RegisterCustomNotifier(this);
            _flexLayout = (IApplicationDefinition)service.GetEditedResource();

            foreach (var grp in _flexLayout.MapSet.MapGroups)
            {
                AddMap(grp);
            }
        }
Ejemplo n.º 2
0
        public override void Bind(IEditorService service)
        {
            _edsvc = service;
            _edsvc.RegisterCustomNotifier(this);

            try
            {
                _fsvc = (IFusionService)_edsvc.GetService((int)ServiceType.Fusion);
                _baseUrl = service.GetCustomProperty("BaseUrl").ToString(); //NOXLATE

                if (!_baseUrl.EndsWith("/")) //NOXLATE
                    _baseUrl += "/"; //NOXLATE
            }
            catch
            {
                throw new NotSupportedException(Strings.IncompatibleConnection);
            }

            _edsvc.Saved += OnSaved;
            _flexLayout = (IApplicationDefinition)service.GetEditedResource();

            TextBoxBinder.BindText(txtTemplateUrl, _flexLayout, "TemplateUrl"); //NOXLATE
            TextBoxBinder.BindText(txtTitle, _flexLayout, "Title"); //NOXLATE
            var templates = _fsvc.GetApplicationTemplates();
            InitializeTemplateList(templates);

            GeneratePreviewUrl();
        }
        public override void Bind(IEditorService service)
        {
            _edsvc = service;
            _edsvc.RegisterCustomNotifier(this);

            try
            {
                _fsvc = (IFusionService)_edsvc.GetService((int)ServiceType.Fusion);
                if (service.CurrentConnection.ProviderName.ToUpper() == "MAESTRO.HTTP")
                {
                    _baseUrl = service.GetCustomProperty("BaseUrl").ToString(); //NOXLATE

                    if (!_baseUrl.EndsWith("/"))                                //NOXLATE
                    {
                        _baseUrl += "/";                                        //NOXLATE
                    }
                }
            }
            catch
            {
                throw new NotSupportedException(Strings.IncompatibleConnection);
            }

            _edsvc.Saved += OnSaved;
            _flexLayout   = (IApplicationDefinition)service.GetEditedResource();

            TextBoxBinder.BindText(txtTemplateUrl, _flexLayout, "TemplateUrl"); //NOXLATE
            TextBoxBinder.BindText(txtTitle, _flexLayout, "Title");             //NOXLATE
            var templates = _fsvc.GetApplicationTemplates();

            InitializeTemplateList(templates);

            GeneratePreviewUrl();
        }
        public override void Bind(IEditorService service)
        {
            try
            {
                _edsvc   = service;
                _fsvc    = (IFusionService)_edsvc.GetService((int)ServiceType.Fusion);
                _context = new FlexibleLayoutEditorContext(_fsvc);
                if (service.CurrentConnection.ProviderName.ToUpper() == "MAESTRO.HTTP")
                {
                    _baseUrl = service.GetCustomProperty("BaseUrl").ToString(); //NOXLATE

                    if (!_baseUrl.EndsWith("/"))                                //NOXLATE
                    {
                        _baseUrl += "/";                                        //NOXLATE
                    }
                }
            }
            catch
            {
                throw new NotSupportedException(Strings.IncompatibleConnection);
            }
            service.RegisterCustomNotifier(this);
            _flexLayout = (IApplicationDefinition)service.GetEditedResource();
            InitWidgetSet();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="service"></param>
        public FlexibleLayoutEditorContext(IFusionService service)
        {
            _service = service;

            _widgetSet = _service.GetApplicationWidgets();
            _templateSet = _service.GetApplicationTemplates();
            _containerSet = _service.GetApplicationContainers();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="service"></param>
        public FlexibleLayoutEditorContext(IFusionService service)
        {
            _service = service;

            _widgetSet    = _service.GetApplicationWidgets();
            _templateSet  = _service.GetApplicationTemplates();
            _containerSet = _service.GetApplicationContainers();
        }
Ejemplo n.º 7
0
        public WidgetReferenceCtrl(IWidgetItem item, IEditorService edsvc)
            : this()
        {
            _widgetRef = item;
            _flexLayout = (IApplicationDefinition)edsvc.GetEditedResource();
            _fsvc = (IFusionService)edsvc.GetService((int)ServiceType.Fusion);
            _context = new FlexibleLayoutEditorContext(_fsvc);
            cmbWidgetRefs.DataSource = _context.GetDockableWidgetNames(_flexLayout);

            cmbWidgetRefs.SelectedItem = item.Widget;
            _init = false;
        }
        public WidgetReferenceCtrl(IWidgetItem item, IEditorService edsvc)
            : this()
        {
            _widgetRef  = item;
            _flexLayout = (IApplicationDefinition)edsvc.GetEditedResource();
            _fsvc       = (IFusionService)edsvc.GetService((int)ServiceType.Fusion);
            _context    = new FlexibleLayoutEditorContext(_fsvc);
            cmbWidgetRefs.DataSource = _context.GetDockableWidgetNames(_flexLayout);

            cmbWidgetRefs.SelectedItem = item.Widget;
            _init = false;
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new <see cref="DeployService"/>.
 /// </summary>
 /// <param name="syncService">Service used for synchronizing package versions.</param>
 /// <param name="fusionService">Service used for fusing packages.</param>
 /// <param name="scheduleService">Service used for orchestrating fusion packages.</param>
 /// <param name="announcementFactory">Factory that creates <see cref="IDeployAnnouncement"/> instances.</param>
 /// <param name="packageVersionValidator">The validator that is used to validate announced package version(s).</param>
 public DeployService(
     ISyncService syncService,
     IFusionService fusionService,
     IScheduleService scheduleService,
     IDeployAnnouncementFactory announcementFactory,
     IPackageVersionValidator packageVersionValidator)
 {
     this.syncService             = syncService;
     this.fusionService           = fusionService;
     this.scheduleService         = scheduleService;
     this.announcementFactory     = announcementFactory;
     this.packageVersionValidator = packageVersionValidator;
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Initializes a new <see cref="ZappServer"/>.
        /// </summary>
        /// <param name="logService">Service used for logging.</param>
        /// <param name="apiService">Service used for outside communcation.</param>
        /// <param name="syncService">Service used for package-version synchronization.</param>
        /// <param name="fusionService">Service used for extraction fusions.</param>
        /// <param name="scheduleService">Service used for scheduling fusions.</param>
        public ZappServer(
            ILog logService,
            IRestService apiService,
            ISyncService syncService,
            IFusionService fusionService,
            IScheduleService scheduleService)
        {
            this.logService = logService;

            this.apiService  = apiService;
            this.syncService = syncService;

            this.fusionService   = fusionService;
            this.scheduleService = scheduleService;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Initializes a new <see cref="DeployAnnouncement"/> with the new <paramref name="packageVersions"/> that needs to be deployed.
        /// </summary>
        /// <param name="configStore">Store used to get information from the configuration.</param>
        /// <param name="fusionService">Service used to get info for package fusions.</param>
        /// <param name="fusionIds">Ids of the fusions that needs to be deployed. (empty if <paramref name="packageVersions"/> is specified).</param>
        /// <param name="packageVersions">Versions of the packages that needs to be deployed. (empty if <paramref name="fusionIds"/> is specified).</param>
        public DeployAnnouncement(
            IConfigStore configStore,
            IFusionService fusionService,
            IEnumerable <string> fusionIds,
            IEnumerable <PackageVersion> packageVersions)
        {
            EnsureArg.IsNotNull(fusionIds, nameof(fusionIds));
            EnsureArg.IsNotNull(packageVersions, nameof(packageVersions));

            this.configStore   = configStore;
            this.fusionService = fusionService;

            var fusionIdsStale = fusionIds.StaleReadOnly();

            this.packageVersions = fusionIdsStale.Any()
                ? new PackageVersion[0]
                : packageVersions.StaleReadOnly();

            affectedFusionIds = fusionIdsStale.Any()
                ? fusionIdsStale
                : GetAffectedFusionIds(this.packageVersions).StaleReadOnly();
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Initializes a new <see cref="ScheduleService"/>.
        /// </summary>
        /// <param name="logService">Service used for logging.</param>
        /// <param name="configStore">Store used for loading configuration.</param>
        /// <param name="fusionService">Service used for resolving fusion extractions.</param>
        /// <param name="fusionProcessFactory">Factory used for creating <see cref="IFusionProcess"/> instances.</param>
        /// <param name="announcementFactory">Factory that creates <see cref="IDeployAnnouncement"/> instances.</param>
        /// <param name="drainers">Collection of drainers that needs to determine if a <see cref="IFusionProcess"/> is ready for teardown.</param>
        /// <param name="interceptors">Collection of interceptors thats needs to be fired on certain events.</param>
        public ScheduleService(
            ILog logService,
            IConfigStore configStore,
            IFusionService fusionService,
            IFusionProcessFactory fusionProcessFactory,
            IDeployAnnouncementFactory announcementFactory,
            IEnumerable <IFusionProcessDrainer> drainers,
            IEnumerable <IFusionProcessInterceptor> interceptors)
        {
            this.logService    = logService;
            this.configStore   = configStore;
            this.fusionService = fusionService;

            this.fusionProcessFactory = fusionProcessFactory;
            this.announcementFactory  = announcementFactory;

            this.drainers     = drainers.StaleReadOnly();
            this.interceptors = interceptors.StaleReadOnly();

            syncLock = new SemaphoreSlim(nrOfSimultaneousOperations);

            processes = new SortedDictionary <string, IFusionProcess>(
                StringComparer.OrdinalIgnoreCase);
        }
Ejemplo n.º 13
0
        public override void Bind(IEditorService service)
        {
            try
            {
                _edsvc = service;
                _fsvc = (IFusionService)_edsvc.GetService((int)ServiceType.Fusion);
                _context = new FlexibleLayoutEditorContext(_fsvc);
                _baseUrl = service.GetCustomProperty("BaseUrl").ToString(); //NOXLATE

                if (!_baseUrl.EndsWith("/")) //NOXLATE
                    _baseUrl += "/"; //NOXLATE
            }
            catch
            {
                throw new NotSupportedException(Strings.IncompatibleConnection);
            }
            service.RegisterCustomNotifier(this);
            _flexLayout = (IApplicationDefinition)service.GetEditedResource();
            InitWidgetSet();
        }
Ejemplo n.º 14
0
 public FusionSession(IFusionService fusionService, ILogStore store)
 {
     FusionService = fusionService ?? throw new ArgumentNullException(nameof(fusionService));
     Store         = store ?? throw new ArgumentNullException(nameof(store));
 }
Ejemplo n.º 15
0
 public FusionSession(IFusionService fusionService)
     : this(fusionService, new TemporaryLogStore())
 {
 }
Ejemplo n.º 16
0
        public override void Bind(IEditorService service)
        {
            service.RegisterCustomNotifier(this);
            try
            {
                _fsvc = (IFusionService)service.GetService((int)ServiceType.Fusion);
                _baseUrl = service.GetCustomProperty("BaseUrl").ToString(); //NOXLATE

                if (!_baseUrl.EndsWith("/")) //NOXLATE
                    _baseUrl += "/"; //NOXLATE
            }
            catch
            {
                throw new NotSupportedException(Strings.IncompatibleConnection);
            }
            _edsvc = service;
            _edsvc.RegisterCustomNotifier(this);
            _flexLayout = (IApplicationDefinition)service.GetEditedResource();

            foreach (var grp in _flexLayout.MapSet.MapGroups)
            {
                AddMap(grp);
            }
        }