The disclosures herein relate generally to databases and more particularly to methods and apparatus for accessing information stored in content management systems.
Conventional content management systems, such as that shown in
One approach employed to store items in a content management system is to model an item in a single table. Unfortunately, such as single table approach results in many fields among the rows and columns of the table being unused. Such an approach is inefficient from the storage viewpoint.
What is needed is an apparatus and methodology to provide a superior manner of modeling an item through the use of improved table structures.
When a tree-based table hierarchy is employed to model an item, the number of tables in the model is not known until the model is complete. However, since the number of tables representing a particular item is not initially known, it as also not known how many cursors should be employed to retrieve data from the tables representing the item. To address this problem, a method of organizing information in a content management system is provided. The method includes creating a database including a root table and at least one child table together forming a tree. The method also includes declaring in source code a unique cursor for a table in the tree, and defining in source code an open cursor instruction for the cursor thus declared. The method further includes compiling the source code of the declaring and defining steps into a compiled query assist code structure. The method also includes repeating the declaring, defining and compiling steps for the remaining tables of the tree until a compiled query assist code structure is provided for each table of the tree.
A principal advantage of the embodiment disclosed herein is the solution to the problem of not knowing the correct number of cursors to declare and open in a tree-based table data hierarchy prior to the run time of the data base.
Root table 10 is a person table which stores a PERSON ID (namely an item ID) and first and last name information in respective columns. The PERSON ID is a primary key. Child table 20 is an email table having foreign keys pointing back to primary keys in root table 10. This child email table 20 includes email address information in a column as shown. In this manner email address information is associated back to PERSON ID's in root table 10. Child table 30 is a phone table having foreign keys pointing back to primary keys in root table 10. This child phone table 30 includes phone number information as shown. In this way, phone number information is associated back to PERSON ID's in root table 10.
In this particular example, which will be used to illustrate a problem, the number of tables is static, namely there are three tables 10, 20 and 30 as shown in FIG. 3A. To retrieve information regarding a particular Item ID, application code 40 of
To retrieve information regarding Harry Lowe (whose PERSON ID=1) application code 40 of
In this example, customized code was developed to retrieve the desired information regarding a selected ITEM ID. This customization was possible because the number of tables, and hence the number of cursors to be declared, was already known. Most users will not want to write customized application code to query and retrieve data even if the number of tables and cursors is known in a tree-based hierarchy. Moreover, a very significant problem occurs when the number of tables in a tree-based hierarchy is not known. The table hierarchy is defined at run time and the number of tables in the hierarchy is not known in advance. To further complicate matters, users might desire to revise a database in such a fashion that would later cause additional tables to be added or appended to the existing tree-based hierarchy. Since the number of cursors to be declared is again unknown, customized application code such as application code 40 is simply not able to solve this very significant problem.
To solve this problem where the number of tables representing an item is not known in advance, a content management system is provided which includes a retrieval interface 100 as shown in
For each table in the tree hierarchy created at run time, a respective dynamic link library (DLL) is provided. These DLLs acting together form “access module” 200. In other words, access module 200 may be viewed as a collection of all DLLs. First, access module 200 is created and then later it is invoked to query the library server of the content management system where the tree-based table hierarchy is stored. The creation of the access module of DLLs is now described. As seen in
The generation of DLLs is dynamic because the DLL is not generated until a respective table is added to the database. When a new table is added to the database, another DLL is generated for that table on a one-to-one correspondence basis. For example, if at some time after initial database creation it is decided to add another child table, for example postal address table 40 as shown in
More detail is now provided with respect to access module 200 of
Sample source code for generating the need cursor is set forth below:
The following is representative source code which creates a Select statement based upon the type of input ITEM ID. An entire matching row need not be fetched, but rather selected columns can be retrieved as desired.
It is noted that ICMUT01000001 is an arbitrary name of a particular table named by the user and from which we are retrieving information. WHERE represents a row.
The following is representative source code for declaring a cursor:
The following is representative source code for opening a cursor:
We now need to compile and link the source code to generate a DLL and store the DLL in file system. At run time, the application can load the DLL, invoke the function ICMprocessSelect( ) in the DLL After invoking this function, the application can fetch from this cursor. The cursor name is forced to be different, for example, by naming each cursor with a different name corresponding to each table's respective name for that DLL. In this manner, cursor name conflicts are desirably avoided. The following is representative source code for achieving these functions in Windows NT.
To summarize, since the number of tables which the user may ultimately employ in a content management system is not known, when a tree-based table structure is employed to manage user data, the number of cursors needed to retrieve data from the tables is likewise unknown. In the particular content management system embodiment described, after the user takes an action which creates a table, embedded SQL source code is also created. The embedded SQL source code contains a function that declares a cursor associated with a Select statement from the table and then opens the cursor. This source code is dynamically compiled and linked to generate a DLL (dynamic link library) or shared library (in a UNIX platform). This only needs to be done once per table. When the querying application needs to open all the cursors for all the tables of the tree-based table hierarchy, the system loads the DLL corresponding to each respective table and invokes the function in the DLL to declare a cursor, open the cursor, and fetch all matching data rows (or specified columns in matching rows) in the table with which the particular DLL is associated. In actual practice, the fetching is done in the application side.
The disclosed content management system methodology and apparatus advantageously solves the problem of not knowing the correct number of cursors to declare and open in a tree-based table data hierarchy prior to the run time of the data base. The content management system can be stored on virtually any computer-readable storage media, such as CD, DVD and other magnetic an optical media in either compressed or non-compressed form. Of course it can also be stored in a server computer system.
Although illustrative embodiments have been shown and described, a wide range of modification, change and substitution is contemplated in the foregoing disclosure and in some instances, some features of an embodiment may be employed without a corresponding use of other features. Accordingly, it is appropriate that the appended claims be construed broadly and in a manner consistent with the scope of the embodiments disclosed herein.
Number | Name | Date | Kind |
---|---|---|---|
4751740 | Wright | Jun 1988 | A |
4969091 | Muller | Nov 1990 | A |
5615337 | Zimowski et al. | Mar 1997 | A |
5644768 | Periwal et al. | Jul 1997 | A |
5742810 | Ng et al. | Apr 1998 | A |
5774719 | Bowen | Jun 1998 | A |
5778398 | Nagashima et al. | Jul 1998 | A |
5799310 | Anderson et al. | Aug 1998 | A |
5819252 | Benson et al. | Oct 1998 | A |
5862378 | Wang et al. | Jan 1999 | A |
5875332 | Wang et al. | Feb 1999 | A |
5892902 | Clark | Apr 1999 | A |
5940616 | Wang | Aug 1999 | A |
6012067 | Sarkar | Jan 2000 | A |
6016394 | Walker | Jan 2000 | A |
6047291 | Anderson et al. | Apr 2000 | A |
6055637 | Hudson et al. | Apr 2000 | A |
6063133 | Li et al. | May 2000 | A |
6065117 | White | May 2000 | A |
6067414 | Wang et al. | May 2000 | A |
6088524 | Levy et al. | Jul 2000 | A |
6104393 | Santos-Gomez | Aug 2000 | A |
6128621 | Weisz | Oct 2000 | A |
6148342 | Ho | Nov 2000 | A |
6161182 | Nadooshan | Dec 2000 | A |
6167405 | Rosensteel, Jr. et al. | Dec 2000 | A |
6173400 | Perlman et al. | Jan 2001 | B1 |
6219826 | De Pauw et al. | Apr 2001 | B1 |
6233586 | Chang et al. | May 2001 | B1 |
6263313 | Milsted et al. | Jul 2001 | B1 |
6263342 | Chang et al. | Jul 2001 | B1 |
6272488 | Chang et al. | Aug 2001 | B1 |
6279111 | Jensenworth et al. | Aug 2001 | B1 |
6282649 | Lambert et al. | Aug 2001 | B1 |
6289344 | Braia et al. | Sep 2001 | B1 |
6289458 | Garg et al. | Sep 2001 | B1 |
6292936 | Wang | Sep 2001 | B1 |
6308274 | Swift | Oct 2001 | B1 |
6314449 | Gallagher et al. | Nov 2001 | B1 |
6327629 | Wang et al. | Dec 2001 | B1 |
6338056 | Dessloch et al. | Jan 2002 | B1 |
6339777 | Attaluri et al. | Jan 2002 | B1 |
6343286 | Lee et al. | Jan 2002 | B1 |
6539396 | Bowman-Amuah | Mar 2003 | B1 |
6550057 | Bowman-Amuah | Apr 2003 | B1 |
6578068 | Bowman-Amuah | Jun 2003 | B1 |
6601234 | Bowman-Amuah | Jul 2003 | B1 |
20010002486 | Kocher et al. | May 2001 | A1 |
20010008015 | Vu et al. | Jul 2001 | A1 |
20010019614 | Madoukh | Sep 2001 | A1 |
Number | Date | Country |
---|---|---|
WO 9922362 | May 1999 | WO |
Number | Date | Country | |
---|---|---|---|
20030204478 A1 | Oct 2003 | US |