![]()
+diff --git a/src/org/waveprotocol/wave/client/wavepanel/render/FullDomRenderer.java b/src/org/waveprotocol/wave/client/wavepanel/render/FullDomRenderer.java
+index 7bf5d6e..4b5aa25 100644
+--- a/src/org/waveprotocol/wave/client/wavepanel/render/FullDomRenderer.java
++++ b/src/org/waveprotocol/wave/client/wavepanel/render/FullDomRenderer.java
+@@ -24,6 +24,7 @@ import org.waveprotocol.wave.client.state.ThreadReadStateMonitor;
+ import org.waveprotocol.wave.client.uibuilder.HtmlClosure;
+ import org.waveprotocol.wave.client.uibuilder.HtmlClosureCollection;
+ import org.waveprotocol.wave.client.uibuilder.UiBuilder;
++import org.waveprotocol.wave.client.wavepanel.view.IntrinsicBlipMetaView;
+ import org.waveprotocol.wave.client.wavepanel.view.ViewIdMapper;
+ import org.waveprotocol.wave.client.wavepanel.view.dom.full.AnchorViewBuilder;
+ import org.waveprotocol.wave.client.wavepanel.view.dom.full.BlipMetaViewBuilder;
+@@ -48,6 +49,7 @@ import org.waveprotocol.wave.model.wave.ParticipantId;
+
+ import java.util.Collections;
+ import java.util.Comparator;
++import java.util.EnumSet;
+ import java.util.List;
+
+ /**
+@@ -220,6 +222,8 @@ public final class FullDomRenderer implements RenderingRules
{
+ };
+
+ BlipMetaViewBuilder metaUi = BlipMetaViewBuilder.create(viewIdMapper.metaOf(blip), document);
++ if (blip.isRoot())
++ metaUi.disable(BlipMetaViewBuilder.DELETE_MENU_OPTIONS_SET);
+ blipPopulator.render(blip, metaUi);
+
+ return BlipViewBuilder.create(viewIdMapper.blipOf(blip), metaUi, threadsUi, convsUi);
diff --git a/src/org/waveprotocol/wave/client/wavepanel/view/dom/BlipMenuItemDomImpl.java b/src/org/waveprotocol/wave/client/wavepanel/view/dom/BlipMenuItemDomImpl.java
index 4b97489..1507f83 100644
--- a/src/org/waveprotocol/wave/client/wavepanel/view/dom/BlipMenuItemDomImpl.java
@@ -760,21 +926,24 @@ index 57294ec..72b1a86 100644
.contentContainer, .replies, .privateReplies{word-wrap: break-word;}
diff --git a/src/org/waveprotocol/wave/client/wavepanel/view/dom/full/BlipMetaViewBuilder.java b/src/org/waveprotocol/wave/client/wavepanel/view/dom/full/BlipMetaViewBuilder.java
-index 9ec4aaf..6ccc1d1 100644
+index 9ec4aaf..aaac5be 100644
--- a/src/org/waveprotocol/wave/client/wavepanel/view/dom/full/BlipMetaViewBuilder.java
+++ b/src/org/waveprotocol/wave/client/wavepanel/view/dom/full/BlipMetaViewBuilder.java
-@@ -81,16 +81,26 @@ public final class BlipMetaViewBuilder implements UiBuilder, IntrinsicBlipMetaVi
+@@ -81,16 +81,27 @@ public final class BlipMetaViewBuilder implements UiBuilder, IntrinsicBlipMetaVi
private final static Map MENU_LABELS =
new EnumMap(MenuOption.class);
+- private final static StringMap MENU_OPTIONS = CollectionUtils.createStringMap();
+ private final static Map MENU_ICONS =
+ new EnumMap(MenuOption.class);
-+
- private final static StringMap MENU_OPTIONS = CollectionUtils.createStringMap();
++ private final static StringMap MENU_OPTIONS = CollectionUtils.createStringMap();
++ public final static Set DELETE_MENU_OPTIONS_SET = EnumSet.of(IntrinsicBlipMetaView.MenuOption.DELETE);
++
public static final String OPTION_ID_ATTRIBUTE = "o";
public static final String OPTION_SELECTED_ATTRIBUTE = "s";
-
+-
++
static {
+ BlipIconResources.Css css = BlipIconResources.Loader.res.css();
+ MENU_ICONS.put(MenuOption.EDIT, EscapeUtils.fromSafeConstant(css.edit()));
@@ -790,7 +959,7 @@ index 9ec4aaf..6ccc1d1 100644
MENU_LABELS.put(MenuOption.EDIT, EscapeUtils.fromSafeConstant("Edit"));
MENU_LABELS.put(MenuOption.REPLY, EscapeUtils.fromSafeConstant("Reply"));
MENU_LABELS.put(MenuOption.DELETE, EscapeUtils.fromSafeConstant("Delete"));
-@@ -245,6 +255,7 @@ public final class BlipMetaViewBuilder implements UiBuilder, IntrinsicBlipMetaVi
+@@ -245,6 +256,7 @@ public final class BlipMetaViewBuilder implements UiBuilder, IntrinsicBlipMetaVi
out.append(EscapeUtils.fromSafeConstant("|"));
String style = selected.contains(option) //
? css.menuOption() + css.menuOptionSelected() : css.menuOption();
diff --git a/pom.xml b/pom.xml
index e6428e3f0..bfe6c98b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,8 +22,8 @@
UTF-8
1.6.1
2.0.1
- 0.3.14
- 8.0.1.v20110908
+ 0.3.15
+ 8.1.1.v20120215
true
@@ -429,6 +429,12 @@
commons-logging
commons-logging
1.1
+
+
+ servlet-api
+ javax.servlet
+
+
commons-fileupload
@@ -446,14 +452,13 @@
liquibase-plugin
1.8.1.0
-
- javax.servlet
- servlet-api
-
- 2.5
-
- provided
-
+
+
+
+
+
+
+
org.jukito
@@ -713,6 +718,12 @@
gwtrpccommlayer
0.0.1-SNAPSHOT
+
+
+
+
+
+
diff --git a/src/main/java/cc/kune/KuneDev.gwt.xml b/src/main/java/cc/kune/KuneDev.gwt.xml
index a2cc10719..156c7c526 100644
--- a/src/main/java/cc/kune/KuneDev.gwt.xml
+++ b/src/main/java/cc/kune/KuneDev.gwt.xml
@@ -20,10 +20,10 @@
-
+
-
-
+
+
-
+
+
diff --git a/src/main/java/cc/kune/barters/client/actions/DelBartersMenuItem.java b/src/main/java/cc/kune/barters/client/actions/DelBartersMenuItem.java
index 1be450cf2..d641f3733 100644
--- a/src/main/java/cc/kune/barters/client/actions/DelBartersMenuItem.java
+++ b/src/main/java/cc/kune/barters/client/actions/DelBartersMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContentMenuItem;
+import cc.kune.gspace.client.actions.DelContentForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelBartersMenuItem extends DelContentMenuItem {
+public class DelBartersMenuItem extends DelContentForEditorsMenuItem {
@Inject
- public DelBartersMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
+ public DelBartersMenuItem(final I18nTranslationService i18n, final DelContentForEditorsAction action, final CoreResources res) {
super(i18n, action, res);
}
}
diff --git a/src/main/java/cc/kune/barters/client/actions/DelFolderMenuItem.java b/src/main/java/cc/kune/barters/client/actions/DelFolderMenuItem.java
index 441087154..c41628de7 100644
--- a/src/main/java/cc/kune/barters/client/actions/DelFolderMenuItem.java
+++ b/src/main/java/cc/kune/barters/client/actions/DelFolderMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContainerMenuItem;
+import cc.kune.gspace.client.actions.DelContainerForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelFolderMenuItem extends DelContainerMenuItem {
+public class DelFolderMenuItem extends DelContainerForEditorsMenuItem {
@Inject
- public DelFolderMenuItem(final I18nTranslationService i18n, final DelContainerAction action, final CoreResources res) {
+ public DelFolderMenuItem(final I18nTranslationService i18n, final DelContainerForEditorAction action, final CoreResources res) {
super(i18n, action, res);
}
diff --git a/src/main/java/cc/kune/barters/server/BarterServerTool.java b/src/main/java/cc/kune/barters/server/BarterServerTool.java
index 44ffbaed4..ef8613c0c 100644
--- a/src/main/java/cc/kune/barters/server/BarterServerTool.java
+++ b/src/main/java/cc/kune/barters/server/BarterServerTool.java
@@ -19,8 +19,8 @@
*/
package cc.kune.barters.server;
-import static cc.kune.barters.shared.BartersToolConstants.TOOL_NAME;
import static cc.kune.barters.shared.BartersToolConstants.ROOT_NAME;
+import static cc.kune.barters.shared.BartersToolConstants.TOOL_NAME;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_BARTER;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_FOLDER;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_ROOT;
@@ -57,8 +57,8 @@ public class BarterServerTool extends AbstractServerTool implements ServerWaveTo
public BarterServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
final CreationService creationService) {
- super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_BARTER), Arrays.asList(TYPE_ROOT, TYPE_FOLDER),
- Arrays.asList(TYPE_FOLDER), Arrays.asList(TYPE_ROOT, TYPE_FOLDER), contentManager,
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_BARTER), Arrays.asList(TYPE_ROOT,
+ TYPE_FOLDER), Arrays.asList(TYPE_FOLDER), Arrays.asList(TYPE_ROOT, TYPE_FOLDER), contentManager,
containerManager, creationService, configurationManager, i18n, ServerToolTarget.forUsers);
gadgetUrl = UrlUtils.of(BARTER_GADGET);
}
@@ -92,6 +92,7 @@ protected void setContainerAcl(final Container container) {
bartersAcl.getAdmins().setMode(GroupListMode.NORMAL);
bartersAcl.getAdmins().add(container.getOwner());
bartersAcl.getEditors().setMode(GroupListMode.NORMAL);
+ bartersAcl.getEditors().add(container.getOwner());
bartersAcl.getViewers().setMode(GroupListMode.EVERYONE);
setAccessList(container, bartersAcl);
}
diff --git a/src/main/java/cc/kune/blogs/client/actions/DelBlogMenuItem.java b/src/main/java/cc/kune/blogs/client/actions/DelBlogMenuItem.java
index 0f3e494fa..873b2e54d 100644
--- a/src/main/java/cc/kune/blogs/client/actions/DelBlogMenuItem.java
+++ b/src/main/java/cc/kune/blogs/client/actions/DelBlogMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContainerMenuItem;
+import cc.kune.gspace.client.actions.DelContainerForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelBlogMenuItem extends DelContainerMenuItem {
+public class DelBlogMenuItem extends DelContainerForEditorsMenuItem {
@Inject
- public DelBlogMenuItem(final I18nTranslationService i18n, final DelContainerAction action, final CoreResources res) {
+ public DelBlogMenuItem(final I18nTranslationService i18n, final DelContainerForEditorAction action, final CoreResources res) {
super(i18n, action, res);
}
diff --git a/src/main/java/cc/kune/blogs/client/actions/DelPostMenuItem.java b/src/main/java/cc/kune/blogs/client/actions/DelPostMenuItem.java
index bd9b61a06..b47c3d1aa 100644
--- a/src/main/java/cc/kune/blogs/client/actions/DelPostMenuItem.java
+++ b/src/main/java/cc/kune/blogs/client/actions/DelPostMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContentMenuItem;
+import cc.kune.gspace.client.actions.DelContentForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelPostMenuItem extends DelContentMenuItem {
+public class DelPostMenuItem extends DelContentForEditorsMenuItem {
@Inject
- public DelPostMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
+ public DelPostMenuItem(final I18nTranslationService i18n, final DelContentForEditorsAction action, final CoreResources res) {
super(i18n, action, res);
}
}
diff --git a/src/main/java/cc/kune/common/KuneCommon.gwt.xml b/src/main/java/cc/kune/common/KuneCommon.gwt.xml
index e526eab88..db2857c32 100644
--- a/src/main/java/cc/kune/common/KuneCommon.gwt.xml
+++ b/src/main/java/cc/kune/common/KuneCommon.gwt.xml
@@ -7,7 +7,8 @@
-
+
diff --git a/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java b/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
index 4aba31e0e..e9a2952a4 100644
--- a/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
+++ b/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
@@ -41,7 +41,6 @@
*
*/
public class ActionRegistryByType {
- private static final String GENERIC_GROUP_ACTION = "kgengroup";
private static final String GENERIC_TYPE_ID = "kgentype";
private static final String KEY_SEPARATOR = "-";
@@ -57,10 +56,6 @@ private void add(final GuiActionDescCollection collection, final GuiActionDescri
collection.add(descrip);
}
- // public void addAction(final Provider extends GuiActionDescrip> action) {
- // addAction(GENERIC_GROUP_ACTION, action, GENERIC_TYPE_ID);
- // }
-
public void addAction(@Nonnull final String tool, final String actionsGroupId,
final GuiActionDescrip descrip, final String typeId) {
addAction(tool, actionsGroupId, new Provider() {
@@ -127,6 +122,8 @@ public GuiActionDescCollection getCurrentActions(final String tool, final Ob
final GuiActionDescrip descrip = descripProv.get();
final AbstractAction action = descrip.getAction();
if (action instanceof RolAction) {
+ // Log.debug("Must add action?: " + action + ", isLogged: " + isLogged +
+ // ", r: " + rights);
if (mustAdd((RolAction) action, isLogged, rights)) {
add(collection, descrip, targetItem);
}
diff --git a/src/main/java/cc/kune/core/client/errors/ErrorHandler.java b/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
index 1cbd2253e..1eb5e888f 100644
--- a/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
+++ b/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
@@ -154,6 +154,7 @@ public void process(final Throwable caught) {
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.info, i18n.t(TextUtils.IN_DEVELOPMENT)));
} else {
logException(caught, true);
+ // FIXME: Remore "with our servers"
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error,
i18n.t("Oops! Something has gone wrong with our servers. Retry later, please.")));
final String error = "Other kind of exception received in ErrorHandler (" + caught.getMessage()
diff --git a/src/main/java/cc/kune/core/server/UserSessionManager.java b/src/main/java/cc/kune/core/server/UserSessionManager.java
index ea42dc172..0942e2a4c 100644
--- a/src/main/java/cc/kune/core/server/UserSessionManager.java
+++ b/src/main/java/cc/kune/core/server/UserSessionManager.java
@@ -45,9 +45,9 @@ public UserSessionManager(final UserManager manager, final Provider
this.manager = manager;
this.userSessionProv = userSessionProv;
final HashSessionManager hSessionManager = (HashSessionManager) jettySessionManager;
- hSessionManager.setMaxInactiveInterval(-1);
+ // hSessionManager.setMaxInactiveInterval(-1);
// this prevent saving the session??
- hSessionManager.setUsingCookies(true);
+ // hSessionManager.setUsingCookies(true);
hSessionManager.setSavePeriod(5);
// For now the implementation of this can be very inaccurate (if we
// login/logout several times with different clients) and not scalable
diff --git a/src/main/java/cc/kune/core/server/content/XMLActionReader.java b/src/main/java/cc/kune/core/server/content/XMLActionReader.java
index 781ff50f9..1318fe927 100644
--- a/src/main/java/cc/kune/core/server/content/XMLActionReader.java
+++ b/src/main/java/cc/kune/core/server/content/XMLActionReader.java
@@ -21,10 +21,8 @@
import java.io.IOException;
import java.io.InputStream;
-import java.io.StringWriter;
import java.util.List;
-import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.waveprotocol.box.server.CoreSettings;
@@ -48,9 +46,7 @@ public XMLActionReader(@Named(CoreSettings.RESOURCE_BASES) final List re
try {
final InputStream iStream = FileDownloadManagerUtils.getInputStreamInResourceBases(resourceBases,
XMLActionsConstants.ACTIONS_XML_LOCATION_PATH_ABS);
- final StringWriter writer = new StringWriter();
- IOUtils.copy(iStream, writer, "UTF-8");
- final String xml = writer.toString();
+ final String xml = FileDownloadManagerUtils.getInpuStreamAsString(iStream);
actions = new XMLKuneClientActions(new ServicesTester(), xml);
} catch (final IOException e) {
LOG.error("Error reading extension actions", e);
diff --git a/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java b/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java
index b7293688f..f41d46d96 100644
--- a/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java
+++ b/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java
@@ -26,10 +26,12 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.StringWriter;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -37,6 +39,12 @@ public class FileDownloadManagerUtils {
public static final Log LOG = LogFactory.getLog(FileDownloadManagerUtils.class);
+ public static String getInpuStreamAsString(final InputStream iStream) throws IOException {
+ final StringWriter writer = new StringWriter();
+ IOUtils.copy(iStream, writer, "UTF-8");
+ return writer.toString();
+ }
+
public static InputStream getInputStreamInResourceBases(final List resourceBases,
final String filename) {
InputStream in = null;
diff --git a/src/main/java/cc/kune/core/server/state/StateServiceDefault.java b/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
index 094ccf21b..b906a3118 100644
--- a/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
+++ b/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
@@ -21,9 +21,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.server.access.AccessRightsService;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.SocialNetworkManager;
@@ -107,12 +109,13 @@ public StateContent create(final User userLogged, final Content content) {
final char[] text = revision.getBody();
final String textBody = text == null ? null : new String(text);
if (content.isWave()) {
- final String waveId = content.getWaveId();
- state.setWaveRef(waveId);
+ final String waveRef = content.getWaveId();
+ state.setWaveRef(waveRef);
try {
// FIXME if we remove the authors this fails...
final Wavelet wavelet = kuneWaveService.fetchWave(
- JavaWaverefEncoder.decodeWaveRefFromPath(waveId), content.getAuthors().get(0).getShortName());
+ JavaWaverefEncoder.decodeWaveRefFromPath(waveRef),
+ content.getAuthors().get(0).getShortName());
// final String currentContent = wavelet.getRootBlip().getContent();
state.setContent(renderedWaves.getOrRender(wavelet));
@@ -126,12 +129,18 @@ public StateContent create(final User userLogged, final Content content) {
state.setIsParticipant(userLogged != User.UNKNOWN_USER ? kuneWaveService.isParticipant(wavelet,
userLogged.getShortName()) : false);
} catch (final Exception e) {
- LOG.error("Error accessing wave " + waveId, e);
+ LOG.error("Error accessing wave " + waveRef, e);
+ String waveUrl = null;
+ try {
+ waveUrl = TextUtils.generateHtmlLink(
+ JavaWaverefEncoder.encodeToUriPathSegment(JavaWaverefEncoder.decodeWaveRefFromPath(waveRef)),
+ waveRef, false);
+ } catch (final InvalidWaveRefException invalidEx) {
+ }
state.setContent(i18n.t("Error accessing this document. "
+ "Please contact the administrators providing this reference ([%s]) "
- + "and any other relevant info.", waveId));
+ + "and any other relevant info.", (waveUrl == null ? waveRef : waveUrl)));
state.setTitle(revision.getTitle());
- // throw new DefaultException("Error retriving Wave");
}
} else {
state.setContent(textBody);
diff --git a/src/main/java/cc/kune/docs/client/actions/DelDocMenuItem.java b/src/main/java/cc/kune/docs/client/actions/DelDocMenuItem.java
index fc330b872..91c6c7a68 100644
--- a/src/main/java/cc/kune/docs/client/actions/DelDocMenuItem.java
+++ b/src/main/java/cc/kune/docs/client/actions/DelDocMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContentMenuItem;
+import cc.kune.gspace.client.actions.DelContentForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelDocMenuItem extends DelContentMenuItem {
+public class DelDocMenuItem extends DelContentForEditorsMenuItem {
@Inject
- public DelDocMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
+ public DelDocMenuItem(final I18nTranslationService i18n, final DelContentForEditorsAction action, final CoreResources res) {
super(i18n, action, res);
}
}
diff --git a/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java b/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java
index 9e009b944..09c10ea90 100644
--- a/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java
+++ b/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContainerMenuItem;
+import cc.kune.gspace.client.actions.DelContainerForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelFolderMenuItem extends DelContainerMenuItem {
+public class DelFolderMenuItem extends DelContainerForEditorsMenuItem {
@Inject
- public DelFolderMenuItem(final I18nTranslationService i18n, final DelContainerAction action, final CoreResources res) {
+ public DelFolderMenuItem(final I18nTranslationService i18n, final DelContainerForEditorAction action, final CoreResources res) {
super(i18n, action, res);
}
diff --git a/src/main/java/cc/kune/events/client/actions/DelMeetingMenuItem.java b/src/main/java/cc/kune/events/client/actions/DelMeetingMenuItem.java
index 6150b6c2a..97780ed1a 100644
--- a/src/main/java/cc/kune/events/client/actions/DelMeetingMenuItem.java
+++ b/src/main/java/cc/kune/events/client/actions/DelMeetingMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContentMenuItem;
+import cc.kune.gspace.client.actions.DelContentForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelMeetingMenuItem extends DelContentMenuItem {
+public class DelMeetingMenuItem extends DelContentForEditorsMenuItem {
@Inject
- public DelMeetingMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
+ public DelMeetingMenuItem(final I18nTranslationService i18n, final DelContentForEditorsAction action, final CoreResources res) {
super(i18n, action, res);
}
}
diff --git a/src/main/java/cc/kune/events/server/EventsServerTool.java b/src/main/java/cc/kune/events/server/EventsServerTool.java
index 12e06d2f8..04982fbd6 100644
--- a/src/main/java/cc/kune/events/server/EventsServerTool.java
+++ b/src/main/java/cc/kune/events/server/EventsServerTool.java
@@ -19,8 +19,8 @@
*/
package cc.kune.events.server;
-import static cc.kune.events.shared.EventsToolConstants.TOOL_NAME;
import static cc.kune.events.shared.EventsToolConstants.ROOT_NAME;
+import static cc.kune.events.shared.EventsToolConstants.TOOL_NAME;
import static cc.kune.events.shared.EventsToolConstants.TYPE_MEETING;
import static cc.kune.events.shared.EventsToolConstants.TYPE_ROOT;
@@ -95,6 +95,7 @@ protected void setContainerAcl(final Container container) {
meetsAcl.getAdmins().setMode(GroupListMode.NORMAL);
meetsAcl.getAdmins().add(container.getOwner());
meetsAcl.getEditors().setMode(GroupListMode.NORMAL);
+ meetsAcl.getEditors().add(container.getOwner());
meetsAcl.getViewers().setMode(GroupListMode.EVERYONE);
setAccessList(container, meetsAcl);
}
diff --git a/src/main/java/cc/kune/events/server/EventsServlet.java b/src/main/java/cc/kune/events/server/EventsServlet.java
index 8362d0fa8..e86cca720 100644
--- a/src/main/java/cc/kune/events/server/EventsServlet.java
+++ b/src/main/java/cc/kune/events/server/EventsServlet.java
@@ -109,7 +109,6 @@ protected void doGet(final HttpServletRequest req, final HttpServletResponse res
final OutputStream out = resp.getOutputStream();
final CalendarOutputter outputter = new CalendarOutputter();
outputter.output(calendar, out);
-
} catch (final ContentNotFoundException e) {
return404(resp);
return;
diff --git a/src/main/java/cc/kune/gspace/client/actions/DelContainerForAdminsMenuItem.java b/src/main/java/cc/kune/gspace/client/actions/DelContainerForAdminsMenuItem.java
new file mode 100644
index 000000000..e28a085ea
--- /dev/null
+++ b/src/main/java/cc/kune/gspace/client/actions/DelContainerForAdminsMenuItem.java
@@ -0,0 +1,60 @@
+/*
+ *
+ * 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 .
+ *
+ */
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.AbstractContentSimpleDTO;
+import cc.kune.core.shared.dto.AccessRolDTO;
+
+import com.google.inject.Inject;
+
+public class DelContainerForAdminsMenuItem extends MenuItemDescriptor {
+
+ public static class DelContainerForAdminsAction extends RolAction {
+
+ private final ContentServiceHelper contentService;
+
+ @Inject
+ public DelContainerForAdminsAction(final ContentServiceHelper contentService) {
+ super(AccessRolDTO.Administrator, true);
+ this.contentService = contentService;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ final StateToken token = ((AbstractContentSimpleDTO) event.getTarget()).getStateToken();
+ contentService.delContent(token);
+ }
+
+ }
+
+ public DelContainerForAdminsMenuItem(final I18nTranslationService i18n,
+ final DelContainerForAdminsAction action, final CoreResources res) {
+ super(action);
+ this.withText(i18n.t("Delete")).withIcon(res.cancel());
+ }
+
+}
diff --git a/src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java b/src/main/java/cc/kune/gspace/client/actions/DelContainerForEditorsMenuItem.java
similarity index 84%
rename from src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java
rename to src/main/java/cc/kune/gspace/client/actions/DelContainerForEditorsMenuItem.java
index fde7e8467..5312ca92a 100644
--- a/src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java
+++ b/src/main/java/cc/kune/gspace/client/actions/DelContainerForEditorsMenuItem.java
@@ -31,14 +31,14 @@
import com.google.inject.Inject;
-public class DelContainerMenuItem extends MenuItemDescriptor {
+public class DelContainerForEditorsMenuItem extends MenuItemDescriptor {
- public static class DelContainerAction extends RolAction {
+ public static class DelContainerForEditorAction extends RolAction {
private final ContentServiceHelper contentService;
@Inject
- public DelContainerAction(final ContentServiceHelper contentService) {
+ public DelContainerForEditorAction(final ContentServiceHelper contentService) {
super(AccessRolDTO.Editor, true);
this.contentService = contentService;
}
@@ -51,7 +51,7 @@ public void actionPerformed(final ActionEvent event) {
}
- public DelContainerMenuItem(final I18nTranslationService i18n, final DelContainerAction action,
+ public DelContainerForEditorsMenuItem(final I18nTranslationService i18n, final DelContainerForEditorAction action,
final CoreResources res) {
super(action);
this.withText(i18n.t("Delete")).withIcon(res.cancel());
diff --git a/src/main/java/cc/kune/gspace/client/actions/DelContentForAdminsMenuItem.java b/src/main/java/cc/kune/gspace/client/actions/DelContentForAdminsMenuItem.java
new file mode 100644
index 000000000..b7ea933a9
--- /dev/null
+++ b/src/main/java/cc/kune/gspace/client/actions/DelContentForAdminsMenuItem.java
@@ -0,0 +1,59 @@
+/*
+ *
+ * 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 .
+ *
+ */
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
+import cc.kune.core.shared.dto.AbstractContentSimpleDTO;
+import cc.kune.core.shared.dto.AccessRolDTO;
+
+import com.google.inject.Inject;
+
+public class DelContentForAdminsMenuItem extends MenuItemDescriptor {
+
+ public static class DelContentForAdminsAction extends RolAction {
+
+ private final ContentServiceHelper contentService;
+
+ @Inject
+ public DelContentForAdminsAction(final ContentServiceHelper contentService) {
+ super(AccessRolDTO.Administrator, true);
+ this.contentService = contentService;
+
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ contentService.delContent(((AbstractContentSimpleDTO) event.getTarget()).getStateToken());
+ }
+
+ }
+
+ public DelContentForAdminsMenuItem(final I18nTranslationService i18n,
+ final DelContentForAdminsAction action, final CoreResources res) {
+ super(action);
+ this.withText(i18n.t("Delete")).withIcon(res.cancel());
+ }
+
+}
diff --git a/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java b/src/main/java/cc/kune/gspace/client/actions/DelContentForEditorsMenuItem.java
similarity index 83%
rename from src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java
rename to src/main/java/cc/kune/gspace/client/actions/DelContentForEditorsMenuItem.java
index d32f4fde6..caebf0b5d 100644
--- a/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java
+++ b/src/main/java/cc/kune/gspace/client/actions/DelContentForEditorsMenuItem.java
@@ -30,14 +30,14 @@
import com.google.inject.Inject;
-public class DelContentMenuItem extends MenuItemDescriptor {
+public class DelContentForEditorsMenuItem extends MenuItemDescriptor {
- public static class DelContentAction extends RolAction {
+ public static class DelContentForEditorsAction extends RolAction {
private final ContentServiceHelper contentService;
@Inject
- public DelContentAction(final ContentServiceHelper contentService) {
+ public DelContentForEditorsAction(final ContentServiceHelper contentService) {
super(AccessRolDTO.Editor, true);
this.contentService = contentService;
@@ -50,7 +50,7 @@ public void actionPerformed(final ActionEvent event) {
}
- public DelContentMenuItem(final I18nTranslationService i18n, final DelContentAction action,
+ public DelContentForEditorsMenuItem(final I18nTranslationService i18n, final DelContentForEditorsAction action,
final CoreResources res) {
super(action);
this.withText(i18n.t("Delete")).withIcon(res.cancel());
diff --git a/src/main/java/cc/kune/lists/client/ListsClientTool.java b/src/main/java/cc/kune/lists/client/ListsClientTool.java
index d87356e8f..88b3765c4 100644
--- a/src/main/java/cc/kune/lists/client/ListsClientTool.java
+++ b/src/main/java/cc/kune/lists/client/ListsClientTool.java
@@ -19,8 +19,8 @@
*/
package cc.kune.lists.client;
-import static cc.kune.lists.shared.ListsToolConstants.TOOL_NAME;
import static cc.kune.lists.shared.ListsToolConstants.ROOT_NAME;
+import static cc.kune.lists.shared.ListsToolConstants.TOOL_NAME;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_LIST;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_POST;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_ROOT;
diff --git a/src/main/java/cc/kune/lists/client/actions/DelListMenuItem.java b/src/main/java/cc/kune/lists/client/actions/DelListMenuItem.java
index 628a128eb..2ed09735d 100644
--- a/src/main/java/cc/kune/lists/client/actions/DelListMenuItem.java
+++ b/src/main/java/cc/kune/lists/client/actions/DelListMenuItem.java
@@ -21,15 +21,16 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContainerMenuItem;
+import cc.kune.gspace.client.actions.DelContainerForAdminsMenuItem;
import com.google.inject.Inject;
-public class DelListMenuItem extends DelContainerMenuItem {
+public class DelListMenuItem extends DelContainerForAdminsMenuItem {
- @Inject
- public DelListMenuItem(final I18nTranslationService i18n, final DelContainerAction action, final CoreResources res) {
- super(i18n, action, res);
- }
+ @Inject
+ public DelListMenuItem(final I18nTranslationService i18n, final DelContainerForAdminsAction action,
+ final CoreResources res) {
+ super(i18n, action, res);
+ }
}
diff --git a/src/main/java/cc/kune/lists/client/actions/DelPostMenuItem.java b/src/main/java/cc/kune/lists/client/actions/DelPostMenuItem.java
index 077427593..cecdc707f 100644
--- a/src/main/java/cc/kune/lists/client/actions/DelPostMenuItem.java
+++ b/src/main/java/cc/kune/lists/client/actions/DelPostMenuItem.java
@@ -21,14 +21,15 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContentMenuItem;
+import cc.kune.gspace.client.actions.DelContentForAdminsMenuItem;
import com.google.inject.Inject;
-public class DelPostMenuItem extends DelContentMenuItem {
+public class DelPostMenuItem extends DelContentForAdminsMenuItem {
- @Inject
- public DelPostMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
- super(i18n, action, res);
- }
+ @Inject
+ public DelPostMenuItem(final I18nTranslationService i18n, final DelContentForAdminsAction action,
+ final CoreResources res) {
+ super(i18n, action, res);
+ }
}
diff --git a/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java b/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java
index 8b7bb2d36..5a3a30ac1 100644
--- a/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java
+++ b/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java
@@ -89,6 +89,7 @@ public ListsClientActions(final I18nUITranslationService i18n, final Session ses
final Provider writeToParticipants, final ListsNewMenu listNewMenu,
final PostNewMenu postNewMenu, final NewMenusForTypeIdsRegistry newMenusRegistry,
final Provider chatAbout, final Provider delFolderMenuItem,
+ final Provider delPostMenuItem,
final Provider setAsHomePage) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContainer, containers);
@@ -120,6 +121,7 @@ public ListsClientActions(final I18nUITranslationService i18n, final Session ses
actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, contents);
actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delPostMenuItem, contents);
actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAllMenuItem, contents);
actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
diff --git a/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java b/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
index 70cdad78d..f21540dbe 100644
--- a/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
+++ b/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
@@ -56,7 +56,7 @@ public ListsRPC(final ContentRPC contentRPC, final UserSessionManager userSessio
}
private String composeListName(final StateToken parentToken, final String listname) {
- // FIXME In the future use tabs here
+ // FIXME In the future use tags here
return parentToken.getGroup() + "-" + listname;
}
@@ -65,9 +65,9 @@ private String composeListName(final StateToken parentToken, final String listna
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.container)
@KuneTransactional
public StateContainerDTO createList(final String userHash, final StateToken parentToken,
- final String listaName, final String description, final boolean isPublic) {
+ final String listName, final String description, final boolean isPublic) {
final StateContainerDTO result = contentRPC.addFolder(userHash, parentToken,
- composeListName(parentToken, listaName), ListsToolConstants.TYPE_LIST);
+ composeListName(parentToken, listName), ListsToolConstants.TYPE_LIST);
// Not public list, don't permit subscriptions neither view posts
return contentRPC.getState(setContainerAcl(result.getStateToken(), isPublic));
}
diff --git a/src/main/java/cc/kune/tasks/client/actions/DelFolderMenuItem.java b/src/main/java/cc/kune/tasks/client/actions/DelFolderMenuItem.java
index 7c25007a8..f8d931b19 100644
--- a/src/main/java/cc/kune/tasks/client/actions/DelFolderMenuItem.java
+++ b/src/main/java/cc/kune/tasks/client/actions/DelFolderMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContainerMenuItem;
+import cc.kune.gspace.client.actions.DelContainerForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelFolderMenuItem extends DelContainerMenuItem {
+public class DelFolderMenuItem extends DelContainerForEditorsMenuItem {
@Inject
- public DelFolderMenuItem(final I18nTranslationService i18n, final DelContainerAction action, final CoreResources res) {
+ public DelFolderMenuItem(final I18nTranslationService i18n, final DelContainerForEditorAction action, final CoreResources res) {
super(i18n, action, res);
}
diff --git a/src/main/java/cc/kune/tasks/client/actions/DelTaskMenuItem.java b/src/main/java/cc/kune/tasks/client/actions/DelTaskMenuItem.java
index 483ed58c2..4f214f9be 100644
--- a/src/main/java/cc/kune/tasks/client/actions/DelTaskMenuItem.java
+++ b/src/main/java/cc/kune/tasks/client/actions/DelTaskMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContentMenuItem;
+import cc.kune.gspace.client.actions.DelContentForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelTaskMenuItem extends DelContentMenuItem {
+public class DelTaskMenuItem extends DelContentForEditorsMenuItem {
@Inject
- public DelTaskMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
+ public DelTaskMenuItem(final I18nTranslationService i18n, final DelContentForEditorsAction action, final CoreResources res) {
super(i18n, action, res);
}
}
diff --git a/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java b/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java
index f071491dc..fa36cde69 100644
--- a/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java
+++ b/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java
@@ -233,6 +233,8 @@ public int compare(Conversation o1, Conversation o2) {
};
BlipMetaViewBuilder metaUi = BlipMetaViewBuilder.create(viewIdMapper.metaOf(blip), document);
+ if (blip.isRoot())
+ metaUi.disable(BlipMetaViewBuilder.DELETE_MENU_OPTIONS_SET);
blipPopulator.render(blip, metaUi);
return BlipViewBuilder.create(viewIdMapper.blipOf(blip), metaUi, threadsUi, convsUi);
diff --git a/src/main/java/cc/kune/wave/server/CustomGadgetProviderServlet.java b/src/main/java/cc/kune/wave/server/CustomGadgetProviderServlet.java
new file mode 100644
index 000000000..05126c977
--- /dev/null
+++ b/src/main/java/cc/kune/wave/server/CustomGadgetProviderServlet.java
@@ -0,0 +1,83 @@
+/**
+ * Copyright 2012 Apache Wave
+ *
+ * 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.wave.server;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.inject.Singleton;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.waveprotocol.box.server.CoreSettings;
+import org.waveprotocol.box.server.persistence.file.FileAccountStore;
+
+import cc.kune.core.server.manager.file.FileDownloadManagerUtils;
+
+import com.google.common.base.Function;
+import com.google.common.collect.MapMaker;
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+
+/**
+ * The servlet for fetching available gadgets from a json file on the server.
+ */
+@SuppressWarnings("serial")
+@Singleton
+public class CustomGadgetProviderServlet extends HttpServlet {
+
+ private static final Logger LOG = Logger.getLogger(FileAccountStore.class.getName());
+ private final ConcurrentMap jsonCache;
+
+ @Inject
+ public CustomGadgetProviderServlet(@Named(CoreSettings.RESOURCE_BASES) final List resourceBases) {
+ jsonCache = new MapMaker().expireAfterWrite(5, TimeUnit.MINUTES).makeComputingMap(
+ new Function() {
+ @Override
+ public String apply(final String key) {
+ String jsonString = "";
+ try {
+ jsonString = FileDownloadManagerUtils.getInpuStreamAsString(FileDownloadManagerUtils.getInputStreamInResourceBases(
+ resourceBases, "/others/jsongadgets.json"));
+ } catch (final IOException e) {
+ LOG.log(Level.WARNING, "Error while loading gadgets json", e);
+ }
+ return jsonString;
+ }
+ });
+ }
+
+ @Override
+ protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
+ throws IOException {
+ final String jsonString = jsonCache.get("");
+ if (jsonString.equals("")) {
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
+ "Error loading json data from file");
+ } else {
+ final PrintWriter out = response.getWriter();
+ out.print(jsonCache.get(""));
+ out.flush();
+ }
+ }
+}
diff --git a/src/main/java/cc/kune/wave/server/WaveMain.java b/src/main/java/cc/kune/wave/server/WaveMain.java
index 6baf542ed..4c5cc88bc 100644
--- a/src/main/java/cc/kune/wave/server/WaveMain.java
+++ b/src/main/java/cc/kune/wave/server/WaveMain.java
@@ -159,8 +159,8 @@ public static void run(Module coreSettings) throws PersistenceException,
PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class);
Injector injector =
settingsInjector.createChildInjector(new ServerModule(enableFederation, listenerCount,
- waveletLoadCount, deltaPersistCount),
- new RobotApiModule(), federationModule, persistenceModule);
+ waveletLoadCount, deltaPersistCount), new RobotApiModule(), federationModule,
+ persistenceModule);
ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class);
WaveBus waveBus = injector.getInstance(WaveBus.class);
@@ -211,6 +211,7 @@ private static void initializeServer(Injector injector, String waveDomain)
}
private static void initializeServlets(Injector injector, ServerRpcProvider server) {
+ server.addServlet("/gadget/gadgetlist", injector.getInstance(CustomGadgetProviderServlet.class));
server.addServlet("/attachment/*", injector.getInstance(AttachmentServlet.class));
server.addServlet(SessionManager.SIGN_IN_URL, injector.getInstance(AuthenticationServlet.class));
diff --git a/src/main/java/cc/kune/wiki/client/actions/DelFolderMenuItem.java b/src/main/java/cc/kune/wiki/client/actions/DelFolderMenuItem.java
index dd73218de..8ab47d6f8 100644
--- a/src/main/java/cc/kune/wiki/client/actions/DelFolderMenuItem.java
+++ b/src/main/java/cc/kune/wiki/client/actions/DelFolderMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContainerMenuItem;
+import cc.kune.gspace.client.actions.DelContainerForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelFolderMenuItem extends DelContainerMenuItem {
+public class DelFolderMenuItem extends DelContainerForEditorsMenuItem {
@Inject
- public DelFolderMenuItem(final I18nTranslationService i18n, final DelContainerAction action, final CoreResources res) {
+ public DelFolderMenuItem(final I18nTranslationService i18n, final DelContainerForEditorAction action, final CoreResources res) {
super(i18n, action, res);
}
diff --git a/src/main/java/cc/kune/wiki/client/actions/DelWikiMenuItem.java b/src/main/java/cc/kune/wiki/client/actions/DelWikiMenuItem.java
index 2119a8cc8..f1d753121 100644
--- a/src/main/java/cc/kune/wiki/client/actions/DelWikiMenuItem.java
+++ b/src/main/java/cc/kune/wiki/client/actions/DelWikiMenuItem.java
@@ -21,14 +21,14 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.actions.DelContentMenuItem;
+import cc.kune.gspace.client.actions.DelContentForEditorsMenuItem;
import com.google.inject.Inject;
-public class DelWikiMenuItem extends DelContentMenuItem {
+public class DelWikiMenuItem extends DelContentForEditorsMenuItem {
@Inject
- public DelWikiMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
+ public DelWikiMenuItem(final I18nTranslationService i18n, final DelContentForEditorsAction action, final CoreResources res) {
super(i18n, action, res);
}
}
diff --git a/src/main/webapp/others/jsongadgets.json b/src/main/webapp/others/jsongadgets.json
new file mode 100644
index 000000000..ce77ff060
--- /dev/null
+++ b/src/main/webapp/others/jsongadgets.json
@@ -0,0 +1,550 @@
+[
+{"name":"MindMap ConceptDraw",
+"desc":"ConceptDraw MINDMAP offers a variety of presentation, input, and output solutions that make creating and sharing map content simple and effective.",
+"primaryCategory":"PRODUCTIVITY",
+"secondaryCategory":"TEAM",
+"gadgetUrl":"http://goo.gl/m7HXR",
+"author":"ConceptDraw",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Map",
+"desc":"Collaborate on a map of placemarks, paths, and shapes with other participants. Great for planning events and trips.",
+"primaryCategory":"MAP",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/0YlHY",
+"author":"Google",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Map Cluster",
+"desc":"Add your location to the map, and see where everyone else is from, using a cluster visualization.",
+"primaryCategory":"MAP",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/TE5LJ",
+"author":"Google",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Yes/No/Mini",
+"desc":"A miniature version of the Yes/No/Maybe gadget.",
+"primaryCategory":"VOTING",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/WnAkm",
+"author":"Zachary 'Gamer_Z.' Yaro",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Yes/No/Maybe/+",
+"desc":"Same as Google's Yes/No/Maybe, only you can edit the titles and add new ones.",
+"primaryCategory":"VOTING",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/fydAe",
+"author":"everybodywave",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Yes/No/Maybe",
+"desc":"Use this to ask friends if they want to join you for a party, to get their opinion on a topic, or even to petition their support for a movement.",
+"primaryCategory":"VOTING",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/24YOf",
+"author":"everybodywave",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Code Snippet",
+"desc":"Paste and edit snippets of code within your waves, including syntax highlighting for over 20 languages. Uses SyntaxHighlighter by Alex Gorbatchev.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/0cQcc",
+"author":" Harry Denholm, Ishani.org",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Image",
+"desc":"Lets you insert, resize and annotate any image from the web.",
+"primaryCategory":"IMAGE",
+"secondaryCategory":"UTILITY",
+"gadgetUrl":"http://goo.gl/wCw4o",
+"author":"everybodywave",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"WaveTube",
+"desc":"A collaborative YouTube player for Wave.",
+"primaryCategory":"VIDEO",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/4k9f3",
+"author":"everybodywave",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Napkin",
+"desc":"The Napkin Gadget is a blank canvas for collaborative doodling.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/FMBPf",
+"author":"Marcin Szczepanski",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"HTML",
+"desc":"Insert HTML code directly in to a wave.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/bN5AD",
+"author":"MBTE Sweden AB",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"iFrame",
+"desc":"Insert IFRAME directly in to a wave.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/jvA7z",
+"author":"MBTE Sweden AB",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"iFrame - no borders",
+"desc":"Insert iFrame DISCRETLY into a wave.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/z46Sg",
+"author":"Pooja Srinivas",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"No Edit",
+"desc":"Kindly readers to not edit your blip.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/0gEjd",
+"author":"everybodywave",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"No Edit - with no text",
+"desc":"DISCRETLY prevent the edition of your blip.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/cNgLA",
+"author":"Pooja Srinivas",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Word Cloud",
+"desc":"Add words and ideas into a collaborative word cloud.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/juj3U",
+"author":"everybodywave",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Views tracker",
+"desc":"A small gadget that when added to a wave tracks wave views. You can display the number of views with Views Display gadget.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/wIQKU",
+"author":"Yuri Zelikov ",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Views display",
+"desc":"A display for the views tracker gadget. When added to a wave with the tracker gadget - displays how many times the wave was viewed.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/hPDJD",
+"author":"Yuri ",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Like Button",
+"desc":"A like button similar to those in Google Reader, Google Buzz, and other Google products.",
+"primaryCategory":"VOTING",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/7wkly",
+"author":"Zachary 'Gamer_Z.' Yaro",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Pinwand",
+"desc":"Collaborate on a virtual pinwand. Add text, images, video, comments and many more.",
+"primaryCategory":"OTHER",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/0PmBc",
+"author":"Michael Hielscher",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"I Like It!",
+"desc":"Adds a favorites button to your wave, so that you and everyone else in the wave can indicate that they like the wave - with a cute smiley face!",
+"primaryCategory":"VOTING",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/aXybB",
+"author":"Jaken",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Diagram Editor",
+"desc":"Create cool diagrams (UML, BPMN, EPC, FMC, etc.) together with your friends in Google Wave!",
+"primaryCategory":"PRODUCTIVITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/HvuA4",
+"author":"processWave.org",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Word Network",
+"desc":"Collaborate on a linking words together and organizing concepts. Double Click on any word to link it to another or double click on the background to c...",
+"primaryCategory":"PRODUCTIVITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/6vwxY",
+"author":"antimatter15",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Google Fight!",
+"desc":"Google Fights - the title should explain it all. Another gadget by www.processWave.org.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/Mg26y",
+"author":"Michael Goderbauer",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Poll",
+"desc":"Poll participants for their opinion. Supports both single and multiple selection polls, and optionally allows votes to be changed after they're cast.",
+"primaryCategory":"VOTING",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/0G7qU",
+"author":"Eric Williams",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Chart",
+"desc":"Lets you insert various charts into wave.",
+"primaryCategory":"PRODUCTIVITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/Tb7Q3",
+"author":"everybodywave",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Retro Chat",
+"desc":"Chat room gadget for old-fashioned IMing in Wave.",
+"primaryCategory":"PRODUCTIVITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/AW0Vm",
+"author":"Charles Lehner",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Picasa",
+"desc":"Add a Picasa photo album to a wave.",
+"primaryCategory":"IMAGE",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/NUYIs",
+"author":"Genliang Guan, University of Sydney",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Goo.gl URL Shortener",
+"desc":"Shorten url with goo.gl, the new Google url shortener.(http://goo.gl/)",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/oRonD",
+"author":"haru1ban",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"PacMan",
+"desc":"Play Pacman inside a Wave.",
+"primaryCategory":"GAME",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/RFzqt",
+"author":"www.schulz.dk",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Sudoku",
+"desc":"A cool game to share with your friends. Solve challenging Sudoku boards together and see who is the best Sudoku player!",
+"primaryCategory":"GAME",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/FxORa",
+"author":"LabPixies",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"AccuWeather",
+"desc":"The AccuWeather Wave Gadget is the perfect companion for trip planning. Select a location and date, and the gadget will return a forecast.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/iODX9",
+"author":"AccuWeather.com",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Decing",
+"desc":"Need to make a decision? Arrange a secret vote inside of a wave. Participants' votes are not shared to others.",
+"primaryCategory":"VOTING",
+"secondaryCategory":"TEAM",
+"gadgetUrl":"http://goo.gl/MghBe",
+"author":"Decing.com",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Grocery List",
+"desc":"Use this for your grocery list needs - share with your family, sort the list automatically, print and take it to the store, and more!",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/kna0V",
+"author":"Quaker",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Likey",
+"desc":"A simple like/dislike Wave gadget that can be added to a blip for intuitive user rating.",
+"primaryCategory":"VOTING",
+"secondaryCategory":"PRODUCTIVITY",
+"gadgetUrl":"http://goo.gl/KrlJE",
+"author":"Ben Griffiths",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Paginator",
+"desc":"The Paginator is a compact reading aid Gadget for Google Wave which paginates large amounts of text and bookmarks the wave viewer's current location",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"PRODUCTIVITY",
+"gadgetUrl":"http://goo.gl/Ol9GW",
+"author":"Dan Smith",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Piano",
+"desc":"A real-time piano gadget.",
+"primaryCategory":"MUSIC",
+"secondaryCategory":"GAME",
+"gadgetUrl":"http://goo.gl/x9vHX",
+"author":"everybodywave",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Team ",
+"desc":"Lets you create a list of wave participants in a particular order.",
+"primaryCategory":"TEAM",
+"secondaryCategory":"PRODUCTIVITY",
+"gadgetUrl":"http://goo.gl/VJnId",
+"author":"everybodywave",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Vector Editor",
+"desc":"This gadget is useful for creating graphics. Shapes can be added, resized, moved, and rotated. The application supports Lines, Freeform, Polygons, Rec...",
+"primaryCategory":"PRODUCTIVITY",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/VSkn5",
+"author":"antimatter15",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Ratings",
+"desc":"Add your vote from 1-5 stars, and see the total votes from others.",
+"primaryCategory":"VOTING",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/uQ9vi",
+"author":"Google",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Colcrop",
+"desc":"Cover as many cells as possible, by choosing adjacent colors. Play against a participant or the computer. Computer Level 4 is pretty hard to defeat.",
+"primaryCategory":"GAME",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/Vh9ME",
+"author":"Alexis Vuillemin",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"Bones",
+"desc":"Bones provides graphical dice that any participant in a wave can set up to be rolled by themselves or others. Results are shared with everyone.",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"TEAM",
+"gadgetUrl":"http://goo.gl/GbhWR",
+"author":"10x10 Room",
+"submittedBy":"Jeremy",
+"imageUrl":""},
+
+{"name":"lmnowave",
+"desc":"Solve crossword puzzles with friends in Google Wave.",
+"primaryCategory":"GAME",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/heXs7",
+"author":"Dan Vanderkam",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"FlickrWave",
+"desc":"Display individual Flickr photos or browse photos from a user's stream, favorites, a photoset or a group.",
+"primaryCategory":"IMAGE",
+"secondaryCategory":"VIDEO",
+"gadgetUrl":"http://goo.gl/OSEZF",
+"author":"Mark Probst",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Verbol VoiceChat",
+"desc":"Lets you record any thoughts you have into the wave, listen to what others are saying or have said, and reply to them. V3.12.3.",
+"primaryCategory":"VOICE",
+"secondaryCategory":"PRODUCTIVITY",
+"gadgetUrl":"http://goo.gl/Iklq2",
+"author":"Family Systems and PhoneFromHere",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Scrumpoker",
+"desc":"ScrumPoker for consensus-based estimation.",
+"primaryCategory":"PRODUCTIVITY",
+"secondaryCategory":"TEAM",
+"gadgetUrl":"http://goo.gl/JuBfO",
+"author":"MasteringWave",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Hostel WithMe",
+"desc":"In partnership with HostelWorld.com. Find the best budget accommodation together with your friends.",
+"primaryCategory":"TRAVEL",
+"secondaryCategory":"SEARCH",
+"gadgetUrl":"http://goo.gl/pXAkD",
+"author":"rucksack.com",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Take-Out",
+"desc":"Helps organize take-out orders for a group. Great for coordinating food or coffee runs for your office!",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"TEAM",
+"gadgetUrl":"http://goo.gl/4yFIQ",
+"author":"Kip Holcomb",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Travel WithMe",
+"desc":"Travel WithMe allows groups of people to plan trips together in real time.",
+"primaryCategory":"TRAVEL",
+"secondaryCategory":"TEAM",
+"gadgetUrl":"http://goo.gl/fdpJO",
+"author":"rucksack.com",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Twitter Search",
+"desc":"Shows results from Twitter for a given search term. Users can edit to specify new term.",
+"primaryCategory":"SEARCH",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/1U79x",
+"author":"Google",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Waffle",
+"desc":"The easy way to plan an event. Just add a Waffle to your wave, choose a few dates - now, all wave participants can vote immediately!",
+"primaryCategory":"SEARCH",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/VsXSf",
+"author":"Mikkel Staunsholm (www.waffle.dk)",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Trippy",
+"desc":"Co-create an itinerary: choose points of interest -- including Lonely Planet recommendations, organize, share, print, or export to My Maps!",
+"primaryCategory":"TRAVEL",
+"secondaryCategory":"TEAM",
+"gadgetUrl":"http://goo.gl/HgDlU",
+"author":"Lonely Planet",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Conference",
+"desc":"Click to insert a Ribbit Conference gadget to your toolbar.",
+"primaryCategory":"VOICE",
+"secondaryCategory":"PRODUCTIVITY",
+"gadgetUrl":"http://goo.gl/UVZ4i",
+"author":"Ribbit Corporation",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"TimeBridge Conferencing",
+"desc":"Instantly add phone and web conferencing to your wave with the TimeBridge Conferencing Gadget. Just plug the gadget into your wave and go!",
+"primaryCategory":"VOICE",
+"secondaryCategory":"PRODUCTIVITY",
+"gadgetUrl":"http://goo.gl/FPVh7",
+"author":"Ribbit Corporation",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Plus One",
+"desc":"A small, simple gadget to collect votes. Use it to rate anything!",
+"primaryCategory":"VOTING",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/aDH3v",
+"author":"Peter Frost",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Time-Me!",
+"desc":"A stopwatch with support for multiple split-times!",
+"primaryCategory":"TIME",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/Zm3ch",
+"author":"Owl Order",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Time-manager",
+"desc":"Insert a small timer into your waves. Click on it to start/stop counting. Total time will be saved.",
+"primaryCategory":"TIME",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://goo.gl/48odp",
+"author":"Fedor Indutny",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"When do we meet?",
+"desc":"Find a date for a business meeting, party, or vacation by collaboratively marking each participant's free days in a shared calendar.",
+"primaryCategory":"TIME",
+"secondaryCategory":"TEAM",
+"gadgetUrl":"http://goo.gl/qQ7n0",
+"author":"Robert Bamler",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"List",
+"desc":"Insert little tables inside your wavelet. You can extend the columns, make them sorted, etc...",
+"primaryCategory":"UTILITY",
+"secondaryCategory":"PRODUCTIVITY",
+"gadgetUrl":"http://goo.gl/O6swn",
+"author":"Teun Duynstee",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"FavJumpr",
+"desc":"A little Flickr game where you have to jump from one's user's favorites to another's by selecting the one you like best.",
+"primaryCategory":"GAME",
+"secondaryCategory":"IMAGE",
+"gadgetUrl":"http://goo.gl/DVySN",
+"author":"Mark Probst",
+"submittedBy":"Yuri",
+"imageUrl":""},
+
+{"name":"Wave Chess",
+"desc":"Play Chess in Google Wave.",
+"primaryCategory":"GAME",
+"secondaryCategory":"OTHER",
+"gadgetUrl":"http://wave-chess.appspot.com/wavechess/com.google.wave.chess.client.ChessGadget.gadget.xml",
+"author":"Google",
+"submittedBy":"Yuri",
+"imageUrl":""}
+ ]
\ No newline at end of file
diff --git a/src/test/java/cc/kune/common/shared/utils/TextUtilsTest.java b/src/test/java/cc/kune/common/shared/utils/TextUtilsTest.java
new file mode 100644
index 000000000..430159e58
--- /dev/null
+++ b/src/test/java/cc/kune/common/shared/utils/TextUtilsTest.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * Copyright (C) 2007-2012 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 .
+ *
+ */
+
+package cc.kune.common.shared.utils;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class TextUtilsTest {
+
+ private static final String DOMAIN_REGEXP = "^http([s]|)://localhost/.*";
+
+ @Test
+ public void testUrlDomain() {
+ assertTrue("http://localhost/kk".matches(DOMAIN_REGEXP));
+ assertTrue("https://localhost/kk".matches(DOMAIN_REGEXP));
+ assertFalse("http://localhost:9898/kk".matches(DOMAIN_REGEXP));
+ assertFalse("http://localhost".matches(DOMAIN_REGEXP));
+ assertFalse("ftp://localhost/kk".matches(DOMAIN_REGEXP));
+ }
+}
diff --git a/src/test/java/cc/kune/core/server/integration/IntegrationTest.java b/src/test/java/cc/kune/core/server/integration/IntegrationTest.java
index 2e7ca0c54..f2877ae70 100644
--- a/src/test/java/cc/kune/core/server/integration/IntegrationTest.java
+++ b/src/test/java/cc/kune/core/server/integration/IntegrationTest.java
@@ -59,7 +59,7 @@ protected String doLoginWithDummyUser() throws DefaultException, IOException {
@After
public void doLogout() throws DefaultException {
- if (session.isUserLoggedIn()) {
+ if (session != null && session.isUserLoggedIn()) {
session.logout();
}
}
diff --git a/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java b/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java
index ad104bb69..57b701f66 100644
--- a/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java
+++ b/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java
@@ -74,20 +74,20 @@ public void addAndDelMainParticipant() throws IOException {
doLogin();
createTestWave(new SimpleArgCallback() {
@Override
- public void onCallback(final WaveRef waveletName) {
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), NEW_PARTICIPANT);
+ public void onCallback(final WaveRef waveRef) {
+ assertNotNull(waveRef);
+ manager.addParticipants(waveRef, getSiteAdminShortName(), NEW_PARTICIPANT);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ final Wavelet fetchWavelet = manager.fetchWave(waveRef, 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());
+ manager.delParticipants(waveRef, 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, "");
+ final Wavelet fetchedAfterDeleted = manager.fetchWave(waveRef, "");
assertNotNull(fetchedAfterDeleted);
}
});
@@ -98,21 +98,21 @@ public void addAndDelParticipantTwice() throws IOException {
doLogin();
createTestWave(new SimpleArgCallback() {
@Override
- public void onCallback(final WaveRef waveletName) {
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ public void onCallback(final WaveRef waveRef) {
+ assertNotNull(waveRef);
+ manager.addParticipants(waveRef, getSiteAdminShortName(), getSiteAdminShortName(),
NEW_PARTICIPANT);
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ manager.addParticipants(waveRef, getSiteAdminShortName(), getSiteAdminShortName(),
NEW_PARTICIPANT, NEW_PARTICIPANT);
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ manager.addParticipants(waveRef, getSiteAdminShortName(), getSiteAdminShortName(),
NEW_PARTICIPANT, NEW_PARTICIPANT, NEW_PARTICIPANT);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ final Wavelet fetchWavelet = manager.fetchWave(waveRef, 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,
+ manager.delParticipants(waveRef, getSiteAdminShortName(), NEW_PARTICIPANT, NEW_PARTICIPANT,
getSiteAdminShortName(), getSiteAdminShortName());
}
});
@@ -124,27 +124,27 @@ public void addAndRemoveParticipant() throws IOException {
final String whoDels = getSiteAdminShortName();
createTestWave(new SimpleArgCallback() {
@Override
- public void onCallback(final WaveRef waveletName) {
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), whoDels, NEW_PARTICIPANT,
+ public void onCallback(final WaveRef waveRef) {
+ assertNotNull(waveRef);
+ manager.addParticipants(waveRef, getSiteAdminShortName(), whoDels, NEW_PARTICIPANT,
NEW_PARTICIPANT2);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ final Wavelet fetchWavelet = manager.fetchWave(waveRef, 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());
+ manager.delParticipants(waveRef, whoDels, NEW_PARTICIPANT, NEW_PARTICIPANT2);
+ final Wavelet fetchDelWavelet = manager.fetchWave(waveRef, 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(),
+ manager.addParticipants(waveRef, getSiteAdminShortName(), getSiteAdminShortName(),
NEW_PARTICIPANT);
// Del all (the last, the whoDels...)
- manager.delParticipants(waveletName, whoDels, NEW_PARTICIPANT, getSiteAdminShortName());
+ manager.delParticipants(waveRef, whoDels, NEW_PARTICIPANT, getSiteAdminShortName());
}
});
}
@@ -168,10 +168,10 @@ public void addGadgetAndCheckProperties() throws DefaultException, IOException {
final URL gadgetUrl = new URL(TEST_GADGET);
createTestWave(new SimpleArgCallback() {
@Override
- public void onCallback(final WaveRef waveletName) {
- assertNotNull(waveletName);
- manager.addGadget(waveletName, getSiteAdminShortName(), gadgetUrl);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ public void onCallback(final WaveRef waveRef) {
+ assertNotNull(waveRef);
+ manager.addGadget(waveRef, getSiteAdminShortName(), gadgetUrl);
+ final Wavelet fetchWavelet = manager.fetchWave(waveRef, getSiteAdminShortName());
final Gadget gadget = getFirstGadget(fetchWavelet, TEST_GADGET);
assertEquals(gadget.getUrl(), TEST_GADGET);
assertEquals(2, gadget.getProperties().size());
@@ -185,8 +185,8 @@ public void onCallback(final WaveRef waveletName) {
}
// Removing some property
newProps.put(SOME_PROPERTY, null);
- manager.setGadgetProperty(waveletName, getSiteAdminShortName(), gadgetUrl, newProps);
- final Wavelet updatedWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ manager.setGadgetProperty(waveRef, getSiteAdminShortName(), gadgetUrl, newProps);
+ final Wavelet updatedWavelet = manager.fetchWave(waveRef, getSiteAdminShortName());
final Gadget gadgetUpdated = getFirstGadget(updatedWavelet, TEST_GADGET);
assertEquals(gadgetUpdated.getUrl(), TEST_GADGET);
assertEquals(3, updatedWavelet.getRootBlip().getElements().size());
@@ -215,10 +215,10 @@ private void addParticipant(final String whoAdds) throws IOException {
doLogin();
createTestWave(new SimpleArgCallback() {
@Override
- public void onCallback(final WaveRef waveletName) {
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), whoAdds, NEW_PARTICIPANT);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ public void onCallback(final WaveRef waveRef) {
+ assertNotNull(waveRef);
+ manager.addParticipants(waveRef, getSiteAdminShortName(), whoAdds, NEW_PARTICIPANT);
+ final Wavelet fetchWavelet = manager.fetchWave(waveRef, getSiteAdminShortName());
assertNotNull(fetchWavelet);
assertEquals(2, fetchWavelet.getParticipants().size());
assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
@@ -247,9 +247,9 @@ public void createWave() throws DefaultException, IOException {
doLogin();
manager.createWave(RICHTEXT_MESSAGE, new SimpleArgCallback() {
@Override
- public void onCallback(final WaveRef waveletName) {
- assertNotNull(waveletName);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ public void onCallback(final WaveRef waveRef) {
+ assertNotNull(waveRef);
+ final Wavelet fetchWavelet = manager.fetchWave(waveRef, getSiteAdminShortName());
assertNotNull(fetchWavelet);
assertTrue(fetchWavelet.getRootBlip().getAnnotations().size() > 0);
assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
@@ -276,9 +276,9 @@ public void createWaveWithTitle() throws DefaultException, IOException {
doLogin();
createTestWave(new SimpleArgCallback() {
@Override
- public void onCallback(final WaveRef waveletName) {
- assertNotNull(waveletName);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ public void onCallback(final WaveRef waveRef) {
+ assertNotNull(waveRef);
+ final Wavelet fetchWavelet = manager.fetchWave(waveRef, getSiteAdminShortName());
assertNotNull(fetchWavelet);
assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
assertEquals(TITLE, fetchWavelet.getTitle());
@@ -319,10 +319,10 @@ public void setTitle() throws DefaultException, IOException {
doLogin();
createTestWave(new SimpleArgCallback() {
@Override
- public void onCallback(final WaveRef waveletName) {
- assertNotNull(waveletName);
- manager.setTitle(waveletName, TITLENEW, getSiteAdminShortName());
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ public void onCallback(final WaveRef waveRef) {
+ assertNotNull(waveRef);
+ manager.setTitle(waveRef, TITLENEW, getSiteAdminShortName());
+ final Wavelet fetchWavelet = manager.fetchWave(waveRef, getSiteAdminShortName());
assertNotNull(fetchWavelet);
assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
assertEquals(TITLENEW, fetchWavelet.getTitle());