use of org.b3log.latke.repository.annotation.Transactional in project symphony by b3log.
the class NotificationMgmtService method addArticleNotification.
/**
* Adds a 'article' type notification with the specified request json object.
*
* @param requestJSONObject the specified request json object, for example,
* "userId"; "",
* "dataId": ""
* @throws ServiceException service exception
*/
// XXX: Unused
@Transactional
public void addArticleNotification(final JSONObject requestJSONObject) throws ServiceException {
try {
requestJSONObject.put(Notification.NOTIFICATION_DATA_TYPE, Notification.DATA_TYPE_C_ARTICLE);
addNotification(requestJSONObject);
} catch (final RepositoryException e) {
final String msg = "Adds notification [type=article] failed";
LOGGER.log(Level.ERROR, msg, e);
throw new ServiceException(msg);
}
}
use of org.b3log.latke.repository.annotation.Transactional in project symphony by b3log.
the class NotificationMgmtService method addSysAnnounceRoleChangedNotification.
/**
* Adds a 'sys announce - role changed' type notification with the specified request json object.
*
* @param requestJSONObject the specified request json object, for example,
* "userId"; "",
* "dataId": "" // oldRoleId-newRoleId
* @throws ServiceException service exception
*/
@Transactional
public void addSysAnnounceRoleChangedNotification(final JSONObject requestJSONObject) throws ServiceException {
try {
requestJSONObject.put(Notification.NOTIFICATION_DATA_TYPE, Notification.DATA_TYPE_C_SYS_ANNOUNCE_ROLE_CHANGED);
addNotification(requestJSONObject);
} catch (final RepositoryException e) {
final String msg = "Adds notification [type=sys_announce_role_changed] failed";
LOGGER.log(Level.ERROR, msg, e);
throw new ServiceException(msg);
}
}
use of org.b3log.latke.repository.annotation.Transactional in project symphony by b3log.
the class NotificationMgmtService method addFollowingArticleUpdateNotification.
/**
* Adds a 'following - article update' type notification with the specified request json object.
*
* @param requestJSONObject the specified request json object, for example,
* "userId"; "",
* "dataId": "" // article id
* @throws ServiceException service exception
*/
@Transactional
public void addFollowingArticleUpdateNotification(final JSONObject requestJSONObject) throws ServiceException {
try {
requestJSONObject.put(Notification.NOTIFICATION_DATA_TYPE, Notification.DATA_TYPE_C_FOLLOWING_ARTICLE_UPDATE);
addNotification(requestJSONObject);
} catch (final RepositoryException e) {
final String msg = "Adds notification [type=following_article_update] failed";
LOGGER.log(Level.ERROR, msg, e);
throw new ServiceException(msg);
}
}
use of org.b3log.latke.repository.annotation.Transactional in project symphony by b3log.
the class NotificationMgmtService method addSysAnnounceNewUserNotification.
/**
* Adds a 'sys announce - new user' type notification with the specified request json object.
*
* @param requestJSONObject the specified request json object, for example,
* "userId"; "",
* "dataId": "" // article id
* @throws ServiceException service exception
*/
@Transactional
public void addSysAnnounceNewUserNotification(final JSONObject requestJSONObject) throws ServiceException {
try {
requestJSONObject.put(Notification.NOTIFICATION_DATA_TYPE, Notification.DATA_TYPE_C_SYS_ANNOUNCE_NEW_USER);
addNotification(requestJSONObject);
} catch (final RepositoryException e) {
final String msg = "Adds notification [type=sys_announce_new_user] failed";
LOGGER.log(Level.ERROR, msg, e);
throw new ServiceException(msg);
}
}
use of org.b3log.latke.repository.annotation.Transactional in project symphony by b3log.
the class NotificationMgmtService method addPointExchangeNotification.
/**
* Adds a 'point exchange' type notification with the specified request json object.
*
* @param requestJSONObject the specified request json object, for example,
* "userId"; "",
* "dataId": "" // transfer record id
* @throws ServiceException service exception
*/
@Transactional
public void addPointExchangeNotification(final JSONObject requestJSONObject) throws ServiceException {
try {
requestJSONObject.put(Notification.NOTIFICATION_DATA_TYPE, Notification.DATA_TYPE_C_POINT_EXCHANGE);
addNotification(requestJSONObject);
} catch (final RepositoryException e) {
final String msg = "Adds notification [type=point_exchange] failed";
LOGGER.log(Level.ERROR, msg, e);
throw new ServiceException(msg);
}
}
Aggregations