Class ResourceWebScriptHelper


  • public class ResourceWebScriptHelper
    extends Object
    Helps a Webscript with various tasks
    Author:
    Gethin James, janv
    • Constructor Detail

      • ResourceWebScriptHelper

        public ResourceWebScriptHelper()
    • Method Detail

      • setUniqueId

        public static void setUniqueId​(Object theObj,
                                       String uniqueId)
        Set the id of theObj to the uniqueId. Attempts to find a set method and invoke it. If it fails it just swallows the exceptions and doesn't throw them further.
        Parameters:
        theObj - Object
        uniqueId - String
      • processAdditionsToTheResponse

        public Object processAdditionsToTheResponse​(org.springframework.extensions.webscripts.WebScriptResponse res,
                                                    Api api,
                                                    String entityCollectionName,
                                                    Params params,
                                                    Object objectToWrap)
        Looks at the object passed in and recursively expands any @EmbeddedEntityResource annotations or related relationship. EmbeddedEntityResource is expanded by calling the ReadById method for this entity. Either returns a ExecutionResult object or a CollectionWithPagingInfo containing a collection of ExecutionResult objects.
        Parameters:
        api - Api
        entityCollectionName - String
        params - Params
        objectToWrap - Object
        Returns:
        Object - Either ExecutionResult or CollectionWithPagingInfo