YggNav.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Bob Hagmann April 22, 1988 10:40:24 am PDT
DIRECTORY
Rope USING [ROPE],
YggDID USING [DID],
YggEnvironment USING [TransID],
YggRep USING [AccurateGMTRep, Attribute, DocType, TypedPrimitiveElement];
Transactions
Note: none of the root operations operate under transaction control
StartTransaction:
PROC
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 [ok:
BOOL];
Check on a transaction. If it has been aborted, ok is FALSE.
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, 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.
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
SetSize:
PROC [trans: YggEnvironment.TransID, did: YggDID.
DID, size:
CARD];
Set the 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: YggRep.Attribute];
Get the named property of the object with the specified did. If the property does not exist, [FALSE, [NIL, 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];
Set the contents of the object with the specified did. The object is grown if needed.
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 [
propertyName: 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
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]
RETURNS [
LIST
OF YggDID.
DID];
Get the did's of all the objects in this container. containerDID of NIL means use the default container.
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]
RETURNS [
LIST
OF YggDID.
DID];
Get the did's of all the containers in this container. containerDID of NIL means use the default container.
Errors: $invalidDID, $invalidTrans
Object creation and destruction
CreateObject:
PROC [trans: YggEnvironment.TransID, containerDID: YggDID.
DID]
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.
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
Indices
CreateIndex:
PROC [trans: YggEnvironment.TransID, containerDID: YggDID.
DID, pattern:
ROPE]
RETURNS [did: YggDID.
DID];
Index all properties in the container whose property name matches the pattern.
Errors: $invalidDID, $invalidTrans
ListIndexPatterns:
PROC [trans: YggEnvironment.TransID, containerDID: YggDID.
DID]
RETURNS [patterns:
LIST OF ROPE];
Remove a pattern from a container. The pattern must exactly match an existing pattern.
Errors: $invalidDID, $invalidTrans
RemoveIndex:
PROC [trans: YggEnvironment.TransID, containerDID: YggDID.
DID, pattern:
ROPE]
RETURNS [ok:
BOOL];
Remove a pattern from a container. The pattern must exactly match an existing pattern.
Errors: $invalidDID, $invalidTrans