protected internal override void serialize(MappingSerializer serializer) { foreach (string extension in _outerInstance.extensions.extensionNames()) { serializer.PutRelativeUri(extension, "ext/" + extension); } }
protected internal override void serialize(MappingSerializer serializer) { List <Representation> maps = new List <Representation>(); maps.Add(new MappingRepresentationAnonymousInnerClass7(this, serializer)); serializer.PutList("foo", new ServerListRepresentation(RepresentationType.MAP, maps)); }
protected internal override void serialize(MappingSerializer serializer) { foreach (KeyValuePair <string, string> entry in _outerInstance.services.SetOfKeyValuePairs()) { serializer.PutString(entry.Key, entry.Value); } }
public override void SetUp() { base.SetUp(); _enumSerializerFactoryStub = MockRepository.GenerateStub <Func <RdbmsProviderDefinition, IEnumSerializer> >(); _storageProviderSerializerFactoryStub = MockRepository.GenerateStub <Func <RdbmsProviderDefinition, IEnumSerializer, IStorageProviderSerializer> >(); _mappingSerializer = new MappingSerializer(_enumSerializerFactoryStub, _storageProviderSerializerFactoryStub); }
internal virtual void PutTo(MappingSerializer serializer, ObjectRepresentation @object, string key) { object value = Get(@object); if (value != null) { (( Representation )value).PutTo(serializer, key); } }
protected virtual void ExportMapping() { var mappingSerializer = new MappingSerializer( pd => pd.Factory.CreateEnumSerializer(), (pd, enumSerializer) => pd.Factory.CreateStorageProviderSerializer(enumSerializer)); var xml = mappingSerializer.Serialize(MappingConfiguration.Current.GetTypeDefinitions()); xml.Save(_rdbmsToolsParameters.MappingExportOutputFileName); }
protected internal override void serialize(MappingSerializer resourceSerializer) { foreach (KeyValuePair <string, string> entry in _outerInstance.uris.SetOfKeyValuePairs()) { resourceSerializer.PutRelativeUri(entry.Key, entry.Value); } foreach (KeyValuePair <string, string> entry in _outerInstance.templates.SetOfKeyValuePairs()) { resourceSerializer.PutRelativeUriTemplate(entry.Key, entry.Value); } }
public void Serialize() { var sqlStorageObjectFactory = new SqlStorageObjectFactory(); var mappingSerializer = new MappingSerializer( d => sqlStorageObjectFactory.CreateEnumSerializer(), (d, enumSerializer) => sqlStorageObjectFactory.CreateStorageProviderSerializer(enumSerializer)); var actual = mappingSerializer.Serialize(MappingConfiguration.Current.GetTypeDefinitions()); var expected = XDocument.Load(new MemoryStream(ResourceManager.GetMappingExportOutput())); Assert.That(actual.ToString(), Is.EqualTo(expected.ToString())); }
public void Serialize_OutputIsValid() { var sqlStorageObjectFactory = new SqlStorageObjectFactory(); var mappingSerializer = new MappingSerializer( d => sqlStorageObjectFactory.CreateEnumSerializer(), (d, enumSerializer) => sqlStorageObjectFactory.CreateStorageProviderSerializer(enumSerializer)); var actual = mappingSerializer.Serialize(MappingConfiguration.Current.GetTypeDefinitions()); var schemaSet = new XmlSchemaSet(); schemaSet.Add(XmlSchema.Read(new MemoryStream(ResourceManager.GetRdbmsMappingSchema()), null)); actual.Validate(schemaSet, null); }
protected void ConfirmButton_Click(object sender, EventArgs e) { try { if (ValidateInput()) { Mapping mapping = CreateMappingFromInput(); MappingSerializer serializer = new MappingSerializer(); MappingHiddenField.Value = serializer.SerializeMapping(mapping); MappingControl.Mapping = mapping; string parametersIdentifier = QueryHelper.GetString("pid", null); Hashtable parameters = WindowHelper.GetItem(parametersIdentifier) as Hashtable; parameters["Mapping"] = MappingHiddenField.Value; WindowHelper.Add(parametersIdentifier, parameters); } } catch (Exception exception) { HandleError(exception); } }
private void RestoreParameters() { // Validate parameters if (!QueryHelper.ValidateHash("hash")) { throw new Exception("[SalesForceMappingEditorPage.RestoreParameters]: Invalid query hash."); } Hashtable parameters = WindowHelper.GetItem(QueryHelper.GetString("pid", null)) as Hashtable; if (parameters == null) { throw new Exception("[SalesForceMappingEditorPage.RestoreParameters]: The dialog page parameters are missing, the session might have been lost."); } // Restore parameters mEntityModelName = ValidationHelper.GetString(parameters["EntityModelName"], null); mSourceMappingHiddenFieldClientId = ValidationHelper.GetString(parameters["MappingHiddenFieldClientId"], null); mSourceMappingPanelClientId = ValidationHelper.GetString(parameters["MappingPanelClientId"], null); // Restore mapping string content = ValidationHelper.GetString(parameters["Mapping"], null); if (String.IsNullOrEmpty(content)) { mSourceMapping = new Mapping(); } else { MappingSerializer serializer = new MappingSerializer(); mSourceMapping = serializer.DeserializeMapping(content); } // Restore credentials content = ValidationHelper.GetString(parameters["Credentials"], null); if (String.IsNullOrEmpty(content)) { throw new Exception("[SalesForceMappingEditorPage.RestoreParameters]: The dialog page parameters are corrupted."); } mCredentials = OrganizationCredentials.Deserialize(EncryptionHelper.DecryptData(content).TrimEnd('\0')); }
private void InitializeControls() { try { string content = Value as string; if (!String.IsNullOrEmpty(content)) { MappingSerializer serializer = new MappingSerializer(); Mapping mapping = serializer.DeserializeMapping(content); MappingControl.Mapping = mapping; MappingControl.Enabled = Enabled; } if (Enabled) { string credentials = GetCredentials(); if (!String.IsNullOrEmpty(credentials)) { InitializeEditButton(); } else { MessageLabel.InnerHtml = GetString("sf.credentialsrequiredformapping"); MessageLabel.Attributes.Add("class", "Red"); MessageLabel.Visible = true; EditMappingButton.Visible = false; } } else { EditMappingButton.Visible = false; } } catch (Exception exception) { HandleError(exception); } }
internal abstract void PutTo(MappingSerializer serializer, string key);
internal override void putTo(MappingSerializer serializer, string key) { }
public override void Serialize(MappingSerializer serializer) { serializer.PutMapping("resources", new MappingRepresentationAnonymousInnerClass(this)); }
protected internal abstract void Serialize(MappingSerializer serializer);
internal override void PutTo(MappingSerializer serializer, string key) { serializer.PutMapping(key, this); }
protected internal override void serialize(MappingSerializer serializer) { }
public MappingRepresentationAnonymousInnerClass7(MappingRepresentationAnonymousInnerClass6 outerInstance, MappingSerializer serializer) : base("map") { this.outerInstance = outerInstance; this._serializer = serializer; }
protected internal override void Serialize(MappingSerializer serializer) { MappingRepresentation apa = new MappingRepresentationAnonymousInnerClass(this, serializer); serializer.PutMapping("services", apa); }
protected internal override void serialize(MappingSerializer serializer) { serializer.PutString("key", "expected string"); }
public override void Serialize(MappingSerializer serializer) { base.Serialize(serializer); serializer.PutList("engines", ListRepresentation.@string(_engines)); }
protected internal override void serialize(MappingSerializer serializer) { serializer.PutMapping("nested", new MappingRepresentationAnonymousInnerClass5(this)); }
protected internal override void serialize(MappingSerializer serializer) { serializer.PutRelativeUri("URL", "subpath"); }
protected internal override void serialize(MappingSerializer serializer) { serializer.PutString("foo", "bar"); }
public MappingRepresentationAnonymousInnerClass(ServerRootRepresentation outerInstance, MappingSerializer serializer) : base("services") { this.outerInstance = outerInstance; this._serializer = serializer; }
protected internal override void serialize(MappingSerializer nested) { nested.PutString("data", "expected data"); }
internal override void ExtraData(MappingSerializer serializer) { @delegate.extraData(serializer); }