atg.rest.util
Class RepositoryUtils

java.lang.Object
  extended by atg.rest.util.RepositoryUtils

public class RepositoryUtils
extends java.lang.Object

A class which provides common repository utility methods.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
RepositoryUtils()
           
 
Method Summary
static RepositoryItem[] convertRepositoryReferenceArrayParameter(java.lang.String pStrValue, ComponentResolver pResolver, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Converts a string of the form /path/to/repository:item-descriptor:itemId,...
static RepositoryItem convertRepositoryReferenceParameter(java.lang.String pRepRefString, ComponentResolver pResolver, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Converts a string of the form /path/to/repository:item-descriptor:itemId to the referenced RepositoryItem
static java.lang.String formatRepositoryReferenceParameter(java.lang.String pRepRefString, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Converts a string of the form /path/to/repository/item-descriptor/itemId to /path/to/repository:item-descriptor:itemId so it can be passed to DynamicBeans.setPropertyValueAsString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

RepositoryUtils

public RepositoryUtils()
Method Detail

formatRepositoryReferenceParameter

public static java.lang.String formatRepositoryReferenceParameter(java.lang.String pRepRefString,
                                                                  DynamoHttpServletRequest pRequest,
                                                                  DynamoHttpServletResponse pResponse)
                                                           throws RestException
Converts a string of the form /path/to/repository/item-descriptor/itemId to /path/to/repository:item-descriptor:itemId so it can be passed to DynamicBeans.setPropertyValueAsString()

Parameters:
pRepRefString - the source string
pRequest - the servlet request
pResponse - the servlet response
Returns:
the converted string
Throws:
RestException - if the source string is not of the proper format

convertRepositoryReferenceParameter

public static RepositoryItem convertRepositoryReferenceParameter(java.lang.String pRepRefString,
                                                                 ComponentResolver pResolver,
                                                                 DynamoHttpServletRequest pRequest,
                                                                 DynamoHttpServletResponse pResponse)
                                                          throws RestException
Converts a string of the form /path/to/repository:item-descriptor:itemId to the referenced RepositoryItem

Parameters:
pRepRefString - the source string
pResolver - the component resolver to use to find the repository item
pRequest - the servlet request
pResponse - the servlet response
Returns:
the converted repository item
Throws:
RestException - if the source string is not of the proper format

convertRepositoryReferenceArrayParameter

public static RepositoryItem[] convertRepositoryReferenceArrayParameter(java.lang.String pStrValue,
                                                                        ComponentResolver pResolver,
                                                                        DynamoHttpServletRequest pRequest,
                                                                        DynamoHttpServletResponse pResponse)
                                                                 throws RestException
Converts a string of the form /path/to/repository:item-descriptor:itemId,... to the referenced RepositoryItem array

Parameters:
pRepRefString - the source string
pResolver - the component resolver to use to find the repository items
pRequest - the servlet request
pResponse - the servlet response
Returns:
the converted repository item array
Throws:
RestException - if the source string is not of the proper format