Document-database access device6993525Abstract A document-database access device enables a WWW client to access a URL-linked document correctly and efficiently when accessing a document with a URL link if the document with the URL link and the URL-linked document are uploaded onto a document database, and also enables the WWW client to access each document under a particular folder by supplying different URL formats to the document for specifying an individual document even if documents with a single name exist under the particular folder. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
Following the above-described URL, the WWW client obtains the contents of the file "doc0001" from the document database and displays the contents on the monitor. Since the file "doc0001" includes a URL link to the file "note.html", the WWW client interprets the link address as a URL:
To eliminate the disadvantages described above, a document can be specified ID in the document database by using a folder hierarchy and a file name instead of using the document ID. For instance, if the file "doc0001" shown in FIG. 2 can be accessed through a URL:
However, in this document database using URLs, the WWW client must search contents of each folder in order so that a response speed of the document database becomes slow along with a large document-database load. Additionally in a case that documents with a single name exist under a single folder, the WWW client cannot specify the document in the document database using URLs. SUMMARY OF THE INVENTION Accordingly, it is a general object of the present invention to provide a document-database access device that enables a WWW client to access a URL-linked document correctly and efficiently when accessing a document with a URL link if the document with the URL link and the URL-linked document are uploaded onto a document database. It is the other general object of the present invention to provide a document-database access device that enables the WWW client to access each document under a particular folder by supplying different URL formats to the document for specifying an individual document even if documents with a single name exist under the particular folder. The above-described objects of the present invention are achieved by a document-database access device accessing a document database, wherein a document and a folder have names and can be specified by identifiers, and the document can be placed under the folder with hierarchy, the document-database access device including: HTTP-request receiving means for receiving an HTTP request from a WWW client;
It should be noted that, hereinafter, the document or the folder is generally referred to as objects. Other objects, features and advantages of the present invention will become more apparent from the following detailed description when read in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a diagram showing one form of a hypertext; FIG. 2 is a diagram showing a situation in which the hypertext shown in FIG. 1 is simply uploaded onto a document database; FIG. 3 is a block diagram showing a connection of a document-database access device 1 to other devices according to an embodiment of the present invention; FIG. 4 is a block diagram showing the entire structure of the document-database access device 1 according to the embodiment of the present invention; FIG. 5 is a flowchart showing steps for processing an object searching means 13; FIG. 6 is a flowchart showing steps for processing the object searching means 13; and FIG. 7 is a flowchart showing another embodiment of the steps for processing the object searching means 13. DESCRIPTION OF THE PREFERRED EMBODIMENTS A description will now be given of preferred embodiments of the present invention, with reference to the accompanying drawings. FIG. 3 is a block diagram showing a connection of a document-database access device 1 to other devices according to an embodiment of the present invention. A document database 2 stores documents and bibliography information. A client accesses a document in the document database 2 through an API (Application Programming Interface) of the document database 2. A document-database client 4 is a program exclusively used with the document database 2, and is designed to fit to function of the document database 2. The document-database access device 1 is provided so that a general WWW client 3 such as a WWW browser can access the document database 2. The document-database access device 1 works as a client to the document database 2, and as a server when the WWW client 3 accesses it. A document or a folder stored in the document database 2 is specified on a HTTP (Hyper Text Transfer Protocol) by a URL when the WWW client 3 accesses the object through the document-database access device 1. Subsequently, the document-database access device 1 interprets the URL of the object, and accesses the document database 2 by using the API of the document database 2 and the ID of the object. FIG. 4 is a block diagram showing the entire structure of the document-database access device 1 according to the embodiment of the present invention. It should be noted that the document-database access device 1 shown in FIG. 4 is identical to the document-database access device 1 shown in FIG. 3. A HTTP-request receiving means 11 receives a HTTP request from the WWW client 3. The HTTP request includes commands such as GET, PUT or the like. A GET request will be described in this embodiment of the present invention. It should be noted that the same process as the GET request is applied to the other requests. The GET request will now be described. A type of the HTTP request (GET), URL and a HTTP version are recorded on a first line, and a server name or a host name for the document-database access device 1 is recorded on a second line as follows.
Host:hostname If the host name is the name of the document-database access device 1, the URL "/—folder0123/image/foo.gif" is taken out and is passed to a segment dividing means 12. A URL obtained from the first HTTP request line always starts from "/", and the URL "/—folder0123/image/foo.gif" separates each segment with "/". The segment dividing means 12 removes "/" that is placed between each segment, and creates a URL segment table as shown in a TABLE. 1. If the last character of the URL is "/", the segment dividing means 12 sets the content of the last segment empty and stores the empty content to the section with the last segment number.
FIGS. 5 and 6 are flowcharts showing steps for processing an object searching means 13 shown in FIG. 4. The object searching means 13 searches an object corresponding to "Content of Segment" in the URL segment table (TABLE. 1) from the document database 2. By using a character that does not appear as a first character of a folder name or a document name for a first character of an ID, the object searching means 13 can distinguish between the ID and a name of the folder or the document. In this embodiment of the present invention, "—" is used as the first character of the ID, and "—" does not appear as the first character of the name of the folder or the document. Additionally, a character used as the first character of the ID may be changed on different document databases, and the first several characters, for example, "$$$" may also be used for distinguishing between the ID and the name of the object. At a step S1 of FIG. 5, the object searching means 13 determines whether the content of a first segment is the ID. "X" shown in FIGS. 3 and 4 indicates a subfolder number of a current folder. For instance, "X-1" indicates a current folder number. If it is ascertained at the step S1 that the content of the first segment is not an ID, the object searching means 13 sets the highest-ranked folder in the document database 2 as a current folder at a step S7, subsequently sets X=1 at a step S8, and proceeds to a step S4. If it is ascertained at the step S1 that the content of the first segment is an ID, the object searching means 13 searches the folder corresponding to the ID in the document database 2 at a step S2. If the folder corresponding to the ID is found at the step S2, the object searching means 13 sets the folder as the current folder and X=2 at a step S3, and proceeds to the step S4. If no folder corresponding to the ID is found at the step S2, the object searching means 13 ascertains that there is no object corresponding to the URL in the document database 2 at a step S13. At a step S4, the object searching means 13 determines whether X is smaller than a total number of the segments in the URL. If it is ascertained at the step S4 that X is smaller than the total number of the segments, the object searching means 13 proceeds to a step S5, and determines whether the content of the "X"th segment is a folder name under the "X-1"th folder. If the content of the "X"th segment is found to be the folder name at the step S5, the object searching means 13 sets the folder as the current folder and sets X=X+1 at a step S6, and shifts back to the step S4. If the content of the "X"th segment is not found to be the folder name at the step S5, the object searching means 13 ascertains that there is no object corresponding to the URL in the document database 2 at the step S13. The object searching means 13 repeats a step S4, a step S5 and a step S6 until when X is equal to the total number of the segments at the step S4. When X is equal to the total number of the segments at the step S4, the object searching means 13 proceeds to a step S9, and determines whether the content of the last segment of the URL is empty. If the content of the last segment is found to be empty, the object searching means 13 verifies that the object corresponding to the URL is the current folder at a step S10. If the content of the last segment is found to be not empty, at a step S11, the object searching means 13 retrieves the document which name corresponds to the content of the segment under the current folder. At a step S12, the object searching means 13 determines that the document retrieved is the object corresponding to the URL. If the document is not found, the object searching means 13 determines that there is no object corresponding to the URL at the step S13. A description will now be given of another embodiment of processing steps of the object searching means 13. In this embodiment, the object searching means 13 searches a document when accessing the document using the URL shown below.
If the content of a last segment is found to be not empty at the step S9 shown in FIG. 5, the object searching means 13 checks if the content of the last segment starts with the document ID. If the content of the last segment does not start with the document ID, the object searching means 13 proceeds to the step S11 and executes the above-described steps. If the content of the last segment starts with the document ID, the object searching means 13 divides the name that includes the document ID and the following document name into the document ID and the following document name. Even though "—" is used for separating the document ID and the document name in the embodiment of the present invention, a character or a word that appears in neither the document ID nor the document name can be used for separating the document ID and the document name. The object searching means 13 searches the document by using the document ID. If the document is found under the current folder and has the same document name as the document name following the document ID of the URL, the object searching means 13 determines the document under the current folder as the object corresponding to the URL. If no document is found or the document found under the current folder has a different name from the document name following the document ID of the URL, the object searching means 13 determines that there is no object corresponding to the URL. FIG. 7 is a flowchart showing another embodiment of the steps for processing the object searching means 13. In this embodiment, the content of the second segment through the content of the segment that is one before the last segment are ignored. In other words, steps S23, 24 and 25 does not relate to the searching of the object corresponding to the URL. The object searching means 13 searches the document corresponding to the content of the last segment of the URL under the folder that corresponds to the content of the first segment at a step S29. For instance, in the URL segment table as shown in TABLE. 1, the object searching means 13 searches the document with the name "image/foo.gif" under the folder with the ID "—folder 0123". Accordingly, the document-database access device 1 can return the content of a first document to the WWW client 3 in a short amount of time in a case that the WWW client 3 accesses the first document by following the link in a second document while displaying the second document. When a group of HTML documents created on a local machine are uploaded to the document database 2, the WWW client can follow the hyperlink if a relative link is used for the HTML documents. It is possible for the WWW client to follow the hyperlink since the URL that points a document is comprised of a combination of a folder name and a document name. A returning-content creating means 14 shown in FIG. 4 creates a returning content and decides a return code for the HTTP and a necessary header for the object. If the object corresponding to the URL is not found by the object searching means 13, the returning-content creating means 14 creates an HTML document for notifying absence of the object. If the object corresponding to the URL exists, the returning-content creating means 14 sets the content of the object as the returning content. Subsequently, a HTTP-response transmitting means 15 returns the HTML document created by the returning-content creating means 14 with the header to the WWW client 3 that has sent the HTTP request, in the return code decided by the returning-content creating means 14. A description will now be given of a solution to a case that objects with a single name exist under a single folder. In a general file system, several files with a single name cannot be created under a single folder or a single directory. However, documents with a single name can be created under a single folder on some document database. If the single name of the documents is used in the URL, the object searching means 13 cannot specify which document the URL points to. For instance, if there exist several documents with a name "hub.html" under a single folder with a folder ID "—folder0123" as shown below, the object searching means 13 cannot decide which "hub.html" the WWW client 3 is seeking for.
The returning-content creating means 14 sets the HTML document that asks the WWW client 3 which "hub.html" the WWW client 3 needs, as a response content. The returning-content creating means 14 uses the bibliography of "hub.html" and the URL that includes a combination of the document ID and the document name as shown in TABLE. 2 below.
The WWW client 3 displays the response content as shown in TABLE. 2 on a monitor after receiving it from the returning-content creating means 14. A user can just select and click an appropriate content on the monitor to receive the "hub.html" document. Even if the "hub.html" document includes a hyperlink using a URL, the WWW client follows the link, and can retrieve a document linked to the "hub.html" document if the document linked to the "hub.html" is uploaded under the same folder with the "hub.html" document in the document database 2. The above description is provided in order to enable any person skilled in the art to make and use the invention and sets forth the best mode contemplated by the inventors of carrying out the invention. The present invention is not limited to the specifically disclosed embodiments and variations, and modifications may be made without departing from the scope and spirit of the invention. The present application is based on Japanese Priority Application No. 11-257813, filed on Sep. 10, 1999 with the Japanese Patent Office, the entire contents of which are hereby incorporated by reference.
|
Same subclass Same class Consider this |
|||||||||||||||||||||||||||||||||||||||||
