[kune-commits] r1356 - in trunk: . script src/main/java/cc/kune/core/client/sitebar/spaces src/main/java/cc/kune/core/client/ws/entheader src/main/java/cc/kune/core/public src/main/java/cc/kune/core/server src/main/java/cc/kune/core/server/manager/file src/main/java/cc/kune/core/server/properties src/main/java/cc/kune/gspace src/main/java/cc/kune/gspace/client src/main/java/cc/kune/gspace/client/options/logo src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/msgs/client src/main/java/org/ourproject/kune/workspace/client src/main/java/org/ourproject/kune/workspace/client/oldsn src/main/java/org/ourproject/kune/workspace/client/sitebar src/main/resources src/test/java/org/ourproject/kune/workspace/client/socialnet
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Fri May 6 22:13:53 CEST 2011
Author: vjrj_
Date: 2011-05-06 22:13:51 +0200 (Fri, 06 May 2011)
New Revision: 1356
Added:
trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadServlet.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupActionRegistry.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipateAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/RolAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UIStatus.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UnjoinButtonAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UserActionRegistry.java
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/other/
trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/toolbar/
trunk/src/main/java/org/ourproject/kune/workspace/client/options/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/
trunk/src/test/java/org/ourproject/kune/workspace/client/socialnet/SNRolActionTest.java
Modified:
trunk/.classpath
trunk/README_FIRST
trunk/pom.xml
trunk/script/mvn-eclipse.sh
trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
trunk/src/main/java/cc/kune/core/public/ws.css
trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java
trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
trunk/src/main/java/cc/kune/gspace/GSpace.gwt.xml
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoView.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java
trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java
trunk/src/main/resources/kune.properties
Log:
Better uploader
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/.classpath 2011-05-06 20:13:51 UTC (rev 1356)
@@ -24,8 +24,8 @@
<classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-fileupload/commons-fileupload/1.1.1/commons-fileupload-1.1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.2/commons-io-1.2.jar" sourcepath="M2_REPO/commons-io/commons-io/1.2/commons-io-1.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar" sourcepath="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1.jar" sourcepath="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.0-SNAPSHOT/communication-src-0.3.0-SNAPSHOT.jar"/>
@@ -61,6 +61,7 @@
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-mvp-client/0.5/gwtp-mvp-client-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-mvp-client/0.5/gwtp-mvp-client-0.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-processors/0.5/gwtp-processors-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-processors/0.5/gwtp-processors-0.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-tester/0.5/gwtp-tester-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-tester/0.5/gwtp-tester-0.5-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/googlecode/gwtupload/gwtupload/0.6.3-compat/gwtupload-0.6.3-compat.jar" sourcepath="M2_REPO/com/googlecode/gwtupload/gwtupload/0.6.3-compat/gwtupload-0.6.3-compat-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/extjs/gxt/2.2.1/gxt-2.2.1.jar"/>
<classpathentry kind="var" path="M2_REPO/com/h2database/h2/1.0.20070617/h2-1.0.20070617.jar"/>
<classpathentry kind="var" path="M2_REPO/com/calclab/emite/hablar/r1697/hablar-r1697.jar"/>
Modified: trunk/README_FIRST
===================================================================
--- trunk/README_FIRST 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/README_FIRST 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,4 +1,4 @@
WARNING
-Please note that we are doing a big refactorization of Kune to adapt it to Wave. Also we are starting to use other libraries (for instance gin for IoC instead of our old Suco library). Then don't expect to much of /trunk/ because of that (for our old more stable code see tag 0.0.6-pre-wiab).
+Please note that we are doing a big refactorization of Kune to adapt it to Wave. Also we are starting to use other libraries (for instance gin for IoC instead of our old Suco library). Then maybe /trunk/ it's a litle bit inestable because of that (for our old more stable code see tag 0.0.6-pre-wiab).
New code (and refactorized) is under cc.kune package. Our old code (not yet refactorized or deprecated) is under org.ourproject.kune package waiting for be adapted or removed.
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/pom.xml 2011-05-06 20:13:51 UTC (rev 1356)
@@ -462,7 +462,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>1.2</version>
+ <version>1.3.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
@@ -472,7 +472,7 @@
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
- <version>1.1.1</version>
+ <version>1.2</version>
</dependency>
<!-- db upgrades -->
<dependency>
@@ -613,7 +613,15 @@
<version>1.4</version>
<type>jar</type>
</dependency>
+ <!-- gwtupload -->
+ <dependency>
+ <groupId>com.googlecode.gwtupload</groupId>
+ <artifactId>gwtupload</artifactId>
+ <version>0.6.3-compat</version>
+ </dependency>
+ <!-- end gwtupload -->
</dependencies>
+
<!-- <dependency> -->
<!-- <groupId>dom4j</groupId> -->
<!-- <artifactId>dom4j</artifactId> -->
Modified: trunk/script/mvn-eclipse.sh
===================================================================
--- trunk/script/mvn-eclipse.sh 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/script/mvn-eclipse.sh 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,4 +1,4 @@
-mvn eclipse:eclipse -Dgwt.compiler.skip=true
+mvn eclipse:eclipse -o -Dgwt.compiler.skip=true
RESULT=$?
perl -p -i -e 's/<\/classpath>//g' .classpath
#perl -p -i -e 's/\/home\/vjrj\/nfsdev\///g' .classpath
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -43,182 +43,182 @@
import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
public class SpaceSelectorPresenter extends
- Presenter<SpaceSelectorPresenter.SpaceSelectorView, SpaceSelectorPresenter.SpaceSelectorProxy> {
+ Presenter<SpaceSelectorPresenter.SpaceSelectorView, SpaceSelectorPresenter.SpaceSelectorProxy> {
- @ProxyCodeSplit
- public interface SpaceSelectorProxy extends Proxy<SpaceSelectorPresenter> {
- }
+ @ProxyCodeSplit
+ public interface SpaceSelectorProxy extends Proxy<SpaceSelectorPresenter> {
+ }
- public interface SpaceSelectorView extends View {
+ public interface SpaceSelectorView extends View {
- HasClickHandlers getGroupBtn();
+ HasClickHandlers getGroupBtn();
- HasClickHandlers getHomeBtn();
+ HasClickHandlers getHomeBtn();
- HasClickHandlers getPublicBtn();
+ HasClickHandlers getPublicBtn();
- HasClickHandlers getUserBtn();
+ HasClickHandlers getUserBtn();
- void setGroupBtnDown(boolean down);
+ void setGroupBtnDown(boolean down);
- void setHomeBtnDown(boolean down);
+ void setHomeBtnDown(boolean down);
- void setPublicBtnDown(boolean down);
+ void setPublicBtnDown(boolean down);
- void setUserBtnDown(boolean down);
- }
+ void setUserBtnDown(boolean down);
+ }
- private final GSpaceArmor armor;
- private Space currentSpace;
- private String groupToken;
- private String homeToken;
- private String publicToken;
- private final Session session;
- private final Provider<SignIn> signIn;
- private final StateManager stateManager;
- private String userToken;
+ private final GSpaceArmor armor;
+ private Space currentSpace;
+ private String groupToken;
+ private String homeToken;
+ private String publicToken;
+ private final Session session;
+ private final Provider<SignIn> signIn;
+ private final StateManager stateManager;
+ private String userToken;
- @Inject
- public SpaceSelectorPresenter(final EventBus eventBus, final StateManager stateManager,
- final SpaceSelectorView view, final SpaceSelectorProxy proxy, final GSpaceArmor armor,
- final Session session, final Provider<SignIn> signIn) {
- super(eventBus, view, proxy);
- this.stateManager = stateManager;
- this.armor = armor;
- this.session = session;
- this.signIn = signIn;
- currentSpace = null;
- homeToken = SiteTokens.HOME;
- userToken = SiteTokens.WAVEINBOX;
- groupToken = SiteTokens.GROUP_HOME;
- publicToken = TokenUtils.preview(SiteTokens.GROUP_HOME);
- view.getHomeBtn().addClickHandler(new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- stateManager.gotoHistoryToken(homeToken);
- }
- });
- view.getUserBtn().addClickHandler(new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- stateManager.gotoHistoryToken(userToken);
- }
- });
- view.getGroupBtn().addClickHandler(new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- stateManager.gotoHistoryToken(groupToken);
- }
- });
- view.getPublicBtn().addClickHandler(new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- stateManager.gotoHistoryToken(publicToken);
- }
- });
- }
+ @Inject
+ public SpaceSelectorPresenter(final EventBus eventBus, final StateManager stateManager,
+ final SpaceSelectorView view, final SpaceSelectorProxy proxy, final GSpaceArmor armor,
+ final Session session, final Provider<SignIn> signIn) {
+ super(eventBus, view, proxy);
+ this.stateManager = stateManager;
+ this.armor = armor;
+ this.session = session;
+ this.signIn = signIn;
+ currentSpace = null;
+ homeToken = SiteTokens.HOME;
+ userToken = SiteTokens.WAVEINBOX;
+ groupToken = SiteTokens.GROUP_HOME;
+ publicToken = TokenUtils.preview(SiteTokens.GROUP_HOME);
+ view.getHomeBtn().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ stateManager.gotoHistoryToken(homeToken);
+ }
+ });
+ view.getUserBtn().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ stateManager.gotoHistoryToken(userToken);
+ }
+ });
+ view.getGroupBtn().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ stateManager.gotoHistoryToken(groupToken);
+ }
+ });
+ view.getPublicBtn().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ stateManager.gotoHistoryToken(publicToken);
+ }
+ });
+ }
- @ProxyEvent
- public void onAppStart(final AppStartEvent event) {
- }
+ @ProxyEvent
+ public void onAppStart(final AppStartEvent event) {
+ }
- private void onGroupSpaceSelect() {
- armor.selectGroupSpace();
- getView().setHomeBtnDown(false);
- getView().setUserBtnDown(false);
- getView().setGroupBtnDown(true);
- getView().setPublicBtnDown(false);
- currentSpace = Space.groupSpace;
- }
+ private void onGroupSpaceSelect() {
+ armor.selectGroupSpace();
+ getView().setHomeBtnDown(false);
+ getView().setUserBtnDown(false);
+ getView().setGroupBtnDown(true);
+ getView().setPublicBtnDown(false);
+ currentSpace = Space.groupSpace;
+ }
- private void onHomeSpaceSelect() {
- armor.selectHomeSpace();
- getView().setHomeBtnDown(true);
- getView().setUserBtnDown(false);
- getView().setGroupBtnDown(false);
- getView().setPublicBtnDown(false);
- currentSpace = Space.homeSpace;
- }
+ private void onHomeSpaceSelect() {
+ armor.selectHomeSpace();
+ getView().setHomeBtnDown(true);
+ getView().setUserBtnDown(false);
+ getView().setGroupBtnDown(false);
+ getView().setPublicBtnDown(false);
+ currentSpace = Space.homeSpace;
+ }
- private void onPublicSpaceSelect() {
- armor.selectPublicSpace();
- getView().setHomeBtnDown(false);
- getView().setUserBtnDown(false);
- getView().setGroupBtnDown(false);
- getView().setPublicBtnDown(true);
- currentSpace = Space.publicSpace;
- }
+ private void onPublicSpaceSelect() {
+ armor.selectPublicSpace();
+ getView().setHomeBtnDown(false);
+ getView().setUserBtnDown(false);
+ getView().setGroupBtnDown(false);
+ getView().setPublicBtnDown(true);
+ currentSpace = Space.publicSpace;
+ }
- @ProxyEvent
- public void onSpaceConf(final SpaceConfEvent event) {
- final Space space = event.getSpace();
- final String token = event.getToken();
- switch (space) {
- case homeSpace:
- homeToken = token;
- break;
- case userSpace:
- userToken = token;
- break;
- case groupSpace:
- groupToken = token;
- break;
- case publicSpace:
- publicToken = token;
- break;
- }
+ @ProxyEvent
+ public void onSpaceConf(final SpaceConfEvent event) {
+ final Space space = event.getSpace();
+ final String token = event.getToken();
+ switch (space) {
+ case homeSpace:
+ homeToken = token;
+ break;
+ case userSpace:
+ userToken = token;
+ break;
+ case groupSpace:
+ groupToken = token;
+ break;
+ case publicSpace:
+ publicToken = token;
+ break;
}
+ }
- @ProxyEvent
- public void onSpaceSelect(final SpaceSelectEvent event) {
- final Space space = event.getSpace();
- if (space != currentSpace) {
- switch (space) {
- case homeSpace:
- onHomeSpaceSelect();
- break;
- case userSpace:
- onUserSpaceSelect();
- break;
- case groupSpace:
- onGroupSpaceSelect();
- break;
- case publicSpace:
- onPublicSpaceSelect();
- break;
- default:
- break;
- }
- // getView().hideTooltip();
- }
+ @ProxyEvent
+ public void onSpaceSelect(final SpaceSelectEvent event) {
+ final Space space = event.getSpace();
+ if (space != currentSpace) {
+ switch (space) {
+ case homeSpace:
+ onHomeSpaceSelect();
+ break;
+ case userSpace:
+ onUserSpaceSelect();
+ break;
+ case groupSpace:
+ onGroupSpaceSelect();
+ break;
+ case publicSpace:
+ onPublicSpaceSelect();
+ break;
+ default:
+ break;
+ }
+ // getView().hideTooltip();
}
+ }
- @ProxyEvent
- public void onUserSignOut(final UserSignOutEvent event) {
- if (currentSpace == Space.userSpace) {
- stateManager.gotoHistoryToken(homeToken);
- }
- userToken = SiteTokens.WAVEINBOX;
+ @ProxyEvent
+ public void onUserSignOut(final UserSignOutEvent event) {
+ if (currentSpace == Space.userSpace) {
+ stateManager.gotoHistoryToken(homeToken);
}
+ userToken = SiteTokens.WAVEINBOX;
+ }
- private void onUserSpaceSelect() {
- if (session.isLogged()) {
- armor.selectUserSpace();
- getView().setHomeBtnDown(false);
- getView().setUserBtnDown(true);
- getView().setGroupBtnDown(false);
- getView().setPublicBtnDown(false);
- currentSpace = Space.userSpace;
- } else {
- signIn.get().setErrorMessage("Sign in to access to your workspace", NotifyLevel.info);
- stateManager.gotoHistoryToken(TokenUtils.addRedirect(SiteTokens.SIGNIN, userToken));
- getView().setUserBtnDown(false);
- // NotifyUser.info("Sign in to access to your workspace");
- }
+ private void onUserSpaceSelect() {
+ if (session.isLogged()) {
+ armor.selectUserSpace();
+ getView().setHomeBtnDown(false);
+ getView().setUserBtnDown(true);
+ getView().setGroupBtnDown(false);
+ getView().setPublicBtnDown(false);
+ currentSpace = Space.userSpace;
+ } else {
+ signIn.get().setErrorMessage("Sign in to access to your inbox", NotifyLevel.info);
+ stateManager.gotoHistoryToken(TokenUtils.addRedirect(SiteTokens.SIGNIN, userToken));
+ getView().setUserBtnDown(false);
+ // NotifyUser.info("Sign in to access to your workspace");
}
+ }
- @Override
- protected void revealInParent() {
- RevealRootContentEvent.fire(this, this);
- }
+ @Override
+ protected void revealInParent() {
+ RevealRootContentEvent.fire(this, this);
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -26,6 +26,8 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.gspace.client.options.logo.CurrentLogoChangedEvent;
+import cc.kune.gspace.client.options.logo.CurrentLogoChangedEvent.CurrentLogoChangedHandler;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.IsWidget;
@@ -37,109 +39,115 @@
import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
public class EntityHeaderPresenter extends
- Presenter<EntityHeaderPresenter.EntityHeaderView, EntityHeaderPresenter.EntityHeaderProxy> implements
- EntityHeader {
+ Presenter<EntityHeaderPresenter.EntityHeaderView, EntityHeaderPresenter.EntityHeaderProxy> implements
+ EntityHeader {
- @ProxyCodeSplit
- public interface EntityHeaderProxy extends Proxy<EntityHeaderPresenter> {
- }
- public interface EntityHeaderView extends View {
- void addAction(GuiActionDescrip descriptor);
+ @ProxyCodeSplit
+ public interface EntityHeaderProxy extends Proxy<EntityHeaderPresenter> {
+ }
+ public interface EntityHeaderView extends View {
+ void addAction(GuiActionDescrip descriptor);
- void addWidget(IsWidget widget);
+ void addWidget(IsWidget widget);
- void reloadImage(GroupDTO group);
+ void reloadImage(GroupDTO group);
- void setLargeFont();
+ void setLargeFont();
- void setLogoImage(StateToken stateToken);
+ void setLogoImage(StateToken stateToken);
- void setLogoImageVisible(boolean visible);
+ void setLogoImageVisible(boolean visible);
- void setLogoText(final String groupName);
+ void setLogoText(final String groupName);
- void setMediumFont();
+ void setMediumFont();
- void setSmallFont();
+ void setSmallFont();
- // void setTheme(final WsTheme oldTheme, WsTheme newTheme);
+ // void setTheme(final WsTheme oldTheme, WsTheme newTheme);
- void showDefUserLogo();
- }
+ void showDefUserLogo();
+ }
- private static final int LARGE_NAME_LIMIT = 17;
- private static final int MEDIUM_NAME_LIMIT = 90;
- private final Session session;
+ private static final int LARGE_NAME_LIMIT = 17;
+ private static final int MEDIUM_NAME_LIMIT = 90;
+ private final Session session;
- @Inject
- public EntityHeaderPresenter(final EventBus eventBus, final EntityHeaderView view, final EntityHeaderProxy proxy,
- final StateManager stateManager, final Session session) {
- super(eventBus, view, proxy);
- this.session = session;
- stateManager.onGroupChanged(true, new GroupChangedHandler() {
- @Override
- public void onGroupChanged(final GroupChangedEvent event) {
- setGroupLogo(session.getCurrentState().getGroup());
- }
- });
- // theme.addOnThemeChanged(new Listener2<WsTheme, WsTheme>() {
- // @Override
- // public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- // // getView().setTheme(oldTheme, newTheme);
- // }
- // });
- }
+ @Inject
+ public EntityHeaderPresenter(final EventBus eventBus, final EntityHeaderView view,
+ final EntityHeaderProxy proxy, final StateManager stateManager, final Session session) {
+ super(eventBus, view, proxy);
+ this.session = session;
+ stateManager.onGroupChanged(true, new GroupChangedHandler() {
+ @Override
+ public void onGroupChanged(final GroupChangedEvent event) {
+ setGroupLogo(session.getCurrentState().getGroup());
+ }
+ });
+ eventBus.addHandler(CurrentLogoChangedEvent.getType(), new CurrentLogoChangedHandler() {
+ @Override
+ public void onCurrentLogoChanged(final CurrentLogoChangedEvent event) {
+ reloadGroupLogoImage();
+ }
+ });
+ // theme.addOnThemeChanged(new Listener2<WsTheme, WsTheme>() {
+ // @Override
+ // public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ // // getView().setTheme(oldTheme, newTheme);
+ // }
+ // });
+ }
- @Override
- public void addAction(final GuiActionDescrip descriptor) {
- getView().addAction(descriptor);
- }
+ @Override
+ public void addAction(final GuiActionDescrip descriptor) {
+ getView().addAction(descriptor);
+ }
- @Override
- public void addWidget(final IsWidget widget) {
- getView().addWidget(widget);
- }
+ @Override
+ public void addWidget(final IsWidget widget) {
+ getView().addWidget(widget);
+ }
- @Override
- public void refreshGroupLogo() {
- setGroupLogo(session.getCurrentState().getGroup());
- }
+ @Override
+ public void refreshGroupLogo() {
+ setGroupLogo(session.getCurrentState().getGroup());
+ }
- @Override
- public void reloadGroupLogoImage() {
- getView().reloadImage(session.getCurrentState().getGroup());
- }
+ @Override
+ public void reloadGroupLogoImage() {
+ getView().reloadImage(session.getCurrentState().getGroup());
+ }
- @Override
- protected void revealInParent() {
- RevealRootContentEvent.fire(this, this);
- }
+ @Override
+ protected void revealInParent() {
+ RevealRootContentEvent.fire(this, this);
+ }
- void setGroupLogo(final GroupDTO group) {
- if (group.hasLogo()) {
- setLogoText(group.getLongName());
- getView().setLogoImage(group.getStateToken());
- getView().setLogoImageVisible(true);
- } else {
- setLogoText(group.getLongName());
- if (group.isPersonal()) {
- getView().showDefUserLogo();
- getView().setLogoImageVisible(true);
- } else {
- getView().setLogoImageVisible(false);
- }
- }
+ void setGroupLogo(final GroupDTO group) {
+ if (group.hasLogo()) {
+ setLogoText(group.getLongName());
+ getView().setLogoImage(group.getStateToken());
+ getView().setLogoImageVisible(true);
+ } else {
+ setLogoText(group.getLongName());
+ if (group.isPersonal()) {
+ getView().showDefUserLogo();
+ getView().setLogoImageVisible(true);
+ } else {
+ getView().setLogoImageVisible(false);
+ }
}
+ }
- void setLogoText(final String name) {
- final int length = name.length();
- if (length <= LARGE_NAME_LIMIT) {
- getView().setLargeFont();
- } else if (length <= MEDIUM_NAME_LIMIT) {
- getView().setMediumFont();
- } else {
- getView().setSmallFont();
- }
- getView().setLogoText(name);
+ void setLogoText(final String name) {
+ final int length = name.length();
+ if (length <= LARGE_NAME_LIMIT) {
+ getView().setLargeFont();
+ } else if (length <= MEDIUM_NAME_LIMIT) {
+ getView().setMediumFont();
+ } else {
+ getView().setSmallFont();
}
+ getView().setLogoText(name);
+ }
}
Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/core/public/ws.css 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,4 +1,6 @@
-CHARSET "UTF-8 "; body {
+CHARSET "UTF-8 ";
+
+body {
background-color: white;
color: black;
font-family: 'Ubuntu', Arial;
@@ -795,7 +797,7 @@
white-space: nowrap;
}
*/
-.k-sn-mainpanel .x-btn button,.k-sn-mainpanel button,button.k-button {
+.k-sn-mainpanel .x-btn button,.k-sn-mainpanel button,button.k-button, .gwt-FileUpload {
font: 13px 'Ubuntu', arial;
border: 2px solid #CCCCCC;
cursor: pointer;
@@ -1314,4 +1316,9 @@
bottom: 0;
left: 0;
right: 0;
-}
\ No newline at end of file
+}
+
+.GWTUpld, table.GWTUpld td {
+ font-family: inherits !important;
+ font-size: 14px !important;
+}
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -34,6 +34,7 @@
import cc.kune.core.server.manager.file.EntityLogoUploadManager;
import cc.kune.core.server.manager.file.FileDownloadManager;
import cc.kune.core.server.manager.file.FileUploadManager;
+import cc.kune.core.server.manager.file.FileGwtUploadServlet;
import cc.kune.core.server.properties.PropertiesFileName;
import cc.kune.core.server.rack.RackBuilder;
import cc.kune.core.server.rack.RackModule;
@@ -131,7 +132,7 @@
builder.installRESTServices("^/ws/json/", TestJSONService.class, GroupJSONService.class,
UserJSONService.class, I18nTranslationJSONService.class, ContentJSONService.class);
builder.installServlet("^/ws/servlets/", FileUploadManager.class, FileDownloadManager.class,
- EntityLogoUploadManager.class, EntityLogoDownloadManager.class);
+ EntityLogoUploadManager.class, EntityLogoDownloadManager.class, FileGwtUploadServlet.class);
builder.at("^/ws/(.*)$").install(new ForwardFilter("^/ws/(.*)$", "/ws/{0}"));
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoUploadManager.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -22,19 +22,19 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.Writer;
-import javax.servlet.http.HttpServletResponse;
-
import magick.MagickException;
import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import cc.kune.core.client.services.FileConstants;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
import cc.kune.core.server.manager.GroupManager;
+import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.shared.domain.AccessRol;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -44,117 +44,64 @@
import com.google.inject.Inject;
import com.google.inject.persist.Transactional;
-public class EntityLogoUploadManager extends FileUploadManagerAbstract {
+public class EntityLogoUploadManager extends FileGwtUploadAbstractServlet {
- private static final long serialVersionUID = -4281058427935636238L;
+ public static final Log LOG = LogFactory.getLog(FileGwtUploadServlet.class);
+ private static final long serialVersionUID = 1L;
+ private final GroupManager groupManager;
+ private final I18nTranslationService i18n;
- @Inject
- transient GroupManager groupManager;
+ @Inject
+ public EntityLogoUploadManager(final KuneProperties kuneProperties, final GroupManager groupManager,
+ final I18nTranslationService i18n) {
+ super(kuneProperties);
+ this.groupManager = groupManager;
+ this.i18n = i18n;
+ }
- @Inject
- transient I18nTranslationService i18n;
-
- @Override
- protected void beforePostStart() {
+ protected void createUploadedFile(final StateToken stateToken, final String mimeTypeS,
+ final File origFile) throws Exception, IOException, MagickException, FileNotFoundException {
+ final BasicMimeType mimeType = new BasicMimeType(mimeTypeS);
+ if (!mimeType.getType().equals("image")) {
+ throw new Exception("Trying to set a non image (" + mimeTypeS + ") as group logo");
}
+ final Group group = groupManager.findByShortName(stateToken.getGroup());
- @Override
- protected void beforeRespond(final HttpServletResponse response, final Writer w) throws IOException {
- response.setCharacterEncoding("utf-8");
- response.setContentType("text/xml");
+ if (group == Group.NO_GROUP) {
+ throw new Exception("Group not found trying to set the logo");
}
- protected void createUploadedFile(final StateToken stateToken, final String mimeTypeS, final File origFile)
- throws Exception, IOException, MagickException, FileNotFoundException {
- final BasicMimeType mimeType = new BasicMimeType(mimeTypeS);
- if (!mimeType.getType().equals("image")) {
- throw new Exception("Trying to set a non image (" + mimeTypeS + ") as group logo");
- }
- final Group group = groupManager.findByShortName(stateToken.getGroup());
+ final File tmpDestFile = File.createTempFile("logoDest", "");
- if (group == Group.NO_GROUP) {
- throw new Exception("Group not found trying to set the logo");
- }
+ final boolean result = ImageUtilsDefault.scaleImageToMax(origFile.getAbsolutePath(),
+ tmpDestFile.getAbsolutePath(), FileConstants.LOGO_DEF_HEIGHT);
- final File tmpDestFile = File.createTempFile("logoDest", "");
-
- final boolean result = ImageUtilsDefault.scaleImageToMax(origFile.getAbsolutePath(),
- tmpDestFile.getAbsolutePath(), FileConstants.LOGO_DEF_HEIGHT);
-
- if (result) {
- group.setLogo(FileUtils.getBytesFromFile(tmpDestFile));
- group.setLogoMime(mimeType);
- logFileDel(tmpDestFile.delete());
- } else {
- logFileDel(tmpDestFile.delete());
- throw new Exception("Cannot create group logo thumb");
- }
+ if (result) {
+ group.setLogo(FileUtils.getBytesFromFile(tmpDestFile));
+ group.setLogoMime(mimeType);
+ logFileDel(tmpDestFile.delete());
+ } else {
+ logFileDel(tmpDestFile.delete());
+ throw new Exception("Cannot create group logo thumb");
}
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
- @Transactional
- protected void createUploadedFile(final String userHash, final StateToken stateToken, final String fileName,
- final FileItem file, final String typeId) throws Exception {
- final String mimeTypeS = file.getContentType();
- final File tmpOrigFile = File.createTempFile("logoOrig", "");
- file.write(tmpOrigFile);
- createUploadedFile(stateToken, mimeTypeS, tmpOrigFile);
- logFileDel(tmpOrigFile.delete());
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
+ @Transactional
+ protected String createUploadedFile(final String userHash, final StateToken stateToken,
+ final String fileName, final FileItem file, final String typeId) {
+ final String mimeTypeS = file.getContentType();
+ try {
+ final File tmpOrigFile = File.createTempFile("logoOrig", "");
+ file.write(tmpOrigFile);
+ createUploadedFile(stateToken, mimeTypeS, tmpOrigFile);
+ logFileDel(tmpOrigFile.delete());
+ } catch (final Exception e) {
+ return i18n.t("Error uploading file");
}
+ return i18n.t("Success uploading");
+ }
- /**
- * Expect result with this format:
- *
- * <pre>
- * <?xml version="1.0" encoding="UTF-8"?>
- * <response success="false">
- * <errors>
- * <field>
- * <id>first</id>
- * <msg><![CDATA[
- * Invalid name. <br /><i>This is a test validation message from the server </i>
- * ]]></msg>
- * </field>
- * <field>
- * <id>dob</id>
- * <msg><![CDATA[
- * Invalid Date of Birth. <br /><i>This is a test validation message from the server </i>
- * ]]></msg>
- * </field>
- * </errors>
- * </response>
- * </pre>
- **/
- protected String createXmlResponse(final boolean success, final String message) {
- String error = "";
- // FIXME: Use Group/User field when necessary
- if (!success) {
- error = "<errors><field><id>" + FileConstants.GROUP_LOGO_FIELD + "</id><msg><![CDATA[" + message
- + "]]></msg></field></errors>";
- }
- return "<response success=\"" + success + "\">" + error + "</response>";
- }
-
- @Override
- protected void onFileUploadException(final HttpServletResponse response) throws IOException {
- doResponse(response, createXmlResponse(false, i18n.t("Error: File too large")).toString(),
- HttpServletResponse.SC_BAD_REQUEST);
- }
-
- @Override
- protected void onOtherException(final HttpServletResponse response, final Exception e) throws IOException {
- super.onOtherException(response, e);
- LOG.info("Exception: " + e.getCause());
- // e.printStackTrace();
- doResponse(response, createXmlResponse(false, i18n.t("Error uploading file")).toString(),
- HttpServletResponse.SC_BAD_REQUEST);
- }
-
- @Override
- protected void onSuccess(final HttpServletResponse response) throws IOException {
- doResponse(response, createXmlResponse(true, i18n.t("Success uploading")).toString());
- }
-
}
Added: trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -0,0 +1,72 @@
+package cc.kune.core.server.manager.file;
+
+import gwtupload.server.UploadAction;
+import gwtupload.server.exceptions.UploadActionException;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import cc.kune.core.client.services.FileConstants;
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.domain.utils.StateToken;
+
+public abstract class FileGwtUploadAbstractServlet extends UploadAction {
+
+ public static final Log LOG = LogFactory.getLog(FileGwtUploadAbstractServlet.class);
+ private static final long serialVersionUID = 1L;
+
+ public FileGwtUploadAbstractServlet(final KuneProperties kuneProperties) {
+ this.maxSize = Integer.valueOf(kuneProperties.get(KuneProperties.UPLOAD_MAX_FILE_SIZE_IN_KS));
+ this.uploadDelay = Integer.valueOf(kuneProperties.get(KuneProperties.UPLOAD_DELAY_FOR_TEST));
+ }
+
+ protected abstract String createUploadedFile(final String userHash, final StateToken stateToken,
+ final String fileName, final FileItem file, final String typeId);
+
+ @Override
+ public String executeAction(final HttpServletRequest request, final List<FileItem> fileItems)
+ throws UploadActionException {
+ String userHash = null;
+ StateToken stateToken = null;
+ String typeId = null;
+ String fileName = null;
+ FileItem file = null;
+ for (final Object element : fileItems) {
+ final FileItem item = (FileItem) element;
+ if (item.isFormField()) {
+ final String name = item.getFieldName();
+ final String value = item.getString();
+ LOG.info("name: " + name + " value: " + value);
+ if (name.equals(FileConstants.HASH)) {
+ userHash = value;
+ }
+ if (name.equals(FileConstants.TOKEN)) {
+ stateToken = new StateToken(value);
+ }
+ if (name.equals(FileConstants.TYPE_ID)) {
+ typeId = value;
+ }
+ } else {
+ fileName = item.getName();
+ LOG.info("file: " + fileName + " fieldName: " + item.getFieldName() + " size: " + item.getSize()
+ + " typeId: " + typeId);
+ file = item;
+ }
+ }
+
+ return createUploadedFile(userHash, stateToken, fileName, file, typeId);
+
+ }
+
+ protected void logFileDel(final boolean delResult) {
+ if (!delResult) {
+ LOG.error("Cannot delete file");
+ }
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadServlet.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadServlet.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -0,0 +1,29 @@
+package cc.kune.core.server.manager.file;
+
+import javax.inject.Inject;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.domain.utils.StateToken;
+
+public class FileGwtUploadServlet extends FileGwtUploadAbstractServlet {
+
+ public static final Log LOG = LogFactory.getLog(FileGwtUploadServlet.class);
+ private static final long serialVersionUID = 1L;
+
+ @Inject
+ public FileGwtUploadServlet(final KuneProperties kuneProperties) {
+ super(kuneProperties);
+ }
+
+ @Override
+ protected String createUploadedFile(final String userHash, final StateToken stateToken,
+ final String fileName, final FileItem file, final String typeId) {
+ LOG.info("ok");
+ return "";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadServlet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -20,37 +20,39 @@
package cc.kune.core.server.properties;
public interface KuneProperties {
- String SITE_URL = "kune.siteurl";
- String SITE_DOMAIN = "kune.site.domain";
- String SITE_NAME = "kune.default.site.name";
- String SITE_SHORTNAME = "kune.default.site.shortName";
- String SITE_DEF_LICENSE = "kune.default.license";
+ String AVI_EMBEDED_OBJECT = "kune.media.aviembededobject";
+ String CHAT_DOMAIN = "kune.chat.domain";
+ String CHAT_HTTP_BASE = "kune.chat.httpbase";
+ String CHAT_ROOM_HOST = "kune.chat.roomHost";
+ String CURRENT_CC_VERSION = "kune.currentccversion";
- String SITE_ADMIN_NAME = "kune.admin.name";
- String SITE_ADMIN_SHORTNAME = "kune.admin.shortName";
- String SITE_ADMIN_EMAIL = "kune.admin.email";
- String SITE_ADMIN_PASSWD = "kune.admin.password";
- String DEFAULT_SITE_SHORT_NAME = "kune.default.site.shortName";
- String CURRENT_CC_VERSION = "kune.currentccversion";
- String CHAT_HTTP_BASE = "kune.chat.httpbase";
- String CHAT_DOMAIN = "kune.chat.domain";
- String CHAT_ROOM_HOST = "kune.chat.roomHost";
- String WS_THEMES_DEF = "kune.wsthemes.default";
- String WS_THEMES = "kune.wsthemes";
- String SITE_LOGO_URL = "kune.sitelogourl";
- String UPLOAD_GALLERY_PERMITTED_EXTS = "kune.upload.gallerypermittedextensions";
- String UPLOAD_MAX_FILE_SIZE = "kune.upload.maxfilesizeinmegas";
- String UPLOAD_LOCATION = "kune.upload.location";
- String IMAGES_RESIZEWIDTH = "kune.images.resizewidth";
- String IMAGES_THUMBSIZE = "kune.images.thumbsize";
- String IMAGES_CROPSIZE = "kune.images.cropsize";
- String IMAGES_ICONSIZE = "kune.images.iconsize";
- String FLV_EMBEDED_OBJECT = "kune.media.flvembededobject";
- String OGG_EMBEDED_OBJECT = "kune.media.oggembededobject";
- String MP3_EMBEDED_OBJECT = "kune.media.mp3embededobject";
- String AVI_EMBEDED_OBJECT = "kune.media.aviembededobject";
+ String DEFAULT_SITE_SHORT_NAME = "kune.default.site.shortName";
+ String FLV_EMBEDED_OBJECT = "kune.media.flvembededobject";
+ String IMAGES_CROPSIZE = "kune.images.cropsize";
+ String IMAGES_ICONSIZE = "kune.images.iconsize";
+ String IMAGES_RESIZEWIDTH = "kune.images.resizewidth";
+ String IMAGES_THUMBSIZE = "kune.images.thumbsize";
+ String MP3_EMBEDED_OBJECT = "kune.media.mp3embededobject";
+ String OGG_EMBEDED_OBJECT = "kune.media.oggembededobject";
+ String SITE_ADMIN_EMAIL = "kune.admin.email";
+ String SITE_ADMIN_NAME = "kune.admin.name";
+ String SITE_ADMIN_PASSWD = "kune.admin.password";
+ String SITE_ADMIN_SHORTNAME = "kune.admin.shortName";
+ String SITE_DEF_LICENSE = "kune.default.license";
+ String SITE_DOMAIN = "kune.site.domain";
+ String SITE_LOGO_URL = "kune.sitelogourl";
+ String SITE_NAME = "kune.default.site.name";
+ String SITE_SHORTNAME = "kune.default.site.shortName";
+ String SITE_URL = "kune.siteurl";
+ String UPLOAD_DELAY_FOR_TEST = "kune.upload.delayfortest";
+ String UPLOAD_GALLERY_PERMITTED_EXTS = "kune.upload.gallerypermittedextensions";
+ String UPLOAD_LOCATION = "kune.upload.location";
+ String UPLOAD_MAX_FILE_SIZE = "kune.upload.maxfilesizeinmegas";
+ String UPLOAD_MAX_FILE_SIZE_IN_KS = "kune.upload.maxfilesizeinks";
+ String WS_THEMES = "kune.wsthemes";
+ String WS_THEMES_DEF = "kune.wsthemes.default";
- String get(String key);
+ String get(String key);
- String get(String key, String defaultValue);
+ String get(String key, String defaultValue);
}
Modified: trunk/src/main/java/cc/kune/gspace/GSpace.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/GSpace.gwt.xml 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/gspace/GSpace.gwt.xml 2011-05-06 20:13:51 UTC (rev 1356)
@@ -5,4 +5,11 @@
<source path='client'
excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
<inherits name="cc.kune.pspace.PSpace" />
+
+ <!-- Include GWTUpload library -->
+ <inherits name="gwtupload.GWTUpload"/>
+ <!-- Load dinamically predefined styles in the library when the application starts -->
+ <stylesheet src="Upload.css"/>
+
+
</module>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -63,4 +63,6 @@
void selectPublicSpace();
void selectUserSpace();
+
+ void setContentVisible(boolean visible);
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -51,6 +51,8 @@
@UiField
VerticalPanel docContainer;
@UiField
+ DockLayoutPanel docContainerParent;
+ @UiField
FlowPanel docFooter;
@UiField
FlowPanel docHeader;
@@ -203,4 +205,11 @@
public void selectUserSpace() {
tabs.selectTab(userSpace);
}
+
+ @Override
+ public void setContentVisible(final boolean visible) {
+ // NotifyUser.info("Visible: " + visible);
+ // docContainer.getElement().getStyle().setOpacity(visible ? 1d : .0d);
+ // docFooter.getElement().getStyle().setOpacity(visible ? 1d : .0d);
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml 2011-05-06 20:13:51 UTC (rev 1356)
@@ -57,7 +57,7 @@
</g:north>
<g:center>
<g:DockLayoutPanel unit="PX"
- styleName="{res.style.docEditorMargin}">
+ styleName="{res.style.docEditorMargin}" ui:field="docContainerParent">
<g:west size="10">
<g:SimplePanel />
</g:west>
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-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -19,7 +19,12 @@
\*/
package cc.kune.gspace.client.options.logo;
-import cc.kune.common.client.log.Log;
+import gwtupload.client.IFileInput.FileInputType;
+import gwtupload.client.IUploader.OnCancelUploaderHandler;
+import gwtupload.client.IUploader.OnChangeUploaderHandler;
+import gwtupload.client.IUploader.OnFinishUploaderHandler;
+import gwtupload.client.IUploader.OnStartUploaderHandler;
+import gwtupload.client.MultiUploader;
import cc.kune.common.client.ui.IconLabel;
import cc.kune.common.client.utils.OnAcceptCallback;
import cc.kune.core.client.resources.CoreMessages;
@@ -28,158 +33,103 @@
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.EntityOptionsView;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.FileUpload;
-import com.google.gwt.user.client.ui.FormPanel;
-import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent;
-import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
+import com.google.gwt.user.client.ui.DecoratorPanel;
+import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Hidden;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
public class EntityOptionsLogoPanel extends Composite implements EntityOptionsLogoView {
+ public class UploadButton extends Composite implements HasClickHandlers {
+ DecoratorPanel widget = new DecoratorPanel();
+
+ public UploadButton() {
+ final DecoratorPanel widget = new DecoratorPanel();
+ final Button btn = new Button(i18n.t("Choose"));
+ btn.addStyleName("k-button");
+ initWidget(widget);
+ widget.setWidget(btn);
+ widget.setHeight("50px");
+ }
+
+ @Override
+ public HandlerRegistration addClickHandler(final ClickHandler handler) {
+ return addDomHandler(handler, ClickEvent.getType());
+ }
+ }
+
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 MultiUploader uploader;
private final Hidden userhashField;
- // 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);
+ final UploadButton btn = new UploadButton();
+ uploader = new MultiUploader(FileInputType.CUSTOM.with(btn));
+ uploader.setServletPath(ICON_UPLD_SERVLET);
+ uploader.setMaximumFiles(1);
dialogInfoLabel = new Label();
dialogInfoLabel.setWordWrap(true);
dialogInfoLabel.addStyleName("kune-Margin-20-tb");
- form.setEncoding(FormPanel.ENCODING_MULTIPART);
- form.setMethod(FormPanel.METHOD_POST);
- form.setAction(GWT.getModuleBaseURL() + ICON_UPLD_SERVLET);
+ uploader.setValidExtensions("png", "jpg", "gif", "jpeg", "bmp");
userhashField = new Hidden(FileConstants.HASH, FileConstants.HASH);
tokenField = new Hidden(FileConstants.TOKEN, FileConstants.TOKEN);
- final VerticalPanel holder = new VerticalPanel();
+ final FlowPanel holder = new FlowPanel();
- fileUpload.setName("upload");
+ uploader.add(userhashField);
+ uploader.add(tokenField);
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();
- }
- }));
+ holder.add(uploader);
- 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
- }
-
- }
- });
-
- form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
- @Override
- public void onSubmitComplete(final SubmitCompleteEvent event) {
- CurrentLogoChangedEvent.fire(eventBus);
- }
- });
- form.add(holder);
- initWidget(form);
+ initWidget(holder);
setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px");
setWidth(String.valueOf(EntityOptionsView.WIDTH) + "px");
+ // uploader.setHeight("100px");
+
addStyleName("k-overflow-y-auto");
addStyleName("k-tab-panel");
}
@Override
+ public HandlerRegistration addOnCancelUploadHandler(final OnCancelUploaderHandler handler) {
+ return uploader.addOnCancelUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnChangeUploadHandler(final OnChangeUploaderHandler handler) {
+ return uploader.addOnChangeUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnFinishUploadHandler(final OnFinishUploaderHandler handler) {
+ return uploader.addOnFinishUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnStartUploadHandler(final OnStartUploaderHandler handler) {
+ return uploader.addOnStartUploadHandler(handler);
+ }
+
+ @Override
public OnAcceptCallback getOnSubmit() {
- // TODO Auto-generated method stub
return null;
}
@@ -189,7 +139,7 @@
}
public void reset() {
- form.reset();
+ uploader.reset();
}
@Override
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -19,6 +19,10 @@
\*/
package cc.kune.gspace.client.options.logo;
+import gwtupload.client.IUploadStatus.Status;
+import gwtupload.client.IUploader;
+import gwtupload.client.IUploader.OnFinishUploaderHandler;
+import gwtupload.client.IUploader.OnStartUploaderHandler;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.core.client.rpcservices.UserServiceAsync;
import cc.kune.core.client.state.Session;
@@ -45,13 +49,6 @@
this.entityLogo = entityLogo;
this.entityOptions = entityOptions;
this.userService = userService;
- eventBus.addHandler(CurrentLogoChangedEvent.getType(),
- new CurrentLogoChangedEvent.CurrentLogoChangedHandler() {
- @Override
- public void onCurrentLogoChanged(final CurrentLogoChangedEvent event) {
- onSubmitComplete();
- }
- });
}
public IsWidget getView() {
@@ -62,13 +59,34 @@
this.view = view;
entityOptions.addTab(view, view.getTabTitle());
setState();
+ view.addOnStartUploadHandler(new OnStartUploaderHandler() {
+ @Override
+ public void onStart(final IUploader uploader) {
+ setState();
+ }
+ });
+ view.addOnFinishUploadHandler(new OnFinishUploaderHandler() {
+
+ @Override
+ public void onFinish(final IUploader uploader) {
+ onSubmitComplete(uploader);
+ }
+ });
}
- public void onSubmitComplete() {
- entityLogo.reloadGroupLogoImage();
+ public void onSubmitComplete(final IUploader uploader) {
+ final String response = uploader.getServerInfo().message;
+ if (uploader.getStatus() == Status.SUCCESS) {
+ if (response != null) {
+ NotifyUser.info(response);
+ }
+ CurrentLogoChangedEvent.fire(eventBus);
+ } else {
+ onSubmitFailed(response);
+ }
}
- public void onSubmitFailed(final int httpStatus, final String responseText) {
+ public void onSubmitFailed(final String responseText) {
NotifyUser.error("Error setting the logo: " + responseText);
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoView.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoView.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -19,17 +19,29 @@
\*/
package cc.kune.gspace.client.options.logo;
+import gwtupload.client.IUploader;
+import gwtupload.client.IUploader.OnCancelUploaderHandler;
import cc.kune.common.client.utils.OnAcceptCallback;
import cc.kune.gspace.client.options.EntityOptionsTabView;
+import com.google.gwt.event.shared.HandlerRegistration;
+
public interface EntityOptionsLogoView extends EntityOptionsTabView {
- OnAcceptCallback getOnSubmit();
+ HandlerRegistration addOnCancelUploadHandler(OnCancelUploaderHandler handler);
- void setNormalGroupsLabels();
+ HandlerRegistration addOnChangeUploadHandler(IUploader.OnChangeUploaderHandler handler);
- void setPersonalGroupsLabels();
+ HandlerRegistration addOnFinishUploadHandler(IUploader.OnFinishUploaderHandler handler);
- void setUploadParams(String userHash, String token);
+ HandlerRegistration addOnStartUploadHandler(IUploader.OnStartUploaderHandler handler);
+ OnAcceptCallback getOnSubmit();
+
+ void setNormalGroupsLabels();
+
+ void setPersonalGroupsLabels();
+
+ void setUploadParams(String userHash, String token);
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -19,6 +19,7 @@
*/
package cc.kune.gspace.client.options.logo;
+import gwtupload.client.IUploader;
import cc.kune.core.client.events.AvatarChangedEvent;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.UserServiceAsync;
@@ -56,8 +57,8 @@
}
@Override
- public void onSubmitComplete() {
- super.onSubmitComplete();
+ public void onSubmitComplete(final IUploader uploader) {
+ super.onSubmitComplete(uploader);
final GroupDTO group = session.getCurrentState().getGroup();
if (session.getCurrentUser().getShortName().equals(group.getShortName())) {
userService.get().getUserAvatarBaser64(session.getUserHash(), group.getStateToken(),
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -26,11 +26,13 @@
@Override
public void attach() {
+ gsArmor.setContentVisible(false);
}
@Override
public void detach() {
UiUtils.clear(gsArmor.getDocHeader());
+ gsArmor.setContentVisible(true);
}
@Override
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -46,114 +46,116 @@
public class UserMessage extends Composite implements HasText {
- interface MessageUiBinder extends UiBinder<Widget, UserMessage> {
- }
- public interface MsgTemplate extends SafeHtmlTemplates {
- @Template("<span>{0}</span>")
- SafeHtml format(SafeHtml message);
- }
- public interface MsgWithTitleTemplate extends SafeHtmlTemplates {
- @Template("<span><b>{0}</b><br/><p>{1}</p></span>")
- SafeHtml format(SafeHtml title, SafeHtml message);
- }
- private static String closeTitle = "Close";
+ interface MessageUiBinder extends UiBinder<Widget, UserMessage> {
+ }
+ public interface MsgTemplate extends SafeHtmlTemplates {
+ @Template("<span>{0}</span>")
+ SafeHtml format(SafeHtml message);
+ }
+ public interface MsgWithTitleTemplate extends SafeHtmlTemplates {
+ @Template("<span><b>{0}</b><br/><p>{1}</p></span>")
+ SafeHtml format(SafeHtml title, SafeHtml message);
+ }
+ private static String closeTitle = "Close";
- private static int fadeMills = 5000;
+ private static int fadeMills = 5000;
- private static final MsgTemplate MSG_NO_TITLE = GWT.create(MsgTemplate.class);
- private static final MsgWithTitleTemplate MSG_WITH_TITLE = GWT.create(MsgWithTitleTemplate.class);
+ private static final MsgTemplate MSG_NO_TITLE = GWT.create(MsgTemplate.class);
+ private static final MsgWithTitleTemplate MSG_WITH_TITLE = GWT.create(MsgWithTitleTemplate.class);
- private static MessageUiBinder uiBinder = GWT.create(MessageUiBinder.class);
+ private static MessageUiBinder uiBinder = GWT.create(MessageUiBinder.class);
- public static void setCloseTitle(final String title) {
- closeTitle = title;
- }
+ public static void setCloseTitle(final String title) {
+ closeTitle = title;
+ }
- public static void setFadeMills(final int mills) {
- fadeMills = mills;
- }
+ public static void setFadeMills(final int mills) {
+ fadeMills = mills;
+ }
- @UiField
- PushButton close;
+ @UiField
+ PushButton close;
- private final CloseCallback closeCallback;
+ private final CloseCallback closeCallback;
- @UiField
- Image icon;
+ @UiField
+ Image icon;
- @UiField
- InlineHTML label;
+ @UiField
+ InlineHTML label;
- public UserMessage(final NotifyLevel level, final String title, final String message, final String id,
- final boolean closeable, final CloseCallback closeCallback) {
- this.closeCallback = closeCallback;
- initWidget(uiBinder.createAndBindUi(this));
- if (TextUtils.notEmpty(id)) {
- super.ensureDebugId(id);
- }
- if (TextUtils.notEmpty(title)) {
- label.setHTML(MSG_WITH_TITLE.format(SimpleHtmlSanitizer.sanitizeHtml(title),
- SimpleHtmlSanitizer.sanitizeHtml(message)));
- } else {
- label.setHTML(MSG_NO_TITLE.format(SimpleHtmlSanitizer.sanitizeHtml(message)));
- }
- close.setVisible(closeable);
- close.setTitle(closeTitle);
- if (!closeable) {
- final Timer time = new Timer() {
- @Override
- public void run() {
- close();
- }
- };
- time.schedule(fadeMills);
- }
- icon.setResource(UserMessageImagesUtil.getIcon(level));
- final Show anim = new Show(this.getElement());
- anim.setDuration(0.5);
- anim.play();
+ public UserMessage(final NotifyLevel level, final String title, final String message, final String id,
+ final boolean closeable, final CloseCallback closeCallback) {
+ this.closeCallback = closeCallback;
+ initWidget(uiBinder.createAndBindUi(this));
+ if (TextUtils.notEmpty(id)) {
+ super.ensureDebugId(id);
}
-
- public UserMessage(final String message, final CloseCallback closeCallback) {
- this("", message, false, closeCallback);
+ if (TextUtils.notEmpty(message)) {
+ if (TextUtils.notEmpty(title)) {
+ label.setHTML(MSG_WITH_TITLE.format(SimpleHtmlSanitizer.sanitizeHtml(title),
+ SimpleHtmlSanitizer.sanitizeHtml(message)));
+ } else {
+ label.setHTML(MSG_NO_TITLE.format(SimpleHtmlSanitizer.sanitizeHtml(message)));
+ }
+ close.setVisible(closeable);
+ close.setTitle(closeTitle);
+ if (!closeable) {
+ final Timer time = new Timer() {
+ @Override
+ public void run() {
+ close();
+ }
+ };
+ time.schedule(fadeMills);
+ }
+ icon.setResource(UserMessageImagesUtil.getIcon(level));
+ final Show anim = new Show(this.getElement());
+ anim.setDuration(0.5);
+ anim.play();
}
+ }
- public UserMessage(final String title, final String message, final boolean closeable,
- final CloseCallback closeCallback) {
- this(NotifyLevel.info, title, message, "", closeable, closeCallback);
- }
+ public UserMessage(final String message, final CloseCallback closeCallback) {
+ this("", message, false, closeCallback);
+ }
- public UserMessage(final String title, final String message, final CloseCallback closeCallback) {
- this(title, message, false, closeCallback);
- }
+ public UserMessage(final String title, final String message, final boolean closeable,
+ final CloseCallback closeCallback) {
+ this(NotifyLevel.info, title, message, "", closeable, closeCallback);
+ }
- private void close() {
- final Fade fade = new Fade(this.getElement());
- fade.setDuration(0.7);
- fade.play();
- fade.addEffectCompletedHandler(new EffectCompletedHandler() {
+ public UserMessage(final String title, final String message, final CloseCallback closeCallback) {
+ this(title, message, false, closeCallback);
+ }
- @Override
- public void onEffectCompleted(final EffectCompletedEvent event) {
- removeFromParent();
- closeCallback.onClose();
- }
- });
- }
+ private void close() {
+ final Fade fade = new Fade(this.getElement());
+ fade.setDuration(0.7);
+ fade.play();
+ fade.addEffectCompletedHandler(new EffectCompletedHandler() {
- @Override
- public String getText() {
- return label.getText();
- }
+ @Override
+ public void onEffectCompleted(final EffectCompletedEvent event) {
+ removeFromParent();
+ closeCallback.onClose();
+ }
+ });
+ }
- @UiHandler("close")
- void handleClick(final ClickEvent e) {
- close();
- }
+ @Override
+ public String getText() {
+ return label.getText();
+ }
- @Override
- public void setText(final String text) {
- label.setText(text);
- }
+ @UiHandler("close")
+ void handleClick(final ClickEvent e) {
+ close();
+ }
+ @Override
+ public void setText(final String text) {
+ label.setText(text);
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -20,11 +20,7 @@
package org.ourproject.kune.workspace.client;
import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
-import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
-import org.ourproject.kune.workspace.client.oldsn.GroupActionRegistry;
-import org.ourproject.kune.workspace.client.oldsn.UserActionRegistry;
-import cc.kune.core.client.cnt.ContentActionRegistry;
import cc.kune.core.client.registry.AclEditableRegistry;
import cc.kune.core.client.registry.AuthorableRegistry;
import cc.kune.core.client.registry.CanBeHomepageRegistry;
@@ -47,173 +43,177 @@
public class RegistryModule extends AbstractExtendedModule {
- @Override
- protected void onInstall() {
+ @Override
+ protected void onInstall() {
- register(Singleton.class, new Factory<AclEditableRegistry>(AclEditableRegistry.class) {
- @Override
- public AclEditableRegistry create() {
- return new AclEditableRegistry();
- }
- });
- register(Singleton.class, new Factory<AuthorableRegistry>(AuthorableRegistry.class) {
- @Override
- public AuthorableRegistry create() {
- return new AuthorableRegistry();
- }
- });
- register(Singleton.class, new Factory<CanBeHomepageRegistry>(CanBeHomepageRegistry.class) {
- @Override
- public CanBeHomepageRegistry create() {
- return new CanBeHomepageRegistry();
- }
- });
+ register(Singleton.class, new Factory<AclEditableRegistry>(AclEditableRegistry.class) {
+ @Override
+ public AclEditableRegistry create() {
+ return new AclEditableRegistry();
+ }
+ });
+ register(Singleton.class, new Factory<AuthorableRegistry>(AuthorableRegistry.class) {
+ @Override
+ public AuthorableRegistry create() {
+ return new AuthorableRegistry();
+ }
+ });
+ register(Singleton.class, new Factory<CanBeHomepageRegistry>(CanBeHomepageRegistry.class) {
+ @Override
+ public CanBeHomepageRegistry create() {
+ return new CanBeHomepageRegistry();
+ }
+ });
- register(Singleton.class, new Factory<ComentableRegistry>(ComentableRegistry.class) {
- @Override
- public ComentableRegistry create() {
- return new ComentableRegistry();
- }
- });
+ register(Singleton.class, new Factory<ComentableRegistry>(ComentableRegistry.class) {
+ @Override
+ public ComentableRegistry create() {
+ return new ComentableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<DragableRegistry>(DragableRegistry.class) {
- @Override
- public DragableRegistry create() {
- return new DragableRegistry();
- }
- });
+ register(Singleton.class, new Factory<DragableRegistry>(DragableRegistry.class) {
+ @Override
+ public DragableRegistry create() {
+ return new DragableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<DropableRegistry>(DropableRegistry.class) {
- @Override
- public DropableRegistry create() {
- return new DropableRegistry();
- }
- });
+ register(Singleton.class, new Factory<DropableRegistry>(DropableRegistry.class) {
+ @Override
+ public DropableRegistry create() {
+ return new DropableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<EmailSubscribeAbleRegistry>(EmailSubscribeAbleRegistry.class) {
- @Override
- public EmailSubscribeAbleRegistry create() {
- return new EmailSubscribeAbleRegistry();
- }
- });
+ register(Singleton.class, new Factory<EmailSubscribeAbleRegistry>(EmailSubscribeAbleRegistry.class) {
+ @Override
+ public EmailSubscribeAbleRegistry create() {
+ return new EmailSubscribeAbleRegistry();
+ }
+ });
- register(Singleton.class, new Factory<LicensableRegistry>(LicensableRegistry.class) {
- @Override
- public LicensableRegistry create() {
- return new LicensableRegistry();
- }
- });
+ register(Singleton.class, new Factory<LicensableRegistry>(LicensableRegistry.class) {
+ @Override
+ public LicensableRegistry create() {
+ return new LicensableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<PublishModerableRegistry>(PublishModerableRegistry.class) {
- @Override
- public PublishModerableRegistry create() {
- return new PublishModerableRegistry();
- }
- });
+ register(Singleton.class, new Factory<PublishModerableRegistry>(PublishModerableRegistry.class) {
+ @Override
+ public PublishModerableRegistry create() {
+ return new PublishModerableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<RateableRegistry>(RateableRegistry.class) {
- @Override
- public RateableRegistry create() {
- return new RateableRegistry();
- }
- });
+ register(Singleton.class, new Factory<RateableRegistry>(RateableRegistry.class) {
+ @Override
+ public RateableRegistry create() {
+ return new RateableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<TageableRegistry>(TageableRegistry.class) {
- @Override
- public TageableRegistry create() {
- return new TageableRegistry();
- }
- });
+ register(Singleton.class, new Factory<TageableRegistry>(TageableRegistry.class) {
+ @Override
+ public TageableRegistry create() {
+ return new TageableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<RenamableRegistry>(RenamableRegistry.class) {
- @Override
- public RenamableRegistry create() {
- return new RenamableRegistry();
- }
- });
+ register(Singleton.class, new Factory<RenamableRegistry>(RenamableRegistry.class) {
+ @Override
+ public RenamableRegistry create() {
+ return new RenamableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<TranslatableRegistry>(TranslatableRegistry.class) {
- @Override
- public TranslatableRegistry create() {
- return new TranslatableRegistry();
- }
- });
+ register(Singleton.class, new Factory<TranslatableRegistry>(TranslatableRegistry.class) {
+ @Override
+ public TranslatableRegistry create() {
+ return new TranslatableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<VersionableRegistry>(VersionableRegistry.class) {
- @Override
- public VersionableRegistry create() {
- return new VersionableRegistry();
- }
- });
+ register(Singleton.class, new Factory<VersionableRegistry>(VersionableRegistry.class) {
+ @Override
+ public VersionableRegistry create() {
+ return new VersionableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<XmppComentableRegistry>(XmppComentableRegistry.class) {
- @Override
- public XmppComentableRegistry create() {
- return new XmppComentableRegistry();
- }
- });
+ register(Singleton.class, new Factory<XmppComentableRegistry>(XmppComentableRegistry.class) {
+ @Override
+ public XmppComentableRegistry create() {
+ return new XmppComentableRegistry();
+ }
+ });
- register(Singleton.class, new Factory<XmppNotifyCapableRegistry>(XmppNotifyCapableRegistry.class) {
- @Override
- public XmppNotifyCapableRegistry create() {
- return new XmppNotifyCapableRegistry();
- }
- });
+ register(Singleton.class, new Factory<XmppNotifyCapableRegistry>(XmppNotifyCapableRegistry.class) {
+ @Override
+ public XmppNotifyCapableRegistry create() {
+ return new XmppNotifyCapableRegistry();
+ }
+ });
- // register(Singleton.class, new
- // Factory<IconsRegistry>(IconsRegistry.class) {
- // @Override
- // public IconsRegistry create() {
- // return new IconsRegistry();
- // }
- // });
+ // register(Singleton.class, new
+ // Factory<IconsRegistry>(IconsRegistry.class) {
+ // @Override
+ // public IconsRegistry create() {
+ // return new IconsRegistry();
+ // }
+ // });
- // register(Singleton.class, new
- // Factory<ContentCapabilitiesRegistry>(ContentCapabilitiesRegistry.class)
- // {
- // @Override
- // public ContentCapabilitiesRegistry create() {
- // return new ContentCapabilitiesRegistry(i(AuthorableRegistry.class),
- // i(AclEditableRegistry.class),
- // i(OldIconsRegistry.class), i(CanBeHomepageRegistry.class),
- // i(ComentableRegistry.class),
- // i(DragableRegistry.class), i(DropableRegistry.class),
- // i(EmailSubscribeAbleRegistry.class),
- // i(LicensableRegistry.class), i(PublishModerableRegistry.class),
- // i(RateableRegistry.class),
- // i(TageableRegistry.class), i(RenamableRegistry.class),
- // i(TranslatableRegistry.class),
- // i(VersionableRegistry.class), i(XmppComentableRegistry.class),
- // i(XmppNotifyCapableRegistry.class));
- // }
- // });
-
- register(Singleton.class, new Factory<ContextActionRegistry>(ContextActionRegistry.class) {
- @Override
- public ContextActionRegistry create() {
- return new ContextActionRegistry();
- }
- });
-
- register(Singleton.class, new Factory<ContentActionRegistry>(ContentActionRegistry.class) {
- @Override
- public ContentActionRegistry create() {
- return new ContentActionRegistry();
- }
- });
-
- register(Singleton.class, new Factory<GroupActionRegistry>(GroupActionRegistry.class) {
- @Override
- public GroupActionRegistry create() {
- return new GroupActionRegistry();
- }
- });
-
- register(Singleton.class, new Factory<UserActionRegistry>(UserActionRegistry.class) {
- @Override
- public UserActionRegistry create() {
- return new UserActionRegistry();
- }
- });
- }
+ // register(Singleton.class, new
+ // Factory<ContentCapabilitiesRegistry>(ContentCapabilitiesRegistry.class)
+ // {
+ // @Override
+ // public ContentCapabilitiesRegistry create() {
+ // return new ContentCapabilitiesRegistry(i(AuthorableRegistry.class),
+ // i(AclEditableRegistry.class),
+ // i(OldIconsRegistry.class), i(CanBeHomepageRegistry.class),
+ // i(ComentableRegistry.class),
+ // i(DragableRegistry.class), i(DropableRegistry.class),
+ // i(EmailSubscribeAbleRegistry.class),
+ // i(LicensableRegistry.class), i(PublishModerableRegistry.class),
+ // i(RateableRegistry.class),
+ // i(TageableRegistry.class), i(RenamableRegistry.class),
+ // i(TranslatableRegistry.class),
+ // i(VersionableRegistry.class), i(XmppComentableRegistry.class),
+ // i(XmppNotifyCapableRegistry.class));
+ // }
+ // });
+ //
+ // register(Singleton.class, new
+ // Factory<ContextActionRegistry>(ContextActionRegistry.class) {
+ // @Override
+ // public ContextActionRegistry create() {
+ // return new ContextActionRegistry();
+ // }
+ // });
+ //
+ // register(Singleton.class, new
+ // Factory<ContentActionRegistry>(ContentActionRegistry.class) {
+ // @Override
+ // public ContentActionRegistry create() {
+ // return new ContentActionRegistry();
+ // }
+ // });
+ //
+ // register(Singleton.class, new
+ // Factory<GroupActionRegistry>(GroupActionRegistry.class) {
+ // @Override
+ // public GroupActionRegistry create() {
+ // return new GroupActionRegistry();
+ // }
+ // });
+ //
+ // register(Singleton.class, new
+ // Factory<UserActionRegistry>(UserActionRegistry.class) {
+ // @Override
+ // public UserActionRegistry create() {
+ // return new UserActionRegistry();
+ // }
+ // });
+ }
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummary.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummary.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-
-public interface BuddiesSummary {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryPanel.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryPanel.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,133 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.actions.ActionItem;
-import org.ourproject.kune.platf.client.actions.ActionItemCollection;
-import org.ourproject.kune.platf.client.actions.ActionManager;
-import org.ourproject.kune.platf.client.actions.MenuItemsContainer;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
-import org.ourproject.kune.platf.client.ui.AbstractToolbar;
-import org.ourproject.kune.workspace.client.skel.SummaryPanel;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import cc.kune.common.client.ui.BasicThumb;
-import cc.kune.core.client.resources.CoreMessages;
-import cc.kune.core.shared.dto.UserSimpleDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.widgets.menu.Menu;
-
-public class BuddiesSummaryPanel extends SummaryPanel implements BuddiesSummaryView {
-
- private final MenuItemsContainer<UserSimpleDTO> menuItemsContainer;
- private final FlowPanel flowPanel;
- private final Label otherBuddiesLabel;
- private final I18nTranslationService i18n;
- private final ActionManager actionManager;
- private final AbstractToolbar toolbar;
- private final Label noBuddiesPublic;
-
- public BuddiesSummaryPanel(final BuddiesSummaryPresenter presenter, final WorkspaceSkeleton ws,
- final I18nTranslationService i18n, final ActionManager actionManager,
- final ActionToolbarView<UserSimpleDTO> actionToolbarView) {
- super(i18n.t("Buddies"), i18n.t("This user buddies"), ws);
- this.actionManager = actionManager;
- menuItemsContainer = new MenuItemsContainer<UserSimpleDTO>();
- this.i18n = i18n;
- final VerticalPanel vp = new VerticalPanel();
- flowPanel = new FlowPanel();
- otherBuddiesLabel = new Label();
- otherBuddiesLabel.addStyleName("kune-Margin-Small-trbl");
- vp.add(flowPanel);
- vp.add(otherBuddiesLabel);
- toolbar = ((ActionToolbarPanel<UserSimpleDTO>) actionToolbarView).getToolbar();
- toolbar.setBlankStyle();
- vp.add((Widget) toolbar);
- super.add(vp);
- addInSummary();
- noBuddiesPublic = new Label(i18n.t(CoreMessages.BUDDIES_NOT_PUBLIC));
- noBuddiesPublic.addStyleName("kune-Margin-7-trbl");
- noBuddiesPublic.addStyleName("k-text-gray");
- }
-
- public void addBuddie(final UserSimpleDTO user, final ActionItemCollection<UserSimpleDTO> actionCollection,
- final String avatarUrl, final String tooltipTitle, final String tooltip) {
- final ClickHandler listener = new ClickHandler() {
- public void onClick(final ClickEvent event) {
- final Element sender = event.getRelativeElement();
- final Menu menu = menuItemsContainer.get(user.getShortName());
- if (menu.getItems().length > 0) {
- menu.showAt(sender.getAbsoluteLeft(), sender.getAbsoluteTop() + 5);
- }
- }
- };
- menuItemsContainer.createItemMenu(user.getShortName(), actionCollection,
- new Listener<ActionItem<UserSimpleDTO>>() {
- public void onEvent(final ActionItem<UserSimpleDTO> actionItem) {
- doAction(actionItem);
- }
- });
-
- final BasicThumb thumb = new BasicThumb(avatarUrl.equals(NOAVATAR) ? "images/persons/person2-32.png"
- : avatarUrl, AVATARSIZE, user.getShortName(), AVATARLABELMAXSIZE, false, listener);
- thumb.setTooltip(tooltipTitle, tooltip);
- flowPanel.add(thumb);
- }
-
- @Override
- public void clear() {
- flowPanel.clear();
- clearOtherUsers();
- menuItemsContainer.clear();
- toolbar.removeAll();
- super.doLayoutIfNeeded();
- }
-
- public void clearOtherUsers() {
- otherBuddiesLabel.setText("");
- }
-
- public void setNoBuddies() {
- otherBuddiesLabel.setText(i18n.t("This user has no buddies"));
- }
-
- public void setOtherUsers(final String text) {
- otherBuddiesLabel.setText(text);
- }
-
- public void showBuddiesNotVisible() {
- flowPanel.add(noBuddiesPublic);
- super.doLayoutIfNeeded();
- }
-
- private void doAction(final ActionItem<UserSimpleDTO> actionItem) {
- actionManager.doAction(actionItem);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryPresenter.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryPresenter.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,241 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-import java.util.List;
-
-import org.ourproject.kune.chat.client.ChatEngine;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
-import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
-import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-import org.ourproject.kune.workspace.client.oldsn.toolbar.ActionBuddiesSummaryToolbar;
-
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.core.client.resources.icons.IconResources;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
-import cc.kune.core.client.rpcservices.UserServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.services.ImageUtils;
-import cc.kune.core.client.state.AccessRightsClientManager;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.UserSNetVisibility;
-import cc.kune.core.shared.domain.utils.AccessRights;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.dto.SocialNetworkDataDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-import cc.kune.core.shared.dto.UserBuddiesDataDTO;
-import cc.kune.core.shared.dto.UserSimpleDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class BuddiesSummaryPresenter extends SocialNetworkPresenter implements BuddiesSummary {
-
- public static final String BUDDIES_VISIBILITY_GROUP = "k-bsp-bud-visib";
-
- private final UserActionRegistry actionRegistry;
- private final Provider<ChatEngine> chatEngineProvider;
- private final Provider<FileDownloadUtils> fileDownUtilsProvider;
- private final I18nTranslationService i18n;
- private final Session session;
- private final StateManager stateManager;
- private final ActionBuddiesSummaryToolbar toolbar;
- private final Provider<UserServiceAsync> userServiceAsync;
- private BuddiesSummaryView view;
-
- @Inject
- public BuddiesSummaryPresenter(final StateManager stateManager, final Session session,
- final Provider<UserServiceAsync> userServiceAsync, final UserActionRegistry actionRegistry,
- final I18nTranslationService i18n, final Provider<ChatEngine> chatEngineProvider,
- final ActionBuddiesSummaryToolbar toolbar, final Provider<FileDownloadUtils> fileDownUtilsProvider,
- final ImageUtils imageUtils, final Provider<SocialNetworkServiceAsync> snServiceAsync,
- final GroupActionRegistry groupActionRegistry, final AccessRightsClientManager accessRightManager,
- final IconResources img) {
- super(i18n, stateManager, accessRightManager, session, snServiceAsync, groupActionRegistry,
- fileDownUtilsProvider, img);
- this.stateManager = stateManager;
- this.session = session;
- this.userServiceAsync = userServiceAsync;
- this.actionRegistry = actionRegistry;
- this.i18n = i18n;
- this.chatEngineProvider = chatEngineProvider;
- this.toolbar = toolbar;
- this.fileDownUtilsProvider = fileDownUtilsProvider;
- stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
- @Override
- public void onEvent(final StateAbstractDTO state) {
- setState(state);
- }
- });
- stateManager.onSocialNetworkChanged(new Listener<StateAbstractDTO>() {
- @Override
- public void onEvent(final StateAbstractDTO state) {
- setState(state);
- }
- });
- registerActions();
- }
-
- private void createAddNewBuddiesAction() {
- final ActionToolbarMenuDescriptor<UserSimpleDTO> addNewBuddiesAction = new ActionToolbarMenuDescriptor<UserSimpleDTO>(
- AccessRolDTO.Administrator, buddiesBottom, new Listener<UserSimpleDTO>() {
- @Override
- public void onEvent(final UserSimpleDTO parameter) {
- NotifyUser.info("In development");
- }
- });
- addNewBuddiesAction.setTextDescription(i18n.t("Add a new buddy"));
- addNewBuddiesAction.setParentMenuTitle(i18n.t("Options"));
- addNewBuddiesAction.setIconUrl("images/add-green.gif");
- actionRegistry.addAction(addNewBuddiesAction);
- }
-
- private void createSetBuddiesVisibilityAction(final String textDescription, final UserSNetVisibility visibility) {
- final ActionToolbarMenuRadioDescriptor<UserSimpleDTO> buddiesVisibilityAction = new ActionToolbarMenuRadioDescriptor<UserSimpleDTO>(
- AccessRolDTO.Administrator, buddiesBottom, new Listener<UserSimpleDTO>() {
- @Override
- public void onEvent(final UserSimpleDTO parameter) {
- userServiceAsync.get().setBuddiesVisibility(session.getUserHash(),
- session.getCurrentState().getGroup().getStateToken(), visibility,
- new AsyncCallbackSimple<Void>() {
- @Override
- public void onSuccess(final Void result) {
- NotifyUser.info(i18n.t("Buddies visibility changed"));
- }
- });
- }
- }, BUDDIES_VISIBILITY_GROUP, new RadioMustBeChecked() {
- @Override
- public boolean mustBeChecked() {
- final StateAbstractDTO currentState = session.getCurrentState();
- if (currentState.getGroup().isPersonal()) {
- final SocialNetworkDataDTO socialNetworkData = currentState.getSocialNetworkData();
- return socialNetworkData.getUserBuddiesVisibility().equals(visibility);
- }
- return false;
- }
- });
- buddiesVisibilityAction.setTextDescription(textDescription);
- buddiesVisibilityAction.setParentMenuTitle(i18n.t("Options"));
- buddiesVisibilityAction.setParentSubMenuTitle(i18n.t("Those who can view your buddies list"));
- actionRegistry.addAction(buddiesVisibilityAction);
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final BuddiesSummaryView view) {
- this.view = view;
- }
-
- private void registerActions() {
- final ActionMenuItemDescriptor<UserSimpleDTO> addAsBuddie = new ActionMenuItemDescriptor<UserSimpleDTO>(
- AccessRolDTO.Viewer, new Listener<UserSimpleDTO>() {
- @Override
- public void onEvent(final UserSimpleDTO user) {
- chatEngineProvider.get().addNewBuddie(user.getShortName());
- }
- });
- addAsBuddie.setMustBeAuthenticated(true);
- addAsBuddie.setTextDescription(i18n.t("Add as a buddie"));
- addAsBuddie.setIconUrl("images/add-green.png");
- addAsBuddie.setEnableCondition(new ActionEnableCondition<UserSimpleDTO>() {
- @Override
- public boolean mustBeEnabled(final UserSimpleDTO user) {
- return !chatEngineProvider.get().isBuddie(user.getShortName());
- }
- });
- actionRegistry.addAction(addAsBuddie);
-
- final ActionMenuItemDescriptor<UserSimpleDTO> go = new ActionMenuItemDescriptor<UserSimpleDTO>(
- AccessRolDTO.Viewer, new Listener<UserSimpleDTO>() {
- @Override
- public void onEvent(final UserSimpleDTO user) {
- stateManager.gotoHistoryToken(user.getShortName());
- }
- });
- go.setMustBeAuthenticated(false);
- go.setTextDescription(i18n.t("Visit this user's homepage"));
- go.setIconUrl("images/group-home.gif");
- actionRegistry.addAction(go);
-
- createAddNewBuddiesAction();
- createSetBuddiesVisibilityAction(i18n.t("anyone"), UserSNetVisibility.anyone);
- createSetBuddiesVisibilityAction(i18n.t("only your buddies"), UserSNetVisibility.yourbuddies);
- createSetBuddiesVisibilityAction(i18n.t("only you"), UserSNetVisibility.onlyyou);
- }
-
- protected void setState(final StateAbstractDTO state) {
- if (state.getGroup().isPersonal()) {
- view.clear();
- final UserBuddiesDataDTO userBuddies = state.getUserBuddies();
- if (state.getSocialNetworkData().isBuddiesVisible()) {
- final List<UserSimpleDTO> buddies = userBuddies.getBuddies();
- for (final UserSimpleDTO user : buddies) {
- final String avatarUrl = user.hasLogo() ? fileDownUtilsProvider.get().getLogoImageUrl(
- user.getStateToken()) : BuddiesSummaryView.NOAVATAR;
- final String tooltip = super.createTooltipWithLogo(user.getShortName(), user.getStateToken(),
- user.hasLogo(), true);
- view.addBuddie(user, actionRegistry.getCurrentActions(user, session.isLogged(), new AccessRights(
- true, true, true), false), avatarUrl, user.getName(), tooltip);
- }
- final boolean hasLocalBuddies = buddies.size() > 0;
- final int numExtBuddies = userBuddies.getOtherExtBuddies();
- if (numExtBuddies > 0) {
- if (hasLocalBuddies) {
- // i18n: plural
- view.setOtherUsers(i18n.t(numExtBuddies == 1 ? "and [%d] external user"
- : "and [%d] external users", numExtBuddies));
- } else {
- view.setOtherUsers(i18n.t(numExtBuddies == 1 ? "[%d] external user" : "[%d] external users",
- numExtBuddies));
- }
- } else {
- if (hasLocalBuddies) {
- view.clearOtherUsers();
- } else {
- view.setNoBuddies();
- }
- }
- toolbar.disableMenusAndClearButtons();
- toolbar.addActions(
- actionRegistry.getCurrentActions(session.getCurrentUser(), session.isLogged(),
- state.getGroupRights(), true), ActionToolbar.IN_ANY);
- toolbar.attach();
- view.show();
- } else {
- view.showBuddiesNotVisible();
- view.show();
- }
- } else {
- view.hide();
- }
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryView.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/BuddiesSummaryView.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ActionItemCollection;
-
-import cc.kune.core.shared.dto.UserSimpleDTO;
-
-public interface BuddiesSummaryView extends View {
-
- String NOAVATAR = "";
- int AVATARSIZE = 32;
- int AVATARLABELMAXSIZE = 15;
-
- void addBuddie(UserSimpleDTO user, ActionItemCollection<UserSimpleDTO> actionCollection, String avatarUrl,
- String tooltipTitle, String tooltip);
-
- void clear();
-
- void clearOtherUsers();
-
- void hide();
-
- void setNoBuddies();
-
- void setOtherUsers(String text);
-
- void show();
-
- void showBuddiesNotVisible();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupActionRegistry.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupActionRegistry.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.actions.ActionRegistry;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-
-/**
- * The Class GroupActionRegistry stores actions over groups (mainly used in SN)
- */
-public class GroupActionRegistry extends ActionRegistry<StateToken> {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummary.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummary.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.ui.MenuItem;
-
-import cc.kune.core.shared.dto.GroupDTO;
-
-public interface GroupMembersSummary {
-
- void addGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
-
- void addUserOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
-
- void removeGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
-
- void removeUserOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryPanel.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryPanel.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,139 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
-import org.ourproject.kune.platf.client.ui.AbstractToolbar;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridDragConfiguration;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel;
-import org.ourproject.kune.workspace.client.skel.SummaryPanel;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.resources.CoreMessages;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GroupDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.google.gwt.core.client.Scheduler;
-import com.google.gwt.core.client.Scheduler.ScheduledCommand;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.widgets.BoxComponent;
-import com.gwtext.client.widgets.MessageBox;
-import com.gwtext.client.widgets.event.ContainerListenerAdapter;
-
-public class GroupMembersSummaryPanel extends SummaryPanel implements GroupMembersSummaryView {
- // private static final int MAX_HEIGHT = 110;
- private final GridMenuPanel<GroupDTO> gridMenuPanel;
- private final I18nUITranslationService i18n;
- private final Label noMembersPublic;
- private final GroupMembersSummaryPresenter presenter;
- private final AbstractToolbar toolbar;
-
- public GroupMembersSummaryPanel(final GroupMembersSummaryPresenter presenter, final I18nUITranslationService i18n,
- final WorkspaceSkeleton ws, final ActionToolbarView<StateToken> actionToolbarView) {
- super(i18n.t("Group members"), i18n.t("People and groups collaborating in this group"), ws);
- this.presenter = presenter;
- this.i18n = i18n;
-
- final GridDragConfiguration dragConf = new GridDragConfiguration("kk",
- i18n.t("Drop into the chat area to start a chat.") + "<br/>"
- + i18n.t("Drop into a room to invite the user to join the chat room"));
- gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This is an orphaned project, if you are interested "
- + "please request to join to work on it"), dragConf, true, true, false, true, false);
- final Listener<String> go = new Listener<String>() {
- @Override
- public void onEvent(final String groupShortName) {
- presenter.onDoubleClick(groupShortName);
- }
- };
- // gridMenuPanel.onClick(go);
- gridMenuPanel.onDoubleClick(go);
- gridMenuPanel.getBottomBar().setCls("k-blank-toolbar");
- super.add(gridMenuPanel);
-
- noMembersPublic = new Label(i18n.t(CoreMessages.MEMBERS_NOT_PUBLIC));
- noMembersPublic.addStyleName("kune-Margin-7-trbl");
- noMembersPublic.addStyleName("k-text-gray");
- noMembersPublic.setVisible(false);
- super.add(noMembersPublic);
-
- toolbar = ((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar();
- toolbar.setBlankStyle();
- super.add((Widget) toolbar);
- super.addInSummary();
- ws.addListenerInEntitySummary(new ContainerListenerAdapter() {
- @Override
- public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
- final int rawWidth, final int rawHeight) {
- gridMenuPanel.setWidth(adjWidth);
- }
- });
- }
-
- @Override
- public void addItem(final GridItem<GroupDTO> gridItem) {
- gridMenuPanel.setVisible(true);
- gridMenuPanel.addItem(gridItem);
- doLayoutIfNeeded();
- }
-
- @Override
- public void clear() {
- gridMenuPanel.removeAll();
- toolbar.removeAll();
- noMembersPublic.setVisible(false);
- doLayoutIfNeeded();
- }
-
- @Override
- public void confirmAddCollab(final String groupShortName, final String groupLongName) {
- final String groupName = groupLongName + " (" + groupShortName + ")";
- MessageBox.confirm(i18n.t("Confirm member joining"), i18n.t("Add [%s] as a member?", groupName),
- new MessageBox.ConfirmCallback() {
- @Override
- public void execute(final String btnID) {
- if (btnID.equals("yes")) {
- Scheduler.get().scheduleDeferred(new ScheduledCommand() {
- @Override
- public void execute() {
- presenter.addCollab(groupShortName);
- }
- });
- }
- }
- });
- }
-
- @Override
- public void setDraggable(final boolean draggable) {
- // gridMenuPanel.setDraggable(draggable);
- }
-
- @Override
- public void showMembersNotVisible() {
- noMembersPublic.setVisible(true);
- gridMenuPanel.setVisible(false);
- doLayoutIfNeeded();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryPresenter.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryPresenter.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,294 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-import java.util.List;
-
-import org.ourproject.kune.chat.client.ChatEngine;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
-import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-import org.ourproject.kune.platf.client.ui.MenuItem;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
-import org.ourproject.kune.workspace.client.oldsn.toolbar.ActionGroupSummaryToolbar;
-import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
-
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.resources.icons.IconResources;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.services.ImageDescriptor;
-import cc.kune.core.client.services.ImageUtils;
-import cc.kune.core.client.state.AccessRightsClientManager;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.AdmissionType;
-import cc.kune.core.shared.domain.SocialNetworkVisibility;
-import cc.kune.core.shared.domain.utils.AccessRights;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.AccessListsDTO;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.core.shared.dto.InitDataDTO;
-import cc.kune.core.shared.dto.LinkDTO;
-import cc.kune.core.shared.dto.SocialNetworkDTO;
-import cc.kune.core.shared.dto.SocialNetworkDataDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-
-import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
-import com.calclab.suco.client.events.Listener;
-import com.google.inject.Provider;
-
-public class GroupMembersSummaryPresenter extends SocialNetworkPresenter implements GroupMembersSummary {
-
- public static final String MEMBERS_VISIBILITY_GROUP = "k-gmsp-memb-visib";
- public static final String NEW_MEMBERS_POLICY_GROUP = "k-gmsp-new-memb-pol";
-
- private final GridGroup adminCategory;
- private final GridGroup collabCategory;
- private final GroupActionRegistry groupActionRegistry;
- private final Provider<GroupServiceAsync> groupServiceProvider;
- private final I18nUITranslationService i18n;
- private final Provider<GroupLiveSearcher> liveSearcherProvider;
- private final GridGroup pendigCategory;
- private final Session session;
- private final Provider<SocialNetworkServiceAsync> snServiceProvider;
- private final StateManager stateManager;
- private GroupMembersSummaryView view;
-
- public GroupMembersSummaryPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
- final ImageUtils imageUtils, final Session session,
- final Provider<SocialNetworkServiceAsync> snServiceProvider,
- final Provider<GroupServiceAsync> groupServiceProvider,
- final Provider<GroupLiveSearcher> liveSearcherProvider, final Provider<ChatEngine> chatEngineProvider,
- final GroupActionRegistry groupActionRegistry, final ActionGroupSummaryToolbar toolbar,
- final Provider<FileDownloadUtils> downloadProvider, final AccessRightsClientManager accessRightsManager,
- final IconResources img) {
- super(i18n, stateManager, accessRightsManager, session, snServiceProvider, groupActionRegistry,
- downloadProvider, img);
- this.i18n = i18n;
- this.stateManager = stateManager;
- this.session = session;
- this.snServiceProvider = snServiceProvider;
- this.groupServiceProvider = groupServiceProvider;
- this.liveSearcherProvider = liveSearcherProvider;
- this.groupActionRegistry = groupActionRegistry;
- final Listener<StateAbstractDTO> setStateListener = new Listener<StateAbstractDTO>() {
- @Override
- public void onEvent(final StateAbstractDTO state) {
- setState(state);
- toolbar.disableMenusAndClearButtons();
- toolbar.addActions(groupActionRegistry.getCurrentActions(state.getGroup().getStateToken(),
- session.isLogged(), state.getGroupRights(), true), ActionToolbar.IN_ANY);
- toolbar.attach();
- }
- };
- stateManager.onStateChanged(setStateListener);
- stateManager.onSocialNetworkChanged(setStateListener);
- session.onInitDataReceived(new Listener<InitDataDTO>() {
- @Override
- public void onEvent(final InitDataDTO initData) {
- addUserOperation(new MenuItem<GroupDTO>("images/new-chat.gif", i18n.t("Start a chat with this member"),
- new Listener<GroupDTO>() {
- @Override
- public void onEvent(final GroupDTO group) {
- chatEngineProvider.get().show();
- if (chatEngineProvider.get().isLoggedIn()) {
- chatEngineProvider.get().chat(
- XmppURI.jid(group.getShortName() + "@" + initData.getChatDomain()));
- } else {
- NotifyUser.important(i18n.t("To start a chat you need to be 'online'"));
- }
- }
- }), true);
- }
- });
- final String adminsTitle = i18n.t("Admins");
- final String collabsTitle = i18n.t("Collaborators");
- final String pendingTitle = i18n.t("Pending");
- adminCategory = new GridGroup(adminsTitle, adminsTitle, i18n.t("People that can admin this group"), true);
- collabCategory = new GridGroup(collabsTitle, collabsTitle,
- i18n.t("Other people that collaborate with this group"), true);
- pendigCategory = new GridGroup(pendingTitle, pendingTitle,
- i18n.t("People pending to be accepted in this group by the admins"),
- imageUtils.getImageHtml(ImageDescriptor.alert), true);
- super.addGroupOperation(gotoGroupMenuItem, false);
- super.addUserOperation(gotoMemberMenuItem, false);
- createActions();
- }
-
- public void addCollab(final String groupShortName) {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().addCollabMember(session.getUserHash(), session.getCurrentState().getStateToken(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Member added as collaborator"));
- stateManager.setSocialNetwork(result);
- }
-
- });
- }
-
- private void createActions() {
- final ActionToolbarMenuDescriptor<StateToken> addMember = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Administrator, membersBottom, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken parameter) {
- liveSearcherProvider.get().onSelection(new Listener<LinkDTO>() {
- @Override
- public void onEvent(final LinkDTO link) {
- view.confirmAddCollab(link.getShortName(), link.getLongName());
- }
- });
- liveSearcherProvider.get().show();
- }
- });
- addMember.setIconUrl("images/add-green.gif");
- addMember.setTextDescription(i18n.t("Add member"));
- addMember.setToolTip(i18n.t("Add an user or a group as member of this group"));
- addMember.setParentMenuTitle(i18n.t("Options"));
-
- groupActionRegistry.addAction(addMember);
- // groupActionRegistry.addAction(unJoin);
-
- // groupActionRegistry.addAction(participate);
- createSetMembersVisibilityAction(i18n.t("anyone"), SocialNetworkVisibility.anyone);
- createSetMembersVisibilityAction(i18n.t("only members"), SocialNetworkVisibility.onlymembers);
- createSetMembersVisibilityAction(i18n.t("only admins"), SocialNetworkVisibility.onlyadmins);
- createNewMembersPolicyAction(i18n.t("moderate request to join"), AdmissionType.Moderated);
- createNewMembersPolicyAction(i18n.t("auto accept request to join"), AdmissionType.Open);
- }
-
- private void createNewMembersPolicyAction(final String textDescription, final AdmissionType admissionPolicy) {
- final ActionToolbarMenuRadioDescriptor<StateToken> newMembersPolicy = new ActionToolbarMenuRadioDescriptor<StateToken>(
- AccessRolDTO.Administrator, membersBottom, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken parameter) {
- groupServiceProvider.get().setGroupNewMembersJoiningPolicy(session.getUserHash(),
- session.getCurrentState().getGroup().getStateToken(), admissionPolicy,
- new AsyncCallbackSimple<Void>() {
- @Override
- public void onSuccess(final Void result) {
- NotifyUser.info(i18n.t("Members joining policy changed"));
- }
- });
- }
- }, NEW_MEMBERS_POLICY_GROUP, new RadioMustBeChecked() {
- @Override
- public boolean mustBeChecked() {
- final StateAbstractDTO currentState = session.getCurrentState();
- return currentState.getGroup().getAdmissionType().equals(admissionPolicy);
- }
- });
- newMembersPolicy.setTextDescription(textDescription);
- newMembersPolicy.setParentMenuTitle(i18n.t("Options"));
- newMembersPolicy.setParentSubMenuTitle(i18n.t("New members policy"));
- groupActionRegistry.addAction(newMembersPolicy);
- }
-
- private void createSetMembersVisibilityAction(final String textDescription, final SocialNetworkVisibility visibility) {
- final ActionToolbarMenuRadioDescriptor<StateToken> showMembers = new ActionToolbarMenuRadioDescriptor<StateToken>(
- AccessRolDTO.Administrator, membersBottom, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken parameter) {
- groupServiceProvider.get().setSocialNetworkVisibility(session.getUserHash(),
- session.getCurrentState().getGroup().getStateToken(), visibility,
- new AsyncCallbackSimple<Void>() {
- @Override
- public void onSuccess(final Void result) {
- NotifyUser.info(i18n.t("Members visibility changed"));
- }
- });
- }
- }, MEMBERS_VISIBILITY_GROUP, new RadioMustBeChecked() {
- @Override
- public boolean mustBeChecked() {
- final StateAbstractDTO currentState = session.getCurrentState();
- if (!currentState.getGroup().isPersonal()) {
- final SocialNetworkDataDTO socialNetworkData = currentState.getSocialNetworkData();
- return socialNetworkData.getSocialNetworkVisibility().equals(visibility);
- }
- return false;
- }
- });
- showMembers.setTextDescription(textDescription);
- showMembers.setParentMenuTitle(i18n.t("Options"));
- showMembers.setParentSubMenuTitle(i18n.t("Those who can view this member list"));
- groupActionRegistry.addAction(showMembers);
- }
-
- public void init(final GroupMembersSummaryView view) {
- this.view = view;
- }
-
- @SuppressWarnings("unchecked")
- private void setGroupMembers(final SocialNetworkDTO socialNetwork, final AccessRights rights) {
- final AccessListsDTO accessLists = socialNetwork.getAccessLists();
-
- final List<GroupDTO> adminsList = accessLists.getAdmins().getList();
- final List<GroupDTO> collabList = accessLists.getEditors().getList();
- final List<GroupDTO> pendingCollabsList = socialNetwork.getPendingCollaborators().getList();
-
- // final int numAdmins = adminsList.size();
-
- final boolean userIsAdmin = rights.isAdministrable();
- final boolean userCanView = rights.isVisible();
-
- view.clear();
-
- view.setDraggable(session.isLogged());
-
- if (userCanView) {
- for (final GroupDTO admin : adminsList) {
- view.addItem(createGridItem(adminCategory, admin, rights, changeToCollabMenuItem, removeMemberMenuItem));
- }
- for (final GroupDTO collab : collabList) {
- view.addItem(createGridItem(collabCategory, collab, rights, changeToAdminMenuItem, removeMemberMenuItem));
- }
- if (userIsAdmin) {
- for (final GroupDTO pendingCollab : pendingCollabsList) {
- view.addItem(createGridItem(pendigCategory, pendingCollab, rights, acceptJoinGroupMenuItem,
- denyJoinGroupMenuItem));
- }
- }
- }
- view.setVisible(true);
- }
-
- private void setState(final StateAbstractDTO state) {
- if (state.getGroup().isPersonal()) {
- view.setVisible(false);
- } else {
- if (state.getSocialNetworkData().isMembersVisible()) {
- setGroupMembers(state.getGroupMembers(), state.getGroupRights());
- } else {
- view.clear();
- view.showMembersNotVisible();
- view.setVisible(true);
- }
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryView.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/GroupMembersSummaryView.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
-
-import cc.kune.core.shared.dto.GroupDTO;
-
-public interface GroupMembersSummaryView {
-
- void addItem(GridItem<GroupDTO> gridItem);
-
- void clear();
-
- void confirmAddCollab(String groupShortName, String groupLongName);
-
- void setDraggable(boolean draggable);
-
- void setVisible(boolean visible);
-
- void showMembersNotVisible();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipateAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipateAction.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipateAction.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,75 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.actions.ActionEvent;
-
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.core.client.resources.icons.IconResources;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
-import cc.kune.core.client.state.AccessRightsClientManager;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.dto.SocialNetworkRequestResult;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Provider;
-
-public class ParticipateAction extends RolAction {
- private final Provider<SocialNetworkServiceAsync> snServiceProvider;
-
- public ParticipateAction(final Session session, final Provider<SocialNetworkServiceAsync> snServiceProvider,
- final StateManager stateManager, final AccessRightsClientManager rightsManager,
- final I18nTranslationService i18n, final IconResources imgResources) {
- super(session, stateManager, rightsManager, i18n, AccessRolDTO.Viewer, i18n.t("Participate"),
- i18n.t("Request to participate in this group"), imgResources.addGreen());
- this.snServiceProvider = snServiceProvider;
- super.setVisible(false, true);
- super.setMustBeAuthenticated(false);
- }
-
- @Override
- public void actionPerformed(final ActionEvent event) {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().requestJoinGroup(session.getUserHash(), session.getCurrentState().getStateToken(),
- new AsyncCallbackSimple<SocialNetworkRequestResult>() {
- @Override
- public void onSuccess(final SocialNetworkRequestResult result) {
- NotifyUser.hideProgress();
- switch ((result)) {
- case accepted:
- NotifyUser.info(i18n.t("You are now member of this group"));
- stateManager.reload();
- break;
- case denied:
- NotifyUser.important(i18n.t("Sorry this is a closed group"));
- break;
- case moderated:
- NotifyUser.info(i18n.t("Membership requested. Waiting for admins decision"));
- break;
- default:
- NotifyUser.info(i18n.t("Programatic error in ParticipateAction"));
- }
- }
- });
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummary.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummary.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.oldsn;
-
-public interface ParticipationSummary {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryPanel.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryPanel.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,80 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
-import org.ourproject.kune.platf.client.ui.AbstractToolbar;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel;
-import org.ourproject.kune.workspace.client.skel.SummaryPanel;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.widgets.BoxComponent;
-import com.gwtext.client.widgets.event.ContainerListenerAdapter;
-
-public class ParticipationSummaryPanel extends SummaryPanel implements ParticipationSummaryView {
-
- private final GridMenuPanel<GroupDTO> gridMenuPanel;
- private final AbstractToolbar toolbar;
-
- public ParticipationSummaryPanel(final ParticipationSummaryPresenter presenter, final I18nTranslationService i18n,
- final WorkspaceSkeleton ws, final ActionToolbarView<StateToken> actionToolbarView) {
- super(i18n.t("Participates in"), i18n.t("Groups in which the user participates"), ws);
- gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This user does not belong to any group"), false, false,
- false, false, false);
- final Listener<String> go = new Listener<String>() {
- public void onEvent(final String groupShortName) {
- presenter.onDoubleClick(groupShortName);
- }
- };
- // gridMenuPanel.onClick(go);
- gridMenuPanel.onDoubleClick(go);
- super.add(gridMenuPanel);
- toolbar = ((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar();
- toolbar.setBlankStyle();
- super.add((Widget) toolbar);
- addInSummary();
- ws.addListenerInEntitySummary(new ContainerListenerAdapter() {
- @Override
- public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
- final int rawWidth, final int rawHeight) {
- gridMenuPanel.setWidth(adjWidth);
- }
- });
- }
-
- public void addItem(final GridItem<GroupDTO> gridItem) {
- gridMenuPanel.addItem(gridItem);
- }
-
- @Override
- public void clear() {
- gridMenuPanel.removeAll();
- toolbar.removeAll();
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryPresenter.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryPresenter.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,105 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.oldsn;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
-import org.ourproject.kune.workspace.client.oldsn.toolbar.ActionParticipationToolbar;
-
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.resources.icons.IconResources;
-import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.services.ImageUtils;
-import cc.kune.core.client.state.AccessRightsClientManager;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.AccessRights;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.core.shared.dto.ParticipationDataDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class ParticipationSummaryPresenter extends SocialNetworkPresenter implements ParticipationSummary {
-
- private final GridGroup adminCategory;
- private GridGroup collabCategory;
- private final GridGroup collabOnlyCategory;
- private ParticipationSummaryView view;
-
- @Inject
- public ParticipationSummaryPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
- final ImageUtils imageUtils, final Session session,
- final Provider<SocialNetworkServiceAsync> snServiceProvider, final GroupActionRegistry groupActionRegistry,
- final ActionParticipationToolbar actionParticipationToolbar,
- final Provider<FileDownloadUtils> downloadProvider, final AccessRightsClientManager accessRightsManager,
- final IconResources img) {
- super(i18n, stateManager, accessRightsManager, session, snServiceProvider, groupActionRegistry,
- downloadProvider, img);
- adminCategory = new GridGroup("admin in:", " ", i18n.tWithNT("Administrate these groups",
- "talking about a person"), false);
- collabCategory = new GridGroup(i18n.t("and as collaborator in:"), " ", i18n.t("Collaborate in these groups"),
- false);
- collabOnlyCategory = new GridGroup(i18n.t("collaborator in:"), " ", i18n.t("Collaborate in these groups"),
- false);
- super.addGroupOperation(gotoGroupMenuItem, false);
- final Listener<StateAbstractDTO> setStateListener = new Listener<StateAbstractDTO>() {
- @Override
- public void onEvent(final StateAbstractDTO state) {
- setState(state);
- }
- };
- stateManager.onStateChanged(setStateListener);
- stateManager.onSocialNetworkChanged(setStateListener);
- }
-
- public void init(final ParticipationSummaryView view) {
- this.view = view;
- }
-
- @SuppressWarnings("unchecked")
- private void setState(final StateAbstractDTO state) {
- final ParticipationDataDTO participation = state.getParticipation();
- final AccessRights rights = state.getGroupRights();
- view.clear();
- final List<GroupDTO> groupsIsAdmin = participation.getGroupsIsAdmin();
- final List<GroupDTO> groupsIsCollab = participation.getGroupsIsCollab();
- final int numAdmins = groupsIsAdmin.size();
- final int numCollaborators = groupsIsCollab.size();
- if (numAdmins == 0) {
- collabCategory = collabOnlyCategory;
- }
- for (final GroupDTO group : groupsIsAdmin) {
- view.addItem(createGridItem(adminCategory, group, rights, unJoinMenuItem));
- }
- for (final GroupDTO group : groupsIsCollab) {
- view.addItem(createGridItem(collabCategory, group, rights, unJoinMenuItem));
- }
- if (numAdmins > 0 || numCollaborators > 0) {
- view.setVisible(true);
- } else {
- view.setVisible(false);
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryView.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/ParticipationSummaryView.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
-
-import cc.kune.core.shared.dto.GroupDTO;
-
-public interface ParticipationSummaryView extends View {
-
- void addItem(GridItem<GroupDTO> createGridItem);
-
- void clear();
-
- void setVisible(boolean b);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/RolAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/RolAction.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/RolAction.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,99 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.actions.AbstractExtendedAction;
-import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip;
-
-import cc.kune.core.client.sn.actions.RolComparator;
-import cc.kune.core.client.state.AccessRightsClientManager;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.AccessRights;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.gwt.resources.client.ImageResource;
-
-public abstract class RolAction extends AbstractExtendedAction {
-
- public static UIStatus refreshStatus(final AccessRolDTO rolRequired, final boolean authNeed,
- final boolean isLogged, final boolean visibleForMembers, final boolean visibleForNonMemb,
- final AccessRights newRights) {
- boolean newVisibility = false;
- boolean newEnabled = false;
- if (authNeed && !isLogged) {
- newVisibility = newEnabled = false;
- } else {
- // Auth ok
- newEnabled = RolComparator.isEnabled(rolRequired, newRights);
- if (newEnabled) {
- final boolean isMember = RolComparator.isMember(newRights);
- newEnabled = newVisibility = isMember && visibleForMembers || !isMember && visibleForNonMemb;
- } else {
- newVisibility = false;
- }
- }
- return new UIStatus(newVisibility, newEnabled);
- }
-
- private boolean authNeed;
- protected final I18nTranslationService i18n;
- protected final Session session;
- protected final StateManager stateManager;
- private boolean visibleForMembers;
- private boolean visibleForNonMemb;
-
- public RolAction(final Session session, final StateManager stateManager,
- final AccessRightsClientManager rightsManager, final I18nTranslationService i18n,
- final AccessRolDTO rolRequired, final String text, final String tooltip, final ImageResource icon) {
- super(text, tooltip, icon);
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- this.visibleForMembers = true;
- this.visibleForNonMemb = true;
- this.authNeed = false;
- // rightsManager.onRightsChanged(new Listener2<AccessRights,
- // AccessRights>() {
- // public void onEvent(final AccessRights prevRights, final AccessRights
- // newRights) {
- // setStatus(refreshStatus(rolRequired, authNeed, session.isLogged(),
- // visibleForMembers,
- // visibleForNonMemb, newRights));
- // }
- //
- // });
- }
-
- public void setMustBeAuthenticated(final boolean authNeed) {
- this.authNeed = authNeed;
- }
-
- private void setStatus(final UIStatus refreshStatus) {
- setEnabled(refreshStatus.isEnabled());
- putValue(OldGuiActionDescrip.VISIBLE, refreshStatus.isVisible());
- }
-
- public void setVisible(final boolean forMembers, final boolean forNonMembers) {
- this.visibleForMembers = forMembers;
- this.visibleForNonMemb = forNonMembers;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/SocialNetworkPresenter.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/SocialNetworkPresenter.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,329 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.ui.ButtonDescriptor;
-import org.ourproject.kune.platf.client.actions.ui.MenuDescriptor;
-import org.ourproject.kune.platf.client.actions.ui.OldMenuItemDescriptor;
-import org.ourproject.kune.platf.client.ui.MenuItem;
-import org.ourproject.kune.platf.client.ui.MenuItemCollection;
-import org.ourproject.kune.platf.client.ui.gridmenu.CustomMenu;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
-
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.core.client.resources.icons.IconResources;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
-import cc.kune.core.client.services.FileConstants;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.state.AccessRightsClientManager;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.AccessRights;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.core.shared.dto.SocialNetworkDataDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener;
-import com.google.inject.Provider;
-
-public class SocialNetworkPresenter {
-
- private static final String MEMBERS_BOTTON = "members_bottom";
-
- protected MenuItem<GroupDTO> acceptJoinGroupMenuItem;
- protected final ActionToolbarPosition buddiesBottom = new ActionToolbarPosition("sn-bottomtoolbar");
- protected MenuItem<GroupDTO> changeToAdminMenuItem;
- protected MenuItem<GroupDTO> changeToCollabMenuItem;
- protected MenuItem<GroupDTO> denyJoinGroupMenuItem;
- private final Provider<FileDownloadUtils> downloadProvider;
- protected MenuItem<GroupDTO> gotoGroupMenuItem;
- protected MenuItem<GroupDTO> gotoMemberMenuItem;
- private final I18nTranslationService i18n;
- private final IconResources imgResources;
- protected final ActionToolbarPosition membersBottom = new ActionToolbarPosition("sn-bottomtoolbar");
- private MenuDescriptor menuOptions;
- private final MenuItemCollection<GroupDTO> otherLoggedOperations;
- private final MenuItemCollection<GroupDTO> otherLoggedOperationsUsers;
- private final MenuItemCollection<GroupDTO> otherOperations;
- private final MenuItemCollection<GroupDTO> otherOperationsUsers;
- protected ActionToolbarButtonDescriptor<StateToken> participate;
- protected MenuItem<GroupDTO> removeMemberMenuItem;
- private final AccessRightsClientManager rightsManager;
- private final Session session;
- private final Provider<SocialNetworkServiceAsync> snServiceProvider;
- private final StateManager stateManager;
- protected ActionToolbarMenuDescriptor<StateToken> unJoin;
-
- protected MenuItem<GroupDTO> unJoinMenuItem;
-
- public SocialNetworkPresenter(final I18nTranslationService i18n, final StateManager stateManager,
- final AccessRightsClientManager rightsManager, final Session session,
- final Provider<SocialNetworkServiceAsync> snServiceProvider, final GroupActionRegistry groupActionRegistry,
- final Provider<FileDownloadUtils> downloadProvider, final IconResources imgResources) {
- this.i18n = i18n;
- this.stateManager = stateManager;
- this.rightsManager = rightsManager;
- this.session = session;
- this.snServiceProvider = snServiceProvider;
- this.downloadProvider = downloadProvider;
- this.imgResources = imgResources;
- createButtons();
- createMenuActions();
- otherOperationsUsers = new MenuItemCollection<GroupDTO>();
- otherLoggedOperationsUsers = new MenuItemCollection<GroupDTO>();
- otherOperations = new MenuItemCollection<GroupDTO>();
- otherLoggedOperations = new MenuItemCollection<GroupDTO>();
- }
-
- public void addGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- MenuItemCollection<GroupDTO> collection;
- collection = mustBeLogged ? otherLoggedOperations : otherOperations;
- collection.add(operation);
- }
-
- public void addUserOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- MenuItemCollection<GroupDTO> collection;
- collection = mustBeLogged ? otherLoggedOperationsUsers : otherOperationsUsers;
- collection.add(operation);
- }
-
- private void createButtons() {
- final ParticipateAction participateAction = new ParticipateAction(session, snServiceProvider, stateManager,
- rightsManager, i18n, imgResources);
- final ButtonDescriptor participateBtn = new ButtonDescriptor(participateAction);
- participateBtn.setLocation(MEMBERS_BOTTON);
-
- menuOptions = new MenuDescriptor(i18n.t("Options"));
-
- final UnjoinButtonAction unjoinAction = new UnjoinButtonAction(session, snServiceProvider, stateManager, rightsManager,
- i18n, imgResources) {
- @Override
- public String getGroupName() {
- return session.getContainerState().getGroup().getShortName();
- }
- };
-
- final OldMenuItemDescriptor unjoinBtn = new OldMenuItemDescriptor(menuOptions, unjoinAction);
- unjoinBtn.setLocation(MEMBERS_BOTTON);
- }
-
- private GridItem<GroupDTO> createDefMemberMenu(final GroupDTO group, final GridGroup gridGroup) {
- final CustomMenu<GroupDTO> menu = new CustomMenu<GroupDTO>(group);
- final String longName = group.getLongName();
- final boolean hasLogo = group.hasLogo();
- final String toolTip = createTooltipWithLogo(group.getShortName(), group.getStateToken(), hasLogo,
- group.isPersonal());
- final String imageHtml = downloadProvider.get().getLogoAvatarHtml(group.getStateToken(), hasLogo,
- group.isPersonal(), session.getImgIconsize(), 0);
- final GridItem<GroupDTO> gridItem = new GridItem<GroupDTO>(group, gridGroup, group.getShortName(), imageHtml,
- longName, longName, " ", longName, toolTip, menu);
- if (!group.isPersonal()) {
- menu.addMenuItemList(otherOperations);
- }
- if (session.isLogged() && !group.isPersonal()) {
- menu.addMenuItemList(otherLoggedOperations);
- }
- if (group.isPersonal()) {
- menu.addMenuItemList(otherOperationsUsers);
- }
- if (session.isLogged() && group.isPersonal()) {
- menu.addMenuItemList(otherLoggedOperationsUsers);
- }
-
- return gridItem;
- }
-
- protected GridItem<GroupDTO> createGridItem(final GridGroup groupCategory, final GroupDTO group,
- final AccessRights rights, final MenuItem<GroupDTO>... gridMenuItems) {
- final GridItem<GroupDTO> gridItem = createDefMemberMenu(group, groupCategory);
- final CustomMenu<GroupDTO> menu = gridItem.getMenu();
- if (rights.isAdministrable()) {
- for (final MenuItem<GroupDTO> item : gridMenuItems) {
- menu.addMenuItem(item);
- }
- }
- return gridItem;
- }
-
- private void createMenuActions() {
- gotoGroupMenuItem = new MenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this group homepage"),
- new Listener<GroupDTO>() {
- @Override
- public void onEvent(final GroupDTO groupDTO) {
- stateManager.gotoHistoryToken(groupDTO.getShortName());
- }
- });
- gotoMemberMenuItem = new MenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this member homepage"),
- new Listener<GroupDTO>() {
- @Override
- public void onEvent(final GroupDTO groupDTO) {
- stateManager.gotoHistoryToken(groupDTO.getShortName());
- }
- });
-
- unJoinMenuItem = new MenuItem<GroupDTO>("images/del.gif", i18n.t("Do not participate anymore in this group"),
- new Listener<GroupDTO>() {
- @Override
- public void onEvent(final GroupDTO groupDTO) {
- removeMemberAction(groupDTO);
- }
- });
- changeToCollabMenuItem = new MenuItem<GroupDTO>("images/arrow-down-green.gif",
- i18n.t("Change to collaborator"), new Listener<GroupDTO>() {
- @Override
- public void onEvent(final GroupDTO group) {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
- session.getCurrentState().getStateToken(), group.getShortName(),
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Member type changed"));
- stateManager.setSocialNetwork(result);
- }
- });
- }
- });
- removeMemberMenuItem = new MenuItem<GroupDTO>("images/del.gif", i18n.t("Remove this member"),
- new Listener<GroupDTO>() {
- @Override
- public void onEvent(final GroupDTO group) {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().deleteMember(session.getUserHash(),
- session.getCurrentState().getStateToken(), group.getShortName(),
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Member removed"));
- stateManager.reload();
- // in the
- // future,
- // only if
- // I cannot
- // be
- // affected:
- // snService.stateManager.reloadSocialNetwork((SocialNetworkResultDTO)
- // result);
- }
- });
- }
- });
- changeToAdminMenuItem = new MenuItem<GroupDTO>("images/arrow-up-green.gif", i18n.t("Change to admin"),
- new Listener<GroupDTO>() {
- @Override
- public void onEvent(final GroupDTO group) {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().setCollabAsAdmin(session.getUserHash(),
- session.getCurrentState().getStateToken(), group.getShortName(),
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Member type changed"));
- stateManager.setSocialNetwork(result);
- }
- });
- }
- });
- acceptJoinGroupMenuItem = new MenuItem<GroupDTO>("images/accept.gif", i18n.t("Accept this member"),
- new Listener<GroupDTO>() {
- @Override
- public void onEvent(final GroupDTO group) {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().acceptJoinGroup(session.getUserHash(),
- session.getCurrentState().getStateToken(), group.getShortName(),
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Member accepted"));
- stateManager.setSocialNetwork(result);
- }
- });
- }
- });
- denyJoinGroupMenuItem = new MenuItem<GroupDTO>("images/cancel.gif", i18n.t("Reject this member"),
- new Listener<GroupDTO>() {
- @Override
- public void onEvent(final GroupDTO group) {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().denyJoinGroup(session.getUserHash(),
- session.getCurrentState().getStateToken(), group.getShortName(),
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Member rejected"));
- stateManager.setSocialNetwork(result);
- }
- });
- }
- });
- }
-
- protected String createTooltipWithLogo(final String shortName, final StateToken token, final boolean hasLogo,
- final boolean isPersonal) {
- return "<table><tr><td>"
- + (hasLogo ? downloadProvider.get().getLogoAvatarHtml(token, hasLogo, isPersonal,
- FileConstants.LOGO_DEF_HEIGHT, 3) : "") + "</td><td>"
- + i18n.t(isPersonal ? "Nickname: [%s]" : "Group short name: [%s]", shortName) + "</td></tr></table>";
- }
-
- public void onDoubleClick(final String groupShortName) {
- stateManager.gotoHistoryToken(groupShortName);
- }
-
- public void removeGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- MenuItemCollection<GroupDTO> collection;
- collection = mustBeLogged ? otherLoggedOperations : otherOperations;
- collection.remove(operation);
- }
-
- private void removeMemberAction(final GroupDTO groupDTO) {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().unJoinGroup(session.getUserHash(), new StateToken(groupDTO.getShortName()),
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Removed as member"));
- stateManager.reload();
- // in the future with user
- // info:
- // services.stateManager.reloadSocialNetwork((SocialNetworkResultDTO)
- // result);
- }
- });
- }
-
- public void removeUserOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- MenuItemCollection<GroupDTO> collection;
- collection = mustBeLogged ? otherLoggedOperationsUsers : otherOperationsUsers;
- collection.remove(operation);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UIStatus.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UIStatus.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UIStatus.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,82 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.oldsn;
-
-public class UIStatus {
-
- private boolean visible;
- private boolean enabled;
-
- public UIStatus(final boolean visible, final boolean enabled) {
- this.visible = visible;
- this.enabled = enabled;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final UIStatus other = (UIStatus) obj;
- if (enabled != other.enabled) {
- return false;
- }
- if (visible != other.visible) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (enabled ? 1231 : 1237);
- result = prime * result + (visible ? 1231 : 1237);
- return result;
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public boolean isVisible() {
- return visible;
- }
-
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- public void setVisible(final boolean visible) {
- this.visible = visible;
- }
-
- @Override
- public String toString() {
- return "(v: " + visible + ", e:" + enabled + ")";
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UnjoinButtonAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UnjoinButtonAction.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UnjoinButtonAction.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,82 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.actions.ActionEvent;
-
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.OnAcceptCallback;
-import cc.kune.core.client.resources.icons.IconResources;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
-import cc.kune.core.client.state.AccessRightsClientManager;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.dto.SocialNetworkDataDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Provider;
-
-public class UnjoinButtonAction extends RolAction {
- private String groupName;
- private final Provider<SocialNetworkServiceAsync> snServiceProvider;
-
- public UnjoinButtonAction(final Session session, final Provider<SocialNetworkServiceAsync> snServiceProvider,
- final StateManager stateManager, final AccessRightsClientManager rightsManager,
- final I18nTranslationService i18n, final IconResources imgResources) {
- super(session, stateManager, rightsManager, i18n, AccessRolDTO.Editor, i18n.t("Leave this group"),
- i18n.t("Do not participate anymore in this group"), imgResources.delGreen());
- this.snServiceProvider = snServiceProvider;
- super.setVisible(true, false);
- super.setMustBeAuthenticated(true);
- }
-
- @Override
- public void actionPerformed(final ActionEvent event) {
- NotifyUser.askConfirmation(i18n.t("Leave this group"), i18n.t("Are you sure?"), new OnAcceptCallback() {
- @Override
- public void onSuccess() {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().unJoinGroup(session.getUserHash(), new StateToken(getGroupName()),
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Removed as member"));
- stateManager.reload();
- // in the future with user info:
- // stateManager.reloadSocialNetwork((SocialNetworkResultDTO)
- // result);
- }
- });
- }
- });
- }
-
- public String getGroupName() {
- return groupName;
- }
-
- public void setGroupName(final String groupName) {
- this.groupName = groupName;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UserActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UserActionRegistry.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/UserActionRegistry.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.oldsn;
-
-import org.ourproject.kune.platf.client.actions.ActionRegistry;
-
-import cc.kune.core.shared.dto.UserSimpleDTO;
-
-/**
- * The Class UserActionRegistry.
- *
- * List of actions over a user (initially used for buddies actions)
- *
- */
-public class UserActionRegistry extends ActionRegistry<UserSimpleDTO> {
-}
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/main/resources/kune.properties 2011-05-06 20:13:51 UTC (rev 1356)
@@ -42,6 +42,8 @@
kune.upload.gallerypermittedextensions = jpg,jpeg,png,gif,bmp,svg,avi,mpg,mpeg,ogg,mov,tif,tiff,mp3,wav
kune.upload.maxfilesizeinmegas = 10
+kune.upload.maxfilesizeinks = 10000000
+kune.upload.delayfortest = 50
# Images are resized to thumbsize pixels and later cropped (centered) to cropsize
# (integer values)
kune.images.resizewidth = 400
Deleted: trunk/src/test/java/org/ourproject/kune/workspace/client/socialnet/SNRolActionTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/socialnet/SNRolActionTest.java 2011-05-06 14:45:24 UTC (rev 1355)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/socialnet/SNRolActionTest.java 2011-05-06 20:13:51 UTC (rev 1356)
@@ -1,102 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.socialnet;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.ourproject.kune.workspace.client.oldsn.RolAction;
-import org.ourproject.kune.workspace.client.oldsn.UIStatus;
-
-import cc.kune.core.shared.domain.utils.AccessRights;
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-public class SNRolActionTest {
-
- private AccessRights adminRights;
- private AccessRights editorRights;
- private AccessRights viewerRights;
- private AccessRights noPermRights;
- private UIStatus ff;
- private UIStatus tt;
-
- @Before
- public void before() {
- adminRights = new AccessRights(true, true, true);
- editorRights = new AccessRights(false, true, true);
- viewerRights = new AccessRights(false, false, true);
- noPermRights = new AccessRights(false, false, false);
- ff = new UIStatus(false, false);
- tt = new UIStatus(true, true);
- }
-
- @Test
- public void testRefreshStatus() {
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Viewer, false, false, true, true, noPermRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Viewer, true, false, true, true, noPermRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Viewer, true, true, true, true, noPermRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Viewer, true, true, false, true, noPermRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Viewer, true, true, false, false, noPermRights));
-
- assertEquals(tt, RolAction.refreshStatus(AccessRolDTO.Viewer, false, false, true, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Viewer, true, false, true, true, viewerRights));
- assertEquals(tt, RolAction.refreshStatus(AccessRolDTO.Viewer, true, true, true, true, viewerRights));
- assertEquals(tt, RolAction.refreshStatus(AccessRolDTO.Viewer, true, true, false, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Viewer, true, true, false, false, viewerRights));
-
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, false, false, true, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, false, true, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, true, true, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, true, false, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, true, false, false, viewerRights));
-
- assertEquals(tt, RolAction.refreshStatus(AccessRolDTO.Editor, false, false, true, true, editorRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, false, true, true, editorRights));
- assertEquals(tt, RolAction.refreshStatus(AccessRolDTO.Editor, true, true, true, true, editorRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, true, false, true, editorRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, true, false, false, editorRights));
-
- assertEquals(tt, RolAction.refreshStatus(AccessRolDTO.Editor, false, false, true, true, adminRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, false, true, true, adminRights));
- assertEquals(tt, RolAction.refreshStatus(AccessRolDTO.Editor, true, true, true, true, adminRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, true, false, true, adminRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Editor, true, true, false, false, adminRights));
-
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, false, false, true, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, false, true, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, true, true, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, true, false, true, viewerRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, true, false, false, viewerRights));
-
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, false, false, true, true, editorRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, false, true, true, editorRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, true, true, true, editorRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, true, false, true, editorRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, true, false, false, editorRights));
-
- assertEquals(tt, RolAction.refreshStatus(AccessRolDTO.Administrator, false, false, true, true, adminRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, false, true, true, adminRights));
- assertEquals(tt, RolAction.refreshStatus(AccessRolDTO.Administrator, true, true, true, true, adminRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, true, false, true, adminRights));
- assertEquals(ff, RolAction.refreshStatus(AccessRolDTO.Administrator, true, true, false, false, adminRights));
-
- }
-}
More information about the kune-commits
mailing list