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);
}
});
}
Aggregations