Package com.mossle.api.scope

Examples of com.mossle.api.scope.ScopeDTO


        for (Role role : userStatus.getRoles()) {
            if (scopeId.equals(role.getScopeId())) {
                buff.append(role.getName()).append(",");
            } else {
                ScopeDTO scopeDto = scopeConnector.findById(role.getScopeId());
                buff.append(role.getName()).append("(")
                        .append(scopeDto.getName()).append("),");
            }
        }

        if (buff.length() > 0) {
            buff.deleteCharAt(buff.length() - 1);
View Full Code Here


    public String manage(@RequestParam("id") Long id, Model model)
            throws Exception {
        RoleDef roleDef = roleDefManager.get(id);
        List<Role> roles = roleManager.findBy("roleDef.id", id);

        ScopeDTO currentScope = ScopeHolder.getScopeDto();
        List<ScopeDTO> scopeDtos;

        if (currentScope.isShared()) {
            scopeDtos = scopeConnector.findAll();
        } else {
            scopeDtos = new ArrayList<ScopeDTO>();
            scopeDtos.add(currentScope);
        }
View Full Code Here

    @RequestMapping("role-def-sync")
    public String sync(@RequestParam("id") Long id) throws Exception {
        RoleDef roleDef = roleDefManager.get(id);
        List<Role> roles = roleManager.findBy("roleDef.id", id);

        ScopeDTO currentScope = ScopeHolder.getScopeDto();
        List<ScopeDTO> scopeDtos;

        if (currentScope.isShared()) {
            scopeDtos = scopeConnector.findAll();
        } else {
            scopeDtos = new ArrayList<ScopeDTO>();
            scopeDtos.add(currentScope);
        }
View Full Code Here

    public void init(FilterConfig filterConfig) {
    }

    public void doFilter(ServletRequest req, ServletResponse res,
            FilterChain filterChain) throws ServletException, IOException {
        ScopeDTO scopeDto = ScopeHolder.getScopeDto();
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;
        logger.debug("requestURI : {}", request.getRequestURI());
        logger.debug("requestURL : {}", request.getRequestURL());
        logger.debug("servletPath : {}", request.getServletPath());
        logger.debug("pathInfo : {}", request.getPathInfo());

        String servletPath = request.getServletPath();

        if (scopeDto.getType() != ScopeDTO.TYPE_CMS) {
            if (servletPath.startsWith("/cms/r/")) {
                String path = baseDir + servletPath.substring("/cms".length());
                logger.debug("path : {}", path);
                IoUtils.copyFileToOutputStream(path, response.getOutputStream());
            } else {
View Full Code Here

    public List<ScopeDTO> findAll() {
        List<ScopeDTO> scopeDtos = new ArrayList<ScopeDTO>();
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sqlFindAll);

        for (Map<String, Object> map : list) {
            ScopeDTO scopeDto = convertScopeDto(map);
            scopeDtos.add(scopeDto);
        }

        return scopeDtos;
    }
View Full Code Here

        List<ScopeDTO> scopeDtos = new ArrayList<ScopeDTO>();
        List<Map<String, Object>> list = jdbcTemplate
                .queryForList(sqlFindSharedScopes);

        for (Map<String, Object> map : list) {
            ScopeDTO scopeDto = convertScopeDto(map);
            scopeDtos.add(scopeDto);
        }

        return scopeDtos;
    }
View Full Code Here

            return null;
        }

        logger.debug("{}", map);

        ScopeDTO scopeDto = new ScopeDTO();
        scopeDto.setId(this.getString(map.get("id")));
        scopeDto.setCode(this.getString(map.get("code")));
        scopeDto.setName(this.getString(map.get("name")));
        scopeDto.setUserRepoRef(this.getString(map.get("userRepoRef")));
        scopeDto.setShared(Integer.valueOf(1).equals(map.get("shared")));
        scopeDto.setType(this.getInt(map.get("type")));

        return scopeDto;
    }
View Full Code Here

            .getLogger(ScopeConnectorWrapper.class);
    private ScopeConnector scopeConnector;
    private ScopeCache scopeCache;

    public ScopeDTO findById(String id) {
        ScopeDTO scopeDto = scopeCache.findById(id);

        if (scopeDto == null) {
            synchronized (scopeCache) {
                scopeDto = scopeCache.findById(id);
View Full Code Here

        return scopeDto;
    }

    public ScopeDTO findByRef(String ref) {
        ScopeDTO scopeDto = scopeCache.findByRef(ref);

        if (scopeDto == null) {
            synchronized (scopeCache) {
                scopeDto = scopeCache.findByRef(ref);
View Full Code Here

        return scopeDto;
    }

    public ScopeDTO findByCode(String code) {
        ScopeDTO scopeDto = scopeCache.findByCode(code);

        if (scopeDto == null) {
            synchronized (scopeCache) {
                scopeDto = scopeCache.findByCode(code);
View Full Code Here

TOP

Related Classes of com.mossle.api.scope.ScopeDTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.