// ReSharper disable InconsistentNaming
        public void InitializedFromEmptyConstructor_WhenConfigIsNotSet_ShouldSetExternalSystemNameFromConfig()
        // ReSharper restore InconsistentNaming
        {
            WhenConfigIsNotSet();

            _target = new EphorteContextIdentity();

            Assert.IsNull(_target.ExternalSystemName);
        }
	    private static IObjectModelAdapter CreateObjectModelAdapter(EphorteContextIdentity ephorteContextIdentity, Uri servicesBaseUrl)
	    {
	        var objectModelSettings = new ClientSettings
	            {
                    Address = new Uri(servicesBaseUrl, "services/objectmodel/v3/en/ObjectModelService.svc").ToString(),
                    EndpointName = "ObjectModelServiceV3En_WSHttpBinding"
	            };

	        return new Gecko.NCore.Client.ObjectModel.V3.En.ObjectModelAdapterV3En(ephorteContextIdentity, objectModelSettings);
		}
		private static IDocumentsAdapter CreateDocumentsAdapter(EphorteContextIdentity ephorteContextIdentity, Uri servicesBaseUrl)
		{
            var documentServiceSettings = new ClientSettings
	            {
                    Address = new Uri(servicesBaseUrl, "services/documents/v3/DocumentService.svc").ToString(),
                    EndpointName = "BasicHttpBinding_DocumentService"
	            };

		    return new Gecko.NCore.Client.Documents.V3.DocumentsAdapter(ephorteContextIdentity, documentServiceSettings);
		}
示例#4
0
        private static IObjectModelAdapter CreateObjectModelAdapter(EphorteContextIdentity ephorteContextIdentity, Uri servicesBaseUrl)
        {
            var objectModelSettings = new ClientSettings
            {
                Address      = new Uri(servicesBaseUrl, "services/objectmodel/v3/en/ObjectModelService.svc").ToString(),
                EndpointName = "ObjectModelServiceV3En_WSHttpBinding"
            };

            return(new Gecko.NCore.Client.ObjectModel.V3.En.ObjectModelAdapterV3En(ephorteContextIdentity, objectModelSettings));
        }
示例#5
0
        private static IDocumentsAdapter CreateDocumentsAdapter(EphorteContextIdentity ephorteContextIdentity, Uri servicesBaseUrl)
        {
            var documentServiceSettings = new ClientSettings
            {
                Address      = new Uri(servicesBaseUrl, "services/documents/v3/DocumentService.svc").ToString(),
                EndpointName = "BasicHttpBinding_DocumentService"
            };

            return(new Gecko.NCore.Client.Documents.V3.DocumentsAdapter(ephorteContextIdentity, documentServiceSettings));
        }
		public static IEphorteContext Create(EphorteContextIdentity ephorteContextIdentity)
		{
			var servicesBaseUrl = GetServicesBaseUrl();

			var objectModelAdapter = CreateObjectModelAdapter(ephorteContextIdentity, servicesBaseUrl);
			var documentsAdapter = CreateDocumentsAdapter(ephorteContextIdentity, servicesBaseUrl);
			const IFunctionsAdapter functionsAdapter = null;
            const IMetadataAdapter metadataAdapter = null;
            return new EphorteContext(objectModelAdapter, functionsAdapter, documentsAdapter, metadataAdapter);
		}
示例#7
0
        public static IEphorteContext Create(EphorteContextIdentity ephorteContextIdentity)
        {
            var servicesBaseUrl = GetServicesBaseUrl();

            var objectModelAdapter = CreateObjectModelAdapter(ephorteContextIdentity, servicesBaseUrl);
            var documentsAdapter   = CreateDocumentsAdapter(ephorteContextIdentity, servicesBaseUrl);
            const IFunctionsAdapter functionsAdapter = null;
            const IMetadataAdapter  metadataAdapter  = null;

            return(new EphorteContext(objectModelAdapter, functionsAdapter, documentsAdapter, metadataAdapter));
        }
        protected void LogOnAsConfiguredUser()
        {
            EphorteContextIdentity = new EphorteContextIdentity
                                         {
                                             Username = Configuration.EphorteUsername,
                                             Password = Configuration.EphortePassword,
                                             Role = Configuration.EphorteRole,
                                             Database = Configuration.EphorteDatabase,
                                             ExternalSystemName = Configuration.ExternalSystemName
                                         };

            EphorteContext = ServiceModelContextFactory.Create(EphorteContextIdentity);
        }
示例#9
0
        protected void LogOnAsConfiguredUser()
        {
            EphorteContextIdentity = new EphorteContextIdentity
            {
                Username           = Configuration.EphorteUsername,
                Password           = Configuration.EphortePassword,
                Role               = Configuration.EphorteRole,
                Database           = Configuration.EphorteDatabase,
                ExternalSystemName = Configuration.ExternalSystemName
            };

            EphorteContext = ServiceModelContextFactory.Create(EphorteContextIdentity);
        }
示例#10
0
        public IEphorteContext Create()
        {
            var identity = new EphorteContextIdentity
            {
                Username           = _options.Username,
                Password           = _options.Password,
                Role               = _options.Role,
                Database           = _options.Database,
                ExternalSystemName = _options.ExternalSystemName
            };

            var servicesBaseUrl = new Uri(_options.NCoreBaseAddress, UriKind.Absolute);

            string GetObjectModelServiceAddress()
            {
                const string objectModelServiceUrl = "services/objectmodel/v3/en/ObjectModelService.svc";

                return(new Uri(servicesBaseUrl, objectModelServiceUrl).ToString());
            }

            var objectModelAdapter = new ObjectModelAdapterV3En(identity, new ClientSettings
            {
                Address = GetObjectModelServiceAddress(),
            });

            var functionsAdapter = GetFunctionsAdapter(servicesBaseUrl, _options.FunctionServiceVersion, identity);

            string GetDocumentServiceAddress()
            {
                string DocumentServiceUrl = "services/documents/v2/DocumentService.svc";

                ////private const string DocumentServiceUrl = "services/documents/v2/DocumentService.svc/ws";
                ////private const string DocumentServiceUrl = "services/documents/v3/DocumentService.svc";
                return(new Uri(servicesBaseUrl, DocumentServiceUrl).ToString());
            }

            var documentsAdapter = new Gecko.NCore.Client.Documents.V2.DocumentsAdapter(identity, new ClientSettings
            {
                Address = GetDocumentServiceAddress(),
            });

            return(new EphorteContext(objectModelAdapter, functionsAdapter, documentsAdapter: documentsAdapter, documentsAdapterWithDatabase: null, metadataAdapter: null));
        }
示例#11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DocumentsAdapter"/> class.
 /// </summary>
 /// <param name="contextIdentity">The identity.</param>
 /// <param name="settings">The configuration.</param>
 public AsyncDocumentsAdapter(EphorteContextIdentity contextIdentity, ClientSettings settings)
     : base(contextIdentity, settings)
 {
 }
示例#12
0
 public AsyncObjectModelAdapterV2(EphorteContextIdentity contextIdentity, ClientSettings settings)
     : base(contextIdentity, settings)
 {
 }
示例#13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FunctionsAdapter"/> class.
 /// </summary>
 /// <param name="contextIdentity">The identity.</param>
 /// <param name="settings">The configuration.</param>
 public FunctionsAdapter(EphorteContextIdentity contextIdentity, ClientSettings settings)
     : base(settings)
 {
     _contextIdentity = contextIdentity;
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="MetadataAdapter"/> class.
		/// </summary>
		/// <param name="contextIdentity">The identity.</param>
		/// <param name="settings">The configuration.</param>
		public MetadataAdapter(EphorteContextIdentity contextIdentity, ClientSettings settings)
            : base(settings)
		{
			_contextIdentity = contextIdentity;
		}
示例#15
0
 public ObjectModelAdapterV2(EphorteContextIdentity contextIdentity, ClientSettings settings)
     : base(settings)
 {
     _contextIdentity = contextIdentity;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FunctionsAdapter"/> class.
 /// </summary>
 /// <param name="contextIdentity">The identity.</param>
 /// <param name="settings">The configuration.</param>
 public AsyncFunctionsAdapter(EphorteContextIdentity contextIdentity, ClientSettings settings)
     : base(contextIdentity, settings)
 {
 }
示例#17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MetadataAdapter"/> class.
 /// </summary>
 /// <param name="contextIdentity">The identity.</param>
 /// <param name="settings">The configuration.</param>
 public AsyncMetadataAdapter(EphorteContextIdentity contextIdentity, ClientSettings settings)
     : base(contextIdentity, settings)
 {
 }
示例#18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DocumentsAdapter"/> class.
 /// </summary>
 /// <param name="contextIdentity">The identity.</param>
 /// <param name="settings">The configuration.</param>
 public DocumentsAdapter(EphorteContextIdentity contextIdentity, ClientSettings settings)
     : base(settings)
 {
     _contextIdentity = contextIdentity;
 }
示例#19
0
        private static IFunctionsAdapter GetFunctionsAdapter(Uri servicesBaseUrl, string functionServiceVersion, EphorteContextIdentity identity)
        {
            string functionServiceServiceUrl;

            string GetFunctionsServiceAddress()
            {
                return(new Uri(servicesBaseUrl, functionServiceServiceUrl).ToString());
            }

            if ("v1".Equals(functionServiceVersion, StringComparison.OrdinalIgnoreCase))
            {
                functionServiceServiceUrl = "services/Functions/V1/FunctionsService.svc/ws";
                return(new Gecko.NCore.Client.Functions.V1.FunctionsAdapter(identity, new ClientSettings
                {
                    Address = GetFunctionsServiceAddress(),
                }));
            }
            else
            {
                functionServiceServiceUrl = "services/Functions/V2/FunctionsService.svc";
                return(new Gecko.NCore.Client.Functions.V2.FunctionsAdapter(identity, new ClientSettings
                {
                    Address = GetFunctionsServiceAddress(),
                }));
            }
        }