EPTXmlEditableParser Class Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

The EPTXmlEditableParser class extends the EPTXmlTextParser by adding editing capabilities.
Inheritance Hierarchy

SystemObject
  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

public class EPTXmlEditableParser : EPTXmlTextParser

The EPTXmlEditableParser type exposes the following members.

Constructors

  NameDescription
Public methodEPTXmlEditableParser
Creates a new EPT field collection object with an initial suggested size of 10 members.
Public methodEPTXmlEditableParser(Int32)
Creates a new EPT field collection object
Public methodEPTXmlEditableParser(Stream)
Creates a new EPTXmlTextParser from a Stream of xml content
Public methodEPTXmlEditableParser(String)
Creates a new EPTXmlTextParser from a string of xml content
Public methodEPTXmlEditableParser(XmlReader)
Creates a new EPT field collection object
Public methodEPTXmlEditableParser(Int32, Stream)
Creates a new EPTXmlTextParser from a stream of xml content
Public methodEPTXmlEditableParser(Int32, String)
Creates a new EPTXmlTextParser from a string of xml content
Public methodEPTXmlEditableParser(Int32, XmlReader)
Creates a new EPT field collection object
Top
Properties

  NameDescription
Public propertyCategoryID
Gets a value that indicates the category where the document belongs.
(Inherited from EPTXmlTextParser.)
Public propertyCount
Gets the number of unique field names in the EPT field collection.
(Inherited from EPTXmlParser.)
Public propertyDocumentID
Gets a value that identifies the document loaded.
(Inherited from EPTXmlTextParser.)
Public propertyDocumentName
Sets or gets the name of the document.
(Inherited from EPTXmlTextParser.)
Public propertyFields
Returns an array of all field names
(Inherited from EPTXmlParser.)
Public propertyHasFields
Gets a value that indicates whether the EPT collection has any fields or not.
(Inherited from EPTXmlParser.)
Public propertyItemString
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.)
Public propertyItemInt32
Gets the entry at the specified index of the the fields collection.
(Inherited from EPTXmlTextParser.)
Public propertyReadOnly
Returns a value that indicates whether this collection of EPT fields is read-only or not
(Overrides EPTXmlTextParserReadOnly.)
Top
Methods

  NameDescription
Public methodAdd
Adds an entry with the specified name and value to the EPT field collection
Protected methodBaseAdd
Adds an entry with the specified name and value to the EPT field collection
(Inherited from EPTXmlParser.)
Protected methodBaseClear
Removes all the fields and their values
(Inherited from EPTXmlParser.)
Protected methodBaseRemove
Removes a field in the EPT field collection
(Inherited from EPTXmlParser.)
Protected methodBaseSet
Sets the value of an entry in the collection of EPT fields
(Inherited from EPTXmlParser.)
Public methodClear
Removes all entires in the EPT field collection
Public methodEquals(Object)
Determines whether the specified Object is an EPTXmlParser that has the same content as the current EPTXmlParser.
(Inherited from EPTXmlParser.)
Public methodEquals(EPTXmlParser)
Determines whether the specified EPTXmlParser has the same content as the current EPTXmlParser.
(Inherited from EPTXmlParser.)
Public methodExistsField
Determines whether a field exists or not
(Inherited from EPTXmlParser.)
Protected methodFinalize (Inherited from Object.)
Public methodGet(Int32)
Gets the values at the specified index of the EPT field collection combined into one comma-separated list.
(Inherited from EPTXmlParser.)
Public methodGet(String)
Gets the values associated with the specified field from the the EPT field collection combined into one comma-separated list.
(Inherited from EPTXmlParser.)
Public methodGetAsDateTime
Returns the value as a DateTime of a specified Content Studio EPT field.
(Inherited from EPTXmlTextParser.)
Public methodGetAsInt32
Returns the value as an Int32 of a specified Content Studio EPT field.
(Inherited from EPTXmlTextParser.)
Public methodGetAsString(String)
Returns the value, as as String of a specified Content Studio EPT field.
(Inherited from EPTXmlTextParser.)
Public methodGetAsString(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.)
Public methodGetEnumerator
Returns an enumerator that iterates through a collection.
(Inherited from EPTXmlParser.)
Public methodGetField
Returns the field name at a specific location
(Inherited from EPTXmlParser.)
Public methodGetFieldCount(Int32)
Returns the number of fields with the specified name or index
Public methodGetFieldCount(String)
Returns the number of fields with the specified name or index
Public methodGetFieldIndex
Gets the zero-based index of a field.
(Inherited from EPTXmlParser.)
Public methodGetHashCode
Gets the hash code for this EPTXmlParser.

A developer can use this value to compare the content of two different instances of an EPTXmlParser.

(Inherited from EPTXmlParser.)
Public methodGetHashCodeForField(Int32)
Gets the hash code for a specific field based on its ordinal number.
(Inherited from EPTXmlParser.)
Public methodGetHashCodeForField(String)
Gets the hash code for a specific field.
(Inherited from EPTXmlParser.)
Public methodGetType (Inherited from Object.)
Public methodGetValues(Int32)
Returns an array of all values that exists for a field
(Inherited from EPTXmlParser.)
Public methodGetValues(String)
Gets the values at the specified field of the EPT field collection.
(Inherited from EPTXmlParser.)
Public methodIsEmptyField
Determines if a field is non-existing or has a value that is empty or null.
(Inherited from EPTXmlParser.)
Protected methodLoad
Loads the storage with new EPT data.
(Inherited from EPTXmlParser.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRemove
Remove a single entry in the EPT field collection
Public methodSet(String, String)
Sets the value of an entry in the EPT field collection.
Public methodSet(String, Int32, String)
Sets the value of an entry in the EPT field collection.
Protected methodSetCategory
Sets the category id of this instance. This value can only be set if the CategoryID property is zero.
(Inherited from EPTXmlTextParser.)
Protected methodSetDocument
Sets the document id of this instance. This value can only be set if the DocumentID property is zero.
(Inherited from EPTXmlTextParser.)
Public methodToPlainText
This method gets the EPT data as plain text with all Xml markup removed and using the specified options.
(Inherited from EPTXmlTextParser.)
Public methodToString
Returns the EPT xml using the default UTF-8 encoding
(Inherited from EPTXmlTextParser.)
Public methodToString(Encoding)
Returns the EPT xml as a string encoded with the specified encoding.
(Inherited from EPTXmlTextParser.)
Public methodCode exampleTryGetValue(String, String)
Gets the value associated with the specified field name.
(Inherited from EPTXmlParser.)
Public methodCode exampleTryGetValue(String, String, Boolean)
Gets the value associated with the specified field name.
(Inherited from EPTXmlParser.)
Public methodCode exampleWrite(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.)
Public methodCode exampleWrite(Stream, Encoding)
Writes the full Xml content of the Ept document to the supplied System.IO.Stream using the supplied encoding.
(Inherited from EPTXmlTextParser.)
Public methodWritePlainText(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.)
Public methodWritePlainText(TextWriter, String, Boolean)
Writes the content of the document as plain using the supplied a TextWriter, with the specified options.
(Inherited from EPTXmlTextParser.)
Public methodWritePlainText(StringBuilder, String, Boolean)
Writes the content of the document as plain text to a StringBuilder using specified options.
(Inherited from EPTXmlTextParser.)
Public methodWritePlainText(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.)
Top
Events

  NameDescription
Public eventEptFieldAdded
Occurs when an EPT field is added.
(Inherited from EPTXmlParser.)
Public eventEptFieldRemoved
Occurs when an EPT field is removed.
(Inherited from EPTXmlParser.)
Public eventEptFieldValueChanged
Occurs when a the value of a field changes.
(Inherited from EPTXmlParser.)
Public eventEptFieldValueChanging
Occurs when a field value is about to be changed.
(Inherited from EPTXmlParser.)
Top
Remarks

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.
Examples

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.

//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

Reference