Example usage for org.springframework.web.context.support WebApplicationContextUtils getWebApplicationContext

List of usage examples for org.springframework.web.context.support WebApplicationContextUtils getWebApplicationContext

Introduction

In this page you can find the example usage for org.springframework.web.context.support WebApplicationContextUtils getWebApplicationContext.

Prototype

@Nullable
public static WebApplicationContext getWebApplicationContext(ServletContext sc) 

Source Link

Document

Find the root WebApplicationContext for this web app, typically loaded via org.springframework.web.context.ContextLoaderListener .

Usage

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public SearchResult lookUpUser(String SID, String searchstring, int max, int start, String orderby,
        boolean asc) {
    try {//from   ww  w .j av a2  s. com

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.lookUpUser(SID, searchstring, max, start, orderby, asc);

    } catch (Exception err) {
        log.error("[lookUpUser]", err);
    }
    return null;
}

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public SearchResult getUserList(String SID, int start, int max, String orderby, boolean asc,
        HttpServletRequest request) {//from  ww  w . java 2s . com
    try {

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.getUserList(SID, start, max, orderby, asc);

    } catch (Exception err) {
        log.error("[getUserList]", err);
    }
    return null;
}

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public SearchResult getUserListByOrganization(String SID, int start, int max, String orderby, boolean asc,
        long organization_id) {
    try {//w w  w.j  av a  2s .  com

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.getUserListByOrganization(SID, start, max, orderby, asc, organization_id);

    } catch (Exception err) {
        log.error("[getUserListByOrganization]", err);
    }
    return null;
}

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public List<UserOrgDTO> getUserByOrganization(String SID, Long organization_id) {
    try {/*from w w w  . ja  v a2  s.  co m*/

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.getUserByOrganization(SID, organization_id);

    } catch (Exception err) {
        log.error("[getUserByOrganization]", err);
    }
    return null;
}

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public Long updateUserProfile(String SID, Map values) {
    try {/*from  w ww.  j a  v a2s .co  m*/

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.updateUserProfile(SID, values);

    } catch (Exception err) {
        log.error("[updateUserProfile]", err);
    }
    return null;
}

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public Long saveOrUpdateUser(String SID, Map regObjectObj) {
    try {//  w  w  w.  j  a  v a 2 s  .co m

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.saveOrUpdateUser(SID, regObjectObj);

    } catch (Exception err) {
        log.error("[saveOrUpdateUser]", err);
    }
    return null;
}

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public Long saveOrUpdateUserOnly(String SID, Object regObjectObj) {
    try {// w w  w .j  a v a  2  s.  c  om

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.saveOrUpdateUserOnly(SID, regObjectObj);

    } catch (Exception err) {
        log.error("[saveOrUpdateUserOnly]", err);
    }
    return null;
}

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public Long deleteUserAdmin(String SID, int user_idClient) {
    try {//  w  w w  .  jav  a 2  s  . c  o  m

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.deleteUserAdmin(SID, user_idClient);

    } catch (Exception err) {
        log.error("[deleteUserAdmin]", err);
    }
    return null;
}

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public Long deleteUserFromOrganization(String SID, long user_idClient, long organization_id,
        HttpServletRequest request) {//  ww w .j  a va2s .  c  om
    try {

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.deleteUserFromOrganization(SID, user_idClient, organization_id);

    } catch (Exception err) {
        log.error("[deleteUserFromOrganization]", err);
    }
    return null;
}

From source file:org.i4change.app.http.javarpc.UserServiceRPC.java

public Long saveOrUpdateUserSidebarPropertyByDiagram(String SID, Long userSidebarPropertyId, Long diagramNo,
        Map propMap) {/*from   www. j av a 2 s. com*/
    try {

        ServletContext servletContext = this.servletRequest.getSession().getServletContext();

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        IUserservice userservice = (IUserservice) context.getBean("userservice.service");

        return userservice.saveOrUpdateUserSidebarPropertyByDiagram(SID, userSidebarPropertyId, diagramNo,
                propMap);

    } catch (Exception err) {
        log.error("[deleteUserFromOrganization]", err);
    }
    return null;
}