Search in sources :

Example 16 with Invitation

use of org.apache.openmeetings.db.entity.room.Invitation in project openmeetings by apache.

the class RoomWebService method hash.

/**
 * Method to get invitation hash with given parameters
 *
 * @param sid - The SID of the User. This SID must be marked as Loggedin
 * @param invite - parameters of the invitation
 * @param sendmail - flag to determine if email should be sent or not
 * @return - serviceResult object with the result
 */
@WebMethod
@POST
@Path("/hash")
public ServiceResult hash(@WebParam(name = "sid") @QueryParam("sid") String sid, @WebParam(name = "invite") @QueryParam("invite") InvitationDTO invite, @WebParam(name = "sendmail") @QueryParam("sendmail") boolean sendmail) {
    log.debug("[hash] invite {}", invite);
    return performCall(sid, User.Right.Soap, sd -> {
        Invitation i = invite.get(sd.getUserId(), userDao, roomDao);
        i = inviteDao.update(i);
        if (i != null) {
            if (sendmail) {
                try {
                    inviteManager.sendInvitationLink(i, MessageType.Create, invite.getSubject(), invite.getMessage(), false);
                } catch (Exception e) {
                    throw new ServiceException(e.getMessage());
                }
            }
            return new ServiceResult(i.getHash(), Type.SUCCESS);
        } else {
            return new ServiceResult("error.unknown", Type.ERROR);
        }
    });
}
Also used : ServiceResult(org.apache.openmeetings.db.dto.basic.ServiceResult) ServiceException(org.apache.openmeetings.webservice.error.ServiceException) Invitation(org.apache.openmeetings.db.entity.room.Invitation) ServiceException(org.apache.openmeetings.webservice.error.ServiceException) WebMethod(javax.jws.WebMethod) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Aggregations

Invitation (org.apache.openmeetings.db.entity.room.Invitation)16 Date (java.util.Date)3 User (org.apache.openmeetings.db.entity.user.User)3 LocalDateTime (java.time.LocalDateTime)2 Appointment (org.apache.openmeetings.db.entity.calendar.Appointment)2 MeetingMember (org.apache.openmeetings.db.entity.calendar.MeetingMember)2 Room (org.apache.openmeetings.db.entity.room.Room)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 RadioGroup (org.apache.wicket.markup.html.form.RadioGroup)2 JQueryBehavior (com.googlecode.wicket.jquery.core.JQueryBehavior)1 DialogButton (com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton)1 MessageDialog (com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog)1 ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 TimeZone (java.util.TimeZone)1 WebMethod (javax.jws.WebMethod)1 POST (javax.ws.rs.POST)1