Class SearchProxy

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean, org.springframework.extensions.webscripts.WebScript

    public class SearchProxy
    extends org.springframework.extensions.webscripts.AbstractWebScript
    implements org.springframework.beans.factory.InitializingBean
    Alfresco OpenSearch Proxy Service Provides the ability to submit a request to a registered search engine via the Alfresco server.
    Author:
    davidc
    • 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
      SearchProxy()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()  
      java.lang.String createUrl​(java.lang.String engine, java.lang.String url, java.lang.String mimetype)
      Construct a "proxied" search engine url
      java.lang.String createUrl​(OpenSearchConfigElement.EngineConfig engine, java.lang.String mimetype)
      Construct a "proxied" search engine url
      void execute​(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res)  
      void setConfigService​(org.springframework.extensions.config.ConfigService configService)  
      void setFormatRegistry​(org.springframework.extensions.webscripts.FormatRegistry formatRegistry)  
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • formatRegistry

        protected org.springframework.extensions.webscripts.FormatRegistry formatRegistry
      • configService

        protected org.springframework.extensions.config.ConfigService configService
      • proxyPath

        protected java.lang.String proxyPath
    • Constructor Detail

      • SearchProxy

        public SearchProxy()
    • Method Detail

      • setFormatRegistry

        public void setFormatRegistry​(org.springframework.extensions.webscripts.FormatRegistry formatRegistry)
        Parameters:
        formatRegistry - FormatRegistry
      • setConfigService

        public void setConfigService​(org.springframework.extensions.config.ConfigService configService)
        Parameters:
        configService - ConfigService
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • execute

        public void execute​(org.springframework.extensions.webscripts.WebScriptRequest req,
                            org.springframework.extensions.webscripts.WebScriptResponse res)
                     throws java.io.IOException
        Specified by:
        execute in interface org.springframework.extensions.webscripts.WebScript
        Throws:
        java.io.IOException
      • createUrl

        public java.lang.String createUrl​(OpenSearchConfigElement.EngineConfig engine,
                                          java.lang.String mimetype)
        Construct a "proxied" search engine url
        Parameters:
        engine - engine name (as identified by )
        mimetype - url to proxy (as identified by mimetype)
        Returns:
        "proxied" url
      • createUrl

        public java.lang.String createUrl​(java.lang.String engine,
                                          java.lang.String url,
                                          java.lang.String mimetype)
        Construct a "proxied" search engine url
        Parameters:
        engine - engine name (as identified by )
        url - engine url
        mimetype - mimetype of url
        Returns:
        "proxied" url