|
SAP NetWeaver 7.40 SP 07 KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sapportals.wcm.rfadapter.IDResolver
public final class IDResolver
offers functionality to calculate valid (and unique) IDs from
a String that can be used to create 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.
| Nested Class Summary | |
|---|---|
class |
IDResolver.IDProposal
an immutable object containing all information about the id generation. |
static class |
IDResolver.Status
|
| Field Summary | |
|---|---|
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
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Method Detail |
|---|
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 null
id - the id to test, must not be null
true, if the id would be a valid ID, false otherwise
public 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 thrown
id - the proposed id for the IResourcetargetfolder - the folder in which to create the IResource
a - WcmException when operations on the given collection fail
WcmExceptionpublic String normalizeID(String id)
public 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 displayname supplied for the IResource/code>targetfolder - the folder in which the new IResource with the given
displayname is to be created
- Returns:
IDProposal which contains the proposed id and gives further information
why and how the proposed id differs from the given displayname
- Throws:
WcmException
public 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 created
IDProposal objects
WcmException| 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
|
|
SAP NetWeaver 7.40 SP 07 KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||