mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
OpenSearch
- integrate Alfresco Web Client authentication (login page) - small refactoring of api service initialisation git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4734 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
package org.alfresco.web.api;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -52,7 +54,8 @@ public class APIServlet extends BaseServlet
|
||||
|
||||
// Retrieve all web api services and index by http url & http method
|
||||
ApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
|
||||
apiServiceRegistry = new APIServiceRegistry(getServletContext(), context);
|
||||
initContext(context);
|
||||
apiServiceRegistry = new APIServiceRegistry(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,4 +112,19 @@ public class APIServlet extends BaseServlet
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise any API beans that require a servlet context
|
||||
*
|
||||
* @param appContext application context
|
||||
*/
|
||||
private void initContext(ApplicationContext appContext)
|
||||
{
|
||||
ServletContext servletContext = getServletContext();
|
||||
Map<String, APIContextAware> contextAwareMap = appContext.getBeansOfType(APIContextAware.class, false, false);
|
||||
for (APIContextAware contextAware: contextAwareMap.values())
|
||||
{
|
||||
contextAware.setAPIContext(servletContext);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user