[kune-commits] r1005 - in trunk: doc
src/main/java/org/ourproject/kune/app/public/css
src/main/java/org/ourproject/kune/app/public/css/img
src/main/java/org/ourproject/kune/platf/client/dto
src/main/java/org/ourproject/kune/platf/client/rpc
src/main/java/org/ourproject/kune/platf/client/services
src/main/java/org/ourproject/kune/platf/client/state
src/main/java/org/ourproject/kune/platf/client/ui/dialogs
src/main/java/org/ourproject/kune/platf/server
src/main/java/org/ourproject/kune/platf/server/manager
src/main/java/org/ourproject/kune/platf/server/manager/file
src/main/java/org/ourproject/kune/platf/server/manager/impl
src/main/java/org/ourproject/kune/platf/server/rpc
src/main/java/org/ourproject/kune/workspace/client/licensechoose
src/main/java/org/ourproject/kune/workspace/client/licensewizard
src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages
src/main/java/org/ourproject/kune/workspace/client/newgroup
src/main/java/org/ourproject/kune/workspace/client/options/license
src/main/java/org/ourproject/kune/workspace/client/signin
src/main/resources
src/test/java/org/ourproject/kune/platf/integration/selenium
src/test/java/org/ourproject/kune/workspace/client/licensewizard
vjrj
vjrj at ourproject.org
Sat Dec 20 23:06:51 CET 2008
Author: vjrj
Date: 2008-12-20 23:06:41 +0100 (Sat, 20 Dec 2008)
New Revision: 1005
Added:
trunk/src/main/java/org/ourproject/kune/app/public/css/img/kune-icon16.png
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdFormView.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoose.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChooseView.java
Modified:
trunk/doc/kune-dic-08.odp
trunk/doc/kune-dic-08.pdf
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialogExtended.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/LicenseManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/LicenseManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizard.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFirstForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndFormView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java
trunk/src/main/resources/kune.properties
trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java
trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/NewGroupSeleniumTest.java
trunk/src/test/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenterTest.java
Log:
Complete - task New License Wizard
Modified: trunk/doc/kune-dic-08.odp
===================================================================
(Binary files differ)
Modified: trunk/doc/kune-dic-08.pdf
===================================================================
(Binary files differ)
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-12-20 22:06:41 UTC (rev 1005)
@@ -41,4 +41,4 @@
padding: 1px 0px 1px 1px;
text-decoration:none;
}
-*/.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-deflicense-icon{background-image:url(img/copyleft.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}
\ No newline at end of file
+*/.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-deflicense-icon{background-image:url(img/copyleft.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/app/public/css/img/kune-icon16.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/css/img/kune-icon16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-12-20 22:06:41 UTC (rev 1005)
@@ -829,6 +829,10 @@
background-image: url(img/info.gif) !important;
}
+.k-newgroup-icon {
+ background-image: url(img/kune-icon16.png) !important;
+}
+
.x-toolbar-body table {
/* width: 100%; */
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -34,8 +34,11 @@
private String chatDomain;
private String chatRoomHost;
private String defaultWsTheme;
+ private LicenseDTO defaultLicense;
private String[] wsThemes;
+
private String siteLogoUrl;
+
private String galleryPermittedExtensions;
private String maxFileSizeInMb;
private int imgResizewidth;
@@ -61,6 +64,10 @@
return countries;
}
+ public LicenseDTO getDefaultLicense() {
+ return defaultLicense;
+ }
+
public String getDefaultWsTheme() {
return defaultWsTheme;
}
@@ -145,6 +152,10 @@
this.countries = countries;
}
+ public void setDefaultLicense(LicenseDTO defaultLicense) {
+ this.defaultLicense = defaultLicense;
+ }
+
public void setDefaultWsTheme(final String defaultWsTheme) {
this.defaultWsTheme = defaultWsTheme;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -20,6 +20,7 @@
package org.ourproject.kune.platf.client.rpc;
import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.DefaultException;
@@ -28,6 +29,8 @@
public interface GroupService extends RemoteService {
+ void changeDefLicense(final String userHash, final StateToken groupToken, final LicenseDTO license);
+
void changeGroupWsTheme(String userHash, StateToken groupToken, String theme) throws DefaultException;
StateToken createNewGroup(String userHash, GroupDTO group, String publicDesc, String tags, String[] enabledTools)
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -20,6 +20,7 @@
package org.ourproject.kune.platf.client.rpc;
import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -27,6 +28,9 @@
public interface GroupServiceAsync {
+ void changeDefLicense(final String userHash, final StateToken groupToken, final LicenseDTO license,
+ AsyncCallback<?> asyncCallback);
+
void changeGroupWsTheme(String userHash, StateToken groupToken, String theme, AsyncCallback<?> callback);
void createNewGroup(String userHash, GroupDTO group, String publicDesc, String tags, String[] enabledTools,
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -100,9 +100,7 @@
import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPanel;
import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
-import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
-import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
-import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePresenter;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
import org.ourproject.kune.workspace.client.newgroup.NewGroup;
import org.ourproject.kune.workspace.client.newgroup.NewGroupPanel;
import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
@@ -328,22 +326,12 @@
}
});
- register(Singleton.class, new Factory<LicenseChoose>(LicenseChoose.class) {
- @Override
- public LicenseChoose create() {
- final LicenseChoosePresenter presenter = new LicenseChoosePresenter($(Session.class));
- final LicenseChoosePanel view = new LicenseChoosePanel(presenter, i18n, $(Images.class));
- presenter.init(view);
- return presenter;
- }
- });
-
register(Singleton.class, new Factory<NewGroup>(NewGroup.class) {
@Override
public NewGroup create() {
final NewGroupPresenter presenter = new NewGroupPresenter(i18n, $(Session.class),
$(StateManager.class), $$(GroupServiceAsync.class));
- final NewGroupPanel view = new NewGroupPanel(presenter, i18n, $$(LicenseChoose.class), $(Images.class));
+ final NewGroupPanel view = new NewGroupPanel(presenter, i18n, $$(LicenseWizard.class), $(Images.class));
presenter.init(view);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -49,11 +49,14 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.licensefoot.EntityLicensePanel;
import org.ourproject.kune.workspace.client.licensefoot.EntityLicensePresenter;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseChangeAction;
import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardPanel;
import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardPresenter;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstForm;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstFormView;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdForm;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdFormView;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndForm;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndFormView;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardTrdForm;
@@ -477,7 +480,8 @@
@Override
public EntityOptionsDefLicense create() {
final EntityOptionsDefLicensePresenter presenter = new EntityOptionsDefLicensePresenter(
- $(EntityOptions.class), $(StateManager.class), $(Session.class), $$(LicenseWizard.class));
+ $(EntityOptions.class), $(StateManager.class), $(Session.class), $$(LicenseWizard.class),
+ $$(LicenseChangeAction.class));
final EntityOptionsDefLicensePanel panel = new EntityOptionsDefLicensePanel(presenter,
$(WorkspaceSkeleton.class), $(I18nTranslationService.class));
presenter.init(panel);
@@ -485,6 +489,14 @@
}
});
+ register(Singleton.class, new Factory<LicenseChangeAction>(LicenseChangeAction.class) {
+ @Override
+ public LicenseChangeAction create() {
+ return new LicenseChangeAction($$(GroupServiceAsync.class), $(Session.class),
+ $(I18nTranslationService.class), $(StateManager.class));
+ }
+ });
+
register(Singleton.class, new Factory<RenameAction>(RenameAction.class) {
@Override
public RenameAction create() {
@@ -498,7 +510,7 @@
public LicenseWizard create() {
final LicenseWizardPresenter presenter = new LicenseWizardPresenter(
$(LicenseWizardFirstFormView.class), $(LicenseWizardSndFormView.class),
- $(LicenseWizardTrdFormView.class), $$(GroupServiceAsync.class));
+ $(LicenseWizardTrdFormView.class), $(LicenseWizardFrdFormView.class), $(Session.class));
final LicenseWizardPanel panel = new LicenseWizardPanel(presenter, $(WorkspaceSkeleton.class),
$(I18nTranslationService.class));
presenter.init(panel);
@@ -526,5 +538,12 @@
return new LicenseWizardTrdForm($(Images.class), $(I18nTranslationService.class));
}
});
+
+ register(Singleton.class, new Factory<LicenseWizardFrdFormView>(LicenseWizardFrdFormView.class) {
+ @Override
+ public LicenseWizardFrdFormView create() {
+ return new LicenseWizardFrdForm($(I18nTranslationService.class), $(Session.class));
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -64,6 +64,8 @@
*/
int SESSION_DURATION = 1000 * 60 * 60 * 24 * 14;
+ public LicenseDTO getDefLicense();
+
public int getImgCropsize();
public int getImgIconsize();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -111,6 +111,10 @@
return currentUserInfo;
}
+ public LicenseDTO getDefLicense() {
+ return initData.getDefaultLicense();
+ }
+
public String getGalleryPermittedExtensions() {
return initData.getGalleryPermittedExtensions();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialogExtended.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialogExtended.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialogExtended.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -82,4 +82,12 @@
public Button getFirstButton() {
return firstButton;
}
+
+ public void mask(final String message) {
+ getEl().mask(message, "x-mask-loading");
+ }
+
+ public void unMask() {
+ getEl().unmask();
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -113,6 +113,10 @@
form.setHeight(height);
}
+ public void setHideLabels(boolean hide) {
+ form.setHideLabels(hide);
+ }
+
public void setPaddings(int padding) {
form.setPaddings(padding);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -118,11 +118,6 @@
doLayoutIfNeeded();
}
- @Deprecated
- public void add(final Widget widget) {
- dialog.add(widget);
- }
-
public void center() {
dialog.center();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -38,8 +38,12 @@
private String siteDomain;
private String chatDomain;
private String chatRoomHost;
+ private License defaultLicense;
+
private String defaultWsTheme;
+
private String[] wsThemes;
+
private String siteLogoUrl;
private String galleryPermittedExtensions;
private String maxFileSizeInMb;
@@ -66,6 +70,10 @@
return countries;
}
+ public License getDefaultLicense() {
+ return defaultLicense;
+ }
+
public String getDefaultWsTheme() {
return defaultWsTheme;
}
@@ -146,6 +154,10 @@
this.countries = countries;
}
+ public void setDefaultLicense(License defaultLicense) {
+ this.defaultLicense = defaultLicense;
+ }
+
public void setDefaultWsTheme(final String defaultWsTheme) {
this.defaultWsTheme = defaultWsTheme;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -32,6 +32,8 @@
public interface GroupManager extends Manager<Group, Long> {
+ void changeDefLicense(User user, Group group, String licenseShortName);
+
void changeWsTheme(User user, Group group, String theme) throws AccessViolationException;
Group createGroup(Group group, User user) throws GroupNameInUseException, UserMustBeLoggedException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/LicenseManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/LicenseManager.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/LicenseManager.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -25,16 +25,18 @@
public interface LicenseManager {
+ License findByShortName(String licenseDef);
+
List<License> getAll();
- License persist(final License license);
+ List<License> getCC();
- void setLicenseFinder(final License licenseFinder);
+ License getDefLicense();
- List<License> getCC();
-
List<License> getNotCC();
- License findByShortName(String licenseDef);
+ License persist(final License license);
+ void setLicenseFinder(final License licenseFinder);
+
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -166,7 +166,6 @@
if (isPdf) {
ImageUtilsDefault.createThumbFromPdf(fileOrig, previewName);
}
-
} catch (NumberFormatException e) {
log.error("Image sizes in kune.properties are not integers");
e.printStackTrace();
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefault.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefault.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -57,6 +57,14 @@
cropImage(scaled, fileDest, x, y, cropDimension, cropDimension);
}
+ /**
+ * convert -density 300 -quality 100 -resize 720x file.pdf result.png
+ *
+ * @param pdfFile
+ * @param newPngFile
+ * @return
+ * @throws MagickException
+ */
static public boolean createThumbFromPdf(String pdfFile, String newPngFile) throws MagickException {
MagickImage pdf = readImage(pdfFile);
MagickImage pdf1 = pdf.breakFrames()[0];
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -46,6 +46,7 @@
import org.ourproject.kune.platf.server.domain.ToolConfiguration;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.GroupManager;
+import org.ourproject.kune.platf.server.manager.LicenseManager;
import org.ourproject.kune.platf.server.properties.DatabaseProperties;
import org.ourproject.kune.platf.server.properties.KuneProperties;
import org.ourproject.kune.platf.server.tool.ServerTool;
@@ -65,21 +66,32 @@
private final KuneProperties kuneProperties;
private final User userFinder;
private final ServerToolRegistry serverToolRegistry;
+ private final LicenseManager licenseManager;
@Inject
public GroupManagerDefault(final Provider<EntityManager> provider, final Group finder, final User userFinder,
final KuneProperties kuneProperties, final DatabaseProperties properties,
- final ServerToolRegistry registry, final License licenseFinder, ServerToolRegistry serverToolRegistry) {
+ final ServerToolRegistry registry, final LicenseManager licenseManager, final License licenseFinder,
+ ServerToolRegistry serverToolRegistry) {
super(provider, Group.class);
this.finder = finder;
this.userFinder = userFinder;
this.kuneProperties = kuneProperties;
this.properties = properties;
this.registry = registry;
+ this.licenseManager = licenseManager;
this.licenseFinder = licenseFinder;
this.serverToolRegistry = serverToolRegistry;
}
+ public void changeDefLicense(User user, Group group, String licName) {
+ final License license = licenseFinder.findByShortName(licName);
+ if (license == null) {
+ throw new RuntimeException("Unknown license");
+ }
+ group.setDefaultLicense(license);
+ }
+
public void changeWsTheme(final User user, final Group group, final String theme) throws AccessViolationException {
// TODO: check theme
group.setWorkspaceTheme(theme);
@@ -117,8 +129,7 @@
public Group createUserGroup(User user, boolean wantPersonalHomepage) throws GroupNameInUseException,
EmailAddressInUseException {
final String defaultSiteWorkspaceTheme = kuneProperties.get(KuneProperties.WS_THEMES_DEF);
- final String licenseDefId = properties.getDefaultLicense();
- final License licenseDef = licenseFinder.findByShortName(licenseDefId);
+ final License licenseDef = licenseManager.getDefLicense();
final Group userGroup = new Group(user.getShortName(), user.getName(), licenseDef, GroupType.PERSONAL);
User userSameEmail = null;
try {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/LicenseManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/LicenseManagerDefault.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/LicenseManagerDefault.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -25,6 +25,7 @@
import org.ourproject.kune.platf.server.domain.License;
import org.ourproject.kune.platf.server.manager.LicenseManager;
+import org.ourproject.kune.platf.server.properties.DatabaseProperties;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -33,24 +34,36 @@
@Singleton
public class LicenseManagerDefault extends DefaultManager<License, Long> implements LicenseManager {
private License licenseFinder;
+ private final DatabaseProperties properties;
@Inject
- public LicenseManagerDefault(final Provider<EntityManager> provider) {
+ public LicenseManagerDefault(final Provider<EntityManager> provider, DatabaseProperties properties) {
super(provider, License.class);
+ this.properties = properties;
}
+ public License findByShortName(String shortName) {
+ return licenseFinder.findByShortName(shortName);
+ }
+
public List<License> getAll() {
return licenseFinder.getAll();
}
+ public List<License> getCC() {
+ return licenseFinder.getCC();
+ }
+
+ public License getDefLicense() {
+ final String licenseDefId = properties.getDefaultLicense();
+ return licenseFinder.findByShortName(licenseDefId);
+ }
+
public List<License> getNotCC() {
return licenseFinder.getNotCC();
}
- public List<License> getCC() {
- return licenseFinder.getCC();
- }
-
+ @Override
public License persist(final License license) {
return super.persist(license);
}
@@ -59,8 +72,4 @@
public void setLicenseFinder(final License licenseFinder) {
this.licenseFinder = licenseFinder;
}
-
- public License findByShortName(String shortName) {
- return licenseFinder.findByShortName(shortName);
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -20,6 +20,7 @@
package org.ourproject.kune.platf.server.rpc;
import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.DefaultException;
@@ -63,6 +64,15 @@
@Authenticated
@Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
@Transactional(type = TransactionType.READ_WRITE)
+ public void changeDefLicense(final String userHash, final StateToken groupToken, final LicenseDTO license) {
+ final User user = getUserLogged();
+ final Group group = groupManager.findByShortName(groupToken.getGroup());
+ groupManager.changeDefLicense(user, group, license.getShortName());
+ }
+
+ @Authenticated
+ @Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
+ @Transactional(type = TransactionType.READ_WRITE)
public void changeGroupWsTheme(final String userHash, final StateToken groupToken, final String theme)
throws DefaultException {
final User user = getUserLogged();
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -90,6 +90,7 @@
data.setSiteDomain(kuneProperties.get(KuneProperties.SITE_DOMAIN));
data.setChatRoomHost(chatProperties.getRoomHost());
data.setWsThemes(this.kuneProperties.get(KuneProperties.WS_THEMES).split(","));
+ data.setDefaultLicense(licenseManager.getDefLicense());
data.setDefaultWsTheme(this.kuneProperties.get(KuneProperties.WS_THEMES_DEF));
data.setSiteLogoUrl(kuneProperties.get(KuneProperties.SITE_LOGO_URL));
data.setGalleryPermittedExtensions(kuneProperties.get(KuneProperties.UPLOAD_GALLERY_PERMITTED_EXTS));
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoose.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoose.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoose.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.licensechoose;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.LicenseDTO;
-
-public interface LicenseChoose {
-
- View getView();
-
- LicenseDTO getLicense();
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePanel.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePanel.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -1,227 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.licensechoose;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.ui.HorizontalLine;
-import org.ourproject.kune.platf.client.ui.IconLabel;
-import org.ourproject.kune.platf.client.ui.TitledPanel;
-
-import com.google.gwt.user.client.ui.ChangeListener;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DeckPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.ListBox;
-import com.google.gwt.user.client.ui.RadioButton;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class LicenseChoosePanel extends Composite implements LicenseChooseView {
-
- protected static final String CC_LIC_FIELD = "cc-lic";
- protected static final String OTHER_LIC_FIELD = "other-lic";
- private static final String BIG_FIELD_WIDTH = "280";
-
- private final RadioButton ccRB;
- private final RadioButton allowModifRB;
- private final RadioButton commercialRB;
- private final RadioButton allowModifShareAlikeRB;
- private final DeckPanel options;
- private final Label ccIntro;
- private final ListBox otherLicenses;
- private final TitledPanel optionsBox;
- private final IconLabel copyleft;
- private final IconLabel nonCopyleft;
- private final RadioButton noModifRB;
- private final RadioButton nonCommercialRB;
- private final I18nTranslationService i18n;
-
- public LicenseChoosePanel(final LicenseChoosePresenter presenter, final I18nTranslationService i18n, Images img) {
- this.i18n = i18n;
-
- final VerticalPanel generalVP = new VerticalPanel();
- initWidget(generalVP);
-
- final VerticalPanel licenseTypesVP = new VerticalPanel();
- ccRB = new RadioButton("ccOrNot", i18n.t("Creative Commons"));
- final RadioButton notCcRB = new RadioButton("ccOrNot", i18n.t("Other licenses"));
- options = new DeckPanel();
- ccIntro = new Label(
- i18n.t("With a Creative Commons license, you keep your copyright but allow people to copy and distribute your work provided they give you credit — and only on the conditions you specify here. What do you want to do?"));
-
- otherLicenses = new ListBox();
- final VerticalPanel ccOptionsVP = new VerticalPanel();
- final VerticalPanel nonCcOptionsVP = new VerticalPanel();
-
- final Label comercialLabel = new Label(i18n.t("Do you want to allow commercial uses of your work?"));
- commercialRB = new RadioButton("commercial", i18n.t("Yes"));
- nonCommercialRB = new RadioButton("commercial", i18n.t("No"));
- final Label allowModifLabel = new Label(i18n.t("Do you want to allow modifications of your work?"));
- allowModifRB = new RadioButton("allowModif", i18n.t("Yes"));
- allowModifShareAlikeRB = new RadioButton("allowModif", i18n.t("Yes, as long as others share alike"));
- noModifRB = new RadioButton("allowModif", i18n.t("No"));
- generalVP.add(licenseTypesVP);
- licenseTypesVP.add(ccRB);
- licenseTypesVP.add(notCcRB);
-
- copyleft = new IconLabel(img.copyleft(), i18n.t("This is a copyleft license"), false);
- nonCopyleft = new IconLabel(img.noCopyleft(), i18n.t("This is not a copyleft license"), false);
- nonCopyleft.setVisible(false);
-
- generalVP.add(options);
-
- // Options
-
- optionsBox = new TitledPanel(i18n.t("Options"), options);
- optionsBox.setWidth(BIG_FIELD_WIDTH);
- generalVP.add(optionsBox);
- generalVP.add(nonCopyleft);
- generalVP.add(copyleft);
-
- ccOptionsVP.add(ccIntro);
- ccOptionsVP.add(comercialLabel);
- ccOptionsVP.add(commercialRB);
- ccOptionsVP.add(nonCommercialRB);
- ccOptionsVP.add(new HorizontalLine());
- ccOptionsVP.add(allowModifLabel);
- ccOptionsVP.add(allowModifRB);
- ccOptionsVP.add(allowModifShareAlikeRB);
- ccOptionsVP.add(noModifRB);
-
- nonCcOptionsVP.add(otherLicenses);
-
- options.add(ccOptionsVP);
- options.add(nonCcOptionsVP);
- options.showWidget(0);
-
- comercialLabel.addStyleName("kune-License-CC-Header");
- allowModifLabel.addStyleName("kune-License-CC-Header");
- nonCommercialRB.addStyleName("kune-Margin-Large-lr");
- commercialRB.addStyleName("kune-Margin-Large-lr");
- allowModifRB.addStyleName("kune-Margin-Large-lr");
- allowModifShareAlikeRB.addStyleName("kune-Margin-Large-lr");
- noModifRB.addStyleName("kune-Margin-Large-lr");
- optionsBox.addStyleName("kune-Margin-Medium-t");
- otherLicenses.addStyleName("kune-Margin-Large-trbl");
- generalVP.addStyleName("kune-Default-Form");
- copyleft.addStyleName("kune-Margin-Medium-t");
- nonCopyleft.addStyleName("kune-Margin-Medium-t");
-
- ccRB.addClickListener(new ClickListener() {
- public void onClick(final Widget arg0) {
- showCCoptions();
- presenter.onChange();
- }
- });
-
- notCcRB.addClickListener(new ClickListener() {
- public void onClick(final Widget arg0) {
- showNotCCoptions();
- presenter.onChange();
- }
- });
-
- final List<LicenseDTO> nonCCLicenses = presenter.getNonCCLicenses();
- for (int i = 0; i < nonCCLicenses.size(); i++) {
- final String licenseDescrip = nonCCLicenses.get(i).getLongName();
- otherLicenses.addItem(licenseDescrip);
- }
- if (nonCCLicenses.size() > 0) {
- otherLicenses.setItemSelected(0, true);
- otherLicenses.setVisibleItemCount(1);
- }
-
- configureListeners(presenter);
- }
-
- public int getSelectedNonCCLicenseIndex() {
- return otherLicenses.getSelectedIndex();
- }
-
- public boolean isAllowModif() {
- return allowModifRB.isChecked();
- }
-
- public boolean isAllowModifShareAlike() {
- return allowModifShareAlikeRB.isChecked();
- }
-
- public boolean isCCselected() {
- return ccRB.isChecked();
- }
-
- public boolean permitComercial() {
- return commercialRB.isChecked();
- }
-
- public void reset() {
- options.showWidget(0);
- ccRB.setChecked(true);
- commercialRB.setChecked(true);
- allowModifShareAlikeRB.setChecked(true);
- }
-
- public void showCCoptions() {
- options.showWidget(0);
- optionsBox.setTitle(i18n.t("Options"));
-
- }
-
- public void showIsCopyleft() {
- nonCopyleft.setVisible(false);
- copyleft.setVisible(true);
- }
-
- public void showIsNotCopyleft() {
- nonCopyleft.setVisible(true);
- copyleft.setVisible(false);
- }
-
- public void showNotCCoptions() {
- options.showWidget(1);
- optionsBox.setTitle(i18n.t("Please, select one of these licenses:"));
- }
-
- private void configureListeners(final LicenseChoosePresenter presenter) {
- final ChangeListener changeListener = new ChangeListener() {
- public void onChange(final Widget arg0) {
- presenter.onChange();
- }
- };
-
- final ClickListener clickListener = new ClickListener() {
- public void onClick(final Widget arg0) {
- presenter.onChange();
- }
- };
- otherLicenses.addChangeListener(changeListener);
- ccRB.addClickListener(clickListener);
- allowModifRB.addClickListener(clickListener);
- commercialRB.addClickListener(clickListener);
- nonCommercialRB.addClickListener(clickListener);
- allowModifShareAlikeRB.addClickListener(clickListener);
- noModifRB.addClickListener(clickListener);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePresenter.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePresenter.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -1,100 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.licensechoose;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.platf.client.state.Session;
-
-import com.allen_sauer.gwt.log.client.Log;
-
-public class LicenseChoosePresenter implements LicenseChoose, View {
-
- private LicenseChooseView view;
-
- private final List<LicenseDTO> licenses;
-
- private final List<LicenseDTO> licensesNonCCList;
-
- public LicenseChoosePresenter(final Session session) {
- licensesNonCCList = new ArrayList<LicenseDTO>();
- licenses = session.getLicenses();
- for (final Iterator<LicenseDTO> iterator = licenses.iterator(); iterator.hasNext();) {
- final LicenseDTO license = iterator.next();
- if (!license.isCC()) {
- licensesNonCCList.add(license);
- }
- }
- }
-
- public LicenseDTO getLicense() {
- String licenseShortName;
-
- if (view.isCCselected()) {
- if (view.permitComercial()) {
- licenseShortName = view.isAllowModif() ? "by" : view.isAllowModifShareAlike() ? "by-sa" : "by-nd";
- } else {
- licenseShortName = view.isAllowModif() ? "by-nc" : view.isAllowModifShareAlike() ? "by-nc-sa"
- : "by-nc-nd";
- }
- } else {
- licenseShortName = licensesNonCCList.get(view.getSelectedNonCCLicenseIndex()).getShortName();
- }
- return getLicenseFromShortName(licenseShortName);
- }
-
- public List<LicenseDTO> getNonCCLicenses() {
- return licensesNonCCList;
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final LicenseChooseView view) {
- this.view = view;
- this.view.reset();
- }
-
- public void onChange() {
- final LicenseDTO licenseDTO = getLicense();
- if (licenseDTO.isCopyleft()) {
- view.showIsCopyleft();
- } else {
- view.showIsNotCopyleft();
- }
- }
-
- private LicenseDTO getLicenseFromShortName(final String shortName) {
- for (int i = 0; i < licenses.size(); i++) {
- final LicenseDTO licenseDTO = licenses.get(i);
- if (licenseDTO.getShortName().equals(shortName)) {
- return licenseDTO;
- }
- }
- Log.error("Internal error: License not found");
- throw new IndexOutOfBoundsException("License not found");
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChooseView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChooseView.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChooseView.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.licensechoose;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface LicenseChooseView extends View {
-
- boolean isCCselected();
-
- boolean isAllowModif();
-
- boolean isAllowModifShareAlike();
-
- int getSelectedNonCCLicenseIndex();
-
- boolean permitComercial();
-
- void reset();
-
- void showNotCCoptions();
-
- void showCCoptions();
-
- void showIsCopyleft();
-
- void showIsNotCopyleft();
-}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -0,0 +1,43 @@
+package org.ourproject.kune.workspace.client.licensewizard;
+
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.site.Site;
+
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.listener.Listener0;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class LicenseChangeAction {
+ private final StateManager stateManager;
+ private final Provider<GroupServiceAsync> groupService;
+ private final Session session;
+ private final I18nTranslationService i18n;
+
+ public LicenseChangeAction(Provider<GroupServiceAsync> groupService, Session session, I18nTranslationService i18n,
+ StateManager stateManager) {
+ this.groupService = groupService;
+ this.session = session;
+ this.i18n = i18n;
+ this.stateManager = stateManager;
+ }
+
+ public void changeLicense(final LicenseDTO license, final Listener0 onSuccess) {
+ Site.showProgressProcessing();
+ groupService.get().changeDefLicense(session.getUserHash(), session.getCurrentStateToken(), license,
+ new AsyncCallback<Object>() {
+ public void onFailure(Throwable caught) {
+ Site.hideProgress();
+ Site.error(i18n.t("Error changing default group license"));
+ }
+
+ public void onSuccess(Object result) {
+ stateManager.reload();
+ onSuccess.onEvent();
+ }
+ });
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizard.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizard.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizard.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -1,7 +1,11 @@
package org.ourproject.kune.workspace.client.licensewizard;
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+
+import com.calclab.suco.client.listener.Listener;
+
public interface LicenseWizard {
- void show();
+ void start(Listener<LicenseDTO> listener);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -1,43 +1,51 @@
package org.ourproject.kune.workspace.client.licensewizard;
+import java.util.List;
+
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstFormView;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdFormView;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndFormView;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardTrdFormView;
+import org.ourproject.kune.workspace.client.site.Site;
import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.listener.Listener;
import com.calclab.suco.client.listener.Listener0;
public class LicenseWizardPresenter implements LicenseWizard {
private LicenseWizardView view;
- private final LicenseWizardFirstFormView firstForm;
+ private final LicenseWizardFirstFormView fstForm;
private final LicenseWizardSndFormView sndForm;
- private final Provider<GroupServiceAsync> groupService;
private final LicenseWizardTrdFormView trdForm;
+ private final LicenseWizardFrdFormView frdForm;
+ private final Session session;
+ private Listener<LicenseDTO> selectLicenseListener;
public LicenseWizardPresenter(LicenseWizardFirstFormView firstForm, LicenseWizardSndFormView sndForm,
- LicenseWizardTrdFormView trdForm, Provider<GroupServiceAsync> groupService) {
- this.firstForm = firstForm;
+ LicenseWizardTrdFormView trdForm, LicenseWizardFrdFormView frdForm, Session session) {
+ this.fstForm = firstForm;
this.sndForm = sndForm;
this.trdForm = trdForm;
- this.groupService = groupService;
+ this.frdForm = frdForm;
+ this.session = session;
}
public View getView() {
return view;
}
- public void init(LicenseWizardView view) {
+ public void init(final LicenseWizardView view) {
this.view = view;
- firstForm.onCopyLeftLicenseSelected(new Listener0() {
+ fstForm.onCopyLeftLicenseSelected(new Listener0() {
public void onEvent() {
onCopyLeftLicenseSelected();
}
});
- firstForm.onAnotherLicenseSelected(new Listener0() {
+ fstForm.onAnotherLicenseSelected(new Listener0() {
public void onEvent() {
onAnotherLicenseSelecterd();
}
@@ -47,16 +55,26 @@
onCreativeCommonsChanged();
}
});
- view.add(firstForm);
+ frdForm.onChange(new Listener0() {
+ public void onEvent() {
+ if (frdForm.getSelectedLicense().length() > 0) {
+ view.setEnabled(true, false, true, true);
+ }
+ }
+ });
+ view.add(fstForm);
view.add(sndForm);
view.add(trdForm);
+ view.add(frdForm);
}
public void onBack() {
if (view.isCurrentPage(sndForm)) {
showFst();
- } else if (view.isCurrentPage(trdForm)) {
+ } else if (in(trdForm)) {
showSnd();
+ } else if (in(frdForm)) {
+ showSnd();
} else {
Log.error("Programatic error in LicenseWizardPresenter");
}
@@ -67,8 +85,24 @@
}
public void onChange() {
- // What license?
- // FIXME RPC call()
+ String licenseShortName;
+ if (in(fstForm)) {
+ licenseShortName = "by-sa";
+ } else if (in(trdForm)) {
+ if (trdForm.isAllowComercial()) {
+ licenseShortName = trdForm.isAllowModif() ? "by" : trdForm.isAllowModifShareAlike() ? "by-sa" : "by-nd";
+ } else {
+ licenseShortName = trdForm.isAllowModif() ? "by-nc" : trdForm.isAllowModifShareAlike() ? "by-nc-sa"
+ : "by-nc-nd";
+ }
+ } else if (in(sndForm)) {
+ licenseShortName = "by-sa";
+ Site.error("Programatic error in LicenseWizardPresenter");
+ } else {
+ licenseShortName = frdForm.getSelectedLicense();
+ }
+ view.hide();
+ selectLicenseListener.onEvent(getLicenseFromShortName(licenseShortName));
}
public void onClose() {
@@ -76,17 +110,22 @@
}
public void onNext() {
- if (view.isCurrentPage(firstForm)) {
+ if (in(fstForm)) {
view.clear();
showSnd();
- } else if (view.isCurrentPage(sndForm)) {
- showTrd();
+ } else if (in(sndForm)) {
+ if (sndForm.isCommonLicensesSelected()) {
+ showTrd();
+ } else {
+ showFrd();
+ }
} else {
Log.error("Programatic error in LicenseWizardPresenter");
}
}
- public void show() {
+ public void start(Listener<LicenseDTO> selectLicenseListener) {
+ this.selectLicenseListener = selectLicenseListener;
reset();
view.show();
view.center();
@@ -100,6 +139,22 @@
view.setEnabled(false, false, true, true);
}
+ private LicenseDTO getLicenseFromShortName(final String shortName) {
+ List<LicenseDTO> licenses = session.getLicenses();
+ for (int i = 0; i < licenses.size(); i++) {
+ final LicenseDTO licenseDTO = licenses.get(i);
+ if (licenseDTO.getShortName().equals(shortName)) {
+ return licenseDTO;
+ }
+ }
+ Log.error("Internal error: License not found");
+ throw new IndexOutOfBoundsException("License not found");
+ }
+
+ private boolean in(View page) {
+ return view.isCurrentPage(page);
+ }
+
private void onCreativeCommonsChanged() {
boolean isCopyleft = trdForm.isAllowComercial() && trdForm.isAllowModifShareAlike();
boolean isAppropiateForCulturalWorks = trdForm.isAllowComercial()
@@ -110,15 +165,21 @@
private void reset() {
view.clear();
view.setEnabled(false, false, true, true);
- view.show(firstForm);
- firstForm.reset();
+ view.show(fstForm);
+ fstForm.reset();
sndForm.reset();
trdForm.reset();
+ frdForm.reset();
}
+ private void showFrd() {
+ view.show(frdForm);
+ view.setEnabled(true, false, true, false);
+ }
+
private void showFst() {
view.clear();
- view.show(firstForm);
+ view.show(fstForm);
view.setEnabled(false, true, true, true);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFirstForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFirstForm.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFirstForm.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -40,8 +40,8 @@
fieldSet.setWidth(250);
copyleftRadio = DefaultFormUtils.createRadio(fieldSet, i18n.t("Use a copyleft license (recommended)"),
RADIO_FIELD_NAME, null, RADIO_COPYLEFT_ID);
- anotherLicenseRadio = DefaultFormUtils.createRadio(fieldSet,
- i18n.t("Use another kind of license (advanced)"), RADIO_FIELD_NAME, null, RADIO_ANOTHER_ID);
+ anotherLicenseRadio = DefaultFormUtils.createRadio(fieldSet, i18n.t("Use another kind of license (advanced)"),
+ RADIO_FIELD_NAME, null, RADIO_ANOTHER_ID);
copyleftRadio.addListener(new CheckboxListenerAdapter() {
@Override
public void onCheck(Checkbox field, boolean checked) {
@@ -71,13 +71,12 @@
recommendCopyleft.setHtml(POINT
+ i18n.t("We recommend [%s] licenses, specially for practical works", TextUtils.generateHtmlLink(
"http://en.wikipedia.org/wiki/Copyleft", i18n.t("copyleft"))) + DefaultFormUtils.br());
- // FIXME
whyALicense.setHtml(POINT
+ TextUtils.generateHtmlLink("http://mirrors.creativecommons.org/getcreative/",
i18n.t("Why do we need a license?")) + DefaultFormUtils.br());
- youCanChangeTheLicenseLater.setHtml(POINT
- + i18n.t("You can change this license later") + DefaultFormUtils.br());
+ youCanChangeTheLicenseLater.setHtml(POINT + i18n.t("You can change this license later") + DefaultFormUtils.br());
+ infoFS.addStyleName("kune-Margin-20-t");
add(intro);
add(copyleftRadio);
add(anotherLicenseRadio);
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdForm.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdForm.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -0,0 +1,110 @@
+package org.ourproject.kune.workspace.client.licensewizard.pages;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardView;
+
+import com.calclab.suco.client.listener.Event0;
+import com.calclab.suco.client.listener.Listener0;
+import com.gwtext.client.core.Template;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.data.SimpleStore;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.Label;
+import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
+
+public class LicenseWizardFrdForm extends DefaultForm implements LicenseWizardFrdFormView {
+ public static final String COMMON_LICENSES_ID = "k-lwsf-common";
+ public static final String OTHER_LICENSES_ID = "k-lwsf-other";
+ public static final String RADIO_FIELD_NAME = "k-lwsf-radio";
+ private final ComboBox cb;
+ private final Event0 onChange;
+ private final Session session;
+
+ public LicenseWizardFrdForm(I18nTranslationService i18n, Session session) {
+ this.session = session;
+ this.onChange = new Event0("onChange");
+ setFrame(true);
+ super.setPaddings(10);
+ super.setHeight(LicenseWizardView.HEIGHT);
+
+ Label intro = new Label();
+ intro.setHtml(i18n.t("Select other kind of licenses:") + DefaultFormUtils.brbr());
+
+ final Store store = new SimpleStore(new String[] { "shortname", "longname", "url" }, getNonCCLicenses());
+ store.load();
+
+ final Template template = new Template("<div class=\"x-combo-list-item\">" + "<img src=\"{url}\"> "
+ + "{longname}<div class=\"x-clear\"></div></div>");
+
+ super.setHideLabels(true);
+
+ cb = new ComboBox();
+ cb.setMinChars(1);
+ // cb.setFieldLabel("Other licenses");
+ cb.setLabelSeparator("");
+ cb.setStore(store);
+ cb.setDisplayField("longname");
+ cb.setValueField("shortname");
+ cb.setMode(ComboBox.LOCAL);
+ cb.setTriggerAction(ComboBox.ALL);
+ cb.setEmptyText(i18n.t("Select license"));
+ cb.setTypeAhead(true);
+ cb.setSelectOnFocus(true);
+ cb.setEditable(false);
+ cb.setWidth(300);
+ cb.setResizable(true);
+ cb.setTpl(template);
+ cb.setTitle("Licenses");
+ cb.addListener(new ComboBoxListenerAdapter() {
+ @Override
+ public void onSelect(ComboBox comboBox, Record record, int index) {
+ onChange.fire();
+ }
+ });
+ add(intro);
+ add(cb);
+ }
+
+ public String getSelectedLicense() {
+ return cb.getValueAsString();
+ }
+
+ public void onChange(final Listener0 slot) {
+ onChange.add(slot);
+ }
+
+ @Override
+ public void reset() {
+ super.reset();
+ }
+
+ public void setFlags(boolean isCopyleft, boolean isAppropiateForCulturalWorks, boolean isNonComercial) {
+ // TODO Auto-generated method stub
+ }
+
+ private String[][] getNonCCLicenses() {
+ ArrayList<LicenseDTO> licensesNonCCList = new ArrayList<LicenseDTO>();
+ List<LicenseDTO> licenses = session.getLicenses();
+ for (LicenseDTO license : licenses) {
+ if (!license.isCC()) {
+ licensesNonCCList.add(license);
+ }
+ }
+ String[][] licensesArray = new String[licensesNonCCList.size()][3];
+ for (int i = 0; i < licensesNonCCList.size(); i++) {
+ LicenseDTO license = licensesNonCCList.get(i);
+ licensesArray[i][0] = license.getShortName();
+ licensesArray[i][1] = license.getLongName();
+ licensesArray[i][2] = license.getImageUrl();
+ }
+ return licensesArray;
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdFormView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdFormView.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdFormView.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.workspace.client.licensewizard.pages;
+
+import org.ourproject.kune.platf.client.View;
+
+import com.calclab.suco.client.listener.Listener0;
+
+public interface LicenseWizardFrdFormView extends View {
+
+ String getSelectedLicense();
+
+ void onChange(Listener0 slot);
+
+ void reset();
+
+ void setFlags(boolean isCopyleft, boolean isAppropiateForCulturalWorks, boolean isNonComercial);
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndForm.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndForm.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -5,26 +5,18 @@
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardView;
-import com.calclab.suco.client.listener.Event0;
-import com.calclab.suco.client.listener.Listener0;
-import com.gwtext.client.widgets.form.Checkbox;
import com.gwtext.client.widgets.form.FieldSet;
import com.gwtext.client.widgets.form.Label;
import com.gwtext.client.widgets.form.Radio;
-import com.gwtext.client.widgets.form.event.CheckboxListenerAdapter;
public class LicenseWizardSndForm extends DefaultForm implements LicenseWizardSndFormView {
public static final String COMMON_LICENSES_ID = "k-lwsf-common";
public static final String OTHER_LICENSES_ID = "k-lwsf-other";
public static final String RADIO_FIELD_NAME = "k-lwsf-radio";
- private final Event0 onCommonLicensesSelected;
- private final Event0 onOtherLicensesSelected;
private final Radio commonLicensesRadio;
private final Radio otherLicensesRadio;
public LicenseWizardSndForm(I18nTranslationService i18n) {
- this.onCommonLicensesSelected = new Event0("onCommonLicensesSelected");
- this.onOtherLicensesSelected = new Event0("onOtherLicensesSelected");
setFrame(true);
super.setPaddings(10);
super.setHeight(LicenseWizardView.HEIGHT);
@@ -35,39 +27,21 @@
final FieldSet fieldSet = new FieldSet("license type");
fieldSet.setStyle("margin-left: 105px");
fieldSet.setWidth(250);
- commonLicensesRadio = DefaultFormUtils.createRadio(fieldSet, i18n.t("Common licenses for cultural works"), RADIO_FIELD_NAME,
- i18n.t("Select a Creative Commons license (recommended for cultural works)"), COMMON_LICENSES_ID);
- otherLicensesRadio = DefaultFormUtils.createRadio(
- fieldSet,
- i18n.t("Other kind of licenses"),
- RADIO_FIELD_NAME,
+ commonLicensesRadio = DefaultFormUtils.createRadio(fieldSet, i18n.t("Common licenses for cultural works"),
+ RADIO_FIELD_NAME, i18n.t("Select a Creative Commons license (recommended for cultural works)"),
+ COMMON_LICENSES_ID);
+ otherLicensesRadio = DefaultFormUtils.createRadio(fieldSet, i18n.t("Other kind of licenses"), RADIO_FIELD_NAME,
i18n.t("Use the GNU licenses (recommended for free software works) and other kind of licenses"),
OTHER_LICENSES_ID);
- commonLicensesRadio.addListener(new CheckboxListenerAdapter() {
- @Override
- public void onCheck(Checkbox field, boolean checked) {
- onCommonLicensesSelected.fire();
- }
- });
- otherLicensesRadio.addListener(new CheckboxListenerAdapter() {
- @Override
- public void onCheck(Checkbox field, boolean checked) {
- onOtherLicensesSelected.fire();
- }
- });
add(intro);
add(commonLicensesRadio);
add(otherLicensesRadio);
}
- public void onCommonLicensesSelected(final Listener0 slot) {
- onCommonLicensesSelected.add(slot);
+ public boolean isCommonLicensesSelected() {
+ return commonLicensesRadio.getValue();
}
- public void onOtherLicensesSelected(final Listener0 slot) {
- onOtherLicensesSelected.add(slot);
- }
-
@Override
public void reset() {
super.reset();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndFormView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndFormView.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndFormView.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -2,12 +2,9 @@
import org.ourproject.kune.platf.client.View;
-import com.calclab.suco.client.listener.Listener0;
-
public interface LicenseWizardSndFormView extends View {
- void onCommonLicensesSelected(Listener0 slot);
- void onOtherLicensesSelected(Listener0 slot);
+ boolean isCommonLicensesSelected();
void reset();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -21,36 +21,40 @@
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.platf.client.ui.WindowUtils;
+import org.ourproject.kune.platf.client.ui.dialogs.BasicDialogExtended;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
import org.ourproject.kune.platf.client.ui.dialogs.MessageToolbar;
-import org.ourproject.kune.platf.client.ui.dialogs.WizardDialog;
-import org.ourproject.kune.platf.client.ui.dialogs.WizardListener;
import org.ourproject.kune.workspace.client.WorkspaceMessages;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
-import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
-import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.ioc.Provider;
-import com.google.gwt.user.client.ui.DeckPanel;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
+import com.calclab.suco.client.listener.Listener;
+import com.calclab.suco.client.listener.Listener0;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.EventObject;
import com.gwtext.client.core.Position;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.PaddedPanel;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.ToolTip;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.form.Field;
import com.gwtext.client.widgets.form.FieldSet;
import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.Label;
import com.gwtext.client.widgets.form.Radio;
import com.gwtext.client.widgets.form.TextArea;
import com.gwtext.client.widgets.form.TextField;
-import com.gwtext.client.widgets.layout.FitLayout;
+import com.gwtext.client.widgets.layout.HorizontalLayout;
-public class NewGroupPanel extends WizardDialog implements NewGroupView {
+public class NewGroupPanel extends BasicDialogExtended implements NewGroupView {
+ private static final String MARGIN_LEFT_105PX = "margin-left: 105px";
+ private static final int LABEL_WIDTH = 100;
public static final String SHORTNAME_FIELD = "k-ngp-short_name";
public static final String LONGNAME_FIELD = "k-ngp-long_name";
public static final String PUBLICDESC_FIELD = "k-ngp-public_desc";
@@ -60,15 +64,12 @@
public static final String COMM_GROUP_TYPE_ID = "k-ngp-type_of_group_comm";
public static final String TAGS_FIELD = "k-ngp-tags";
public static final String NEWGROUP_WIZARD = "k-ngp-wiz";
+ public static final String REGISTER_BUTTON = "k-ngp-finish-bt";
public static final String CANCEL_BUTTON = "k-ngp-cancel-bt";
- public static final String CLOSE_BUTTON = "k-ngp-close-bt";
- public static final String FINISH_BUTTON = "k-ngp-finish-bt";
- public static final String NEXT_BUTTON = "k-ngp-next-bt";
- public static final String BACK_BUTTON = "k-ngp-back-bt";
public static final String ERROR_MSG_BAR = "k-ngp-error-mb";
private static final int BIG_FIELD_WIDTH = 280;
- private final FormPanel newGroupInitialDataForm;
+ private final FormPanel form;
private Radio projectRadio;
private Radio orgRadio;
private Radio communityRadio;
@@ -76,99 +77,43 @@
private TextField shortNameField;
private TextField longNameField;
private TextArea publicDescField;
- private final DeckPanel deck;
- private final LicenseChoose licenseChoosePanel;
- private final I18nUITranslationService i18n;
private TextField tags;
private final MessageToolbar messageErrorBar;
+ private final Provider<LicenseWizard> licenseWizard;
+ private final I18nUITranslationService i18n;
+ private Image licenseImage;
+ private LicenseDTO license;
public NewGroupPanel(final NewGroupPresenter presenter, final I18nUITranslationService i18n,
- final Provider<LicenseChoose> licenseChooseProvider, Images img) {
- super(NEWGROUP_WIZARD, i18n.t(WorkspaceMessages.REGISTER_A_NEW_GROUP_TITLE), true, false, 460, 430,
- new WizardListener() {
- public void onBack() {
- presenter.onBack();
- }
-
- public void onCancel() {
+ final Provider<LicenseWizard> licenseWizard, Images img) {
+ super(NEWGROUP_WIZARD, WorkspaceMessages.REGISTER_A_NEW_GROUP_TITLE, true, true, 450, 430, "k-newgroup-icon",
+ i18n.t("Cancel"), CANCEL_BUTTON, i18n.t("Register"), REGISTER_BUTTON, new Listener0() {
+ public void onEvent() {
presenter.onCancel();
}
-
- public void onClose() {
- Log.info("close pressed");
- presenter.onClose();
+ }, new Listener0() {
+ public void onEvent() {
+ presenter.onRegister();
}
-
- public void onFinish() {
- presenter.onFinish();
- }
-
- public void onNext() {
- presenter.onNext();
- }
- }, i18n, BACK_BUTTON, NEXT_BUTTON, FINISH_BUTTON, CANCEL_BUTTON, CLOSE_BUTTON);
+ }, 0);
this.i18n = i18n;
+ this.licenseWizard = licenseWizard;
Field.setMsgTarget("side");
- final Panel centerPanel = new Panel();
- centerPanel.setPaddings(10);
- centerPanel.setLayout(new FitLayout());
- deck = new DeckPanel();
- newGroupInitialDataForm = createNewGroupInitialDataForm(presenter);
- licenseChoosePanel = licenseChooseProvider.get();
- final VerticalPanel newGroupInitialDataVP = new VerticalPanel();
- final HorizontalPanel newGroupInitialDataHP = new HorizontalPanel();
- final VerticalPanel chooseLicenseVP = new VerticalPanel();
- final HorizontalPanel chooseLicenseHP = new HorizontalPanel();
- newGroupInitialDataHP.add(img.step1().createImage());
- final Label step1Label = new Label(
- i18n.t("Please fill this form and follow the next steps to register a new group:"));
- newGroupInitialDataHP.add(step1Label);
- newGroupInitialDataVP.add(newGroupInitialDataHP);
- newGroupInitialDataVP.add(newGroupInitialDataForm);
- chooseLicenseHP.add(img.step2().createImage());
- final HTML step2Label = new HTML(i18n.t("Select a license to share your group contents with other people. "
- + "We recomend [%s] licenses for practical works.", TextUtils.generateHtmlLink(
- "http://en.wikipedia.org/wiki/Copyleft", "copyleft")));
- chooseLicenseHP.add(step2Label);
- final Label licenseTypeLabel = new Label(i18n.t("Choose a license type:"));
- chooseLicenseVP.add(chooseLicenseHP);
- chooseLicenseVP.add(licenseTypeLabel);
+ form = createNewGroupInitialDataForm(presenter);
- newGroupInitialDataHP.addStyleName("kune-Margin-Medium-b");
- step1Label.addStyleName("kune-Margin-Large-l");
- step2Label.addStyleName("kune-Margin-Large-l");
- step1Label.addStyleName("kune-Margin-Medium-b");
- step2Label.addStyleName("kune-Margin-Medium-b");
-
messageErrorBar = new MessageToolbar(img, ERROR_MSG_BAR);
super.setBottomToolbar(messageErrorBar.getToolbar());
- chooseLicenseVP.add((Widget) licenseChoosePanel.getView());
- deck.add(newGroupInitialDataVP);
- deck.add(chooseLicenseVP);
- centerPanel.add(deck);
- super.add(centerPanel);
- deck.showWidget(0);
- initBottomButtons();
- // newGroupInitialDataVP.addStyleName("kune-Default-Form");
- deck.addStyleName("kune-Default-Form");
- licenseTypeLabel.addStyleName("kune-License-CC-Header");
- newGroupInitialDataVP.setHeight("10"); // Ext set this to 100% ...
- chooseLicenseVP.setHeight("10"); // (same here)
- super.setFinishText(i18n.t("Register"));
+ super.add(form);
}
public void clearData() {
- deck.showWidget(0);
- newGroupInitialDataForm.getForm().reset();
- ((LicenseChoosePanel) licenseChoosePanel.getView()).reset();
- showNewGroupInitialDataForm();
- initBottomButtons();
+ form.getForm().reset();
shortNameField.focus(false);
}
public LicenseDTO getLicense() {
- return licenseChoosePanel.getLicense();
+ return license;
}
public String getLongName() {
@@ -196,7 +141,7 @@
}
public boolean isFormValid() {
- return newGroupInitialDataForm.getForm().isValid();
+ return form.getForm().isValid();
}
public boolean isOrganization() {
@@ -207,26 +152,34 @@
return projectRadio.getValue();
}
- public void setMessage(final String message, final SiteErrorType type) {
- messageErrorBar.setErrorMessage(message, type);
+ public void maskProcessing() {
+ mask(i18n.t("Processing"));
}
- public void showLicenseForm() {
- deck.showWidget(1);
+ public void setLicense(LicenseDTO license) {
+ this.license = license;
+ licenseImage.setUrl(license.getImageUrl());
+ KuneUiUtils.setQuickTip(licenseImage, license.getLongName());
}
- public void showNewGroupInitialDataForm() {
- deck.showWidget(0);
+ public void setMessage(final String message, final SiteErrorType type) {
+ messageErrorBar.setErrorMessage(message, type);
}
private FormPanel createNewGroupInitialDataForm(final NewGroupPresenter presenter) {
final FormPanel form = new FormPanel();
+ form.setFrame(true);
+ form.setPaddings(10);
form.setBorder(false);
form.setWidth(420);
- form.setLabelWidth(100);
+ form.setLabelWidth(LABEL_WIDTH);
form.setLabelAlign(Position.RIGHT);
form.setButtonAlign(Position.RIGHT);
+ final Label intro = new Label();
+ intro.setHtml(i18n.t("Please fill this form to register a new group:") + DefaultFormUtils.brbr());
+ form.add(intro);
+
shortNameField = new TextField();
shortNameField.setTabIndex(1);
shortNameField.setFieldLabel(i18n.t("Short name"));
@@ -277,9 +230,49 @@
tags.setValidationDelay(1000);
form.add(tags);
+ licenseImage = new Image("images/lic/bysa80x15.png");
+ licenseImage.addClickListener(new ClickListener() {
+ public void onClick(Widget arg0) {
+ WindowUtils.open(license.getUrl());
+ }
+ });
+ licenseImage.addStyleName("kune-pointer");
+ Panel licenseImagePanel = new Panel();
+ // licenseImagePanel.setLayout(new FitLayout());
+ // licenseImagePanel.setWidth(80);
+ licenseImagePanel.add(licenseImage);
+
+ Button changeLicenseButton = new Button(i18n.t("Change"));
+ changeLicenseButton.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ licenseWizard.get().start(new Listener<LicenseDTO>() {
+ public void onEvent(LicenseDTO license) {
+ setLicense(license);
+ }
+ });
+ }
+ });
+ changeLicenseButton.addClass("kune-Margin-Medium-trbl");
+
+ Label licenseLabel = new Label();
+ licenseLabel.setHtml(i18n.t("Default license for this group:") + DefaultFormUtils.br());
+ form.add(licenseLabel);
+ licenseLabel.setStyle(MARGIN_LEFT_105PX);
+
+ Panel licPanel = new Panel();
+ licPanel.setBorder(false);
+ licPanel.setLayout(new HorizontalLayout(5));
+ licPanel.add(licenseImagePanel);
+ licPanel.add(changeLicenseButton);
+ form.add(new PaddedPanel(licPanel, 0, 105, 0, 0));
+
final FieldSet groupTypeFieldSet = new FieldSet(i18n.t("Group type"));
- groupTypeFieldSet.setStyle("margin-left: 105px");
+ groupTypeFieldSet.setStyle(MARGIN_LEFT_105PX);
groupTypeFieldSet.setWidth(BIG_FIELD_WIDTH);
+ groupTypeFieldSet.setFrame(false);
+ groupTypeFieldSet.setCollapsible(false);
+ groupTypeFieldSet.setAutoHeight(true);
form.add(groupTypeFieldSet);
@@ -303,14 +296,6 @@
+ "They rarely are a legal entity."), COMM_GROUP_TYPE_ID);
communityRadio.setTabIndex(7);
- groupTypeFieldSet.setCollapsible(false);
-
return form;
}
-
- private void initBottomButtons() {
- super.setEnabledBackButton(false);
- super.setEnabledFinishButton(false);
- super.setEnabledNextButton(true);
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -69,6 +69,7 @@
Site.showProgressProcessing();
view.show();
view.center();
+ view.setLicense(session.getDefLicense());
Site.hideProgress();
} else {
stateManager.restorePreviousToken();
@@ -86,13 +87,6 @@
this.view = view;
}
- public void onBack() {
- view.setEnabledBackButton(false);
- view.setEnabledFinishButton(false);
- view.setEnabledNextButton(true);
- view.showNewGroupInitialDataForm();
- }
-
public void onCancel() {
view.hide();
reset();
@@ -106,50 +100,41 @@
reset();
}
- public void onFinish() {
- view.maskProcessing();
- final String shortName = view.getShortName();
- final String longName = view.getLongName();
- final String publicDesc = view.getPublicDesc();
- final LicenseDTO license = view.getLicense();
- final GroupDTO group = new GroupDTO(shortName, longName, getTypeOfGroup());
- group.setDefaultLicense(license);
+ public void onRegister() {
+ if (view.isFormValid()) {
+ view.maskProcessing();
+ final String shortName = view.getShortName();
+ final String longName = view.getLongName();
+ final String publicDesc = view.getPublicDesc();
+ final LicenseDTO license = view.getLicense();
+ final GroupDTO group = new GroupDTO(shortName, longName, getTypeOfGroup());
+ group.setDefaultLicense(license);
- final AsyncCallback<StateToken> callback = new AsyncCallback<StateToken>() {
- public void onFailure(final Throwable caught) {
- try {
- throw caught;
- } catch (final GroupNameInUseException e) {
- onBack();
- view.unMask();
- setMessage(i18n.t(WorkspaceMessages.NAME_IN_ALREADY_IN_USE), SiteErrorType.error);
- } catch (final Throwable e) {
- onBack(); // The messageP is in first page of wizard :-/
- view.unMask();
- setMessage(i18n.t("Error creating group"), SiteErrorType.error);
- GWT.log("Other kind of exception in group registration", null);
- throw new RuntimeException();
+ final AsyncCallback<StateToken> callback = new AsyncCallback<StateToken>() {
+ public void onFailure(final Throwable caught) {
+ try {
+ throw caught;
+ } catch (final GroupNameInUseException e) {
+ view.unMask();
+ setMessage(i18n.t(WorkspaceMessages.NAME_IN_ALREADY_IN_USE), SiteErrorType.error);
+ } catch (final Throwable e) {
+ view.unMask();
+ setMessage(i18n.t("Error creating group"), SiteErrorType.error);
+ GWT.log("Other kind of exception in group registration", null);
+ throw new RuntimeException();
+ }
}
- }
- public void onSuccess(final StateToken token) {
- mustGoToPrevious = false;
- view.hide();
- stateManager.gotoToken(token);
- reset();
- view.unMask();
- }
- };
- groupServiceProvider.get().createNewGroup(session.getUserHash(), group, publicDesc, view.getTags(), null,
- callback);
- }
-
- public void onNext() {
- if (view.isFormValid()) {
- view.setEnabledBackButton(true);
- view.setEnabledFinishButton(true);
- view.setEnabledNextButton(false);
- view.showLicenseForm();
+ public void onSuccess(final StateToken token) {
+ mustGoToPrevious = false;
+ view.hide();
+ stateManager.gotoToken(token);
+ reset();
+ view.unMask();
+ }
+ };
+ groupServiceProvider.get().createNewGroup(session.getUserHash(), group, publicDesc, view.getTags(), null,
+ callback);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -52,20 +52,12 @@
void maskProcessing();
- void setEnabledBackButton(boolean enabled);
+ void setLicense(LicenseDTO license);
- void setEnabledFinishButton(boolean enabled);
-
- void setEnabledNextButton(boolean enabled);
-
void setMessage(String message, SiteErrorType type);
void show();
- void showLicenseForm();
-
- void showNewGroupInitialDataForm();
-
void unMask();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePanel.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePanel.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -3,7 +3,6 @@
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
-import org.ourproject.kune.platf.client.ui.WindowUtils;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -58,7 +57,7 @@
}
public void openWindow(final String url) {
- WindowUtils.open(url);
+
}
public void setLicense(LicenseDTO defaultLicense) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -4,10 +4,13 @@
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseChangeAction;
import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
import org.ourproject.kune.workspace.client.options.EntityOptions;
import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.listener.Listener;
+import com.calclab.suco.client.listener.Listener0;
import com.calclab.suco.client.listener.Listener2;
public class EntityOptionsDefLicensePresenter implements EntityOptionsDefLicense {
@@ -16,12 +19,14 @@
private final EntityOptions entityOptions;
private final Session session;
private final Provider<LicenseWizard> licenseWizard;
+ private final Provider<LicenseChangeAction> licenseChangeAction;
public EntityOptionsDefLicensePresenter(EntityOptions entityOptions, StateManager stateManager, Session session,
- Provider<LicenseWizard> licenseWizard) {
+ Provider<LicenseWizard> licenseWizard, Provider<LicenseChangeAction> licenseChangeAction) {
this.entityOptions = entityOptions;
this.session = session;
this.licenseWizard = licenseWizard;
+ this.licenseChangeAction = licenseChangeAction;
stateManager.onGroupChanged(new Listener2<String, String>() {
public void onEvent(String group1, String group2) {
setState();
@@ -40,7 +45,15 @@
}
public void onChange() {
- licenseWizard.get().show();
+ licenseWizard.get().start(new Listener<LicenseDTO>() {
+ public void onEvent(final LicenseDTO license) {
+ licenseChangeAction.get().changeLicense(license, new Listener0() {
+ public void onEvent() {
+ setLicense(license);
+ }
+ });
+ }
+ });
}
public void onLicenseClick() {
@@ -51,7 +64,11 @@
return session.getCurrentState().getGroup().getDefaultLicense();
}
+ private void setLicense(LicenseDTO license) {
+ view.setLicense(license);
+ }
+
private void setState() {
- view.setLicense(getCurrentDefLicense());
+ setLicense(getCurrentDefLicense());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -53,10 +53,6 @@
messageErrorBar.hideErrorMessage();
}
- public void mask(final String message) {
- getEl().mask(message, "x-mask-loading");
- }
-
public void maskProcessing() {
mask(i18n.t("Processing"));
}
@@ -72,8 +68,4 @@
public void setErrorMessage(final String message, final SiteErrorType type) {
messageErrorBar.setErrorMessage(message, type);
}
-
- public void unMask() {
- getEl().unmask();
- }
}
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/main/resources/kune.properties 2008-12-20 22:06:41 UTC (rev 1005)
@@ -4,7 +4,6 @@
kune.default.site.shortName = site
kune.site.domain = localhost
-# Site default password
kune.default.license = by-sa
# Superuser of a kune installation (is member of site group)
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -100,8 +100,7 @@
GroupType organization = GroupType.ORGANIZATION;
signInAndNewGroup();
fillNewGroup1stPage(shortname, longName, description, tags, organization);
- click(NewGroupPanel.NEXT_BUTTON);
- click(NewGroupPanel.FINISH_BUTTON);
+ click(NewGroupPanel.REGISTER_BUTTON);
}
protected void open(SiteToken token) {
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/NewGroupSeleniumTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/NewGroupSeleniumTest.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/NewGroupSeleniumTest.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -37,8 +37,7 @@
signInAndNewGroup();
fillNewGroup1stPage("admin", "some long name" + genPrefix(), "some public description", "tag1 tag2 tag3",
GroupType.ORGANIZATION);
- click(NewGroupPanel.NEXT_BUTTON);
- click(NewGroupPanel.FINISH_BUTTON);
+ click(NewGroupPanel.REGISTER_BUTTON);
waitForTextInside(gid(NewGroupPanel.ERROR_MSG_BAR), WorkspaceMessages.NAME_IN_ALREADY_IN_USE);
}
Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenterTest.java 2008-12-20 21:22:52 UTC (rev 1004)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenterTest.java 2008-12-20 22:06:41 UTC (rev 1005)
@@ -5,6 +5,7 @@
import org.mockito.Mockito;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstFormView;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdFormView;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndFormView;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardTrdFormView;
@@ -18,6 +19,7 @@
private LicenseWizardSndFormView sndForm;
private Provider<GroupServiceAsync> groupService;
private LicenseWizardTrdFormView trdForm;
+ private LicenseWizardFrdFormView frdForm;
@Before
public void before() {
@@ -25,8 +27,9 @@
firstForm = Mockito.mock(LicenseWizardFirstFormView.class);
sndForm = Mockito.mock(LicenseWizardSndFormView.class);
trdForm = Mockito.mock(LicenseWizardTrdFormView.class);
+ frdForm = Mockito.mock(LicenseWizardFrdFormView.class);
groupService = MockProvider.mock(GroupServiceAsync.class);
- licenseWizard = new LicenseWizardPresenter(firstForm, sndForm, trdForm, groupService);
+ licenseWizard = new LicenseWizardPresenter(firstForm, sndForm, trdForm, frdForm, null);
licenseWizard.init(view);
}
@@ -50,7 +53,7 @@
@Test
public void onShowResetWidget() {
- licenseWizard.show();
+ licenseWizard.start(null);
Mockito.verify(view).clear();
Mockito.verify(view).center();
Mockito.verify(view).setEnabled(false, false, true, true);
More information about the kune-commits
mailing list