[kune-commits] r1696 - in trunk: . src/main/java/cc/kune/core/client/sitebar/search src/main/java/cc/kune/core/client/sn src/main/java/cc/kune/core/shared/dto src/main/java/cc/kune/events/client/actions
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Wed Feb 22 20:41:12 CET 2012
Author: vjrj_
Date: 2012-02-22 20:41:12 +0100 (Wed, 22 Feb 2012)
New Revision: 1696
Added:
trunk/src/main/java/cc/kune/events/client/actions/EventOpenMenuItem.java
Removed:
trunk/src/main/java/cc/kune/events/client/actions/EventEditMenuItem.java
Modified:
trunk/INSTALL
trunk/src/main/java/cc/kune/core/client/sitebar/search/MultivalueSuggestBox.java
trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java
trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java
trunk/src/main/java/cc/kune/core/shared/dto/UserSimpleDTO.java
trunk/src/main/java/cc/kune/events/client/actions/CalendarRolAction.java
trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
Log:
NEW - # 158: Add a Calendar view to event tool
http://kune.ourproject.org/issues/ticket/158
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/INSTALL 2012-02-22 19:41:12 UTC (rev 1696)
@@ -245,10 +245,6 @@
This is used to set the database of users of openfire to kune users database table. When you do that you have to follow the next step (or you will get authentication problems).
-Edit the openfire.xml in a terminal:
-* In debian (with a .deb installation) you can to edit the configuration in /etc/openfire directory.
-* In Mac: /usr/local/openfire/conf
-
Also in 'Server > Server Manager > System Properties' set (verify that the mysql connection user and password is the same as the password you choose to configure your database):
jdbcProvider.driver = com.mysql.jdbc.Driver
@@ -266,7 +262,10 @@
jdbcUserProvider.usernameField = shortName
admin.authorizedJIDs = admin at PUT_HERE_YOUR_DOMAIN
-Or, alternatively (if is more easy for you), add these lines to conf/openfire.xml. Again check that the user/passwd of the db is the same here and in kune.properties (the ones configured before):
+Or, alternatively (if is more easy for you), add these lines to conf/openfire.xml
+* In debian (with a .deb installation) you can to edit the configuration in /etc/openfire directory.
+* In Mac: /usr/local/openfire/conf
+(Again check that the user/passwd of the db is the same here and in kune.properties the ones configured before):
<pre>
<jive>
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/search/MultivalueSuggestBox.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/search/MultivalueSuggestBox.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/search/MultivalueSuggestBox.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -880,8 +880,10 @@
final JSONObject jsonOpt = optionsArray.get(i).isObject();
final Option option = new Option();
- option.setName(jsonOpt.get(OptionResultSet.DISPLAY_NAME).isString().stringValue() + " ("
- + jsonOpt.get(OptionResultSet.VALUE).isString().stringValue() + ")");
+
+ final String longName = jsonOpt.get(OptionResultSet.DISPLAY_NAME).isString().stringValue();
+ final String shortName = jsonOpt.get(OptionResultSet.VALUE).isString().stringValue();
+ option.setName(!longName.equals(shortName) ? longName + " (" + shortName + ")" : shortName);
option.setValue(jsonOpt.get(OptionResultSet.VALUE).isString().stringValue());
options.addOption(option);
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -65,8 +65,8 @@
@Override
public void addAdmin(final GroupDTO group, final String avatarUrl, final String tooltip,
final String tooltipTitle, final GuiActionDescCollection menu) {
- final BasicDragableThumb thumb = createThumb(group.getShortName(), avatarUrl, tooltip, tooltipTitle,
- menu);
+ final BasicDragableThumb thumb = createThumb(group.getCompoundName(), avatarUrl, tooltip,
+ tooltipTitle, menu);
firstCategoryFlow.add(group.isPersonal() ? (Widget) decorateAvatarWithXmppStatus(
group.getShortName(), thumb) : thumb);
}
@@ -74,8 +74,8 @@
@Override
public void addCollab(final GroupDTO group, final String avatarUrl, final String tooltip,
final String tooltipTitle, final GuiActionDescCollection menu) {
- final BasicDragableThumb thumb = createThumb(group.getShortName(), avatarUrl, tooltip, tooltipTitle,
- menu);
+ final BasicDragableThumb thumb = createThumb(group.getCompoundName(), avatarUrl, tooltip,
+ tooltipTitle, menu);
sndCategoryFlow.add(group.isPersonal() ? (Widget) decorateAvatarWithXmppStatus(group.getShortName(),
thumb) : thumb);
}
@@ -83,8 +83,8 @@
@Override
public void addPending(final GroupDTO group, final String avatarUrl, final String tooltip,
final String tooltipTitle, final GuiActionDescCollection menu) {
- final BasicDragableThumb thumb = createThumb(group.getShortName(), avatarUrl, tooltip, tooltipTitle,
- menu);
+ final BasicDragableThumb thumb = createThumb(group.getCompoundName(), avatarUrl, tooltip,
+ tooltipTitle, menu);
trdCategoryFlow.add(thumb);
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -26,8 +26,8 @@
import cc.kune.core.client.events.SocialNetworkChangedEvent;
import cc.kune.core.client.events.StateChangedEvent;
import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
import cc.kune.core.client.events.UserSignOutEvent;
-import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.sn.actions.registry.GroupSNAdminsMenuItemsRegistry;
@@ -204,21 +204,26 @@
if (userCanView) {
for (final GroupDTO admin : adminsList) {
final String avatar = getAvatar(admin);
- getView().addAdmin(admin, avatar, admin.getLongName(), "",
- createMenuItems(admin, adminsMenuItemsRegistry, admin.getLongName()));
+ getView().addAdmin(admin, avatar, admin.getCompoundName(), "",
+ createMenuItems(admin, adminsMenuItemsRegistry, admin.getCompoundName()));
}
getView().setCollabsVisible(numCollabs > 0, areMany(numCollabs));
for (final GroupDTO collab : collabList) {
final String avatar = getAvatar(collab);
- getView().addCollab(collab, avatar, collab.getLongName(), "",
- createMenuItems(collab, collabsMenuItemsRegistry, collab.getLongName()));
+ getView().addCollab(collab, avatar, collab.getCompoundName(), "",
+ createMenuItems(collab, collabsMenuItemsRegistry, collab.getCompoundName()));
}
if (userIsAdmin) {
getView().setPendingVisible(numPendings > 0, areMany(numPendings));
for (final GroupDTO pendingCollab : pendingCollabsList) {
final String avatar = getAvatar(pendingCollab);
- getView().addPending(pendingCollab, avatar, pendingCollab.getLongName(), "",
- createMenuItems(pendingCollab, pendingsMenuItemsRegistry, pendingCollab.getLongName()));
+ getView().addPending(
+ pendingCollab,
+ avatar,
+ pendingCollab.getCompoundName(),
+ "",
+ createMenuItems(pendingCollab, pendingsMenuItemsRegistry,
+ pendingCollab.getCompoundName()));
}
} else {
getView().setPendingVisible(false, false);
Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -84,7 +84,7 @@
@Override
public void addParticipation(final GroupDTO group, final String avatarUrl, final String tooltip,
final String tooltipTitle, final GuiActionDescCollection menu) {
- sndCategoryFlow.add(createThumb(group.getShortName(), avatarUrl, tooltip, tooltipTitle, menu));
+ sndCategoryFlow.add(createThumb(group.getCompoundName(), avatarUrl, tooltip, tooltipTitle, menu));
}
@Override
Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -27,8 +27,8 @@
import cc.kune.core.client.events.SocialNetworkChangedEvent;
import cc.kune.core.client.events.StateChangedEvent;
import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
import cc.kune.core.client.events.UserSignOutEvent;
-import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.sn.UserSNPresenter.UserSNProxy;
@@ -179,8 +179,8 @@
final List<UserSimpleDTO> buddies = userBuddiesData.getBuddies();
for (final UserSimpleDTO user : buddies) {
final String avatarUrl = downloadProvider.get().getUserAvatar(user);
- getView().addBuddie(user, avatarUrl, user.getName(), "",
- createMenuItems(user, userMenuItemsRegistry, user.getName()));
+ getView().addBuddie(user, avatarUrl, user.getCompoundName(), "",
+ createMenuItems(user, userMenuItemsRegistry, user.getCompoundName()));
}
final boolean hasLocalBuddies = buddies.size() > 0;
final int numExtBuddies = userBuddiesData.getOtherExtBuddies();
@@ -211,12 +211,12 @@
final int numAdmins = groupsIsAdmin.size();
final int numCollaborators = groupsIsCollab.size();
for (final GroupDTO group : groupsIsAdmin) {
- getView().addParticipation(group, getAvatar(group), group.getLongName(), "",
- createMenuItems(group, userMenuItemsRegistry, group.getLongName()));
+ getView().addParticipation(group, getAvatar(group), group.getCompoundName(), "",
+ createMenuItems(group, userMenuItemsRegistry, group.getCompoundName()));
}
for (final GroupDTO group : groupsIsCollab) {
- getView().addParticipation(group, getAvatar(group), group.getLongName(), "",
- createMenuItems(group, userMenuItemsRegistry, group.getLongName()));
+ getView().addParticipation(group, getAvatar(group), group.getCompoundName(), "",
+ createMenuItems(group, userMenuItemsRegistry, group.getCompoundName()));
}
final int totalGroups = numAdmins + numCollaborators;
// getView().setParticipationCount(totalGroups);
Modified: trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -28,6 +28,7 @@
AdmissionType admissionType;
private String backgroundImage;
+ private String compoundName;
private Long createdOn;
private ContentSimpleDTO defaultContent;
private LicenseDTO defaultLicense;
@@ -79,6 +80,13 @@
return backgroundImage;
}
+ public String getCompoundName() {
+ if (compoundName == null) {
+ compoundName = !longName.equals(shortName) ? longName + " (" + shortName + ")" : shortName;
+ }
+ return compoundName;
+ }
+
public Long getCreatedOn() {
return createdOn;
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/UserSimpleDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/UserSimpleDTO.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/core/shared/dto/UserSimpleDTO.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -25,6 +25,7 @@
import com.google.gwt.user.client.rpc.IsSerializable;
public class UserSimpleDTO implements IsSerializable {
+ private String compoundName;
private I18nCountryDTO country;
private EmailNotificationFrequency emailNotifFreq;
private boolean emailVerified;
@@ -47,6 +48,7 @@
this.language = language;
this.country = country;
this.timezone = timezone;
+
}
@Override
@@ -78,6 +80,13 @@
return true;
}
+ public String getCompoundName() {
+ if (compoundName == null) {
+ compoundName = !name.equals(shortName) ? name + " (" + shortName + ")" : shortName;
+ }
+ return compoundName;
+ }
+
public I18nCountryDTO getCountry() {
return country;
}
Modified: trunk/src/main/java/cc/kune/events/client/actions/CalendarRolAction.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/CalendarRolAction.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/events/client/actions/CalendarRolAction.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -23,7 +23,7 @@
public void onCalendarStateChange(final CalendarStateChangeEvent event) {
// if the calendar is not selecting a appointment don't show this
final AccessRights rights = session.getContainerState().getContainerRights();
- final boolean isEnabled = RolComparator.isEnabled(AccessRolDTO.Editor, rights);
+ final boolean isEnabled = RolComparator.isEnabled(rolRequired, rights);
final boolean isMember = RolComparator.isMember(rights);
final boolean isOnApp = !calendar.get().getAppToEdit().equals(CalendarViewer.NO_APPOINT);
final boolean newEnabled = isMember && isEnabled && (!onlyOnApp || isOnApp);
Deleted: trunk/src/main/java/cc/kune/events/client/actions/EventEditMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventEditMenuItem.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventEditMenuItem.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -1,45 +0,0 @@
-package cc.kune.events.client.actions;
-
-import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
-import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.client.state.AccessRightsClientManager;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.events.client.viewer.CalendarViewer;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-
- at Singleton
-public class EventEditMenuItem extends MenuItemDescriptor {
- public static class EventEditAction extends CalendarRolAction {
- private final Provider<CalendarViewer> calendar;
- private final StateManager stateManager;
-
- @Inject
- public EventEditAction(final NavResources res, final I18nTranslationService i18n,
- final Provider<CalendarViewer> calendar, final EventBus eventBus,
- final StateManager stateManager, final Session session, final AccessRightsClientManager rightsMan) {
- super(eventBus, session, calendar, AccessRolDTO.Editor, true, true);
- this.calendar = calendar;
- this.stateManager = stateManager;
- withText(i18n.t("Edit the appointment")).withIcon(res.go());
- }
-
- @Override
- public void actionPerformed(final ActionEvent event) {
- stateManager.gotoHistoryToken(calendar.get().getAppToEdit().getId());
- }
- }
-
- @Inject
- public EventEditMenuItem(final EventEditAction action, final CalendarOnOverMenu cal) {
- super(action);
- setParent(cal.get());
- }
-}
Copied: trunk/src/main/java/cc/kune/events/client/actions/EventOpenMenuItem.java (from rev 1694, trunk/src/main/java/cc/kune/events/client/actions/EventEditMenuItem.java)
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventOpenMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventOpenMenuItem.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -0,0 +1,45 @@
+package cc.kune.events.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.client.state.AccessRightsClientManager;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.events.client.viewer.CalendarViewer;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class EventOpenMenuItem extends MenuItemDescriptor {
+ public static class EventEditAction extends CalendarRolAction {
+ private final Provider<CalendarViewer> calendar;
+ private final StateManager stateManager;
+
+ @Inject
+ public EventEditAction(final NavResources res, final I18nTranslationService i18n,
+ final Provider<CalendarViewer> calendar, final EventBus eventBus,
+ final StateManager stateManager, final Session session, final AccessRightsClientManager rightsMan) {
+ super(eventBus, session, calendar, AccessRolDTO.Viewer, false, true);
+ this.calendar = calendar;
+ this.stateManager = stateManager;
+ withText(i18n.t("Open the appointment")).withIcon(res.go());
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ stateManager.gotoHistoryToken(calendar.get().getAppToEdit().getId());
+ }
+ }
+
+ @Inject
+ public EventOpenMenuItem(final EventEditAction action, final CalendarOnOverMenu cal) {
+ super(action);
+ setParent(cal.get());
+ }
+}
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-02-22 15:27:06 UTC (rev 1695)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-02-22 19:41:12 UTC (rev 1696)
@@ -55,7 +55,7 @@
final Provider<CalendarMonthViewSelectBtn> calMonthBtn,
final Provider<EventAddMenuItem> eventAddMenuItem,
final Provider<EventRemoveMenuItem> eventRemoveMenuItem,
- final Provider<EventEditMenuItem> eventEditMenuItem, final Provider<CalendarGoPrevBtn> calPrevBtn,
+ final Provider<EventOpenMenuItem> eventOpenMenuItem, final Provider<CalendarGoPrevBtn> calPrevBtn,
final Provider<CalendarGoNextBtn> calNextBtn, final CalendarOnOverMenu onOverMenu,
final Provider<CalendarGoTodayBtn> goToday, final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
@@ -74,15 +74,8 @@
// On over calendar menu
actionsRegistry.addAction(ActionGroups.TOOLBAR, onOverMenu, containers);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, eventAddMenuItem,
- // containers);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, eventEditMenuItem,
- // containers);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, eventRemoveMenuItem,
- // containers);
-
eventAddMenuItem.get();
- eventEditMenuItem.get();
+ eventOpenMenuItem.get();
eventRemoveMenuItem.get();
// For now, commented:
More information about the kune-commits
mailing list