| createRecord : FunctionAbstract method that should be implemented in all subclasses
+ DataWriter extension for writing an array or single Ext.data.Record object(s) in preparation for executing a remote CRUD action via XML.
+XmlWriter uses an instance of Ext.XTemplate for maximum flexibility in defining your own custom XML schema if the default schema is not appropriate for your needs.
+See the tpl configuration-property. Config Options|
| createRecord : Function | DataWriter | | destroyRecord : Function | DataWriter | | listful : Boolean | DataWriter | | documentRoot : String[xrequest] (Optional) The name of the XML document root-node. Note:
+this parameter is required only when sending ext... [xrequest] (Optional) The name of the XML document root-node. Note:
+this parameter is required only when sending extra baseParams to the server
+during a write-request -- if no baseParams are set, the Ext.data.XmlReader.record meta-property can
+suffice as the XML document root-node for write-actions involving just a single record. For requests
+involving multiple records and NO baseParams, the Ext.data.XmlWriter.root property can
+act as the XML document root. | XmlWriter | | forceDocumentRoot : Boolean[false] Set to true to force XML documents having a root-node as defined
+by documentRoot, even with no baseParams def... [false] Set to true to force XML documents having a root-node as defined
+by documentRoot, even with no baseParams defined. | XmlWriter | | listful : Booleanfalse by default. Set true to have the DataWriter always write HTTP params as a list,
even when acting upon a single... false by default. Set true to have the DataWriter always write HTTP params as a list,
-even when acting upon a single record. | DataWriter | | saveRecord : Function | DataWriter | | writeAllFields : Booleanfalse by default. Set true to have DataWriter return ALL fields of a modified
+even when acting upon a single record. | DataWriter | | root : String[records] The name of the containing element which will contain the nodes of an write-action involving multiple recor... [records] The name of the containing element which will contain the nodes of an write-action involving multiple records. Each
+xml-record written to the server will be wrapped in an element named after Ext.data.XmlReader.record property.
+eg:
+
+<?xml version="1.0" encoding="UTF-8"?>
+<user><first>Barney</first></user>
+However, when multiple records are written in a batch-operation, these records must be wrapped in a containing
+Element.
+eg:
+
+<?xml version="1.0" encoding="UTF-8"?>
+ <records>
+ <first>Barney</first></user>
+ <records><first>Barney</first></user>
+ </records>
+Defaults to records. Do not confuse the nature of this property with that of documentRoot | XmlWriter | | tpl : String/Ext.XTemplateThe XML template used to render write-actions to your server.
+One can easily provide his/her own custom template-defi... The XML template used to render write-actions to your server.
+ One can easily provide his/her own custom template-definition if the default does not suffice.
+ Defaults to:
+
+<?xml version="{version}" encoding="{encoding}"?>
+ <tpl if="documentRoot"><{documentRoot}>
+ <tpl for="baseParams">
+ <tpl for=".">
+ <{name}>{value}</{name}>
+ </tpl>
+ </tpl>
+ <tpl if="records.length > 1"><{root}>',
+ <tpl for="records">
+ <{parent.record}>
+ <tpl for=".">
+ <{name}>{value}</{name}>
+ </tpl>
+ </{parent.record}>
+ </tpl>
+ <tpl if="records.length > 1"></{root}></tpl>
+ <tpl if="documentRoot"></{documentRoot}></tpl>
+
+ Templates will be called with the following API
+
+- {String} version [1.0] The xml version.
+- {String} encoding [ISO-8859-15] The xml encoding.
+- {String/false} documentRoot The XML document root-node name or false if not required. See documentRoot and forceDocumentRoot.
+- {String} record The meta-data parameter defined on your Ext.data.XmlReader.record configuration represents the name of the xml-tag containing each record.
+- {String} root The meta-data parameter defined by Ext.data.XmlWriter.root configuration-parameter. Represents the name of the xml root-tag when sending multiple records to the server.
+- {Array} records The records being sent to the server, ie: the subject of the write-action being performed. The records parameter will be always be an array, even when only a single record is being acted upon.
+Each item within the records array will contain an array of field objects having the following properties:
+
+- {String} name The field-name of the record as defined by your Ext.data.Record definition. The "mapping" property will be used, otherwise it will match the "name" property. Use this parameter to define the XML tag-name of the property.
+- {Mixed} value The record value of the field enclosed within XML tags specified by name property above.
+
+- {Array} baseParams. The baseParams as defined upon Ext.data.Store.baseParams. Note that the baseParams have been converted into an array of [{name : "foo", value: "bar"}, ...] pairs in the same manner as the records parameter above. See documentRoot and forceDocumentRoot.
+ | XmlWriter | | updateRecord : Function | DataWriter | | writeAllFields : Booleanfalse by default. Set true to have DataWriter return ALL fields of a modified
record -- not just those that changed.... false by default. Set true to have DataWriter return ALL fields of a modified
record -- not just those that changed.
-false to have DataWriter only request modified fields from a record. | DataWriter |
Public Properties|
| meta : Mixed This DataWriter's configured metadata as passed to the constructor. | DataWriter |
Public Methods|
| createRecord( Ext.data.Record rec )
+false to have DataWriter only request modified fields from a record. | DataWriter | | xmlEncoding : String[ISO-8859-15] The encoding written to header of xml documents.
+ <?xml version="1.0" encoding="ISO-8859-15"?>
| XmlWriter | | xmlVersion : String[1.0] The version written to header of xml documents.
+ <?xml version="1.0" encoding="ISO-8859-15"?>
| XmlWriter |
Public PropertiesThis class has no public properties. Public Methods|
| apply( Object params , Object baseParams , String action , Record/Record[] rs )
:
- void | XmlWriter | | destroyRecord( Ext.data.Record rec )
+ voidCompiles a Store recordset into a data-format defined by an extension such as Ext.data.JsonWriter or Ext.data.XmlWrit... | DataWriter | | createRecord( Ext.data.Record rec )
:
- void | XmlWriter | | render( String action , Record[] rs , Object http , Object data )
+ Array | XmlWriter | | destroyRecord( Ext.data.Record rec )
:
- voidFinal action of a write event. Apply the written data-object to params. Final action of a write event. Apply the written data-object to params. | XmlWriter | | updateRecord( Ext.data.Record rec )
+ Array | XmlWriter | | render( Object params , Object baseParams , Object/Object[] data )
:
- void | XmlWriter | | write( String action , Object params , Record/Record[] rs )
+ voidXmlWriter implementation of the final stage of a write action. XmlWriter implementation of the final stage of a write action. | XmlWriter | | toArray( Hash data )
:
- voidWrites data in preparation for server-write action. Simply proxies to DataWriter#update, DataWriter#create
-DataWrite... Writes data in preparation for server-write action. Simply proxies to DataWriter#update, DataWriter#create
-DataWriter#destroy. | DataWriter |
Public EventsThis class has no public events.
\ No newline at end of file
+ [Object] Converts a Hashed Ext.data.Record to fields-array array suitable
+for encoding to xml via XTemplate, eg:
+<tpl for="... Converts a Hashed Ext.data.Record to fields-array array suitable
+for encoding to xml via XTemplate, eg:
+ <tpl for="."><{name}>{value}</{name}</tpl>
+eg, non-phantom:
+ {id: 1, first: 'foo', last: 'bar'} --> [{name: 'id', value: 1}, {name: 'first', value: 'foo'}, {name: 'last', value: 'bar'}]
+ Phantom records will have had their idProperty omitted in toHash if determined to be auto-generated.
+Non AUTOINCREMENT pks should have been protected. | DataWriter |