The next step is to query the server using the Query Method that is provided by the InfoStore
object. Query will examine the APS InfoStore for all the InfoObjects you are trying to find.
The result, which is an InfoObjects
collection, is parsed in order to retrieve the selected items. In this case, since the query specified that only folders were to be retrieved, all the InfoObjects will represent directories, or folders. The InfoObjects
collection contains numerous properties of various types, some of which may be simple properties and some of which may be containers or property bags. A property bag may contain more property bags, which may contain additional property bags, and so on. For now, however, only two of these properties are of interest:
The final step in this function is processing the results of your query using the Count
and Item
properties named above. If Count is greater than zero, then the folders that were retrieved will be printed. Paste the following code into your file to finish the function.
//Check that there are folders to view.
//Retrieve the folder IDs from the query result.
Response.Write ("<LI>" + "<A HRef='Home.csp
Server.HTMLEncode(Result.Item(k).Title) + "</A><BR>");
} else Response.Write ("No Sub
The most interesting line in this slice of code is the response:
Response.Write ("<LI>" + "<A HRef='Home.csp
Server.HTMLEncode(Result.Item(k).Title) + "</A><BR>");
The method displays a link to one of the sub
<A href='Home.csp
The link instructs the page Home.csp to be loaded. This page hasn't been discussed yet, but it is important in that it provides the frames definition for a home page. It divides the browser window into three separate frames and loads the Folders pages into the left most frame. See Home Page.
The folder ID is given to the frames page so that it can pass it on to both the Folders.csp page and the Reports.csp page, which you will examine shortly. Consequently, both the Folders page and the Reports page are loaded with a new folder ID
and display both the sub
To give you a better idea of how the links work, here is the HTML code that was produced by the Folders page at the top level of the myAPS folder tree.
<a href='home.csp
<a href='home.csp
There are two top
Note that in this code segment the ID
property is accessed directly without using the Properties
collection. More often than not, however, the Properties property will need to be used in order to access properties in the list. This is because some common properties have been built into the SDK object model while others can only be accessed by using the InfoObject's Properties property. This will be illustrated later in Creating an "Up a Level" link.
RetrieveChildFolders
now prints a list of child folders when given their parent folder's ID
number. You may recall, however, that your original intention was to list all the topRetrieveChildFolders
like this:
RetrieveChildFolders(IStore, 0)
For a complete version of the RetrieveChildFolders
function, see Folders.csp.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |