[kune-commits] r1402 - in trunk: . src/main/java/cc/kune/client src/main/java/cc/kune/core src/main/java/cc/kune/core/client src/main/java/cc/kune/core/client/actions src/main/webapp/others
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Fri Jun 10 05:11:49 CEST 2011
Author: vjrj_
Date: 2011-06-10 05:11:49 +0200 (Fri, 10 Jun 2011)
New Revision: 1402
Added:
trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java
trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
Modified:
trunk/TODO
trunk/src/main/java/cc/kune/client/KuneGinjector.java
trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/webapp/others/kune-wave-extensions.xml
Log:
extensions via xml
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2011-06-09 21:04:18 UTC (rev 1401)
+++ trunk/TODO 2011-06-10 03:11:49 UTC (rev 1402)
@@ -371,6 +371,8 @@
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
* MID-TERM
+** Archive of xmpp conversations
+*** http://community.igniterealtime.org/docs/DOC-1094 (for openfire)
** Enable two Waves per doc: 1 for the doc (no comments enabled), other for comments. Similar to docs.google.com comments approach.
** TODO start/stop init scripts
https://groups.google.com/group/wave-protocol/browse_thread/thread/d9cdcea0d5393eda
Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-06-09 21:04:18 UTC (rev 1401)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-06-10 03:11:49 UTC (rev 1402)
@@ -32,6 +32,7 @@
import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
import cc.kune.core.client.CoreGinModule;
import cc.kune.core.client.CoreParts;
+import cc.kune.core.client.actions.XMLActionsParser;
import cc.kune.core.client.auth.RegisterPresenter;
import cc.kune.core.client.auth.SignInPresenter;
import cc.kune.core.client.cookies.CookiesManager;
@@ -144,4 +145,6 @@
AsyncProvider<UserNotifierPresenter> getUserNotifierPresenter();
WaveParts getWaveParts();
+
+ XMLActionsParser getXmlActionsParser();
}
Modified: trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/client/OnAppStartFactory.java 2011-06-09 21:04:18 UTC (rev 1401)
+++ trunk/src/main/java/cc/kune/client/OnAppStartFactory.java 2011-06-10 03:11:49 UTC (rev 1402)
@@ -19,15 +19,10 @@
*/
package cc.kune.client;
-import cc.kune.barters.client.BartersClientTool;
-import cc.kune.blogs.client.BlogsClientTool;
-import cc.kune.chat.client.ChatClientTool;
+import cc.kune.core.client.actions.XMLActionsParser;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.state.Session;
-import cc.kune.docs.client.DocsClientTool;
-import cc.kune.meets.client.MeetingsClientTool;
-import cc.kune.wiki.client.WikiClientTool;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -35,14 +30,18 @@
public class OnAppStartFactory {
@Inject
- public OnAppStartFactory(final Session session, final Provider<DocsClientTool> docsClientTool,
- final Provider<BlogsClientTool> blogsClientTool,
- final Provider<BartersClientTool> bartersClientTool,
- final Provider<MeetingsClientTool> meetsClientTool,
- final Provider<ChatClientTool> chatsClientTool, final Provider<WikiClientTool> wikiClientTool) {
+ public OnAppStartFactory(final Session session,
+ // final Provider<DocsClientTool> docsClientTool,
+ // final Provider<BlogsClientTool> blogsClientTool,
+ // final Provider<BartersClientTool> bartersClientTool,
+ // final Provider<MeetingsClientTool> meetsClientTool,
+ // final Provider<ChatClientTool> chatsClientTool, final
+ // Provider<WikiClientTool> wikiClientTool,
+ final Provider<XMLActionsParser> actionsParser) {
session.onAppStart(true, new AppStartHandler() {
@Override
public void onAppStart(final AppStartEvent event) {
+ actionsParser.get();
}
});
}
Modified: trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml 2011-06-09 21:04:18 UTC (rev 1401)
+++ trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml 2011-06-10 03:11:49 UTC (rev 1402)
@@ -10,6 +10,7 @@
<public path="public" />
<!-- Dependencies ============================================= -->
<inherits name="com.google.gwt.user.User" />
+ <inherits name="com.google.gwt.xml.XML" />
<inherits name="cc.kune.gspace.GSpace" />
<inherits name="cc.kune.msgs.KuneMsgs" />
<inherits name="cc.kune.common.KuneCommon" />
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-06-09 21:04:18 UTC (rev 1401)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-06-10 03:11:49 UTC (rev 1402)
@@ -30,6 +30,7 @@
import cc.kune.common.client.ui.MaskWidget;
import cc.kune.common.client.ui.MaskWidgetView;
import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.actions.XMLActionsParser;
import cc.kune.core.client.auth.Register;
import cc.kune.core.client.auth.RegisterPanel;
import cc.kune.core.client.auth.RegisterPresenter;
@@ -115,101 +116,103 @@
public class CoreGinModule extends ExtendedGinModule {
- /*
- * (non-Javadoc)
- *
- * @see com.google.gwt.inject.client.AbstractGinModule#configure()
- */
- @Override
- protected void configure() {
- bind(EventBus.class).to(EventBusWithLogging.class).in(Singleton.class);
- bind(TokenFormatter.class).to(ParameterTokenFormatter.class).in(Singleton.class);
- bind(RootPresenter.class).asEagerSingleton();
- bind(ProxyFailureHandler.class).to(DefaultProxyFailureHandler.class).in(Singleton.class);
- s(I18nUITranslationService.class);
- bind(I18nTranslationService.class).to(I18nUITranslationService.class).in(Singleton.class);
- bind(GlobalShortcutRegister.class).to(DefaultGlobalShortcutRegister.class).in(Singleton.class);
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.google.gwt.inject.client.AbstractGinModule#configure()
+ */
+ @Override
+ protected void configure() {
+ bind(EventBus.class).to(EventBusWithLogging.class).in(Singleton.class);
+ bind(TokenFormatter.class).to(ParameterTokenFormatter.class).in(Singleton.class);
+ bind(RootPresenter.class).asEagerSingleton();
+ bind(ProxyFailureHandler.class).to(DefaultProxyFailureHandler.class).in(Singleton.class);
+ s(I18nUITranslationService.class);
+ bind(I18nTranslationService.class).to(I18nUITranslationService.class).in(Singleton.class);
+ bind(GlobalShortcutRegister.class).to(DefaultGlobalShortcutRegister.class).in(Singleton.class);
- // Presenters
- bindPresenter(CorePresenter.class, CorePresenter.CoreView.class, CoreViewImpl.class,
- CorePresenter.CoreProxy.class);
- bindPresenter(SpinerPresenter.class, SpinerPresenter.SpinerView.class, SpinerViewImpl.class,
- SpinerPresenter.SpinerProxy.class);
- bindPresenter(UserNotifierPresenter.class, UserNotifierPresenter.UserNotifierView.class,
- UserNotifierViewImpl.class, UserNotifierProxy.class);
- bindPresenter(SpaceSelectorPresenter.class, SpaceSelectorPresenter.SpaceSelectorView.class,
- SpaceSelectorViewImpl.class, SpaceSelectorPresenter.SpaceSelectorProxy.class);
- bindPresenter(SiteLogoPresenter.class, SiteLogoPresenter.SiteLogoView.class, SiteLogoViewImpl.class,
- SiteLogoPresenter.SiteLogoProxy.class);
- bindPresenter(SitebarActionsPresenter.class, SitebarActionsPresenter.SitebarActionsView.class,
- SitebarActionsPanel.class, SitebarActionsPresenter.SitebarActionsProxy.class);
- bind(SitebarActions.class).to(SitebarActionsPresenter.class).in(Singleton.class);
- bindPresenter(NewGroupPresenter.class, NewGroupView.class, NewGroupPanel.class,
- NewGroupPresenter.NewGroupProxy.class);
- bindPresenter(GroupSNPresenter.class, GroupSNPresenter.GroupSNView.class, GroupSNPanel.class,
- GroupSNPresenter.GroupSNProxy.class);
- bindPresenter(UserSNPresenter.class, UserSNPresenter.UserSNView.class, UserSNPanel.class,
- UserSNPresenter.UserSNProxy.class);
- bindPresenter(EntityHeaderPresenter.class, EntityHeaderPresenter.EntityHeaderView.class,
- EntityHeaderPanel.class, EntityHeaderPresenter.EntityHeaderProxy.class);
- bindPresenter(SignInPresenter.class, SignInView.class, SignInPanel.class, SignInPresenter.SignInProxy.class);
- bindPresenter(RegisterPresenter.class, RegisterView.class, RegisterPanel.class,
- RegisterPresenter.RegisterProxy.class);
- bindPresenter(UserConfirmPresenter.class, UserConfirmPresenter.UserConfirmView.class, UserConfirmPanel.class,
- UserConfirmPresenter.UserConfirmProxy.class);
+ // Presenters
+ bindPresenter(CorePresenter.class, CorePresenter.CoreView.class, CoreViewImpl.class,
+ CorePresenter.CoreProxy.class);
+ bindPresenter(SpinerPresenter.class, SpinerPresenter.SpinerView.class, SpinerViewImpl.class,
+ SpinerPresenter.SpinerProxy.class);
+ bindPresenter(UserNotifierPresenter.class, UserNotifierPresenter.UserNotifierView.class,
+ UserNotifierViewImpl.class, UserNotifierProxy.class);
+ bindPresenter(SpaceSelectorPresenter.class, SpaceSelectorPresenter.SpaceSelectorView.class,
+ SpaceSelectorViewImpl.class, SpaceSelectorPresenter.SpaceSelectorProxy.class);
+ bindPresenter(SiteLogoPresenter.class, SiteLogoPresenter.SiteLogoView.class, SiteLogoViewImpl.class,
+ SiteLogoPresenter.SiteLogoProxy.class);
+ bindPresenter(SitebarActionsPresenter.class, SitebarActionsPresenter.SitebarActionsView.class,
+ SitebarActionsPanel.class, SitebarActionsPresenter.SitebarActionsProxy.class);
+ bind(SitebarActions.class).to(SitebarActionsPresenter.class).in(Singleton.class);
+ bindPresenter(NewGroupPresenter.class, NewGroupView.class, NewGroupPanel.class,
+ NewGroupPresenter.NewGroupProxy.class);
+ bindPresenter(GroupSNPresenter.class, GroupSNPresenter.GroupSNView.class, GroupSNPanel.class,
+ GroupSNPresenter.GroupSNProxy.class);
+ bindPresenter(UserSNPresenter.class, UserSNPresenter.UserSNView.class, UserSNPanel.class,
+ UserSNPresenter.UserSNProxy.class);
+ bindPresenter(EntityHeaderPresenter.class, EntityHeaderPresenter.EntityHeaderView.class,
+ EntityHeaderPanel.class, EntityHeaderPresenter.EntityHeaderProxy.class);
+ bindPresenter(SignInPresenter.class, SignInView.class, SignInPanel.class,
+ SignInPresenter.SignInProxy.class);
+ bindPresenter(RegisterPresenter.class, RegisterView.class, RegisterPanel.class,
+ RegisterPresenter.RegisterProxy.class);
+ bindPresenter(UserConfirmPresenter.class, UserConfirmPresenter.UserConfirmView.class,
+ UserConfirmPanel.class, UserConfirmPresenter.UserConfirmProxy.class);
- bind(UserPassAutocompleteManager.class).to(UserPassAutocompleteManagerImpl.class).in(Singleton.class);
- bind(SignIn.class).to(SignInPresenter.class).in(Singleton.class);
- bind(Register.class).to(RegisterPresenter.class).in(Singleton.class);
- bind(NewGroup.class).to(NewGroupPresenter.class).in(Singleton.class);
- bind(EntityHeader.class).to(EntityHeaderPresenter.class).in(Singleton.class);
+ bind(UserPassAutocompleteManager.class).to(UserPassAutocompleteManagerImpl.class).in(Singleton.class);
+ bind(SignIn.class).to(SignInPresenter.class).in(Singleton.class);
+ bind(Register.class).to(RegisterPresenter.class).in(Singleton.class);
+ bind(NewGroup.class).to(NewGroupPresenter.class).in(Singleton.class);
+ bind(EntityHeader.class).to(EntityHeaderPresenter.class).in(Singleton.class);
- s(UserMessagesPresenter.class);
- s(UserMessagesPanel.class);
- // bind(MessagePanelView.class).to(MessagePanel.class);
+ s(UserMessagesPresenter.class);
+ s(UserMessagesPanel.class);
+ // bind(MessagePanelView.class).to(MessagePanel.class);
- // UI
- bind(GuiProvider.class).to(DefaultGuiProvider.class).in(Singleton.class);
- s(GxtGuiProvider.class);
- s(GwtGuiProvider.class);
+ // UI
+ bind(GuiProvider.class).to(DefaultGuiProvider.class).in(Singleton.class);
+ s(GxtGuiProvider.class);
+ s(GwtGuiProvider.class);
- bind(MaskWidgetView.class).to(MaskWidget.class).in(Singleton.class);
+ bind(MaskWidgetView.class).to(MaskWidget.class).in(Singleton.class);
- // Core App
- bind(Session.class).to(SessionDefault.class).in(Singleton.class);
- s(ErrorHandler.class);
- s(StateManagerDefault.class);
- bind(StateManager.class).to(StateManagerDefault.class).in(Singleton.class);
- s(AccessRightsClientManager.class);
- bind(ContentCache.class).to(ContentCacheDefault.class).in(Singleton.class);
- bind(HistoryWrapper.class).to(HistoryWrapperDefault.class).in(Singleton.class);
- s(PrefetchUtilities.class);
- bind(AppStarter.class).to(AppStarterDefault.class).in(Singleton.class);
- bind(CookiesManager.class).to(CookiesManagerImpl.class).in(Singleton.class);
- s(BeforeSignOut.class);
- eagle(SiteTokenListeners.class);
- s(SiteTokens.class);
- s(ReservedWordsRegistry.class);
- eagle(TokenMatcher.class);
- s(ActionRegistryByType.class);
- s(ContentCapabilitiesRegistry.class);
- eagle(CoreParts.class);
+ // Core App
+ bind(Session.class).to(SessionDefault.class).in(Singleton.class);
+ s(ErrorHandler.class);
+ s(StateManagerDefault.class);
+ bind(StateManager.class).to(StateManagerDefault.class).in(Singleton.class);
+ s(AccessRightsClientManager.class);
+ bind(ContentCache.class).to(ContentCacheDefault.class).in(Singleton.class);
+ bind(HistoryWrapper.class).to(HistoryWrapperDefault.class).in(Singleton.class);
+ s(PrefetchUtilities.class);
+ bind(AppStarter.class).to(AppStarterDefault.class).in(Singleton.class);
+ bind(CookiesManager.class).to(CookiesManagerImpl.class).in(Singleton.class);
+ s(BeforeSignOut.class);
+ eagle(SiteTokenListeners.class);
+ s(SiteTokens.class);
+ s(ReservedWordsRegistry.class);
+ eagle(TokenMatcher.class);
+ s(ActionRegistryByType.class);
+ s(ContentCapabilitiesRegistry.class);
+ eagle(CoreParts.class);
- // SN
- s(GroupSNAdminsMenuItemsRegistry.class);
- s(GroupSNCollabsMenuItemsRegistry.class);
- s(GroupSNPendingsMenuItemsRegistry.class);
- s(UserSNMenuItemsRegistry.class);
- s(GroupSNConfActions.class);
- s(UserSNConfActions.class);
+ // SN
+ s(GroupSNAdminsMenuItemsRegistry.class);
+ s(GroupSNCollabsMenuItemsRegistry.class);
+ s(GroupSNPendingsMenuItemsRegistry.class);
+ s(UserSNMenuItemsRegistry.class);
+ s(GroupSNConfActions.class);
+ s(UserSNConfActions.class);
- s(SiteUserOptionsPresenter.class);
- s(SiteUserOptions.class, SiteUserOptionsPresenter.class);
- s(SitebarNewGroupLink.class);
- s(SitebarSignInLink.class);
- s(SitebarSignOutLink.class);
+ s(SiteUserOptionsPresenter.class);
+ s(SiteUserOptions.class, SiteUserOptionsPresenter.class);
+ s(SitebarNewGroupLink.class);
+ s(SitebarSignInLink.class);
+ s(SitebarSignOutLink.class);
- s(ErrorsDialog.class);
- }
+ s(ErrorsDialog.class);
+ eagle(XMLActionsParser.class);
+ }
}
Added: trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java 2011-06-10 03:11:49 UTC (rev 1402)
@@ -0,0 +1,78 @@
+package cc.kune.core.client.actions;
+
+public class WaveExtension {
+ public static class Builder {
+ private String gadgetUrl;
+ private String iconCss;
+ private String iconUrl;
+ private String installerUrl;
+ private String name;
+
+ public Builder() {
+ }
+
+ public WaveExtension build() {
+ return new WaveExtension(this);
+ }
+
+ public Builder gadgetUrl(final String gadgetUrl) {
+ this.gadgetUrl = gadgetUrl;
+ return this;
+ }
+
+ public Builder iconCss(final String iconCss) {
+ this.iconCss = iconCss;
+ return this;
+ }
+
+ public Builder iconUrl(final String iconUrl) {
+ this.iconUrl = iconUrl;
+ return this;
+ }
+
+ public Builder installerUrl(final String installerUrl) {
+ this.installerUrl = installerUrl;
+ return this;
+ }
+
+ public Builder name(final String name) {
+ this.name = name;
+ return this;
+ }
+ }
+
+ private final String gadgetUrl;
+ private final String iconCss;
+ private final String iconUrl;
+ private final String installerUrl;
+ private final String name;
+
+ public WaveExtension(final Builder builder) {
+ gadgetUrl = builder.gadgetUrl;
+ iconCss = builder.iconCss;
+ iconUrl = builder.iconUrl;
+ installerUrl = builder.installerUrl;
+ name = builder.name;
+ }
+
+ public String getGadgetUrl() {
+ return gadgetUrl;
+ }
+
+ public String getIconCss() {
+ return iconCss;
+ }
+
+ public String getIconUrl() {
+ return iconUrl;
+ }
+
+ public String getInstallerUrl() {
+ return installerUrl;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-10 03:11:49 UTC (rev 1402)
@@ -0,0 +1,77 @@
+package cc.kune.core.client.actions;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import cc.kune.core.client.actions.WaveExtension.Builder;
+import cc.kune.core.client.errors.ErrorHandler;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.RequestCallback;
+import com.google.gwt.http.client.RequestException;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.xml.client.Document;
+import com.google.gwt.xml.client.Element;
+import com.google.gwt.xml.client.Node;
+import com.google.gwt.xml.client.NodeList;
+import com.google.gwt.xml.client.XMLParser;
+import com.google.inject.Inject;
+
+public class XMLActionsParser {
+
+ private final ErrorHandler errHandler;
+ private final Map<String, WaveExtension> extensionsMap;
+
+ @Inject
+ public XMLActionsParser(final ErrorHandler errHandler) {
+ this.errHandler = errHandler;
+ extensionsMap = new HashMap<String, WaveExtension>();
+
+ // Based on:
+ // http://www.roseindia.net/tutorials/gwt/retrieving-xml-data.shtml
+ final RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,
+ "/others/kune-wave-extensions.xml");
+ try {
+ requestBuilder.sendRequest(null, new RequestCallback() {
+ @Override
+ public void onError(final Request request, final Throwable ex) {
+ onFailed(ex);
+ }
+
+ @Override
+ public void onResponseReceived(final Request request, final Response response) {
+ parseXML(response.getText());
+ }
+ });
+ } catch (final RequestException ex) {
+ onFailed(ex);
+ }
+ }
+
+ private String get(final Element extension, final String id) {
+ final Node child = extension.getElementsByTagName(id).item(0).getFirstChild();
+ return child != null ? child.getNodeValue() : "";
+ }
+
+ private void onFailed(final Throwable ex) {
+ errHandler.process(ex);
+ }
+
+ private void parseXML(final String text) {
+ final Document parse = XMLParser.parse(text);
+ final NodeList extensions = parse.getElementsByTagName("extensions");
+ for (int i = 0; i < extensions.getLength(); i++) {
+ final Element extension = (Element) extensions.item(i);
+ final Builder builder = new WaveExtension.Builder();
+ final String name = get(extension, "name");
+ builder.name(name);
+ builder.gadgetUrl(get(extension, "gadgetUrl"));
+ builder.iconUrl(get(extension, "iconUrl"));
+ builder.iconCss(get(extension, "iconCss"));
+ builder.installerUrl(get(extension, "installerUrl"));
+ extensionsMap.put(name, builder.build());
+ }
+
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/webapp/others/kune-wave-extensions.xml
===================================================================
--- trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-09 21:04:18 UTC (rev 1401)
+++ trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-10 03:11:49 UTC (rev 1402)
@@ -1,4 +1,7 @@
+<?xml version="1.0" ?>
+<kuneWaveExtensions>
+
<!-- List of Wave extensions to use in Kune ===================== -->
<extensions>
@@ -63,3 +66,5 @@
</guiActionDescriptor>
</guiActionDescriptors>
+
+</kuneWaveExtensions>
\ No newline at end of file
More information about the kune-commits
mailing list