Once you have logged on to the APS and have a valid EnterpriseSession (see the Getting Started Tutorial for details), you can query the APS InfoStore for InfoObjects using InfoStore.Query. When you query the APS InfoStore, the result that is returned is always a collection of InfoObjects.
Typically, when you query the InfoStore for InfoObjects, you retrieve the objects that have been instantiated by a specific desktop plugin, and not the plugin itself. For example, the following query returns a single report object:
Result = InfoStore.Query("Select TOP 1 SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report'");
The above query uses the SI_PROGID property to specify the type of object that will be retrieved.
Authentication and destination plugins are static, and they must be retrieved directly with the SI_NAME property. For example, the following query returns the secEnterprise plugin:
Result = InfoStore.Query("Select SI_ALIAS_AUTOADD From CI_SYSTEMOBJECTS Where SI_NAME = 'secEnterprise'");
Tip: SI_NAME for each destination plugin takes the same form as SI_PROGID. For example, SI_NAME = 'CrystalEnterprise.Ftp'.
Like the authentication and destination plugins, the administration plugins are static; however, unlike other static plugins, the administration plugins cannot be queried for directly. Administration plugins allow you to monitor all of the servers in the system, which means the servers needs to be retrieved first. The following query returns a collection of APS server objects:
var ServerObjects = IStore.Query("SELECT SI_NAME, SI_SERVER_KIND FROM CI_SYSTEMOBJECTS Where SI_PROGID='CrystalEnterprise.Server' AND SI_SERVER_KIND = 'aps'");
Once the server objects are retrieved, you can use the PluginInterface property to access the server plugin's ServerAdmin property, which can then be used to retrieve the APS Administration plugin. For example:
var ServerPlugin = ServerObjects.Item(1).PluginInterface(""); var APSAdminPlugin = ServerPlugin.ServerAdmin;
Note: For further details on using each type of plugin, see Desktop plugins, Authentication plugins, Administration plugins, and Destination plugins.
After you have retrieved an InfoObject from the InfoStore, you need some method of accessing the data specific to the object. Some properties can be accessed only through the InfoObject's Properties collection. However, in most cases, you can use the interface provided by the appropriate plugin DLL.
Next: Plugin interface
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |