ViewCtl |
|
ViewCtl is the main interface object. The following alphabetically arranged list of properties and methods belongs to the ViewCtl object:
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
Full descriptions of all ViewCtl Properties and ViewCtl Methods (grouped according to functionality) are provided below.
For descriptions of the different individual objects, see ViewDef, ViewItem, DataGroup, DataSource, DS_Item and DS_Link.
The following table lists the properties of the ViewCtl object, as well as groups of subordinate objects:
Property |
Description | ||||||
Logic to be executed prior to exiting the Views System. See Logic Procedures. | |||||||
Same as for InitLogicType$. | |||||||
Logic to be executed prior to retrieving data. See Logic Procedures. | |||||||
Same as for InitLogicType$. | |||||||
Logic to be executed upon entering the Views System. Reference based on InitLogicType$. See Logic Procedures. | |||||||
Single character string indicating logic type:
| |||||||
Internal key code to be used as the three-character prefix for internal ID values for new views, data sources, items, links and groups. If the given code is not three characters long, it will be left justified and padded on the right with spaces. Default value is 000. Use SetInternalKeyCode( ) method to set. | |||||||
Object specified to supply logic references. See Logic Procedures. | |||||||
Message to be used for the default data group to which views and data sources belonging to no data group are assigned. Use SetUnassignedMessage( ) method to set. | |||||||
Object identifier for LogicObject$. | |||||||
Code number indicating the type of error that caused a method to fail. For code details, use the VError$( ) method or see VError Codes. | |||||||
String to be prefixed to a view description; e.g. "View:". | |||||||
Directory in which to access the Views definition files (pvxview.*). If blank, normal search rules will apply. Read only. Set using SetViewsDirectory( ). | |||||||
The following are local object Groups (*obj/group) that define lists of related objects: | |||||||
Standard group list of DataGroup objects. One object for each data group to which the views and data sources in memory belong. | |||||||
Standard group list of DataSource objects, including the primary and related data sources. | |||||||
Standard group list of ViewDef objects. One object for each view. |
The tables below group different ViewCtl methods according to their functionality. Use the following links to jump to a particular group of methods:
|
|
|
|
|
|
|
|
|
|
|
Loading and Manipulating Definitions in Memory
These load and manipulate the ViewCtl object and its subordinate objects in memory. They do not affect the pvxview.* definition files. To commit any changes to the definition files, invoke the Save( ) method.
Method |
Description | ||||||||||||||||||||||||||||||||||||||||||||||||
Create/name new group definition. | |||||||||||||||||||||||||||||||||||||||||||||||||
Create a DataSource object and initialize its properties with information based on the source.
SrcName$ will vary depending on SrcType$: logical file name (L), PxPlus file name/path or prefix file reference to an external database table (P), object name;tableID (O), or (T) open string for the database table composed of the database file tag ([ODB], [DB2], [OCI]) followed by DSN; table_name;KEY= KeyDef [; other_connection_strings ]: | |||||||||||||||||||||||||||||||||||||||||||||||||
Add a new DS_Item object to the specified data source. If a column name (no trailing "$") is specified, the object is initialized with information derived from the data source driver. If an *asterisk is supplied, all columns in the source will be added. | |||||||||||||||||||||||||||||||||||||||||||||||||
AddItem(VuObjID | VuDesc$, ItemPath$) |
Add a new ViewItem to the specified view, based on the item path. The sequence of the ViewItem objects will be adjusted automatically to ensure they are grouped by their linkage path. | ||||||||||||||||||||||||||||||||||||||||||||||||
AddLink(PSrcDesc$, LSrcDesc$, kno$, KeyDef$) |
Create a new DS_Link object based on the specified parent data source and link source. | ||||||||||||||||||||||||||||||||||||||||||||||||
Create a ViewDef object based on the specified data source. If the data source is not currently in memory, it gets loaded. | |||||||||||||||||||||||||||||||||||||||||||||||||
AssignToDataGroup(Desc$, DataGroup$) |
Assign specified view or data source to a data group. | ||||||||||||||||||||||||||||||||||||||||||||||||
Checks if the description of the view, data source, item, link, or data group has already been used and returns an alternate unused description using a numeric suffix; e.g. Client(2). | |||||||||||||||||||||||||||||||||||||||||||||||||
Clear( ) |
Re-initialize the ViewCtl definition and delete all subordinate objects created by it. (Does not change ViewsDirectory$( ) or InternalKeyCode$.) | ||||||||||||||||||||||||||||||||||||||||||||||||
Clear(SrcObjID) |
Re-initialize the specified ViewDef or DataSource object and delete all subordinate objects. | ||||||||||||||||||||||||||||||||||||||||||||||||
Removes all DataGroup objects. | |||||||||||||||||||||||||||||||||||||||||||||||||
Return the object identifier for the specified DataGroup object. | |||||||||||||||||||||||||||||||||||||||||||||||||
Return the number of DataGroup objects. | |||||||||||||||||||||||||||||||||||||||||||||||||
Return the object identifier for the specified DataSource object. | |||||||||||||||||||||||||||||||||||||||||||||||||
GetDataSourceCount( ) |
Return the number of DataSource objects. | ||||||||||||||||||||||||||||||||||||||||||||||||
Return the ViewItem or DS_Item object identifier. | |||||||||||||||||||||||||||||||||||||||||||||||||
GetItem(SrcObjID, ItemName$ | ItemDesc$) |
Return the ViewItem object identifier of the item with the given name or description. | ||||||||||||||||||||||||||||||||||||||||||||||||
GetItem(VuObjID, ItemPath$ | ColumnName$) |
Return the ViewItem object identifier of the view item which has the given path or column name (no trailing "$"). | ||||||||||||||||||||||||||||||||||||||||||||||||
GetItem(ItemPath$) |
Return the ViewItem object identifier for the item. | ||||||||||||||||||||||||||||||||||||||||||||||||
Return the number of ViewItem or DS_Item objects in the specified ViewDef or DataSource object. | |||||||||||||||||||||||||||||||||||||||||||||||||
GetLink(SrcObjID, idx) |
Return the DS_Link object identifier. | ||||||||||||||||||||||||||||||||||||||||||||||||
Return the object identifier for the specified ViewDef object. | |||||||||||||||||||||||||||||||||||||||||||||||||
Return the number of ViewDef objects. | |||||||||||||||||||||||||||||||||||||||||||||||||
Load(Name$) |
Create a ViewDef or DataSource object and load it using information from the views definition files. Also creates and loads all related items, links and groups. Note: | ||||||||||||||||||||||||||||||||||||||||||||||||
Create a DataGroup object and load with information from the views definition files. | |||||||||||||||||||||||||||||||||||||||||||||||||
Load the data source used in the link. | |||||||||||||||||||||||||||||||||||||||||||||||||
Remove(Name$) |
Remove the specified ViewDef or DataSource object and subordinate objects from memory. | ||||||||||||||||||||||||||||||||||||||||||||||||
Remove the specified DataGroup object from memory. | |||||||||||||||||||||||||||||||||||||||||||||||||
RemoveFromDataGroup(Desc$, GrpDesc$) |
Remove the specified view or data source from a data group. | ||||||||||||||||||||||||||||||||||||||||||||||||
RemoveItem(ObjID, idx) |
Remove a ViewItem or DS_Item object. | ||||||||||||||||||||||||||||||||||||||||||||||||
Remove a DS_Link object. Also removes any ViewItem objects referencing the link. | |||||||||||||||||||||||||||||||||||||||||||||||||
Set CloseLogic$. | |||||||||||||||||||||||||||||||||||||||||||||||||
SetCloseLogic(SrcObjID, Type$, Logic$) |
Set closing logic for a ViewDef or DataSource object. | ||||||||||||||||||||||||||||||||||||||||||||||||
SetCondition(VuObjID, ItmPath$, Code, Case [, v1$...v8$]) |
Set a filter condition at the view item level.
v1$...v8$ - Values to be used in comparison. Pass numeric values as string arguments. Note: | ||||||||||||||||||||||||||||||||||||||||||||||||
Set the Description$ property of any ViewCtl subordinate object. Checks for duplicate descriptions in the views definition files and in memory. Fails if the description is a duplicate. | |||||||||||||||||||||||||||||||||||||||||||||||||
Set the Description$ property of any ViewCtl subordinate object. Checks for duplicate descriptions in the views definition files and in memory. If the description is a duplicate, a unique description will be created and set using the CheckDuplicateDescription $( ) method. The value of Description$ will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||
Set the directory in which the views definition files are located and open them. Will add a trailing delimiter to the ViewDirectory$ property if omitted. Also clears the ViewCtl object of all subordinate objects. | |||||||||||||||||||||||||||||||||||||||||||||||||
Set ExecutionLogic$. | |||||||||||||||||||||||||||||||||||||||||||||||||
Set the filter to be applied at the view level.
Note:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Set InitLogic$. Set A$ to "A" to apply immediately. | |||||||||||||||||||||||||||||||||||||||||||||||||
SetInitLogic(SrcObjID, Type$, Logic$) |
Set initialization logic for a ViewDef or DataSource object. | ||||||||||||||||||||||||||||||||||||||||||||||||
Set the internal key code to be used as the three-character prefix for internal ID values for new views, data sources, items, links and groups. If the given code is not three characters long, it will be left justified and padded on the right with spaces. Default value is 000. | |||||||||||||||||||||||||||||||||||||||||||||||||
Set logic object for a ViewDef or DataSource object. | |||||||||||||||||||||||||||||||||||||||||||||||||
SetLogicObject(ObjNm$ [, A$ ]) |
Set LogicObject$. Set A$ to A to apply immediately. | ||||||||||||||||||||||||||||||||||||||||||||||||
Set the message to be used for the default data group to which views and data sources belonging to no data group are assigned. | |||||||||||||||||||||||||||||||||||||||||||||||||
Translates an ItemPath$ or LinkPath$ from the descriptive format to the format using object identifiers, used by the ViewDef and ViewItem objects.
Returns a string composed of DS_Link and DS_Item object identifiers. Note:
|
LinkPath$ - PrimarySourceDesc$ +SEP [+ LinkDesc$ +SEP...]
ItemPath$ - PrimarySourceDesc$ +SEP [+ LinkDesc$ +SEP...]+ DS_ItemDesc$ (or DS_ItemName$)
The Save( ) method commits the definition held in memory by the ViewCtl object to the pvxview.* definition files. It resolves UpdateStamp$ fields, as well as the internal identifiers in memory, for any new objects created using an Add xxx( ) method. (Internal identifiers are the internal keys used by the views definition files.)
Method |
Description |
Save([ObjID]) |
Commit the definition in memory to the views definition files. Save the definition of the specified view, data source or group, as well as any subordinate items, links and groupings. |
Return the next available internal ID for the specified file (used internally by the Save( ) method). |
Direct Access to Definition Files (Update Methods)
The following ViewCtl methods directly update the pvxview.* definition files without affecting any view definitions currently in memory:
Method |
Description | ||||||||
Change the description of an existing group.
| |||||||||
Copy(Name$, NewName$ [, Group$]) |
Copy view or data source definition (header, items and optional group assignments, if Group$ is specified). Note: | ||||||||
Copy members from one data group to another. If the group being copied to does not exist, it will be created.
| |||||||||
Delete(ViewDesc$ | DS_Desc$) Delete(InternalID$, Type$) |
Deletes a view or data source definition. Can also be based on InternalID (i.e. Src_ID$) and Type$ ("D" = Data source, "V" = View). | ||||||||
Delete the specified group definition. If any views or data sources are "orphaned" by the deletion of the group, they will be placed in the default or unassigned group. | |||||||||
Delete the specified view or data source from the data group. | |||||||||
Disable(DS_Desc$) |
Flag the data source as disabled: Set SRC_TYPE$ field in pvxview.src header to "D" and delete group assignments from pvxview.gpd. Does not remove items or link/view references. | ||||||||
Find views and data sources that do not belong to a data group and put them in the default data group. | |||||||||
Add the views and data sources in the list to the group.
|
Direct Access to Definition Files (Retrieval Methods)
The following ViewCtl methods retrieve information directly from the pvxview.* definition files without regard for any view definition currently in memory:
Method |
Description | ||||||||||||||||||||||||||||||||
Returns a SEP-separated string containing the internal ID's of all data sources referenced in the view specified by ViewDesc$, or a null string if an error occurs. | |||||||||||||||||||||||||||||||||
Returns the internal ID (Grp_ID$) of the specified group. Useful for determining if a group exists. Returns "" (null) if the group does not exist. | |||||||||||||||||||||||||||||||||
Returns the SourceType$ of the specified view or data source. | |||||||||||||||||||||||||||||||||
List$( ) |
Returns a $00$ separated list of views and/or data sources in alphabetic order. The Type$ indicator will determine what is returned:
Bitmap references are: | ||||||||||||||||||||||||||||||||
ListByGroup$([Type$]) |
Returns a list of views and/or data sources sorted by data group. The Type$ indicator will determine what is returned:
Normally, data groups with no items will be suppressed, unless the "S" flag is included. If no bitmap references are included, format of the items will be: DataGroupDesc$+ SEP +View|DataSourceDesc$+ $00$. | ||||||||||||||||||||||||||||||||
ListGroupMembers$(GrpDesc$ [,[LB_Type$]) |
Returns a list of views and data sources which belong to the specified group. The LB_Type$ indicator determines how the output will be formatted:
If no bitmap references are included, the format of individual items in the return value will be:
Bitmap references are:
| ||||||||||||||||||||||||||||||||
Return a SEP-separated list of groups to which a specified data source or view belongs. | |||||||||||||||||||||||||||||||||
Print(Type$ [, Desc$ [,"V"][, Opt$]]) |
Print view and/or data source definitions to the printer or PxPlus Viewer. If the outputting to the printer, "*winprt*;Asis" is used to output directly to the Windows default printer without invoking the printer dialogue box.
|
ViewCtl export and import processing is accomplished using the methods described in the following table:
Method |
Description | ||||||
Export(Channel [, SourceList$]) |
Export the specified definitions to a specially formatted text file. | ||||||
The following methods handle importing definitions: | |||||||
Return a SEP-separated list of the data sources and views included in the exported file. The optional code will determine what source types will be included in the list:
| |||||||
Specify a definition to be imported (must exist in the exported file). (Used in conjunction with Import( )).
| |||||||
Import(Channel) |
Import the data source and view definitions specified previously using the SetImport( ) method, or all the definitions if none have been specified by SetImport( ). In the latter case, merge option 1 (replace) will be used. |
Other ViewCtl methods are described as follows:
Method |
Description |
Return a description of the last view error to occur (based on the contents of the VError property) or of the specified ErrorCode. See VError Codes. The format of the error description is as follows: |