[kune-commits] r1555 - in trunk/src/main/java/cc/kune: chat/client/actions core/client/rpcservices core/server/manager core/server/manager/impl core/server/rpc wave/server
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Mon Oct 10 04:25:34 CEST 2011
Author: vjrj_
Date: 2011-10-10 04:25:33 +0200 (Mon, 10 Oct 2011)
New Revision: 1555
Added:
trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembersAction.java
Modified:
trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
trunk/src/main/java/cc/kune/core/server/manager/KuneWaveManager.java
trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java
Log:
CLOSED - # 130: When starting assemblies ask for minutes doc creation
http://kune.ourproject.org/issues/ticket/130
Modified: trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java 2011-10-10 01:21:14 UTC (rev 1554)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -43,15 +43,14 @@
import com.calclab.emite.im.client.chat.ChatStates;
import com.calclab.emite.xep.muc.client.Occupant;
import com.calclab.emite.xep.muc.client.Room;
-import com.calclab.emite.xep.muc.client.RoomManager;
import com.google.inject.Inject;
public class OpenGroupPublicChatRoomAction extends RolActionAutoUpdated {
private final ChatClient chatClient;
- private final I18nTranslationService i18n;
+ protected final I18nTranslationService i18n;
private boolean inviteMembers;
- private final Session session;
+ protected final Session session;
@SuppressWarnings("deprecation")
@Inject
@@ -63,7 +62,6 @@
this.session = session;
this.chatClient = chatClient;
this.i18n = i18n;
- final RoomManager roomManager = chatInstances.roomManager;
stateManager.onStateChanged(true, new StateChangedHandler() {
@Override
public void onStateChanged(final StateChangedEvent event) {
Modified: trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java 2011-10-10 01:21:14 UTC (rev 1554)
+++ trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -28,7 +28,7 @@
public class StartAssemblyWithMembers extends MenuItemDescriptor {
@Inject
- public StartAssemblyWithMembers(final OpenGroupPublicChatRoomAction action,
+ public StartAssemblyWithMembers(final StartAssemblyWithMembersAction action,
final I18nTranslationService i18n) {
super(action);
action.setInviteMembers(true);
Added: trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembersAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembersAction.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembersAction.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -0,0 +1,65 @@
+package cc.kune.chat.client.actions;
+
+import java.util.Date;
+
+import cc.kune.chat.client.ChatClient;
+import cc.kune.chat.client.ChatInstances;
+import cc.kune.chat.client.resources.ChatResources;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.AccessRightsClientManager;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class StartAssemblyWithMembersAction extends OpenGroupPublicChatRoomAction {
+
+ private final Provider<ContentServiceAsync> contentService;
+
+ @Inject
+ public StartAssemblyWithMembersAction(final Session session,
+ final AccessRightsClientManager accessRightsClientManager, final ChatClient chatClient,
+ final StateManager stateManager, final I18nTranslationService i18n, final ChatResources res,
+ final ChatInstances chatInstances, final Provider<ContentServiceAsync> contentService) {
+ super(session, accessRightsClientManager, chatClient, stateManager, i18n, res, chatInstances);
+ this.contentService = contentService;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ NotifyUser.askConfirmation(i18n.t("Please confirm"),
+ i18n.t("Start a collaborative document for the meeting minutes?"), new SimpleResponseCallback() {
+ @Override
+ public void onCancel() {
+ }
+
+ @Override
+ public void onSuccess() {
+ contentService.get().writeTo(
+ session.getUserHash(),
+ session.getCurrentStateToken(),
+ false,
+ i18n.t("Meeting minutes of [%s] on [%s]", session.getCurrentGroupShortName(),
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_LONG).format(new Date())),
+ i18n.t("You can collaboratively edit this document with the meeting minutes."),
+ new AsyncCallbackSimple<String>() {
+ @Override
+ public void onSuccess(final String url) {
+ stateManager.gotoHistoryToken(url);
+ NotifyUser.info("Now you can edit this message");
+ }
+ });
+ }
+ });
+ super.actionPerformed(event);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembersAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-10-10 01:21:14 UTC (rev 1554)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -90,4 +90,7 @@
TagCloudResult setTags(String userHash, StateToken token, String tags) throws DefaultException;
String writeTo(String userHash, StateToken token, boolean onlyToAdmins) throws DefaultException;
+
+ String writeTo(String userHash, StateToken token, boolean onlyToAdmins, String title, String message)
+ throws DefaultException;
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-10-10 01:21:14 UTC (rev 1554)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -99,4 +99,7 @@
void writeTo(String userHash, StateToken token, boolean onlyToAdmins, AsyncCallback<String> callback);
+ void writeTo(String userHash, StateToken token, boolean onlyToAdmins, String title, String message,
+ AsyncCallback<String> callback);
+
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/KuneWaveManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/KuneWaveManager.java 2011-10-10 01:21:14 UTC (rev 1554)
+++ trunk/src/main/java/cc/kune/core/server/manager/KuneWaveManager.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -8,4 +8,6 @@
String writeTo(User user, String groupName, boolean onlyToAdmins);
+ String writeTo(User user, String groupName, boolean onlyToAdmins, String title, String content);
+
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java 2011-10-10 01:21:14 UTC (rev 1554)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -58,6 +58,12 @@
@Override
public String writeTo(final User user, final String groupName, final boolean onlyToAdmins) {
+ return writeTo(user, groupName, onlyToAdmins, KuneWaveService.NO_TITLE, KuneWaveService.NO_MESSAGE);
+ }
+
+ @Override
+ public String writeTo(final User user, final String groupName, final boolean onlyToAdmins,
+ final String title, final String message) {
final Group group = groupFinder.findByShortName(groupName);
final Set<Group> toList = new HashSet<Group>();
toList.add(user.getUserGroup());
@@ -79,6 +85,6 @@
toList.addAll(group.getSocialNetwork().getAccessLists().getEditors().getList());
}
}
- return KuneWaveUtils.getUrl(waveService.createWave("", participantUtils.listFrom(toList)));
+ return KuneWaveUtils.getUrl(waveService.createWave(title, message, participantUtils.listFrom(toList)));
}
}
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-10-10 01:21:14 UTC (rev 1554)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -521,4 +521,13 @@
return waveManager.writeTo(user, token.getGroup(), onlyToAdmins);
}
+ @Override
+ @Authenticated
+ @Transactional
+ 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);
+ }
+
}
Modified: trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java 2011-10-10 01:21:14 UTC (rev 1554)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -29,6 +29,8 @@
import com.google.wave.api.Wavelet;
public interface KuneWaveService {
+ public static final String NO_MESSAGE = "";
+ public static final String NO_TITLE = "";
public static final URL WITHOUT_GADGET = null;
void addGadget(WaveRef waveName, String author, String gadgetUrl);
Modified: trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java 2011-10-10 01:21:14 UTC (rev 1554)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java 2011-10-10 02:25:33 UTC (rev 1555)
@@ -87,7 +87,6 @@
// See: DocumentModifyServiceTest
private static final String NO_ANNOTATION_KEY = null;
private static final List<BundledAnnotation> NO_BUNDLED_ANNOTATIONS = Collections.emptyList();
- private static final String NO_TITLE = "";
private static final List<String> NO_VALUES = Collections.<String> emptyList();
private static final String NO_WAVE_TO_COPY = null;
More information about the kune-commits
mailing list