[kune-commits] r1763 - in trunk/src: main/java/cc/kune/core/server main/java/cc/kune/core/server/init main/java/cc/kune/core/server/manager/file main/java/cc/kune/core/server/persist main/java/cc/kune/core/server/rack/filters/rest main/java/cc/kune/core/server/rpc main/java/cc/kune/lists/server/rpc test/java/cc/kune/core/server/integration
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Tue Mar 13 14:17:36 CET 2012
Author: vjrj_
Date: 2012-03-13 14:17:36 +0100 (Tue, 13 Mar 2012)
New Revision: 1763
Modified:
trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java
trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java
trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfirePersistModule.java
trunk/src/main/java/cc/kune/core/server/rack/filters/rest/TransactionalServiceExecutor.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java
trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
Log:
NEW - # 201: Add openfire to the persist system
http://kune.ourproject.org/issues/ticket/201
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -19,6 +19,9 @@
*/
package cc.kune.core.server;
+import static com.google.inject.matcher.Matchers.annotatedWith;
+import static com.google.inject.matcher.Matchers.any;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -41,6 +44,8 @@
import cc.kune.core.server.manager.file.UserLogoDownloadManager;
import cc.kune.core.server.manager.impl.GroupServerUtils;
import cc.kune.core.server.persist.DataSourceKunePersistModule;
+import cc.kune.core.server.persist.DataSourceOpenfirePersistModule;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.rack.RackBuilder;
import cc.kune.core.server.rack.RackModule;
import cc.kune.core.server.rack.filters.ForwardFilter;
@@ -55,8 +60,8 @@
import cc.kune.core.server.rest.UserJSONService;
import cc.kune.core.server.scheduler.CronServerTasksManager;
import cc.kune.docs.server.DocumentServerModule;
+import cc.kune.events.server.EventsServerModule;
import cc.kune.events.server.EventsServlet;
-import cc.kune.events.server.EventsServerModule;
import cc.kune.events.server.utils.EventsServerConversionUtil;
import cc.kune.hspace.client.ClientStatsService;
import cc.kune.lists.client.rpc.ListsService;
@@ -169,14 +174,18 @@
builder.use(new ServletModule() {
@Override
protected void configureServlets() {
- install(new DataSourceKunePersistModule());
- // install(new MyDataSourceTwoPersistModule());
+ final DataSourceKunePersistModule kuneDataSource = new DataSourceKunePersistModule();
+ install(kuneDataSource);
+ install(new DataSourceOpenfirePersistModule());
+ bindInterceptor(annotatedWith(KuneTransactional.class), any(),
+ kuneDataSource.getTransactionInterceptor());
+ bindInterceptor(any(), annotatedWith(KuneTransactional.class),
+ kuneDataSource.getTransactionInterceptor());
// more bindings
filter("/*").through(DataSourceKunePersistModule.MY_DATA_SOURCE_ONE_FILTER_KEY);
- // filter("/*").through(MyDataSourceTwoPersistModule.MY_DATA_SOURCE_TWO_FILTER_KEY);
-
+ filter("/*").through(DataSourceOpenfirePersistModule.MY_DATA_SOURCE_TWO_FILTER_KEY);
super.configureServlets();
}
});
Modified: trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -35,6 +35,7 @@
import cc.kune.core.server.manager.LicenseManager;
import cc.kune.core.server.manager.UserManager;
import cc.kune.core.server.manager.impl.ContentConstants;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.properties.KuneBasicProperties;
import cc.kune.core.shared.domain.ContentStatus;
import cc.kune.core.shared.dto.GroupType;
@@ -48,7 +49,6 @@
import com.google.inject.Inject;
import com.google.inject.Singleton;
-import com.google.inject.persist.Transactional;
@Singleton
public class DatabaseInitializer {
@@ -70,10 +70,7 @@
final GroupManager groupManager, final LicenseManager licenseManager,
final I18nLanguageManager languageManager, final I18nCountryManager countryManager,
final I18nTranslationManager translationManager, final ContentManager contentManager,
- final I18nTranslationServiceDefault translationService
-
- // , final XmppRosterProvider borrar) {
- ) {
+ final I18nTranslationServiceDefault translationService) {
this.properties = properties;
this.userManager = userManager;
this.groupManager = groupManager;
@@ -83,8 +80,6 @@
this.translationManager = translationManager;
this.translationService = translationService;
this.contentManager = contentManager;
- // assert borrar != null;
- // LOG.info("Roster items: " + borrar.count());
}
private void createDefUsersGroup() throws Exception, UserMustBeLoggedException {
@@ -188,7 +183,7 @@
translationService.init();
}
- @Transactional
+ @KuneTransactional
public void initDatabase() throws Exception {
createLicenses();
createOthers();
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -31,6 +31,7 @@
import cc.kune.core.server.auth.Authorizated;
import cc.kune.core.server.manager.FileManager;
import cc.kune.core.server.manager.GroupManager;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.shared.domain.AccessRol;
import cc.kune.core.shared.domain.utils.StateToken;
@@ -38,7 +39,6 @@
import cc.kune.domain.Group;
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
public class EntityBackgroundUploadManager extends FileGwtUploadAbstractServlet {
@@ -60,7 +60,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
- @Transactional
+ @KuneTransactional
protected String createUploadedFile(final String userHash, final StateToken stateToken,
final String fileName, final FileItem origFile, final String typeId) {
try {
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -34,6 +34,7 @@
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
import cc.kune.core.server.manager.GroupManager;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.AccessRol;
@@ -42,7 +43,6 @@
import cc.kune.domain.Group;
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
public class EntityLogoUploadManager extends FileGwtUploadAbstractServlet {
@@ -89,7 +89,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
- @Transactional
+ @KuneTransactional
protected String createUploadedFile(final String userHash, final StateToken stateToken,
final String fileName, final FileItem file, final String typeId) {
final String mimeTypeS = file.getContentType();
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -34,6 +34,7 @@
import cc.kune.core.server.content.ContentUtils;
import cc.kune.core.server.content.CreationService;
import cc.kune.core.server.manager.FileManager;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.server.utils.StringW;
import cc.kune.core.shared.domain.AccessRol;
@@ -44,7 +45,6 @@
import cc.kune.domain.User;
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
import com.google.inject.servlet.RequestScoped;
@RequestScoped
@@ -100,7 +100,7 @@
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, actionLevel = ActionLevel.container, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
Content createUploadedFileWrapped(final String userHash, final StateToken stateToken,
final String fileName, final FileItem fileUploadItem, final String typeId) throws Exception {
final String relDir = FileUtils.toDir(stateToken);
Modified: trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -24,12 +24,13 @@
import cc.kune.domain.finders.TagUserContentFinder;
import cc.kune.domain.finders.UserFinder;
-import com.google.inject.AbstractModule;
import com.google.inject.Key;
+import com.google.inject.PrivateModule;
import com.google.inject.Provider;
import com.google.inject.persist.jpa.JpaPersistModule;
+import com.google.inject.persist.jpa.KuneJpaLocalTxnInterceptor;
-public class DataSourceKunePersistModule extends AbstractModule {
+public class DataSourceKunePersistModule extends PrivateModule {
// FIXME Trying to make this PrivateModule so we can have two Persist sources
// http://code.google.com/p/google-guice/wiki/GuicePersistMultiModules
@@ -38,6 +39,7 @@
CustomPersistFilter.class, DataSourceKune.class);
private String settedJpaUnit = null;
private String settedProperties = null;
+ private KuneJpaLocalTxnInterceptor transactionInterceptor;
/**
* Instantiates this module (main constructor)
@@ -104,40 +106,35 @@
bind(Session.class).annotatedWith(DataSourceKune.class).toProvider(
DataSourceKuneSessionProvider.class);
- // FIXME: Trying to use a custom JpaLocalTxnInterceptor because when this
- // module is private the objects are not persisted with the guice-persist
- // @Transactional
-
- // final KuneJpaLocalTxnInterceptor transactionInterceptor = new
- // KuneJpaLocalTxnInterceptor();
- // requestInjection(transactionInterceptor);
- // bindInterceptor(annotatedWith(KuneTransactional.class), any(),
- // transactionInterceptor);
- // bindInterceptor(any(), annotatedWith(KuneTransactional.class),
- // transactionInterceptor);
-
final Provider<EntityManager> entityManagerProvider = binder().getProvider(EntityManager.class);
bind(EntityManager.class).annotatedWith(DataSourceKune.class).toProvider(entityManagerProvider);
+ transactionInterceptor = new KuneJpaLocalTxnInterceptor();
+ requestInjection(transactionInterceptor);
+
bind(MY_DATA_SOURCE_ONE_FILTER_KEY).to(CustomPersistFilter.class);
- // expose(EntityManager.class).annotatedWith(DataSourceKune.class);
- // expose(Session.class).annotatedWith(DataSourceKune.class);
- // expose(KuneProperties.class);
- // expose(ContainerFinder.class);
- // expose(ContentFinder.class);
- // expose(ExtMediaDescripFinder.class);
- // expose(GroupFinder.class);
- // expose(I18nCountryFinder.class);
- // expose(I18nLanguageFinder.class);
- // expose(I18nTranslationFinder.class);
- // expose(LicenseFinder.class);
- // expose(RateFinder.class);
- // expose(TagFinder.class);
- // expose(TagUserContentFinder.class);
- // expose(UserFinder.class);
- // expose(MY_DATA_SOURCE_ONE_FILTER_KEY);
+ expose(EntityManager.class).annotatedWith(DataSourceKune.class);
+ expose(Session.class).annotatedWith(DataSourceKune.class);
+ expose(KuneProperties.class);
+ expose(ContainerFinder.class);
+ expose(ContentFinder.class);
+ expose(ExtMediaDescripFinder.class);
+ expose(GroupFinder.class);
+ expose(I18nCountryFinder.class);
+ expose(I18nLanguageFinder.class);
+ expose(I18nTranslationFinder.class);
+ expose(LicenseFinder.class);
+ expose(RateFinder.class);
+ expose(TagFinder.class);
+ expose(TagUserContentFinder.class);
+ expose(UserFinder.class);
+ expose(MY_DATA_SOURCE_ONE_FILTER_KEY);
bind(GenericPersistenceInitializer.class).asEagerSingleton();
}
+
+ public KuneJpaLocalTxnInterceptor getTransactionInterceptor() {
+ return transactionInterceptor;
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfirePersistModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfirePersistModule.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfirePersistModule.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -55,6 +55,6 @@
bind(MY_DATA_SOURCE_TWO_FILTER_KEY).to(CustomPersistFilter.class);
expose(MY_DATA_SOURCE_TWO_FILTER_KEY);
- // bind(KunePersistenceInitializer.class).asEagerSingleton();
+ bind(GenericPersistenceInitializer.class).asEagerSingleton();
}
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/rest/TransactionalServiceExecutor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/filters/rest/TransactionalServiceExecutor.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/rack/filters/rest/TransactionalServiceExecutor.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -19,27 +19,29 @@
*/
package cc.kune.core.server.rack.filters.rest;
+import cc.kune.core.server.persist.KuneTransactional;
+
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
public class TransactionalServiceExecutor {
- private final RESTMethodFinder methodFinder;
- private final RESTSerializer serializer;
+ private final RESTMethodFinder methodFinder;
+ private final RESTSerializer serializer;
- @Inject
- public TransactionalServiceExecutor(RESTMethodFinder methodFinder, RESTSerializer serializer) {
- this.methodFinder = methodFinder;
- this.serializer = serializer;
- }
+ @Inject
+ public TransactionalServiceExecutor(final RESTMethodFinder methodFinder,
+ final RESTSerializer serializer) {
+ this.methodFinder = methodFinder;
+ this.serializer = serializer;
+ }
- @Transactional
- public String doService(Class<?> serviceClass, String methodName, ParametersAdapter parameters,
- Object serviceInstance) {
- String output = null;
- RESTMethod rest = methodFinder.findMethod(methodName, parameters, serviceClass);
- if (rest != null && rest.invoke(serviceInstance)) {
- output = serializer.serialize(rest.getResponse(), rest.getFormat());
- }
- return output;
+ @KuneTransactional
+ public String doService(final Class<?> serviceClass, final String methodName,
+ final ParametersAdapter parameters, final Object serviceInstance) {
+ String output = null;
+ final RESTMethod rest = methodFinder.findMethod(methodName, parameters, serviceClass);
+ if (rest != null && rest.invoke(serviceInstance)) {
+ output = serializer.serialize(rest.getResponse(), rest.getFormat());
}
+ return output;
+ }
}
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -48,6 +48,7 @@
import cc.kune.core.server.manager.KuneWaveManager;
import cc.kune.core.server.manager.TagUserContentManager;
import cc.kune.core.server.mapper.Mapper;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.state.StateContainer;
import cc.kune.core.server.state.StateContent;
import cc.kune.core.server.state.StateEventContainer;
@@ -73,7 +74,6 @@
import cc.kune.domain.User;
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
public class ContentRPC implements ContentService, RPC {
private final AccessService accessService;
@@ -115,7 +115,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public void addAuthor(final String userHash, final StateToken token, final String authorShortName)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
@@ -126,7 +126,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public StateContentDTO addContent(final String userHash, final StateToken parentToken,
final String title, final String typeId) throws DefaultException {
return createContent(parentToken, title, typeId);
@@ -135,7 +135,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public StateContainerDTO addFolder(final String userHash, final StateToken parentToken,
final String title, final String contentTypeId) throws DefaultException {
final User user = getCurrentUser();
@@ -147,7 +147,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.content, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public void addGadgetToContent(final String userHash, final StateToken currentStateToken,
final String gadgetName) throws DefaultException {
final User user = getCurrentUser();
@@ -159,7 +159,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public StateContentDTO addNewContentWithGadget(final String userHash, final StateToken parentToken,
final String gadgetname, final String typeId, final String title, final String body)
throws DefaultException {
@@ -170,7 +170,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public StateContentDTO addNewContentWithGadgetAndState(final String userHash,
final StateToken parentToken, final String gadgetname, final String typeId, final String title,
final String body, final Map<String, String> gadgetProperties) throws DefaultException {
@@ -185,7 +185,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public Boolean addParticipant(final String userHash, final StateToken token, final String participant)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
@@ -196,7 +196,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = true)
- @Transactional
+ @KuneTransactional
public Boolean addParticipants(final String userHash, final StateToken token, final String groupName,
final SocialNetworkSubGroup subGroup) throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
@@ -208,16 +208,17 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public StateContainerDTO addRoom(final String userHash, final StateToken parentToken,
final String roomName) throws DefaultException {
final User user = getCurrentUser();
return getState(user, chatManager.addRoom(userHash, user, parentToken, roomName, ""));
}
+ @Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = true)
- @Transactional
+ @KuneTransactional
public StateContentDTO copyContent(final String userHash, final StateToken parentToken,
final StateToken token) throws DefaultException {
final User user = getCurrentUser();
@@ -253,7 +254,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public StateContentDTO delContent(final String userHash, final StateToken token)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
@@ -262,7 +263,7 @@
@Override
@Authenticated(mandatory = false)
- @Transactional
+ @KuneTransactional
public StateAbstractDTO getContent(final String userHash, final StateToken token)
throws DefaultException {
Group defaultGroup;
@@ -335,7 +336,7 @@
@Override
@Authenticated(mandatory = false)
@Authorizated(accessRolRequired = AccessRol.Viewer)
- @Transactional
+ @KuneTransactional
public TagCloudResult getSummaryTags(final String userHash, final StateToken groupToken) {
final Group group = groupManager.findByShortName(groupToken.getGroup());
return getSummaryTags(group);
@@ -381,7 +382,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public StateContainerDTO moveContent(final String userHash, final StateToken movedToken,
final StateToken newContainerToken) throws DefaultException {
final User user = getCurrentUser();
@@ -414,7 +415,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Viewer)
- @Transactional
+ @KuneTransactional
public RateResult rateContent(final String userHash, final StateToken token, final Double value)
throws DefaultException {
final User rater = getCurrentUser();
@@ -430,7 +431,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public void removeAuthor(final String userHash, final StateToken token, final String authorShortName)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
@@ -441,7 +442,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public StateAbstractDTO renameContainer(final String userHash, final StateToken token,
final String newName) throws DefaultException {
renameFolder(token.getGroup(), ContentUtils.parseId(token.getFolder()), newName);
@@ -451,7 +452,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public StateAbstractDTO renameContent(final String userHash, final StateToken token,
final String newName) throws DefaultException {
final User user = getCurrentUser();
@@ -482,7 +483,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public void save(final String userHash, final StateToken token, final String textContent)
throws DefaultException {
@@ -494,7 +495,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public String sendFeedback(final String userHash, final String title, final String body)
throws DefaultException {
final User user = getCurrentUser();
@@ -504,7 +505,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public ContentSimpleDTO setAsDefaultContent(final String userHash, final StateToken token) {
final Content content = contentManager.find(ContentUtils.parseId(token.getDocument()));
groupManager.setDefaultContent(token.getGroup(), content);
@@ -514,7 +515,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor)
- @Transactional
+ @KuneTransactional
public void setGadgetProperties(final String userHash, final StateToken currentStateToken,
final String gadgetName, final Map<String, String> properties) {
final User user = getCurrentUser();
@@ -526,7 +527,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public I18nLanguageDTO setLanguage(final String userHash, final StateToken token,
final String languageCode) throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
@@ -537,7 +538,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public void setPublishedOn(final String userHash, final StateToken token, final Date publishedOn)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
@@ -548,7 +549,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor)
- @Transactional
+ @KuneTransactional
public StateAbstractDTO setStatus(final String userHash, final StateToken token,
final ContentStatus status) {
if (status.equals(ContentStatus.publishedOnline) || status.equals(ContentStatus.rejected)
@@ -563,7 +564,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public StateAbstractDTO setStatusAsAdmin(final String userHash, final StateToken token,
final ContentStatus status) {
final Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
@@ -574,7 +575,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public TagCloudResult setTags(final String userHash, final StateToken token, final String tags)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
@@ -586,7 +587,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public String writeTo(final String userHash, final StateToken token, final boolean onlyToAdmins)
throws DefaultException {
final User user = getCurrentUser();
@@ -595,16 +596,17 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public String writeTo(final String userHash, final StateToken token, final boolean onlyToAdmins,
final String title, final String message) throws DefaultException {
final User user = getCurrentUser();
return waveManager.writeTo(user, token.getGroup(), onlyToAdmins, title, message);
}
+ @Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.content, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
+ @KuneTransactional
public String writeToParticipants(final String userHash, final StateToken token)
throws DefaultException {
final User user = getCurrentUser();
Modified: trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -29,6 +29,7 @@
import cc.kune.core.server.content.ContentManager;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.mapper.Mapper;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.properties.ReservedWordsRegistry;
import cc.kune.core.shared.domain.AccessRol;
import cc.kune.core.shared.domain.AdmissionType;
@@ -41,7 +42,6 @@
import cc.kune.domain.User;
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
public class GroupRPC implements RPC, GroupService {
private final ContentManager contentManager;
@@ -66,7 +66,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public void changeDefLicense(final String userHash, final StateToken groupToken,
final LicenseDTO license) {
final User user = getUserLogged();
@@ -77,7 +77,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public void changeGroupWsTheme(final String userHash, final StateToken groupToken, final String theme)
throws DefaultException {
final User user = getUserLogged();
@@ -88,7 +88,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public GroupDTO clearGroupBackImage(final String userHash, final StateToken token) {
final Group group = groupManager.findByShortName(token.getGroup());
groupManager.clearGroupBackImage(group);
@@ -97,7 +97,7 @@
@Override
@Authenticated
- @Transactional(rollbackOn = DefaultException.class)
+ @KuneTransactional(rollbackOn = DefaultException.class)
public StateAbstractDTO createNewGroup(final String userHash, final GroupDTO groupDTO,
final String publicDesc, final String tags, final String[] enabledTools) throws DefaultException {
final User user = getUserLogged();
@@ -127,7 +127,7 @@
@Override
@Authenticated(mandatory = true)
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
- @Transactional
+ @KuneTransactional
public void setGroupNewMembersJoiningPolicy(final String userHash, final StateToken token,
final AdmissionType admissionPolicy) {
final Group group = groupManager.findByShortName(token.getGroup());
@@ -137,7 +137,7 @@
@Override
@Authenticated(mandatory = true)
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
- @Transactional
+ @KuneTransactional
public void setSocialNetworkVisibility(final String userHash, final StateToken token,
final SocialNetworkVisibility visibility) {
final Group group = groupManager.findByShortName(token.getGroup());
@@ -147,7 +147,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public void setToolEnabled(final String userHash, final StateToken groupToken, final String toolName,
final boolean enabled) {
groupManager.setToolEnabled(getUserLogged(), groupToken.getGroup(), toolName, enabled);
@@ -155,7 +155,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
public StateAbstractDTO updateGroup(final String userHash, final StateToken token,
final GroupDTO groupDTO) throws DefaultException {
Modified: trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -34,6 +34,7 @@
import cc.kune.core.server.manager.I18nLanguageManager;
import cc.kune.core.server.manager.I18nTranslationManager;
import cc.kune.core.server.mapper.Mapper;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.shared.domain.AccessRol;
import cc.kune.core.shared.dto.I18nLanguageDTO;
import cc.kune.core.shared.dto.I18nTranslationDTO;
@@ -42,7 +43,6 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
-import com.google.inject.persist.Transactional;
public class I18nRPC implements RPC, I18nService {
private final I18nTranslationManager i18nTranslationManager;
@@ -63,7 +63,7 @@
}
@Override
- @Transactional
+ @KuneTransactional
public I18nLanguageDTO getInitialLanguage(final String localeParam) {
String initLanguage;
I18nLanguage lang;
@@ -97,14 +97,14 @@
}
@Override
- @Transactional
+ @KuneTransactional
public HashMap<String, String> getLexicon(final String language) {
return i18nTranslationManager.getLexicon(language);
}
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public List<I18nTranslationDTO> getTranslatedLexicon(final String userHash, final String language,
final boolean toTranslate) {
if (toTranslate) {
@@ -115,7 +115,7 @@
}
@Override
- @Transactional
+ @KuneTransactional
public String getTranslation(final String userHash, final String language, final String text,
final String noteForTranslators) {
String translation = null;
@@ -134,7 +134,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
@SuperAdmin(rol = AccessRol.Editor)
public String setTranslation(final String userHash, final Long id, final String translation)
throws DefaultException {
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -33,6 +33,7 @@
import cc.kune.core.server.manager.LicenseManager;
import cc.kune.core.server.manager.UserManager;
import cc.kune.core.server.mapper.Mapper;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.properties.ChatProperties;
import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.server.properties.ReservedWordsRegistry;
@@ -45,7 +46,6 @@
import cc.kune.core.shared.dto.UserInfoDTO;
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
public class SiteRPC implements RPC, SiteService {
private final ChatProperties chatProperties;
@@ -88,7 +88,7 @@
}
@Override
- @Transactional
+ @KuneTransactional
public InitDataDTO getInitData(final String userHash) throws DefaultException {
final InitDataDTO dataMapped = mapper.map(data, InitDataDTO.class);
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -29,6 +29,7 @@
import cc.kune.core.server.manager.SocialNetworkManager;
import cc.kune.core.server.mapper.Mapper;
import cc.kune.core.server.notifier.NotificationService;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.shared.domain.AccessRol;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.SocialNetworkDataDTO;
@@ -38,7 +39,6 @@
import cc.kune.domain.finders.UserFinder;
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
public class SocialNetworkRPC implements SocialNetService, RPC {
@@ -64,7 +64,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public SocialNetworkDataDTO acceptJoinGroup(final String hash, final StateToken groupToken,
final String groupToAcceptShortName) throws DefaultException {
final User userLogged = userSessionManager.getUser();
@@ -80,7 +80,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public SocialNetworkDataDTO addAdminMember(final String hash, final StateToken groupToken,
final String groupToAddShortName) throws DefaultException {
final User userLogged = userSessionManager.getUser();
@@ -95,7 +95,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public void addAsBuddie(final String hash, final String userName) throws DefaultException {
final User userLogged = userSessionManager.getUser();
final User toUser = userFinder.findByShortName(userName);
@@ -105,7 +105,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public SocialNetworkDataDTO addCollabMember(final String hash, final StateToken groupToken,
final String groupToAddShortName) throws DefaultException {
final User userLogged = userSessionManager.getUser();
@@ -121,7 +121,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public SocialNetworkDataDTO addViewerMember(final String hash, final StateToken groupToken,
final String groupToAddShortName) throws DefaultException {
final User userLogged = userSessionManager.getUser();
@@ -142,7 +142,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public SocialNetworkDataDTO deleteMember(final String hash, final StateToken groupToken,
final String groupToDeleleShortName) throws DefaultException {
final User userLogged = userSessionManager.getUser();
@@ -158,7 +158,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public SocialNetworkDataDTO denyJoinGroup(final String hash, final StateToken groupToken,
final String groupToDenyShortName) throws DefaultException {
final User userLogged = userSessionManager.getUser();
@@ -180,7 +180,7 @@
@Authenticated(mandatory = false)
// At least you can access as Viewer to the Group
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Viewer)
- @Transactional
+ @KuneTransactional
public SocialNetworkDataDTO getSocialNetwork(final String hash, final StateToken groupToken)
throws DefaultException {
final User user = userSessionManager.getUser();
@@ -190,7 +190,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public SocialNetworkRequestResult requestJoinGroup(final String hash, final StateToken groupToken)
throws DefaultException {
final User user = userSessionManager.getUser();
@@ -204,7 +204,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public SocialNetworkDataDTO setAdminAsCollab(final String hash, final StateToken groupToken,
final String groupToSetCollabShortName) throws DefaultException {
final User userLogged = userSessionManager.getUser();
@@ -220,7 +220,7 @@
@Override
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
+ @KuneTransactional
public SocialNetworkDataDTO setCollabAsAdmin(final String hash, final StateToken groupToken,
final String groupToSetAdminShortName) throws DefaultException {
final User userLogged = userSessionManager.getUser();
@@ -235,7 +235,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public void unJoinGroup(final String hash, final StateToken groupToken) throws DefaultException {
final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
Modified: trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -44,6 +44,7 @@
import cc.kune.core.server.manager.UserManager;
import cc.kune.core.server.manager.impl.EmailConfirmationType;
import cc.kune.core.server.mapper.Mapper;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.properties.ReservedWordsRegistry;
import cc.kune.core.server.users.UserInfo;
import cc.kune.core.server.users.UserInfoService;
@@ -64,7 +65,6 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.name.Named;
-import com.google.inject.persist.Transactional;
public class UserRPC implements RPC, UserService {
@@ -100,14 +100,14 @@
@Authenticated
@Override
- @Transactional
+ @KuneTransactional
public void askForEmailConfirmation(final String userHash) throws DefaultException {
final User user = userSessionManager.getUser();
userManager.askForEmailConfirmation(user, EmailConfirmationType.emailVerification);
}
@Override
- @Transactional
+ @KuneTransactional
public void askForPasswordReset(final String email) throws EmailNotFoundException {
try {
final User user = userFinder.findByEmail(email);
@@ -119,7 +119,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public void changePasswd(final String userHash, final String oldPassword, final String newPassword)
throws DefaultException {
final Long userId = userSessionManager.getUser().getId();
@@ -127,7 +127,7 @@
}
@Override
- @Transactional(rollbackOn = DefaultException.class)
+ @KuneTransactional(rollbackOn = DefaultException.class)
public void createUser(final UserDTO userDTO, final boolean wantPersonalHomepage)
throws DefaultException {
reserverdWords.check(userDTO.getShortName(), userDTO.getName());
@@ -138,7 +138,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
public String getUserAvatarBaser64(final String userHash, final StateToken userToken)
throws DefaultException {
@@ -169,7 +169,7 @@
}
@Override
- @Transactional
+ @KuneTransactional
public UserInfoDTO login(final String nickOrEmail, final String passwd, final String waveToken)
throws DefaultException {
// final SessionService sessionService = sessionServiceProvider.get();
@@ -189,14 +189,14 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public void logout(final String userHash) throws DefaultException {
userSessionManager.logout();
}
@Override
@Authenticated(mandatory = false)
- @Transactional
+ @KuneTransactional
public void onlyCheckSession(final String userHash) throws DefaultException {
// Do almost nothing @Authenticated checks user session
userSessionManager.updateLoggedUser();
@@ -204,7 +204,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public UserInfoDTO reloadUserInfo(final String userHash) throws DefaultException {
final User user = userSessionManager.getUser();
userSessionManager.updateLoggedUser();
@@ -212,7 +212,7 @@
}
@Override
- @Transactional
+ @KuneTransactional
public void resetPassword(final String passwdHash, final String newpasswd)
throws EmailHashInvalidException {
try {
@@ -227,7 +227,7 @@
@Override
@Authenticated(mandatory = true)
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
- @Transactional
+ @KuneTransactional
public void setBuddiesVisibility(final String userHash, final StateToken groupToken,
final UserSNetVisibility visibility) {
final User user = userSessionManager.getUser();
@@ -239,7 +239,7 @@
@Override
@Authenticated
- @Transactional
+ @KuneTransactional
public StateAbstractDTO updateUser(final String userHash, final UserDTO user,
final I18nLanguageSimpleDTO lang) throws DefaultException, EmailAddressInUseException,
GroupLongNameInUseException {
@@ -254,7 +254,7 @@
@Authenticated
@Override
- @Transactional
+ @KuneTransactional
public void verifyPasswordHash(final String userHash, final String emailReceivedHash)
throws EmailHashInvalidException, EmailHashExpiredException {
final User user = userSessionManager.getUser();
Modified: trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -26,6 +26,7 @@
import cc.kune.core.server.auth.Authorizated;
import cc.kune.core.server.content.ContainerManager;
import cc.kune.core.server.content.ContentUtils;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.core.server.rpc.ContentRPC;
import cc.kune.core.server.rpc.RPC;
import cc.kune.core.shared.domain.AccessRol;
@@ -40,7 +41,6 @@
import cc.kune.lists.shared.ListsConstants;
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
public class ListsRPC implements ListsService, RPC {
private final ContainerManager contentManager;
@@ -63,7 +63,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.container)
- @Transactional
+ @KuneTransactional
public StateContainerDTO createList(final String userHash, final StateToken parentToken,
final String listaName, final String description, final boolean isPublic) {
final StateContainerDTO result = contentRPC.addFolder(userHash, parentToken,
@@ -84,7 +84,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Viewer, actionLevel = ActionLevel.container)
- @Transactional
+ @KuneTransactional
public StateContentDTO newPost(final String userHash, final StateToken parentToken,
final String postTitle) {
final Container container = getContainer(parentToken);
@@ -108,7 +108,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.container)
- @Transactional
+ @KuneTransactional
public StateContainerDTO setPublic(final String hash, final StateToken token, final Boolean isPublic) {
final Container container = setPublicAcl(token, isPublic);
return contentRPC.getState(container);
@@ -130,7 +130,7 @@
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Viewer, actionLevel = ActionLevel.container)
- @Transactional
+ @KuneTransactional
public StateContainerDTO subscribeToList(final String userHash, final StateToken token,
final Boolean subscribe) {
final Container container = getContainer(token);
Modified: trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -37,13 +37,13 @@
import cc.kune.core.server.manager.I18nLanguageManager;
import cc.kune.core.server.manager.I18nTranslationManager;
import cc.kune.core.server.manager.LicenseManager;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.domain.Container;
import cc.kune.domain.Content;
import cc.kune.domain.Group;
import cc.kune.domain.ToolConfiguration;
import com.google.inject.Inject;
-import com.google.inject.persist.Transactional;
public class DatabaseInitializerTest {
@Inject
@@ -62,7 +62,7 @@
@Inject
I18nTranslationManager transManager;
- @Transactional
+ @KuneTransactional
@Before
public void init() {
new IntegrationTestHelper(this);
Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2012-03-13 12:08:46 UTC (rev 1762)
+++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2012-03-13 13:17:36 UTC (rev 1763)
@@ -19,6 +19,9 @@
*/
package cc.kune.core.server.integration;
+import static com.google.inject.matcher.Matchers.annotatedWith;
+import static com.google.inject.matcher.Matchers.any;
+
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.configuration.ConfigurationException;
@@ -35,7 +38,9 @@
import cc.kune.core.server.PlatformServerModule;
import cc.kune.core.server.TestConstants;
import cc.kune.core.server.persist.DataSourceKunePersistModule;
+import cc.kune.core.server.persist.DataSourceOpenfirePersistModule;
import cc.kune.core.server.persist.KunePersistenceService;
+import cc.kune.core.server.persist.KuneTransactional;
import cc.kune.docs.server.DocumentServerModule;
import cc.kune.events.server.EventsServerModule;
import cc.kune.lists.server.ListsServerModule;
@@ -59,8 +64,12 @@
TestConstants.WAVE_TEST_PROPFILE, CoreSettings.class));
final PersistenceModule wavePersistModule = injector.getInstance(PersistenceModule.class);
final NoOpFederationModule federationModule = injector.getInstance(NoOpFederationModule.class);
+ final DataSourceKunePersistModule kuneDataSource = new DataSourceKunePersistModule(
+ "kune.properties", TestConstants.PERSISTENCE_UNIT);
final Injector childInjector = injector.createChildInjector(
wavePersistModule,
+ kuneDataSource,
+ new DataSourceOpenfirePersistModule(),
new AbstractModule() {
@Override
protected void configure() {
@@ -68,10 +77,14 @@
bindScope(RequestScoped.class, Scopes.SINGLETON);
bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
+ bindInterceptor(annotatedWith(KuneTransactional.class), any(),
+ kuneDataSource.getTransactionInterceptor());
+ bindInterceptor(any(), annotatedWith(KuneTransactional.class),
+ kuneDataSource.getTransactionInterceptor());
+ install(kuneDataSource);
}
},
- new DataSourceKunePersistModule("kune.properties", TestConstants.PERSISTENCE_UNIT),
// new MyDataSourceTwoPersistModule(),
new ListsServerModule(), new RobotApiModule(), new PlatformServerModule(),
More information about the kune-commits
mailing list