Skip to content

Commit

Permalink
LPS-42212 Same for bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoDiaz authored and brianchandotcom committed Feb 26, 2014
1 parent a4e3d36 commit 0cf2bf1
Showing 1 changed file with 18 additions and 1 deletion.
Expand Up @@ -29,6 +29,7 @@
import com.liferay.portal.kernel.search.IndexerRegistryUtil;
import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.Sort;
import com.liferay.portal.kernel.transaction.TransactionCommitCallbackRegistryUtil;
import com.liferay.portal.kernel.util.ArrayUtil;
import com.liferay.portal.kernel.util.ContentTypes;
import com.liferay.portal.kernel.util.OrderByComparator;
Expand Down Expand Up @@ -65,6 +66,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.Callable;

import javax.portlet.PortletPreferences;

Expand Down Expand Up @@ -665,6 +667,21 @@ protected long getFolder(BookmarksEntry entry, long folderId)
return folderId;
}

protected void notify(final SubscriptionSender subscriptionSender) {
TransactionCommitCallbackRegistryUtil.registerCallback(
new Callable<Void>() {

@Override
public Void call() throws Exception {
subscriptionSender.flushNotificationsAsync();

return null;
}

}
);
}

protected void notifySubscribers(
BookmarksEntry entry, ServiceContext serviceContext)
throws PortalException, SystemException {
Expand Down Expand Up @@ -774,7 +791,7 @@ protected void notifySubscribers(
subscriptionSender.addPersistedSubscribers(
BookmarksEntry.class.getName(), entry.getEntryId());

subscriptionSender.flushNotificationsAsync();
notify(subscriptionSender);
}

protected void validate(String url) throws PortalException {
Expand Down

0 comments on commit 0cf2bf1

Please sign in to comment.