Search in sources :

Example 1 with AdminEmailCreateGroupReceiverListUploadUrlAjaxPageData

use of teammates.ui.pagedata.AdminEmailCreateGroupReceiverListUploadUrlAjaxPageData in project teammates by TEAMMATES.

the class AdminEmailCreateGroupReceiverListUploadUrlAction method execute.

@Override
protected ActionResult execute() {
    gateKeeper.verifyAdminPrivileges(account);
    AdminEmailCreateGroupReceiverListUploadUrlAjaxPageData data = new AdminEmailCreateGroupReceiverListUploadUrlAjaxPageData(account, sessionToken);
    try {
        String callbackUrl = Url.addParamToUrl(Const.ActionURIs.ADMIN_EMAIL_GROUP_RECEIVER_LIST_UPLOAD, Const.ParamsNames.SESSION_TOKEN, sessionToken);
        data.nextUploadUrl = GoogleCloudStorageHelper.getNewUploadUrl(callbackUrl);
        data.ajaxStatus = "Group receiver list upload url created, proceed to uploading";
    } catch (BlobstoreFailureException | IllegalArgumentException e) {
        data.nextUploadUrl = null;
        isError = true;
        data.ajaxStatus = "An error occurred when creating upload URL, please try again";
    }
    return createAjaxResult(data);
}
Also used : BlobstoreFailureException(com.google.appengine.api.blobstore.BlobstoreFailureException) AdminEmailCreateGroupReceiverListUploadUrlAjaxPageData(teammates.ui.pagedata.AdminEmailCreateGroupReceiverListUploadUrlAjaxPageData)

Aggregations

BlobstoreFailureException (com.google.appengine.api.blobstore.BlobstoreFailureException)1 AdminEmailCreateGroupReceiverListUploadUrlAjaxPageData (teammates.ui.pagedata.AdminEmailCreateGroupReceiverListUploadUrlAjaxPageData)1