Packageat.data
Classpublic class DataInterface
ImplementsIDataInterface

A Class with static methods accessible from anywhere in the program without needing to manage references to it.

The database filename should be set in GlobalSettings.databaseName.

This class serves as the middleman between the front end (GUI) of eVE and the backend application data store. It provides many of eVE's dataProviders and is used in modules and UI components throughout the application. This class is designed to be the centralized point for datastore reading/writing for eVE.

There are a variety of methods stored in this class that call helper classes using SQL to return parameter based data.

Typical return types are XML or XMLList.

See also

GlobalSettings.databaseName


Public Properties
 PropertyDefined by
  debugMode : Boolean = false
[static] Outputs useful information for debugging this component for developers when true.
DataInterface
Protected Properties
 PropertyDefined by
  disp : EventDispatcher
[static] The event dispatcher for the static class.
DataInterface
Public Methods
 MethodDefined by
  
DataInterface(caller:Function = null)
DataInterface
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[static]
DataInterface
  
dispatchEvent(event:Event):void
[static]
DataInterface
  
getBookmark(callID:int):XML
[static] Returns the bookmark data in XML format for a single call
DataInterface
  
getBookmarks(indicationID:int):XML
[static] Returns all bookmark data in XML form for an indication.
DataInterface
  
getBookmarkStructure(callID:int):XML
[static] Deprecated, use getBookmark.
DataInterface
  
getBookmarkStructures(indicationID:int):XML
[static] Deprecated, use getBookmarks.
DataInterface
  
getBrand(brandID:int, getCachedIfExists:Boolean = true):XML
[static] Method for getting the data for a single brand from the data store with an id matching the brandID parameter.
DataInterface
  
getBrandByIndicationID(indicationID:int, getCachedIfExists:Boolean = true):XML
[static] Returns the brand of the specified indication.
DataInterface
  
getBrands(getCachedIfExists:Boolean = true):XMLList
[static] Method for getting all brands in the database.
DataInterface
  
getBrandSlides(brandID:int, addDependencySlides:Boolean = true, getCachedIfExists:Boolean = true):XMLList
[static] Returns an XMLList of all slides belonging to the specified brand.
DataInterface
  
getCall(callID:int, addDependencySlides:Boolean = true, getCachedIfExists:Boolean = false):XML
[static] Returns the data related to the specified call in XML format.
DataInterface
  
getCalls(indicationID:int, addDependencySlides:Boolean = true, getCachedIfExists:Boolean = false):XML
[static] Returns all calls belonging to an indication
DataInterface
  
getCallSectionData(callID:uint):XML
[static] Returns XML with a childlist of section XML nodes of all sections represented by this call's slides.
DataInterface
  
getCallStructure(callID:int):XMLList
[static] Deprecated.
DataInterface
  
getCallStructures(indicationID:int):XML
[static] Deprecated.
DataInterface
  
getDBChangesByCallId(callId:int, setViewed:Boolean = false):DBUpdateChanges
Returns a data object with any changes to the database since the last synchronizer changes.
DataInterface
  
getIndication(indicationID:int, getCachedIfExists:Boolean = true):XML
[static] Returns the data related to the specified indication in XML
DataInterface
  
getIndicationByCallID(callID:int, getCachedIfExists:Boolean = true):XML
[static] Returns the indication that a call belongs to.
DataInterface
  
getIndications(brandID:int, getCachedIfExists:Boolean = true):XMLList
[static] Returns all indications belonging to a brand.
DataInterface
  
getIndicationSlideData(indicationID:int, getCachedIfExists:Boolean = true):XMLList
[static] Returns an XMLList of all sections belonging to an indication each of which have a child list of slides that belong to the section (for the specified indication)
DataInterface
  
getIndicationSlideDataWithDependencies(indicationID:int, getCachedIfExists:Boolean = true):XMLList
[static] Returns an XMLList of all sections belonging to an indication each of which have a child list of slides that belong to the section (for the specified indication)
DataInterface
  
[static]
DataInterface
  
getRepBag(indicationID:int, getCachedIfExists:Boolean = true):XMLList
[static] Method for getting the rep bag data in XML format for an indication.
DataInterface
  
getSectionByID(sectionID:int):XML
[static] Returns Section XML based upon the section id provided.
DataInterface
  
getSlideByDbid(slideId:int):XML
[static] Returns the slide xml and depencies for the supplied dbid.
DataInterface
  
getSlideTitle(slideId:int):String
[static] Returns the slide title for the supplied id.
DataInterface
  
initializeDatabase(overwriteExistingAppStorageDB:Boolean = false):void
[static] Method for setting up the application database.
DataInterface
  
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
[static]
DataInterface
  
updateCallTitleAttrib(callID:int, title:String, titleAbbr:String):void
[static] Updates properties of the specified call.
DataInterface
  
updateCustomizedBookmarkStructure(data:XML):BookmarkTransaction
[static] Method for placing data for a single bookmark into the application database.
DataInterface
  
updateCustomizedBookmarkStructures(data:XMLList):BookmarkTransaction
[static] Method for placing data for a multiple bookmarks into the application database.
DataInterface
  
updateCustomizedCallStructure(data:XML):CallTransaction
[static] Method for placing a customized call data into the application database.
DataInterface
  
updateCustomizedCallStructures(data:XMLList):CallTransaction
[static] Method for placing a customized call data into the application database.
DataInterface
  
updateDefaultCallID(indicationID:int, callID:int):void
[static] Sets the default call id for for the specified indication.
DataInterface
Protected Methods
 MethodDefined by
  
Dispatches an event from the DataInterface static class indicating that the DataInterface.updateCustomizedBookmarkStructure static function has completed.
DataInterface
  
Dispatches an event from the DataInterface static class indicating that the DataInterface.updateCustomizedBookmarkStructures static function has completed.
DataInterface
Property detail
debugModeproperty
public static var debugMode:Boolean = false

Outputs useful information for debugging this component for developers when true.

The output is typically in the form of trace statements and Alerts.

The default value is false.

dispproperty 
protected static var disp:EventDispatcher

The event dispatcher for the static class.

See also

flash.events.EventDispatcher
Constructor detail
DataInterface()constructor
public function DataInterface(caller:Function = null)Parameters
caller:Function (default = null)
Method detail
addEventListener()method
public static function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

Parameters
type:String
 
listener:Function
 
useCapture:Boolean (default = false)
 
priority:int (default = 0)
 
useWeakReference:Boolean (default = false)

See also

flash.events.EventDispatcher
dispatchEvent()method 
public static function dispatchEvent(event:Event):void

Parameters
event:Event

See also

flash.events.EventDispatcher
getBookmark()method 
public static function getBookmark(callID:int):XML

Returns the bookmark data in XML format for a single call

Parameters
callID:int — id of the call

Returns
XML
getBookmarks()method 
public static function getBookmarks(indicationID:int):XML

Returns all bookmark data in XML form for an indication.

Parameters
indicationID:int — id of the indicaiton.

Returns
XML
getBookmarkStructure()method 
public static function getBookmarkStructure(callID:int):XML

Deprecated, use getBookmark.

Parameters
callID:int

Returns
XML

See also

getBookmarkStructures()method 
public static function getBookmarkStructures(indicationID:int):XML

Deprecated, use getBookmarks.

Parameters
indicationID:int

Returns
XML

See also

getBrand()method 
public static function getBrand(brandID:int, getCachedIfExists:Boolean = true):XML

Method for getting the data for a single brand from the data store with an id matching the brandID parameter.

Parameters
brandID:int — id of the brand to return from the database.
 
getCachedIfExists:Boolean (default = true) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XML — XML node representing a brand
getBrandByIndicationID()method 
public static function getBrandByIndicationID(indicationID:int, getCachedIfExists:Boolean = true):XML

Returns the brand of the specified indication.

Parameters
indicationID:int — id of the indication.
 
getCachedIfExists:Boolean (default = true) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XML
getBrands()method 
public static function getBrands(getCachedIfExists:Boolean = true):XMLList

Method for getting all brands in the database.

Parameters
getCachedIfExists:Boolean (default = true) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XMLList — XMLList of all brands in the database
getBrandSlides()method 
public static function getBrandSlides(brandID:int, addDependencySlides:Boolean = true, getCachedIfExists:Boolean = true):XMLList

Returns an XMLList of all slides belonging to the specified brand.

Parameters
brandID:int — id of the brand
 
addDependencySlides:Boolean (default = true) — if true, adds child XML nodes to each slide in the returned list if the parent slide node has business rule dependencies. The child list will consist (in order) of mustPrecede children, a copy of the parent, then mustFollow children.
 
getCachedIfExists:Boolean (default = true) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XMLListXMLList of slide XML nodes.
getCall()method 
public static function getCall(callID:int, addDependencySlides:Boolean = true, getCachedIfExists:Boolean = false):XML

Returns the data related to the specified call in XML format.

Parameters
callID:int — id of the call
 
addDependencySlides:Boolean (default = true) — if true, adds child XML nodes to each slide in the returned list if the parent slide node has business rule dependencies. The child list will consist (in order) of mustPrecede children, a copy of the parent, then mustFollow children.
 
getCachedIfExists:Boolean (default = false) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XMLXML whose attributes are properties of the specified call.
getCalls()method 
public static function getCalls(indicationID:int, addDependencySlides:Boolean = true, getCachedIfExists:Boolean = false):XML

Returns all calls belonging to an indication

Parameters
indicationID:int — id of the indication whose calls we want to retrieve
 
addDependencySlides:Boolean (default = true) — if true, adds child XML nodes to each slide in the returned list if the parent slide node has business rule dependencies. The child list will consist (in order) of mustPrecede children, a copy of the parent, then mustFollow children.
 
getCachedIfExists:Boolean (default = false) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XML — XMLList of all calls of the specified indication.
getCallSectionData()method 
public static function getCallSectionData(callID:uint):XML

Returns XML with a childlist of section XML nodes of all sections represented by this call's slides. If there is only one slide in a call, there will be only one section. If there are three slides in this call all belonging to the same section, then there will still only be one section in the result list. However, if five slides are in the call all belonging to a different section, then five sections will be in the result list.

NOTE: This does not return all sections for an indication or brand.

Parameters
callID:uint — id of the call

Returns
XML
getCallStructure()method 
public static function getCallStructure(callID:int):XMLList

Deprecated. Use getCall

Parameters
callID:int

Returns
XMLList
getCallStructures()method 
public static function getCallStructures(indicationID:int):XML

Deprecated. Use getCalls.

Parameters
indicationID:int

Returns
XML
getDBChangesByCallId()method 
public function getDBChangesByCallId(callId:int, setViewed:Boolean = false):DBUpdateChanges

Returns a data object with any changes to the database since the last synchronizer changes.

Parameters
callId:int — The database Id of the call you want to check against.
 
setViewed:Boolean (default = false) — If true, it will set these changes wasViewed property to Y and these changes will not appear again.

Returns
DBUpdateChanges

See also

at.data.DBUpdateChanges
getIndication()method 
public static function getIndication(indicationID:int, getCachedIfExists:Boolean = true):XML

Returns the data related to the specified indication in XML

Parameters
indicationID:int — id of the indication
 
getCachedIfExists:Boolean (default = true) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XMLXML whose attributes are properties of the specified indication.
getIndicationByCallID()method 
public static function getIndicationByCallID(callID:int, getCachedIfExists:Boolean = true):XML

Returns the indication that a call belongs to.

Parameters
callID:int — id of the call
 
getCachedIfExists:Boolean (default = true) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XMLXML whose attributes are properties of the specified indication.
getIndications()method 
public static function getIndications(brandID:int, getCachedIfExists:Boolean = true):XMLList

Returns all indications belonging to a brand.

Parameters
brandID:int — returns the data from the previous call to this method (if the exact same parameters are sent).
 
getCachedIfExists:Boolean (default = true)

Returns
XMLList — XMLList of all indications of the specified brand
getIndicationSlideData()method 
public static function getIndicationSlideData(indicationID:int, getCachedIfExists:Boolean = true):XMLList

Returns an XMLList of all sections belonging to an indication each of which have a child list of slides that belong to the section (for the specified indication)

Parameters
indicationID:int — id of the indication
 
getCachedIfExists:Boolean (default = true) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XMLList — an XMLList of sections (each with a childlist of slides)
getIndicationSlideDataWithDependencies()method 
public static function getIndicationSlideDataWithDependencies(indicationID:int, getCachedIfExists:Boolean = true):XMLList

Returns an XMLList of all sections belonging to an indication each of which have a child list of slides that belong to the section (for the specified indication)

Parameters
indicationID:int — id of the indication
 
getCachedIfExists:Boolean (default = true) — returns the data from the previous call to this method (if the exact same parameters are sent).

Returns
XMLList — an XMLList of sections (each with a childlist of slides)
getInstance()method 
public static function getInstance():DataInterface

Returns
DataInterface
getRepBag()method 
public static function getRepBag(indicationID:int, getCachedIfExists:Boolean = true):XMLList

Method for getting the rep bag data in XML format for an indication.

Parameters
indicationID:int — id of the indication.
 
getCachedIfExists:Boolean (default = true)

Returns
XMLList
getSectionByID()method 
public static function getSectionByID(sectionID:int):XML

Returns Section XML based upon the section id provided.

Parameters
sectionID:int

Returns
XML
getSlideByDbid()method 
public static function getSlideByDbid(slideId:int):XML

Returns the slide xml and depencies for the supplied dbid.

Parameters
slideId:int

Returns
XML
getSlideTitle()method 
public static function getSlideTitle(slideId:int):String

Returns the slide title for the supplied id.

Parameters
slideId:int

Returns
String
initializeDatabase()method 
public static function initializeDatabase(overwriteExistingAppStorageDB:Boolean = false):void

Method for setting up the application database. The database filename should be set in GlobalSettings.databaseName. This method first checks to see if there is a database residing in the application storage directory. If there is not a new database is created. The method then checks to see if a database resides in the application directory of the project. If a database is found in the application directory of the project a size comparison is initiated. If the size of the database found in the application directory is larger than the database in the application storage directory then the database in the application directory is moved to the application storage directory where it overwrites the database presently there. This is essentially how a pre-populated database is installed for the project.

Note: A word about the application storage directory on Windows and Mac machines.

Access to the SQLite eve2.db file on Vista machines:

The AppData/Roaming directory in Windows Vista is equivalent to the Application Data directory that is found in the Documents and Settings directory in Windows XP. The AppData/Roaming folder is also typically hidden in Vista. To unhide this folder (and others), open the Folder Options in the Vista Control Panel, and on the "View" tab, change the option to "show hidden files and folders", and click ok. Note: If there is an underscore in the name of the project it is changed to a dash in the application storage directory automatically.

For Mac users the application storage directory looks like this:

Users/[ username ]/Library/Preferences/[ projectname ]/Local Store/eve2.db

For Windows Vista users the application storage directory looks like this:

C:/Users/[ username ]/AppData/Roaming/[ projectname ]/Local Store/eve2.db

For Windows (non-Vista) users the application storage directory looks like this:

C:/Documents and Settings/[ username ]/Application Data/[ projectname ]/Local Store/eve2.db

To include a database in a final version of the project before doing a Build Release... simply open the properties up the project and navigate to the Flex Build Path panel and click the Add Folder... button. Browse to the database that should be located in the application storage directory of your computer and in the subdirectory that is associated with your project (see above) and click the OK button. A Release Build... after this step insures proper compiling of the database into the project bundle.

Parameters
overwriteExistingAppStorageDB:Boolean (default = false)

See also

GlobalSettings.databaseName
onUpdateCustomizedBookmarkStructureComplete()method 
protected function onUpdateCustomizedBookmarkStructureComplete(e:SQLEvent):void

Dispatches an event from the DataInterface static class indicating that the DataInterface.updateCustomizedBookmarkStructure static function has completed.

Parameters
e:SQLEvent
onUpdateCustomizedBookmarkStructuresComplete()method 
protected function onUpdateCustomizedBookmarkStructuresComplete(e:SQLEvent):void

Dispatches an event from the DataInterface static class indicating that the DataInterface.updateCustomizedBookmarkStructures static function has completed.

Parameters
e:SQLEvent
removeEventListener()method 
public static function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void

Parameters
type:String
 
listener:Function
 
useCapture:Boolean (default = false)

See also

flash.events.EventDispatcher
updateCallTitleAttrib()method 
public static function updateCallTitleAttrib(callID:int, title:String, titleAbbr:String):void

Updates properties of the specified call.

Parameters
callID:int — id of the call whose properties are being updated.
 
title:String — new title of the specified call.
 
titleAbbr:String — new title abbreviation of the specified call.
updateCustomizedBookmarkStructure()method 
public static function updateCustomizedBookmarkStructure(data:XML):BookmarkTransaction

Method for placing data for a single bookmark into the application database. This method relies on properly formed XML data and XML data that matches the return model for this item type. Valid attributes consist of any variety, however, it is essential that 'dbid' within the slide nodes is ever-present to insure proper data insertion into the application database.

Parameters
data:XML

Returns
BookmarkTransaction

Example
   <bookmark id="1" title="Custom Eveacore Call Config 1" titleAbbr="ABC" callid="1" isEditable="true">
     <slide dbid="15" id="section4-slide4" ... />
     <slide dbid="3" id="section1-slide3" ... />
     <slide dbid="25" id="section6-slide3" ... />
     <slide dbid="11" id="section3-slide2" ... />
     <slide dbid="23" id="section6-slide1" ... />
     <slide dbid="4" id="section1-slide4" ... />
   </bookmark>
    

updateCustomizedBookmarkStructures()method 
public static function updateCustomizedBookmarkStructures(data:XMLList):BookmarkTransaction

Method for placing data for a multiple bookmarks into the application database. This method relies on properly formed XML data and XML data that matches the return model for this item type. Valid attributes consist of any variety, however, it is essential that 'dbid' within the slide nodes is ever-present to insure proper data insertion into the application database.

Parameters
data:XMLList

Returns
BookmarkTransaction

Example
   <bookmark id="1" title="Custom Eveacore Call Config 1" titleAbbr="ABC" callid="1" isEditable="true">
     <slide dbid="15" id="section4-slide4" ... />
     <slide dbid="3" id="section1-slide3" ... />
     <slide dbid="25" id="section6-slide3" ... />
     <slide dbid="11" id="section3-slide2" ... />
     <slide dbid="23" id="section6-slide1" ... />
     <slide dbid="4" id="section1-slide4" ... />
   </bookmark>
   <bookmark id="2" title="Custom Eveacore Call Config 2" titleAbbr="DEF" callid="2" isEditable="true">
     <slide dbid="6" id="section1-slide6" ... />
     <slide dbid="17" id="section5-slide3" ... />
     <slide dbid="56" id="section7-slide3" ... />
     <slide dbid="13" id="section4-slide5" ... />
     <slide dbid="5" id="section1-slide5" ... />
     <slide dbid="19" id="section5-slide5" ... />
   </bookmark>
    

updateCustomizedCallStructure()method 
public static function updateCustomizedCallStructure(data:XML):CallTransaction

Method for placing a customized call data into the application database. This method relies on properly formed XML data and XML data that matches the return model for this item type. Valid attributes consist of any variety, however, it is essential that: 1. 'id' attribute in call node be present (unique identifier). 2. 'dbid' within the slide nodes is present (unique identifier).

Parameters
data:XML

Returns
CallTransaction

Example
     <call type="default" id="1" title="Default Cialis Call Config 1" titleAbbr="ABC" isEditable="false">
      <slide dbid="9" id="section2-slide2" ... />
      <slide dbid="8" id="section2-slide1" ... />
      <slide dbid="2" id="section1-slide2" ...>
       <slide dbid="2" id="section1-slide2" ... />
       <slide dbid="3" id="section1-slide3" ... />
       <slide dbid="4" id="section1-slide4" ... />
       <slide dbid="5" id="section1-slide6" ... />
      </slide>
     </call>
   

updateCustomizedCallStructures()method 
public static function updateCustomizedCallStructures(data:XMLList):CallTransaction

Method for placing a customized call data into the application database. This method relies on properly formed XML data and XML data that matches the return model for this item type. Valid attributes consist of any variety, however, it is essential that: 1. 'id' attribute in call node be present (unique identifier). 2. 'dbid' within the slide nodes is present (unique identifier).

Parameters
data:XMLList

Returns
CallTransaction

Example
     <call type="custom" id="1" title="Custom Cialis Call Config 1" titleAbbr="ABC" isEditable="true">
      <slide dbid="9" id="section2-slide2" ... />
      <slide dbid="8" id="section2-slide1" ... />
      <slide dbid="2" id="section1-slide2" ...>
       <slide dbid="2" id="section1-slide2" ... />
       <slide dbid="3" id="section1-slide3" ... />
       <slide dbid="4" id="section1-slide4" ... />
       <slide dbid="5" id="section1-slide6" ... />
      </slide>
     </call>
     <call type="custom" id="2" title="Custom Cialis Call Config 1" titleAbbr="DEF" isEditable="true">
      <slide dbid="92" id="section9-slide2" ... />
      <slide dbid="18" id="section2-slide6" ... />
     </call>
   

updateDefaultCallID()method 
public static function updateDefaultCallID(indicationID:int, callID:int):void

Sets the default call id for for the specified indication.

Parameters
indicationID:int — id of the indication whose default call is being set
 
callID:int — id of the call that is now the default for the specified indication.