Example #1
0
		private void InstallServiceBrowserDestinations(ServiceDefinition service, AdapterDefinition adapter) {
			//ServiceBrowser destinations
			DestinationDefinition destination = new DestinationDefinition(service);
			destination.Id = DestinationDefinition.FluorineServiceBrowserDestination;
			destination.Properties.Source = DestinationDefinition.FluorineServiceBrowserDestination;
			destination.AdapterRef = new AdapterRef(adapter);
			service.AddDestination(destination);

			destination = new DestinationDefinition(service);
			destination.Id = DestinationDefinition.FluorineManagementDestination;
			destination.Properties.Source = DestinationDefinition.FluorineManagementDestination;
			destination.AdapterRef = new AdapterRef(adapter);
			service.AddDestination(destination);

			destination = new DestinationDefinition(service);
			destination.Id = DestinationDefinition.FluorineCodeGeneratorDestination;
			destination.Properties.Source = DestinationDefinition.FluorineCodeGeneratorDestination;
			destination.AdapterRef = new AdapterRef(adapter);
			service.AddDestination(destination);

			destination = new DestinationDefinition(service);
			destination.Id = DestinationDefinition.FluorineSqlServiceDestination;
			destination.Properties.Source = DestinationDefinition.FluorineSqlServiceDestination;
			destination.AdapterRef = new AdapterRef(adapter);
			service.AddDestination(destination);
		}
		/// <summary>
		/// Creates a default services configuration instance.
		/// </summary>
		/// <returns>Services configuration instance.</returns>
		public static ServicesConfiguration CreateDefault() {
			ServicesConfiguration sc = new ServicesConfiguration();

			LoginCommandCollection loginCommandCollection = FluorineConfiguration.Instance.LoginCommands;
			if (loginCommandCollection != null) {
				LoginCommand loginCommand = new LoginCommand();
				loginCommand.Class = loginCommandCollection.GetLoginCommand(LoginCommandSettings.FluorineLoginCommand);
				loginCommand.Server = LoginCommandSettings.FluorineLoginCommand;
				SecurityConfiguration securityConfiguration = new SecurityConfiguration();
				securityConfiguration.LoginCommands = new LoginCommand[] { loginCommand };
				sc.Security = securityConfiguration;
			}

			//Create a default amf channel
			ChannelDefinition channelDefinition = new ChannelDefinition();
			channelDefinition.Class = "flex.messaging.endpoints.AMFEndpoint";
			channelDefinition.Id = "my-amf";
			Endpoint endpoint = new Endpoint();
			endpoint.Url = @"http://{server.name}:{server.port}/{context.root}/Gateway.aspx";
			endpoint.Class = "flex.messaging.endpoints.AMFEndpoint";
			channelDefinition.Endpoint = endpoint;
			sc.Channels = new ChannelDefinition[] { channelDefinition };

			ServiceDefinition serviceDefinition = new ServiceDefinition(sc);
			serviceDefinition.Id = GodLesZ.Library.Amf.Messaging.Services.RemotingService.RemotingServiceId;
			serviceDefinition.Class = typeof(GodLesZ.Library.Amf.Messaging.Services.RemotingService).FullName;
			serviceDefinition.MessageTypes = "flex.messaging.messages.RemotingMessage";

			AdapterDefinition adapter = new AdapterDefinition();
			adapter.Id = "dotnet";
			adapter.Class = typeof(GodLesZ.Library.Amf.Remoting.RemotingAdapter).FullName;
			adapter.Default = true;
			serviceDefinition.AddAdapter(adapter);
			serviceDefinition.Adapters = new AdapterDefinition[] { adapter };
			AdapterRef adapterRef = new AdapterRef();
			adapterRef.Ref = "dotnet";

			DestinationDefinition destination = new DestinationDefinition(serviceDefinition);
			destination.Id = DestinationDefinition.FluorineDestination;
			destination.AdapterRef = adapterRef;
			DestinationProperties properties = new DestinationProperties();
			properties.Source = "*";
			destination.Properties = properties;
			serviceDefinition.AddDestination(destination);

			Services services = new Services();
			services.ServiceDefinitions = new ServiceDefinition[] { serviceDefinition };
			sc.Services = services;

			FlexClient flexClient = new FlexClient();
			sc.FlexClient = flexClient;
			return sc;
		}