Package io.lumify.core.user

Examples of io.lumify.core.user.User


    public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception {
        String uiPreferencesString = getOptionalParameter(request, "ui-preferences");
        String propertyName = getOptionalParameter(request, "name");
        String propertyValue = getOptionalParameter(request, "value");

        User user = getUser(request);
        if (user == null || user.getUsername() == null) {
            respondWithNotFound(response);
            return;
        }

        if (uiPreferencesString != null) {
            getUserRepository().setUiPreferences(user, new JSONObject(uiPreferencesString));
        } else if (propertyName != null) {
            user.getUiPreferences().put(propertyName, propertyValue);
            getUserRepository().setUiPreferences(user, user.getUiPreferences());
        } else {
            respondWithBadRequest(response, "ui-preferences", "either ui-preferences or name,value are required parameters.");
        }

        user = getUser(request);
View Full Code Here


    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception {
        final String username = UrlUtils.urlDecode(request.getParameter("username"));
        final String password = UrlUtils.urlDecode(request.getParameter("password")).trim();

        User user = getUserRepository().findByUsername(username);
        if (user != null && getUserRepository().isPasswordValid(user, password)) {
            getUserRepository().recordLogin(user, request.getRemoteAddr());
            CurrentUser.set(request, user.getUserId(), user.getUsername());
            JSONObject json = new JSONObject();
            json.put("status", "OK");
            respondWithJson(response, json);
        } else {
            response.sendError(HttpServletResponse.SC_FORBIDDEN);
View Full Code Here

    }

    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception {
        final String concept = UrlUtils.urlDecode(getAttributeString(request, "concept"));
        User user = getUser(request);

        Iterable<DictionaryEntry> dictionary = dictionaryEntryRepository.findByConcept(concept, user);
        JSONArray entries = new JSONArray();
        JSONObject results = new JSONObject();
        for (DictionaryEntry entry : dictionary) {
View Full Code Here

        String propertyKey = UrlUtils.urlDecode(getAttributeString(request, "propertyKey"));
        playbackOptions.range = getOptionalParameter(request, "Range");
        playbackOptions.download = getOptionalParameter(request, "download") != null;
        playbackOptions.playback = getOptionalParameter(request, "playback") != null;

        User user = getUser(request);
        Authorizations authorizations = getAuthorizations(request, user);
        handle(response, graphVertexId, propertyName, propertyKey, playbackOptions, authorizations);
    }
View Full Code Here

    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception {
        final String tokens = getRequiredParameter(request, "tokens");
        final String concept = getRequiredParameter(request, "concept");
        final String resolvedName = getOptionalParameter(request, "resolvedName");
        User user = getUser(request);

        DictionaryEntry entry = dictionaryEntryRepository.saveNew(tokens, concept, resolvedName, user);

        JSONObject resultJson = new JSONObject();
        resultJson.put("success", true);
View Full Code Here

    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception {
        String userName = getRequiredParameter(request, "user-name");

        User user = this.getUserRepository().findByUsername(userName);
        if (user == null) {
            respondWithNotFound(response);
            return;
        }
View Full Code Here

        JSONObject result = new JSONObject();
        JSONObject users = new JSONObject();
        result.put("users", users);

        for (String userId : userIds) {
            User user = getUserRepository().findById(userId);
            JSONObject userJson = UserRepository.toJson(user);
            users.put(user.getUserId(), userJson);
        }

        respondWithJson(response, result);
    }
View Full Code Here

    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception {
        final String workspaceId = getActiveWorkspaceId(request);
        final String data = getRequiredParameter(request, "data");

        User authUser = getUser(request);

        Workspace workspace = workspaceRepository.findById(workspaceId, authUser);
        if (workspace == null) {
            respondWithNotFound(response);
            return;
View Full Code Here

        analystsNotebookExporter = InjectHelper.getInstance(AnalystsNotebookExporter.class);
    }

    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception {
        User user = getUser(request);
        Authorizations authorizations = getAuthorizations(request, user);
        String workspaceId = getActiveWorkspaceId(request);
        Workspace workspace = workspaceRepository.findById(workspaceId, user);

        AnalystsNotebookVersion version = DEFAULT_VERSION;
View Full Code Here

    }

    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception {
        final String graphVertexId = getAttributeString(request, "graphVertexId");
        User user = getUser(request);
        Authorizations authorizations = getAuthorizations(request, user);
        String workspaceId = getActiveWorkspaceId(request);

        ClientApiElement element = handle(graphVertexId, workspaceId, authorizations);
        respondWithClientApiObject(response, element);
View Full Code Here

TOP

Related Classes of io.lumify.core.user.User

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.