[kune-commits] r918 - in trunk/src/main:
java/org/ourproject/kune/platf/client/dto
java/org/ourproject/kune/workspace/client/entitylogo resources
vjrj
vjrj at ourproject.org
Wed Oct 22 00:17:59 CEST 2008
Author: vjrj
Date: 2008-10-22 00:17:58 +0200 (Wed, 22 Oct 2008)
New Revision: 918
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java
trunk/src/main/resources/dozerBeanMapping.xml
Log:
Incomplete - task EntityLogo revisited
Incomplete - task NPE finding a non existent content
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-10-21 19:26:47 UTC (rev 917)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-10-21 22:17:58 UTC (rev 918)
@@ -33,6 +33,7 @@
private LicenseDTO defaultLicense;
private String workspaceTheme;
private boolean hasLogo;
+ private StateToken stateToken;
public GroupDTO() {
this(null, null, GroupType.ORGANIZATION);
@@ -95,6 +96,13 @@
return shortName;
}
+ public StateToken getStateToken() {
+ if (stateToken == null) {
+ stateToken = new StateToken(shortName);
+ }
+ return stateToken;
+ }
+
public String getWorkspaceTheme() {
return workspaceTheme;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java 2008-10-21 19:26:47 UTC (rev 917)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java 2008-10-21 22:17:58 UTC (rev 918)
@@ -20,6 +20,7 @@
package org.ourproject.kune.workspace.client.entitylogo;
+import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
@@ -119,6 +120,10 @@
ws.addToEntityMainHeader(this);
}
+ public void reloadImage(GroupDTO group) {
+ Image.prefetch(downloadProvider.get().getLogoImageUrl(group.getStateToken()));
+ }
+
public void setFullLogo(final StateToken stateToken, final boolean clipped) {
clear();
final String imageUrl = downloadProvider.get().getImageUrl(stateToken);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java 2008-10-21 19:26:47 UTC (rev 917)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java 2008-10-21 22:17:58 UTC (rev 918)
@@ -3,7 +3,6 @@
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
@@ -60,6 +59,7 @@
group.getShortName())) {
// only if we are in the
// same group
+ view.reloadImage(group);
currentState.setGroup(group);
setGroupLogo(group);
}
@@ -72,7 +72,7 @@
if (groupFullLogo != null) {
view.setFullLogo(groupFullLogo.getStateToken(), true);
} else if (group.hasLogo()) {
- view.setLogoImage(new StateToken(group.getShortName()));
+ view.setLogoImage(group.getStateToken());
view.setLogoText(group.getLongName());
view.setLogoImageVisible(true);
} else {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java 2008-10-21 19:26:47 UTC (rev 917)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java 2008-10-21 22:17:58 UTC (rev 918)
@@ -1,5 +1,6 @@
package org.ourproject.kune.workspace.client.entitylogo;
+import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.workspace.client.themes.WsTheme;
@@ -11,8 +12,10 @@
int LOGO_ICON_MIN_HEIGHT = 28;
int LOGO_ICON_MIN_WIDTH = 468;
- String LOGO_FORM_FIELD = "k-elv-ff";
+ String LOGO_FORM_FIELD = "k-elogov-ff";
+ void reloadImage(GroupDTO group);
+
void setFullLogo(StateToken stateToken, boolean clipped);
void setLogoImage(StateToken stateToken);
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2008-10-21 19:26:47 UTC (rev 917)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2008-10-21 22:17:58 UTC (rev 918)
@@ -46,10 +46,10 @@
</mapping>
<mapping>
- <class-a>org.ourproject.kune.platf.client.dto.GroupDTO</class-a>
- <class-b>org.ourproject.kune.platf.server.domain.Group</class-b>
- <field>
- <a get-method="hasLogo">hasLogo</a>
+ <class-a>org.ourproject.kune.platf.server.domain.Group</class-a>
+ <class-b>org.ourproject.kune.platf.client.dto.GroupDTO</class-b>
+ <field type="one-way">
+ <a>hasLogo</a>
<b>hasLogo</b>
</field>
</mapping>
More information about the kune-commits
mailing list