[kune-commits] r1326 - in trunk: script src/main/java/cc/kune/chat/client/snd src/main/java/cc/kune/common/client/ui/dialogs/tabbed src/main/java/cc/kune/common/public src/main/java/cc/kune/common/public/images src/main/java/cc/kune/core/server/state src/main/java/cc/kune/gspace/client/options src/main/java/cc/kune/gspace/client/options/license src/main/java/cc/kune/gspace/client/options/logo src/main/java/cc/kune/gspace/client/options/pscape src/main/java/cc/kune/gspace/client/options/tools src/main/java/cc/kune/wave/client src/main/java/cc/kune/wave/server
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Thu Apr 28 20:00:05 CEST 2011
Author: vjrj_
Date: 2011-04-28 20:00:03 +0200 (Thu, 28 Apr 2011)
New Revision: 1326
Added:
trunk/src/main/java/cc/kune/common/public/images/corner.png
trunk/src/main/java/cc/kune/common/public/images/corner_ie6.png
Modified:
trunk/script/repopubli.sh
trunk/src/main/java/cc/kune/chat/client/snd/SndClickEvent.java
trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
trunk/src/main/java/cc/kune/common/public/kune-common.css
trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
trunk/src/main/java/cc/kune/gspace/client/options/EntityOptionsView.java
trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPanel.java
trunk/src/main/java/cc/kune/wave/client/WebClient.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java
trunk/src/main/java/cc/kune/wave/server/WaveMain.java
Log:
WIAB updated, minor fixes
Modified: trunk/script/repopubli.sh
===================================================================
--- trunk/script/repopubli.sh 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/script/repopubli.sh 2011-04-28 18:00:03 UTC (rev 1326)
@@ -5,7 +5,7 @@
echo "$0 -j target/emite-0.4.6-emiteuimodule.jar -g com.calclab.emite -a emite -v 0.4.6"
}
-PACKAGING=jar
+PACKAGING='jar'
while getopts “hg:a:v:j:s” OPTION
do
@@ -27,7 +27,7 @@
JAR=$OPTARG
;;
s)
- PACKAGING=java-source
+ PACKAGING='java-source -DgeneratePom=false'
;;
?)
usage
@@ -47,5 +47,5 @@
-Dversion=$VER \
-Dpackaging=$PACKAGING \
-Dfile=$JAR \
- -DrepositoryId=kune.ourproject.org \
- -Durl=scpexe://kune.ourproject.org/home/groups/kune/htdocs/mavenrepo/
+ -Durl=scpexe://kune.ourproject.org/home/groups/kune/htdocs/mavenrepo/ \
+ -DrepositoryId=kune.ourproject.org
Modified: trunk/src/main/java/cc/kune/chat/client/snd/SndClickEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/snd/SndClickEvent.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/chat/client/snd/SndClickEvent.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -7,7 +7,7 @@
public class SndClickEvent extends GwtEvent<SndClickEvent.SndClickHandler> {
- public interface HasClickHandlers extends HasHandlers {
+ public interface HasSndClickHandlers extends HasHandlers {
HandlerRegistration addSndClickHandler(SndClickHandler handler);
}
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -24,6 +24,7 @@
import cc.kune.common.client.ui.dialogs.BasicTopDialog;
import cc.kune.common.client.ui.dialogs.MessageToolbar;
+import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.logical.shared.HasCloseHandlers;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.ui.DecoratedTabPanel;
@@ -31,149 +32,161 @@
import com.google.gwt.user.client.ui.Widget;
public abstract class AbstractTabbedDialogPanel implements AbstractTabbedDialogView {
- private BasicTopDialog dialog;
- private final String dialogId;
- private final String errorLabelId;
- private final String firstBtnId;
- private final String firstBtnTitle;
- private final int height;
- private String iconCls;
- private final NotifyLevelImages images;
- private MessageToolbar messageErrorBar;
- private final int minHeight;
- private final int minWidth;
- private final boolean modal;
- private final String sndBtnId;
- private final String sndBtnTitle;
- private DecoratedTabPanel tabPanel;
- private String title;
- private final int width;
+ private BasicTopDialog dialog;
+ private final String dialogId;
+ private final String errorLabelId;
+ private final String firstBtnId;
+ private final String firstBtnTitle;
+ private final int height;
+ private String iconCls;
+ private final NotifyLevelImages images;
+ private MessageToolbar messageErrorBar;
+ private final int minHeight;
+ private final int minWidth;
+ private final boolean modal;
+ private final String sndBtnId;
+ private final String sndBtnTitle;
+ private DecoratedTabPanel tabPanel;
+ private String title;
+ private final int width;
- public AbstractTabbedDialogPanel(final String dialogId, final String title, final int width, final int height,
- final int minWidth, final int minHeight, final boolean modal, final NotifyLevelImages images,
- final String errorLabelId, final String firstBtnTitle, final String firstBtnId, final String sndBtnTitle,
- final String sndBtnId) {
- this.dialogId = dialogId;
- this.title = title;
- this.width = width;
- this.height = height;
- this.modal = modal;
- this.images = images;
- this.errorLabelId = errorLabelId;
- // Not used:
- this.minWidth = minWidth;
- this.minHeight = minHeight;
- this.firstBtnTitle = firstBtnTitle;
- this.firstBtnId = firstBtnId;
- this.sndBtnTitle = sndBtnTitle;
- this.sndBtnId = sndBtnId;
- }
+ public AbstractTabbedDialogPanel(final String dialogId, final String title, final int width,
+ final int height, final int minWidth, final int minHeight, final boolean modal,
+ final NotifyLevelImages images, final String errorLabelId, final String firstBtnTitle,
+ final String firstBtnId, final String sndBtnTitle, final String sndBtnId) {
+ this.dialogId = dialogId;
+ this.title = title;
+ this.width = width;
+ this.height = height;
+ this.modal = modal;
+ this.images = images;
+ this.errorLabelId = errorLabelId;
+ // Not used:
+ this.minWidth = minWidth;
+ this.minHeight = minHeight;
+ this.firstBtnTitle = firstBtnTitle;
+ this.firstBtnId = firstBtnId;
+ this.sndBtnTitle = sndBtnTitle;
+ this.sndBtnId = sndBtnId;
+ }
- @Override
- public void activateTab(final int index) {
- createDialogIfNecessary();
- tabPanel.selectTab(index);
- }
+ @Override
+ public void activateTab(final int index) {
+ createDialogIfNecessary();
+ tabPanel.selectTab(index);
+ }
- @Override
- public void addTab(final IsWidget view, final IsWidget tabWidget) {
- createDialogIfNecessary();
- tabPanel.add(view, tabWidget);
- }
+ @Override
+ public void addTab(final IsWidget view, final IsWidget tabWidget) {
+ createDialogIfNecessary();
+ tabPanel.add(view, tabWidget);
+ }
- @Override
- public void createAndShow() {
- show();
- setFirstTabActive();
- }
+ @Override
+ public void createAndShow() {
+ show();
+ setFirstTabActive();
+ }
- private void createDialog() {
- dialog = new BasicTopDialog.Builder(dialogId, true, modal).autoscroll(true).width(width).height(height).icon(
- iconCls).firstButtonId(firstBtnId).firstButtonTitle(firstBtnTitle).sndButtonId(dialogId).sndButtonTitle(
- sndBtnTitle).build();
- messageErrorBar = new MessageToolbar(images, errorLabelId);
- tabPanel = new DecoratedTabPanel();
- dialog.getInnerPanel().add(tabPanel);
- }
+ private void createDialog() {
+ dialog = new BasicTopDialog.Builder(dialogId, true, modal).autoscroll(true).width(width).height(
+ height).icon(iconCls).firstButtonId(firstBtnId).firstButtonTitle(firstBtnTitle).sndButtonId(
+ dialogId).sndButtonTitle(sndBtnTitle).build();
+ messageErrorBar = new MessageToolbar(images, errorLabelId);
+ tabPanel = new DecoratedTabPanel();
+ dialog.getInnerPanel().add(tabPanel);
+ }
- private void createDialogIfNecessary() {
- if (dialog == null) {
- createDialog();
- }
+ private void createDialogIfNecessary() {
+ if (dialog == null) {
+ createDialog();
}
+ }
- @Override
- public void destroy() {
- if (dialog != null) {
- dialog.removeFromParent();
- dialog = null;
- }
+ @Override
+ public void destroy() {
+ if (dialog != null) {
+ dialog.removeFromParent();
+ dialog = null;
}
+ }
- public HasCloseHandlers<?> getClose() {
- return dialog.getClose();
- }
+ public HasCloseHandlers<?> getClose() {
+ createDialogIfNecessary();
+ return dialog.getClose();
+ }
- public Widget getWidget() {
- return dialog;
- }
+ public HasClickHandlers getFirstBtn() {
+ createDialogIfNecessary();
+ return dialog.getFirstBtn();
+ }
- @Override
- public void hide() {
- if (dialog != null) {
- if (dialog.isVisible()) {
- dialog.hide();
- }
- }
- }
+ public HasClickHandlers getSecondBtn() {
+ createDialogIfNecessary();
+ return dialog.getSecondBtn();
+ }
- @Override
- public void hideMessages() {
- if (dialog != null) {
- messageErrorBar.hideErrorMessage();
- }
- }
+ public Widget getWidget() {
+ createDialogIfNecessary();
+ return dialog;
+ }
- @Override
- public void insertTab(final IsWidget tab, final IsWidget tabTitle, final int index) {
- createDialogIfNecessary();
- tabPanel.insert(tab, tabTitle, index);
+ @Override
+ public void hide() {
+ if (dialog != null) {
+ if (dialog.isVisible()) {
+ dialog.hide();
+ }
}
+ }
- public boolean isVisible() {
- createDialogIfNecessary();
- return dialog.isVisible();
+ @Override
+ public void hideMessages() {
+ if (dialog != null) {
+ messageErrorBar.hideErrorMessage();
}
+ }
- @Override
- public void setErrorMessage(final String message, final NotifyLevel level) {
- messageErrorBar.setErrorMessage(message, level);
- }
+ @Override
+ public void insertTab(final IsWidget tab, final IsWidget tabTitle, final int index) {
+ createDialogIfNecessary();
+ tabPanel.insert(tab, tabTitle, index);
+ }
- public void setFirstTabActive() {
- tabPanel.selectTab(0);
- }
+ public boolean isVisible() {
+ createDialogIfNecessary();
+ return dialog.isVisible();
+ }
- public void setIcon(final ImageResource icon) {
- dialog.setTitleIcon(icon);
- }
+ @Override
+ public void setErrorMessage(final String message, final NotifyLevel level) {
+ messageErrorBar.setErrorMessage(message, level);
+ }
- public void setIconCls(final String iconCls) {
- this.iconCls = iconCls;
- if (dialog != null) {
- dialog.setTitleIcon(iconCls);
- }
+ public void setFirstTabActive() {
+ tabPanel.selectTab(0);
+ }
+
+ public void setIcon(final ImageResource icon) {
+ dialog.setTitleIcon(icon);
+ }
+
+ public void setIconCls(final String iconCls) {
+ this.iconCls = iconCls;
+ if (dialog != null) {
+ dialog.setTitleIcon(iconCls);
}
+ }
- public void setTitle(final String title) {
- this.title = title;
- if (dialog != null) {
- dialog.setTitle(title);
- }
+ public void setTitle(final String title) {
+ this.title = title;
+ if (dialog != null) {
+ dialog.setTitle(title);
}
+ }
- public void show() {
- createDialogIfNecessary();
- dialog.showCentered();
- }
+ public void show() {
+ createDialogIfNecessary();
+ dialog.showCentered();
+ }
}
Added: trunk/src/main/java/cc/kune/common/public/images/corner.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/common/public/images/corner.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/common/public/images/corner_ie6.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/common/public/images/corner_ie6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/cc/kune/common/public/kune-common.css
===================================================================
--- trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-04-28 18:00:03 UTC (rev 1326)
@@ -531,4 +531,90 @@
_filter: chroma(color = pink);
}
-/* end tooltip */
\ No newline at end of file
+/* end tooltip */
+
+/* tabbar */
+
+.gwt-DecoratedTabBar {
+}
+.gwt-DecoratedTabBar .gwt-TabBarFirst {
+ width: 5px; /* first tab distance from the left */
+}
+.gwt-DecoratedTabBar .gwt-TabBarRest {
+}
+.gwt-DecoratedTabBar .gwt-TabBarItem {
+ border-collapse: collapse;
+ margin-left: 6px;
+}
+.gwt-DecoratedTabBar .tabTopCenter {
+ padding: 0px;
+ background: #e3e3e3;
+}
+.gwt-DecoratedTabBar .tabTopLeft,
+.gwt-DecoratedTabBar .tabTopRight {
+ padding: 0px;
+ zoom: 1;
+}
+.gwt-DecoratedTabBar .tabTopLeftInner,
+.gwt-DecoratedTabBar .tabTopRightInner {
+ width: 6px;
+ height: 6px;
+}
+.gwt-DecoratedTabBar .tabTopLeft {
+ background: url(images/corner.png) no-repeat 0px -55px;
+ -background: url(images/corner_ie6.png) no-repeat 0px -55px;
+}
+.gwt-DecoratedTabBar .tabTopRight {
+ background: url(images/corner.png) no-repeat -6px -55px;
+ -background: url(images/corner_ie6.png) no-repeat -6px -55px;
+}
+* html .gwt-DecoratedTabBar .tabTopLeftInner,
+* html .gwt-DecoratedTabBar .tabTopRightInner {
+ width: 6px;
+ height: 6px;
+ overflow: hidden;
+}
+.gwt-DecoratedTabBar .tabMiddleLeft,
+.gwt-DecoratedTabBar .tabMiddleRight {
+ width: 6px;
+ padding: 0px;
+ background: #e3e3e3 url(images/hborder.png) repeat-x 0px -1463px;
+}
+.gwt-DecoratedTabBar .tabMiddleLeftInner,
+.gwt-DecoratedTabBar .tabMiddleRightInner {
+ width: 1px;
+ height: 1px;
+}
+.gwt-DecoratedTabBar .tabMiddleCenter {
+ padding: 0px 4px 2px 4px;
+ cursor: pointer;
+ cursor: hand;
+ color: black;
+ font-weight: bold;
+ text-align: center;
+ background: #e3e3e3 url(images/hborder.png) repeat-x 0px -1463px;
+}
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopCenter {
+ background: #747474;
+}
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopLeft {
+ background-position: 0px -61px;
+}
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopRight {
+ background-position: -6px -61px;
+}
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleLeft,
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleRight {
+ background: #bcbcbc url(images/hborder.png) repeat-x 0px -2511px;
+}
+.gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleCenter {
+ cursor: default;
+ background: #bcbcbc url(images/hborder.png) repeat-x 0px -2511px;
+ color: white;
+}
+.gwt-DecoratedTabBar .gwt-TabBarItem-disabled .tabMiddleCenter {
+ cursor: default;
+ color: #999999;
+}
+
+/* End tabbar */
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -42,124 +42,128 @@
import com.google.inject.Inject;
import com.google.inject.Singleton;
+import com.google.wave.api.Wavelet;
@Singleton
public class StateServiceDefault implements StateService {
- private final ContentManager contentManager;
- private final GroupManager groupManager;
- private final I18nTranslationService i18n;
- private final KuneWaveManager kuneWaveManager;
- private final AccessRightsService rightsService;
- private final SocialNetworkManager socialNetworkManager;
- private final TagUserContentManager tagManager;
+ private final ContentManager contentManager;
+ private final GroupManager groupManager;
+ private final I18nTranslationService i18n;
+ private final KuneWaveManager kuneWaveManager;
+ private final AccessRightsService rightsService;
+ private final SocialNetworkManager socialNetworkManager;
+ private final TagUserContentManager tagManager;
- @Inject
- public StateServiceDefault(final GroupManager groupManager, final SocialNetworkManager socialNetworkManager,
- final ContentManager contentManager, final TagUserContentManager tagManager,
- final AccessRightsService rightsService, final I18nTranslationService i18n,
- final KuneWaveManager kuneWaveManager) {
- this.groupManager = groupManager;
- this.socialNetworkManager = socialNetworkManager;
- this.contentManager = contentManager;
- this.tagManager = tagManager;
- this.rightsService = rightsService;
- this.i18n = i18n;
- this.kuneWaveManager = kuneWaveManager;
- }
+ @Inject
+ public StateServiceDefault(final GroupManager groupManager,
+ final SocialNetworkManager socialNetworkManager, final ContentManager contentManager,
+ final TagUserContentManager tagManager, final AccessRightsService rightsService,
+ final I18nTranslationService i18n, final KuneWaveManager kuneWaveManager) {
+ this.groupManager = groupManager;
+ this.socialNetworkManager = socialNetworkManager;
+ this.contentManager = contentManager;
+ this.tagManager = tagManager;
+ this.rightsService = rightsService;
+ this.i18n = i18n;
+ this.kuneWaveManager = kuneWaveManager;
+ }
- private Container calculateRootContainer(final Container container) {
- return container.isRoot() ? container : container.getAbsolutePath().get(0);
- }
+ private Container calculateRootContainer(final Container container) {
+ return container.isRoot() ? container : container.getAbsolutePath().get(0);
+ }
- @Override
- public StateContainer create(final User userLogged, final Container container) {
- final StateContainer state = new StateContainer();
- state.setTitle(container.getName());
- state.setTypeId(container.getTypeId());
- state.setLanguage(container.getLanguage());
- state.setStateToken(container.getStateToken());
- state.setRootContainer(calculateRootContainer(container));
- state.setLicense(container.getOwner().getDefaultLicense());
- state.setAccessLists(container.getAccessLists());
- final Group group = container.getOwner();
- setCommon(state, userLogged, group, container);
- return state;
- }
+ @Override
+ public StateContainer create(final User userLogged, final Container container) {
+ final StateContainer state = new StateContainer();
+ state.setTitle(container.getName());
+ state.setTypeId(container.getTypeId());
+ state.setLanguage(container.getLanguage());
+ state.setStateToken(container.getStateToken());
+ state.setRootContainer(calculateRootContainer(container));
+ state.setLicense(container.getOwner().getDefaultLicense());
+ state.setAccessLists(container.getAccessLists());
+ final Group group = container.getOwner();
+ setCommon(state, userLogged, group, container);
+ return state;
+ }
- @Override
- public StateContent create(final User userLogged, final Content content) {
- final StateContent state = new StateContent();
- final String typeId = content.getTypeId();
- state.setTypeId(typeId);
- state.setMimeType(content.getMimeType());
- state.setDocumentId(content.getId().toString());
- state.setLanguage(content.getLanguage());
- state.setPublishedOn(content.getPublishedOn());
- state.setAuthors(content.getAuthors());
- state.setTags(tagManager.getTagsAsString(userLogged, content));
- state.setStatus(content.getStatus());
- state.setStateToken(content.getStateToken());
- final Revision revision = content.getLastRevision();
- state.setTitle(revision.getTitle());
- state.setVersion(content.getVersion());
- final char[] text = revision.getBody();
- final String textBody = text == null ? null : new String(text);
- if (typeId.equals(TYPE_DOCUMENT) || (typeId.equals(TYPE_POST))) {
- state.setWaveRef(textBody);
- try {
- state.setContent(kuneWaveManager.fetchWavelet(JavaWaverefEncoder.decodeWaveRefFromPath(textBody),
- content.getAuthors().get(0).getShortName()).getRootBlip().getContent());
- } catch (final InvalidWaveRefException e) {
- throw new DefaultException("Error retriving Wave");
- }
- } else {
- state.setContent(textBody);
- }
- final Container container = content.getContainer();
- state.setRootContainer(calculateRootContainer(container));
- final License license = content.getLicense();
- final Group group = container.getOwner();
- state.setLicense(license == null ? group.getDefaultLicense() : license);
- state.setContentRights(rightsService.get(userLogged, content.getAccessLists()));
- state.setAccessLists(content.getAccessLists());
- setCommon(state, userLogged, group, container);
- if (userLogged != User.UNKNOWN_USER) {
- state.setCurrentUserRate(contentManager.getRateContent(userLogged, content));
- }
- // FIXME: user RateResult
- final Double rateAvg = contentManager.getRateAvg(content);
- state.setRate(rateAvg != null ? rateAvg : 0D);
- final Long rateByUsers = contentManager.getRateByUsers(content);
- state.setRateByUsers(rateByUsers != null ? rateByUsers.intValue() : 0);
- return state;
+ @Override
+ public StateContent create(final User userLogged, final Content content) {
+ final StateContent state = new StateContent();
+ final String typeId = content.getTypeId();
+ state.setTypeId(typeId);
+ state.setMimeType(content.getMimeType());
+ state.setDocumentId(content.getId().toString());
+ state.setLanguage(content.getLanguage());
+ state.setPublishedOn(content.getPublishedOn());
+ state.setAuthors(content.getAuthors());
+ state.setTags(tagManager.getTagsAsString(userLogged, content));
+ state.setStatus(content.getStatus());
+ state.setStateToken(content.getStateToken());
+ final Revision revision = content.getLastRevision();
+ state.setVersion(content.getVersion());
+ final char[] text = revision.getBody();
+ final String textBody = text == null ? null : new String(text);
+ if (typeId.equals(TYPE_DOCUMENT) || (typeId.equals(TYPE_POST))) {
+ state.setWaveRef(textBody);
+ try {
+ final Wavelet wavelet = kuneWaveManager.fetchWavelet(
+ JavaWaverefEncoder.decodeWaveRefFromPath(textBody),
+ content.getAuthors().get(0).getShortName());
+ state.setContent(wavelet.getRootBlip().getContent());
+ state.setTitle(wavelet.getTitle());
+ } catch (final InvalidWaveRefException e) {
+ throw new DefaultException("Error retriving Wave");
+ }
+ } else {
+ state.setContent(textBody);
+ state.setTitle(revision.getTitle());
}
-
- @Override
- public StateNoContent createNoHome(final User userLogged, final String groupShortName) {
- final Group group = groupManager.findByShortName(groupShortName);
- assert (group.isPersonal());
- final StateNoContent state = new StateNoContent();
- state.setGroup(group);
- state.setEnabledTools(groupManager.findEnabledTools(group.getId()));
- setSocialNetwork(state, userLogged, group);
- state.setStateToken(group.getStateToken());
- state.setTitle("<h2>" + i18n.t("This user does not have a homepage") + "</h2>");
- return state;
+ final Container container = content.getContainer();
+ state.setRootContainer(calculateRootContainer(container));
+ final License license = content.getLicense();
+ final Group group = container.getOwner();
+ state.setLicense(license == null ? group.getDefaultLicense() : license);
+ state.setContentRights(rightsService.get(userLogged, content.getAccessLists()));
+ state.setAccessLists(content.getAccessLists());
+ setCommon(state, userLogged, group, container);
+ if (userLogged != User.UNKNOWN_USER) {
+ state.setCurrentUserRate(contentManager.getRateContent(userLogged, content));
}
+ // FIXME: user RateResult
+ final Double rateAvg = contentManager.getRateAvg(content);
+ state.setRate(rateAvg != null ? rateAvg : 0D);
+ final Long rateByUsers = contentManager.getRateByUsers(content);
+ state.setRateByUsers(rateByUsers != null ? rateByUsers.intValue() : 0);
+ return state;
+ }
- private void setCommon(final StateContainer state, final User userLogged, final Group group,
- final Container container) {
- state.setToolName(container.getToolName());
- state.setGroup(group);
- state.setContainer(container);
- state.setContainerRights(rightsService.get(userLogged, container.getAccessLists()));
- state.setEnabledTools(groupManager.findEnabledTools(group.getId()));
- state.setTagCloudResult(tagManager.getTagCloudResultByGroup(group));
- setSocialNetwork(state, userLogged, group);
- }
+ @Override
+ public StateNoContent createNoHome(final User userLogged, final String groupShortName) {
+ final Group group = groupManager.findByShortName(groupShortName);
+ assert (group.isPersonal());
+ final StateNoContent state = new StateNoContent();
+ state.setGroup(group);
+ state.setEnabledTools(groupManager.findEnabledTools(group.getId()));
+ setSocialNetwork(state, userLogged, group);
+ state.setStateToken(group.getStateToken());
+ state.setTitle("<h2>" + i18n.t("This user does not have a homepage") + "</h2>");
+ return state;
+ }
- private void setSocialNetwork(final StateAbstract state, final User userLogged, final Group group) {
- state.setSocialNetworkData(socialNetworkManager.getSocialNetworkData(userLogged, group));
- }
+ private void setCommon(final StateContainer state, final User userLogged, final Group group,
+ final Container container) {
+ state.setToolName(container.getToolName());
+ state.setGroup(group);
+ state.setContainer(container);
+ state.setContainerRights(rightsService.get(userLogged, container.getAccessLists()));
+ state.setEnabledTools(groupManager.findEnabledTools(group.getId()));
+ state.setTagCloudResult(tagManager.getTagCloudResultByGroup(group));
+ setSocialNetwork(state, userLogged, group);
+ }
+
+ private void setSocialNetwork(final StateAbstract state, final User userLogged, final Group group) {
+ state.setSocialNetworkData(socialNetworkManager.getSocialNetworkData(userLogged, group));
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/EntityOptionsView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/EntityOptionsView.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/gspace/client/options/EntityOptionsView.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -23,6 +23,7 @@
public interface EntityOptionsView extends AbstractTabbedDialogView {
- int HEIGHT = 270;
+ int HEIGHT = 270;
+ int WIDTH = 400;
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -26,44 +26,52 @@
import cc.kune.core.client.ws.entheader.EntityHeader;
import cc.kune.core.shared.i18n.I18nTranslationService;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
public class GroupOptionsPanel extends AbstractTabbedDialogPanel implements GroupOptionsView {
- public static final String GROUP_OP_PANEL_ID = "k-gop-diagpan";
- public static final String GROUP_OPTIONS_ERROR_ID = "k-gop-err-mess";
- private final EntityHeader entityHeader;
- private final GroupOptionsCollection entityPreferencesGroup;
+ public static final String GROUP_OP_PANEL_ID = "k-gop-diagpan";
+ public static final String GROUP_OPTIONS_ERROR_ID = "k-gop-err-mess";
+ private final EntityHeader entityHeader;
+ private final GroupOptionsCollection entityPreferencesGroup;
- @Inject
- public GroupOptionsPanel(final EntityHeader entityHeader, final I18nTranslationService i18n,
- final NotifyLevelImages images, final GroupOptionsCollection entityOptionsGroup) {
- super(GROUP_OP_PANEL_ID, "", 400, HEIGHT + 80, 400, HEIGHT + 80, false, images, GROUP_OPTIONS_ERROR_ID,
- i18n.t("Close"), null, null, null);
- this.entityHeader = entityHeader;
- this.entityPreferencesGroup = entityOptionsGroup;
- super.setIconCls("k-options-icon");
- super.setTitle(i18n.t(CoreMessages.GROUP_OPTIONS_DIALOG_TITLE));
- }
+ @Inject
+ public GroupOptionsPanel(final EntityHeader entityHeader, final I18nTranslationService i18n,
+ final NotifyLevelImages images, final GroupOptionsCollection entityOptionsGroup) {
+ super(GROUP_OP_PANEL_ID, "", WIDTH, HEIGHT + 80, WIDTH, HEIGHT + 80, false, images,
+ GROUP_OPTIONS_ERROR_ID, i18n.t("Close"), null, null, null);
+ this.entityHeader = entityHeader;
+ this.entityPreferencesGroup = entityOptionsGroup;
+ super.setIconCls("k-options-icon");
+ super.setTitle(i18n.t(CoreMessages.GROUP_OPTIONS_DIALOG_TITLE));
+ }
- @Override
- public void addAction(final GuiActionDescrip descriptor) {
- entityHeader.addAction(descriptor);
- }
+ @Override
+ public void addAction(final GuiActionDescrip descriptor) {
+ entityHeader.addAction(descriptor);
+ }
- @Override
- public Widget asWidget() {
- return super.getWidget();
- }
+ @Override
+ public Widget asWidget() {
+ return super.getWidget();
+ }
- @Override
- public void createAndShow() {
- createAndShowItImpl();
- }
+ @Override
+ public void createAndShow() {
+ createAndShowItImpl();
+ }
- private void createAndShowItImpl() {
- entityPreferencesGroup.createAll();
- super.createAndShow();
- }
+ private void createAndShowItImpl() {
+ super.getFirstBtn().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ hide();
+ }
+ });
+ entityPreferencesGroup.createAll();
+ super.createAndShow();
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPanel.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPanel.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -25,38 +25,46 @@
import cc.kune.core.client.ws.entheader.EntityHeader;
import cc.kune.core.shared.i18n.I18nTranslationService;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
public class UserOptionsPanel extends AbstractTabbedDialogPanel implements UserOptionsView {
- public static final String USER_OP_PANEL_ID = "k-uop-diagpan";
- public static final String USER_OPTIONS_ERROR_ID = "k-uop-err-mess";
+ public static final String USER_OP_PANEL_ID = "k-uop-diagpan";
+ public static final String USER_OPTIONS_ERROR_ID = "k-uop-err-mess";
- private final UserOptionsCollection userPreferencesGroup;
+ private final UserOptionsCollection userPreferencesGroup;
- @Inject
- public UserOptionsPanel(final EntityHeader entityHeader, final I18nTranslationService i18n,
- final NotifyLevelImages images, final UserOptionsCollection userOptionsGroup) {
- super(USER_OP_PANEL_ID, "", 400, HEIGHT + 80, 400, HEIGHT + 80, false, images, USER_OPTIONS_ERROR_ID,
- i18n.t("Close"), null, null, null);
- this.userPreferencesGroup = userOptionsGroup;
- super.setIconCls("k-options-icon");
- super.setTitle(i18n.t(CoreMessages.USER_OPTIONS_DIALOG_TITLE));
- }
+ @Inject
+ public UserOptionsPanel(final EntityHeader entityHeader, final I18nTranslationService i18n,
+ final NotifyLevelImages images, final UserOptionsCollection userOptionsGroup) {
+ super(USER_OP_PANEL_ID, "", WIDTH, HEIGHT + 80, WIDTH, HEIGHT + 80, false, images,
+ USER_OPTIONS_ERROR_ID, i18n.t("Close"), null, null, null);
+ this.userPreferencesGroup = userOptionsGroup;
+ super.setIconCls("k-options-icon");
+ super.setTitle(i18n.t(CoreMessages.USER_OPTIONS_DIALOG_TITLE));
+ }
- @Override
- public Widget asWidget() {
- return super.getWidget();
- }
+ @Override
+ public Widget asWidget() {
+ return super.getWidget();
+ }
- @Override
- public void createAndShow() {
- createAndShowItImpl();
- }
+ @Override
+ public void createAndShow() {
+ createAndShowItImpl();
+ }
- private void createAndShowItImpl() {
- userPreferencesGroup.createAll();
- super.createAndShow();
- }
+ private void createAndShowItImpl() {
+ super.getFirstBtn().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ hide();
+ }
+ });
+ userPreferencesGroup.createAll();
+ super.createAndShow();
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePanel.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePanel.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -37,51 +37,48 @@
public class EntityOptionsDefLicensePanel extends Composite implements EntityOptionsDefLicenseView {
- private final Button change;
- private final Image licenseImage;
- private final IconLabel tabTitle;
+ private final Button change;
+ private final Image licenseImage;
+ private final IconLabel tabTitle;
- public EntityOptionsDefLicensePanel(final I18nTranslationService i18n, final CoreResources res) {
- tabTitle = new IconLabel(res.copyleft(), i18n.t("License"));
- // super.setIconCls("k-copyleft-icon");
- // super.setFrame(true);
- // super.getFormPanel().setButtonAlign(Position.LEFT);
- final VerticalPanel vp = new VerticalPanel();
- final Label intro = new Label();
- intro.setText(i18n.t("This is the default license for all the contents of this group (you can also select another different license per content):"));
- vp.add(intro);
+ public EntityOptionsDefLicensePanel(final I18nTranslationService i18n, final CoreResources res) {
+ tabTitle = new IconLabel(res.copyleft(), i18n.t("License"));
+ final VerticalPanel vp = new VerticalPanel();
+ final Label intro = new Label();
+ intro.setText(i18n.t("This is the default license for all the contents of this group (you can also select another different license per content):"));
+ vp.add(intro);
+ licenseImage = new Image();
+ vp.add(licenseImage);
+ licenseImage.addStyleName("kune-pointer");
+ change = new Button(i18n.t("Change"));
+ initWidget(vp);
+ super.setHeight(String.valueOf(EntityOptionsView.HEIGHT));
+ super.setWidth(String.valueOf(EntityOptionsView.WIDTH));
+ }
- licenseImage = new Image();
- vp.add(licenseImage);
- licenseImage.addStyleName("kune-pointer");
- change = new Button(i18n.t("Change"));
- initWidget(vp);
- super.setHeight(String.valueOf(EntityOptionsView.HEIGHT));
- }
+ @Override
+ public HasClickHandlers getChange() {
+ return change;
+ }
- @Override
- public HasClickHandlers getChange() {
- return change;
- }
+ @Override
+ public HasClickHandlers getLicenseImage() {
+ return licenseImage;
+ }
- @Override
- public HasClickHandlers getLicenseImage() {
- return licenseImage;
- }
+ @Override
+ public IsWidget getTabTitle() {
+ return tabTitle;
+ }
- @Override
- public IsWidget getTabTitle() {
- return tabTitle;
- }
+ @Override
+ public void openWindow(final String url) {
+ KuneWindowUtils.open(url);
+ }
- @Override
- public void openWindow(final String url) {
- KuneWindowUtils.open(url);
- }
-
- @Override
- public void setLicense(final LicenseDTO defaultLicense) {
- licenseImage.setUrl(defaultLicense.getImageUrl());
- Tooltip.to(licenseImage, defaultLicense.getLongName());
- }
+ @Override
+ public void setLicense(final LicenseDTO defaultLicense) {
+ licenseImage.setUrl(defaultLicense.getImageUrl());
+ Tooltip.to(licenseImage, defaultLicense.getLongName());
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -46,171 +46,172 @@
public class EntityOptionsLogoPanel extends Composite implements EntityOptionsLogoView {
- public static final String ICON_UPLD_SERVLET = "servlets/EntityLogoUploadManager";
- private final Label dialogInfoLabel;
- private final FileUpload fileUpload = new FileUpload();
- private final FormPanel form = new FormPanel();
- private final I18nTranslationService i18n;
- private OnAcceptCallback onAccept;
- private final IconLabel tabTitle;
- private final Hidden tokenField;
- private final Hidden userhashField;
+ public static final String ICON_UPLD_SERVLET = "servlets/EntityLogoUploadManager";
+ private final Label dialogInfoLabel;
+ private final FileUpload fileUpload = new FileUpload();
+ private final FormPanel form = new FormPanel();
+ private final I18nTranslationService i18n;
+ private OnAcceptCallback onAccept;
+ private final IconLabel tabTitle;
+ private final Hidden tokenField;
+ private final Hidden userhashField;
- // private final TextField file;
+ // private final TextField file;
- public EntityOptionsLogoPanel(final EventBus eventBus, final I18nTranslationService i18n, final String panelId,
- final String buttonId, final String inputId, final NavResources res) {
- super();
- this.i18n = i18n;
- tabTitle = new IconLabel(res.picture(), "");
- // super.setButtonAlign(HorizontalAlignment.LEFT);
- // super.setFrame(true);
- // super.setAutoScroll(false);
- // super.setBorder(false);
- // super.setFileUpload(true);
- // super.setWidth(400);
- // super.setIconCls("k-picture-icon");
- // super.setMethod(Method.POST);
- // super.setUrl(ICON_UPLD_SERVLET);
- // super.setWaitMsgTarget(true);
- // super.setHideLabels(true);
- // super.setPadding(10);
- // super.addFormListener(new FormListener() {
- // @Override
- // public boolean doBeforeAction(final Form form) {
- // return true;
- // }
- //
- // @Override
- // public void onActionComplete(final Form form, final int httpStatus,
- // final String responseText) {
- // presenter.onSubmitComplete(httpStatus, responseText);
- // }
- //
- // @Override
- // public void onActionFailed(final Form form, final int httpStatus,
- // final String responseText) {
- // presenter.onSubmitFailed(httpStatus, responseText);
- // }
- // });
- // super.add(dialogInfoLabel);
- // file = new TextField("File", inputId);
- // final EventCallback keyListener = new EventCallback() {
- // @Override
- // public void execute(final EventObject e) {
- // // setEnableFileField();
- // }
- // };
- // file.addKeyPressListener(keyListener);
- // file.setId(inputId);
- // file.setInputType("file");
- // super.add(file);
- // final FieldListenerAdapter changeListener = new
- // FieldListenerAdapter() {
- // @Override
- // public void onChange(final Field field, final Object newVal, final
- // Object oldVal) {
- // NotifyUser.info("change");
- // // setEnableFileField();
- // }
- // };
- // // Don't works:
- // file.addListener(changeListener);
- // setId(panelId);
- //
- // sendButton.setId(buttonId);
- // super.addButton(sendButton);
+ public EntityOptionsLogoPanel(final EventBus eventBus, final I18nTranslationService i18n,
+ final String panelId, final String buttonId, final String inputId, final NavResources res) {
+ super();
+ this.i18n = i18n;
+ tabTitle = new IconLabel(res.picture(), "");
+ // super.setButtonAlign(HorizontalAlignment.LEFT);
+ // super.setFrame(true);
+ // super.setAutoScroll(false);
+ // super.setBorder(false);
+ // super.setFileUpload(true);
+ // super.setWidth(400);
+ // super.setIconCls("k-picture-icon");
+ // super.setMethod(Method.POST);
+ // super.setUrl(ICON_UPLD_SERVLET);
+ // super.setWaitMsgTarget(true);
+ // super.setHideLabels(true);
+ // super.setPadding(10);
+ // super.addFormListener(new FormListener() {
+ // @Override
+ // public boolean doBeforeAction(final Form form) {
+ // return true;
+ // }
+ //
+ // @Override
+ // public void onActionComplete(final Form form, final int httpStatus,
+ // final String responseText) {
+ // presenter.onSubmitComplete(httpStatus, responseText);
+ // }
+ //
+ // @Override
+ // public void onActionFailed(final Form form, final int httpStatus,
+ // final String responseText) {
+ // presenter.onSubmitFailed(httpStatus, responseText);
+ // }
+ // });
+ // super.add(dialogInfoLabel);
+ // file = new TextField("File", inputId);
+ // final EventCallback keyListener = new EventCallback() {
+ // @Override
+ // public void execute(final EventObject e) {
+ // // setEnableFileField();
+ // }
+ // };
+ // file.addKeyPressListener(keyListener);
+ // file.setId(inputId);
+ // file.setInputType("file");
+ // super.add(file);
+ // final FieldListenerAdapter changeListener = new
+ // FieldListenerAdapter() {
+ // @Override
+ // public void onChange(final Field field, final Object newVal, final
+ // Object oldVal) {
+ // NotifyUser.info("change");
+ // // setEnableFileField();
+ // }
+ // };
+ // // Don't works:
+ // file.addListener(changeListener);
+ // setId(panelId);
+ //
+ // sendButton.setId(buttonId);
+ // super.addButton(sendButton);
- dialogInfoLabel = new Label();
+ dialogInfoLabel = new Label();
- form.setEncoding(FormPanel.ENCODING_MULTIPART);
- form.setMethod(FormPanel.METHOD_POST);
- form.setAction(GWT.getModuleBaseURL() + ICON_UPLD_SERVLET);
+ form.setEncoding(FormPanel.ENCODING_MULTIPART);
+ form.setMethod(FormPanel.METHOD_POST);
+ form.setAction(GWT.getModuleBaseURL() + ICON_UPLD_SERVLET);
- userhashField = new Hidden(FileConstants.HASH, FileConstants.HASH);
- tokenField = new Hidden(FileConstants.TOKEN, FileConstants.TOKEN);
+ userhashField = new Hidden(FileConstants.HASH, FileConstants.HASH);
+ tokenField = new Hidden(FileConstants.TOKEN, FileConstants.TOKEN);
- final VerticalPanel holder = new VerticalPanel();
+ final VerticalPanel holder = new VerticalPanel();
- fileUpload.setName("upload");
- holder.add(dialogInfoLabel);
- holder.add(fileUpload);
- holder.add(userhashField);
- holder.add(tokenField);
- holder.add(new Button(i18n.t("Send"), new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- Log.info("You selected: " + fileUpload.getFilename(), null);
- form.submit();
- }
- }));
+ fileUpload.setName("upload");
+ holder.add(dialogInfoLabel);
+ holder.add(fileUpload);
+ holder.add(userhashField);
+ holder.add(tokenField);
+ holder.add(new Button(i18n.t("Send"), new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ Log.info("You selected: " + fileUpload.getFilename(), null);
+ form.submit();
+ }
+ }));
- form.addSubmitHandler(new FormPanel.SubmitHandler() {
- @Override
- public void onSubmit(final SubmitEvent event) {
- // final String filename = file.getValueAsString();
- // if (filename != null && filename.length() > 0) {
- // getForm().submit();
- // }
+ form.addSubmitHandler(new FormPanel.SubmitHandler() {
+ @Override
+ public void onSubmit(final SubmitEvent event) {
+ // final String filename = file.getValueAsString();
+ // if (filename != null && filename.length() > 0) {
+ // getForm().submit();
+ // }
- if (!"".equalsIgnoreCase(fileUpload.getFilename())) {
- GWT.log("UPLOADING FILE????", null);
- // NOW WHAT????
- } else {
- event.cancel(); // cancel the event
- }
+ if (!"".equalsIgnoreCase(fileUpload.getFilename())) {
+ GWT.log("UPLOADING FILE????", null);
+ // NOW WHAT????
+ } else {
+ event.cancel(); // cancel the event
+ }
- }
- });
+ }
+ });
- form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
- @Override
- public void onSubmitComplete(final SubmitCompleteEvent event) {
- CurrentLogoChangedEvent.fire(eventBus);
- }
- });
- form.add(holder);
- initWidget(form);
- setHeight(String.valueOf(EntityOptionsView.HEIGHT));
- }
+ form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
+ @Override
+ public void onSubmitComplete(final SubmitCompleteEvent event) {
+ CurrentLogoChangedEvent.fire(eventBus);
+ }
+ });
+ form.add(holder);
+ initWidget(form);
+ setHeight(String.valueOf(EntityOptionsView.HEIGHT));
+ setWidth(String.valueOf(EntityOptionsView.WIDTH));
+ }
- @Override
- public OnAcceptCallback getOnSubmit() {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public OnAcceptCallback getOnSubmit() {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public IsWidget getTabTitle() {
- return tabTitle;
- }
+ @Override
+ public IsWidget getTabTitle() {
+ return tabTitle;
+ }
- public void reset() {
- form.reset();
- }
+ public void reset() {
+ form.reset();
+ }
- @Override
- public void setNormalGroupsLabels() {
- dialogInfoLabel.setText(i18n.t("Select an image in your computer as the logo for this group. "
- + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
- FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT)
- + TextUtils.brbr());
- tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_NORMAL_TITLE);
- }
+ @Override
+ public void setNormalGroupsLabels() {
+ dialogInfoLabel.setText(i18n.t("Select an image in your computer as the logo for this group. "
+ + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
+ FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT)
+ + TextUtils.brbr());
+ tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_NORMAL_TITLE);
+ }
- @Override
- public void setPersonalGroupsLabels() {
- dialogInfoLabel.setText(i18n.t("Select an image in your computer as your avatar. "
- + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
- FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT)
- + "<br/><br/>");
- tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_PERSON_TITLE);
- }
+ @Override
+ public void setPersonalGroupsLabels() {
+ dialogInfoLabel.setText(i18n.t("Select an image in your computer as your avatar. "
+ + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
+ FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT)
+ + "<br/><br/>");
+ tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_PERSON_TITLE);
+ }
- @Override
- public void setUploadParams(final String userHash, final String token) {
- userhashField.setValue(userHash);
- tokenField.setValue(token);
- }
+ @Override
+ public void setUploadParams(final String userHash, final String token) {
+ userhashField.setValue(userHash);
+ tokenField.setValue(token);
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/gspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -41,92 +41,95 @@
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
-public class EntityOptionsPublicSpaceConfPanel extends VerticalPanel implements EntityOptionsPublicSpaceConfView {
+public class EntityOptionsPublicSpaceConfPanel extends VerticalPanel implements
+ EntityOptionsPublicSpaceConfView {
- private final Image backImage;
- private final Button clearBtn;
- private final Label currentBackLabel;
- private final FileDownloadUtils downUtils;
- private final Label noBackLabel;
- private final IconLabel tabTitle;
+ private final Image backImage;
+ private final Button clearBtn;
+ private final Label currentBackLabel;
+ private final FileDownloadUtils downUtils;
+ private final Label noBackLabel;
+ private final IconLabel tabTitle;
- public EntityOptionsPublicSpaceConfPanel(final I18nTranslationService i18n, final FileDownloadUtils downUtils,
- final CoreResources res) {
- this.downUtils = downUtils;
- tabTitle = new IconLabel(res.themeChoose(), i18n.t("Style"));
- // super.setIconCls("k-colors-icon");
- // super.setAutoScroll(true);
- // super.setBorder(false);
- super.setHeight(String.valueOf(EntityOptionsView.HEIGHT));
- // super.setFrame(true);
- // super.setPaddings(10);
+ public EntityOptionsPublicSpaceConfPanel(final I18nTranslationService i18n,
+ final FileDownloadUtils downUtils, final CoreResources res) {
+ this.downUtils = downUtils;
+ tabTitle = new IconLabel(res.themeChoose(), i18n.t("Style"));
+ // super.setIconCls("k-colors-icon");
+ // super.setAutoScroll(true);
+ // super.setBorder(false);
+ super.setHeight(String.valueOf(EntityOptionsView.HEIGHT));
+ super.setWidth(String.valueOf(EntityOptionsView.WIDTH));
+ // super.setFrame(true);
+ // super.setPaddings(10);
- final HorizontalPanel wsHP = new HorizontalPanel();
- final Label wsThemeInfo = new Label(i18n.t("Change this workspace theme:"));
- // final Widget toolbarWsChange = (Widget) wsSelector.getView();
- // toolbarWsChange.addStyleName("kune-Margin-Medium-l");
- wsHP.add(wsThemeInfo);
- // wsHP.add(toolbarWsChange);
- add(wsHP);
- final VerticalPanel backPanel = new VerticalPanel();
- currentBackLabel = new Label(i18n.t("Current background image: "));
- noBackLabel = new Label(i18n.t("Also you can upload any image and select it later as background."));
- backImage = new Image();
- backImage.addStyleName("kune-Margin-Medium-trbl");
- noBackLabel.addStyleName("kune-Margin-Medium-tb");
- clearBtn = new Button(i18n.t("Clear"));
- Tooltip.to(clearBtn, i18n.t("Remove current background image"));
- backPanel.add(noBackLabel);
- backPanel.add(currentBackLabel);
- backPanel.add(backImage);
- backPanel.add(clearBtn);
- add(backPanel);
- final Label wsInfo = new Label(i18n.t("Select and configure the public space theme of this group:"));
- wsInfo.addStyleName("kune-Margin-Medium-tb");
- add(wsInfo);
+ final HorizontalPanel wsHP = new HorizontalPanel();
+ final Label wsThemeInfo = new Label(i18n.t("Change this workspace theme:"));
+ // final Widget toolbarWsChange = (Widget) wsSelector.getView();
+ // toolbarWsChange.addStyleName("kune-Margin-Medium-l");
+ wsHP.add(wsThemeInfo);
+ // wsHP.add(toolbarWsChange);
+ add(wsHP);
+ final VerticalPanel backPanel = new VerticalPanel();
+ currentBackLabel = new Label(i18n.t("Current background image: "));
+ noBackLabel = new Label(i18n.t("Also you can upload any image and select it later as background."));
+ backImage = new Image();
+ backImage.addStyleName("kune-Margin-Medium-trbl");
+ noBackLabel.addStyleName("kune-Margin-Medium-tb");
+ clearBtn = new Button(i18n.t("Clear"));
+ Tooltip.to(clearBtn, i18n.t("Remove current background image"));
+ backPanel.add(noBackLabel);
+ backPanel.add(currentBackLabel);
+ backPanel.add(backImage);
+ backPanel.add(clearBtn);
+ add(backPanel);
+ final Label wsInfo = new Label(i18n.t("Select and configure the public space theme of this group:"));
+ wsInfo.addStyleName("kune-Margin-Medium-tb");
+ add(wsInfo);
- final VerticalPanel stylesPanel = new VerticalPanel();
- final ClickHandler clickHandler = new ClickHandler() {
+ final VerticalPanel stylesPanel = new VerticalPanel();
+ final ClickHandler clickHandler = new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- NotifyUser.info(TextUtils.IN_DEVELOPMENT_P);
- }
- };
- for (int i = 1; i <= 6; i++) {
- final BasicThumb thumb = new BasicThumb("images/styles/styl" + i + ".png", "Style " + i, clickHandler);
- thumb.setTooltip(i18n.t("Click to select and configure this theme"));
- add(thumb);
- }
- add(stylesPanel);
- setBackImageVisibleImpl(false);
+ @Override
+ public void onClick(final ClickEvent event) {
+ NotifyUser.info(TextUtils.IN_DEVELOPMENT_P);
+ }
+ };
+ for (int i = 1; i <= 6; i++) {
+ final BasicThumb thumb = new BasicThumb("images/styles/styl" + i + ".png", "Style " + i,
+ clickHandler);
+ thumb.setTooltip(i18n.t("Click to select and configure this theme"));
+ add(thumb);
}
+ add(stylesPanel);
+ setBackImageVisibleImpl(false);
+ }
- @Override
- public void clearBackImage() {
- setBackImageVisibleImpl(false);
- }
+ @Override
+ public void clearBackImage() {
+ setBackImageVisibleImpl(false);
+ }
- @Override
- public HasClickHandlers getClearBtn() {
- return clearBtn;
- }
+ @Override
+ public HasClickHandlers getClearBtn() {
+ return clearBtn;
+ }
- @Override
- public IsWidget getTabTitle() {
- return tabTitle;
- }
+ @Override
+ public IsWidget getTabTitle() {
+ return tabTitle;
+ }
- @Override
- public void setBackImage(final StateToken token) {
- backImage.setUrl(downUtils.getImageResizedUrl(token, ImageSize.thumb));
- setBackImageVisibleImpl(true);
- }
+ @Override
+ public void setBackImage(final StateToken token) {
+ backImage.setUrl(downUtils.getImageResizedUrl(token, ImageSize.thumb));
+ setBackImageVisibleImpl(true);
+ }
- private void setBackImageVisibleImpl(final boolean visible) {
- backImage.setVisible(visible);
- currentBackLabel.setVisible(visible);
- clearBtn.setVisible(visible);
- noBackLabel.setVisible(!visible);
- }
+ private void setBackImageVisibleImpl(final boolean visible) {
+ backImage.setVisible(visible);
+ currentBackLabel.setVisible(visible);
+ clearBtn.setVisible(visible);
+ noBackLabel.setVisible(!visible);
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPanel.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPanel.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -41,96 +41,96 @@
import com.google.gwt.user.client.ui.Widget;
public class EntityOptionsToolsConfPanel extends DefaultForm implements EntityOptionsToolsConfView {
- private final HashMap<String, CheckBox> fields;
- private final I18nTranslationService i18n;
- private final IconLabel tabTitle;
+ private final HashMap<String, CheckBox> fields;
+ private final I18nTranslationService i18n;
+ private final IconLabel tabTitle;
- public EntityOptionsToolsConfPanel(final I18nTranslationService i18n, final CoreResources res) {
- tabTitle = new IconLabel(res.kunePreferences(), i18n.t("Tools"));
- this.i18n = i18n;
- super.setHeight(EntityOptionsView.HEIGHT);
- super.setFrame(true);
- super.add(new HiddenField());
- super.getFormPanel().setLabelWidth(20);
- fields = new HashMap<String, CheckBox>();
- }
+ public EntityOptionsToolsConfPanel(final I18nTranslationService i18n, final CoreResources res) {
+ tabTitle = new IconLabel(res.kunePreferences(), i18n.t("Tools"));
+ this.i18n = i18n;
+ super.setHeight(EntityOptionsView.HEIGHT);
+ super.setWidth(EntityOptionsView.WIDTH);
+ super.setFrame(true);
+ super.add(new HiddenField());
+ super.getFormPanel().setLabelWidth(20);
+ fields = new HashMap<String, CheckBox>();
+ }
- @Override
- public void add(final ToolSimpleDTO tool, final ClickHandler handler) {
- final CheckBox checkbox = new CheckBox();
- checkbox.setFieldLabel(tool.getRootName());
- checkbox.setValue(false);
- checkbox.addListener(Events.Change, new Listener<BaseEvent>() {
- @Override
- public void handleEvent(final BaseEvent be) {
- handler.onClick(null);
- // presenter.onCheck(tool, checked);
- }
- });
- super.add(checkbox);
- fields.put(tool.getName(), checkbox);
- doLayoutIfNeeded();
- }
+ @Override
+ public void add(final ToolSimpleDTO tool, final ClickHandler handler) {
+ final CheckBox checkbox = new CheckBox();
+ checkbox.setFieldLabel(tool.getRootName());
+ checkbox.setValue(false);
+ checkbox.addListener(Events.Change, new Listener<BaseEvent>() {
+ @Override
+ public void handleEvent(final BaseEvent be) {
+ handler.onClick(null);
+ // presenter.onCheck(tool, checked);
+ }
+ });
+ super.add(checkbox);
+ fields.put(tool.getName(), checkbox);
+ doLayoutIfNeeded();
+ }
- @Override
- public Widget asWidget() {
- return super.getFormPanel();
- }
+ @Override
+ public Widget asWidget() {
+ return super.getFormPanel();
+ }
- @Override
- public void clear() {
- super.getFormPanel().removeAll();
- fields.clear();
- final Label label = new Label();
- label.setText(i18n.t("Here you can select the tools used:"));// +
- // "<br/><br/>");
- super.add(label);
- }
+ @Override
+ public void clear() {
+ super.getFormPanel().removeAll();
+ fields.clear();
+ final Label label = new Label();
+ label.setText(i18n.t("Here you can select the tools used:"));
+ super.add(label);
+ }
- private void doLayoutIfNeeded() {
- if (super.getFormPanel().isRendered()) {
- super.getFormPanel().layout();
- }
+ private void doLayoutIfNeeded() {
+ if (super.getFormPanel().isRendered()) {
+ super.getFormPanel().layout();
}
+ }
- @Override
- public IsWidget getTabTitle() {
- return tabTitle;
- }
+ @Override
+ public IsWidget getTabTitle() {
+ return tabTitle;
+ }
- private CheckBox getTool(final String tool) {
- final CheckBox field = fields.get(tool);
- if (field == null) {
- Log.error("Field " + tool + " not found in EOTCP");
- }
- return field;
+ private CheckBox getTool(final String tool) {
+ final CheckBox field = fields.get(tool);
+ if (field == null) {
+ Log.error("Field " + tool + " not found in EOTCP");
}
+ return field;
+ }
- @Override
- public boolean isChecked(final String tool) {
- final CheckBox field = getTool(tool);
- return field.getValue();
- }
+ @Override
+ public boolean isChecked(final String tool) {
+ final CheckBox field = getTool(tool);
+ return field.getValue();
+ }
- @Override
- public void setChecked(final String tool, final boolean checked) {
- final CheckBox field = getTool(tool);
- field.setValue(checked);
- }
+ @Override
+ public void setChecked(final String tool, final boolean checked) {
+ final CheckBox field = getTool(tool);
+ field.setValue(checked);
+ }
- @Override
- public void setEnabled(final String tool, final boolean enabled) {
- final CheckBox field = getTool(tool);
- if (enabled) {
- field.enable();
- } else {
- field.disable();
- }
+ @Override
+ public void setEnabled(final String tool, final boolean enabled) {
+ final CheckBox field = getTool(tool);
+ if (enabled) {
+ field.enable();
+ } else {
+ field.disable();
}
+ }
- @Override
- public void setTooltip(final String tool, final String tip) {
- final CheckBox field = getTool(tool);
- Tooltip.to(field, tip);
- }
+ @Override
+ public void setTooltip(final String tool, final String tip) {
+ final CheckBox field = getTool(tool);
+ Tooltip.to(field, tip);
+ }
}
Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -103,7 +103,7 @@
// Please also see WebClientDemo.gwt.xml.
private static final Logger REMOTE_LOG = Logger.getLogger("REMOTE_LOG");
- private final ProfileManager profiles = new ProfileManagerImpl();
+ private final ProfileManager profiles = new ProfileManagerImpl(Session.get().getDomain());
@UiField
SplitLayoutPanel splitPanel;
@@ -262,13 +262,9 @@
* Returns <code>ws://yourhost[:port]/</code>.
*/
// XXX check formatting wrt GPE
- public native static String getWebSocketBaseUrl(String moduleBase) /*-{
- return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
-}-*/;
+ private native String getWebSocketBaseUrl(String moduleBase) /*-{return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";}-*/;
- public native static boolean useSocketIO() /*-{
- return !!$wnd.__useSocketIO
-}-*/;
+ private native boolean useSocketIO() /*-{ return !!$wnd.__useSocketIO }-*/;
/**
*/
Modified: trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -40,139 +40,141 @@
import com.google.wave.api.impl.WaveletData;
public class KuneWaveManagerDefault implements KuneWaveManager {
- public static final Log LOG = LogFactory.getLog(KuneWaveManagerDefault.class);
+ public static final Log LOG = LogFactory.getLog(KuneWaveManagerDefault.class);
- private static final String NO_TITLE = "";
+ private static final String NO_TITLE = "";
- private final ConversationUtil conversationUtil;
- private final EventDataConverterManager converterManager;
- private final String domain;
- private final OperationServiceRegistry operationRegistry;
- private final ParticipantUtils participantUtils;
- private final WaveletProvider waveletProvider;
+ private final ConversationUtil conversationUtil;
+ private final EventDataConverterManager converterManager;
+ private final String domain;
+ private final OperationServiceRegistry operationRegistry;
+ private final ParticipantUtils participantUtils;
+ private final WaveletProvider waveletProvider;
- @Inject
- public KuneWaveManagerDefault(final EventDataConverterManager converterManager,
- @Named("DataApiRegistry") final OperationServiceRegistry operationRegistry,
- final WaveletProvider waveletProvider, final ConversationUtil conversationUtil,
- final ParticipantUtils participantUtils, @Named(CoreSettings.WAVE_SERVER_DOMAIN) final String domain) {
- this.converterManager = converterManager;
- this.waveletProvider = waveletProvider;
- this.conversationUtil = conversationUtil;
- this.operationRegistry = operationRegistry;
- this.participantUtils = participantUtils;
- this.domain = domain;
- }
+ @Inject
+ public KuneWaveManagerDefault(final EventDataConverterManager converterManager,
+ @Named("DataApiRegistry") final OperationServiceRegistry operationRegistry,
+ final WaveletProvider waveletProvider, final ConversationUtil conversationUtil,
+ final ParticipantUtils participantUtils,
+ @Named(CoreSettings.WAVE_SERVER_DOMAIN) final String domain) {
+ this.converterManager = converterManager;
+ this.waveletProvider = waveletProvider;
+ this.conversationUtil = conversationUtil;
+ this.operationRegistry = operationRegistry;
+ this.participantUtils = participantUtils;
+ this.domain = domain;
+ }
- @Override
- public WaveRef createWave(final String message, final ParticipantId participant) {
- return createWave(NO_TITLE, message, participant);
+ @Override
+ public WaveRef createWave(final String message, final ParticipantId participant) {
+ return createWave(NO_TITLE, message, participant);
+ }
+
+ @Override
+ public WaveRef createWave(@Nonnull final String title, final String message,
+ @Nonnull final ParticipantId... participantsArray) {
+ String newWaveId = null;
+ String newWaveletId = null;
+ final Set<String> participants = new HashSet<String>();
+ for (final ParticipantId participant : participantsArray) {
+ participants.add(participant.toString());
}
-
- @Override
- public WaveRef createWave(@Nonnull final String title, final String message,
- @Nonnull final ParticipantId... participantsArray) {
- String newWaveId = null;
- String newWaveletId = null;
- final Set<String> participants = new HashSet<String>();
- for (final ParticipantId participant : participantsArray) {
- participants.add(participant.toString());
+ final ParticipantId user = participantsArray[0];
+ final OperationQueue opQueue = new OperationQueue();
+ final Wavelet newWavelet = opQueue.createWavelet(domain, participants);
+ opQueue.setTitleOfWavelet(newWavelet, title);
+ final Blip rootBlip = newWavelet.getRootBlip();
+ rootBlip.append(new com.google.wave.api.Markup(message).getText());
+ final OperationContextImpl context = new OperationContextImpl(waveletProvider,
+ converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
+ for (final OperationRequest req : opQueue.getPendingOperations()) {
+ OperationUtil.executeOperation(req, operationRegistry, context, user);
+ final String reqId = req.getId();
+ final JsonRpcResponse response = context.getResponse(reqId);
+ if (response != null) {
+ if (response.isError()) {
+ onFailure(context.getResponse(reqId).getErrorMessage());
+ } else {
+ final Object responseWaveId = response.getData().get(ParamsProperty.WAVE_ID);
+ final Object responseWaveletId = response.getData().get(ParamsProperty.WAVELET_ID);
+ if (responseWaveId != null && responseWaveletId != null) {
+ // This is serialized use
+ // ApiIdSerializer.instance().deserialiseWaveId (see
+ // WaveService)
+ newWaveId = (String) responseWaveId;
+ newWaveletId = (String) responseWaveletId;
+ }
}
- final ParticipantId user = participantsArray[0];
- final OperationQueue opQueue = new OperationQueue();
- final Wavelet newWavelet = opQueue.createWavelet(domain, participants);
- final Blip rootBlip = newWavelet.getRootBlip();
- rootBlip.append(new com.google.wave.api.Markup(message).getText());
- final OperationContextImpl context = new OperationContextImpl(waveletProvider,
- converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
- for (final OperationRequest req : opQueue.getPendingOperations()) {
- OperationUtil.executeOperation(req, operationRegistry, context, user);
- final String reqId = req.getId();
- final JsonRpcResponse response = context.getResponse(reqId);
- if (response != null) {
- if (response.isError()) {
- onFailure(context.getResponse(reqId).getErrorMessage());
- } else {
- final Object responseWaveId = response.getData().get(ParamsProperty.WAVE_ID);
- final Object responseWaveletId = response.getData().get(ParamsProperty.WAVELET_ID);
- if (responseWaveId != null && responseWaveletId != null) {
- // This is serialized use
- // ApiIdSerializer.instance().deserialiseWaveId (see
- // WaveService)
- newWaveId = (String) responseWaveId;
- newWaveletId = (String) responseWaveletId;
- }
- }
- }
- }
- OperationUtil.submitDeltas(context, waveletProvider, new SubmitRequestListener() {
- @Override
- public void onFailure(final String arg0) {
- KuneWaveManagerDefault.this.onFailure("Wave creation failed, onFailure: " + arg0);
- }
+ }
+ }
+ OperationUtil.submitDeltas(context, waveletProvider, new SubmitRequestListener() {
+ @Override
+ public void onFailure(final String arg0) {
+ KuneWaveManagerDefault.this.onFailure("Wave creation failed, onFailure: " + arg0);
+ }
- @Override
- public void onSuccess(final int arg0, final HashedVersion arg1, final long arg2) {
- LOG.info("Wave creation success: " + arg1);
- }
- });
- LOG.info("WaveId: " + newWaveId + " waveletId: " + newWaveletId);
- WaveRef wavename;
- try {
- wavename = WaveRef.of(ApiIdSerializer.instance().deserialiseWaveId(newWaveId),
- ApiIdSerializer.instance().deserialiseWaveletId(newWaveletId));
- } catch (final InvalidIdException e) {
- throw new DefaultException("Error getting wave id");
- }
- return wavename;
+ @Override
+ public void onSuccess(final int arg0, final HashedVersion arg1, final long arg2) {
+ LOG.info("Wave creation success: " + arg1);
+ }
+ });
+ LOG.info("WaveId: " + newWaveId + " waveletId: " + newWaveletId);
+ WaveRef wavename;
+ try {
+ wavename = WaveRef.of(ApiIdSerializer.instance().deserialiseWaveId(newWaveId),
+ ApiIdSerializer.instance().deserialiseWaveletId(newWaveletId));
+ } catch (final InvalidIdException e) {
+ throw new DefaultException("Error getting wave id");
}
+ return wavename;
+ }
- @Override
- public Wavelet fetchWavelet(final WaveRef waveName, final String author) {
- Wavelet wavelet = null;
- final OperationQueue opQueue = new OperationQueue();
- opQueue.fetchWavelet(waveName.getWaveId(), waveName.getWaveletId());
- final OperationContextImpl context = new OperationContextImpl(waveletProvider,
- converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
- final OperationRequest request = opQueue.getPendingOperations().get(0);
- OperationUtil.executeOperation(request, operationRegistry, context, participantUtils.of(author));
- final String reqId = request.getId();
- final JsonRpcResponse response = context.getResponse(reqId);
- if (response != null) {
- if (response.isError()) {
- onFailure(context.getResponse(reqId).getErrorMessage());
- } else {
- // Duplicate code from WaveService
- final WaveletData waveletData = (WaveletData) response.getData().get(ParamsProperty.WAVELET_DATA);
- final Map<String, Blip> blips = new HashMap<String, Blip>();
- final Map<String, BlipThread> threads = new HashMap<String, BlipThread>();
- wavelet = Wavelet.deserialize(opQueue, blips, threads, waveletData);
+ @Override
+ public Wavelet fetchWavelet(final WaveRef waveName, final String author) {
+ Wavelet wavelet = null;
+ final OperationQueue opQueue = new OperationQueue();
+ opQueue.fetchWavelet(waveName.getWaveId(), waveName.getWaveletId());
+ final OperationContextImpl context = new OperationContextImpl(waveletProvider,
+ converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
+ final OperationRequest request = opQueue.getPendingOperations().get(0);
+ OperationUtil.executeOperation(request, operationRegistry, context, participantUtils.of(author));
+ final String reqId = request.getId();
+ final JsonRpcResponse response = context.getResponse(reqId);
+ if (response != null) {
+ if (response.isError()) {
+ onFailure(context.getResponse(reqId).getErrorMessage());
+ } else {
+ // Duplicate code from WaveService
+ final WaveletData waveletData = (WaveletData) response.getData().get(ParamsProperty.WAVELET_DATA);
+ final Map<String, Blip> blips = new HashMap<String, Blip>();
+ final Map<String, BlipThread> threads = new HashMap<String, BlipThread>();
+ wavelet = Wavelet.deserialize(opQueue, blips, threads, waveletData);
- // Deserialize threads.
- @SuppressWarnings("unchecked")
- final Map<String, BlipThread> tempThreads = (Map<String, BlipThread>) response.getData().get(
- ParamsProperty.THREADS);
- for (final Map.Entry<String, BlipThread> entry : tempThreads.entrySet()) {
- final BlipThread thread = entry.getValue();
- threads.put(entry.getKey(),
- new BlipThread(thread.getId(), thread.getLocation(), thread.getBlipIds(), blips));
- }
+ // Deserialize threads.
+ @SuppressWarnings("unchecked")
+ final Map<String, BlipThread> tempThreads = (Map<String, BlipThread>) response.getData().get(
+ ParamsProperty.THREADS);
+ for (final Map.Entry<String, BlipThread> entry : tempThreads.entrySet()) {
+ final BlipThread thread = entry.getValue();
+ threads.put(entry.getKey(),
+ new BlipThread(thread.getId(), thread.getLocation(), thread.getBlipIds(), blips));
+ }
- // Deserialize blips.
- @SuppressWarnings("unchecked")
- final Map<String, BlipData> blipDatas = (Map<String, BlipData>) response.getData().get(
- ParamsProperty.BLIPS);
- for (final Map.Entry<String, BlipData> entry : blipDatas.entrySet()) {
- blips.put(entry.getKey(), Blip.deserialize(opQueue, wavelet, entry.getValue()));
- }
- }
+ // Deserialize blips.
+ @SuppressWarnings("unchecked")
+ final Map<String, BlipData> blipDatas = (Map<String, BlipData>) response.getData().get(
+ ParamsProperty.BLIPS);
+ for (final Map.Entry<String, BlipData> entry : blipDatas.entrySet()) {
+ blips.put(entry.getKey(), Blip.deserialize(opQueue, wavelet, entry.getValue()));
}
- return wavelet;
+ }
}
+ return wavelet;
+ }
- private void onFailure(final String message) {
- final String errorMsg = TextUtils.notEmpty(message) ? message : "Wave operation failed";
- LOG.error(errorMsg);
- throw new DefaultException(errorMsg);
- }
+ private void onFailure(final String message) {
+ final String errorMsg = TextUtils.notEmpty(message) ? message : "Wave operation failed";
+ LOG.error(errorMsg);
+ throw new DefaultException(errorMsg);
+ }
}
Modified: trunk/src/main/java/cc/kune/wave/server/WaveMain.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-04-28 13:50:23 UTC (rev 1325)
+++ trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-04-28 18:00:03 UTC (rev 1326)
@@ -124,7 +124,7 @@
initializeServer(injector, domain);
initializeServlets(injector, server);
initializeRobots(injector, waveBus);
- initializeFrontend(injector, server, waveBus, domain);
+ initializeFrontend(injector, server, waveBus);
initializeFederation(injector);
LOG.info("Starting server");
@@ -201,12 +201,12 @@
}
private static void initializeFrontend(Injector injector, ServerRpcProvider server,
- WaveBus waveBus, String waveDomain) throws WaveServerException {
+ WaveBus waveBus) throws WaveServerException {
HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class);
WaveletProvider provider = injector.getInstance(WaveletProvider.class);
ClientFrontend frontend =
- ClientFrontendImpl.create(hashFactory, provider, waveBus, waveDomain);
+ ClientFrontendImpl.create(hashFactory, provider, waveBus);
ProtocolWaveClientRpc.Interface rpcImpl = WaveClientRpcImpl.create(frontend, false);
server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl));
More information about the kune-commits
mailing list