[kune-commits] r796 - in trunk/src/main:
java/org/ourproject/kune/app/public/images
java/org/ourproject/kune/platf/client/app
java/org/ourproject/kune/platf/client/dto
java/org/ourproject/kune/platf/client/services
java/org/ourproject/kune/platf/client/state
java/org/ourproject/kune/platf/server
java/org/ourproject/kune/platf/server/properties
java/org/ourproject/kune/platf/server/rpc
java/org/ourproject/kune/workspace/client
java/org/ourproject/kune/workspace/client/actions
java/org/ourproject/kune/workspace/client/ui/newtmp
java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar
java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo
java/org/ourproject/kune/workspace/client/ui/newtmp/skel
java/org/ourproject/kune/workspace/client/ui/newtmp/themes
java/org/ourproject/kune/workspace/client/workspace/ui resources
vjrj
vjrj at ourproject.org
Thu Jul 10 19:00:36 CEST 2008
Author: vjrj
Date: 2008-07-10 19:00:24 +0200 (Thu, 10 Jul 2008)
New Revision: 796
Added:
trunk/src/main/java/org/ourproject/kune/app/public/images/colors.gif
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
trunk/src/main/resources/kune.properties
Log:
Workspace refactorization
Added: trunk/src/main/java/org/ourproject/kune/app/public/images/colors.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/images/colors.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -39,8 +39,6 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.google.gwt.user.client.Window;
@@ -67,10 +65,8 @@
final I18nUITranslationService i18n = kune.getI18N();
// Temporary new ws
- final WsThemePresenter wstheme = kune.getInstance(WsThemePresenter.class);
final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
- wstheme.setTheme(WsTheme.def);
ws.show();
ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
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-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -24,107 +24,117 @@
import com.google.gwt.user.client.rpc.IsSerializable;
public class InitDataDTO implements IsSerializable {
+ private UserInfoDTO userInfo;
private ArrayList<LicenseDTO> licenses;
private ArrayList<I18nLanguageSimpleDTO> languages;
private ArrayList<I18nCountryDTO> countries;
private String[] timezones;
- UserInfoDTO userInfo;
private String chatHttpBase;
private String siteDomain;
private String chatDomain;
private String chatRoomHost;
private String defaultWsTheme;
private String[] wsThemes;
+ private String siteLogoUrl;
- public ArrayList<LicenseDTO> getLicenses() {
- return licenses;
+ public String getChatDomain() {
+ return chatDomain;
}
- public void setLicenses(final ArrayList<LicenseDTO> licenses) {
- this.licenses = licenses;
+ public String getChatHttpBase() {
+ return chatHttpBase;
}
- public UserInfoDTO getUserInfo() {
- return userInfo;
+ public String getChatRoomHost() {
+ return chatRoomHost;
}
- public void setUserInfo(final UserInfoDTO currentUser) {
- this.userInfo = currentUser;
+ public ArrayList<I18nCountryDTO> getCountries() {
+ return countries;
}
- public String getChatHttpBase() {
- return chatHttpBase;
+ public String getDefaultWsTheme() {
+ return defaultWsTheme;
}
- public void setChatHttpBase(final String chatHttpBase) {
- this.chatHttpBase = chatHttpBase;
+ public ArrayList<I18nLanguageSimpleDTO> getLanguages() {
+ return languages;
}
- public String getChatDomain() {
- return chatDomain;
+ public ArrayList<LicenseDTO> getLicenses() {
+ return licenses;
}
- public void setChatDomain(final String chatDomain) {
- this.chatDomain = chatDomain;
+ public String getSiteDomain() {
+ return siteDomain;
}
- public String getChatRoomHost() {
- return chatRoomHost;
+ public String getSiteLogoUrl() {
+ return siteLogoUrl;
}
- public void setChatRoomHost(final String chatRoomHost) {
- this.chatRoomHost = chatRoomHost;
+ public String[] getTimezones() {
+ return timezones;
}
+ public UserInfoDTO getUserInfo() {
+ return userInfo;
+ }
+
+ public String[] getWsThemes() {
+ return wsThemes;
+ }
+
public boolean hasUser() {
- return getUserInfo() != null;
+ return getUserInfo() != null;
}
- public String getDefaultWsTheme() {
- return defaultWsTheme;
+ public void setChatDomain(final String chatDomain) {
+ this.chatDomain = chatDomain;
}
- public void setDefaultWsTheme(final String defaultWsTheme) {
- this.defaultWsTheme = defaultWsTheme;
+ public void setChatHttpBase(final String chatHttpBase) {
+ this.chatHttpBase = chatHttpBase;
}
- public String[] getWsThemes() {
- return wsThemes;
+ public void setChatRoomHost(final String chatRoomHost) {
+ this.chatRoomHost = chatRoomHost;
}
- public void setWsThemes(final String[] wsThemes) {
- this.wsThemes = wsThemes;
+ public void setCountries(final ArrayList<I18nCountryDTO> countries) {
+ this.countries = countries;
}
- public ArrayList<I18nLanguageSimpleDTO> getLanguages() {
- return languages;
+ public void setDefaultWsTheme(final String defaultWsTheme) {
+ this.defaultWsTheme = defaultWsTheme;
}
public void setLanguages(final ArrayList<I18nLanguageSimpleDTO> languages) {
- this.languages = languages;
+ this.languages = languages;
}
- public ArrayList<I18nCountryDTO> getCountries() {
- return countries;
+ public void setLicenses(final ArrayList<LicenseDTO> licenses) {
+ this.licenses = licenses;
}
- public void setCountries(final ArrayList<I18nCountryDTO> countries) {
- this.countries = countries;
+ public void setSiteDomain(final String siteDomain) {
+ this.siteDomain = siteDomain;
}
+ public void setSiteLogoUrl(final String siteLogoUrl) {
+ this.siteLogoUrl = siteLogoUrl;
+ }
+
public void setTimezones(final String[] timezones) {
- this.timezones = timezones;
+ this.timezones = timezones;
}
- public String[] getTimezones() {
- return timezones;
+ public void setUserInfo(final UserInfoDTO currentUser) {
+ this.userInfo = currentUser;
}
- public String getSiteDomain() {
- return siteDomain;
+ public void setWsThemes(final String[] wsThemes) {
+ this.wsThemes = wsThemes;
}
- public void setSiteDomain(final String siteDomain) {
- this.siteDomain = siteDomain;
- }
}
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-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -23,6 +23,9 @@
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
@@ -122,6 +125,17 @@
final WorkspaceSkeleton ws = builder.getInstance(WorkspaceSkeleton.class);
+ builder.registerProvider(SiteLogo.class, new Provider<SiteLogo>() {
+ public SiteLogo get() {
+ final SiteLogoPresenter presenter = new SiteLogoPresenter(builder.getInstance(Session.class));
+ final SiteLogoPanel panel = new SiteLogoPanel(presenter, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.getInstance(SiteLogo.class);
+
builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {
public EntityLogo get() {
return new EntityLogoPanel(i18n, ws);
@@ -130,7 +144,7 @@
builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
public WsThemePresenter get() {
- final WsThemePresenter presenter = new WsThemePresenter();
+ final WsThemePresenter presenter = new WsThemePresenter(builder.getInstance(Session.class));
final WsThemePanel panel = new WsThemePanel(ws, presenter);
presenter.init(panel);
return presenter;
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-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -24,9 +24,12 @@
import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageSimpleDTO;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import com.calclab.suco.client.signal.Slot;
+
public interface Session {
/**
@@ -34,48 +37,36 @@
*/
public static int SESSION_DURATION = 1000 * 60 * 60 * 24 * 14;
- public List<LicenseDTO> getLicenses();
+ public List<I18nCountryDTO> getCountries();
- public void setLicenses(final List<LicenseDTO> licenses);
+ public Object[][] getCountriesArray();
- public void setCurrent(final StateDTO currentState);
+ public I18nLanguageDTO getCurrentLanguage();
public StateDTO getCurrentState();
- public void setCurrentState(final StateDTO currentState);
-
- public void setDefaultWsTheme(final String defaultWsTheme);
-
- public void setWsThemes(final String[] wsThemes);
-
- public String[] getWsThemes();
-
- public String getDefaultWsTheme();
-
- public boolean isLogged();
-
public List<I18nLanguageSimpleDTO> getLanguages();
- public void setLanguages(final List<I18nLanguageSimpleDTO> languages);
-
- public List<I18nCountryDTO> getCountries();
-
- public void setCountries(final List<I18nCountryDTO> countries);
-
public Object[][] getLanguagesArray();
- public Object[][] getCountriesArray();
+ public List<LicenseDTO> getLicenses();
- public void setTimezones(final String[] timezones);
-
public Object[][] getTimezones();
+ public boolean isLogged();
+
+ public void setCurrent(final StateDTO currentState);
+
public void setCurrentLanguage(final I18nLanguageDTO currentLanguage);
- public I18nLanguageDTO getCurrentLanguage();
+ public void setCurrentState(final StateDTO currentState);
+ public void setInitData(InitDataDTO initData);
+
String getUserHash();
+ void onInitDataReceived(Slot<InitDataDTO> slot);
+
void setUserHash(String userHash);
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -26,9 +26,13 @@
import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageSimpleDTO;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Slot;
+
/**
* RESPONSABILITIES: - Store the user's application state - Generates URLable's
* historyTokens
@@ -38,152 +42,123 @@
*/
public class SessionImpl implements Session {
private String userHash;
- private List<LicenseDTO> licenses;
- private List<I18nLanguageSimpleDTO> languages;
- private List<I18nCountryDTO> countries;
private Object[][] languagesArray;
private Object[][] countriesArray;
- private String[] timezones;
private Object[][] timezonesArray;
private StateDTO currentState;
- private String[] wsThemes;
- private String defaultWsTheme;
private I18nLanguageDTO currentLanguage;
+ private InitDataDTO initData;
+ private final Signal<InitDataDTO> onInitDataReceived;
public SessionImpl(final String userHash, final I18nLanguageDTO initialLanguage) {
- this.userHash = userHash;
- currentLanguage = initialLanguage;
- licenses = null;
- languages = null;
- languagesArray = null;
- countries = null;
+ this.userHash = userHash;
+ currentLanguage = initialLanguage;
+ languagesArray = null;
+ this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
}
public List<I18nCountryDTO> getCountries() {
- return countries;
+ return initData.getCountries();
}
public Object[][] getCountriesArray() {
- if (countriesArray == null) {
- countriesArray = mapCountries();
- }
- return countriesArray;
+ if (countriesArray == null) {
+ countriesArray = mapCountries();
+ }
+ return countriesArray;
}
public I18nLanguageDTO getCurrentLanguage() {
- return currentLanguage;
+ return currentLanguage;
}
public StateDTO getCurrentState() {
- return currentState;
+ return currentState;
}
- public String getDefaultWsTheme() {
- return defaultWsTheme;
- }
-
public List<I18nLanguageSimpleDTO> getLanguages() {
- return languages;
+ return initData.getLanguages();
}
public Object[][] getLanguagesArray() {
- if (languagesArray == null) {
- languagesArray = mapLangs();
- }
- return languagesArray;
+ if (languagesArray == null) {
+ languagesArray = mapLangs();
+ }
+ return languagesArray;
}
public List<LicenseDTO> getLicenses() {
- return licenses;
+ return initData.getLicenses();
}
public Object[][] getTimezones() {
- if (timezonesArray == null) {
- mapTimezones();
- }
- return timezonesArray;
+ if (timezonesArray == null) {
+ mapTimezones();
+ }
+ return timezonesArray;
}
public String getUserHash() {
- return userHash;
+ return userHash;
}
- public String[] getWsThemes() {
- return wsThemes;
- }
-
public boolean isLogged() {
- return userHash != null;
+ return userHash != null;
}
- public void setCountries(final List<I18nCountryDTO> countries) {
- this.countries = countries;
+ public void onInitDataReceived(final Slot<InitDataDTO> slot) {
+ onInitDataReceived.add(slot);
}
public void setCurrent(final StateDTO currentState) {
- this.currentState = currentState;
+ this.currentState = currentState;
}
public void setCurrentLanguage(final I18nLanguageDTO currentLanguage) {
- this.currentLanguage = currentLanguage;
+ this.currentLanguage = currentLanguage;
}
public void setCurrentState(final StateDTO currentState) {
- this.currentState = currentState;
+ this.currentState = currentState;
}
- public void setDefaultWsTheme(final String defaultWsTheme) {
- this.defaultWsTheme = defaultWsTheme;
+ public void setInitData(final InitDataDTO initData) {
+ this.initData = initData;
+ onInitDataReceived.fire(initData);
}
- public void setLanguages(final List<I18nLanguageSimpleDTO> languages) {
- this.languages = languages;
- }
-
- public void setLicenses(final List<LicenseDTO> licenses) {
- this.licenses = licenses;
- }
-
- public void setTimezones(final String[] timezones) {
- this.timezones = timezones;
- }
-
public void setUserHash(final String userHash) {
- this.userHash = userHash;
+ this.userHash = userHash;
}
- public void setWsThemes(final String[] wsThemes) {
- this.wsThemes = wsThemes;
- }
-
private Object[][] mapCountries() {
- Object[][] objs = new Object[countries.size()][1];
- int i = 0;
- for (Iterator<I18nCountryDTO> iterator = countries.iterator(); iterator.hasNext();) {
- I18nCountryDTO country = iterator.next();
- Object[] obj = new Object[] { country.getCode(), country.getEnglishName() };
- objs[i++] = obj;
- }
- return objs;
+ final Object[][] objs = new Object[getCountries().size()][1];
+ int i = 0;
+ for (final Iterator<I18nCountryDTO> iterator = getCountries().iterator(); iterator.hasNext();) {
+ final I18nCountryDTO country = iterator.next();
+ final Object[] obj = new Object[] { country.getCode(), country.getEnglishName() };
+ objs[i++] = obj;
+ }
+ return objs;
}
private Object[][] mapLangs() {
- Object[][] objs = new Object[languages.size()][1];
- int i = 0;
- for (Iterator<I18nLanguageSimpleDTO> iterator = languages.iterator(); iterator.hasNext();) {
- I18nLanguageSimpleDTO language = iterator.next();
- Object[] obj = new Object[] { language.getCode(), language.getEnglishName() };
- objs[i++] = obj;
- }
- return objs;
+ final Object[][] objs = new Object[getLanguages().size()][1];
+ int i = 0;
+ for (final Iterator<I18nLanguageSimpleDTO> iterator = getLanguages().iterator(); iterator.hasNext();) {
+ final I18nLanguageSimpleDTO language = iterator.next();
+ final Object[] obj = new Object[] { language.getCode(), language.getEnglishName() };
+ objs[i++] = obj;
+ }
+ return objs;
}
private void mapTimezones() {
- timezonesArray = new Object[timezones.length][1];
- for (int i = 0; i < timezones.length; i++) {
- Object[] obj = new Object[] { timezones[i] };
- timezonesArray[i] = obj;
- }
+ timezonesArray = new Object[getTimezones().length][1];
+ for (int i = 0; i < getTimezones().length; i++) {
+ final Object[] obj = new Object[] { getTimezones()[i] };
+ timezonesArray[i] = obj;
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -41,7 +41,6 @@
private final ContentProvider provider;
private final Workspace workspace;
private StateDTO oldState;
- private String lastTheme;
private final Session session;
private final HistoryWrapper history;
private final WorkspaceManager ws;
@@ -135,7 +134,6 @@
} else {
workspace.getThemeMenuComponent().setVisible(false);
}
- setWsTheme(group);
workspace.showGroup(group, isAdmin);
final String toolName = state.getToolName();
@@ -180,11 +178,4 @@
workspace.getParticipationComponent().setParticipation(state);
}
- private void setWsTheme(final GroupDTO group) {
- final String nextTheme = group.getWorkspaceTheme();
- if (lastTheme == null || !lastTheme.equals(nextTheme)) {
- workspace.setTheme(nextTheme);
- }
- lastTheme = nextTheme;
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -38,93 +38,102 @@
private String chatRoomHost;
private String defaultWsTheme;
private String[] wsThemes;
+ private String siteLogoUrl;
- public UserInfo getUserInfo() {
- return userInfo;
+ public String getChatDomain() {
+ return chatDomain;
}
- public void setUserInfo(final UserInfo currentUserInfo) {
- this.userInfo = currentUserInfo;
+ public String getChatHttpBase() {
+ return chatHttpBase;
}
- public List<License> getLicenses() {
- return licenses;
+ public String getChatRoomHost() {
+ return chatRoomHost;
}
- public void setLicenses(final List<License> licenses) {
- this.licenses = licenses;
+ public List<I18nCountry> getCountries() {
+ return countries;
}
- public void setChatHttpBase(final String chatHttpBase) {
- this.chatHttpBase = chatHttpBase;
+ public String getDefaultWsTheme() {
+ return defaultWsTheme;
}
- public String getChatHttpBase() {
- return chatHttpBase;
+ public List<I18nLanguage> getLanguages() {
+ return languages;
}
- public void setChatDomain(final String chatDomain) {
- this.chatDomain = chatDomain;
+ public List<License> getLicenses() {
+ return licenses;
}
- public String getChatDomain() {
- return chatDomain;
+ public String getSiteDomain() {
+ return siteDomain;
}
- public void setChatRoomHost(final String chatRoomHost) {
- this.chatRoomHost = chatRoomHost;
+ public String getSiteLogoUrl() {
+ return siteLogoUrl;
}
- public String getChatRoomHost() {
- return chatRoomHost;
+ public String[] getTimezones() {
+ return timezones;
}
- public String getDefaultWsTheme() {
- return defaultWsTheme;
+ public UserInfo getUserInfo() {
+ return userInfo;
}
- public void setDefaultWsTheme(final String defaultWsTheme) {
- this.defaultWsTheme = defaultWsTheme;
+ public String[] getWsThemes() {
+ return wsThemes;
}
- public String[] getWsThemes() {
- return wsThemes;
+ public void setChatDomain(final String chatDomain) {
+ this.chatDomain = chatDomain;
}
- public void setWsThemes(final String[] wsThemes) {
- this.wsThemes = wsThemes;
+ public void setChatHttpBase(final String chatHttpBase) {
+ this.chatHttpBase = chatHttpBase;
}
- public List<I18nLanguage> getLanguages() {
- return languages;
+ public void setChatRoomHost(final String chatRoomHost) {
+ this.chatRoomHost = chatRoomHost;
}
+ public void setCountries(final List<I18nCountry> countries) {
+ this.countries = countries;
+ }
+
+ public void setDefaultWsTheme(final String defaultWsTheme) {
+ this.defaultWsTheme = defaultWsTheme;
+ }
+
public void setLanguages(final List<I18nLanguage> languages) {
- this.languages = languages;
+ this.languages = languages;
}
- public List<I18nCountry> getCountries() {
- return countries;
+ public void setLicenses(final List<License> licenses) {
+ this.licenses = licenses;
}
- public void setCountries(final List<I18nCountry> countries) {
- this.countries = countries;
+ public void setSiteDomain(final String siteDomain) {
+ this.siteDomain = siteDomain;
}
- public void setTimezones(final String[] timezones) {
- this.timezones = timezones;
+ public void setSiteLogoUrl(final String siteLogoUrl) {
+ this.siteLogoUrl = siteLogoUrl;
}
- public String[] getTimezones() {
- return timezones;
+ public void setTimezones(final String[] timezones) {
+ this.timezones = timezones;
}
- public String getSiteDomain() {
- return siteDomain;
+ public void setUserInfo(final UserInfo currentUserInfo) {
+ this.userInfo = currentUserInfo;
}
- public void setSiteDomain(final String siteDomain) {
- this.siteDomain = siteDomain;
+ public void setWsThemes(final String[] wsThemes) {
+ this.wsThemes = wsThemes;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -28,6 +28,7 @@
public String CHAT_ROOM_HOST = "kune.chat.roomHost";
public String WS_THEMES_DEF = "kune.wsthemes.default";
public String WS_THEMES = "kune.wsthemes";
+ public String SITE_LOGO_URL = "kune.sitelogourl";
public String get(String key);
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-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -88,6 +88,7 @@
data.setChatRoomHost(chatProperties.getRoomHost());
data.setWsThemes(this.kuneProperties.get(KuneProperties.WS_THEMES).split(","));
data.setDefaultWsTheme(this.kuneProperties.get(KuneProperties.WS_THEMES_DEF));
+ data.setSiteLogoUrl(kuneProperties.get(KuneProperties.SITE_LOGO_URL));
return mapper.map(data, InitDataDTO.class);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -36,7 +36,6 @@
import org.ourproject.kune.workspace.client.actions.DisableRateItAction;
import org.ourproject.kune.workspace.client.actions.EnableRateItAction;
import org.ourproject.kune.workspace.client.actions.InitAction;
-import org.ourproject.kune.workspace.client.actions.InitDataReceivedAction;
import org.ourproject.kune.workspace.client.actions.LoggedInAction;
import org.ourproject.kune.workspace.client.actions.LoggedOutAction;
import org.ourproject.kune.workspace.client.actions.OnlyCheckUserSessionAction;
@@ -74,56 +73,55 @@
private final I18nUITranslationService i18n;
public WorkspaceClientModule(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nUITranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- dispacher = DefaultDispatcher.getInstance();
- this.workspace = workspace;
+ final I18nUITranslationService i18n) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ dispacher = DefaultDispatcher.getInstance();
+ this.workspace = workspace;
}
public void configure(final Register register) {
- register.addAction(WorkspaceEvents.START_APP, new InitAction(session, dispacher, workspace));
- register.addAction(WorkspaceEvents.STOP_APP, new StopAction(workspace));
- register.addAction(WorkspaceEvents.INIT_DATA_RECEIVED, new InitDataReceivedAction(session, workspace));
- register.addAction(WorkspaceEvents.USER_LOGGED_IN, new LoggedInAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.USER_LOGGED_OUT, new LoggedOutAction(session, stateManager));
- register.addAction(WorkspaceEvents.ONLY_CHECK_USER_SESSION, new OnlyCheckUserSessionAction(session));
- register.addAction(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET, new AttachToExtensibleWidgetAction(workspace));
- register.addAction(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
- new DetachFromExtensibleWidgetAction(workspace));
- register.addAction(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET, new ClearExtensibleWidgetAction(workspace));
- register.addAction(WorkspaceEvents.REQ_JOIN_GROUP, new RequestJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.ACCEPT_JOIN_GROUP, new AcceptJoinGroupAction(session, stateManager,
- workspace, i18n));
- register.addAction(WorkspaceEvents.DENY_JOIN_GROUP, new DenyJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.DEL_MEMBER, new DeleteMemberAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.SET_COLLAB_AS_ADMIN, new SetCollabAsAdminAction(session, stateManager,
- workspace, i18n));
- register.addAction(WorkspaceEvents.SET_ADMIN_AS_COLLAB, new SetAdminAsCollabAction(session, stateManager,
- workspace, i18n));
- register
- .addAction(WorkspaceEvents.ADD_ADMIN_MEMBER, new AddAdminAction(session, stateManager, workspace, i18n));
- register.addAction(WorkspaceEvents.ADD_COLLAB_MEMBER, new AddCollabAction(session, stateManager, workspace,
- i18n));
- register.addAction(WorkspaceEvents.ADD_VIEWER_MEMBER, new AddViewerAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.UNJOIN_GROUP, new UnJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.CHANGE_GROUP_WSTHEME, new ChangeGroupWsThemeAction(session, workspace));
- register.addAction(WorkspaceEvents.RATE_CONTENT, new RateContentAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.ENABLE_RATEIT, new EnableRateItAction(workspace));
- register.addAction(WorkspaceEvents.DISABLE_RATEIT, new DisableRateItAction(workspace));
- register.addAction(WorkspaceEvents.GET_TRANSLATION, new GetTranslationAction(session));
- register.addAction(WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH, new AddGroupLiveSearchAction(workspace));
- register.addAction(WorkspaceEvents.ADD_USERLIVESEARCH, new AddUserLiveSearchAction(workspace));
- register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
- register.addAction(WorkspaceEvents.SHOW_SEARCHER, new ShowSearcherAction());
- register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
- register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
- register.addAction(WorkspaceEvents.USER_LOGIN, new UserLoginAction());
- register.addAction(WorkspaceEvents.USER_LOGOUT, new UserLogoutAction(session));
- register.addAction(WorkspaceEvents.USER_REGISTER, new UserRegisterAction());
- register.addAction(WorkspaceEvents.CREATE_NEW_GROUP, new CreateNewGroupAction(session));
- register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
- register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
+ register.addAction(WorkspaceEvents.START_APP, new InitAction(session, dispacher, workspace));
+ register.addAction(WorkspaceEvents.STOP_APP, new StopAction(workspace));
+ register.addAction(WorkspaceEvents.USER_LOGGED_IN, new LoggedInAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.USER_LOGGED_OUT, new LoggedOutAction(session, stateManager));
+ register.addAction(WorkspaceEvents.ONLY_CHECK_USER_SESSION, new OnlyCheckUserSessionAction(session));
+ register.addAction(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET, new AttachToExtensibleWidgetAction(workspace));
+ register.addAction(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
+ new DetachFromExtensibleWidgetAction(workspace));
+ register.addAction(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET, new ClearExtensibleWidgetAction(workspace));
+ register.addAction(WorkspaceEvents.REQ_JOIN_GROUP, new RequestJoinGroupAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.ACCEPT_JOIN_GROUP, new AcceptJoinGroupAction(session, stateManager,
+ workspace, i18n));
+ register.addAction(WorkspaceEvents.DENY_JOIN_GROUP, new DenyJoinGroupAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.DEL_MEMBER, new DeleteMemberAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.SET_COLLAB_AS_ADMIN, new SetCollabAsAdminAction(session, stateManager,
+ workspace, i18n));
+ register.addAction(WorkspaceEvents.SET_ADMIN_AS_COLLAB, new SetAdminAsCollabAction(session, stateManager,
+ workspace, i18n));
+ register
+ .addAction(WorkspaceEvents.ADD_ADMIN_MEMBER, new AddAdminAction(session, stateManager, workspace, i18n));
+ register.addAction(WorkspaceEvents.ADD_COLLAB_MEMBER, new AddCollabAction(session, stateManager, workspace,
+ i18n));
+ register.addAction(WorkspaceEvents.ADD_VIEWER_MEMBER, new AddViewerAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.UNJOIN_GROUP, new UnJoinGroupAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.CHANGE_GROUP_WSTHEME, new ChangeGroupWsThemeAction(session, workspace));
+ register.addAction(WorkspaceEvents.RATE_CONTENT, new RateContentAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.ENABLE_RATEIT, new EnableRateItAction(workspace));
+ register.addAction(WorkspaceEvents.DISABLE_RATEIT, new DisableRateItAction(workspace));
+ register.addAction(WorkspaceEvents.GET_TRANSLATION, new GetTranslationAction(session));
+ register.addAction(WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH, new AddGroupLiveSearchAction(workspace));
+ register.addAction(WorkspaceEvents.ADD_USERLIVESEARCH, new AddUserLiveSearchAction(workspace));
+ register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
+ register.addAction(WorkspaceEvents.SHOW_SEARCHER, new ShowSearcherAction());
+ register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
+ register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
+ register.addAction(WorkspaceEvents.USER_LOGIN, new UserLoginAction());
+ register.addAction(WorkspaceEvents.USER_LOGOUT, new UserLogoutAction(session));
+ register.addAction(WorkspaceEvents.USER_REGISTER, new UserRegisterAction());
+ register.addAction(WorkspaceEvents.CREATE_NEW_GROUP, new CreateNewGroupAction(session));
+ register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
+ register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -44,59 +44,55 @@
private final Workspace workspace;
public InitAction(final Session session, final Dispatcher dispatcher, final Workspace workspace) {
- this.session = session;
- this.dispatcher = dispatcher;
- this.workspace = workspace;
+ this.session = session;
+ this.dispatcher = dispatcher;
+ this.workspace = workspace;
}
public void execute(final Object value) {
- PrefetchUtilities.preFetchImpImages();
- getInitData();
- dispatcher.fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
- Timer prefetchTimer = new Timer() {
- public void run() {
- PrefetchUtilities.doTasksDeferred(workspace);
- }
- };
- prefetchTimer.schedule(20000);
+ PrefetchUtilities.preFetchImpImages();
+ getInitData();
+ dispatcher.fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
+ final Timer prefetchTimer = new Timer() {
+ public void run() {
+ PrefetchUtilities.doTasksDeferred(workspace);
+ }
+ };
+ prefetchTimer.schedule(20000);
}
private void getInitData() {
- SiteServiceAsync server = SiteService.App.getInstance();
- server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
- public void onFailure(final Throwable error) {
- Site.error("Error fetching initial data");
- Log.debug(error.getMessage());
- }
+ final SiteServiceAsync server = SiteService.App.getInstance();
+ server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
+ public void onFailure(final Throwable error) {
+ Site.error("Error fetching initial data");
+ Log.debug(error.getMessage());
+ }
- public void onSuccess(final InitDataDTO initData) {
- checkChatDomain(initData.getChatDomain());
- session.setLicenses(initData.getLicenses());
- session.setWsThemes(initData.getWsThemes());
- session.setDefaultWsTheme(initData.getDefaultWsTheme());
- session.setLanguages(initData.getLanguages());
- session.setCountries(initData.getCountries());
- session.setTimezones(initData.getTimezones());
- UserInfoDTO currentUser = initData.getUserInfo();
- dispatcher.fire(WorkspaceEvents.INIT_DATA_RECEIVED, initData);
- if (currentUser == null) {
- dispatcher.fire(WorkspaceEvents.USER_LOGGED_OUT, null);
- } else {
- dispatcher.fire(WorkspaceEvents.USER_LOGGED_IN, currentUser);
- }
- RootPanel.get("kuneinitialcurtain").setVisible(false);
+ public void onSuccess(final InitDataDTO initData) {
+ checkChatDomain(initData.getChatDomain());
+ session.setInitData(initData);
+ final UserInfoDTO currentUser = initData.getUserInfo();
+ // use signals:
+ dispatcher.fire(WorkspaceEvents.INIT_DATA_RECEIVED, initData);
+ if (currentUser == null) {
+ dispatcher.fire(WorkspaceEvents.USER_LOGGED_OUT, null);
+ } else {
+ dispatcher.fire(WorkspaceEvents.USER_LOGGED_IN, currentUser);
+ }
+ RootPanel.get("kuneinitialcurtain").setVisible(false);
- Site.unMask();
- }
+ Site.unMask();
+ }
- private void checkChatDomain(final String chatDomain) {
- String httpDomain = WindowUtils.getLocation().getHostName();
- if (!chatDomain.equals(httpDomain)) {
- Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
- + "). This will produce problems with the chat functionality. "
- + "Check kune.properties on the server.");
- }
- }
- });
+ private void checkChatDomain(final String chatDomain) {
+ final String httpDomain = WindowUtils.getLocation().getHostName();
+ if (!chatDomain.equals(httpDomain)) {
+ Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
+ + "). This will produce problems with the chat functionality. "
+ + "Check kune.properties on the server.");
+ }
+ }
+ });
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -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.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class InitDataReceivedAction implements Action<Object> {
-
- private final Workspace workspace;
- private final Session session;
-
- public InitDataReceivedAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
- }
-
- public void execute(final Object value) {
- onInitDataReceived();
- }
-
- private void onInitDataReceived() {
- workspace.setTheme(session.getDefaultWsTheme());
- workspace.getThemeMenuComponent().setThemes(session.getWsThemes());
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -44,6 +44,7 @@
entityLicensePresenter.setLicense(state);
// Only for probes:
wsThemePresenter.setVisible(true);
+ wsThemePresenter.setTheme(new WsTheme(group.getWorkspaceTheme()));
}
public void setTheme(final WsTheme theme) {
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+public interface SiteLogo {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,19 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Image;
+
+public class SiteLogoPanel implements SiteLogoView {
+
+ private final Image siteLogoImg;
+
+ public SiteLogoPanel(final SiteLogoPresenter presenter, final WorkspaceSkeleton ws) {
+ siteLogoImg = new Image();
+ ws.getSiteBar().add(siteLogoImg);
+ }
+
+ public void setSiteLogoUrl(final String siteLogoUrl) {
+ siteLogoImg.setUrl(siteLogoUrl);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,29 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.state.Session;
+
+import com.calclab.suco.client.signal.Slot;
+
+public class SiteLogoPresenter implements SiteLogo {
+
+ private SiteLogoView view;
+
+ public SiteLogoPresenter(final Session session) {
+ session.onInitDataReceived(new Slot<InitDataDTO>() {
+ public void onEvent(final InitDataDTO initData) {
+ view.setSiteLogoUrl(initData.getSiteLogoUrl());
+ }
+ });
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final SiteLogoView view) {
+ this.view = view;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteLogoView extends View {
+ void setSiteLogoUrl(String siteLogoUrl);
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -24,6 +24,7 @@
trayBar = mainPanel.createBottomBar(entitySummary, "k-site-traybar");
mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH, 30);
mainPanel.add(entitySummary, DefaultBorderLayout.Position.CENTER);
+ trayBar.addFill();
}
public void addInSummary(final Widget widget) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -1,5 +1,48 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
-public enum WsTheme {
- def, green, blue, grey, purple, red
+public class WsTheme {
+ private final String name;
+
+ public WsTheme(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final WsTheme other = (WsTheme) obj;
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (name == null ? 0 : name.hashCode());
+ return result;
+ }
+
+ public String toString() {
+ return name;
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -13,10 +13,26 @@
public class WsThemePanel extends ToolbarButton implements WsThemeView {
private final Menu menu;
+ private final WsThemePresenter presenter;
public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter) {
+ this.presenter = presenter;
menu = new Menu();
- for (final WsTheme theme : WsTheme.values()) {
+
+ menu.setDefaultAlign("br-tr");
+ super.setMenu(menu);
+ super.setIcon("images/colors.gif");
+ ws.getSiteTraybar().addButton(this);
+ presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ ws.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void setThemes(final String[] themes) {
+ for (int i = 0; i < themes.length; i++) {
+ final WsTheme theme = new WsTheme(themes[i]);
final MenuItem item = new MenuItem();
item.setText(theme.toString());
menu.addItem(item);
@@ -27,14 +43,6 @@
}
});
}
- menu.setDefaultAlign("br-tr");
- super.setMenu(menu);
- ws.getSiteTraybar().addButton(this);
- presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
- public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- ws.setTheme(oldTheme, newTheme);
- }
- });
}
public void setVisible(final boolean visible) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -1,6 +1,10 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.state.Session;
+
import com.calclab.suco.client.signal.Signal2;
+import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
public class WsThemePresenter {
@@ -9,8 +13,13 @@
private WsTheme previousTheme;
private final Signal2<WsTheme, WsTheme> onThemeChanged;
- public WsThemePresenter() {
+ public WsThemePresenter(final Session session) {
this.onThemeChanged = new Signal2<WsTheme, WsTheme>("onThemeChanged");
+ session.onInitDataReceived(new Slot<InitDataDTO>() {
+ public void onEvent(final InitDataDTO initData) {
+ view.setThemes(initData.getWsThemes());
+ }
+ });
}
public void init(final WsThemeView view) {
@@ -22,7 +31,9 @@
}
public void setTheme(final WsTheme newTheme) {
- onThemeChanged.fire(previousTheme, newTheme);
+ if (previousTheme == null || !previousTheme.equals(newTheme)) {
+ onThemeChanged.fire(previousTheme, newTheme);
+ }
previousTheme = newTheme;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -2,6 +2,8 @@
public interface WsThemeView {
+ void setThemes(String[] themes);
+
void setVisible(boolean visible);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -36,7 +36,6 @@
import org.ourproject.kune.workspace.client.workspace.WorkspaceView;
import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.Composite;
@@ -309,27 +308,38 @@
}
public void setTheme(final String theme) {
- colorTheme.setTheme(theme);
- final String mainColor = colorTheme.getContentMainBorder();
- // groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
- contentTitleBarBorderDec.setColor(mainColor);
- bottomBorderDecorator.setColor(mainColor);
- DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor", mainColor);
- contentTitlePanel.setColors(colorTheme.getContentTitle(), colorTheme.getContentTitleText());
- contentSubTitlePanel.setColors(mainColor, colorTheme.getContentSubTitleText());
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "borderLeftColor", mainColor);
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "backgroundColor", colorTheme.getContentTitle());
- DOM.setStyleAttribute(contentSubTitleBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(contentBottomBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(), "backgroundColor", colorTheme.getContext());
- DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(), 0), 1), "backgroundColor", colorTheme
- .getSplitter());
- DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(), "color", colorTheme.getContentBottomText());
- groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
- participationPanel.setColor(colorTheme.getParticipationDD());
- groupSummaryPanel.setColor(colorTheme.getSummaryDD());
- tagsPanel.setColor(colorTheme.getTagsDD());
- groupToolsBar.setTabsColors(colorTheme.getToolSelected(), colorTheme.getToolUnselected());
+ // colorTheme.setTheme(theme);
+ // final String mainColor = colorTheme.getContentMainBorder();
+ // // groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
+ // contentTitleBarBorderDec.setColor(mainColor);
+ // bottomBorderDecorator.setColor(mainColor);
+ // DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor",
+ // mainColor);
+ // contentTitlePanel.setColors(colorTheme.getContentTitle(),
+ // colorTheme.getContentTitleText());
+ // contentSubTitlePanel.setColors(mainColor,
+ // colorTheme.getContentSubTitleText());
+ // DOM.setStyleAttribute(contentTitleBarHP.getElement(),
+ // "borderLeftColor", mainColor);
+ // DOM.setStyleAttribute(contentTitleBarHP.getElement(),
+ // "backgroundColor", colorTheme.getContentTitle());
+ // DOM.setStyleAttribute(contentSubTitleBarHP.getElement(),
+ // "backgroundColor", mainColor);
+ // DOM.setStyleAttribute(contentBottomBarHP.getElement(),
+ // "backgroundColor", mainColor);
+ // DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(),
+ // "backgroundColor", colorTheme.getContext());
+ // DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(),
+ // 0), 1), "backgroundColor", colorTheme
+ // .getSplitter());
+ // DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(),
+ // "color", colorTheme.getContentBottomText());
+ // groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
+ // participationPanel.setColor(colorTheme.getParticipationDD());
+ // groupSummaryPanel.setColor(colorTheme.getSummaryDD());
+ // tagsPanel.setColor(colorTheme.getTagsDD());
+ // groupToolsBar.setTabsColors(colorTheme.getToolSelected(),
+ // colorTheme.getToolUnselected());
}
public void setTool(final String toolName) {
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/resources/kune.properties 2008-07-10 17:00:24 UTC (rev 796)
@@ -17,6 +17,8 @@
kune.chat.domain = localhost
kune.chat.roomHost = rooms.localhost
-# Workspace themes (see colorthemes.js)
-kune.wsthemes = defaultKuneTheme,greenKuneTheme,blueKuneTheme,greyKuneTheme,purpleKuneTheme,redKuneTheme
-kune.wsthemes.default = defaultKuneTheme
+# Workspace enabled themes
+kune.wsthemes = def,green,blue,grey,purple,red
+kune.wsthemes.default = def
+
+kune.sitelogourl = images/kune-logo-16px.png
\ No newline at end of file
More information about the kune-commits
mailing list