예제 #1
0
 private List<String> getUrisFromUserAccounts(Collection<UserAccount> proxyUsers) {
   List<String> list = new ArrayList<String>();
   for (UserAccount u : proxyUsers) {
     list.add(u.getUri());
   }
   return list;
 }
예제 #2
0
  private ProxyInfo assembleProxyInfoForUser(UserAccount proxyUser) {
    String userUri = proxyUser.getUri();
    String label = assembleUserAccountLabel(proxyUser);
    String classLabel = "";
    String imageUrl =
        UrlBuilder.getUrl(
            PlaceholderUtil.getPlaceholderImagePathForType(vreq, VitroVocabulary.USERACCOUNT));

    // Does this user have a profile? Can we get better info?
    Individual proxyProfilePage = getProfilePage(proxyUser);
    if (proxyProfilePage != null) {
      String thumbUrl = proxyProfilePage.getThumbUrl();
      if ((thumbUrl != null) && (!thumbUrl.isEmpty())) {
        imageUrl = UrlBuilder.getUrl(thumbUrl);
      }
      classLabel = getMostSpecificTypeLabel(proxyProfilePage.getURI());
    }
    return new ProxyInfo(userUri, label, classLabel, imageUrl);
  }
예제 #3
0
  public final ResponseValues showPage() {
    Map<String, Object> body = new HashMap<String, Object>();

    if (isSubmit()) {
      body.put("emailAddress", emailAddress);
      body.put("firstName", firstName);
      body.put("lastName", lastName);
      body.put("proxies", buildOngoingProxyList());
    } else {
      body.put("emailAddress", userAccount.getEmailAddress());
      body.put("firstName", userAccount.getFirstName());
      body.put("lastName", userAccount.getLastName());
      body.put("proxies", buildOriginalProxyList());
    }
    body.put("formUrls", buildUrlsMap());
    body.put("myAccountUri", userAccount.getUri());
    body.put("profileTypes", buildProfileTypesString());

    // Could I do this without exposing this mechanism? But how to search
    // for an associated profile in AJAX?
    body.put("matchingProperty", SelfEditingConfiguration.getBean(vreq).getMatchingPropertyUri());

    if (userAccount.isExternalAuthOnly()) {
      body.put("externalAuthOnly", Boolean.TRUE);
    }
    if (!errorCode.isEmpty()) {
      body.put(errorCode, Boolean.TRUE);
    }
    if (!confirmationCode.isEmpty()) {
      body.put(confirmationCode, Boolean.TRUE);
    }
    if (isProxyPanelAuthorized()) {
      body.put("showProxyPanel", Boolean.TRUE);
    }

    strategy.addMoreBodyValues(body);

    return new TemplateResponseValues(TEMPLATE_NAME, body);
  }