DataProcessor

uk.gov.nationalarchives.dp.client.DataProcessor
See theDataProcessor companion object
class DataProcessor[F[_]]()(using me: MonadError[F, Throwable])

A class to process XML responses from Preservica

Type parameters

F

The effect type

Value parameters

me

An implicit MonadError instance

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def allBitstreamInfo(bitstreamElements: Seq[Elem], generationType: GenerationType, contentObject: Entity): F[Seq[BitStreamInfo]]

Returns a list of Client.BitStreamInfo objects

Returns a list of Client.BitStreamInfo objects

Value parameters

bitstreamElements

The elements containing the bitstream information

Attributes

Returns

A Seq of BitStreamInfo objects parsed from the XML

def allBitstreamUrls(generationElement: Elem): F[Seq[String]]

Returns all the text content of every Bitstreams -> Bitstream element

Returns all the text content of every Bitstreams -> Bitstream element

Value parameters

generationElement

The 'Generation' element containing the bitstreams

Attributes

Returns

A Seq of String with the text content of every Bitstreams -> Bitstream element

def allGenerationUrls(generationsElement: Elem, contentObjectRef: UUID): F[Seq[String]]

Returns all the text content of every Generations -> Generation element

Returns all the text content of every Generations -> Generation element

Value parameters

generationsElement

The 'Generations' element containing the generations

Attributes

Returns

A Seq of String with the text content of every Generations -> Generation element

def childNodeFromEntity(entityResponse: Elem, nodeName: String, childNodeName: String): F[String]

Fetches nodeName -> childNodeName text from entityResponse

Fetches nodeName -> childNodeName text from entityResponse

Value parameters

childNodeName

The child node name to return the text from

entityResponse

The response from the entity

nodeName

The node name to search

Attributes

Returns

The text of the child node wrapped in the F effect

def childNodeFromWorkflowInstance(workflowInstanceResponse: Elem, nodeName: String): F[String]

Gets the child node from a workflow instance response

Gets the child node from a workflow instance response

Value parameters

nodeName

The name of the node to search for

workflowInstanceResponse

The workflow instance response

Attributes

Returns

The text of the child node provided as an argument.

def existingApiId(res: Elem, elementName: String, fileName: String): Option[String]

Returns elementName -> ApiId from the XML response where the Name field matches fileName

Returns elementName -> ApiId from the XML response where the Name field matches fileName

Value parameters

elementName

The name of the element

fileName

The name of the file

res

The XML response from Preservica

Attributes

Returns

An optional string with the ApiId or None if not found.

def fragmentUrls(entityResponseElement: Elem): F[Seq[String]]

Returns the metadata fragment urls from the element

Returns the metadata fragment urls from the element

Value parameters

entityResponseElement

The EntityResponse element to search

Attributes

Returns

A Seq of String wrapped in the F effect with the fragment URLS

def fragments(metadataResponseElements: Seq[Elem]): F[Seq[Node]]

Returns a list of metadata content

Returns a list of metadata content

Value parameters

metadataResponseElements

The MetadataResponse elements that contains the fragments

Attributes

Returns

A Seq of String representing the metadata XML or an error if none are found

def generationType(generationsElement: Elem, contentObjectRef: UUID): F[GenerationType]

Returns whether the the text content of every Generations -> Generation element

Returns whether the the text content of every Generations -> Generation element

Value parameters

generationsElement

The 'Generations' element containing the generations

Attributes

Returns

A Seq of String with the text content of every Generations -> Generation element

def generationUrlFromEntity(contentObjectElement: Elem): F[String]

Gets the text of the first generation element

Gets the text of the first generation element

Value parameters

contentObjectElement

The Content Object element to search

Attributes

Returns

The text of the first generation element wrapped in the F effect

def getContentObjectsFromRepresentation(elem: Elem, representationType: RepresentationType, ioEntityRef: UUID): F[Seq[Entity]]

Returns a Seq of String objects

Returns a Seq of String objects

Value parameters

elem

The element containing the representations

representationType

The (Optional) representation type that you want returned

Attributes

Returns

A Seq of String objects parsed from the XML

def getEntities(elem: Elem): F[Seq[Entity]]

Parses a list of Entities.Entity parsed from the XML

Parses a list of Entities.Entity parsed from the XML

Value parameters

elem

The element to parse

Attributes

Returns

A Seq of Entities.Entity

def getEntity(entityRef: UUID, entityResponse: Elem, entityType: EntityType): F[Entity]

Converts an entity response to an Entities.Entity case class

Converts an entity response to an Entities.Entity case class

Value parameters

entityRef

The reference of the entity

entityResponse

The XML response from Preservica

entityType

The EntityClient.EntityType of the entity.

Attributes

Returns

An Entities.Entity wrapped in the F effect

def getEntityXml(entityRef: UUID, entityResponse: Elem, entityType: EntityType): F[Node]

Retrieves the EntityClient.EntityType Node from an entity response

Retrieves the EntityClient.EntityType Node from an entity response

Value parameters

entityRef

The reference of the entity

entityResponse

The XML response from Preservica

entityType

The EntityClient.EntityType of the entity.

Attributes

Returns

An scala.xml.Node found in the entity response (by searching for EntityClient.EntityType) wrapped in the F effect

def getEventActions(elem: Elem): F[Seq[EventAction]]

Returns a list of DataProcessor.EventAction objects

Returns a list of DataProcessor.EventAction objects

Value parameters

elem

The element containing the event actions

Attributes

Returns

A Seq of EventAction objects parsed from the XML

def getIdentifiers(elem: Elem): F[Seq[IdentifierResponse]]

Returns a list of Entities.IdentifierResponse objects

Returns a list of Entities.IdentifierResponse objects

Value parameters

elem

The element containing the identifiers

Attributes

Returns

A Seq of IdentifierResponse objects parsed from the XML

def getIdentifiersXml(elem: Elem): F[Seq[Node]]

Returns a list of NodeSeq objects

Returns a list of NodeSeq objects

Value parameters

elem

The element containing the identifiers

Attributes

Returns

A Seq of Identifier elements parsed from the XML

def getPreservicaNamespaceVersion(elem: Elem): F[Float]

Returns a Float

Returns a Float

Value parameters

elem

The element containing the namespace with the version in it

Attributes

Returns

A Float, representing the Preservica version, parsed from the XML

def getUrlsToEntityRepresentations(elem: Elem, representationType: Option[RepresentationType]): F[Seq[String]]

Returns a Seq of String objects

Returns a Seq of String objects

Value parameters

elem

The element containing the representations

representationType

The (Optional) representation type that you want returned

Attributes

Returns

A Seq of String objects parsed from the XML

def nextPage(elem: Elem): F[Option[String]]

Returns the next page

Returns the next page

Value parameters

elem

The element containing the pagination element

Attributes

Returns

The optional next page or None if there are none

Extensions

Extensions

extension (ns: NodeSeq)
def textOfFirstElement(): F[String]