Class BaseHold

  • All Implemented Interfaces:
    org.springframework.extensions.webscripts.WebScript
    Direct Known Subclasses:
    HoldPost, HoldPut

    public abstract class BaseHold
    extends org.springframework.extensions.webscripts.DeclarativeWebScript
    Base class for the hold webscripts
    Since:
    2.2
    Author:
    Tuna Aksoy
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.springframework.extensions.webscripts.AbstractWebScript

        org.springframework.extensions.webscripts.AbstractWebScript.ScriptDetails
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseHold()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Map<String,​Object> executeImpl​(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)  
      protected List<org.alfresco.service.cmr.repository.NodeRef> getHolds​(org.json.JSONObject json)
      Helper method to get the list of NodeRef(s) for the hold(s) which will contain the item (record / record folder / active content)
      protected HoldService getHoldService()
      Returns the hold service
      protected List<org.alfresco.service.cmr.repository.NodeRef> getItemNodeRefs​(org.json.JSONObject json)
      Helper method to get the NodeRefs for the items(s) (record(s) / record folder(s) / active content(s)) which will be added to the hold(s)
      protected org.json.JSONObject getJSONFromContent​(org.springframework.extensions.webscripts.WebScriptRequest req)
      Helper method the get the json object from the request
      void setHoldService​(HoldService holdService)
      Set the hold service
      void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)  
      void setNodeTypeUtility​(NodeTypeUtility nodeTypeUtility)  
      void setRecordFolderService​(RecordFolderService recordFolderService)  
      • Methods inherited from class org.springframework.extensions.webscripts.DeclarativeWebScript

        execute, executeFinallyImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplate
      • Methods inherited from class org.springframework.extensions.webscripts.AbstractWebScript

        addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
    • Constructor Detail

      • BaseHold

        public BaseHold()
    • Method Detail

      • setHoldService

        public void setHoldService​(HoldService holdService)
        Set the hold service
        Parameters:
        holdService - the hold service
      • setRecordFolderService

        public void setRecordFolderService​(RecordFolderService recordFolderService)
        Parameters:
        recordFolderService - record folder service
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
        Parameters:
        nodeService - node service
      • setNodeTypeUtility

        public void setNodeTypeUtility​(NodeTypeUtility nodeTypeUtility)
        Parameters:
        nodeTypeUtility - node type utility
      • getHoldService

        protected HoldService getHoldService()
        Returns the hold service
        Returns:
        Returns the hold service
      • executeImpl

        protected Map<String,​Object> executeImpl​(org.springframework.extensions.webscripts.WebScriptRequest req,
                                                       org.springframework.extensions.webscripts.Status status,
                                                       org.springframework.extensions.webscripts.Cache cache)
        Overrides:
        executeImpl in class org.springframework.extensions.webscripts.DeclarativeWebScript
        See Also:
        DeclarativeWebScript.executeImpl(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.Status, org.springframework.extensions.webscripts.Cache)
      • getJSONFromContent

        protected org.json.JSONObject getJSONFromContent​(org.springframework.extensions.webscripts.WebScriptRequest req)
        Helper method the get the json object from the request
        Parameters:
        req - The webscript request
        Returns:
        The json object which was sent in the request body
      • getItemNodeRefs

        protected List<org.alfresco.service.cmr.repository.NodeRef> getItemNodeRefs​(org.json.JSONObject json)
        Helper method to get the NodeRefs for the items(s) (record(s) / record folder(s) / active content(s)) which will be added to the hold(s)
        Parameters:
        json - The request content as JSON object
        Returns:
        List of item NodeRefs which will be added to the hold(s)
      • getHolds

        protected List<org.alfresco.service.cmr.repository.NodeRef> getHolds​(org.json.JSONObject json)
        Helper method to get the list of NodeRef(s) for the hold(s) which will contain the item (record / record folder / active content)
        Parameters:
        json - The request content as JSON object
        Returns:
        List of NodeRef(s) of the hold(s)