@begin(header) author: ack@amt.media.mit.edu show_author: ShowNone author_organization: MIT node_expert: x-ag@guilder.mit.edu expiration_date: 10/29/93 last_modifier: ack@amt.media.mit.edu last_mod_date: 10/29/91 mod_num: 2 @end(header) -------------------------------- Multiple Answer Garden Databases -------------------------------- Mark Ackerman ackerman@xv.mit.edu ackerman@athena.mit.edu 10/28/91 Some people want to have more than 1 information database in a single Answer Garden application. For example, one might have one database about the X Window System (with the information supplied by MIT) and another database about Unix (with the information supplied locally). These would be separate information databases, and updates to one would not violate the others. Having multiple databases is easy. Example ------- Let's assume you want 3 databases database1 X Window System database2 Macintosh programming database3 Unix shell scripts You want these to appear as one database to end-users. While authoring, editing, and updating, you want these to appear as 3 separate databases. How to do this -------------- The way to do this is to place each database in a separate directory. Each will have a separate AGNodeFile, and thus each one can be accessed through a separate Answer Garden directory. In addition, there will be one additional AGNodeFile that ties the 3 information databases together. You need to know about the format of the AGNSFile and the include directive. The AGNSFile ------------- Data about each Answer Garden node is stored in an Ascii file called the AGNSFile. (This is a reserved name.) It is located in the directory specified by the Directory resource in the app-defaults file. The AGNSFile contains one record per node. The format is node name #node type #label #physical location See the node "Using the authoring system" for more information about the AGNSFile. The include directive --------------------- There is a special node type to include a whole new AGNodeFile, the "include" directive. It is conceptually the same as having a #include in a .c file. Thus, the line: whatever #include #reserved #./database2 will include the AGNodeFile in the subdirectory "./database2" Note that this location is relative to the directory specified by the Directory resource in the app-defaults file. Do not use the label slot. You can put anything you want in the node name slot. The example re-visited ---------------------- The 3 AGNodeFiles for database1, database2, and database3 look like standard Answer Garden AGNodeFiles. That is, they contain lists of node names, types, labels, and physical locations. The AGNodeFile that ties them together is: first #include #reserved #./X second #include #reserved #./Mac third #include #reserved #./shell If the AnswerGarden*Directory resource is set to "/u/AG/", then the first database will be found in "/u/AG/X/". All of the nodes found in that directory (and specified by the AGNodeFile there) will be included in Answer Garden. NOTE: All node names must be unique to the entire Answer Garden application. Thus, you cannot have 3 nodes named "Root". If you do this, Answer Garden will "find" only the first one specified (in the current implementation).