YggNav.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Bob Hagmann December 14, 1988 4:02:21 pm PST
This interface provides the navigational interface to Yggdrasil.
DIRECTORY
Rope USING [ROPE],
YggDID USING [DID],
YggEnvironment USING [TransID],
YggRep USING [AccurateGMTRep, Attribute, DocType, TypedPrimitiveElement];
YggNav: CEDAR DEFINITIONS
~ BEGIN
ROPE: TYPE ~ Rope.ROPE;
Errors
ErrorDesc: TYPE = RECORD [code: ATOM, explanation: ROPE]
← [NIL, NIL];
An error description reports the code ATOM indicating exactly what went wrong. The "explanation" is intended to be a description of the error suitable for human consumption; it frequently contains the name of the object being operated upon.
Error: ERROR [error: ErrorDesc];
Transactions
Note: none of the root operations operate under transaction control
StartTransaction: PROC [parentTrans: YggEnvironment.TransID] RETURNS [trans: YggEnvironment.TransID];
Start up a new transaction.
EndTransaction: PROC [trans: YggEnvironment.TransID, commit: BOOL] RETURNS [ok: BOOL];
Commit or abort a transaction.
CheckTransaction: PROC [trans: YggEnvironment.TransID] RETURNS [found: BOOL, active: BOOL, committed: BOOL];
Check on a transaction. If it no found, then active and committed are not meaningful. If found, then if active then committed is not meaningful. If not active, then the commit state is returned in committed. Old transactions will not be found.
Root objects
Note: none of the root operations operate under transaction control
GetRoots: PROC RETURNS [roots: LIST OF YggDID.DID];
Get all the root objects for the service.
AddRoot: PROC [did: YggDID.DID] RETURNS [ok: BOOL];
Add a root object. If the DID does not exist, FALSE will be returned.
RemoveRoot: PROC [did: YggDID.DID] RETURNS [ok: BOOL];
Remove a root object. If the DID is not a root object, FALSE will be returned.
Object contents
GetTypeOfContents: PROC [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [YggRep.DocType];
Get the contents of the object with the specified did.
Errors: $invalidDID, $invalidTrans
GetUninterpretedContents: UNSAFE PROC [trans: YggEnvironment.TransID, did: YggDID.DID, firstByte: CARD, byteCount: CARD, to: LONG POINTER] RETURNS [bytesMoved: CARD];
Get the contents of the object with the specified did. The contents must not be a well known interpreted type (e. g., int, date, float, ...)
Errors: $invalidDID, $invalidTrans, $invalidReservedType
GetContents: PROC [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [contents: YggRep.TypedPrimitiveElement];
Get the contents of the object with the specified did.
Errors: $invalidDID, $invalidTrans
SetUninterpretedContents: UNSAFE PROC [trans: YggEnvironment.TransID, did: YggDID.DID, setDocType: BOOL, docType: YggRep.DocType, firstByte: CARD, byteCount: CARD, from: LONG POINTER] RETURNS [bytesMoved: CARD];
Set the contents of the object with the specified did. The object is grown if needed. The contents type is changed if setDocType is TRUE to docType.
Errors: $invalidDID, $invalidTrans
SetContents: PROC [trans: YggEnvironment.TransID, did: YggDID.DID, contents: YggRep.TypedPrimitiveElement];
Set the contents of the object with the specified did. The object is grown if needed.
Errors: $invalidDID, $invalidTrans
GetSize: PROC [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [size: CARD];
Set the contents of the object with the specified did. The object is grown if needed.
Errors: $invalidDID, $invalidTrans
SetSize: PROC [trans: YggEnvironment.TransID, did: YggDID.DID, size: CARD];
Set the size contents of the object with the specified did. The object is grown if needed.
Errors: $invalidDID, $invalidTrans
Object property manipulation
GetProperty: PROC [trans: YggEnvironment.TransID, did: YggDID.DID, propertyName: ROPE] RETURNS [propertyExists: BOOL, property: LIST OF YggRep.Attribute];
Get the named property of the object with the specified did. If the property does not exist, [FALSE, NIL] is returned.
Errors: $invalidDID, $invalidTrans
GetAllProperties: PROC [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [properties: LIST OF YggRep.Attribute];
Get all the properties of the object with the specified did. If no properties exist, NIL is returned.
Errors: $invalidDID, $invalidTrans
ListAllProperties: PROC [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [propertyNames: LIST OF ROPE];
Get all the property names of the object with the specified did. If no properties exist, NIL is returned.
Errors: $invalidDID, $invalidTrans
SetProperty: PROC [trans: YggEnvironment.TransID, did: YggDID.DID, propertyName: ROPE, property: YggRep.Attribute, appendProperty: BOOL];
Set the named property of the object with the specified did. If appendProperty is TRUE, the property is appended. If FALSE, it first destroys all properties with this name. A NIL value for the property with appendProperty as TRUE is a noop, and with appendProperty as FALSE deletes the property. A non-NIL value for the property with appendProperty as FALSE makes the new property the one and only value for the property.
Errors: $invalidDID, $invalidTrans
Object property construction
Note: all of these procedures copy data.
ConstructIntTPE: PROC [int: INT32] RETURNS [property: YggRep.TypedPrimitiveElement];
Construct a YggRep.TypedPrimitiveElement for a 32 bit integer.
ConstructFloatTPE: PROC [float: REAL32] RETURNS [property: YggRep.TypedPrimitiveElement];
Construct a YggRep.TypedPrimitiveElement for a 32 bit real.
ConstructDateTPE: PROC [date: YggRep.AccurateGMTRep] RETURNS [property: YggRep.TypedPrimitiveElement];
Construct a YggRep.TypedPrimitiveElement for a date.
ConstructShortRopeTPE: PROC [rope: ROPE] RETURNS [property: YggRep.TypedPrimitiveElement];
Construct a YggRep.TypedPrimitiveElement for a ROPE that is short (less than a few disk pages preferred) and contains no nulls.
Errors: $shortRopeWithNulls
ConstructRopeTPE: PROC [rope: ROPE] RETURNS [property: YggRep.TypedPrimitiveElement];
Construct a YggRep.TypedPrimitiveElement for a ROPE that is long (more than a disk page preferred) and may contain no nulls.
ConstructUninterpretedBytesTPE: PROC [docType: YggRep.DocType, bytes: LONG POINTER, size: CARD] RETURNS [property: YggRep.TypedPrimitiveElement];
Construct a YggRep.TypedPrimitiveElement for an array of bytes.
Errors: $invalidReservedType
Links
LinkList: TYPE = RECORD [
linkName: ROPE,
dids: LIST OF YggDID.DID
];
GetTypedOutlinks: PROC [trans: YggEnvironment.TransID, did: YggDID.DID, linkType: ROPE] RETURNS [LIST OF YggDID.DID];
Get the did's of all the outlinks for this object with "link type" propertyName.
Errors: $invalidDID, $invalidTrans
GetAllOutlinks: PROC [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [LIST OF LinkList];
Get the did's of all the outlinks for this object.
Errors: $invalidDID, $invalidTrans
GetTypedInlinks: PROC [trans: YggEnvironment.TransID, did: YggDID.DID, linkType: ROPE] RETURNS [LIST OF YggDID.DID];
Get the did's of all the inlinks for this object with "link type" propertyName.
Errors: $invalidDID, $invalidTrans
GetAllInlinks: PROC [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [LIST OF LinkList];
Get the did's of all the inlinks for this object.
Errors: $invalidDID, $invalidTrans
SnapLink: PROC [trans: YggEnvironment.TransID, fromDID: YggDID.DID, toDID: YggDID.DID, linkType: ROPE] RETURNS [linkDID: YggDID.DID];
Construct a link between the two dids.
Errors: $invalidDID, $invalidTrans
RemoveLink: PROC [trans: YggEnvironment.TransID, linkDID: YggDID.DID];
Remove a link.
Errors: $invalidDID, $invalidTrans
Containers
GetDefaultContainer: PROC [trans: YggEnvironment.TransID] RETURNS [YggDID.DID];
Get the default container for this transaction.
Errors: $invalidDID, $invalidTrans
SetDefaultContainer: PROC [trans: YggEnvironment.TransID, did: YggDID.DID];
Set the default container for this transaction.
Errors: $invalidDID, $invalidTrans
AddToContainer: PROC [trans: YggEnvironment.TransID, did: YggDID.DID, containerDID: YggDID.DID];
Add the object to the container.
Errors: $invalidDID, $invalidTrans
RemoveFromContainer: PROC [trans: YggEnvironment.TransID, did: YggDID.DID, containerDID: YggDID.DID] RETURNS [ok: BOOL];
Remove the object from the container.
Errors: $invalidDID, $invalidTrans
GetObjectsInContainer: PROC [trans: YggEnvironment.TransID, containerDID: YggDID.DID, dontWait: BOOL] RETURNS [dids: LIST OF YggDID.DID, success: BOOL];
Get the did's of all the objects in this container. containerDID of NIL means use the default container.
Errors: $invalidDID, $invalidTrans
GetParents: PROC [trans: YggEnvironment.TransID, did: YggDID.DID, dontWait: BOOL] RETURNS [dids: LIST OF YggDID.DID, success: BOOL];
Get the did's of all the parents.
Errors: $invalidDID, $invalidTrans
AddContainerToContainer: PROC [trans: YggEnvironment.TransID, subcontainerDID: YggDID.DID, containerDID: YggDID.DID];
Add the subcontainer to the container.
Errors: $invalidDID, $invalidTrans
RemoveContainerFromContainer: PROC [trans: YggEnvironment.TransID, subcontainerDID: YggDID.DID, containerDID: YggDID.DID] RETURNS [ok: BOOL];
Remove the subcontainer from the container.
Errors: $invalidDID, $invalidTrans
GetContainersInContainer: PROC [trans: YggEnvironment.TransID, containerDID: YggDID.DID, dontWait: BOOL ← FALSE] RETURNS [dids: LIST OF YggDID.DID, success: BOOL];
Get the did's of all the containers in this container. containerDID of NIL means use the default container.
Errors: $invalidDID, $invalidTrans
GetSuperContainers: PROC [trans: YggEnvironment.TransID, containerDID: YggDID.DID, dontWait: BOOL ← FALSE] RETURNS [dids: LIST OF YggDID.DID, success: BOOL];
Get the did's of all the containers containing this container.
Errors: $invalidDID, $invalidTrans
Indexing in containers
AddIndexPatternToContainer: PROC [containerDID: YggDID.DID, pattern: ROPE] RETURNS [patternOK: BOOL];
Add the pattern to index on for the container.
Errors: $invalidDID
RemoveIndexPatternFromContainer: PROC [containerDID: YggDID.DID, pattern: ROPE] RETURNS [ok: BOOL];
Remove the pattern
Errors: $invalidDID
GetPatternsInContainer: PROC [containerDID: YggDID.DID, dontWait: BOOL] RETURNS [patterns: LIST OF ROPE, success: BOOL];
Get the patterns in this container.
Errors: $invalidDID
Object creation and destruction
CreateObject: PROC [trans: YggEnvironment.TransID, containerDID: YggDID.DID, makeRoot: BOOL ← FALSE] RETURNS [did: YggDID.DID];
Make up a new object in the specified container. The default container for the transaction is used if containerDID is NIL. If makeRoot is specified, then the new object is a root.
Errors: $invalidDID, $invalidTrans
RemoveObject: PROC [trans: YggEnvironment.TransID, did: YggDID.DID];
Remove a object. Any links pointing to this object are also removed. This is a recursive process (if the links are really objects).
Errors: $invalidDID, $invalidTrans
END.