DataWriterXmlWriter
| Package: | CQ.Ext.data |
| Class: | XmlWriter |
| Extends: | CQ.Ext.data.DataWriter |
| Clientlib: | cq.widgets |
| Config Options | Defined By | |
|---|---|---|
|
createRecord : Function Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.createRecord)
Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.createRecord)
|
DataWriter | |
|
destroyRecord : Function Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.destroyRecord)
Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.destroyRecord)
|
DataWriter | |
|
documentRoot : String [xrequest] (Optional) The name of the XML document root-node. Note: this parameter is required only when sending extr...
[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 CQ.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 CQ.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 : Boolean false 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 | |
|
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 CQ.Ext.data.XmlReader.record property. eg:
However, when multiple records are written in a batch-operation, these records must be wrapped in a containing Element. eg: Defaults to records. Do not confuse the nature of this property with that of documentRoot |
XmlWriter | |
|
tpl : String/CQ.Ext.XTemplate The 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: Templates will be called with the following API
|
XmlWriter | |
|
updateRecord : Function Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.updateRecord
Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.updateRecord
|
DataWriter | |
|
writeAllFields : Boolean false 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 | |
|
xmlEncoding : String [ISO-8859-15] The encoding written to header of xml documents. <?xml version="1.0" encoding="ISO-8859-15"?>
[ISO-8859-15] The encoding written to header of xml documents.
|
XmlWriter | |
|
xmlVersion : String [1.0] The version written to header of xml documents. <?xml version="1.0" encoding="ISO-8859-15"?>
[1.0] The version written to header of xml documents.
|
XmlWriter | |
| Property | Defined By | |
|---|---|---|
|
render : Object abstract method meant to be overridden by all DataWriter extensions. It's the extension's job to apply the "data" to...
abstract method meant to be overridden by all DataWriter extensions. It's the extension's job to apply the "data" to the "params".
The data-object provided to render is populated with data according to the meta-info defined in the user's DataReader config,
|
DataWriter | |
| Method | Defined By | |
|---|---|---|
apply( Object params, Object baseParams, String action, Record/Record[] rs ) : void Compiles a Store recordset into a data-format defined by an extension such as CQ.Ext.data.JsonWriter or CQ.Ext.data.X...
Compiles a Store recordset into a data-format defined by an extension such as CQ.Ext.data.JsonWriter or CQ.Ext.data.XmlWriter in preparation for a server-write action. The first two params are similar similar in nature to CQ.Ext.apply,
Where the first parameter is the receiver of paramaters and the second, baseParams, the source.
Parameters:
|
DataWriter | |
createRecord( CQ.Ext.data.Record rec ) : Array createRecord
@protected
createRecord
@protected
Parameters:
|
XmlWriter | |
destroyRecord( CQ.Ext.data.Record rec ) : Array destroyRecord
@protected
destroyRecord
@protected
Parameters:
|
XmlWriter | |
render( Object params, Object baseParams, Object/Object[] data ) : void XmlWriter implementation of the final stage of a write action.
XmlWriter implementation of the final stage of a write action.
Parameters:
|
XmlWriter | |
toArray( Hash data ) : Array Converts a Hashed CQ.Ext.data.Record to fields-array array suitable
for encoding to xml via XTemplate, eg:
<tpl f...
Converts a Hashed CQ.Ext.data.Record to fields-array array suitable
for encoding to xml via XTemplate, eg:
eg, non-phantom:
Phantom records will have had their idProperty omitted in toHash if determined to be auto-generated.
Non AUTOINCREMENT pks should have been protected.
Parameters:
|
DataWriter | |
toHash( CQ.Ext.data.Record rec, Object config ) : Object Converts a Record to a hash, taking into account the state of the CQ.Ext.data.Record along with configuration propert...
Converts a Record to a hash, taking into account the state of the CQ.Ext.data.Record along with configuration properties
related to its rendering, such as writeAllFields, phantom, getChanges and
idProperty
Parameters:
|
DataWriter | |
updateRecord( CQ.Ext.data.Record rec ) : Array updateRecord
@protected
updateRecord
@protected
Parameters:
|
XmlWriter | |