public final class IDResolver extends Object
IResource
objects within a certain ICollection. To ensure the
validity of the calculated IDs, the class uses the NameInfo
class of the RepositoryFramework for a list of char that
are forbidden. This class is implemented as a singleton. It uses the
IDValidator class to check for invalid characters, while the
check for uniqueness within a folder is done in this class. Note that uniqueness
within a folder cannot be guaranteed, because the current user might not have
the permission to see all elements within the current ICollection.| Modifier and Type | Class and Description |
|---|---|
class |
IDResolver.IDProposal
an immutable object containing all information about the id generation.
|
static class |
IDResolver.Status |
| Modifier and Type | Field and Description |
|---|---|
static IDResolver.Status |
INVALID |
static IDResolver.Status |
NON_UNIQUE |
static char |
NUMERATOR |
static char |
NUMERATOR_PREFIX |
static char |
NUMERATOR_SUFFIX |
static char |
REPLACER |
static IDResolver.Status |
UNIQUE |
| Modifier and Type | Method and Description |
|---|---|
IDResolver.Status |
checkID(String id,
ICollection targetfolder)
checks if the given id would be a valid id within the given folder.
|
IDResolver.IDProposal |
generateID(String displayname,
ICollection targetfolder)
generates an ID proposal based on the given displayname that is valid within the given
targetfolder.
|
List |
generateIDs(List displaynames,
ICollection targetfolder)
generates ID proposals based on the list with displaynames that are valid within the given
targetfolder.
|
static IDResolver |
getInstance() |
String |
getInvalidChars() |
char[] |
invalidChars() |
boolean |
isValidID(String id)
decides if the given parameter would be a valid id for an
IResource. |
String |
normalizeID(String id) |
public static final IDResolver.Status UNIQUE
public static final IDResolver.Status INVALID
public static final IDResolver.Status NON_UNIQUE
public static final char REPLACER
public static final char NUMERATOR
public static final char NUMERATOR_SUFFIX
public static final char NUMERATOR_PREFIX
public char[] invalidChars()
public String getInvalidChars()
public static IDResolver getInstance()
public boolean isValidID(String id)
IResource.
It will throw a NullPointerException, if the parameter is nullid - the id to test, must not be nulltrue, if the id would be a valid ID, false otherwisepublic IDResolver.Status checkID(String id, ICollection targetfolder) throws WcmException
isValidID it also checks, if the id would be unique within the folder. If one of the
parameters is null, a NullPointerException will be thrownid - the proposed id for the IResourcetargetfolder - the folder in which to create the IResourceWcmException - no descriptionpublic IDResolver.IDProposal generateID(String displayname, ICollection targetfolder) throws WcmException
IResource in the given ICollection using
the ID generated by this method, you might still run into a NameAlreadyExistsException.
This is due to several reasons: displayname - the display name supplied for the IResourcetargetfolder - the folder in which the new IResource with the given
display name is to be createdWcmException - - no descriptionpublic List generateIDs(List displaynames, ICollection targetfolder) throws WcmException
displaynames - a list that must contain only String objectstargetfolder - the folder in which the new IResource with the given
displayname is to be createdIDProposal objectsWcmException - no description| Access Rights |
|---|
| 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 2021 SAP SE Complete Copyright Notice