DASchema

Overview

The DASchema class represents the complete or partial data model for your server application, including the data tables and relationships between them, commands, Update Rules and other elements.

DASchema usually is serialized into .daSchema Files which can be edited by Schema Modeler application.

Location

 

appendScript:

method appends given JavaScript to the Schema scripts collection

- (void) appendScript:(NSString *)script

Parameters:

  • script: JavaScript as string

businessRuleScript  retain

read/write property which returns business rule script from the schema level

@property (retain) DASchemaServerBusinessRuleScript *businessRuleScript

commandByName:

Returns DASchemaCommand by given name. Command name is case sencetive. If DASchema does not have command with given name then returns nil.

- (DASchemaCommand *) commandByName:(NSString *)commandName

Parameters:

  • commandName: Name of the command we need to retrieve.

commands  retain

Represents collection of the DASchemaCommand

@property (retain) NSMutableArray *commands

customAttributes  retain

Represents custom attibutes that user can apply to given DASchema and use it later for its own purposes.

@property (retain) NSString *customAttributes

initWithData:

Initializes DASchema with given XML data stream.

- (id) initWithData:(NSData *)data

Parameters:

  • data: XML data stream.

initWithName:    (declared in DASchemaBaseObject)

Initializes a new instance of the class with a given name.

- (id) initWithName:(NSString *)aName

Parameters:

  • aName:

initWithXml:    (declared in DASchemaBaseObject)

Initializes a new instance of the class with a given XML string. Here, the XML string is the XML node from the Schema XML file that represents a certain schema object, for example the Schema Data Table or Schema Parameter. In most cases you will not need to invoke this method directly on the DASchemaBaseObject. This method is overridden in descendant classes (for example in the DASchemaDataTable) where it can be used for deserializing schema XML into a schema object.

- (id) initWithXml:(NSString *)anXml

Parameters:

  • anXml:

joins  retain

Represents collection of the DASchemaJoins. Not implemented at the moment.

@property (retain) NSMutableArray *joins

name  retain    (declared in DASchemaBaseObject)

Represents the name of the schema object. Name is a mandatory property and an exception will be raised if its value is nil or empty. Only alpha-numeric characters are allowed in the Name value.

@property (retain) NSString *name

note  retain    (declared in DASchemaBaseObject)

Description for schema object

@property (retain) NSString *note

relations  retain

Represents collection of the DASchemaRelations

@property (retain) NSMutableArray *relations

schemaWithData:

Creates and initializes DASchema with given XML data stream.

+ (id) schemaWithData:(NSData *)data

Parameters:

  • data: XML data stream.

schemaWithXml:

Creates and initializes DASchema with given XML string.

+ (id) schemaWithXml:(NSString *)anXml

Parameters:

  • anXml: XML string.

tableByName:

Returns DASchemaTable by given name. Table name is case sencetive. If DASchema does not have table with given name then returns nil.

- (DASchemaDataTable *) tableByName:(NSString *)tableName

Parameters:

  • tableName: Name of the table we want to retrieve

tables  retain

Represents collection of the DASchemaTables

@property (retain) NSMutableArray *tables

unions  retain

Represents collection of the DASchemaUnions

@property (retain) NSMutableArray *unions

updateRules  retain

Represents collection of the DASchemaUpdateRules

@property (retain) NSMutableArray *updateRules

version  assign

Schema version

@property (assign) int version

xmlAsData

Returns content of the DASchema as XML data stream

- (NSData *) xmlAsData

xmlAsString

Returns content of the DASchema as XML string

- (NSString *) xmlAsString

 

businessRuleScript  retain

read/write property which returns business rule script from the schema level

@property (retain) DASchemaServerBusinessRuleScript *businessRuleScript

commands  retain

Represents collection of the DASchemaCommand

@property (retain) NSMutableArray *commands

customAttributes  retain

Represents custom attibutes that user can apply to given DASchema and use it later for its own purposes.

@property (retain) NSString *customAttributes

joins  retain

Represents collection of the DASchemaJoins. Not implemented at the moment.

@property (retain) NSMutableArray *joins

name  retain    (declared in DASchemaBaseObject)

Represents the name of the schema object. Name is a mandatory property and an exception will be raised if its value is nil or empty. Only alpha-numeric characters are allowed in the Name value.

@property (retain) NSString *name

note  retain    (declared in DASchemaBaseObject)

Description for schema object

@property (retain) NSString *note

relations  retain

Represents collection of the DASchemaRelations

@property (retain) NSMutableArray *relations

tables  retain

Represents collection of the DASchemaTables

@property (retain) NSMutableArray *tables

unions  retain

Represents collection of the DASchemaUnions

@property (retain) NSMutableArray *unions

updateRules  retain

Represents collection of the DASchemaUpdateRules

@property (retain) NSMutableArray *updateRules

version  assign

Schema version

@property (assign) int version

 

schemaWithData:

Creates and initializes DASchema with given XML data stream.

+ (id) schemaWithData:(NSData *)data

Parameters:

  • data: XML data stream.

schemaWithXml:

Creates and initializes DASchema with given XML string.

+ (id) schemaWithXml:(NSString *)anXml

Parameters:

  • anXml: XML string.

 

appendScript:

method appends given JavaScript to the Schema scripts collection

- (void) appendScript:(NSString *)script

Parameters:

  • script: JavaScript as string

commandByName:

Returns DASchemaCommand by given name. Command name is case sencetive. If DASchema does not have command with given name then returns nil.

- (DASchemaCommand *) commandByName:(NSString *)commandName

Parameters:

  • commandName: Name of the command we need to retrieve.

initWithData:

Initializes DASchema with given XML data stream.

- (id) initWithData:(NSData *)data

Parameters:

  • data: XML data stream.

initWithName:    (declared in DASchemaBaseObject)

Initializes a new instance of the class with a given name.

- (id) initWithName:(NSString *)aName

Parameters:

  • aName:

initWithXml:    (declared in DASchemaBaseObject)

Initializes a new instance of the class with a given XML string. Here, the XML string is the XML node from the Schema XML file that represents a certain schema object, for example the Schema Data Table or Schema Parameter. In most cases you will not need to invoke this method directly on the DASchemaBaseObject. This method is overridden in descendant classes (for example in the DASchemaDataTable) where it can be used for deserializing schema XML into a schema object.

- (id) initWithXml:(NSString *)anXml

Parameters:

  • anXml:

tableByName:

Returns DASchemaTable by given name. Table name is case sencetive. If DASchema does not have table with given name then returns nil.

- (DASchemaDataTable *) tableByName:(NSString *)tableName

Parameters:

  • tableName: Name of the table we want to retrieve

xmlAsData

Returns content of the DASchema as XML data stream

- (NSData *) xmlAsData

xmlAsString

Returns content of the DASchema as XML string

- (NSString *) xmlAsString