DOMS Server API

Note: in the work of estimating for DOMS Server, methods have been added, which are not yet on the list below. Methods mentioned in the estimates, see Server task or ask JRG.

/!\ WORK IN PROGRESS

Object operations

newObject(template) => pid

Given a template, create a new object, return the PID

deleteObject(pid)

Given a PID, mark the object as deleted (note: object may only be undeleted by direct access to Fedora)

markPublishedObject(pid)

Given a PID, mark the object as published. Will fail if object does not validate.

markInProgressObject(pid)

Given a PID, mark the object as in progress.

listDatastreamsObject(pid) => listOfDatastreams

Given a PID, list datastream names in object.

getObjectTitle(pid) => title

Given a PID, return the title of the object.

Datastream operations

newDatastream(pid, name, content)

Given a pid and a datastream name, add a datastream with that name, and given content. Will fail if name already exists with different content.

deleteDatastream(pid, name)

Given a pid and a datastream name, mark that datastream as deleted.

modifyDatastream(pid, name, content)

Given a pid and a datastream name, replace the contents of that datastream with the given content. Will fail of datastream does not exist.

getDatastream(pid, name) => content

Given a pid and a datastream, return the datastream content. Will fail of datastream does not exist.

File operations

addFile(pid, name, content, checksum)

Given a pid and a name, add a new file to the object with the given content. Will fail if pid does not describe a file object, if a file is already added to the object with different content, or if content does not match checksum.

?deleteFile(pid)

Given a pid, delete the file in this object. This will fail if this is not a file object, if no file is present in the object, or if the object has been published so the file is undeletable.

/!\ TODO: Do we need/want this operation?

getFileUrl(pid) => url

Given a pid, return an externally resolvable URL that disseminates this file.

Relation operations

addRelation(fromPid, name, toPid)

Add a relation between two objects.

?getRelations(pid) => listOfNamesAndPids

Given a pid, list relations out of this object

/!\ TODO: Should this just be an RI-query?

?getRelations(pid, name) => listOfPids

Given a pid, list relations out of this object of a specific type

/!\ TODO: Should this just be an RI-query?

deleteRelation(pid, name, pid)

Given a specific relation, remove it.

?modifyRelation(pid, oldName, oldPid, newName, newPid)

Given an old relation, replace it with a new relation.

/!\ TODO: Do we need this operation?

Search operations

findObjects(queryString) => listOfPids

Given a query string, return list of objects matching

/!\ TODO: Should we return more than pids?

/!\ TODO: Paging

listObjects(modifiedSinceDate) => listOfPids

Given a date, return a list of objects modified since then.

/!\ TODO: Should we return more than pids?

/!\ TODO: Paging

riQuery(queryString) => queryResult

Given a query string for the resource index, return result.

/!\ TODO: Specify better

/!\ TODO: Do we want direct access to the Resource Index?

View operations

getView(pid, name) => viewBundle

Given an entry PID and a view name, return a bundle

getViewStructure(pid, name) => datastructureOfView

Given an entry PID and a view name, return a spanning tree over the view graph.

/!\ TODO: DFS or BFS? How does the data structure look?

Structural operations

For creating new entry objects

?listCollections() => listOfPids

List all collection objects in DOMS.

/!\ TODO: Should this just be an RI-query?

?getEntryTemplatesForCollection(collectionPid, viewName) => listOfPids

Given the PID of a collection, return all templates for that collection, that are also entry objects for the given view name.

/!\ TODO: Should this just be an RI-query?

For creating new subobjects in view

?getSubItemTemplates(pid, viewName) => listOfPids

Given an object and a named view, return templates that could be used to generate subobjects for that pid in that view.

/!\ TODO: Should we also return the specific relation of the template?

/!\ TODO: Should this just be an RI-query?

?addSubItem(pid, viewName, template)

Given an object, a named view, and a template, create a new object for that template, then add relation between old and new object in the view. Will fail if there is no allwed relation in the view between the object and the template.

/!\ TODO: Should we also get as paramter the specific relation of the template?

/!\ TODO: This could also be done with newObject and addRelation

For adding new view-external relations

?getAllowedRelations(pid) => listOfNamesAndCMS

Given a pid, return possible relations that could be added, and the content models allowed as object for those relations.

?listObjectsWithContentModel(pid)

Given a content model pid, list all objects that subscribe to that content model.

/!\ TODO: Should this just be an RI-query?

For content model driven behaviour

?getContentModel(pid) => compoundContentModel

/!\ TODO: ContentModels for views?

/!\ TODO: Should this just be an RI-query?

General notes

/!\ TODO: A lot of operations are currently defined to return a list of pids. Perhaps it would be better to return a list of pids AND object names/types

DOMS Server API (last edited 2010-06-08 13:52:08 by jrg)