[kune-commits] r1610 - in trunk: . src/main/java/cc/kune/chat/client/actions src/main/java/cc/kune/core/client/actions/xml src/main/java/cc/kune/core/client/dnd src/main/java/cc/kune/core/client/state src/main/java/cc/kune/core/server src/main/java/cc/kune/core/server/properties src/main/java/cc/kune/core/server/rpc src/main/java/cc/kune/core/shared/dto src/main/java/cc/kune/gspace/client/actions src/main/java/cc/kune/gspace/client/options/general src/main/java/cc/kune/hspace/client src/main/java/cc/kune/lists/client/actions src/main/resources src/main/resources/META-INF
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Wed Nov 16 14:18:33 CET 2011
Author: vjrj_
Date: 2011-11-16 14:18:31 +0100 (Wed, 16 Nov 2011)
New Revision: 1610
Modified:
trunk/INSTALL
trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
trunk/src/main/java/cc/kune/core/client/actions/xml/NewGadgetAction.java
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java
trunk/src/main/java/cc/kune/core/client/state/ContentCache.java
trunk/src/main/java/cc/kune/core/client/state/ContentCacheDefault.java
trunk/src/main/java/cc/kune/core/client/state/StateManager.java
trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
trunk/src/main/java/cc/kune/core/server/InitData.java
trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContentAction.java
trunk/src/main/java/cc/kune/gspace/client/actions/RenameAction.java
trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java
trunk/src/main/java/cc/kune/hspace/client/GroupContentHomeLink.java
trunk/src/main/java/cc/kune/hspace/client/GroupContentHomeLink.ui.xml
trunk/src/main/java/cc/kune/lists/client/actions/NewListAction.java
trunk/src/main/java/cc/kune/lists/client/actions/NewListPostAction.java
trunk/src/main/resources/META-INF/persistence.xml
trunk/src/main/resources/kune.properties
Log:
CLOSED - # 159: When Drag&Drop or Renaming, clear Content Cache
http://kune.ourproject.org/issues/ticket/159
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/INSTALL 2011-11-16 13:18:31 UTC (rev 1610)
@@ -71,7 +71,7 @@
# (in the trunk directory)
mvn compile -Dliquibase.should.run=false && mvn gwt:compile
-NOTE: If you change these db passwords after compiling, you have to repeat the "mvn compile" because if not, probably you are using a old persistence.xml. See TROUBLESHOOT for more details.
+NOTE: If you change the previous db passwords after this compiling, you have to repeat the "mvn compile" because if not, probably you will use an old persistence.xml. See TROUBLESHOOT for more details.
===Configure upload directory===
@@ -155,26 +155,6 @@
mvn package
an executable target/kune-VERSION.one-jar.jar is generated in target directory.
-===Apache proxy===
-
-You can configure your Apache with this kind of virtual host
-<VirtualHost *:80>
- ServerName youkune.example.com
-
- ProxyRequests Off
- <Proxy *>
- Order deny,allow
- Allow from all
- </Proxy>
-
- ProxyPass / http://localhost:8080/
- ProxyPassReverse / http://localhost:8080/
- <Location />
- Order allow,deny
- Allow from all
- </Location>
-</VirtualHost>
-
==Appendix A: Configuration of Openfire xmpp server==
Install openfire in your system: http://www.igniterealtime.org/downloads/index.jsp
@@ -218,6 +198,11 @@
In Server > Server Settings > HTTP Binding, enable "HTTP Bind Settings" and set the port to 5280. Check that port is not used by other service in your machine (we use 5280 as default, but if you want to use other change it your web.xml accordly)
+Because users are managed from the database of kune, we recommend to set:
+In Server > Server Settings > Registration & Login > Inband Account Registration > Disabled
+In Server > Server Settings > Registration & Login > Change Password > Disabled
+so this will not conflict with kune users management.
+
Edit the openfire.xml in a terminal:
* In debian (with a .deb installation) you can to edit the configuration in /etc/openfire directory.
* In Mac: /usr/local/openfire/conf
@@ -285,6 +270,11 @@
==Appendix B: Apache configuration sample==
+WARNING: This should not work with current wave's websocket. Consider use nginx (that support websocket better) instead.
+http://serverfault.com/questions/290121/configuring-apache2-to-proxy-websocket
+
+You can configure your Apache with this kind of virtual host
+
Enable this modules:
a2enmod expires
a2enmod proxy
Modified: trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -32,6 +32,7 @@
import cc.kune.core.client.rpcservices.ContentServiceAsync;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.StateContainerDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -89,12 +90,13 @@
if (diag.isValid()) {
NotifyUser.showProgressProcessing();
final String groupShortName = session.getCurrentState().getGroup().getShortName();
- contentService.get().addRoom(session.getUserHash(),
- session.getContainerState().getRootContainer().getStateToken(),
+ final StateToken parentToken = session.getContainerState().getRootContainer().getStateToken();
+ contentService.get().addRoom(session.getUserHash(), parentToken,
groupShortName + "-" + diag.getTextFieldValue(),
new AsyncCallbackSimple<StateContainerDTO>() {
@Override
public void onSuccess(final StateContainerDTO state) {
+ stateManager.removeCache(parentToken);
stateManager.setRetrievedStateAndGo(state);
NotifyUser.hideProgress();
NotifyUser.info(i18n.t("Chatroom created"));
Modified: trunk/src/main/java/cc/kune/core/client/actions/xml/NewGadgetAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/NewGadgetAction.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/NewGadgetAction.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -26,8 +26,10 @@
import cc.kune.core.client.resources.CoreMessages;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.ContentCache;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -67,12 +69,14 @@
@Override
public void actionPerformed(final ActionEvent event) {
- contentService.get().addNewContentWithGadget(session.getUserHash(), session.getCurrentStateToken(),
- gadgetName, typeId, i18n.t(title), i18n.t(body), new AsyncCallbackSimple<StateContentDTO>() {
+ final StateToken parentToken = session.getCurrentStateToken();
+ contentService.get().addNewContentWithGadget(session.getUserHash(), parentToken, gadgetName, typeId,
+ i18n.t(title), i18n.t(body), new AsyncCallbackSimple<StateContentDTO>() {
@Override
public void onSuccess(final StateContentDTO result) {
NotifyUser.info(i18n.t("'[%s]' created succesfully", i18n.t(title)),
i18n.t(CoreMessages.GADGETS_EXPERIMENTAL));
+ stateManager.removeCache(parentToken);
stateManager.setRetrievedStateAndGo(result);
contentViewer.blinkTitle();
}
Modified: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -58,13 +58,9 @@
private final ContentViewerPresenter contentViewer;
private final ErrorHandler errHandler;
private final I18nTranslationService i18n;
-
private final NewMenusForTypeIdsRegistry newMenusRegistry;
-
private final Session session;
-
private final StateManager stateManager;
-
private final HashMap<String, SubMenuDescriptor> submenus;
@Inject
Modified: trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -23,6 +23,7 @@
import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.client.errors.ErrorHandler;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.ContentCache;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.domain.utils.StateToken;
@@ -49,6 +50,7 @@
*/
public class FolderViewerDropController implements DropTarget {
+ private final ContentCache contentCache;
private final ContentServiceAsync contentService;
private final KuneDragController dragController;
private SimpleDropController dropController;
@@ -61,13 +63,14 @@
@Inject
public FolderViewerDropController(final KuneDragController dragController,
final ContentServiceAsync contentService, final Session session, final StateManager stateManager,
- final ErrorHandler erroHandler, final I18nTranslationService i18n) {
+ final ErrorHandler erroHandler, final I18nTranslationService i18n, final ContentCache contentCache) {
this.dragController = dragController;
this.contentService = contentService;
this.session = session;
this.stateManager = stateManager;
this.erroHandler = erroHandler;
this.i18n = i18n;
+ this.contentCache = contentCache;
}
@Override
@@ -84,8 +87,9 @@
if (target != null) {
final StateToken destToken = (StateToken) target;
widget.removeFromParent();
- contentService.moveContent(session.getUserHash(), ((FolderItemWidget) widget).getToken(),
- destToken, new AsyncCallback<StateContainerDTO>() {
+ final StateToken tokenToMove = ((FolderItemWidget) widget).getToken();
+ contentService.moveContent(session.getUserHash(), tokenToMove, destToken,
+ new AsyncCallback<StateContainerDTO>() {
@Override
public void onFailure(final Throwable caught) {
erroHandler.process(caught);
@@ -96,6 +100,8 @@
@Override
public void onSuccess(final StateContainerDTO result) {
NotifyUser.hideProgress();
+ contentCache.remove(tokenToMove);
+ contentCache.remove(destToken);
}
});
} else {
Modified: trunk/src/main/java/cc/kune/core/client/state/ContentCache.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/ContentCache.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/client/state/ContentCache.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -28,10 +28,10 @@
void cache(StateToken token, StateAbstractDTO content);
- void clearCacheOfGroup(String group);
+ void removeCacheOfGroup(String group);
void getContent(String user, StateToken newState, AsyncCallback<StateAbstractDTO> callback);
- void removeContent(StateToken token);
+ void remove(StateToken token);
}
Modified: trunk/src/main/java/cc/kune/core/client/state/ContentCacheDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/ContentCacheDefault.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/client/state/ContentCacheDefault.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -22,6 +22,8 @@
import java.util.HashMap;
import java.util.Map;
+import cc.kune.core.client.init.AppStartEvent;
+import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.notify.spiner.ProgressShowEvent;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
import cc.kune.core.client.state.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
@@ -36,7 +38,7 @@
private final Map<StateToken, StateAbstractDTO> cacheMap;
private final EventBus eventBus;
private final ContentServiceAsync server;
- private final boolean useCache;
+ private boolean useCache = false;
@Inject
public ContentCacheDefault(final ContentServiceAsync server, final EventBus eventBus,
@@ -44,7 +46,14 @@
this.server = server;
this.eventBus = eventBus;
this.cacheMap = new HashMap<StateToken, StateAbstractDTO>();
- // Don't use while we don't check changes in the server
+ // Better, don't use while we don't check changes in the server (by others)
+ // and we do server pub/sub
+ session.onAppStart(true, new AppStartHandler() {
+ @Override
+ public void onAppStart(final AppStartEvent event) {
+ useCache = event.getInitData().useClientContentCache();
+ }
+ });
useCache = true;
session.onUserSignInOrSignOut(false, new UserSignInOrSignOutHandler() {
@Override
@@ -62,15 +71,6 @@
}
}
- @Override
- public void clearCacheOfGroup(final String group) {
- for (final StateToken entry : cacheMap.keySet()) {
- if (entry.getGroup().equals(group)) {
- cacheMap.remove(entry);
- }
- }
- }
-
private StateAbstractDTO getCached(final StateToken newState) {
assert newState != null;
return useCache ? cacheMap.get(newState) : null;
@@ -91,8 +91,17 @@
}
@Override
- public void removeContent(final StateToken token) {
+ public void remove(final StateToken token) {
cacheMap.remove(token);
}
+ @Override
+ public void removeCacheOfGroup(final String group) {
+ for (final StateToken entry : cacheMap.keySet()) {
+ if (entry.getGroup().equals(group)) {
+ cacheMap.put(entry, null);
+ }
+ }
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManager.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManager.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -64,6 +64,10 @@
void removeBeforeStateChangeListener(BeforeActionListener listener);
+ void removeCache(StateToken parentToken);
+
+ void removeCacheOfGroup(String group);
+
void removeSiteToken(String token);
void restorePreviousToken();
Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -101,7 +101,7 @@
onSocialNetworkChanged(false, new SocialNetworkChangedHandler() {
@Override
public void onSocialNetworkChanged(final SocialNetworkChangedEvent event) {
- contentCache.clearCacheOfGroup(event.getState().getStateToken().getGroup());
+ contentCache.removeCacheOfGroup(event.getState().getStateToken().getGroup());
}
});
}
@@ -194,7 +194,7 @@
@Override
public void gotoStateToken(final StateToken token, final boolean useCache) {
if (!useCache) {
- contentCache.removeContent(token);
+ contentCache.remove(token);
}
gotoStateToken(token);
}
@@ -367,7 +367,7 @@
if (currentStateToken == null) {
processCurrentHistoryToken();
} else {
- contentCache.removeContent(currentStateToken);
+ contentCache.remove(currentStateToken);
getContent(currentStateToken);
}
}
@@ -378,6 +378,16 @@
}
@Override
+ public void removeCache(final StateToken parentToken) {
+ contentCache.remove(parentToken);
+ }
+
+ @Override
+ public void removeCacheOfGroup(final String group) {
+ contentCache.removeCacheOfGroup(group);
+ }
+
+ @Override
public void removeSiteToken(final String token) {
siteTokens.remove(token);
}
Modified: trunk/src/main/java/cc/kune/core/server/InitData.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/InitData.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/server/InitData.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -64,6 +64,7 @@
private String siteUrl;
private String[] timezones;
private boolean translatorEnabled;
+ private boolean useClientContentCache;
private UserInfo userInfo;
private List<ToolSimple> userTools;
@@ -325,6 +326,10 @@
this.translatorEnabled = translatorEnabled;
}
+ public void setUseClientContentCache(final boolean useClientContentCache) {
+ this.useClientContentCache = useClientContentCache;
+ }
+
public void setUserInfo(final UserInfo currentUserInfo) {
this.userInfo = currentUserInfo;
}
@@ -333,4 +338,8 @@
this.userTools = userTools;
}
+ public boolean useClientContentCache() {
+ return useClientContentCache;
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -62,6 +62,7 @@
String UPLOAD_LOCATION = "kune.upload.location";
String UPLOAD_MAX_FILE_SIZE = "kune.upload.maxfilesizeinmegas";
String UPLOAD_MAX_FILE_SIZE_IN_KS = "kune.upload.maxfilesizeinks";
+ String USE_CLIENT_CONTENT_CACHE = "kune.client.useContentCache";
String WELCOME_WAVE = "kune.site.welcomewave";
String WS_THEMES = "kune.wsthemes";
String WS_THEMES_DEF = "kune.wsthemes.default";
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -150,6 +150,7 @@
data.setSiteShortName(kuneProperties.get(KuneProperties.SITE_SHORTNAME));
data.setSiteCommonName(kuneProperties.get(KuneProperties.SITE_COMMON_NAME));
data.setTranslatorEnabled(kuneProperties.getBoolean(KuneProperties.UI_TRANSLATOR_ENABLED));
+ data.setUseClientContentCache(kuneProperties.getBoolean(KuneProperties.USE_CLIENT_CONTENT_CACHE));
return data;
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -56,6 +56,7 @@
private String siteUrl;
private String[] timezones;
private boolean translatorEnabled;
+ private boolean useClientContentCache;
private UserInfoDTO userInfo;
private List<ToolSimpleDTO> userTools;
@@ -316,6 +317,10 @@
this.translatorEnabled = translatorEnabled;
}
+ public void setUseClientContentCache(final boolean useClientContentCache) {
+ this.useClientContentCache = useClientContentCache;
+ }
+
public void setUserInfo(final UserInfoDTO currentUser) {
this.userInfo = currentUser;
}
@@ -324,4 +329,8 @@
this.userTools = userTools;
}
+ public boolean useClientContentCache() {
+ return useClientContentCache;
+ }
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -25,9 +25,9 @@
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.state.ContentCache;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.HasContent;
import cc.kune.core.shared.dto.StateContainerDTO;
@@ -42,7 +42,6 @@
public static class NewContainerAction extends RolAction {
- private final ContentCache cache;
private final Provider<ContentServiceAsync> contentService;
private final FolderViewerPresenter folderViewer;
private final I18nTranslationService i18n;
@@ -52,13 +51,12 @@
@Inject
public NewContainerAction(final Session session, final StateManager stateManager,
final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService,
- final ContentCache cache, final FolderViewerPresenter folderViewer) {
+ final FolderViewerPresenter folderViewer) {
super(AccessRolDTO.Editor, true);
this.session = session;
this.stateManager = stateManager;
this.i18n = i18n;
this.contentService = contentService;
- this.cache = cache;
this.folderViewer = folderViewer;
}
@@ -67,18 +65,19 @@
NotifyUser.showProgressProcessing();
stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
final String newName = (String) getValue(NEW_NAME);
- contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(), newName,
- (String) getValue(ID), new AsyncCallbackSimple<StateContainerDTO>() {
+ final StateToken parentToken = session.getCurrentStateToken();
+ contentService.get().addFolder(session.getUserHash(), parentToken, newName, (String) getValue(ID),
+ new AsyncCallbackSimple<StateContainerDTO>() {
@Override
public void onSuccess(final StateContainerDTO state) {
// contextNavigator.setEditOnNextStateChange(true);
+ stateManager.removeCache(parentToken);
stateManager.setRetrievedStateAndGo(state);
NotifyUser.hideProgress();
NotifyUser.info(i18n.tWithNT("[%s] created", "New folder created, for instance", newName));
folderViewer.highlightTitle();
}
});
- cache.removeContent(session.getCurrentStateToken());
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -31,6 +31,7 @@
import cc.kune.core.client.state.ContentCache;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.HasContent;
import cc.kune.core.shared.dto.StateContainerDTO;
@@ -70,18 +71,20 @@
NotifyUser.showProgressProcessing();
stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
final String newName = (String) getValue(NEW_NAME);
- contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(), newName,
- (String) getValue(ID), new AsyncCallbackSimple<StateContainerDTO>() {
+ final StateToken parentToken = session.getCurrentStateToken();
+ contentService.get().addFolder(session.getUserHash(), parentToken, newName, (String) getValue(ID),
+ new AsyncCallbackSimple<StateContainerDTO>() {
@Override
public void onSuccess(final StateContainerDTO state) {
// contextNavigator.setEditOnNextStateChange(true);
+ stateManager.removeCache(parentToken);
stateManager.setRetrievedStateAndGo(state);
NotifyUser.hideProgress();
NotifyUser.info(i18n.tWithNT("[%s] created", "New folder created, for instance", newName));
folderViewer.highlightTitle();
}
});
- cache.removeContent(session.getCurrentStateToken());
+ cache.remove(parentToken);
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentAction.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContentAction.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContentAction.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -24,9 +24,9 @@
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.state.ContentCache;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -40,7 +40,6 @@
public static final String ID = "ctnnewid";
public static final String NEW_NAME = "ctnnewname";
- private final ContentCache cache;
private final Provider<ContentServiceAsync> contentService;
private final ContentViewerPresenter contentViewer;
private final I18nTranslationService i18n;
@@ -50,14 +49,13 @@
@Inject
public NewContentAction(final Session session, final StateManager stateManager,
final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService,
- final ContentViewerPresenter contentViewerPresenter, final ContentCache cache) {
+ final ContentViewerPresenter contentViewerPresenter) {
super(AccessRolDTO.Editor, true);
this.session = session;
this.stateManager = stateManager;
this.i18n = i18n;
this.contentService = contentService;
this.contentViewer = contentViewerPresenter;
- this.cache = cache;
}
@Override
@@ -66,11 +64,12 @@
// stateManager.gotoStateToken(((HasContent)
// session.getCurrentState()).getContainer().getStateToken());
final String newName = (String) getValue(NEW_NAME);
- contentService.get().addContent(session.getUserHash(),
- session.getCurrentStateToken().copy().clearDocument(), newName, (String) getValue(ID),
+ final StateToken parentToken = session.getCurrentStateToken().copy().clearDocument();
+ contentService.get().addContent(session.getUserHash(), parentToken, newName, (String) getValue(ID),
new AsyncCallbackSimple<StateContentDTO>() {
@Override
public void onSuccess(final StateContentDTO state) {
+ stateManager.removeCache(parentToken);
stateManager.setRetrievedStateAndGo(state);
NotifyUser.hideProgress();
// stateManager.refreshCurrentGroupState();
@@ -79,6 +78,5 @@
contentViewer.blinkTitle();
}
});
- cache.removeContent(session.getCurrentStateToken());
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/RenameAction.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/RenameAction.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/RenameAction.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -25,9 +25,13 @@
import cc.kune.core.client.errors.NameNotPermittedException;
import cc.kune.core.client.events.RenameContentEvent;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.ContentCache;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.ContainerDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.gwt.event.shared.EventBus;
@@ -36,6 +40,7 @@
import com.google.inject.Provider;
public class RenameAction {
+ private final ContentCache contentCache;
private final Provider<ContentServiceAsync> contentService;
private final ErrorHandler errorHandler;
private final EventBus eventBus;
@@ -44,12 +49,14 @@
@Inject
public RenameAction(final I18nTranslationService i18n, final Session session, final EventBus eventBus,
- final Provider<ContentServiceAsync> contentService, final ErrorHandler errorHandler) {
+ final Provider<ContentServiceAsync> contentService, final ErrorHandler errorHandler,
+ final ContentCache contentCache) {
this.i18n = i18n;
this.session = session;
this.eventBus = eventBus;
this.contentService = contentService;
this.errorHandler = errorHandler;
+ this.contentCache = contentCache;
}
public void rename(final StateToken token, final String oldName, final String newName,
@@ -79,6 +86,14 @@
session.setCurrentState(state);
listener.onSuccess(token, state.getTitle());
RenameContentEvent.fire(eventBus, token, oldName, newName);
+ contentCache.remove(token);
+ // remove parent cache
+ if (state instanceof StateContentDTO) {
+ contentCache.remove(((StateContentDTO) state).getContainer().getStateToken());
+ } else if (state instanceof StateContainerDTO) {
+ final ContainerDTO container = ((StateContainerDTO) state).getContainer();
+ contentCache.remove(token.copy().setFolder(container.getParentFolderId()));
+ }
}
};
if (token.isComplete()) {
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -80,6 +80,7 @@
if (view.isValid()) {
NotifyUser.showProgress();
final GroupDTO group = session.getCurrentState().getGroup();
+ final String previousGroupName = group.getShortName();
final StateToken token = group.getStateToken().copy();
group.setShortName(groupView.getShortName());
group.setLongName(groupView.getLongName());
@@ -88,6 +89,7 @@
@Override
public void onSuccess(final StateAbstractDTO result) {
NotifyUser.hideProgress();
+ stateManager.removeCacheOfGroup(previousGroupName);
stateManager.setRetrievedStateAndGo(result);
setState();
sendChangeEntityEvent();
Modified: trunk/src/main/java/cc/kune/hspace/client/GroupContentHomeLink.java
===================================================================
--- trunk/src/main/java/cc/kune/hspace/client/GroupContentHomeLink.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/hspace/client/GroupContentHomeLink.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -20,6 +20,8 @@
package cc.kune.hspace.client;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
@@ -45,7 +47,12 @@
}
public void setValues(final String logoImageUrl, final String text, final String historyToken) {
- icon.setUrl(logoImageUrl);
+ Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+ @Override
+ public void execute() {
+ icon.setUrl(logoImageUrl);
+ }
+ });
link.setText(text);
link.setTargetHistoryToken(historyToken);
}
Modified: trunk/src/main/java/cc/kune/hspace/client/GroupContentHomeLink.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/hspace/client/GroupContentHomeLink.ui.xml 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/hspace/client/GroupContentHomeLink.ui.xml 2011-11-16 13:18:31 UTC (rev 1610)
@@ -4,6 +4,7 @@
<ui:style>
</ui:style>
<g:FlowPanel styleName="k-home-group-stats-item">
+ <!-- yes, we use url here because avatars are urls links not resources -->
<g:Image ui:field="icon" width="22px" height="22px" styleName="k-home-group-cnt-icon"
url="images/clear.png" />
<g:Hyperlink ui:field="link" styleName="k-home-group-cnt-link" />
Modified: trunk/src/main/java/cc/kune/lists/client/actions/NewListAction.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/client/actions/NewListAction.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/lists/client/actions/NewListAction.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -102,7 +102,7 @@
folderViewer.highlightTitle();
}
});
- cache.removeContent(session.getCurrentStateToken());
+ cache.remove(session.getCurrentStateToken());
}
}
});
Modified: trunk/src/main/java/cc/kune/lists/client/actions/NewListPostAction.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/client/actions/NewListPostAction.java 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/java/cc/kune/lists/client/actions/NewListPostAction.java 2011-11-16 13:18:31 UTC (rev 1610)
@@ -107,7 +107,7 @@
folderViewer.highlightTitle();
}
});
- cache.removeContent(session.getCurrentStateToken());
+ cache.remove(session.getCurrentStateToken());
}
}
});
Modified: trunk/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/src/main/resources/META-INF/persistence.xml 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/resources/META-INF/persistence.xml 2011-11-16 13:18:31 UTC (rev 1610)
@@ -32,6 +32,7 @@
<class>cc.kune.domain.User</class>
<properties>
<property name="hibernate.archive.autodetection" value="class, hbm"/>
+ <!-- In order to debug sql enable this -->
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="false"/>
<property name="use_sql_comments" value="true"/>
@@ -90,6 +91,7 @@
<class>cc.kune.domain.User</class>
<properties>
<property name="hibernate.archive.autodetection" value="class, hbm"/>
+ <!-- In order to debug sql enable this -->
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="false"/>
<property name="use_sql_comments" value="true"/>
@@ -146,6 +148,7 @@
<class>cc.kune.domain.User</class>
<properties>
<property name="hibernate.archive.autodetection" value="class, hbm"/>
+ <!-- In order to debug sql enable this -->
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="false"/>
<property name="use_sql_comments" value="false"/>
@@ -197,6 +200,7 @@
<class>cc.kune.domain.ToolConfiguration</class>
<class>cc.kune.domain.User</class>
<properties>
+ <!-- In order to debug sql enable this -->
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="false"/>
<property name="use_sql_comments" value="false"/>
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2011-11-16 10:40:13 UTC (rev 1609)
+++ trunk/src/main/resources/kune.properties 2011-11-16 13:18:31 UTC (rev 1610)
@@ -77,6 +77,8 @@
kune.tools.groupRegisEnabledTools = docs,blogs,wiki,tasks,events,lists
# WARNING: be sure that all tools in groupRegisEnabledTools are included in groupSiteAvailableTools
+kune.client.useContentCache = false
+
### Workspace enabled themes
# This names are also the name of the items in the theme menu and there are translated
More information about the kune-commits
mailing list