Project
Overview
A Project is a logical container for related FormLayout, DataSource and DataField definitions. It divides a Repository into logical units.
Exactly one GlobalProject is available for both a Repository or a stand-alone FormLayout. In the case of a Repository additional Project objects can be created by the user.
For each Project TFORMer Designer creates a subfolder below the main Repository file. FormLayouts, which are member of this Project are stored in this subfolder.
A stand-alone FormLayout can only use the GlobalProject (it references the FormLayout itself). The GlobalProject of a Repository can't be used to reference FormLayouts.
DataFields and DataSources defined in a Project are usable exclusively by FormLayouts which are member exactly of this Project.
DataFields and DataSources defined in the GlobalProject are usable by all FormLayouts in all Projects.
Working with Data Fields
Iterate through data fields: Start with TFormer_GetFirstProjectVarIt and continue with TFormer_GetNextProjectVarIt.
Check field usage: Use TFormer_ProjectVarItGetUsage to check whether a field is used in a particular form layout.
Example
To retrieve all Project objects within a Repository do the following:
ERRCODE eCode = ErrOk;
HPROJECT_ITERATOR itProject = NULL;
LPCSTR pszProjectName = NULL;
BOOL bProjectValid = FALSE;
// Retrieve the first Project
itProject = TFormer_GetFirstProjectIt (hTForm, &eCode);
bProjectValid = (itProject != NULL);
// TYPE_E_ELEMENTNOTFOUND should not be treated as error
if (eCode == TYPE_E_ELEMENTNOTFOUND)
eCode = ErrOk;
while (bProjectValid && eCode == ErrOk)
{
pszProjectName = TFormer_ProjectItGetName (itProject, &eCode);
if (pszProjectName != NULL && eCode == ErrOk)
printf ("project name: '%s'\n", pszProjectName);
// Get the next Project
bProjectValid = (TFormer_GetNextProjectIt (itProject) == ErrOk);
}
TFormer_FreeProjectIt (itProject);
Attention
The Project is only valid as long as it is available in the Repository. If it is removed from the Repository all instances of the Project immediately become invalid.