CategoryDef Class Reference

Category Definition. More...

#include <categorydef.h>

List of all members.

Public Member Functions

 CategoryDef (const CategoryDef &copy)
 Copy Constructor.
 CategoryDef (QObject *parent=0)
 Default Constructor.
QString categoryName () const
 Category Name.
QString catName () const
 Return a specially modified categoryName.
QString cfyFieldName () const
 Return the category Clarify field name.
QString cfySeparator () const
 Clarify Seperator.
QString clarifyFieldName () const
 Clarify Field Name.
QString clarifySeparator () const
 Clarify Separator.
bool duplicatesAllowed () const
 Category 'Allows Duplicates' flag.
FieldDef getFieldDef (int index) const
 Get a Field Def by Index.
FieldDef getFieldDef (const QString &name) const
 Get a Field Def by Name.
QList< FieldDefgetFieldDefs () const
 Get Field Defs collection.
QString guidFieldName () const
 GUID Field Name.
bool hasCfyField () const
 Has Clarify Field.
bool hasClarifyField () const
 Category 'has clarify' information.
bool hasGuidField () const
 Return TRUE if this category has a guid field.
bool hasThidField () const
 Return TRUE if this category has a cmcID field.
bool hasVarField () const
 Category 'has var' field.
bool isConnection (const QString &fieldName) const
 Connection Defs collection.
bool isField (const QString &fieldName) const
 Check for Field Name.
bool isPublished () const
 Return if the category is published or not.
bool isShared () const
 Category 'Is Shared' flag.
QString keyFieldName () const
 Return the category Key Field Name.
int maxItems () const
 Maximum number of Items.
CategoryDef operator= (const CategoryDef &copy)
 Assignment Operator.
void rstGuidFieldName ()
 Reset GUID Field Name.
void rstIsPublished ()
 Reset Is Published.
void rstThidFieldName ()
 Reset THID Field Name.
void rstVarFieldName ()
 Reset VAR Field Name.
bool saveExtInfo ()
 Initialize Extended Info.
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 () const
 Definition String.
QString thidFieldName () const
 THID Field Name.
QStringList toStringList () const
 Category Definition String.
QString varFieldName () const
 Return the category Var field name.
 ~CategoryDef ()
 Primary Destructor.


Detailed Description

Category Definition.

Definition at line 75 of file categorydef.h.


Constructor & Destructor Documentation

CategoryDef ( QObject *  parent = 0  ) 

Default Constructor.

Definition at line 810 of file categorydef.cpp.

CategoryDef ( const CategoryDef copy  ) 

Copy Constructor.

Definition at line 821 of file categorydef.cpp.

~CategoryDef (  ) 

Primary Destructor.

This destructor handles cleanup of the object.

Definition at line 848 of file categorydef.cpp.


Member Function Documentation

QString categoryName (  )  const

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 883 of file categorydef.cpp.

QString catName (  )  const

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.

Definition at line 923 of file categorydef.cpp.

QString cfyFieldName (  )  const

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

Definition at line 1149 of file categorydef.cpp.

QString cfySeparator (  )  const

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.

Definition at line 1173 of file categorydef.cpp.

QString clarifyFieldName (  )  const

Clarify Field Name.

Definition at line 1160 of file categorydef.cpp.

QString clarifySeparator (  )  const

Clarify Separator.

Definition at line 1184 of file categorydef.cpp.

bool duplicatesAllowed (  )  const

Category 'Allows Duplicates' flag.

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

Definition at line 992 of file categorydef.cpp.

FieldDef getFieldDef ( int  index  )  const

Get a Field Def by Index.

Definition at line 1443 of file categorydef.cpp.

FieldDef getFieldDef ( const QString &  name  )  const

Get a Field Def by Name.

Definition at line 1431 of file categorydef.cpp.

QList< FieldDef > getFieldDefs (  )  const

Get Field Defs collection.

Definition at line 1419 of file categorydef.cpp.

QString guidFieldName (  )  const

GUID Field Name.

Definition at line 1230 of file categorydef.cpp.

bool hasCfyField (  )  const

Has Clarify Field.

Definition at line 1017 of file categorydef.cpp.

bool hasClarifyField (  )  const

Category 'has clarify' information.

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

Definition at line 1006 of file categorydef.cpp.

bool hasGuidField (  )  const

Return TRUE if this category has a guid field.

Definition at line 1053 of file categorydef.cpp.

bool hasThidField (  )  const

Return TRUE if this category has a cmcID field.

Definition at line 1041 of file categorydef.cpp.

bool hasVarField (  )  const

Category 'has var' field.

Definition at line 1029 of file categorydef.cpp.

bool isConnection ( const QString &  fieldName  )  const

Connection Defs collection.

Check for Connection Name.

Get a Connection Def by Name

Get a Connection Def by Index

Form Defs collection

Get a Form Def by Name

Get a Form Def by Index

Form Defs collection

Get a Form Def by Name

Get a Form Def by Index

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 1544 of file categorydef.cpp.

bool isField ( const QString &  fieldName  )  const

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 1573 of file categorydef.cpp.

bool isPublished (  )  const

Return if the category is published or not.

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

Definition at line 1327 of file categorydef.cpp.

bool isShared (  )  const

Category 'Is Shared' flag.

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

Definition at line 979 of file categorydef.cpp.

QString keyFieldName (  )  const

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

Definition at line 1106 of file categorydef.cpp.

int maxItems (  )  const

Maximum number of Items.

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

Definition at line 966 of file categorydef.cpp.

CategoryDef operator= ( const CategoryDef copy  ) 

Assignment Operator.

Definition at line 833 of file categorydef.cpp.

void rstGuidFieldName (  ) 

Reset GUID Field Name.

Definition at line 1254 of file categorydef.cpp.

void rstIsPublished (  ) 

Reset Is Published.

Definition at line 1351 of file categorydef.cpp.

void rstThidFieldName (  ) 

Reset THID Field Name.

Definition at line 1218 of file categorydef.cpp.

void rstVarFieldName (  ) 

Reset VAR Field Name.

Definition at line 1313 of file categorydef.cpp.

bool saveExtInfo (  ) 

Initialize Extended Info.

Extended info is extended information about the category that gets stored in the Dumont category.

Definition at line 1081 of file categorydef.cpp.

void setGuidFieldName ( const QString &  name  ) 

Set GUID Field Name.

Definition at line 1242 of file categorydef.cpp.

void setIsPublished ( bool  state  ) 

Set Is Published.

Definition at line 1339 of file categorydef.cpp.

void setThidFieldName ( const QString &  name  ) 

Set THID Field Name.

Definition at line 1206 of file categorydef.cpp.

void setVarFieldName ( const QString &  name  ) 

Set VAR Field Name.

Definition at line 1301 of file categorydef.cpp.

QString string (  )  const

Definition String.

Definition at line 952 of file categorydef.cpp.

QString thidFieldName (  )  const

THID Field Name.

Definition at line 1194 of file categorydef.cpp.

QStringList toStringList (  )  const

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 940 of file categorydef.cpp.

QString varFieldName (  )  const

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

Definition at line 1289 of file categorydef.cpp.


The documentation for this class was generated from the following files:




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