Package io.lumify.web.clientapi.model

Examples of io.lumify.web.clientapi.model.ClientApiWorkspaces


    }

    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception {
        User user = getUser(request);
        ClientApiWorkspaces results = handle(user);
        respondWithClientApiObject(response, results);
    }
View Full Code Here


    public ClientApiWorkspaces handle(User user) {
        Iterable<Workspace> workspaces = workspaceRepository.findAll(user);
        String activeWorkspaceId = getUserRepository().getCurrentWorkspaceId(user.getUserId());
        activeWorkspaceId = activeWorkspaceId != null ? activeWorkspaceId : "";

        ClientApiWorkspaces results = new ClientApiWorkspaces();
        for (Workspace workspace : workspaces) {
            ClientApiWorkspace workspaceClientApi = workspaceRepository.toClientApi(workspace, user, false);
            if (workspaceClientApi != null) {
                if (activeWorkspaceId.equals(workspace.getWorkspaceId())) { //if its the active one
                    workspaceClientApi.setActive(true);
                }
                results.addWorkspace(workspaceClientApi);
            }
        }
        return results;
    }
View Full Code Here

TOP

Related Classes of io.lumify.web.clientapi.model.ClientApiWorkspaces

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.