Content Studio Web Content Management System
SystemObject
ContentStudio.Document.EPTEPTXmlParser
ContentStudio.Document.EPTEPTXmlTextParser
ContentStudio.Document.EPTEPTXmlEditableParser
ContentStudio.Document.EPTSyncronizedEPTDocument
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Top
Top
Top
Top
You can use this class to create your own EPT data "on the fly" or edit an existing document and for example save it to Content Studio using a
CSSyncronizedDocument object.
Note
The SyncronizedEPTDocument class provides a safer an more convenient way of creating, editing and updating Content Studio EPT documents.
The following code snippet shows how to create a Content Studio EPT document with two fields and save it to Content Studio as a new document.
Note
This method does not check that the content to save follows the EPT schema in use, nor does i check that you really save the content into a valid EPT document category. Instead, you might want to use the SyncronizedEPTDocument class for creating, editing and updating Content Studio EPT documents.
[This is preliminary documentation and is subject to change.]
The EPTXmlEditableParser class extends the EPTXmlTextParser by adding editing capabilities.
Inheritance Hierarchy
ContentStudio.Document.EPTEPTXmlParser
ContentStudio.Document.EPTEPTXmlTextParser
ContentStudio.Document.EPTEPTXmlEditableParser
ContentStudio.Document.EPTSyncronizedEPTDocument
Namespace: ContentStudio.Document.EPT
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax
The EPTXmlEditableParser type exposes the following members.
Constructors
Name | Description | |
---|---|---|
EPTXmlEditableParser |
Creates a new EPT field collection object with an initial suggested size of 10 members.
| |
EPTXmlEditableParser(Int32) |
Creates a new EPT field collection object
| |
EPTXmlEditableParser(Stream) |
Creates a new EPTXmlTextParser from a Stream of xml content
| |
EPTXmlEditableParser(String) |
Creates a new EPTXmlTextParser from a string of xml content
| |
EPTXmlEditableParser(XmlReader) |
Creates a new EPT field collection object
| |
EPTXmlEditableParser(Int32, Stream) |
Creates a new EPTXmlTextParser from a stream of xml content
| |
EPTXmlEditableParser(Int32, String) |
Creates a new EPTXmlTextParser from a string of xml content
| |
EPTXmlEditableParser(Int32, XmlReader) |
Creates a new EPT field collection object
|
Properties
Name | Description | |
---|---|---|
CategoryID |
Gets a value that indicates the category where the document belongs.
(Inherited from EPTXmlTextParser.) | |
Count |
Gets the number of unique field names in the EPT field collection.
(Inherited from EPTXmlParser.) | |
DocumentID |
Gets a value that identifies the document loaded.
(Inherited from EPTXmlTextParser.) | |
DocumentName |
Sets or gets the name of the document.
(Inherited from EPTXmlTextParser.) | |
Fields |
Returns an array of all field names
(Inherited from EPTXmlParser.) | |
HasFields |
Gets a value that indicates whether the EPT collection has any fields or not.
(Inherited from EPTXmlParser.) | |
ItemString |
Gets or sets the entry with the specified key in the fields collection.
If you set a value to an entry that contains multiple values they are removed and replaced with this single new value.
(Overrides EPTXmlTextParserItemString.) | |
ItemInt32 |
Gets the entry at the specified index of the the fields collection.
(Inherited from EPTXmlTextParser.) | |
ReadOnly |
Returns a value that indicates whether this collection of EPT fields is read-only or not
(Overrides EPTXmlTextParserReadOnly.) |
Methods
Name | Description | |
---|---|---|
Add |
Adds an entry with the specified name and value to the EPT field collection
| |
BaseAdd |
Adds an entry with the specified name and value to the EPT field collection
(Inherited from EPTXmlParser.) | |
BaseClear |
Removes all the fields and their values
(Inherited from EPTXmlParser.) | |
BaseRemove |
Removes a field in the EPT field collection
(Inherited from EPTXmlParser.) | |
BaseSet |
Sets the value of an entry in the collection of EPT fields
(Inherited from EPTXmlParser.) | |
Clear |
Removes all entires in the EPT field collection
| |
Equals(Object) |
Determines whether the specified Object is an EPTXmlParser that has
the same content as the current EPTXmlParser.
(Inherited from EPTXmlParser.) | |
Equals(EPTXmlParser) |
Determines whether the specified EPTXmlParser
has the same content as the current EPTXmlParser.
(Inherited from EPTXmlParser.) | |
ExistsField |
Determines whether a field exists or not
(Inherited from EPTXmlParser.) | |
Finalize | (Inherited from Object.) | |
Get(Int32) |
Gets the values at the specified index of the EPT field collection combined into one comma-separated list.
(Inherited from EPTXmlParser.) | |
Get(String) |
Gets the values associated with the specified field from the the EPT field collection combined into one comma-separated list.
(Inherited from EPTXmlParser.) | |
GetAsDateTime |
Returns the value as a DateTime of a specified Content Studio EPT field.
(Inherited from EPTXmlTextParser.) | |
GetAsInt32 |
Returns the value as an Int32 of a specified Content Studio EPT field.
(Inherited from EPTXmlTextParser.) | |
GetAsString(String) |
Returns the value, as as String of a specified Content Studio EPT field.
(Inherited from EPTXmlTextParser.) | |
GetAsString(String, Boolean) |
Returns the value, as as String of a specified Content Studio EPT field with option to remove any embedded html markup.
(Inherited from EPTXmlTextParser.) | |
GetEnumerator |
Returns an enumerator that iterates through a collection.
(Inherited from EPTXmlParser.) | |
GetField |
Returns the field name at a specific location
(Inherited from EPTXmlParser.) | |
GetFieldCount(Int32) |
Returns the number of fields with the specified name or index
| |
GetFieldCount(String) |
Returns the number of fields with the specified name or index
| |
GetFieldIndex |
Gets the zero-based index of a field.
(Inherited from EPTXmlParser.) | |
GetHashCode |
Gets the hash code for this EPTXmlParser.
(Inherited from EPTXmlParser.)A developer can use this value to compare the content of two different instances of an EPTXmlParser. | |
GetHashCodeForField(Int32) |
Gets the hash code for a specific field based on its ordinal number.
(Inherited from EPTXmlParser.) | |
GetHashCodeForField(String) |
Gets the hash code for a specific field.
(Inherited from EPTXmlParser.) | |
GetType | (Inherited from Object.) | |
GetValues(Int32) |
Returns an array of all values that exists for a field
(Inherited from EPTXmlParser.) | |
GetValues(String) |
Gets the values at the specified field of the EPT field collection.
(Inherited from EPTXmlParser.) | |
IsEmptyField |
Determines if a field is non-existing or has a value that is empty or null.
(Inherited from EPTXmlParser.) | |
Load |
Loads the storage with new EPT data.
(Inherited from EPTXmlParser.) | |
MemberwiseClone | (Inherited from Object.) | |
Remove |
Remove a single entry in the EPT field collection
| |
Set(String, String) |
Sets the value of an entry in the EPT field collection.
| |
Set(String, Int32, String) |
Sets the value of an entry in the EPT field collection.
| |
SetCategory |
Sets the category id of this instance. This value can only be set if the CategoryID property is zero.
(Inherited from EPTXmlTextParser.) | |
SetDocument |
Sets the document id of this instance. This value can only be set if the DocumentID property is zero.
(Inherited from EPTXmlTextParser.) | |
ToPlainText |
This method gets the EPT data as plain text with all Xml markup removed and using the specified options.
(Inherited from EPTXmlTextParser.) | |
ToString |
Returns the EPT xml using the default UTF-8 encoding
(Inherited from EPTXmlTextParser.) | |
ToString(Encoding) |
Returns the EPT xml as a string encoded with the specified encoding.
(Inherited from EPTXmlTextParser.) | |
TryGetValue(String, String) |
Gets the value associated with the specified field name.
(Inherited from EPTXmlParser.) | |
TryGetValue(String, String, Boolean) |
Gets the value associated with the specified field name.
(Inherited from EPTXmlParser.) | |
Write(Stream) |
Writes the full Xml content of the Ept document to the supplied System.IO.Stream using the default UTF-8 encoding.
(Inherited from EPTXmlTextParser.) | |
Write(Stream, Encoding) |
Writes the full Xml content of the Ept document to the supplied System.IO.Stream using the supplied encoding.
(Inherited from EPTXmlTextParser.) | |
WritePlainText(Stream, String, Boolean) |
Writes the content of the document as plain text to a Stream using specified options and the Unicode encoding
(Inherited from EPTXmlTextParser.) | |
WritePlainText(TextWriter, String, Boolean) |
Writes the content of the document as plain using the supplied a TextWriter, with the specified options.
(Inherited from EPTXmlTextParser.) | |
WritePlainText(StringBuilder, String, Boolean) |
Writes the content of the document as plain text to a StringBuilder using specified options.
(Inherited from EPTXmlTextParser.) | |
WritePlainText(Stream, String, Boolean, Encoding) |
Writes the content of the document as plain text to a Stream using the specified options and a specific encoding
(Inherited from EPTXmlTextParser.) |
Events
Name | Description | |
---|---|---|
EptFieldAdded |
Occurs when an EPT field is added.
(Inherited from EPTXmlParser.) | |
EptFieldRemoved |
Occurs when an EPT field is removed.
(Inherited from EPTXmlParser.) | |
EptFieldValueChanged |
Occurs when a the value of a field changes.
(Inherited from EPTXmlParser.) | |
EptFieldValueChanging |
Occurs when a field value is about to be changed.
(Inherited from EPTXmlParser.) |
Remarks
Note
The SyncronizedEPTDocument class provides a safer an more convenient way of creating, editing and updating Content Studio EPT documents.
Examples
Note
This method does not check that the content to save follows the EPT schema in use, nor does i check that you really save the content into a valid EPT document category. Instead, you might want to use the SyncronizedEPTDocument class for creating, editing and updating Content Studio EPT documents.
//Create a new instance of the EPTXmlEditableParser class EPTXmlEditableParser EPT = new EPTXmlEditableParser(); //Add two fields with values EPT.Add("title", "A news item"); EPT.Add("content", "The content goes here"); //Get the ept document as xml, and saved it to Content Studio as a new document. int EptCategory = 257; using (CSSyncronizedDocument synDoc = new CSSyncronizedDocument(CS_ConnectionId, CS_UserSessionId, EptCategory, "A news item")) { synDoc.Content = EPT.ToString(); synDoc.FileExtension = ".xml"; synDoc.Save(); synDoc.Approve(); }
See Also