-
Notifications
You must be signed in to change notification settings - Fork 263
Creating Documents for Application Data
A document is a container for application data, so most editors support creating documents. For a general description of document support, see Documents in ATF.
This topic discusses ATF document interfaces an editor implements to create documents.
IDocument
is a simple interface that describes a type of document. For instance, its Type
property gets a text string describing the document type. The DomDocument
class is a general implementation of IDocument
. For greater detail on IDocument
, see IDocument Interface in What is a Document in ATF.
In the ATF Simple DOM Editor Sample, the EventSequenceDocument
class uses
DomDocument
and overrides the Type
property to indicate the document type. For details on this class, see EventSequenceDocument Class.
IDocumentClient
mainly provides methods for document file handling — opening and closing a document — and is implemented by a document client. An editor has a document client for each type of document it can edit. For more information about this interface, see IDocumentClient Interface in What is a Document in ATF.
Several samples contain an Editor
class that implements IDocumentClient
, and these classes are typically MEF components.
For a discussion of using IDocumentClient
methods, see Implementing a Document and Its Client. This discussion uses the ATF Simple DOM Editor Sample as an example, and this sample's IDocumentClient
implementation is also discussed in Editor Component Document Client.
In opening and closing document files, the IDocumentClient
implementation typically provides a way to persist application data. This is easy to do in ATF when you use the ATF DOM and an XML Schema to define the data model. The DomXmlWriter
and DomXmlReader
classes provide a simple way to save data to a file and read it back later. For details on using these classes, see DOM Persistence. That discussion uses the ATF Fsm Editor Sample, but data persistence is handled nearly the same in all ATF samples.
Document handlers also implement IControlHostClient
when a control is used to display a document. Such a control host client specifies the control's behavior, if any, when the control gains or loses focus, or is closed. For information about control clients, see Creating Control Clients. In particular, using the Close()
method checks whether the document is dirty and offers the user the option of saving it, which is generally desired.
The ATF Simple DOM Editor Sample uses a ListView
control to display event sequence documents, so its Editor
class implements a control host client. For details, see Editor Component Control Host Client in Simple DOM Editor Programming Discussion.
Creating an Editor Application
- Designing the Application Data Model with the DOM: Define an application data model that works with the ATF DOM in a data definition language, such as an XML Schema.
- Creating Documents for Application Data: Develop classes that work with documents, using the ATF document interfaces.
- Editing and Selecting Data with Contexts: Create contexts with services for editing and selecting data.
- Creating Data Instances: Create new data instances with the instancing framework.
- Editing Data Properties: Edit properties of data types using property editor components.
-
Role Playing with Adaptation: DOM adapters allow
DomNode
s to play many roles.
- Home
- Getting Started
- Features & Benefits
- Requirements & Dependencies
- Gallery
- Technology & Samples
- Adoption
- News
- Release Notes
- ATF Community
- Searching Documentation
- Using Documentation
- Videos
- Tutorials
- How To
- Programmer's Guide
- Reference
- Code Samples
- Documentation Files
© 2014-2015, Sony Computer Entertainment America LLC