Codota Logo
ConfluenceUser
Code IndexAdd Codota to your IDE (free)

How to use
ConfluenceUser
in
com.atlassian.confluence.user

Best Java code snippets using com.atlassian.confluence.user.ConfluenceUser (Showing top 12 results out of 315)

  • Common ways to obtain ConfluenceUser
private void myMethod () {
ConfluenceUser c =
  • Codota IconAuthenticatedUserThreadLocal.get()
  • Codota IconUserAccessor userAccessor;String str;userAccessor.getUserByName(str)
  • Smart code suggestions by Codota
}
origin: com.atlassian.confluence.plugins/confluence-advanced-macros

public DefaultUpdater(final ConfluenceUser user, I18NBean i18n) {
  this.username = user != null ? user.getName() : null;
  this.i18n = i18n;
}
origin: com.atlassian.confluence.plugins/confluence-business-blueprints

private Set<String> getUserKeys(List<String> listUsername)
{
  return listUsername.stream()
      .map(userAccessor::getUserByName)
      .filter(Objects::nonNull)
      .map(user -> user.getKey().getStringValue())
      .collect(Collectors.toSet());
}
origin: com.atlassian.confluence.plugins/confluence-mentions-plugin

items.add(User.fromUsername(currentUser.getName()));
items.addAll(networkService.getFollowing(currentUser.getKey(), new SimplePageRequest(0, maxResults)).getResults());
  final Iterator<User> followers = networkService.getFollowers(currentUser.getKey(), new SimplePageRequest(0, maxResults)).iterator();
  while (items.size() < maxResults && followers.hasNext()) {
    items.add(followers.next());
origin: com.atlassian.streams/streams-confluence-plugin

public String getChangedBy()
{
  final ConfluenceUser lastModifier = attachment.getLastModifier();
  return lastModifier != null ? lastModifier.getName() : null;
}
origin: com.atlassian.confluence.plugins/confluence-mentions-plugin

private boolean fragmentContainsUser(XMLEventReader xmlFragmentReader, ConfluenceUser user) throws XMLStreamException {
  while (xmlFragmentReader.hasNext()) {
    final XMLEvent xmlEvent = xmlFragmentReader.nextEvent();
    if (xmlEvent.isStartElement()) {
      final StartElement startElement = xmlEvent.asStartElement();
      if (startElement.getName().equals(USER_RESOURCE_QNAME)) {
        final Attribute userKeyAttribute = startElement.getAttributeByName(USERKEY_ATTRIBUTE_QNAME);
        if (userKeyAttribute != null && user.getKey() != null) {
          if (user.getKey().getStringValue().equals(userKeyAttribute.getValue())) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
origin: com.atlassian.confluence.plugins/confluence-userlister-plugin

  private void loadUsers() {
    users = usernames.stream().map(userAccessor::getUserByName)
        .filter(Objects::nonNull)  // If it's an anonymous user, then we can't do anything (CONF-5821)
        .filter(user -> !userAccessor.isDeactivated(user))  // we don't know group users are active, so check.
        .map(user -> new ListedUser(user, loggedInUsernames.contains(user.getName())))
        .collect(Collectors.toList());

    Collections.sort(users,
        Comparator.comparing(
            (ListedUser user) -> StringUtils.isBlank(user.getFullName()) ? user.getName() : user.getFullName(),
            String.CASE_INSENSITIVE_ORDER));
  }
}
origin: com.atlassian.confluence.plugins/confluence-mentions-plugin

  private void sendUserMention(final ConfluenceUser recipient,
                 final ConfluenceUser author,
                 final ContentEntityObject content,
                 final String mentionHtml) {
    final UserProfile recipientProfile = userManager.getUserProfile(recipient.getKey());
    final ConfluenceMentionEvent event = new ConfluenceMentionEvent(
        this,
        content,
        recipientProfile,
        author,
        mentionHtml
    );
    eventPublisher.publish(event);
  }
}
origin: com.atlassian.streams/streams-confluence-plugin

public boolean matches(final Attachment attachment)
{
  final ConfluenceUser lastModifier = attachment.getLastModifier();
  return equal(getChangedBy(), lastModifier != null ? lastModifier.getName() : null) &&
      getUrlPath().equals(extractUrlPath(attachment)) &&
      Math.abs(getModified().getTime() - attachment.getLastModificationDate().getTime()) < MILLIS_PER_MINUTE;
}
origin: com.atlassian.confluence.plugins/confluence-mentions-plugin

  @Override
  protected Maybe<MentionContentPayload> checkedCreate(ConfluenceMentionEvent event) {
    final ContentEntityObject content = event.getContent();

    final ConfluenceUser mentionedUser = userAccessor.getUserByName(event.getMentionedUserProfile().getUsername());
    final UserKey mentionedUserKey = mentionedUser != null ? mentionedUser.getKey() : null;

    final ConfluenceUser mentionAuthor = event.getMentionAuthor();
    final UserKey mentionAuthorKey = mentionAuthor != null ? mentionAuthor.getKey() : null;

    return Option.some(
        new SimpleMentionContentPayload(content.getId(),
            content.getTypeEnum(),
            mentionAuthorKey,
            mentionedUserKey,
            event.getMentionHtml()
        )
    );
  }
}
origin: com.atlassian.confluence.plugins/confluence-mentions-plugin

@Override
public String getExcerpt(ContentEntityObject content, ConfluenceUser mentionedUser) {
  if (mentionedUser == null || isBlank(mentionedUser.getName()) || content == null) {
    return "";
  }
  BodyContent bodyContent = content.getBodyContent();
  if (bodyContent.getBodyType() != BodyType.XHTML) {
    return "";
  }
  XMLEventReader reader = null;
  List<? extends CharSequence> excerpts;
  try {
    reader = xmlEventReaderFactory.createStorageXmlEventReader(
        new StringReader("<div>" + bodyContent.getBody() + "</div>")
    );
    excerpts = getExcerpts(reader, mentionedUser);
  } catch (XMLStreamException exception) {
    throw new RuntimeException("Error occurred while reading stream", exception);
  } finally {
    closeQuietly(reader);
  }
  StringBuilder result = new StringBuilder();
  excerpts.forEach(result::append);
  return result.toString();
}
origin: com.atlassian.confluence.plugins/confluence-business-blueprints

@Override
public String execute() throws Exception
{
  // Get all global space which user has create page permission
  SpacesQuery globalSpacesListBuilder = SpacesQuery.newQuery()
                          .forUser(getRemoteUser())
                          .withSpaceType(SpaceType.GLOBAL)
                          .withPermission(CREATEEDIT_PAGE_PERMISSION)
                          .build();
  globalSpaces = spaceManager.getAllSpaces(globalSpacesListBuilder);
  ConfluenceUser authenticatedUser = getAuthenticatedUser();
  if (authenticatedUser != null)
    personalSpace = spaceManager.getPersonalSpace(authenticatedUser.getName());
  favouriteSpaces = computeFavouriteSpaces(globalSpaces);
  // favourite spaces shouldn't appear in the global list as
  globalSpaces.removeAll(favouriteSpaces);
  loginURL = computeLoginURL();
  return SUCCESS;
}
origin: com.atlassian.confluence/confluence-studio-theme-plugin

private String getPersonalSpaceRedirectUrl()
{
  final String baseUrl = applicationProperties.getBaseUrl(UrlMode.CANONICAL);
  final ConfluenceUser user = AuthenticatedUserThreadLocal.get();
  if (user == null)
  {
    return baseUrl + "/login.action";
  }
  final Space space = spaceManager.getPersonalSpace(user);
  if (space != null)
  {
    return baseUrl + space.getUrlPath();
  }
  else
  {
    final boolean canCreatePersonalSpace = userAccessor.isSuperUser(user) ||
      permissionManager.hasCreatePermission(user,
        personalInformationManager.getOrCreatePersonalInformation(user), Space.class);
    if (canCreatePersonalSpace)
    {
      return baseUrl + "/spaces/createpersonalspace.action";
    }
  }
  return baseUrl + "/display/~" + user.getName();
}
com.atlassian.confluence.userConfluenceUser

Most used methods

  • getName
  • getKey

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Path (java.nio.file)
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JTable (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now