com.sap.netweaver.bc.rf.common

Interface IRid

All Known Implementing Classes:
Rid

public interface IRid

A Rid is an identifier for a CM resource. It holds all information to identify a CM resource and retrieve it via the CM Framework. Each CM resource has its unique Rid. The first pathsegment must be a valid name of a repository (prefix).

A Rid has a path-like structure, like a path in a file system and follows the following production:

   Rid         ::= '/' pathsegment | '/' pathsegment '?' query
   pathsegment ::= name | name '/' pathsegment | empty
   name        ::= any char except '/'
   query       ::= parameter | parameter '&' query | empty
   parameter   ::= varname | varname '=' value
   varname         ::= any char except '=', '&'   value       ::= any
 character except '&'
 
Equality is defined as ignoring trailing '/' characters. Thus, the Rids "/docs/" and /docs" are considered equal. There is special handling for the root collection "/", which is not equal to the empty Rid "".

Copyright (c) SAP AG 2001-2003


Method Summary
 IRid add(IRid uri)
          Concatenate this Rid with the given Rid.
 IRid add(String uri)
          Concatenate this Rid with the given Rid.
 IRid addPathSegment(String segment)
          Adds a path segment.
 boolean endsWithSlash()
          Return if this Rid ends with a slash.
 String extension()
          Get the extension part of the resource name.
 String getPath()
          Return the path component of this Rid.
 String getQuery()
          Return the query component of this Rid (null if it does not exist).
 Properties getQueryParameter()
          Get the query parameters of the Rid.
 boolean isAbsolute()
          Return if Rid is absolute, e.g. start with a slash.
 boolean isAncestorOf(IRid child)
          Determine if this Rid is an ancestor (parent or parent's parent, etc.) of the given child Rid.
 boolean isAncestorOfOrSelf(IRid child)
          Determine if this Rid is an ancestor (parent or parent's parent, etc.) of the given child Rid or the same.
 boolean isRoot()
          Return if Rid is root collection.
 int length()
          Return length of Rid in string representation
 IRid name()
          Get the name of the resource, designated by this Rid.
 IRid parent()
          Get the Rid of the parent collection of this Rid
 IRid removeExtension()
          Remove the (optional) extension of the resource name.
 IRid removeName()
          Remove the name of the resource, same as parent()
 IRid removeRoot()
          Get a new Rid with the toplevel collection removed
 IRid removeTrailingSlash()
          Remove a possible trailing slash from the Rid.
 IRid resolveRelativeRid(String uri)
          Resolve relative Rids
 IRid root()
          Get Rid of toplevel collection (below root) of this Rid.
 IRid setQueryParameter(Properties parameter)
          Create a new Rid by setting the given parameters as query part of this Rid.
 List split()
          Splits the Rid into its path components
 String toExternalForm()
          Convert this Rid to a representation usable in RFC2396 URI references.
 

Method Detail

toExternalForm

String toExternalForm()
Convert this Rid to a representation usable in RFC2396 URI references. Non-ASCII and reserved characters are encoded.

Note that such an encoded string cannot be used to construct an new Rid object! The path in Rid objects is never, ever encoded.

Returns:
Rid suitable escaped as RFC2396 URI reference

getPath

String getPath()
Return the path component of this Rid.

Returns:
the path component

getQuery

String getQuery()
Return the query component of this Rid (null if it does not exist).

Returns:
the query component

getQueryParameter

Properties getQueryParameter()
Get the query parameters of the Rid. Will return an empty Properties object if Rid has no query part. Modifying the Properties object has no effect on the Rid itself.

Returns:
query parameters as Properties

root

IRid root()
Get Rid of toplevel collection (below root) of this Rid.

The root Rid of a toplevel collection is the root collection Rid. The root Rid of the root Rid is the root Rid itself.

Returns:
Rid of toplevel collection below root

name

IRid name()
Get the name of the resource, designated by this Rid. If the Rid has query parameter, these are discarded.

Returns:
the name of the resource, designated by this Rid

parent

IRid parent()
Get the Rid of the parent collection of this Rid

Returns:
the Rid of the parent collection

extension

String extension()
Get the extension part of the resource name. Returns the empty string if there is no extension.

Returns:
the extension part of the resource name

removeRoot

IRid removeRoot()
Get a new Rid with the toplevel collection removed

Returns:
Rid with toplevel collection removed

removeName

IRid removeName()
Remove the name of the resource, same as parent()

Returns:
parent of the resource

removeExtension

IRid removeExtension()
Remove the (optional) extension of the resource name. Query parameters are discarded.

Returns:
uri with extension of name removed

removeTrailingSlash

IRid removeTrailingSlash()
Remove a possible trailing slash from the Rid. Query parameters are preserved.

Returns:
Rid without trailing slash

isAbsolute

boolean isAbsolute()
Return if Rid is absolute, e.g. start with a slash.

Returns:
if Rid is absolute path

isRoot

boolean isRoot()
Return if Rid is root collection.

Returns:
if this is the root collection

isAncestorOf

boolean isAncestorOf(IRid child)
Determine if this Rid is an ancestor (parent or parent's parent, etc.) of the given child Rid.

Parameters:
child - to test against
Returns:
if this Rid is ancestor of child

isAncestorOfOrSelf

boolean isAncestorOfOrSelf(IRid child)
Determine if this Rid is an ancestor (parent or parent's parent, etc.) of the given child Rid or the same.

Parameters:
child - to test against
Returns:
if this Rid is ancestor of child

endsWithSlash

boolean endsWithSlash()
Return if this Rid ends with a slash.

Returns:
if this Rid ends with a slash

add

IRid add(String uri)
Concatenate this Rid with the given Rid. Treats this Rid as if it ends with a slash and the parameter Rid as if it starts without a slash.

Parameters:
uri - to append to this
Returns:
new Rid as concatenation

add

IRid add(IRid uri)
Concatenate this Rid with the given Rid. Treats this Rid as if it ends with a slash and the parameter Rid as if it starts without a slash.

Parameters:
uri - to append to this
Returns:
new Rid as concatenation

split

List split()
Splits the Rid into its path components

Returns:
List of Strings

length

int length()
Return length of Rid in string representation

Returns:
length of Rid in string representation

resolveRelativeRid

IRid resolveRelativeRid(String uri)
Resolve relative Rids

Parameters:
uri - An Rid, which may be relative or absolute
Returns:
resolved Rid

addPathSegment

IRid addPathSegment(String segment)
                    throws Exception
Adds a path segment.

Parameters:
segment - String containing the new path segment
Returns:
new Rid
Throws:
Exception - Exception raised in failure situation

setQueryParameter

IRid setQueryParameter(Properties parameter)
Create a new Rid by setting the given parameters as query part of this Rid.

Parameters:
parameter - to set to query
Returns:
new Rid with parameter in query
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice