This documentation is for WSO2 Governance Registry 5.0.1. View documentation for the latest release.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here is a description of how each of these methods works.

Method

Important parameters (To extract from Request Context)

Return value

Description

get

requestContext.getResourcePath() // path, the resource is getting

Resource // the resource at the path

Retrieves a resource in a given path.

put

requestContext.getResourcePath() // path to put
requestContext.getResource() // the resource to store

-

Stores a resource in a given path.

importResource

requestContext.getResourcePath() // path to put
requestContext.getSourceURL() // the URL of the importing resource

-

Imports a resource from a URL.

move

requestContext.getSourcePath() // source to move from
requestContext.getTargetPath() // target to move to

String // the new path

Moves a resource from one to another.

copy

requestContext.getSourcePath() // source to copy from
requestContext.getTargetPath() // target to copy to

String // the new path

Copies a resource from one to another.

rename

requestContext.getSourcePath() // source of the resource
requestContext.getTargetPath() // the new name

String // the new path

Changes a name of a resource.

createLink

requestContext.getResourcePath() // the path of the link is creating
requestContext.getTargetPath() // the target path or the target registry url
requestContext.getTargetSubPath() // the target sub path if the target is a remote url

-

Creates a sym-link or a remote link.

removeLink

requestContext.getResourcePath() // the path of the link to remove

-

Removes a link.

delete

requestContext.getResourcePath() // the path of the resource to remove

-

Deletes a resource. If this is a collection, all the children will also be removed.

putChild Deprecated.

requestContext.getResourcePath() // the path resource is putting
requestContext.getResource() // the resource to put

String // the path of the resource

Called when putting a resource to any path except root.

importChild

requestContext.getResourcePath() // the path resource is importing to
requestContext.getSourceURL() // the URL of the importing resource

String // the path of the resource

Called when importing a resource to any path except root.

invokeAspect

requestContext.getResource() // the resource to invoke the aspect
requestContext.getAspect() // the Aspect object to be invoked
requestContext.getAction() // the action of the Aspect

-

Triggered when invoking an aspect (Aspects are described in detail in following sections).

addAssociation

requestContext.getSourcePath() // left branch of the association
requestContext.getTargetPath() // right branch of the association
requestContext.getAssociationType() // the type of the association

-

Triggered when adding an association.

removeAssociation

requestContext.getSourcePath() // left branch of the association
requestContext.getTargetPath() // right branch of the association
requestContext.getAssociationType() // the type of the association

-

Triggered when removing an association.

getAllAssociations

requestContext.getResourcePath() // the path of the resource

Association[]

Returns all the associations of a given resource.

getAssociations

requestContext.getResourcePath() // the path of the resource
requestContext.getAssociationType() // the type of the association

Association[]

Returns associations of a give association type of a given resource.

applyTag

requestContext.getResourcePath() // the path of the resource
requestContext.getTag() // the tag to be added

-

Applies a tag to a particular path.

removeTag

requestContext.getResourcePath() // the path of the resource
requestContext.getTag() // the tag to be removed

-

Removes a tag in a particular path.

rateResource

requestContext.getResourcePath() // the path of the resource
requestContext.getRating() // the value of the rating

-

Triggered when Rating a resource.

restoreVersion

requestContext.getVersionPath() // the path + version of the resource

-

Triggered when restoring a version-ed resource.

createVersion

requestContext.getResourcePath() // Create a version of a resource

-

Triggered when creating a resource.

Info

This is triggered when you create a snapshot (but not a new version) of an asset. It is related to the Repository aspect of WSO2 G-Reg.

editComment

requestContext.getCommentPath() // The path of the comment of a resource
requestContext.getComment() // The comment

-

Edits a comment in a given path.

addComment

requestContext.getResourcePath() // The path of the resource
requestContext.getComment() // The comment

String // the comment path

Adds a comment to the given path.

removeComment

requestContext.getCommentPath() // The path of the comment of a resource
requestContext.getComment() // The comment

-

Removes a comment in a given path.

getComments

requestContext.getResourcePath() // The path of the resource

Comment[]

Gets all comments in a given path.

getAverageRating

requestContext.getResourcePath() // The path of the resource

float

Gets the average rating of a resource.

getRating

requestContext.getResourcePath() // The path of the resource
requestContext.getUserName() // The path of the resource

int

Gets the rating given by a user to a given resource.

getVersions

requestContext.getResourcePath() // The path of the resource

String[]

Returns version paths of a given resource.

getTags

requestContext.getResourcePath() // The path of the resource

Tag[]

Returns tags of a given resource.

getResourcePathWithTag

requestContext.getResourcePath() // The path of the resource
requestContext.getTag() // The value of the tag

TaggedResourcePath[]

Returns resource paths with a given tag.

executeQuery

requestContext.getResourcePath() // The path of the query
requestContext.getQueryParameters() // The query parameters

Collection

Returns collection (paths as the content) queried in the given query.

searchContent

requestContext.getKeywords() // The search keywords

Collection

Returns collection (paths as the content) found as a result of search operation.

resourceExists

requestContext.getResourcePath() // The path of the resource

boolean

Returns whether the resource in the given path exists.

dump

requestContext.getResourcePath() // The path of the resource
requestContext.getDumpingWriter() // The writer that requested in dumping

-

Dumps a particular path.

restore

requestContext.getResourcePath() // The path of the resource
requestContext.getDumpingReader() // The reader that used with restoring

-

Restores a dump.

Handlers can be engaged and configured using the registry configuration file (registry.xml). Here is an example of using registry.xml to declare a handler.

...