DumontEXE 0.0.1
Public Slots | Public Member Functions | Private Attributes
cmcCategoryDef Class Reference

Category Definition. More...

#include <cmcCategoryDef.h>

Inheritance diagram for cmcCategoryDef:

List of all members.

Public Slots

QString categoryName ()
 Category Name
.
QString catName ()
 Return a specially modified categoryName
.
QString cfyFieldName ()
 Return the category Clarify field name
.
QString cfySeparator ()
 Clarify Seperator
.
QString clarifyFieldName ()
 Clarify Field Name
.
QString clarifySeparator ()
 Clarify Separator
.
cmcConnectionDefconnectionDef (const QString &name)
 Get a Connection Def by Name
.
cmcConnectionDefconnectionDef (long index)
 Get a Connection Def by Index
.
cmcConnectionDefsconnectionDefs ()
 Connection Defs collection
.
bool duplicatesAllowed ()
 Category 'Allows Duplicates' flag
.
cmcFieldDeffieldDef (const QString &name)
 Get a Field Def by Name
.
cmcFieldDeffieldDef (long index)
 Get a Field Def by Index
.
cmcFieldDefsfieldDefs ()
 Get Field Defs collection
.
cmcFormDefformDef (const QString &name)
 Get a Form Def by Name
.
cmcFormDefformDef (long index)
 Get a Form Def by Index
.
cmcFormDefsformDefs ()
 Form Defs collection
.
QString guidFieldName ()
 GUID Field Name
.
bool hasCfyField ()
 Has Clarify Field
.
bool hasClarifyField ()
 Category 'has clarify' information
.
bool hasGuidField ()
 Return TRUE if this category has a guid field
.
bool hasThidField ()
 Return TRUE if this category has a cmcID field
.
bool hasVarField ()
 Category 'has var' field
.
bool isConnection (QString fieldName)
 Check for Connection Name
.
bool isField (QString fieldName)
 Check for Field Name
.
bool isPublished ()
 Return if the category is published or not
.
bool isShared ()
 Category 'Is Shared' flag
.
QString keyFieldName ()
 Return the category Key Field Name
.
long maxItems ()
 Maximum number of Items
.
void rstGuidFieldName ()
 Reset GUID Field Name
.
void rstIsPublished ()
 Reset Is Published
.
void rstThidFieldName ()
 Reset THID Field Name
.
void rstVarFieldName ()
 Reset VAR Field Name
.
void setGuidFieldName (const QString &name)
 Set GUID Field Name
.
void setIsPublished (bool state)
 Set Is Published
.
void setThidFieldName (const QString &name)
 Set THID Field Name
.
void setVarFieldName (const QString &name)
 Set VAR Field Name
.
QString string ()
 Definition String
.
QString thidFieldName ()
 THID Field Name
.
QString varFieldName ()
 Return the category Var field name
.
cmcViewDefviewDef (const QString &name)
 Get a Form Def by Name
.
cmcViewDefviewDef (long index)
 Get a Form Def by Index
.
cmcViewDefsviewDefs ()
 Form Defs collection
.

Public Member Functions

 cmcCategoryDef (const cmcCategoryDef &copy)
 Copy Constructor
.
 cmcCategoryDef (const QString &categoryName, cmcApplication *application, cmcCategoryDefs *parent)
 Standard Constructor
.
QStringList stringList ()
 Category Definition String
.
virtual ~cmcCategoryDef ()
 Primary Destructor
.

Private Attributes

QPointer< cmcConnectionDefsm_cmcConnectionDefs
 Connection Definition Collection
.
QPointer< cmcFieldDefsm_cmcFieldDefs
 Field Definiton Collection
.
QPointer< cmcFormDefsm_cmcFormDefs
 Form Definition Collection
.
QPointer< cmcViewDefsm_cmcViewDefs
 View Definition Collection
.
QStringList m_definition
 Static Definition
.

Detailed Description

Category Definition.

Definition at line 52 of file cmcCategoryDef.h.


Constructor & Destructor Documentation

cmcCategoryDef ( const cmcCategoryDef copy)

Copy Constructor
.

Definition at line 38 of file cmcCategoryDef.cpp.

cmcCategoryDef ( const QString &  categoryName,
cmcApplication application,
cmcCategoryDefs parent 
)

Standard Constructor
.

Definition at line 43 of file cmcCategoryDef.cpp.

~cmcCategoryDef ( ) [virtual]

Primary Destructor
.

This destructor handles cleanup of the object.

Definition at line 54 of file cmcCategoryDef.cpp.


Member Function Documentation

QString categoryName ( void  ) [slot]

Category Name
.

This is an overloaded function of name(). It is provided for convenience because many of the other objects in the system refer to the 'categoryName' and having a consistent interface makes the objects easier to work with.

Definition at line 59 of file cmcCategoryDef.cpp.

QString catName ( ) [slot]

Return a specially modified categoryName
.

This returns a specially modified category name. This method is designed to be used by the keyFieldName, cfyFieldName and varFieldName functions. When applied, this function will return the following results:

                                               (typical)             (typical)
  category name      -  simplified result     Clarify Field         Var Field
 -------------------   -------------------   -------------------   ---------------------
  Person                person                personCfy             personVar
  Company               company               companyCfy            companyVar
  Calendar              calendar              calendarCfy           calendarVar
  New Opportunity       newOpportunity        newOpportunityCfy     newOpportunityVar
  Test Category         testCategory          testCategoryCfy       testCategoryVar
  A Category Name       aCategoryName         aCategoryNameCfy      aCategoryNameVar

There are some specific advantages for using names formatted thusly. For instance if drag-and-drop is being employed on the calendar, then it is important to carefully structure your field names so that fields that are identically named between, say, People and Calendar are fields you WANT identically named. Because, if you drag a person from a People report on to a calendar, then a new calendar item will be created, and all identical fields and connections will be copied from the People category item to the Calendar category item. This is fine for fields you want automatically copied, but it is rather problemmatic for fields you don't want copied such as ID fields and VAR fields and what-not. Using the catNameKey/catNameCfy/catNameVar field naming convention prevents this sort of automatic copying for these critical internal fields.

QString cfyFieldName ( ) [slot]

Return the category Clarify field name
.

This returns the category Clarify field name. Note that categories are not required to have a clarify field - it's just a good idear, especially if the category allows duplicates, and in those cases the clarify field should certainly be set to something that allows one item to be distinguished from another.

The return value of this function will depend on a couple of conditions. Even if an actual, defined, clarify field does not exist for this category, it will attempt to find a possible clarify field by looking for the following fields in the following order:

  • -Defined Clarify Field-
  • "Clarify"
  • "catNameCfy"

For instance, first the category is checked for an actual defined clarify field. If one is not found, then the field "Clarify" is searched for in the list of fields. If that field is not found, then the special "catNameCfy" field is searched for in the list of fields. The "catNameCfy" field is a special field that is developed from a composite of the category name plus the three letter extension "Cfy" using the catName() function.

vbScript Example:
 dim ddll: set ddll = createObject("DumontDLL")
 dim dfrm: set dfrm = ddll.Form(Form)
 dim oCFN:     oCFN = dfrm.cfyFieldName
 msgbox "Field " & oCFN & " is " & dfrm.Field(oCFN).Value
QString cfySeparator ( ) [slot]

Clarify Seperator
.

If this category has a clarify field defined, then this value will indicate the clarify field seperator. This value is used when building 'clarified item' connections and settings.

QString clarifyFieldName ( ) [slot]

Clarify Field Name
.

Definition at line 155 of file cmcCategoryDef.cpp.

QString clarifySeparator ( ) [slot]

Clarify Separator
.

Definition at line 186 of file cmcCategoryDef.cpp.

cmcConnectionDef * connectionDef ( const QString &  name) [slot]

Get a Connection Def by Name
.

Definition at line 285 of file cmcCategoryDef.cpp.

cmcConnectionDef * connectionDef ( long  index) [slot]

Get a Connection Def by Index
.

Definition at line 290 of file cmcCategoryDef.cpp.

cmcConnectionDefs * connectionDefs ( ) [slot]

Connection Defs collection
.

Definition at line 278 of file cmcCategoryDef.cpp.

bool duplicatesAllowed ( ) [slot]

Category 'Allows Duplicates' flag
.

This indicates TRUE if the category allows duplicates or FALSE if not.

cmcFieldDef * fieldDef ( const QString &  name) [slot]

Get a Field Def by Name
.

Definition at line 268 of file cmcCategoryDef.cpp.

cmcFieldDef * fieldDef ( long  index) [slot]

Get a Field Def by Index
.

Definition at line 273 of file cmcCategoryDef.cpp.

cmcFieldDefs * fieldDefs ( ) [slot]

Get Field Defs collection
.

Definition at line 261 of file cmcCategoryDef.cpp.

cmcFormDef * formDef ( const QString &  name) [slot]

Get a Form Def by Name
.

Definition at line 304 of file cmcCategoryDef.cpp.

cmcFormDef * formDef ( long  index) [slot]

Get a Form Def by Index
.

Definition at line 309 of file cmcCategoryDef.cpp.

cmcFormDefs * formDefs ( ) [slot]

Form Defs collection
.

Definition at line 297 of file cmcCategoryDef.cpp.

QString guidFieldName ( ) [slot]

GUID Field Name
.

bool hasCfyField ( ) [slot]

Has Clarify Field
.

Definition at line 130 of file cmcCategoryDef.cpp.

bool hasClarifyField ( ) [slot]

Category 'has clarify' information
.

This indicates TRUE if the cateogy has clarify field information or FALSE if not.

bool hasGuidField ( ) [slot]

Return TRUE if this category has a guid field
.

bool hasThidField ( ) [slot]

Return TRUE if this category has a cmcID field
.

bool hasVarField ( ) [slot]

Category 'has var' field
.

bool isConnection ( QString  fieldName) [slot]

Check for Connection Name
.

This returns TRUE when the FieldName provided is a connection field. This helps to identify an object as a connection when all we have is a field name as provided by the vbScript Form_onEnterField(FieldName) function.

vbScript Example:
 Sub Form_OnEnterField(ByVal FieldName)
   If( dfrm.isField(FieldName) ) then
     msgbox FieldName + " is a field"
   End If
   If( dfrm.isConnection(FieldName) ) then
     msgbox FieldName + " is a Connection"
   End If
 End Sub
See also:
isField

Definition at line 336 of file cmcCategoryDef.cpp.

bool isField ( QString  fieldName) [slot]

Check for Field Name
.

This takes a field name as a parameter and returns 'true' if the field name equates to an actual field in the category. If the field name provided is a connection name, or is not listed then this function returns false.

vbScript Example:
 Sub Form_OnEnterField(ByVal FieldName)
   If( dfrm.isField(FieldName) ) then
     msgbox FieldName + " is a field"
   End If
   If( dfrm.isConnection(FieldName) ) then
     msgbox FieldName + " is a Connection"
   End If
 End Sub
See also:
isConnection

Definition at line 341 of file cmcCategoryDef.cpp.

bool isPublished ( ) [slot]

Return if the category is published or not
.

Published categories are those that are included in XML export/import files.

bool isShared ( ) [slot]

Category 'Is Shared' flag
.

This indicates TRUE if the category is shared or FALSE if not.

QString keyFieldName ( ) [slot]

Return the category Key Field Name
.

This is a short-hand function for getting the keyFieldName on the Form. Every category always has a keyField - also known as the 'Name' field, and this function returns that field that IS the Name field.

vbScript Example:
 dim ddll: set ddll = createObject("DumontDLL")
 dim dfrm: set dfrm = ddll.Form(Form)
 dim oKFN:     oKFN = dfrm.keyFieldName
 msgbox "Field " & oKFN & " is " & dfrm.Field(oKFN).Value
See also:
keyField, cfyField, varField
long maxItems ( ) [slot]

Maximum number of Items
.

This value always returns 500,000 since that is the upper limit of the Commence category item count.

void rstGuidFieldName ( ) [slot]

Reset GUID Field Name
.

Definition at line 216 of file cmcCategoryDef.cpp.

void rstIsPublished ( ) [slot]

Reset Is Published
.

Definition at line 246 of file cmcCategoryDef.cpp.

void rstThidFieldName ( ) [slot]

Reset THID Field Name
.

Definition at line 201 of file cmcCategoryDef.cpp.

void rstVarFieldName ( ) [slot]

Reset VAR Field Name
.

Definition at line 231 of file cmcCategoryDef.cpp.

void setGuidFieldName ( const QString &  name) [slot]

Set GUID Field Name
.

Definition at line 211 of file cmcCategoryDef.cpp.

void setIsPublished ( bool  state) [slot]

Set Is Published
.

Definition at line 241 of file cmcCategoryDef.cpp.

void setThidFieldName ( const QString &  name) [slot]

Set THID Field Name
.

Definition at line 196 of file cmcCategoryDef.cpp.

void setVarFieldName ( const QString &  name) [slot]

Set VAR Field Name
.

Definition at line 226 of file cmcCategoryDef.cpp.

QString string ( void  ) [slot]

Definition String
.

Definition at line 100 of file cmcCategoryDef.cpp.

QStringList stringList ( )

Category Definition String
.

This is the category definition string as returned by the DDE call to to [GetCategoryDefinition(CategoryName)]. This string is delimited by vbCrLf.

This value gets cached on first call, meaning if the category definition changes after this call (unlikely), then this value will be invalid.

Definition at line 93 of file cmcCategoryDef.cpp.

QString thidFieldName ( ) [slot]

THID Field Name
.

QString varFieldName ( ) [slot]

Return the category Var field name
.

This returns the category Var field name. This Var field is that special field that is used to extend the 100-field limit of the Commence categories. This field should ALWAYS be a Memo type field so that a long, multi-line text value can be placed on it.

Dumont assumes the 'name' of this field is a programmed construct of the category name followed by the 'Var' extension. For instance, if the category name is "Calendar", then the var field name would be "calendarVar". If the category name is "Person", then the var field name would be "personVar". And, if the category name is "Rolodex Files", then the var field name would be "rolodexFilesVar". The purpose for this naming convention (besides being consistent) is to prevent field values from one category var field propagating to the var field of another category on a drag/drop operation. For instance, if a person were to be dragged to the calendar, the entire contents of the var field would be dragged along with that item if both the calendar and person categories had their var field defined as "Var". Therefore, var field names are distinguished for each category by name.

vbScript Example:
 dim oVFN:     oVFN = dfrm.varFieldName
 msgbox "Field " & dfrm.varFieldName & " is " & dfrm.Field(dfrm.varFieldName).Value
cmcViewDef * viewDef ( long  index) [slot]

Get a Form Def by Index
.

Definition at line 329 of file cmcCategoryDef.cpp.

cmcViewDef * viewDef ( const QString &  name) [slot]

Get a Form Def by Name
.

Definition at line 324 of file cmcCategoryDef.cpp.

cmcViewDefs * viewDefs ( ) [slot]

Form Defs collection
.

Definition at line 317 of file cmcCategoryDef.cpp.


Member Data Documentation

Connection Definition Collection
.

Definition at line 600 of file cmcCategoryDef.h.

QPointer<cmcFieldDefs> m_cmcFieldDefs [private]

Field Definiton Collection
.

Definition at line 593 of file cmcCategoryDef.h.

QPointer<cmcFormDefs> m_cmcFormDefs [private]

Form Definition Collection
.

Definition at line 607 of file cmcCategoryDef.h.

QPointer<cmcViewDefs> m_cmcViewDefs [private]

View Definition Collection
.

Definition at line 614 of file cmcCategoryDef.h.

QStringList m_definition [private]

Static Definition
.

Definition at line 586 of file cmcCategoryDef.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com