private void process(String comment, boolean asPublic) {
   try {
     regMan.processRegistrationRequest(
         requestState.getRequestId(),
         null,
         RegistrationRequestAction.update,
         asPublic ? comment : null,
         asPublic ? null : comment);
     bus.fireEvent(new RegistrationRequestChangedEvent(requestState.getRequestId()));
   } catch (EngineException e) {
     NotificationPopup.showError(
         msg, msg.getMessage("RequestProcessingPanel.errorRequestProcess"), e);
   }
 }
 private List<VerifiableEmail> getEmailIdentities(RegistrationRequestState currentRequest)
     throws EngineException {
   List<VerifiableEmail> emailIds = new ArrayList<>();
   List<IdentityParam> identities = currentRequest.getRequest().getIdentities();
   if (identities == null) return emailIds;
   for (IdentityParam id : identities)
     if (id != null && id.getTypeId().equals(EmailIdentity.ID))
       emailIds.add(EmailIdentity.fromIdentityParam(id));
   return emailIds;
 }
 private Attribute<?> getEmailAttributeFromRequest(
     RegistrationRequestState currentRequest, SqlSession sql) throws EngineException {
   List<Attribute<?>> attrs = currentRequest.getRequest().getAttributes();
   if (attrs == null) return null;
   AttributeType at =
       attributesHelper.getAttributeTypeWithSingeltonMetadata(
           ContactEmailMetadataProvider.NAME, sql);
   if (at == null) return null;
   for (Attribute<?> ap : attrs) {
     if (ap == null) continue;
     if (ap.getName().equals(at.getName()) && ap.getGroupPath().equals("/")) return ap;
   }
   return null;
 }
 public void setInput(RegistrationRequestState requestState) {
   commentField.setValue("");
   contentP.removeAllComponents();
   this.requestState = requestState;
   List<AdminComment> comments = requestState.getAdminComments();
   for (AdminComment comment : comments) {
     StringBuilder sb = new StringBuilder();
     if (comment.isPublicComment()) sb.append(msg.getMessage("RequestCommentPanel.public"));
     else sb.append(msg.getMessage("RequestCommentPanel.internal"));
     sb.append(" ")
         .append(new SimpleDateFormat(Constants.SIMPLE_DATE_FORMAT).format(comment.getDate()));
     sb.append("\n\n").append(comment.getContents());
     Label commentL = new Label(sb.toString(), ContentMode.PREFORMATTED);
     commentL.addStyleName(Styles.messageBox.toString());
     contentP.addComponent(commentL);
   }
 }