Method and apparatus for linking data in a distributed data processing system6973656Abstract An apparatus for implementing "links" between objects or content items in applications or documents in a distributed system such that changes to the source objects or items are reflected in changes to the target objects or content items. The apparatus includes mechanisms for allowing users to establish links, to break individual links, to copy documents or content including links, and to determine locations and/or descriptions of the source of a given target or any or all of the multiple targets of a given source. Advantageously, the apparatus of this invention uses remote message passing for communication, thereby permitting links to be established even when the source and target applications execute on different platforms and even when they share no common file system. The apparatus includes an availability server which can serve as a surrogate for applications which are currently not running. This permits targets of links to query the state of a link source, to register/unregister with the link source in order to receive notification of updates, create new links linked to the same link source, and to break their link to the link source, even though the application containing the link source is unavailable. The apparatus of the availability server can be generalized to support the ability to support transparent access from one application to objects of a second application in the face of unavailability of the second application. Claims 1. In a network comprising a first node, a second node and an computer implemented server located at a node separate from the first and second nodes, an availability server method for communicating information between a linking application in the first node and an object of a linked application in the second node, wherein the linked application is in one of an executing state and a non-executing state, wherein state data indicate the object is in one of a loaded state and an unloaded state, the computer implemented method comprising the steps of: Description BACKGROUND OF THE INVENTION
The LinkSource object is created by a source part when a target asks the source to create a link to the content element identified by a particular LinkSpec object. The LinkSource object resides in the source part. There is potentially more than one LinkSource object in the source part. As shown in FIG. 4, each LinkSource object 200 contains:
The LinkTarget object is created when a target part requests a link to the content element specified by a particular LinkSpec object. The LinkTarget object resides in the target document. There is potentially more than one LinkTarget object in the target part. The target part can register with one or more LinkTarget objects. If it is registered, the target part will receive an update message whenever the content element of the particular link associated with a registered LinkTarget object is updated. This message will be generated after the source part has updated the Content object at the source of the link and released the lock on that object. A target part can ask the LinkTarget for the most recent ChangeId associated with this link, and can request a lock on the Content object. If it obtains the lock, it can read the content element of the link. When it is finished reading the content element, it must release the lock. If it is registered, the target part can ask to unregister. As shown in FIG. 10, the Linktarget object 300 contains:
The LinkService object is used to help establish links across documents, and to keep track of the LinkSource objects and LinkTarget objects within a document. There is one LinkService object for each document. As shown in FIG. 4, the information retained in the LinkService object 400 includes:
The Availability Server is used to provide access to the LinkSource object 200, and the content element therein, when the document in which the LinkSource object 200 resides is not open. The Availability Server does this by creating a LinkSourceSurrogate object that is initialized from the persistent state of the LinkSource object that resides in the document, and from the auxiliary state of the LinkSource object that resides in the Availability Server. Preferably, there is one Availability Server per machine running OpenDoc. Thus, file sharing across the network is not necessary for the Availability Server to read this persistent state. Usually a LinkSourceSurrogate will only exist if a document in which the LinkSource resides is closed. However a LinkSource object in the document and a LinkSourceSurrogate in the Availability Server may briefly coexist for the reasons described below. As shown in FIG. 5, the Availability Server maintains the following information:
In addition, additional interfaces are provided by which the source part can:
In addition, additional interfaces are provided by which the target part can:
Additionally, an interface can be provided wherein any part can request the LinkService object to:
An OpenDoc document can be either open or closed. When a document is open, the parts of the document and the associated content element may be loaded into memory and the parts executed as one or more processes by the processor. When a document is closed the parts of the document are not executing and the content elements of the parts are stored in a file (the document file) in non-volatile memory, for example, on the hard disk drive associated with the computer system. When a document A is created on a computer system running an OpenDoc application, a LinkService object 400 associated with the document A is created within the document. The Linkservice object 400 registers with the Availability Server 500 that preferably resides on the same computer system. In the alternative, the Availability Server 500 may be a process that is executing on a remote computer system. The Availability Server 500 generates a unique documentID for document A, for example the number 23 as shown in FIG. 6, and generates a new entry in the table of documents 510 for document A. As shown in FIG. 6, the entry includes the documentID, the location of the document file, and a pointer to the LinkService object. The pointer may be set to "empty" to indicate that the document is closed. The Availability Server 500 then returns the documentID to the Linkservice object 400. The LinkService object 400 preferably stores the documentID and a pointer to the Availability Server 500. Links are established between content elements in different parts. FIGS. 7-10 illustrate the operation of the LinkSpec object 100, the LinkSource object 200, the LinkTarget object 300, the LinkService object 400 and the Availability Server 500 in establishing a link between a source part X of a document A and a target part XX of a document B. As shown in FIG. 7, the first step in establishing the link is to create a LinkSpec object 100 that identifies the content element of the source part X of the document A that will be the source of the link. The LinkSpec object 100 may be created, for example, by the source part X when source part X receives a request to copy selected content element of the part X to the clipboard or to the drag-and-drop. In FIG. 7 for example, the user has selected a cell C2 of a spreadsheet as the content to be linked. The Linkspec object 100 contains a content specifier that identifies the particular content element of the link. The LinkSpec object 100 also contains the pointer to the part, as well as a pointer to source document's LinkService object 400 as shown. After the Linkspec object 100 has been created, the source part X calls a WriteLinkSpec method of the LinkSpec object 100. The WriteLinkSpec method converts the Linkspec object to a platform independent form and copies it to storage that is made accessible to other documents. The platform independent form may utilize, for example, a Bento storage unit and CORBA compliant externalized pointers, such as the externalized reference to a proxy to a stringID discussed in section 6-24 of the SOMobjects Developer Toolkit User's Guide, Version 2.1, October 1994, incorporated by reference above. As shown in FIG. 7, the storage is a clipboard. In the alternative, the storage may be a drag-and-drop buffer, a shared memory region, or a distributed repository. After the Linkspec object 100 is converted and copied to storage, the linking operation turns to the target part XX of a document B as illustrated in FIG. 8. When the target part XX receives a request to establish a link with the content element specified by the externalized Linkspec object 100-1, which may be a user command such as a PASTE AS LINK or a drag and drop, the target part XX creates an in-memory LinkSpec object 100-2 and calls the ReadLinkSpec method, passing it a pointer to the externalized storage. The ReadLinkSpec method initializes the state of the in-memory LinkSpec object 100-2 to the state of the externalized LinkSpec object 100-1, thereby replicating the original LinkSpec object 100 in the target document B. As shown in FIG. 9, the target part XX then requests that a link be created to the source content element specified by the LinkSpec object 100-2 by calling method "AcquireLink" on the LinkService object 400 in the target document B, passing a pointer to the LinkSpec object 100-2. In response to this request, a LinkTarget object 300 is created and initialized in the target document B. The pointer to the source document's LinkService object is then retrieved from the LinkSpec object 100-2, and the method "EstablishLink" is invoked on the LinkService object 400 of the source document A asking that a link be created. This message has several parameters, including the pointer to the source part X, a pointer to the target part YY, and the content specifier identifying the content element of the link. When the Linkservice object 400 of the source document A receives this message, the LinkService object 400 responds by invoking the method "CreateLink" on the source part X asking that it create a link for content element specified by the given content specifier, for example C2 as shown in FIG. 10. If a LinkSource object already exists for the given content specifier (not shown), the source part X returns a pointer to it. If a LinkSource object does not exist for the given content specifier (as shown), the source part X responds by creating a LinkSource object 200, and then returns a pointer to this object. In the case where the source part X creates a new LinkSource object 200, the LinkService object 400 of the source document A invokes the "RegisterLink" method on the Availability Server 500, passing a pointer to the new LinkSource object and the documentID for the document, for example 23 as shown in FIG. 10, to thereby register the new Linksource object 200. The "RegisterLink" method generates a new LinkID (unique to the Availability Server), for example 10 as shown, and associates the new LinkID with the given documentID. The pair <Availability Server Name, LinkID> henceforth serves as a persistent reference to the LinkSource object. The RegisterLink method then writes the DocumentID, the LinkID, and the pointer to the new Linksource object 200 as an entry in the Table of Linksource objects stored in the Availability Server 500, and sets the status field of the entry as "INDOC". The Availability Server 500 then returns the newly generated LinkID to the LinkService object 400 of the document A. The LinkService object 400, in turn, adds a new entry to the table of Link objects stored therein, The new entry includes the new linkID and the pointer to the new Linksource object 200. The LinkService object 400 of the source document A sends a message "InitLinkSrc" to the LinkSource object 200 that indicates the LinkID and the Availability Server name assigned to it by the Availability Server. The LinkService object 400 then calls the "AddTarget" method of the LinkSource object 200, passing several parameters including a pointer to the LinkTarget object 300. The LinkSource object 200, upon invocation of the "AddTarget" method, determines whether the LinkTarget object is local or not. Upon return, the LinkSource object 200 will notify the LinkTarget object 300 whether the LinkTarget object is local or not and which tracking mode is in effect. The tracking mechanism is described below in more detail. If the second mode of tracking is in effect, the LinkSource object 200 will retain a pointer to the LinkTarget object in its table of targets with a newly generated connectionID. This connectionID will be returned to the LinkTarget object. At this point in link establishment, all of the object method invocations return. More specifically, the source part X returns the pointer to the LinkSource object 200 to the LinkService object 400 in the source document A. The LinkService object 400 in the source document A returns the LinkID of the LinkSource object 200, a pointer to the Availability Server 500, and the name of the Availability Server to the LinkTarget object 300 of part XX. The name may be used to locate the Availability Server and restart it if necessary. The LinkTarget object 300 returns a pointer to itself to the LinkService object 400 within the target document B, which updates its table of LinkTarget objects, and then returns the pointer to the link target object to the target part XX. The target part XX can then associate the linked content item (e.g., a bar graph element as shown) to the LinkTarget object. FIGS. 11-13 illustrate the operation of LinkSource object 200, LinkTarget object 300, and the Availability Server 500 when the source part X updates the content element that is the source of the link. When the source part's content element changes, the source part X reflects the changed content element in the Content object 210 of the LinkSource object 200. The source part X controls the frequency with which it updates the Content object 210 of the LinkSource object 200. As shown in FIG. 11 (steps 1-4), to update the Content object 210, the source part X (1) locks the LinkSource object 200, (2) acquires the Content object 210 from the LinkSource object 200, (3) updates the Content object 210 to reflect the changes in the content element, (4) notifies the LinkSource object 200 that the content element has changed by supplying a ChangeID, and (5) releases the lock. When the lock on the LinkSource object 200 is released, the LinkSource object 200 accesses its table of link targets and notifies those LinkTarget objects registered with the particular LinkSource object 200 that the linked content element has been updated. The LinkTarget object 300, upon receipt of this message, invokes the "ContentUpdated" method (step 4) of the target part, passing it a set of parameters including a pointer to itself. The target part XX responds as described below with respect to steps 5-6 of FIG. 11. The target part XX can communicate to the LinkTarget object 300 to (1) check to see if a new version of the Content object 210 exists by examining the changeID stored in the LinkSource object 200; (2) request the LinkSource object 200 to grant the target part XX a lock on the Content object 210 of the LinkSource object 200 such that the target part X can read the Content object 210 and update its own content, if necessary; (3) register/unregister with the LinkSource object 200 to receive/cancel notification of future changes; and (4) request that the LinkSource object 200 provide a description. These calls from the LinkTarget object 300 of the target part XX to the source part X pass a LinkID to identify the particular link related to the call. Generally, the calls from the LinkTarget object 300 of the target part XX to the source part X may be routed directly to the LinkSource object 200 in the source part X or, in the alternative, to the availability server 500. In the preferred embodiment, when the source part X and the target part XX are located in the same document, the calls from the LinkTarget object 300 of the target part XX to the LinkSource object 200 of the source part X are routed directly to LinkSource object 200; yet, when the source part X and the target part XX are located in separate documents (either in the same computer system or in different computer systems), such calls are routed to the Availability Server 500. The Availability Server 500 will know whether the source document is open or closed, where the document is located, and will handle the calls as discussed below. As shown in FIG. 12, the Availability Server 500, upon receiving a call (e.g., lock) from the LinkTarget object 300 of the target part XX, determines whether the document owning the LinkSource object 200 associated with the particular LinkID included in the call is open or closed. If the document is open, the Availability Server 500 must route the call to LinkSource object 200 in the open document. If the document is closed, the Availability Server 500 must route the call to a LinkSourceSurrogate object 600 that resides in the Availability Server 500. The LinkSourceSurrogate object 600 holds the Content object 210 and the auxiliary state of the original LinkSource object 200. The LinkSourceSurrogate object 600 is able to service all calls directed from LinkTarget object 300 to the LinkSource object 200 (except requests to put the LinkSource object 200 in view on the display, which cannot be satisfied when the document owning particular LinkSource object 200 is closed). More specifically, the Availability Server 500 begins by checking the status field within the Table of LinkSource objects stored in the Availability Server 500 that is associated with the particular linkID. If the status field is INDOC (i.e., the document is open and the link is also open), the Availability Server 500 retrieves the pointer to the LinkSource object 200 associated with the particular LinkID and forwards the call there. If the status field is INAS (i.e., the document is closed and a LinkSourceSurrogate object 600 exists in the Availability Server), the Availability Server 500 retrieves the pointer to the LinkSourceSurrogate object 600 associated with the particular LinkID and forwards the call to the LinkSourceSurrogate object 600. If the status field is INBOTH (i.e., the LinkSource object 200 exists in the document and the LinkSourceSurrogate object 600 exists in the Availability Server 500), the Availability Server 500 treats the call exactly as for the status INDOC, except that upon completion of an Unlock call to the LinkSource object 200, the LinkSourceSurrogate object 600 is destroyed and the status field changes to INDOC. Finally, if the status field is UNLOADED, (neither the LinkSourceSurrogate Object 600 nor the LinkSource object 200 exist in the document), the Availability Server 500 checks the Table of Documents 510 stored in the Availability Server 500 to determine if the document associated with the LinkID is currently open or closed. If it is open, the Availability Server 500 requests the LinkService object 400 in the document to acquire access to the LinkSource object 200 and return a pointer to the LinkSource object 200. After receiving the pointer to the LinkSource object, the call is forwarded to the LinkSource object 200. The pointer to the LinkSource object 200 is stored in the appropriate entry in the table of link source objects 520 stored in the Availability Server 500, and the status field of this entry is changed to INDOC. If the document is closed, the Availability Server 500 creates a LinkSourceSurrogate object 600, initializes the LinkSourceSurrogate object 600 by retrieving content from the saved document file (whose name and location has been stored) and the auxiliary state from the Availability Server 500 table of auxiliary states. Once the LinkSourceSurrogate object 600 is created and initialized, the call is forwarded to the LinkSourceSurrogate object 600. The pointer to the LinkSourceSurrogate object 600 is stored in the appropriate entry in the table of link Source objects 520 stored in the Availability Server 500, and the status field of this entry is changed to INAS. As mentioned above, the target part XX may communicate to the LinkTarget object 300 to check to see if the content element that is the source of link has changed. This is accomplished by the LinkTarget object 300 routing a message via the Availability Server 500 to the LinkSource object 200 or the LinkSource object 600 requesting the current changeID. The LinkSource object 200 (or the LinkSourceSurrogate object 600) retrieves the current changeID, which is stored in the LinkSource object 200 (or LinkSourceSurrogate object 600), and returns the current changeID to the LinkTarget object 300. The LinkTarget object 300 forwards the changeID to the target part XX. The target part XX can compare the changeID supplied by the LinkTarget object 300 with the previously stored changeID to determine if the content element that is the source of the link has been updated. As mentioned above, the target part XX may also communicate to the LinkTarget object 300 to request the LinkSource object 200 (or the LinkSourceSurrogate object 600) to grant the target part XX a lock on the Content object 210 of the LinkSource object 200 (or LinkSourceSurrogate object 600) such that the target part X can read the Content object 210. This may occur upon receiving notification that the content element of the link has been updated, or may occur upon receiving a predetermined user command. As shown in FIG. 11 (step 5 and 6), to obtain a lock on the Content object 210, the target part XX invokes a "Lock" method on the Linktarget object 300. The "Lock" method of the LinkTarget object 300 calls via the Availability Server 500 the LinkSource object 200 (or the LinkSourceSurrogate object 600) requesting a lock on the Content object 210, passing the LinkID. If the Content object 210 is locked, the request is blocked until the Content object 210 is unlocked, or a waiting time-limit expires. If the Content object 210 is unlocked, the LinkSource object 200 (or the LinkSourceSurrogate object 600) grants a lock to the LinkTarget object 300 and returns a key to the lock to the Content object 210, which then returns the key to the target part XX. Upon receiving the key to the lock, the target part XX invokes a method "AcquireContentStorageUnit" on the LinkTarget object 300, passing the key. In the "AcquireContentStorageUnit" method, the LinkTarget object 300 via the Availability Server 500 calls the LinkSource object 200 (or the LinkSourceSurrogate object 600) requesting a pointer to the Content object 210, passing the key and the linkID. The LinkSource object 200 (or the LinkSourceSurrogate object 600) checks that the key is valid and, if so, returns to the LinkTarget object 300 a pointer to the Content object 210, which returns the pointer to the target part XX. Upon receiving the pointer to the Content object 210, the target part XX sends one or more messages to the Content object 210 within the LinkSource object 200 (or within the LinkSourceSurrogate object 600) requesting that the Content object 210 transmit to the target part XX portions of the data included in the Content object 210. Upon receipt of this message, the Content object 210 returns the portions of data to the target part XX. Upon receiving the content data from the Content object 210, the target part XX may update the content of the link, if necessary. After retrieving all the content data it desires, the target part XX invokes an "Unlock" method on the LinkTarget object 300, passing the key. In the "Unlock" method, the LinkTarget object 300 via the Availability Server 500 requests that the LinkSource object 200 (or the LinkSourceSurrogate object 600) unlock the Content object 210, passing the key and the LinkID. Upon receiving the unlock request, the LinkSource object 200 (or the LinkSourceSurrogate object 600) checks that the key is valid and, if so, unlocks the Content object 210 and returns a message to the LinkTarget object 300 that the Content object 210 has been unlocked, which then returns to the target part XX. The target part XX may also communicate to the LinkTarget object to register with the LinkSource object to receive notification of future changes. As shown in FIG. 13, the target part XX begins by calling the LinkTarget object 300 requesting that the Linktarget object 300 register itself to receive notification of future updates to the Content object 210 that is the source of the link, passing a pointer to itself. The Linktarget object 300, in turn, stores the pointer to the target part XX and calls via the Availability Server 500 the "Register" method of the LinkSource object 200 (or the LinkSourceSurrogate object 600), passing the LinkID, a pointer to the Linktarget object 300 and a description of the LinkTarget object (not shown). The LinkSource object 200 (or the LinkSourceSurrogate object 600), upon receiving this call, generates an entry in the table of targets including a pointer to the Linktarget object, a description of the Linktarget object, and a new connectionID. The LinkSource object 200 (or the LinkSourceSurrogate object 600) then returns the connectionID to the LinkTarget object 300, which stores the connectionID for un-registration. However, if the second mode of tracking is in effect for this LinkSource object 200, the LinkTarget object 300 will already have a connectionID. In this case, the LinkSource object 200 (or the LinkSourceSurrogate object 600) does not generate a new entry in the table of targets. Similarly, the target part XX may also communicate to the LinkTarget object to un-register with the LinkSource object such that the target part does not receive notification of future changes. The target part XX begins by calling the LinkTarget object 300 requesting that the Linktarget object 300 unregister itself such that it does not receive notification of future updates to the Content object 210 that is the source of the link. The Linktarget object 300, in turn, calls via the Availability Server 500 the "UnRegister" method of the LinkSource object 200 (or the LinkSourceSurrogate object 600), passing the LinkID and the connectionID previously received and stored during registration. The LinkSource object 200 (or the LinkSourceSurrogate object 600), upon receiving this call, deletes the entry in the table of targets corresponding to the connectionID. The method invocations then return. However, if the second mode of tracking is in effect for this LinkSource object, the entry is retained and updated to indicate that the LinkTarget object should no longer receive updates. Similarly, the target part XX may also communicate to the LinkTarget object to request that the LinkSource object provide a description of the source of the link or other relevant information. The target part XX begins by invoking the "GetLinkSourceDescr" of the LinkTarget object 300. The LinkTarget object 300, in turn, calls via the Availability Server 500 the LinkSource object 200 (or the LinkSourceSurrogate object 600) to request the description, passing the LinkID. The LinkSource object 200 (or the LinkSourceSurrogate object 600), upon receiving this call, retrieves the description from storage therein, and returns the description to the target part XX. FIGS. 14-17 illustrate the operation of the LinkSource object 200, the LinkService object 400 of the source document A and the Availability Server 500 when the source document A is closed and re-opened. When an existing document is closed, the LinkService object 400 associated with the document invokes the method "DocClosed" on the Availability Server 500, passing the documentID stored therein. The location of the Availability Server 500 may be identified by the pointer stored by the LinkService object 400. If the pointer is not valid (e.g., the Availability Server 500 has crashed since the document A was opened), the name of the Availability Server 500 may be used to locate the Availability Server 500. In the "DocClosed" method, the Availability Server 500 clears the pointer to the LinkService object of the entry within the table of documents 510 corresponding to the supplied documentID to thereby indicate that the corresponding document is closed. In addition, when source document A is closed, the LinkSource object 200 associated with each link in the document is destroyed, but its persistent representation remains in the document. This is accomplished by the LinkService object 400, for each LinkSource object in the source document, invoking the "LinkClosed" method on the Availability Server 500, passing the current auxiliary state retrieved from the LinkSource object 200 and the linkID associated with that LinkSource object. The Availability Server 500 stores the auxiliary state as entry in the table of auxiliary states keyed by LinkID. In addition, the Availability Server 500 updates the status field associated with the LinkID in the Table of LinkSource objects 520 from "INDOC" to "UNLOADED". Since a document cannot be closed while locks are held on LinkSource objects or LinkSourceSurrogate objects within the document, the INBOTH case cannot exist. As shown in FIG. 14, when an existing document is re-opened, the LinkService object 400 associated with the document first acquires a pointer to the Availability Server 500. This may be accomplished by supplying the name of the Availability Server 500 to the CORBA compliant naming service. If the Availability Server 500 is not currently running, it is started. Next, the LinkService object 400 then invokes the method "DocOpened" on the Availability Server 500, passing the documentID stored therein. In the "DocOpened" method, the Availability Server 500 also updates the entry corresponding to the supplied documentID in the Table of Documents 510 to include a pointer to the LinkService object 400, thereby indicating that the corresponding document is open. In addition, the LinkService object 400 in the open document's process and the Availability Server 500 each check that the current document file location matches the stored document file location. In the event of a mismatch, additional recovery actions are performed to take into account the possibility that the document file has been copied or moved, or that the Availability Server 500 has been restored from an out-of-date file. The recovery actions are discussed in more detail below. In addition, when an existing document is opened, the parts of the document are re-created from their persistent representation. More specifically, for each LinkSource object 200 in the part so reconstructed, the LinkService objects 400 begins a two step initialization process. In the first step, as shown in FIG. 16 the LinkService object 400 invokes the "InitLinkSourcefromStorage" method on the LinkSource object 200. In the "InitLinkSourcefromStorage" method, the LinkSource object 200 returns the LinkID that was previously assigned to the LinkSource object 200 and saved on persistent storage. The LinkService object 400 checks whether the LinkID supplied by the LinkSource object 200 matches an entry in the Table of LinkSource objects 520 in the LinkService object 400. If a match is not found, or if the LinkID is associated with a different LinkSource object (which may be determined by checking storage unit identifiers), then it is detected that the LinkSource object 200 is a copy of the original LinkSource object. Initializing such a copy will be discussed below. If a match is found, the current LinkSource object 200 is the original LinkSource object, and the initialization process proceeds to the second step as illustrated in FIG. 16. In the second step, the LinkService object 400 invokes a "LinkOpen" method on the Availability Server 500, passing the LinkID and a pointer to the LinkSource object 200. The Availability Server 500 updates the status field of the entry within the table of LinkSource objects 520 corresponding to the LinkID to "INDOC" and also stores a pointer to the LinkSource object 200 in the entry. The Availability Server 500 returns to the LinkService object 400 the auxiliary state within the table of auxiliary states that is associated with the LinkID. The auxiliary state may have changed while the document was closed. The LinkService object 400 forwards the LinkID (which in the case of a non-copy is the same linkID) and the auxiliary state to the LinkSource object 200 by invoking the "CompleteInitLinkSourcefromStorage" method on the LinkSource object. The LinkSource object 200 uses the auxiliary state it has previously stored persistently, or the auxiliary state supplied by the Availability Server 500, whichever is more recent. Moreover, if the Availability Server 500 previously created a LinkSourceSurrogate object 600 for this LinkSource object 200, the Availability Server 500 destroys the LinkSourceSurrogate object 600, unless the LinkSourceSurrogate object 600 is in a locked state. If the LinkSourceSurrogate object 600 is in a locked state, the LinkSourceSurrogate object 600 is retained until it is unlocked. In this case, when the Availability Server 500 returns to the LinkService object 400, the Availability Server 500 also informs the LinkService object 400 that the LinkSourceSurrogate 600 is locked. The LinkService object 400, as part of the "CompleteInitLinkSourcefromStorage" method will cause the LinkSource object 200 to initialize in a locked state. The LinkService object 400 updates its table of LinkSource objects 520 to include an entry corresponding to the LinkSource object 200. Moreover, when the document as a whole is moved, the Availability Server 500 is called and given the documentID and the new location of the document. The Availability Server 500 then updates the entry corresponding to the supplied documentID in the Table of Documents 510 to include the new document location. In addition, to minimize main memory space required by the Availability Server 500, the Availability Server 500 may identify from time to time certain entries, for example those entries corresponding to the least recently used LinkSourceSurrogate objects, in the table of LinkSource objects 520 whose status field is "INAS", destroy the corresponding LinkSourceSurrogate objects 600 and convert the status field of one or more of the entries to "UNLOADED" if the corresponding LinkSourceSurrogate object 600 is not locked. In addition, the source part X may include a tracking interface to the LinkSource object that permits the source part X to query the LinkSource object about the target parts to which the LinkSource object is linked. The response to this query may be a description of one or more of the link targets including the host name, document name, and part description of the target part, along with any additional information provided by the target part. The description the target part may also indicate whether or not the target part is currently open or closed. Preferably, the tracking interface can be set in one of two modes: in the first mode, the Linksource object returns the description of only those link targets that are either local (intra-document) or registered (including local and non-local registered targets). In the second mode, the Linksource object returns a description of all targets, including the local, non-local, registered, and non-registered targets. The mode is set by the source part X when the LinkSource object is created. Operating the tracking interface in the first mode as described above may be used to improve the performance of the system by limiting the amount of information stored by the LinkSource. Moreover, it also improves the performance of the system by reducing the number of calls that are made from the link target to the Link source part. The tracking mechanism operates as follows:
In another aspect of the present invention, a document may include an interface to retrieve and display all LinkSource objects and/or LinkTarget objects in the document, or in a particular part within the document. The displayed information related to a LinkSource object preferably includes the machine name, document name, part name, a content description of the source, and other descriptive information related to the Source. The displayed information related to a LinkTarget object preferably includes the machine name, document name, part name, a description of the target, and a boolean flag indicating whether or not the target is registered. To retrieve and display a description of all LinkSource objects in a document, the document begins by invoking the "GetLinkSources" method on the LinkService object 400. The LinkService object 400 retrieves from its table of LinkSource objects 410 pointers to those LinkSource objects within the document and returns the pointers to the document. In turn, for each returned pointer, the document invokes the "DescribeSelf" method on the LinkSource object identified by the pointer, which returns its description stored therein. The descriptions retrieved from each LinkSource object are then displayed to the user. To retrieve and display a description of all LinkSource objects in a particular part of a document, the document begins by invoking the "GetLinkSourcesfor Part" method on the LinkService object 400, passing a reference to the particular part. The LinkService object 400 retrieves from its table of LinkSource objects 410 pointers to those LinkSource objects within the document that match the supplied part reference and returns the pointers to the document. In turn, for each returned pointer, the document invokes the "DescribeSelf" method on the LinkSource object identified by the pointer, which returns its description stored therein. The descriptions retrieved from each LinkSource object are then displayed to the user. To retrieve and display a description of all LinkTarget objects in a document, the document begins by invoking the "GetLinkTargets" method on the LinkService object 400. The LinkService object 400 retrieves from its table of LinkTarget objects 420 pointers to those LinkTarget objects within the document and returns the pointers to the document. In turn, for each returned pointer, the document invokes the "DescribeSelf" method on the LinkTarget object identified by the pointer, which returns its description stored therein. The descriptions retrieved from each LinkTarget object are then displayed to the user. In addition, a user may identify a particular LinkSource object and then request that a description of all targets linked to the particular LinkSource object be displayed. The user may identify the particular LinkSource object by selecting it from the displayed descriptions, which are generated as described above, or by clicking on selected linked content in a part. To retrieve and generate the description of all targets linked to the identified LinkSource object, the document begins by invoking the "GetLinkTargets" method on the identified LinkSource object. The LinkSource object retrieves from its table of targets the description of the targets stored therein, and returns the descriptions to the document. Each description is then displayed to a user. Moreover, an interface may be provided that allows the user to identify a particular LinkSource object and to select and break the link to the LinkTarget objects linked thereto. When the tracking mechanism is operating in the first mode, the interface may be used to select and break the link to any of the LinkTarget objects that are registered or local to the particular LinkSource object. When the tracking mechanism is operating in the second mode, the interface maybe used to select and break the link to any LinkTarget object linked to the particular LinkSource object. The interface operates as described above to generate and display a description of the LinkTarget objects which are either local or registered to the LinkSource object (in case of tracking mode 1) or of all the Targets linked to the LinkSource (in case of tracking mode 2), as described above. The description of the LinkTarget objects may be arranged in the form of a table that includes an entry for each Linktarget object. Each entry of the table is associated with the connectionID of the corresponding LinkTarget object and a pointer to the LinkSource object linked to the corresponding LinkTarget object. A gesture or key stroke is used to select one of the entries. Upon selection of an entry, the interface invokes the "RemoveLinkTarget" of the LinkSource object, passing the connectionID associated with the selected entry. In turn, the LinkSource object deletes the entry in the table of targets stored therein that corresponds to the supplied connectionID. The method invocations then return, and the interface displays the table in updated form. If the LinkTarget object whose link is being broken is currently registered, the LinkSource object will inform the LinkTarget object by calling the "RemoveLink" method of the Linktarget object. Otherwise, the LinkSource object will inform the LinkTarget object that the link is broken the next time the LinkTarget object calls the LinkSource object. Similarly, an interface may be provided that allows the user to select and break the link to a particular LinkTarget object. The interface begins by invoking the "RemoveLink" method of the LinkTarget object. The LinkTarget object, in turn, calls via the Availability Server the LinkSource object (or the LinkSourceSurrogate object) invoking the "RemoveLinkTarget" on the LinkSource object (or the LinkSourceSurrogate object) passing the LinkID as well as the connectionID. The LinkSource object (or the LinkSourceSurrogate object), upon receiving this call, deletes the entry in the table of targets corresponding to the supplied connectionID. The method invocations then return. In addition, the LinkSource objects and LinkTarget objects may be treated as persistent content. This entails that Linksource objects and Linktarget objects can be part of a selection which is copied, either via the clipboard, via drag/drop, or via copying an entire document. When a copied selection includes both a LinkSource object and a LinkTarget object linked to the LinkSource object, the relationship is preserved when copied: that is, a LinkSource object A linked to a LinkTarget object B yields a new LinkSource object A′ linked to a new LinkTarget object B′. However, if the selection includes only the Linktarget object and not the LinkSource object to which it is linked, then a copied Linktarget object is linked to the original Linksource object. However, if the selection includes only the LinkSource object and not ta LinkTarget object to which it is linked, then a copied Linksource object is not linked to the particular LinkTarget object. In OpenDoc, parts which copy structured content (whether including links or not) do so using a "cloning" operation which structurally duplicates the inter-object storage unit (SU) references from the original content to the copied content. The present invention relies on this property whenever a locally linked LinkSource object-Linktarget object pair (i.e., within the same document) is copied. According to the present invention, links are copied as follows. First, copies of LinkSource objects register with the Availability Server and obtain a new LinkID that replaces their older LinkID. And second, when a copy of a LinkTarget object is initialized and it is determined that the LinkTarget object is linked to a local LinkSource object, the Linktarget object calls the local LinkSource object and obtains the Availability Server name and LinkID associated with the local LinkSource object. More specifically, copies of LinkSource objects are recognized by the LinkService object associated with the source part as copies when an existing document is opened and the parts of the document are re-created from their persistent representation. As described above, the LinkService object invokes the "InitLinkSourcefromStorage" method on the LinkSource object, which returns the LinkID associated with the LinkSource object. The LinkService object recognizes a particular LinkSource object is a copy when the LinkID returned by this method either is not in the table of LinkSource objects stored in the LinkService object, or is in the table of LinkSource objects 410 but refers to a different LinkSource object (e.g., one with a different storage unit identifier). As shown in FIG. 17 (Steps 2-6), the LinkService object does not invoke the "LinkOpen" method on the Availability Server as discussed above, instead it invokes the "RegisterLinkSource" method on the Availability Server, passing the DocumentID and a pointer to the LinkSource object. In the "RegisterLinkSource" method, the Availability Server generates a new LinkID (unique to the Availability Server), and associates the LinkID with the DocumentID. The pair <Availability Server Name, LinkID> henceforth serves as a persistent reference to the copied LinkSource object. The RegisterLinkSource method (step 4) then writes the DocumentID, the LinkID, and a pointer to the copied Linksource object as an entry in the table of Linksource objects stored in the Availability Server, sets the status field of the entry as "INDOC", and initializes the auxiliary state of the LinkSource object to empty. The Availability Server then returns (return from step 3) the newly generated LinkID to the LinkService object. The LinkService object, in turn, invokes the "CompleteInitLinkSourcefromStorage" method on the LinkSource object, passing the linkID and an empty auxiliary state, and also adds an entry to its table of LinkSource objects 410 that includes the link ID and the storage unit identifier of the LinkSource object. In the "CompleteInitLinkSourcefromStorage" method, the LinkSource object checks whether the LinkSource object is a copy which is indicated by the LinkID supplied by the LinkService object being different from the LinkID previously stored. If the LinkSource object determines it is a copy, the LinkSource object ignores the auxiliary state previously stored and initializes as empty the table of link targets within the LinkSource object. LinkTarget objects are detected as copies by the LinkService object 200 using a similar mechanism. When a copied Linktarget object is initialized from storage, the LinkTarget object checks whether the storage unit identifier of LinkSource objects to which it is linked are local (in the same document). If so, the Linktarget object invokes the "GetPersistentInfo" method on the LinkSource object, which returns a new Availability name and linkID pair. Additionally, a copied Linktarget object always invokes the "AddNewTarget" method on the LinkSource object, which if the tracking mechanism is in the second mode allows the LinkSource object to record a new entry in the table of LinkTargets stored therein that includes the location and description of the Linktarget object. The pointers to the objects discussed above are preferably persistent Bento references. A more detailed description of a Bento reference may be found in the Bento Specification, available at http://www.cil.org/pub/cilabs/tech/bento/Bento-Specification/postscript, herein incorporated by reference in its entirety. The present invention as described above is embodied as part of an OpenDoc application layer that includes one or more parts, wherein communication among the computer systems occurs between objects that comply with the CORBA standards mentioned above. Moreover, the computer systems of the present invention as described above preferably included a CORBA compliant high-level object communication protocol layer, for example IBM's SOM, and a TCP/IP compliant low-level communication protocol layer, for example IBM's TCP/IP Version 2.0. However, the present invention is not limited in this respect and may be embodied in any distributed data processing system, including telephone systems, cable and wireless television systems, cable and wireless digital audio systems, distributed video systems, and other distributed information systems. For example, the present invention may be embodied in a real-time information delivery system wherein the information source periodically becomes unavailable (for example, by shutting down, or by going idle), and the state of the information source when unavailable is saved. The Availability Server of the present invention may be used to provide access to information source or the saved state, depending upon whether the information source is up and running or unavailable. As described above, the Availability Server of the present invention preferably resides on the same computer system as the information source, stores a pointer to content provided by the information source, and provides access to the content regardless of whether the information source is available or unavailable. However, the invention is not limited in this respect. For example, in some applications, it may be preferred that the Availability Server reside on a separate computer system from the information source. In this case, the Availability Server may store the entire state of the information source when the information source becomes unavailable, and provide access to the stored state when the information source is unavailable. Moreover, the objects as described above are objects created with an object oriented programming system, for example IBM's Visual Age C++. However, the present invention is not limited in this respect. Generally, the objects may be discrete functional components of applications whose state can be saved and retrieved independent of one another. While the invention has been shown and described with reference to particular embodiments thereof, it will be understood by those skilled in the art that the foregoing and other changes in form and detail may be made therein without departing from the spirit and scope of the invention.
|
Same subclass Same class Consider this |
||||||||||
