Package com.atlassian.sal.api.user

Examples of com.atlassian.sal.api.user.UserProfile


    public ReceivePack create(HttpServletRequest req, Repository repo) throws ServiceNotEnabledException, ServiceNotAuthorizedException
    {
        String user = userManager.getRemoteUsername(req);
        String pluginKey = repo.getWorkTree().getName();
        UserProfile userProfile = userManager.getUserProfile(user);

        final UserExtension userExtension = speakeasyService.getRemotePlugin(pluginKey, user);
        if (userExtension != null && !userExtension.isCanEdit())
        {
            throw new ServiceNotAuthorizedException();
View Full Code Here


    private <T extends Extension> T buildGlobal(Plugin plugin, T extension) throws PluginOperationFailedException
    {
        String author = getPluginAuthor(plugin);
        extension.setAuthor(author);
        UserProfile profile = userManager.getUserProfile(author);
        extension.setAuthorDisplayName(profile != null && profile.getFullName() != null
                ? profile.getFullName()
                : author);
        extension.setAuthorEmail(profile != null ? profile.getEmail() : "unknown@example.com");
        List<String> accessList = data.getUsersList(plugin.getKey());
        extension.setNumUsers(accessList.size());
        extension.setNumFavorites(data.getFavorites(plugin.getKey()).size());

        if (plugin.getResource("/" + JsonManifest.ATLASSIAN_EXTENSION_PATH) != null)
View Full Code Here

    {
        String toName = options.getToName();
        String toEmail = options.getToEmail();
        if (options.getToUsername() != null)
        {
            UserProfile to = userManager.getUserProfile(options.getToUsername());
            if (to != null)
            {
                toName = to.getFullName();
                toEmail = to.getEmail();
            }
            else
            {
                log.warn("Cannot find profile for user '" + options.getToUsername());
                return;
View Full Code Here

        {
            String toName = options.getToName();
            String toEmail = options.getToEmail();
            if (options.getToUsername() != null)
            {
                UserProfile toUser = userManager.getUserProfile(options.getToUsername());
                if (toUser != null)
                {
                    toName = toUser.getFullName();
                    toEmail = toUser.getEmail();
                }
                else
                {
                    log.warn("Cannot find profile for user '" + options.getToUsername());
                    return;
View Full Code Here

        sendFeedbackType(extension, feedback, "broken", user);
    }

    private void sendFeedbackType(final Extension extension, final Feedback feedback, final String feedbackType, final String user)
    {
        final UserProfile sender = userManager.getUserProfile(user);
        if (sender == null)
        {
            log.warn("Unable to send feedback from '" + user + "' due to no profile found");
            return;
        }
        String pluginAuthor = extension.getAuthor();
        if (pluginAuthor != null && userManager.getUserProfile(pluginAuthor) != null)
        {
            productAccessor.sendEmail(new EmailOptions()
                    .toUsername(pluginAuthor)
                    .subjectTemplate("email/" + feedbackType + "-subject.vm")
                    .bodyTemplate("email/" + feedbackType + "-body.vm")
                    .replyToEmail(sender.getEmail())
                    .context(new HashMap<String, Object>()
                    {{
                            put("plugin", extension);
                            put("sender", sender.getUsername());
                            put("senderFullName", sender.getFullName());
                            put("feedback", feedback);
                            put("nl", "\n");
                        }}));
        }
    }
View Full Code Here

            final FullNameResolver resolver = new FullNameResolver()
            {
                public String getFullName(String userName)
                {
                    UserProfile profile = userManager.getUserProfile(userName);
                    return profile != null ? profile.getFullName() : userName;
                }
            };
            productAccessor.sendEmail(new EmailOptions().toUsername(pluginAuthor).subjectTemplate("email/forked-subject.vm").bodyTemplate("email/forked-body.vm").context(new HashMap<String, Object>()
            {{
                    put("plugin", extension);
View Full Code Here

TOP

Related Classes of com.atlassian.sal.api.user.UserProfile

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.