Search in sources :

Example 11 with ActivityStreamException

use of com.xpn.xwiki.plugin.activitystream.api.ActivityStreamException in project xwiki-platform by xwiki.

the class DefaultEventStatusManager method saveEventStatusInStore.

private void saveEventStatusInStore(ActivityEventStatus eventStatus) throws ActivityStreamException {
    XWikiContext context = contextProvider.get();
    XWikiHibernateStore hibernateStore = context.getWiki().getHibernateStore();
    try {
        hibernateStore.beginTransaction(context);
        Session session = hibernateStore.getSession(context);
        session.save(eventStatus);
        hibernateStore.endTransaction(context, true);
    } catch (XWikiException e) {
        hibernateStore.endTransaction(context, false);
        throw new ActivityStreamException(e);
    }
}
Also used : XWikiHibernateStore(com.xpn.xwiki.store.XWikiHibernateStore) XWikiContext(com.xpn.xwiki.XWikiContext) ActivityStreamException(com.xpn.xwiki.plugin.activitystream.api.ActivityStreamException) XWikiException(com.xpn.xwiki.XWikiException) Session(org.hibernate.Session)

Aggregations

ActivityStreamException (com.xpn.xwiki.plugin.activitystream.api.ActivityStreamException)11 XWikiException (com.xpn.xwiki.XWikiException)6 XWikiContext (com.xpn.xwiki.XWikiContext)5 ActivityStreamPlugin (com.xpn.xwiki.plugin.activitystream.plugin.ActivityStreamPlugin)4 ActivityEvent (com.xpn.xwiki.plugin.activitystream.api.ActivityEvent)3 XWikiHibernateStore (com.xpn.xwiki.store.XWikiHibernateStore)3 ArrayList (java.util.ArrayList)3 Session (org.hibernate.Session)3 EventStreamDeletedEvent (org.xwiki.eventstream.events.EventStreamDeletedEvent)3 MalformedURLException (java.net.MalformedURLException)2 EventStreamAddedEvent (org.xwiki.eventstream.events.EventStreamAddedEvent)2 XWikiDocument (com.xpn.xwiki.doc.XWikiDocument)1 AttachmentAddedEvent (com.xpn.xwiki.internal.event.AttachmentAddedEvent)1 AttachmentDeletedEvent (com.xpn.xwiki.internal.event.AttachmentDeletedEvent)1 AttachmentUpdatedEvent (com.xpn.xwiki.internal.event.AttachmentUpdatedEvent)1 CommentAddedEvent (com.xpn.xwiki.internal.event.CommentAddedEvent)1 CommentDeletedEvent (com.xpn.xwiki.internal.event.CommentDeletedEvent)1 CommentUpdatedEvent (com.xpn.xwiki.internal.event.CommentUpdatedEvent)1 Date (java.util.Date)1 Query (org.hibernate.Query)1