[kune-commits] r1689 - in trunk: . src/main/java/cc/kune/chat/client src/main/java/cc/kune/chat/client/actions src/main/java/cc/kune/common/client/notify src/main/java/cc/kune/common/client/tooltip src/main/java/cc/kune/common/client/ui src/main/java/cc/kune/common/client/utils src/main/java/cc/kune/common/shared src/main/java/cc/kune/common/shared/i18n src/main/java/cc/kune/common/shared/res src/main/java/cc/kune/common/shared/utils src/main/java/cc/kune/core/client/i18n src/main/java/cc/kune/core/client/init src/main/java/cc/kune/core/client/rpcservices src/main/java/cc/kune/core/client/sn/actions src/main/java/cc/kune/core/client/state src/main/java/cc/kune/core/client/state/impl src/main/java/cc/kune/core/client/sub src/main/java/cc/kune/core/server/content src/main/java/cc/kune/core/server/i18n/impl src/main/java/cc/kune/core/server/manager/impl src/main/java/cc/kune/core/server/notifier src/main/java/cc/kune/core/server/rpc src/main/java/cc/kune/events src/main/java/cc/kune/events/client/actions src/main/java/cc/kune/events/client/viewer src/main/java/cc/kune/events/server src/main/java/cc/kune/events/shared src/main/java/cc/kune/gspace/client/actions src/main/java/cc/kune/gspace/client/i18n src/main/java/cc/kune/gspace/client/licensewizard src/main/java/cc/kune/gspace/client/licensewizard/pages src/main/java/cc/kune/gspace/client/options/license src/main/java/cc/kune/wave/server/kspecific src/main/resources src/test/java/cc/kune/events src/test/java/cc/kune/events/server src/test/java/cc/kune/events/shared src/test/java/cc/kune/wave/server
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Tue Feb 21 00:38:47 CET 2012
Author: vjrj_
Date: 2012-02-21 00:38:46 +0100 (Tue, 21 Feb 2012)
New Revision: 1689
Added:
trunk/src/main/java/cc/kune/common/shared/res/
trunk/src/main/java/cc/kune/common/shared/res/ICalConstants.java
trunk/src/main/java/cc/kune/common/shared/utils/Pair.java
trunk/src/main/java/cc/kune/common/shared/utils/SimpleArgCallback.java
trunk/src/main/java/cc/kune/common/shared/utils/SimpleCallback.java
trunk/src/main/java/cc/kune/common/shared/utils/SimpleResponseCallback.java
trunk/src/main/java/cc/kune/events/shared/DateUtils.java
trunk/src/main/java/cc/kune/events/shared/EventsConversionUtil.java
trunk/src/test/java/cc/kune/events/shared/
trunk/src/test/java/cc/kune/events/shared/BasicCalendarTest.java
trunk/src/test/java/cc/kune/events/shared/EventsConversionUtilTest.java
trunk/war/
Removed:
trunk/src/main/java/cc/kune/common/client/utils/Pair.java
trunk/src/main/java/cc/kune/common/client/utils/SimpleCallback.java
trunk/src/main/java/cc/kune/common/client/utils/SimpleResponseCallback.java
Modified:
trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java
trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembersAction.java
trunk/src/main/java/cc/kune/common/client/notify/ConfirmAskEvent.java
trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
trunk/src/main/java/cc/kune/common/client/tooltip/TooltipPositionCalculator.java
trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java
trunk/src/main/java/cc/kune/common/client/utils/OnAcceptCallback.java
trunk/src/main/java/cc/kune/common/shared/i18n/I18nTranslationService.java
trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.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/client/sn/actions/AddEntityToThisGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAction.java
trunk/src/main/java/cc/kune/core/client/state/TokenMatcher.java
trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java
trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java
trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
trunk/src/main/java/cc/kune/core/server/content/CreationService.java
trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
trunk/src/main/java/cc/kune/core/server/i18n/impl/I18nTranslationServiceDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
trunk/src/main/java/cc/kune/core/server/notifier/NotificationSenderDefault.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/events/KuneEvents.gwt.xml
trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java
trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewer.java
trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java
trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPresenter.java
trunk/src/main/java/cc/kune/events/server/CalendarServerUtils.java
trunk/src/main/java/cc/kune/events/shared/EventsConstants.java
trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackAction.java
trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nCellList.java
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslationDataProvider.java
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorPanel.java
trunk/src/main/java/cc/kune/gspace/client/licensewizard/LicenseChangeAction.java
trunk/src/main/java/cc/kune/gspace/client/licensewizard/LicenseWizardPresenter.java
trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstForm.java
trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstFormView.java
trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFrdForm.java
trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFrdFormView.java
trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardTrdForm.java
trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardTrdFormView.java
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePresenter.java
trunk/src/main/java/cc/kune/wave/server/kspecific/KuneAgent.java
trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveService.java
trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java
trunk/src/main/resources/wave-server-testing.properties
trunk/src/main/resources/wave-server.properties
trunk/src/test/java/cc/kune/events/server/CalendarServerUtilsTest.java
trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java
Log:
NEW - # 158: Add a Calendar view to event tool
http://kune.ourproject.org/issues/ticket/158
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -36,9 +36,9 @@
import cc.kune.common.client.log.Log;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
-import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.common.client.utils.WindowUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.events.AppStartEvent;
import cc.kune.core.client.events.AppStopEvent;
Modified: trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -23,8 +23,8 @@
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.state.Session;
Modified: trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembersAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembersAction.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembersAction.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -26,8 +26,8 @@
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.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
import cc.kune.core.client.state.AccessRightsClientManager;
Modified: trunk/src/main/java/cc/kune/common/client/notify/ConfirmAskEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/notify/ConfirmAskEvent.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/client/notify/ConfirmAskEvent.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -45,7 +45,7 @@
final java.lang.String message, final java.lang.String acceptBtnMsg,
final java.lang.String cancelBtnMsg, final java.lang.String acceptBtnTooltip,
final java.lang.String cancelBtnTooltip,
- final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ final cc.kune.common.shared.utils.SimpleResponseCallback callback) {
source.fireEvent(new ConfirmAskEvent(title, message, acceptBtnMsg, cancelBtnMsg, acceptBtnTooltip,
cancelBtnTooltip, callback));
}
@@ -56,7 +56,7 @@
java.lang.String acceptBtnMsg;
java.lang.String acceptBtnTooltip;
- cc.kune.common.client.utils.SimpleResponseCallback callback;
+ cc.kune.common.shared.utils.SimpleResponseCallback callback;
java.lang.String cancelBtnMsg;
java.lang.String cancelBtnTooltip;
ImageResource icon;
@@ -70,7 +70,7 @@
public ConfirmAskEvent(final ImageResource icon, final java.lang.String title,
final java.lang.String message, final java.lang.String acceptBtnMsg,
final java.lang.String cancelBtnMsg,
- final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ final cc.kune.common.shared.utils.SimpleResponseCallback callback) {
this(title, message, acceptBtnMsg, cancelBtnMsg, acceptBtnMsg, cancelBtnMsg, callback);
this.icon = icon;
}
@@ -79,7 +79,7 @@
final java.lang.String message, final java.lang.String acceptBtnMsg,
final java.lang.String cancelBtnMsg, final java.lang.String acceptBtnTooltip,
final java.lang.String cancelBtnTooltip,
- final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ final cc.kune.common.shared.utils.SimpleResponseCallback callback) {
this(title, message, acceptBtnMsg, cancelBtnMsg, acceptBtnTooltip, cancelBtnTooltip, callback);
this.icon = icon;
}
@@ -90,7 +90,7 @@
public ConfirmAskEvent(final java.lang.String title, final java.lang.String message,
final java.lang.String acceptBtnMsg, final java.lang.String cancelBtnMsg,
- final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ final cc.kune.common.shared.utils.SimpleResponseCallback callback) {
this.title = title;
this.message = message;
this.acceptBtnMsg = acceptBtnMsg;
@@ -101,7 +101,7 @@
public ConfirmAskEvent(final java.lang.String title, final java.lang.String message,
final java.lang.String acceptBtnMsg, final java.lang.String cancelBtnMsg,
final java.lang.String acceptBtnTooltip, final java.lang.String cancelBtnTooltip,
- final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ final cc.kune.common.shared.utils.SimpleResponseCallback callback) {
this(title, message, acceptBtnMsg, cancelBtnMsg, callback);
this.acceptBtnTooltip = acceptBtnTooltip;
this.cancelBtnTooltip = cancelBtnTooltip;
@@ -189,7 +189,7 @@
return TYPE;
}
- public cc.kune.common.client.utils.SimpleResponseCallback getCallback() {
+ public cc.kune.common.shared.utils.SimpleResponseCallback getCallback() {
return callback;
}
Modified: trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,8 +19,8 @@
*/
package cc.kune.common.client.notify;
-import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.common.shared.utils.TextUtils;
import com.google.gwt.event.dom.client.ClickHandler;
Modified: trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -62,10 +62,7 @@
}
}
- public static Tooltip to(final Widget widget, final String text) {
- final Tooltip tip = new Tooltip();
- tip.to(widget);
- tip.setText(text);
+ private static void setHideOnDetachListener(final Widget widget, final Tooltip tip) {
widget.addAttachHandler(new Handler() {
@Override
public void onAttachOrDetach(final AttachEvent event) {
@@ -73,8 +70,14 @@
tip.hide();
}
}
+ });
+ }
- });
+ public static Tooltip to(final Widget widget, final String text) {
+ final Tooltip tip = new Tooltip();
+ tip.to(widget);
+ tip.setText(text);
+ setHideOnDetachListener(widget, tip);
return tip;
}
@@ -82,8 +85,10 @@
final Tooltip tip = new Tooltip();
tip.to(widget);
tip.setContent(withContent);
+ setHideOnDetachListener(widget, tip);
return tip;
}
+
@UiField
HTMLPanel arrow;
@UiField
@@ -96,13 +101,10 @@
private Widget ofWidget;
private final Label textLabel;
private final TooltipTimers timers;
-
@UiField
InlineLabel title;
-
@UiField
HTMLPanel tooltip;
-
private int width = WIDTH_NOT_DEFINED;
public Tooltip() {
@@ -131,6 +133,12 @@
textLabel = new Label();
}
+ private TooltipPosition calculatePosition() {
+ return TooltipPositionCalculator.calculate(Window.getClientWidth(), Window.getClientHeight(),
+ ofWidget.getAbsoluteLeft(), ofWidget.getAbsoluteTop(), ofWidget.getOffsetWidth(),
+ ofWidget.getOffsetHeight(), Tooltip.this.getWidth(), Tooltip.this.getHeight());
+ }
+
protected int getHeight() {
return tooltip.getElement().getOffsetHeight();
}
@@ -193,10 +201,7 @@
}
private void showAt() {
- Tooltip.this.showAt(TooltipPositionCalculator.calculate(Window.getClientWidth(),
- Window.getClientHeight(), ofWidget.getAbsoluteLeft(), ofWidget.getAbsoluteTop(),
- ofWidget.getOffsetWidth(), ofWidget.getOffsetHeight(), Tooltip.this.getWidth(),
- Tooltip.this.getHeight()));
+ Tooltip.this.showAt(calculatePosition());
}
protected void showAt(final TooltipPosition position) {
Modified: trunk/src/main/java/cc/kune/common/client/tooltip/TooltipPositionCalculator.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/tooltip/TooltipPositionCalculator.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/TooltipPositionCalculator.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -26,15 +26,9 @@
public static TooltipPosition calculate(final int windowWitdh, final int windowHeight,
final int widgetLeft, final int widgetTop, final int widgetWidth, final int widgetHeight,
final int tooltipWidth, final int tooltipHeight) {
- // GWT.log("ww: " + windowWitdh + " wh: " + windowHeight + " widL: " +
- // widgetLeft + " widT: " + widgetTop
- // + " widW: " + widgetWidth + " widH: " + widgetHeight + " tW: " +
- // tooltipWidth + " tH: " + tooltipHeight);
final boolean overflowsWidth = overflowsWidth(windowWitdh, widgetLeft, tooltipWidth);
final boolean overflowsHeight = overflowsHeight(windowHeight, widgetTop, tooltipHeight);
- // GWT.log("ow: " + overflowsWidth + " oH: " + overflowsHeight);
if (overflowsWidth && overflowsHeight) {
- // esta es mezcla de las anteriores (y falta)
return new TooltipPosition(leftOverflow(widgetLeft, widgetWidth, tooltipWidth), widgetTop
- tooltipHeight - TooltipPosition.TOOLTIP_DISTANCE, ArrowPosition.SE,
leftArrowOverflow(tooltipWidth), -2 * TooltipPosition.ARROW_SIZE);
@@ -46,13 +40,6 @@
return new TooltipPosition(leftOverflow(widgetLeft, widgetWidth, tooltipWidth), topNoOverflow(
widgetTop, widgetHeight), ArrowPosition.NE, leftArrowOverflow(tooltipWidth), -2
* TooltipPosition.ARROW_SIZE - 1);
- // 10 in the border width
- // } else if (overflowsHeight) {
- //
- // return new TooltipPosition(onTopPositionTop(widgetLeft, widgetWidth),
- // widgetTop - tooltipHeight
- // - TooltipPosition.TOOLTIP_DISTANCE, ArrowPosition.SW,
- // TooltipPosition.ARROW_DEF_MARGIN, 0);
} else {
// Don't overflow
return new TooltipPosition(leftNoOverflow(widgetLeft), topNoOverflow(widgetTop, widgetHeight),
@@ -72,10 +59,6 @@
return widgetLeft + widgetWidth - tooltipWidth - TooltipPosition.TOOLTIP_DISTANCE;
}
- private static int onTopPositionTop(final int widgetTop, final int widgetHeight) {
- return topNoOverflow(widgetTop, widgetHeight);
- }
-
private static boolean overflowsHeight(final int windowHeight, final int widgetTop,
final int tooltipHeight) {
return widgetTop + TooltipPosition.TOOLTIP_DISTANCE + tooltipHeight > windowHeight;
Modified: trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -21,7 +21,7 @@
import cc.kune.common.client.tooltip.Tooltip;
import cc.kune.common.client.ui.EditEvent.EditHandler;
-import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.shared.utils.SimpleCallback;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.BlurEvent;
Modified: trunk/src/main/java/cc/kune/common/client/utils/OnAcceptCallback.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/OnAcceptCallback.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/client/utils/OnAcceptCallback.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -20,6 +20,7 @@
package cc.kune.common.client.utils;
import cc.kune.common.client.log.Log;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
public abstract class OnAcceptCallback implements SimpleResponseCallback {
Deleted: trunk/src/main/java/cc/kune/common/client/utils/Pair.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/Pair.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/client/utils/Pair.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -1,86 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package cc.kune.common.client.utils;
-
-/**
- * @param <L>
- * @param <R>
- */
-public final class Pair<L, R> {
- public static <L, R> Pair<L, R> create(final L l, final R r) {
- return new Pair<L, R>(l, r);
- }
-
- public final L left;
- public final R right;
-
- private Pair(final L left, final R right) {
- this.left = left;
- this.right = right;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final Pair other = (Pair) obj;
- if (left == null) {
- if (other.left != null) {
- return false;
- }
- } else if (!left.equals(other.left)) {
- return false;
- }
- if (right == null) {
- if (other.right != null) {
- return false;
- }
- } else if (!right.equals(other.right)) {
- return false;
- }
- return true;
- }
-
- public L getLeft() {
- return left;
- }
-
- public R getRight() {
- return right;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((left == null) ? 0 : left.hashCode());
- result = prime * result + ((right == null) ? 0 : right.hashCode());
- return result;
- }
-
- @Override
- public String toString() {
- return "(" + left + "," + right + ")";
- }
-}
Deleted: trunk/src/main/java/cc/kune/common/client/utils/SimpleCallback.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/SimpleCallback.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/client/utils/SimpleCallback.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -1,27 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.common.client.utils;
-
-public interface SimpleCallback {
- /**
- * Notifies this callback
- */
- void onCallback();
-}
Deleted: trunk/src/main/java/cc/kune/common/client/utils/SimpleResponseCallback.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/SimpleResponseCallback.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/client/utils/SimpleResponseCallback.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.common.client.utils;
-
-public interface SimpleResponseCallback {
- /**
- * Notifies this callback of an accept response.
- */
- void onSuccess();
-
- /**
- * Notifies this callback of a cancel.
- */
- void onCancel();
-}
Modified: trunk/src/main/java/cc/kune/common/shared/i18n/I18nTranslationService.java
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/i18n/I18nTranslationService.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/common/shared/i18n/I18nTranslationService.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,7 +19,7 @@
*/
package cc.kune.common.shared.i18n;
-import cc.kune.common.client.utils.Pair;
+import cc.kune.common.shared.utils.Pair;
import com.google.gwt.i18n.client.HasDirection.Direction;
Added: trunk/src/main/java/cc/kune/common/shared/res/ICalConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/res/ICalConstants.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/shared/res/ICalConstants.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -0,0 +1,13 @@
+package cc.kune.common.shared.res;
+
+public class ICalConstants {
+ /* Note that all day events is not supported by ICalendar */
+ public static final String _ALL_DAY = "ALLDAY";
+ // VTIMEZONE ?? See: TimeZoneConstants in GWT for names and values
+ public static final String DATE_TIME_END = "DTEND";
+ public static final String DATE_TIME_START = "DTSTART";
+ public static final String DESCRIPTION = "DESCRIPTION";
+ public static final String LOCATION = "LOCATION";
+ public static final String ORGANIZER = "ORGANIZER";
+ public static final String SUMMARY = "SUMMARY";
+}
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/common/shared/utils/Pair.java (from rev 1676, trunk/src/main/java/cc/kune/common/client/utils/Pair.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/utils/Pair.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/shared/utils/Pair.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package cc.kune.common.shared.utils;
+
+/**
+ * @param <L>
+ * @param <R>
+ */
+public final class Pair<L, R> {
+ public static <L, R> Pair<L, R> create(final L l, final R r) {
+ return new Pair<L, R>(l, r);
+ }
+
+ public final L left;
+ public final R right;
+
+ private Pair(final L left, final R right) {
+ this.left = left;
+ this.right = right;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final Pair other = (Pair) obj;
+ if (left == null) {
+ if (other.left != null) {
+ return false;
+ }
+ } else if (!left.equals(other.left)) {
+ return false;
+ }
+ if (right == null) {
+ if (other.right != null) {
+ return false;
+ }
+ } else if (!right.equals(other.right)) {
+ return false;
+ }
+ return true;
+ }
+
+ public L getLeft() {
+ return left;
+ }
+
+ public R getRight() {
+ return right;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((left == null) ? 0 : left.hashCode());
+ result = prime * result + ((right == null) ? 0 : right.hashCode());
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "(" + left + "," + right + ")";
+ }
+}
Added: trunk/src/main/java/cc/kune/common/shared/utils/SimpleArgCallback.java
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/utils/SimpleArgCallback.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/shared/utils/SimpleArgCallback.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -0,0 +1,9 @@
+package cc.kune.common.shared.utils;
+
+public interface SimpleArgCallback<T> {
+
+ /**
+ * Notifies this callback
+ */
+ void onCallback(T arg);
+}
Copied: trunk/src/main/java/cc/kune/common/shared/utils/SimpleCallback.java (from rev 1676, trunk/src/main/java/cc/kune/common/client/utils/SimpleCallback.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/utils/SimpleCallback.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/shared/utils/SimpleCallback.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.common.shared.utils;
+
+public interface SimpleCallback {
+
+ public static final SimpleCallback DO_NOTHING = new SimpleCallback() {
+ @Override
+ public void onCallback() {
+ }
+ };
+
+ /**
+ * Notifies this callback
+ */
+ void onCallback();
+}
Copied: trunk/src/main/java/cc/kune/common/shared/utils/SimpleResponseCallback.java (from rev 1676, trunk/src/main/java/cc/kune/common/client/utils/SimpleResponseCallback.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/utils/SimpleResponseCallback.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/shared/utils/SimpleResponseCallback.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -0,0 +1,32 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.common.shared.utils;
+
+public interface SimpleResponseCallback {
+ /**
+ * Notifies this callback of an accept response.
+ */
+ void onSuccess();
+
+ /**
+ * Notifies this callback of a cancel.
+ */
+ void onCancel();
+}
Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -30,10 +30,10 @@
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.utils.Location;
import cc.kune.common.client.utils.MetaUtils;
-import cc.kune.common.client.utils.Pair;
-import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.common.client.utils.WindowUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.Pair;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.events.UserSignInEvent;
import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
Modified: trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -25,7 +25,7 @@
import cc.kune.common.client.notify.ProgressHideEvent;
import cc.kune.common.client.notify.UserNotifyEvent;
import cc.kune.common.client.resources.CommonResources;
-import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.events.AppStartEvent;
import cc.kune.core.client.events.AppStopEvent;
import cc.kune.core.client.rpcservices.SiteServiceAsync;
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -20,6 +20,7 @@
package cc.kune.core.client.rpcservices;
import java.util.Date;
+import java.util.Map;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.shared.domain.ContentStatus;
@@ -51,6 +52,9 @@
StateContentDTO addNewContentWithGadget(String userHash, StateToken currentStateToken,
String gadgetName, String typeId, String title, String body);
+ StateContentDTO addNewContentWithGadgetAndState(String userHash, StateToken currentStateToken,
+ String gadgetName, String typeId, String tile, String body, Map<String, String> gadgetState);
+
void addParticipant(String userHash, StateToken token, String participant) throws DefaultException;
StateContainerDTO addRoom(String user, StateToken parentToken, String name) 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 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -20,6 +20,7 @@
package cc.kune.core.client.rpcservices;
import java.util.Date;
+import java.util.Map;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.shared.domain.ContentStatus;
@@ -51,6 +52,10 @@
void addNewContentWithGadget(String userHash, StateToken currentStateToken, String gadgetName,
String typeId, String title, String body, AsyncCallback<StateContentDTO> asyncCallback);
+ void addNewContentWithGadgetAndState(String userHash, StateToken currentStateToken, String gadgetName,
+ String typeId, String title, String body, Map<String, String> gadgetState,
+ AsyncCallback<StateContentDTO> callback);
+
void addParticipant(String userHash, StateToken token, String authorShortName,
AsyncCallback<Void> asyncCallback) throws DefaultException;
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -22,8 +22,8 @@
import cc.kune.common.client.actions.Action;
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -23,8 +23,8 @@
import cc.kune.common.client.actions.Action;
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.contacts.SimpleContactManager;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.sitebar.search.EntitySearchPanel;
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -23,8 +23,8 @@
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.notify.NotifyLevel;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.auth.SignIn;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAction.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAction.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -23,8 +23,8 @@
import cc.kune.common.client.actions.AbstractExtendedAction;
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
Modified: trunk/src/main/java/cc/kune/core/client/state/TokenMatcher.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/TokenMatcher.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/state/TokenMatcher.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -22,7 +22,7 @@
import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
import org.waveprotocol.wave.model.waveref.WaverefEncoder;
-import cc.kune.common.client.utils.Pair;
+import cc.kune.common.shared.utils.Pair;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.ReservedWordsRegistryDTO;
Modified: trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -29,7 +29,7 @@
import cc.kune.common.client.actions.BeforeActionListener;
import cc.kune.common.client.log.Log;
import cc.kune.common.client.notify.ProgressHideEvent;
-import cc.kune.common.client.utils.Pair;
+import cc.kune.common.shared.utils.Pair;
import cc.kune.core.client.events.AppStartEvent;
import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
import cc.kune.core.client.events.GoHomeEvent;
Modified: trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -20,7 +20,7 @@
package cc.kune.core.client.sub;
import cc.kune.common.client.utils.Base64Utils;
-import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.state.StateManager;
Modified: trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/client/sub/SubtitlesWidget.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -24,7 +24,7 @@
import org.adamtacy.client.ui.effects.examples.Show;
import org.adamtacy.client.ui.effects.examples.SlideRight;
-import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.core.client.sub.SubtitlesManager.SubtitlesView;
import com.google.gwt.core.client.GWT;
Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -20,8 +20,10 @@
package cc.kune.core.server.content;
import java.net.URL;
+import java.util.Collections;
import java.util.Date;
import java.util.List;
+import java.util.Map;
import javax.persistence.EntityManager;
@@ -119,11 +121,13 @@
protected Content createContent(final String title, final String body, final User author,
final Container container, final String typeId) {
- return createContent(title, body, author, container, typeId, KuneWaveService.WITHOUT_GADGET);
+ return createContent(title, body, author, container, typeId, KuneWaveService.WITHOUT_GADGET,
+ Collections.<String, String> emptyMap());
}
protected Content createContent(final String title, final String body, final User author,
- final Container container, final String typeId, final URL gadgetUrl) {
+ final Container container, final String typeId, final URL gadgetUrl,
+ final Map<String, String> gadgetProperties) {
FilenameUtils.checkBasicFilename(title);
final String newtitle = findInexistentTitle(container, title);
final Content newContent = new Content();
@@ -136,8 +140,9 @@
revision.setTitle(newtitle);
// Duplicate in StateServiceDefault
if (newContent.isWave()) {
- final WaveRef waveRef = kuneWaveManager.createWave(newtitle, body, gadgetUrl,
- participantUtils.of(author.getShortName()));
+ final String authorName = author.getShortName();
+ final WaveRef waveRef = kuneWaveManager.createWave(newtitle, body,
+ KuneWaveService.DO_NOTHING_CBACK, gadgetUrl, gadgetProperties, participantUtils.of(authorName));
newContent.setWaveId(JavaWaverefEncoder.encodeToUriPathSegment(waveRef));
newContent.setModifiedOn((new Date()).getTime());
}
Modified: trunk/src/main/java/cc/kune/core/server/content/CreationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CreationService.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/server/content/CreationService.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,6 +19,8 @@
*/
package cc.kune.core.server.content;
+import java.util.Map;
+
import cc.kune.domain.Container;
import cc.kune.domain.Content;
import cc.kune.domain.Group;
@@ -35,7 +37,7 @@
String contentTypeId);
Content createGadget(User user, Container container, String gadgetname, String typeId, String title,
- String body);
+ String body, Map<String, String> gadgetProperties);
Container createRootFolder(Group group, String name, String rootName, String typeRoot);
Modified: trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -21,6 +21,8 @@
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Collections;
+import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -72,7 +74,8 @@
tool.checkTypesBeforeContentCreation(container.getTypeId(), typeId);
final URL gagdetUrl = tool instanceof ServerWaveTool ? ((ServerWaveTool) tool).getGadgetUrl()
: KuneWaveService.WITHOUT_GADGET;
- final Content content = contentManager.createContent(title, body, user, container, typeId, gagdetUrl);
+ final Content content = contentManager.createContent(title, body, user, container, typeId,
+ gagdetUrl, Collections.<String, String> emptyMap());
tool.onCreateContent(content, container);
return content;
}
@@ -90,12 +93,13 @@
@Override
public Content createGadget(final User user, final Container container, final String gadgetname,
- final String typeIdChild, final String title, final String body) {
+ final String typeIdChild, final String title, final String body,
+ final Map<String, String> gadgetProperties) {
final String toolName = container.getToolName();
final ServerTool tool = tools.get(toolName);
tool.checkTypesBeforeContentCreation(container.getTypeId(), typeIdChild);
final Content content = contentManager.createContent(title, body, user, container, typeIdChild,
- getGadgetUrl(gadgetname));
+ getGadgetUrl(gadgetname), gadgetProperties);
tool.onCreateContent(content, container);
return content;
}
Modified: trunk/src/main/java/cc/kune/core/server/i18n/impl/I18nTranslationServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/i18n/impl/I18nTranslationServiceDefault.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/server/i18n/impl/I18nTranslationServiceDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,8 +19,8 @@
*/
package cc.kune.core.server.i18n.impl;
-import cc.kune.common.client.utils.Pair;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.Pair;
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.i18n.I18nTranslationServiceMultiLang;
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 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -71,7 +71,7 @@
for (final String part : participants) {
partIds.add(participantUtils.of(part));
}
- return KuneWaveServerUtils.getUrl(waveService.createWave(title, body,
+ return KuneWaveServerUtils.getUrl(waveService.createWave(title, body, KuneWaveService.DO_NOTHING_CBACK,
partIds.toArray(new ParticipantId[0])));
}
@@ -104,6 +104,7 @@
toList.addAll(group.getSocialNetwork().getAccessLists().getEditors().getList());
}
}
- return KuneWaveServerUtils.getUrl(waveService.createWave(title, message, participantUtils.listFrom(toList)));
+ return KuneWaveServerUtils.getUrl(waveService.createWave(title, message, KuneWaveService.DO_NOTHING_CBACK,
+ participantUtils.listFrom(toList)));
}
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -45,6 +45,7 @@
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
+import cc.kune.common.shared.utils.SimpleArgCallback;
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.errors.EmailAddressInUseException;
@@ -266,13 +267,17 @@
if (defWave != null) {
welcome = kuneWaveManager.createWave(
ContentConstants.WELCOME_WAVE_CONTENT_TITLE.replaceAll("\\[%s\\]",
- properties.getDefaultSiteName()), "", defWave, null,
- participantUtils.of(properties.getAdminShortName()), participantUtils.of(shortName));
+ properties.getDefaultSiteName()), "", defWave, new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef arg) {
+ // Is this necessary? try to remove (used when we were setting
+ // the def
+ // content
+ // contentManager.save(userGroup.getDefaultContent());
+ askForEmailConfirmation(user, EmailConfirmationType.emailVerification);
+ }
+ }, null, participantUtils.of(properties.getAdminShortName()), participantUtils.of(shortName));
}
- // Is this necessary? try to remove (used when we were setting the def
- // content
- // contentManager.save(userGroup.getDefaultContent());
- askForEmailConfirmation(user, EmailConfirmationType.emailVerification);
return user;
} catch (final RuntimeException e) {
try {
Modified: trunk/src/main/java/cc/kune/core/server/notifier/NotificationSenderDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotificationSenderDefault.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotificationSenderDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -104,7 +104,8 @@
if (isHtml) {
LOG.error("Wave html messages not supported yet");
}
- waveService.createWave(subject.getString(), body.getString(), username);
+ waveService.createWave(subject.getString(), body.getString(), KuneWaveService.DO_NOTHING_CBACK,
+ username);
break;
}
}
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,7 +19,9 @@
*/
package cc.kune.core.server.rpc;
+import java.util.Collections;
import java.util.Date;
+import java.util.Map;
import javax.persistence.NoResultException;
@@ -158,11 +160,22 @@
public StateContentDTO addNewContentWithGadget(final String userHash, final StateToken parentToken,
final String gadgetname, final String typeId, final String title, final String body)
throws DefaultException {
+ return addNewContentWithGadgetAndState(userHash, parentToken, gadgetname, typeId, title, body,
+ Collections.<String, String> emptyMap());
+ }
+
+ @Override
+ @Authenticated
+ @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ 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 {
final User user = getCurrentUser();
final Container container = accessService.accessToContainer(
ContentUtils.parseId(parentToken.getFolder()), user, AccessRol.Editor);
final Content addedContent = creationService.createGadget(user, container, gadgetname, typeId,
- title, body);
+ title, body, gadgetProperties);
return getState(user, addedContent);
}
Modified: trunk/src/main/java/cc/kune/events/KuneEvents.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/events/KuneEvents.gwt.xml 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/events/KuneEvents.gwt.xml 2012-02-20 23:38:46 UTC (rev 1689)
@@ -5,5 +5,9 @@
<source path="shared"/>
<inherits name='com.bradrydzewski.gwt.calendar.Calendar'/>
<inherits name='com.bradrydzewski.gwt.calendar.theme.google.Google'/>
- <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/>
+ <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/>
+ <source path='client'
+ excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
+ <source path='shared'
+ excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
</module>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -2,15 +2,21 @@
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
-import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.ui.dialogs.PromptTopDialog;
import cc.kune.common.client.ui.dialogs.PromptTopDialog.Builder;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.Session;
import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.events.client.viewer.CalendarViewer;
+import cc.kune.events.shared.EventsConstants;
+import cc.kune.events.shared.EventsConversionUtil;
+import com.bradrydzewski.gwt.calendar.client.Appointment;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.inject.Inject;
@@ -19,15 +25,20 @@
public class EventAddMenuItem extends MenuItemDescriptor {
public static class EventAddAction extends RolAction {
private final Provider<CalendarViewer> calendar;
+ private final Provider<ContentServiceAsync> contService;
private PromptTopDialog dialog;
private final I18nTranslationService i18n;
+ private final Session session;
@Inject
public EventAddAction(final NavResources res, final I18nTranslationService i18n,
- final Provider<CalendarViewer> calendar) {
+ final Provider<CalendarViewer> calendar, final Provider<ContentServiceAsync> contService,
+ final Session session) {
super(AccessRolDTO.Editor, true);
this.i18n = i18n;
this.calendar = calendar;
+ this.contService = contService;
+ this.session = session;
withText(i18n.t("Add an appointment")).withIcon(res.calendarAdd());
}
@@ -43,8 +54,23 @@
@Override
public void onClick(final ClickEvent event) {
if (dialog.isValid()) {
- calendar.get().addAppointment(dialog.getTextFieldValue(), calendar.get().getOnOverDate());
- NotifyUser.info("Appointment added but not yet saved (this is under development)");
+ final String title = dialog.getTextFieldValue();
+ final Appointment app = calendar.get().addAppointment(title,
+ calendar.get().getOnOverDate());
+ contService.get().addNewContentWithGadgetAndState(session.getUserHash(),
+ session.getContainerState().getStateToken(),
+ EventsConstants.TYPE_MEETING_DEF_GADGETNAME, EventsConstants.TYPE_MEETING, "", title,
+ EventsConversionUtil.toMap(app), new AsyncCallbackSimple<StateContentDTO>() {
+ @Override
+ public void onFailure(final Throwable caught) {
+ super.onFailure(caught);
+ // FIXME, remove appointment
+ }
+
+ @Override
+ public void onSuccess(final StateContentDTO result) {
+ }
+ });
dialog.hide();
}
}
Modified: trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewer.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewer.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewer.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -10,7 +10,7 @@
public interface CalendarViewer extends ContentViewer {
public static final Appointment NO_APPOINT = new Appointment();
- void addAppointment(String description, Date onDate);
+ Appointment addAppointment(String description, Date onDate);
void decrement();
Modified: trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -9,6 +9,7 @@
import cc.kune.core.client.dnd.KuneDragController;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.SessionConstants;
import cc.kune.events.client.viewer.CalendarViewerPresenter.CalendarViewerView;
import cc.kune.gspace.client.armor.GSpaceArmor;
import cc.kune.gspace.client.viewers.AbstractFolderViewerPanel;
@@ -74,15 +75,18 @@
}
@Override
- public void addAppointment(final String title, final Date date) {
+ public Appointment addAppointment(final String title, final Date date) {
// Should this be used or serialize from server side?
final Appointment appt = new Appointment();
appt.setStart(date);
- appt.setEnd(date);
+ // http://stackoverflow.com/questions/2527845/how-to-do-calendar-operations-in-java-gwt-how-to-add-days-to-a-dateSessionConstants._AN_HOUR
+ final Date endDate = new Date(date.getTime() + SessionConstants._AN_HOUR + SessionConstants._AN_HOUR
+ / 2);
+ appt.setEnd(endDate);
appt.setTitle(title);
appt.setStyle(AppointmentStyle.ORANGE);
calendar.addAppointment(appt);
- // FIXME NotiUser
+ return appt;
}
@Override
Modified: trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPresenter.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPresenter.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -59,7 +59,7 @@
HasUpdateHandlers<Appointment>, HasDateRequestHandlers<Date>, HasMouseOverHandlers<Appointment>,
HasLayout, HasAppointments, AbstractFolderViewerView {
- void addAppointment(String title, Date date);
+ Appointment addAppointment(String title, Date date);
HandlerRegistration addClickHandler(ClickHandler clickHandler);
@@ -108,8 +108,8 @@
}
@Override
- public void addAppointment(final String description, final Date onDate) {
- getView().addAppointment(description, onDate);
+ public Appointment addAppointment(final String description, final Date onDate) {
+ return getView().addAppointment(description, onDate);
}
private void addListeners() {
Modified: trunk/src/main/java/cc/kune/events/server/CalendarServerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/events/server/CalendarServerUtils.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/events/server/CalendarServerUtils.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -4,10 +4,7 @@
import net.fortuna.ical4j.model.DateTime;
import net.fortuna.ical4j.model.Property;
import net.fortuna.ical4j.model.TimeZone;
-import net.fortuna.ical4j.model.TimeZoneRegistry;
-import net.fortuna.ical4j.model.TimeZoneRegistryFactory;
import net.fortuna.ical4j.model.component.VEvent;
-import net.fortuna.ical4j.model.component.VTimeZone;
import net.fortuna.ical4j.model.parameter.Value;
import net.fortuna.ical4j.model.property.Description;
import net.fortuna.ical4j.model.property.DtEnd;
@@ -20,20 +17,26 @@
public class CalendarServerUtils {
public static VEvent from(final Appointment app) {
- final TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
- final TimeZone timezone = registry.getTimeZone("GMT");
- final VTimeZone tz = timezone.getVTimeZone();
+ // final TimeZoneRegistry registry =
+ // TimeZoneRegistryFactory.getInstance().createRegistry();
+ // final TimeZone timezone = registry.getTimeZone("GMT");
+ // final VTimeZone tz = timezone.getVTimeZone();
+ // FIXME here v timezone!!!
- // FIXME here v timezone!!!
final DateTime start = new DateTime(app.getStart().getTime());
- start.setTimeZone(timezone);
+ final TimeZone timezone = start.getTimeZone();
+ // start.setTimeZone(timezone);
final DateTime end = new DateTime(app.getEnd().getTime());
- end.setTimeZone(timezone);
+ // end.setTimeZone(timezone);
VEvent event;
if (app.isAllDay()) {
event = new VEvent();
- event.getProperties().add(new DtStart(new Date(app.getStart().getTime())));
- event.getProperties().add(new DtEnd(new Date(app.getEnd().getTime())));
+ final DtStart eventStart = new DtStart(new Date(app.getStart().getTime()));
+ eventStart.setTimeZone(timezone);
+ event.getProperties().add(eventStart);
+ final DtEnd eventEnd = new DtEnd(new Date(app.getEnd().getTime()));
+ eventStart.setTimeZone(timezone);
+ event.getProperties().add(eventEnd);
event.getProperties().getProperty(Property.DTSTART).getParameters().add(Value.DATE);
event.getProperties().getProperty(Property.DTEND).getParameters().add(Value.DATE);
} else {
Added: trunk/src/main/java/cc/kune/events/shared/DateUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/events/shared/DateUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/events/shared/DateUtils.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -0,0 +1,26 @@
+package cc.kune.events.shared;
+
+import java.util.Date;
+
+import com.google.gwt.i18n.client.DateTimeFormat;
+
+/**
+ * The Class DateUtils try to follow RFC 2445 date-time formats.
+ *
+ * DTSTART;TZID=US-Eastern:19970714T133000 ;Local time and time ; zone reference
+ */
+public class DateUtils {
+
+ private static String RFC_DATE_TIME_FORMAT = "'DTSTART':yyyyMMdd'T'hhmmss";
+ private static String RFC_DATE_TIME_FORMAT_TZ = "'DTSTART;TZID='v:yyyyMMdd'T'hhmmss";
+ private static DateTimeFormat rfcDateFormat = DateTimeFormat.getFormat(RFC_DATE_TIME_FORMAT);
+ private static DateTimeFormat rfcDateFormatTz = DateTimeFormat.getFormat(RFC_DATE_TIME_FORMAT_TZ);
+
+ public static Date toDate(final String date) {
+ return rfcDateFormat.parse(date);
+ }
+
+ public static String toString(final Date date) {
+ return rfcDateFormat.format(date);
+ }
+}
Modified: trunk/src/main/java/cc/kune/events/shared/EventsConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/events/shared/EventsConstants.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/events/shared/EventsConstants.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -24,6 +24,7 @@
public static final String NAME = "events";
public static final String ROOT_NAME = "events";
public static final String TYPE_MEETING = NAME + "." + "meeting";
+ public static final String TYPE_MEETING_DEF_GADGETNAME = "massmob";
public static final String TYPE_ROOT = NAME + "." + "root";
private EventsConstants() {
Added: trunk/src/main/java/cc/kune/events/shared/EventsConversionUtil.java
===================================================================
--- trunk/src/main/java/cc/kune/events/shared/EventsConversionUtil.java (rev 0)
+++ trunk/src/main/java/cc/kune/events/shared/EventsConversionUtil.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -0,0 +1,38 @@
+package cc.kune.events.shared;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import cc.kune.common.shared.res.ICalConstants;
+
+import com.bradrydzewski.gwt.calendar.client.Appointment;
+
+/**
+ * The Class EventsConversionUtil is used to convert Appointments to Gadgets
+ * properties and viceversa
+ */
+public class EventsConversionUtil {
+
+ public static Appointment toApp(final Map<String, String> properties) {
+ final Appointment app = new Appointment();
+ app.setStart(DateUtils.toDate(properties.get(ICalConstants.DATE_TIME_START)));
+ app.setEnd(DateUtils.toDate(properties.get(ICalConstants.DATE_TIME_END)));
+ app.setDescription(properties.get(ICalConstants.DESCRIPTION));
+ app.setTitle(properties.get(ICalConstants.SUMMARY));
+ app.setLocation(properties.get(ICalConstants.LOCATION));
+ app.setCreatedBy(properties.get(ICalConstants.ORGANIZER));
+ return app;
+ }
+
+ public static Map<String, String> toMap(final Appointment app) {
+ final Map<String, String> properties = new HashMap<String, String>();
+ properties.put(ICalConstants.DATE_TIME_START, DateUtils.toString(app.getStart()));
+ properties.put(ICalConstants.DATE_TIME_END, DateUtils.toString(app.getEnd()));
+ properties.put(ICalConstants.SUMMARY, app.getTitle());
+ properties.put(ICalConstants.DESCRIPTION, app.getDescription());
+ properties.put(ICalConstants.LOCATION, app.getLocation());
+ properties.put(ICalConstants.ORGANIZER, app.getCreatedBy());
+ return properties;
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackAction.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackAction.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackAction.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -23,7 +23,7 @@
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.notify.NotifyLevel;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.auth.SignIn;
import cc.kune.core.client.i18n.I18nUITranslationService;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -20,8 +20,8 @@
package cc.kune.gspace.client.i18n;
import cc.kune.common.client.errors.UIException;
-import cc.kune.common.client.utils.SimpleCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.ui.DefaultForm;
import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nCellList.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nCellList.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nCellList.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -18,7 +18,7 @@
package cc.kune.gspace.client.i18n;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.core.client.i18n.I18nUITranslationService;
import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.dto.I18nTranslationDTO;
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslationDataProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslationDataProvider.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslationDataProvider.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -18,7 +18,7 @@
import java.util.List;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.I18nServiceAsync;
import cc.kune.core.client.state.Session;
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorPanel.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorPanel.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -20,8 +20,8 @@
package cc.kune.gspace.client.i18n;
import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.common.client.utils.SimpleCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
Modified: trunk/src/main/java/cc/kune/gspace/client/licensewizard/LicenseChangeAction.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/licensewizard/LicenseChangeAction.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/licensewizard/LicenseChangeAction.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -20,8 +20,8 @@
package cc.kune.gspace.client.licensewizard;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.GroupServiceAsync;
import cc.kune.core.client.state.Session;
Modified: trunk/src/main/java/cc/kune/gspace/client/licensewizard/LicenseWizardPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/licensewizard/LicenseWizardPresenter.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/licensewizard/LicenseWizardPresenter.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -24,7 +24,7 @@
import cc.kune.common.client.log.Log;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.ui.dialogs.wizard.WizardListener;
-import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.dto.LicenseDTO;
import cc.kune.gspace.client.licensewizard.pages.LicenseWizardFirstFormView;
Modified: trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstForm.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstForm.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,8 +19,8 @@
*/
package cc.kune.gspace.client.licensewizard.pages;
-import cc.kune.common.client.utils.SimpleCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.ui.DefaultForm;
import cc.kune.core.client.ui.DefaultFormUtils;
Modified: trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstFormView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstFormView.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstFormView.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,7 +19,7 @@
*/
package cc.kune.gspace.client.licensewizard.pages;
-import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.shared.utils.SimpleCallback;
import com.google.gwt.user.client.ui.IsWidget;
Modified: trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFrdForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFrdForm.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFrdForm.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,8 +19,8 @@
*/
package cc.kune.gspace.client.licensewizard.pages;
-import cc.kune.common.client.utils.SimpleCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.ui.DefaultForm;
import cc.kune.core.shared.dto.LicenseDTO;
Modified: trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFrdFormView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFrdFormView.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFrdFormView.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,7 +19,7 @@
*/
package cc.kune.gspace.client.licensewizard.pages;
-import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.shared.utils.SimpleCallback;
import com.google.gwt.user.client.ui.IsWidget;
Modified: trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardTrdForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardTrdForm.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardTrdForm.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -21,8 +21,8 @@
import cc.kune.common.client.resources.CommonResources;
import cc.kune.common.client.tooltip.Tooltip;
-import cc.kune.common.client.utils.SimpleCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.SimpleCallback;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.ui.DefaultForm;
Modified: trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardTrdFormView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardTrdFormView.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardTrdFormView.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,7 +19,7 @@
*/
package cc.kune.gspace.client.licensewizard.pages;
-import cc.kune.common.client.utils.SimpleCallback;
+import cc.kune.common.shared.utils.SimpleCallback;
import com.google.gwt.user.client.ui.IsWidget;
Modified: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePresenter.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePresenter.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,7 +19,7 @@
*/
package cc.kune.gspace.client.options.license;
-import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.common.shared.utils.SimpleResponseCallback;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.LicenseDTO;
Modified: trunk/src/main/java/cc/kune/wave/server/kspecific/KuneAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/kspecific/KuneAgent.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/wave/server/kspecific/KuneAgent.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -21,6 +21,7 @@
import java.net.URL;
import java.util.HashSet;
+import java.util.Map;
import java.util.logging.Logger;
import javax.annotation.Nonnull;
@@ -31,6 +32,8 @@
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
+import cc.kune.common.shared.utils.SimpleArgCallback;
+
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;
@@ -71,31 +74,35 @@
}
@Override
- public WaveRef createWave(final String message, final ParticipantId... participants) {
- return createWave(NO_TITLE, message, participants);
+ public WaveRef createWave(final String message, final SimpleArgCallback<WaveRef> onCreate,
+ final ParticipantId... participants) {
+ return createWave(NO_TITLE, message, onCreate, participants);
}
@Override
public WaveRef createWave(@Nonnull final String title, final String message,
- @Nonnull final ParticipantId... participantsArray) {
- return createWave(title, message, WITHOUT_GADGET, participantsArray);
+ final SimpleArgCallback<WaveRef> onCreate, @Nonnull final ParticipantId... participantsArray) {
+ return createWave(title, message, onCreate, WITHOUT_GADGET, participantsArray);
}
@Override
- public WaveRef createWave(final String title, final String message, final String... participantsArray) {
+ public WaveRef createWave(final String title, final String message,
+ final SimpleArgCallback<WaveRef> onCreate, final String... participantsArray) {
// TODO Auto-generated method stub
return null;
}
@Override
- public WaveRef createWave(final String title, final String message, final String waveIdToCopy,
- final URL gadgetUrl, final ParticipantId... participantsArray) {
+ public WaveRef createWave(final String newtitle, final String body,
+ final SimpleArgCallback<WaveRef> simpleArgCallback, final URL gadgetUrl,
+ final Map<String, String> gadgetProperties, final ParticipantId... participantsArray) {
// TODO Auto-generated method stub
return null;
}
@Override
- public WaveRef createWave(final String title, final String message, final URL gadgetUrl,
+ public WaveRef createWave(final String title, final String message,
+ final SimpleArgCallback<WaveRef> onCreate, final URL gadgetUrl,
final ParticipantId... participantsArray) {
// super.newWave(getWaveDomain(), participantsArray);
final HashSet<String> parts = new HashSet<String>();
@@ -103,10 +110,25 @@
parts.add(part.getAddress());
}
final Wavelet wave = newWave(getWaveDomain(), parts);
- return WaveRef.of(wave.getWaveId(), wave.getWaveletId());
+ return null;
}
@Override
+ public WaveRef createWave(final String title, final String message, final String waveIdToCopy,
+ final SimpleArgCallback<WaveRef> onCreate, final URL gadgetUrl,
+ final Map<String, String> gadgetProperties, final ParticipantId... participantsArray) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public WaveRef createWave(final String title, final String message, final String waveIdToCopy,
+ final SimpleArgCallback<WaveRef> onCreate, final URL gadgetUrl,
+ final ParticipantId... participantsArray) {
+ return null;
+ }
+
+ @Override
public void delParticipants(final WaveRef waveName, final String whoDel, final String... participants) {
// TODO Auto-generated method stub
@@ -192,7 +214,7 @@
@Override
public void setGadgetProperty(final WaveRef waveletName, final String author, final URL gadgetUrl,
- final String someProperty, final String someValue) {
+ final Map<String, String> newProperties) {
// TODO Auto-generated method stub
}
Modified: trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveService.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveService.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveService.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -20,16 +20,25 @@
package cc.kune.wave.server.kspecific;
import java.net.URL;
+import java.util.Map;
import org.waveprotocol.wave.model.id.WaveId;
import org.waveprotocol.wave.model.id.WaveletId;
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
+import cc.kune.common.shared.utils.SimpleArgCallback;
+
import com.google.wave.api.Participants;
import com.google.wave.api.Wavelet;
public interface KuneWaveService {
+ public static final SimpleArgCallback<WaveRef> DO_NOTHING_CBACK = new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef arg) {
+ // Do nothing
+ }
+ };
public static final String NO_MESSAGE = "";
public static final String NO_TITLE = "";
public static final URL WITHOUT_GADGET = null;
@@ -38,17 +47,27 @@
void addParticipants(WaveRef waveName, String author, String userWhoAdd, String... newParticipants);
- WaveRef createWave(String message, ParticipantId... participants);
+ WaveRef createWave(String message, SimpleArgCallback<WaveRef> onCreate, ParticipantId... participants);
- WaveRef createWave(String title, String message, ParticipantId... participantsArray);
+ WaveRef createWave(String title, String message, SimpleArgCallback<WaveRef> onCreate,
+ ParticipantId... participantsArray);
- WaveRef createWave(String title, String message, String... participantsArray);
+ WaveRef createWave(String title, String message, SimpleArgCallback<WaveRef> onCreate,
+ String... participantsArray);
- WaveRef createWave(String title, String message, String waveIdToCopy, URL gadgetUrl,
+ WaveRef createWave(String newtitle, String body, SimpleArgCallback<WaveRef> simpleArgCallback,
+ URL gadgetUrl, Map<String, String> gadgetProperties, ParticipantId... participantsArray);
+
+ WaveRef createWave(String title, String message, SimpleArgCallback<WaveRef> onCreate, URL gadgetUrl,
ParticipantId... participantsArray);
- WaveRef createWave(String title, String message, URL gadgetUrl, ParticipantId... participantsArray);
+ WaveRef createWave(String title, String message, String waveIdToCopy,
+ SimpleArgCallback<WaveRef> onCreate, URL gadgetUrl, Map<String, String> gadgetProperties,
+ ParticipantId... participantsArray);
+ WaveRef createWave(String title, String message, String waveIdToCopy,
+ SimpleArgCallback<WaveRef> onCreate, URL gadgetUrl, ParticipantId... participantsArray);
+
void delParticipants(WaveRef waveName, String whoDel, String... participants);
Wavelet fetchWave(WaveId waveId, WaveletId waveletId, String author);
@@ -65,8 +84,9 @@
String render(WaveRef waveRef, String author);
- void setGadgetProperty(WaveRef waveletName, String author, URL gadgetUrl, String someProperty,
- String someValue);
+ void setGadgetProperty(WaveRef waveletName, String author, URL gadgetUrl,
+ Map<String, String> newProperties);
void setTitle(WaveRef waveName, String title, String author);
+
}
Modified: trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -48,6 +48,7 @@
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
+import cc.kune.common.shared.utils.SimpleArgCallback;
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.wave.server.ParticipantUtils;
@@ -211,24 +212,42 @@
}
@Override
- public WaveRef createWave(final String message, final ParticipantId... participants) {
- return createWave(NO_TITLE, message, participants);
+ public WaveRef createWave(final String message, final SimpleArgCallback<WaveRef> onCreate,
+ final ParticipantId... participants) {
+ return createWave(NO_TITLE, message, onCreate, participants);
}
@Override
public WaveRef createWave(@Nonnull final String title, final String message,
- @Nonnull final ParticipantId... participantsArray) {
- return createWave(title, message, WITHOUT_GADGET, participantsArray);
+ final SimpleArgCallback<WaveRef> onCreate, @Nonnull final ParticipantId... participantsArray) {
+ return createWave(title, message, onCreate, WITHOUT_GADGET, participantsArray);
}
@Override
- public WaveRef createWave(final String title, final String message, final String... participantsArray) {
- return createWave(title, message, participantUtils.listFrom(participantsArray));
+ public WaveRef createWave(final String title, final String message,
+ final SimpleArgCallback<WaveRef> onCreate, final String... participantsArray) {
+ return createWave(title, message, onCreate, participantUtils.listFrom(participantsArray));
}
@Override
+ public WaveRef createWave(final String title, final String message,
+ final SimpleArgCallback<WaveRef> onCreate, final URL gadgetUrl,
+ final Map<String, String> gadgetProperties, final ParticipantId... participantsArray) {
+ return createWave(title, message, NO_WAVE_TO_COPY, onCreate, gadgetUrl, gadgetProperties,
+ participantsArray);
+ }
+
+ @Override
public WaveRef createWave(@Nonnull final String title, final String message,
- final String waveIdToCopy, final URL gadgetUrl, @Nonnull final ParticipantId... participantsArray) {
+ final SimpleArgCallback<WaveRef> onCreate, final URL gadgetUrl,
+ @Nonnull final ParticipantId... participantsArray) {
+ return createWave(title, message, NO_WAVE_TO_COPY, onCreate, gadgetUrl, participantsArray);
+ }
+
+ @Override
+ public WaveRef createWave(@Nonnull final String title, final String message,
+ final String waveIdToCopy, final SimpleArgCallback<WaveRef> onCreate, final URL gadgetUrl,
+ final Map<String, String> gadgetProperties, @Nonnull final ParticipantId... participantsArray) {
String newWaveId = null;
String newWaveletId = null;
final Set<String> participants = new HashSet<String>();
@@ -259,7 +278,13 @@
}
if (gadgetUrl != WITHOUT_GADGET) {
- final Gadget gadget = new Gadget(gadgetUrl.toString());
+ Gadget gadget;
+ if (gadgetProperties.size() > 0) {
+ gadgetProperties.put(Gadget.URL, gadgetUrl.toString());
+ gadget = new Gadget(gadgetProperties);
+ } else {
+ gadget = new Gadget(gadgetUrl.toString());
+ }
rootBlip.append(gadget);
}
@@ -285,18 +310,6 @@
}
}
}
- OperationUtil.submitDeltas(context, waveletProvider, new SubmitRequestListener() {
- @Override
- public void onFailure(final String arg0) {
- KuneWaveServiceDefault.this.onFailure("Wave creation failed, onFailure: " + arg0);
- }
-
- @Override
- public void onSuccess(final int arg0, final HashedVersion arg1, final long arg2) {
- LOG.info("Wave creation success: " + arg1);
- }
- });
- LOG.info("WaveId: " + newWaveId + " waveletId: " + newWaveletId);
WaveRef wavename;
try {
wavename = WaveRef.of(ApiIdSerializer.instance().deserialiseWaveId(newWaveId),
@@ -304,13 +317,17 @@
} catch (final InvalidIdException e) {
throw new DefaultException("Error getting wave id");
}
+ doSubmit(onCreate, context, wavename);
+ LOG.info("WaveId: " + newWaveId + " waveletId: " + newWaveletId);
return wavename;
}
@Override
- public WaveRef createWave(@Nonnull final String title, final String message, final URL gadgetUrl,
+ public WaveRef createWave(@Nonnull final String title, final String message,
+ final String waveIdToCopy, final SimpleArgCallback<WaveRef> onCreate, final URL gadgetUrl,
@Nonnull final ParticipantId... participantsArray) {
- return createWave(title, message, NO_WAVE_TO_COPY, gadgetUrl, participantsArray);
+ return createWave(title, message, waveIdToCopy, onCreate, gadgetUrl,
+ Collections.<String, String> emptyMap(), participantsArray);
}
@Override
@@ -369,6 +386,22 @@
OperationUtil.submitDeltas(context, waveletProvider, listener);
}
+ private void doSubmit(final SimpleArgCallback<WaveRef> onCreate, final OperationContextImpl context,
+ final WaveRef wavename) {
+ OperationUtil.submitDeltas(context, waveletProvider, new SubmitRequestListener() {
+ @Override
+ public void onFailure(final String arg0) {
+ KuneWaveServiceDefault.this.onFailure("Wave creation failed, onFailure: " + arg0);
+ }
+
+ @Override
+ public void onSuccess(final int arg0, final HashedVersion arg1, final long arg2) {
+ LOG.info("Wave creation success: " + arg1);
+ onCreate.onCallback(wavename);
+ }
+ });
+ }
+
@Override
public Wavelet fetchWave(final WaveId waveId, final WaveletId waveletId, final String author) {
final OperationQueue opQueue = new OperationQueue();
@@ -454,11 +487,9 @@
@Override
public void setGadgetProperty(final WaveRef waveletName, final String author, final URL gadgetUrl,
- final String someProperty, final String someValue) {
- // See BlipContentRefs DocumentModifyService
+ final Map<String, String> newProperties) {
+ // Note: See BlipContentRefs DocumentModifyService
final Wavelet wavelet = fetchWave(waveletName, author);
- // FIXME
- final OperationQueue opQueue = new OperationQueue();
final Blip rootBlip = wavelet.getRootBlip();
for (final Element elem : rootBlip.getElements().values()) {
if (elem.isGadget()) {
@@ -466,11 +497,15 @@
if (properties.get(Gadget.URL).equals(gadgetUrl.toString())) {
// This is the gadget we want to modify (the first of that type)
final List<Element> updatedElementsIn = Lists.newArrayListWithCapacity(1);
- properties.put(someProperty, someValue);
- // properties.put(propertyNameToDelete, null);
final Gadget gadget = (Gadget) elem;
- gadget.setProperty(someProperty, someValue);
- // updatedElementsIn.add(new Gadget(properties));
+ final OperationQueue opQueue = new OperationQueue();
+ for (final String propKey : newProperties.keySet()) {
+ final String value = newProperties.get(propKey);
+ properties.put(propKey, value);
+ // properties.put(propertyNameToDelete, null);
+ gadget.setProperty(propKey, value);
+ // updatedElementsIn.add(new Gadget(properties));
+ }
updatedElementsIn.add(gadget);
final OperationRequest operationRequest = opQueue.modifyDocument(rootBlip);
operationRequest.addParameter(Parameter.of(ParamsProperty.MODIFY_ACTION,
@@ -479,7 +514,7 @@
operationRequest.addParameter(Parameter.of(
ParamsProperty.MODIFY_QUERY,
new DocumentModifyQuery(ElementType.GADGET, ImmutableMap.of(Gadget.URL,
- gadgetUrl.toString()), 1)));
+ gadgetUrl.toString()), -1)));
doOperation(author, opQueue, "set gadget property");
break;
}
@@ -500,4 +535,5 @@
set.addAll(Arrays.asList(array));
return set;
}
+
}
Modified: trunk/src/main/resources/wave-server-testing.properties
===================================================================
--- trunk/src/main/resources/wave-server-testing.properties 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/resources/wave-server-testing.properties 2012-02-20 23:38:46 UTC (rev 1689)
@@ -1,28 +1,36 @@
# Core Configuration for the Wave in a Box server
#
-# Domain name of the wave server
+# Domain name of the wave server
+# Default value: local.net (without .domain zone some things will be broken)
wave_server_domain = localhost
# A comma separated list of address on which to listen for connections.
# Each address is a comma separated host:port pair.
+# Default value: localhost:9898
http_frontend_public_address = localhost:9898
+
+# Default value: values passed to http_frontend_public_address.
http_frontend_addresses = ${http_frontend_public_address}
-http_baseurl = /
-resource_base = ./target/kune-0.0.7/
+# A comma separated list of webApp source directories
+# Default value: ./war
+resource_bases = /var/www/kune/,target/kune-0.1.0-SNAPSHOT/,src/main/webapp/
+
### Server-specific variables
###
-# Settings for the different persistence stores. Currently supported: file, file, mongodb
+# Settings for the different persistence stores. Currently supported: memory, file, mongodb
signer_info_store_type = memory
# The location where signer info certificate data is stored on disk. This should be changed.
# Note: This is only used when using the file signer info store. It is ignored
# for other data store types.
+# Default value: _certificates
signer_info_store_directory = _certificates
# Currently supported attachment types: mongodb, disk
+# Default value: disk
attachment_store_type = disk
# The location where attachments are stored on disk. This should be changed.
@@ -44,12 +52,39 @@
# The location where deltas are stored on disk. This should be changed.
# Note: This is only used when using the file delta store. It is ignored
# for other data store types.
+# Default value: _deltas
delta_store_directory = _deltas
-# Set true to use Socket.IO instead of raw WebSockets in the webclient.
+# The location where user sessions are persisted on disk. This allow to restore user sessions
+# between restarts.
+# Default value: _sessions
+sessions_store_directory = _sessions
+
+# Set false to use raw WebSockets instead of Socket.IO (still a bit experimental) in the webclient
+# Default value: true
use_socketio = true
-# To enable federation, edit the server.federation.config file and uncomment the line below
+# Note: the default value for admin is an invalid user id that cannot be registered.
+# To become an admin: Register a user and set its address as the value below.
+# Admin has a privilege to change passwords of other users using an agent robot.
+# Default value: @${wave_server_domain}
+admin_user = @local.net
+
+# The wave id of the welcome template wave. (Without domain, for example: w+Fxjs_-ZPmmA).
+# If filled in then a copy of this wave (actually only the root blip) will be
+# automatically added to the inbox of every new user.
+# Default value: "" (empty)
+welcome_wave_id =
+
+# Thread counts
+#The number of threads to listen on wavelet updates. Default value: 1
+listener_executor_thread_count = 1
+#The number of threads for loading wavelets. Default value: 1
+wavelet_load_executor_thread_count = 1
+#The number of threads to persist deltas. Default value: 1
+delta_persist_executor_thread_count = 1
+
+# To enable federation, edit the server.federation.config file and include it here.
#include = server.federation.config
# These two parameters MUST appear in this file AFTER the above include of the
@@ -61,3 +96,17 @@
# Set true to disable the verification of signers (certificates)
waveserver_disable_signer_verification = true
+
+# Set true to prevent anyone registering on your server.
+# When true, only the admin user can use the RegistrationRobot to add new accounts
+# Default value: false
+disable_registration = false
+
+# Enable SSL for all address/port combinations listed (makes the next 2 settings non-optional)
+enable_ssl = false
+
+# Path to keystore containg the ssl certificates to server
+ssl_keystore_path = src/main/resources/wiab.ks
+
+#Password to the keystore
+ssl_keystore_password = fafafa
Modified: trunk/src/main/resources/wave-server.properties
===================================================================
--- trunk/src/main/resources/wave-server.properties 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/main/resources/wave-server.properties 2012-02-20 23:38:46 UTC (rev 1689)
@@ -2,7 +2,7 @@
#
# Domain name of the wave server
-# Default value: local.net
+# Default value: local.net (without .domain zone some things will be broken)
wave_server_domain = localhost
# A comma separated list of address on which to listen for connections.
@@ -103,7 +103,7 @@
disable_registration = false
# Enable SSL for all address/port combinations listed (makes the next 2 settings non-optional)
-enable_ssl = true
+enable_ssl = false
# Path to keystore containg the ssl certificates to server
ssl_keystore_path = src/main/resources/wiab.ks
Modified: trunk/src/test/java/cc/kune/events/server/CalendarServerUtilsTest.java
===================================================================
--- trunk/src/test/java/cc/kune/events/server/CalendarServerUtilsTest.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/test/java/cc/kune/events/server/CalendarServerUtilsTest.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -7,19 +7,16 @@
import net.fortuna.ical4j.model.DateTime;
import net.fortuna.ical4j.model.component.VEvent;
-import net.fortuna.ical4j.util.Dates;
import org.junit.Ignore;
import org.junit.Test;
+import cc.kune.events.shared.BasicCalendarTest;
+
import com.bradrydzewski.gwt.calendar.client.Appointment;
-public class CalendarServerUtilsTest {
+public class CalendarServerUtilsTest extends BasicCalendarTest {
- private static final String DESCRIPTION = "some description";
- private static final String ID = "some id";
- private static final String TITLE = "some title";
-
private void checkConversionFromAndTo(final Appointment initialApp, final boolean allDay) {
final VEvent vevent = CalendarServerUtils.from(initialApp);
assertEquals(initialApp.getDescription(), vevent.getDescription().getValue());
@@ -51,30 +48,17 @@
@Test
public void testFromToFrom() {
- final Appointment initialApp = new Appointment();
- initialApp.setTitle(TITLE);
- initialApp.setDescription(DESCRIPTION);
- initialApp.setStart(new Date(Dates.getCurrentTimeRounded()));
- initialApp.setEnd(new Date(Dates.getCurrentTimeRounded()));
- initialApp.setId(ID);
final boolean allDay = false;
+ final Appointment initialApp = createAppointment(allDay);
initialApp.setAllDay(allDay);
-
checkConversionFromAndTo(initialApp, allDay);
}
@Ignore
@Test
public void testFromToFromAllDay() {
- final Appointment initialApp = new Appointment();
- initialApp.setTitle(TITLE);
- initialApp.setDescription(DESCRIPTION);
- initialApp.setStart(new Date(Dates.getCurrentTimeRounded()));
- initialApp.setEnd(new Date(Dates.getCurrentTimeRounded()));
- initialApp.setId(ID);
final boolean allDay = true;
- initialApp.setAllDay(allDay);
-
+ final Appointment initialApp = createAppointment(allDay);
checkConversionFromAndTo(initialApp, allDay);
}
Added: trunk/src/test/java/cc/kune/events/shared/BasicCalendarTest.java
===================================================================
--- trunk/src/test/java/cc/kune/events/shared/BasicCalendarTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/events/shared/BasicCalendarTest.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -0,0 +1,30 @@
+package cc.kune.events.shared;
+
+import net.fortuna.ical4j.model.Date;
+import net.fortuna.ical4j.util.Dates;
+
+import com.bradrydzewski.gwt.calendar.client.Appointment;
+
+public class BasicCalendarTest {
+
+ protected static final String DESCRIPTION = "some description";
+ protected static final String ID = "some id";
+ protected static final String TITLE = "some title";
+
+ protected Appointment createAppointment(final boolean allDay) {
+ final Appointment initialApp = new Appointment();
+ initialApp.setTitle(TITLE);
+ initialApp.setDescription(DESCRIPTION);
+ initialApp.setStart(getNow());
+ initialApp.setEnd(getNow());
+ initialApp.setId(ID);
+ initialApp.setAllDay(allDay);
+ return initialApp;
+ }
+
+ protected Date getNow() {
+ final Date date = new Date(Dates.getCurrentTimeRounded());
+ return date;
+ }
+
+}
Added: trunk/src/test/java/cc/kune/events/shared/EventsConversionUtilTest.java
===================================================================
--- trunk/src/test/java/cc/kune/events/shared/EventsConversionUtilTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/events/shared/EventsConversionUtilTest.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -0,0 +1,28 @@
+package cc.kune.events.shared;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Map;
+
+import org.junit.Test;
+
+import com.bradrydzewski.gwt.calendar.client.Appointment;
+import com.google.gwt.editor.client.Editor.Ignore;
+
+public class EventsConversionUtilTest extends BasicCalendarTest {
+
+ @Test
+ @Ignore
+ public void testToMap() {
+ final Appointment app = createAppointment(false);
+ final Map<String, String> map = EventsConversionUtil.toMap(app);
+ final Appointment appReConverted = EventsConversionUtil.toApp(map);
+ assertEquals(app.getStart(), appReConverted.getStart());
+ assertEquals(app.getEnd(), appReConverted.getEnd());
+ assertEquals(app.getDescription(), appReConverted.getDescription());
+ assertEquals(app.getTitle(), appReConverted.getTitle());
+ assertEquals(app.getLocation(), appReConverted.getLocation());
+ assertEquals(app.getCreatedBy(), appReConverted.getCreatedBy());
+ }
+
+}
Modified: trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -19,10 +19,6 @@
*/
package cc.kune.wave.server;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -35,12 +31,10 @@
import org.waveprotocol.wave.model.id.TokenGenerator;
import org.waveprotocol.wave.model.wave.InvalidParticipantAddress;
import org.waveprotocol.wave.model.wave.ParticipantId;
-import org.waveprotocol.wave.model.waveref.WaveRef;
import cc.kune.wave.server.kspecific.KuneAgent;
import com.google.common.collect.Lists;
-import com.google.wave.api.Wavelet;
public class KuneAgentTest {
private static final String MESSAGE = "testing";
@@ -81,13 +75,14 @@
@Ignore
@Test
public void testBasicCreation() throws InvalidParticipantAddress {
- final WaveRef waveletName = manager.createWave(RICHTEXT_MESSAGE,
- ParticipantId.of(getSiteAdminShortName()));
- assertNotNull(waveletName);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertTrue(fetchWavelet.getRootBlip().getAnnotations().size() > 0);
- assertEquals("", fetchWavelet.getRootBlip().getContent());
- assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ // final WaveRef waveletName = manager.createWave(RICHTEXT_MESSAGE, null,
+ // ParticipantId.of(getSiteAdminShortName()));
+ // assertNotNull(waveletName);
+ // final Wavelet fetchWavelet = manager.fetchWave(waveletName,
+ // getSiteAdminShortName());
+ // assertNotNull(fetchWavelet);
+ // assertTrue(fetchWavelet.getRootBlip().getAnnotations().size() > 0);
+ // assertEquals("", fetchWavelet.getRootBlip().getContent());
+ // assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
}
}
Modified: trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java 2012-02-14 13:04:48 UTC (rev 1688)
+++ trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java 2012-02-20 23:38:46 UTC (rev 1689)
@@ -28,7 +28,9 @@
import java.net.URL;
import java.util.Arrays;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@@ -37,6 +39,7 @@
import org.junit.Test;
import org.waveprotocol.wave.model.waveref.WaveRef;
+import cc.kune.common.shared.utils.SimpleArgCallback;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.server.integration.IntegrationTest;
import cc.kune.core.server.integration.IntegrationTestHelper;
@@ -53,6 +56,8 @@
private static final String NEW_PARTICIPANT = "newparti";
private static final String NEW_PARTICIPANT2 = "newparti2";
private static final String RICHTEXT_MESSAGE = "<b>" + MESSAGE + "</b>";
+ private static final String SOME_OTHER_PROPERTY = "someOtherProperty";
+ private static final String SOME_OTHER_VALUE = "someOtherValue";
private static final String SOME_PROPERTY = "someProperty";
private static final String SOME_VALUE = "someValue";
private static final String TEST_GADGET = "http://wave-api.appspot.com/public/gadgets/areyouin/gadget.xml";
@@ -67,98 +72,132 @@
@Ignore
public void addAndDelMainParticipant() throws IOException {
doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), NEW_PARTICIPANT);
+ createTestWave(new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), NEW_PARTICIPANT);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertEquals(2, fetchWavelet.getParticipants().size());
- assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
- assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
- // Del all
- manager.delParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName());
- // This fails because we don't have a way to access to than wave now ...
- // @domain don't work neither
- final Wavelet fetchedAfterDeleted = manager.fetchWave(waveletName, "");
- assertNotNull(fetchedAfterDeleted);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertEquals(2, fetchWavelet.getParticipants().size());
+ assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
+ assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
+ // Del all
+ manager.delParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName());
+ // This fails because we don't have a way to access to than wave now ...
+ // @domain don't work neither
+ final Wavelet fetchedAfterDeleted = manager.fetchWave(waveletName, "");
+ assertNotNull(fetchedAfterDeleted);
+ }
+ });
}
@Test
public void addAndDelParticipantTwice() throws IOException {
doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
- NEW_PARTICIPANT);
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
- NEW_PARTICIPANT, NEW_PARTICIPANT);
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
- NEW_PARTICIPANT, NEW_PARTICIPANT, NEW_PARTICIPANT);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertEquals(2, fetchWavelet.getParticipants().size());
- assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
- assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
- // Del main editor
- manager.delParticipants(waveletName, getSiteAdminShortName(), NEW_PARTICIPANT, NEW_PARTICIPANT,
- getSiteAdminShortName(), getSiteAdminShortName());
+ createTestWave(new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ NEW_PARTICIPANT);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ NEW_PARTICIPANT, NEW_PARTICIPANT);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ NEW_PARTICIPANT, NEW_PARTICIPANT, NEW_PARTICIPANT);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertEquals(2, fetchWavelet.getParticipants().size());
+ assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
+ assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
+ // Del main editor
+ manager.delParticipants(waveletName, getSiteAdminShortName(), NEW_PARTICIPANT, NEW_PARTICIPANT,
+ getSiteAdminShortName(), getSiteAdminShortName());
+ }
+ });
}
@Test
public void addAndRemoveParticipant() throws IOException {
doLogin();
final String whoDels = getSiteAdminShortName();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), whoDels, NEW_PARTICIPANT,
- NEW_PARTICIPANT2);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertEquals(3, fetchWavelet.getParticipants().size());
- assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
- assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT2));
- assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
- manager.delParticipants(waveletName, whoDels, NEW_PARTICIPANT, NEW_PARTICIPANT2);
- final Wavelet fetchDelWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchDelWavelet);
- assertEquals(1, fetchDelWavelet.getParticipants().size());
- assertTrue(manager.isParticipant(fetchDelWavelet, getSiteAdminShortName()));
- assertFalse(manager.isParticipant(fetchDelWavelet, NEW_PARTICIPANT));
- assertFalse(manager.isParticipant(fetchDelWavelet, NEW_PARTICIPANT2));
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
- NEW_PARTICIPANT);
- // Del all (the last, the whoDels...)
- manager.delParticipants(waveletName, whoDels, NEW_PARTICIPANT, getSiteAdminShortName());
+ createTestWave(new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), whoDels, NEW_PARTICIPANT,
+ NEW_PARTICIPANT2);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertEquals(3, fetchWavelet.getParticipants().size());
+ assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
+ assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT2));
+ assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
+ manager.delParticipants(waveletName, whoDels, NEW_PARTICIPANT, NEW_PARTICIPANT2);
+ final Wavelet fetchDelWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchDelWavelet);
+ assertEquals(1, fetchDelWavelet.getParticipants().size());
+ assertTrue(manager.isParticipant(fetchDelWavelet, getSiteAdminShortName()));
+ assertFalse(manager.isParticipant(fetchDelWavelet, NEW_PARTICIPANT));
+ assertFalse(manager.isParticipant(fetchDelWavelet, NEW_PARTICIPANT2));
+ manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ NEW_PARTICIPANT);
+ // Del all (the last, the whoDels...)
+ manager.delParticipants(waveletName, whoDels, NEW_PARTICIPANT, getSiteAdminShortName());
+ }
+ });
}
@Test
public void addGadget() throws DefaultException, IOException {
doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.addGadget(waveletName, getSiteAdminShortName(), new URL(TEST_GADGET));
+ final URL gadgetUrl = new URL(TEST_GADGET);
+ createTestWave(new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ manager.addGadget(waveletName, getSiteAdminShortName(), gadgetUrl);
+ }
+ });
}
@Test
public void addGadgetAndCheckProperties() throws DefaultException, IOException {
doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
final URL gadgetUrl = new URL(TEST_GADGET);
- manager.addGadget(waveletName, getSiteAdminShortName(), gadgetUrl);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- final Gadget gadget = getFirstGadget(fetchWavelet, TEST_GADGET);
- assertEquals(gadget.getUrl(), TEST_GADGET);
- assertEquals(2, gadget.getProperties().size());
- assertEquals(3, fetchWavelet.getRootBlip().getElements().size());
- manager.setGadgetProperty(waveletName, getSiteAdminShortName(), gadgetUrl, SOME_PROPERTY, SOME_VALUE);
- final Wavelet updatedWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- final Gadget gadgetUpdated = getFirstGadget(updatedWavelet, TEST_GADGET);
- assertEquals(gadgetUpdated.getUrl(), TEST_GADGET);
- assertEquals(3, updatedWavelet.getRootBlip().getElements().size());
- assertEquals(3, gadgetUpdated.getProperties().size());
- assertEquals(SOME_VALUE, gadgetUpdated.getProperties().get(SOME_PROPERTY));
+ createTestWave(new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ manager.addGadget(waveletName, getSiteAdminShortName(), gadgetUrl);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ final Gadget gadget = getFirstGadget(fetchWavelet, TEST_GADGET);
+ assertEquals(gadget.getUrl(), TEST_GADGET);
+ assertEquals(2, gadget.getProperties().size());
+ assertEquals(3, fetchWavelet.getRootBlip().getElements().size());
+ final Map<String, String> newProps = new HashMap<String, String>();
+ newProps.put(SOME_PROPERTY, SOME_VALUE);
+ newProps.put(SOME_OTHER_PROPERTY, SOME_OTHER_VALUE);
+ final int numberProp = 50;
+ for (int i = 1; i < numberProp; i++) {
+ newProps.put(SOME_OTHER_PROPERTY + i, SOME_OTHER_VALUE + i);
+ }
+ // Removing some property
+ newProps.put(SOME_PROPERTY, null);
+ manager.setGadgetProperty(waveletName, getSiteAdminShortName(), gadgetUrl, newProps);
+ final Wavelet updatedWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ final Gadget gadgetUpdated = getFirstGadget(updatedWavelet, TEST_GADGET);
+ assertEquals(gadgetUpdated.getUrl(), TEST_GADGET);
+ assertEquals(3, updatedWavelet.getRootBlip().getElements().size());
+ assertEquals(numberProp + 2, gadgetUpdated.getProperties().size());
+ assertEquals(null, gadgetUpdated.getProperties().get(SOME_PROPERTY));
+ assertEquals(SOME_OTHER_VALUE, gadgetUpdated.getProperties().get(SOME_OTHER_PROPERTY));
+ for (int i = 1; i < numberProp; i++) {
+ assertEquals(SOME_OTHER_VALUE + i, gadgetUpdated.getProperties().get(SOME_OTHER_PROPERTY + i));
+ }
+ }
+ });
}
@Test
@@ -174,14 +213,18 @@
private void addParticipant(final String whoAdds) throws IOException {
doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), whoAdds, NEW_PARTICIPANT);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertEquals(2, fetchWavelet.getParticipants().size());
- assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
- assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
+ createTestWave(new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), whoAdds, NEW_PARTICIPANT);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertEquals(2, fetchWavelet.getParticipants().size());
+ assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
+ assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
+ }
+ });
}
@Test
@@ -195,42 +238,52 @@
new IntegrationTestHelper(this);
}
- private WaveRef createTestWave() {
- return manager.createWave(TITLE, RICHTEXT_MESSAGE, participantUtils.of(getSiteAdminShortName()));
+ private void createTestWave(final SimpleArgCallback<WaveRef> callback) {
+ manager.createWave(TITLE, RICHTEXT_MESSAGE, callback, participantUtils.of(getSiteAdminShortName()));
}
@Test
public void createWave() throws DefaultException, IOException {
doLogin();
- final WaveRef waveletName = manager.createWave(RICHTEXT_MESSAGE,
- participantUtils.of(getSiteAdminShortName()));
- assertNotNull(waveletName);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertTrue(fetchWavelet.getRootBlip().getAnnotations().size() > 0);
- assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ manager.createWave(RICHTEXT_MESSAGE, new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertTrue(fetchWavelet.getRootBlip().getAnnotations().size() > 0);
+ assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ }
+ }, participantUtils.of(getSiteAdminShortName()));
}
@Test
public void createWaveWithGadget() throws DefaultException, IOException {
doLogin();
- final WaveRef waveletName = manager.createWave(TITLE, RICHTEXT_MESSAGE, new URL(TEST_GADGET),
- participantUtils.of(getSiteAdminShortName()));
- assertNotNull(waveletName);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ manager.createWave(TITLE, RICHTEXT_MESSAGE, new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ }
+ }, new URL(TEST_GADGET), participantUtils.of(getSiteAdminShortName()));
}
@Test
public void createWaveWithTitle() throws DefaultException, IOException {
doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
- assertEquals(TITLE, fetchWavelet.getTitle());
+ createTestWave(new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ assertEquals(TITLE, fetchWavelet.getTitle());
+ }
+ });
}
private Gadget getFirstGadget(final Wavelet fetchWavelet, final String testGadget) {
@@ -253,20 +306,28 @@
@Test
public void renderWave() throws DefaultException, IOException {
doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(manager.render(waveletName, getSiteAdminShortName()));
+ createTestWave(new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(manager.render(waveletName, getSiteAdminShortName()));
+ }
+ });
}
@Test
public void setTitle() throws DefaultException, IOException {
doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.setTitle(waveletName, TITLENEW, getSiteAdminShortName());
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
- assertEquals(TITLENEW, fetchWavelet.getTitle());
+ createTestWave(new SimpleArgCallback<WaveRef>() {
+ @Override
+ public void onCallback(final WaveRef waveletName) {
+ assertNotNull(waveletName);
+ manager.setTitle(waveletName, TITLENEW, getSiteAdminShortName());
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ assertEquals(TITLENEW, fetchWavelet.getTitle());
+ }
+ });
}
}
More information about the kune-commits
mailing list