kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
August 2008
- 1 participants
- 21 discussions
07 Aug '08
Author: vjrj
Date: 2008-08-07 14:07:05 +0200 (Thu, 07 Aug 2008)
New Revision: 833
Added:
trunk/src/main/java/org/ourproject/kune/platf/server/auth/GroupAuthorizated.java
trunk/src/main/java/org/ourproject/kune/platf/server/auth/GroupAuthorizatedMethodInterceptor.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessRightsService.java
trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessRightsServiceDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessServiceDefault.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/SocialNetworkManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
Log:
Group authorization annotation for check authRights in methods
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-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -501,7 +501,7 @@
public GroupMembersSummary create() {
final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n,
$(StateManager.class), $(ImageUtils.class), $(Session.class),
- $$(SocialNetworkServiceAsync.class), $$(UserLiveSearcher.class), $(WsThemePresenter.class));
+ $$(SocialNetworkServiceAsync.class), $$(GroupLiveSearcher.class), $(WsThemePresenter.class));
final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2008-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -31,6 +31,8 @@
import org.ourproject.kune.platf.client.rpc.SiteService;
import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.server.access.AccessRightsService;
+import org.ourproject.kune.platf.server.access.AccessRightsServiceDefault;
import org.ourproject.kune.platf.server.access.AccessService;
import org.ourproject.kune.platf.server.access.AccessServiceDefault;
import org.ourproject.kune.platf.server.access.FinderService;
@@ -39,6 +41,8 @@
import org.ourproject.kune.platf.server.auth.AuthenticatedMethodInterceptor;
import org.ourproject.kune.platf.server.auth.Authorizated;
import org.ourproject.kune.platf.server.auth.AuthorizatedMethodInterceptor;
+import org.ourproject.kune.platf.server.auth.GroupAuthorizated;
+import org.ourproject.kune.platf.server.auth.GroupAuthorizatedMethodInterceptor;
import org.ourproject.kune.platf.server.auth.SessionService;
import org.ourproject.kune.platf.server.auth.SessionServiceDefault;
import org.ourproject.kune.platf.server.content.CommentManager;
@@ -94,55 +98,58 @@
public class PlatformServerModule extends AbstractExtendedModule {
@Override
protected void configure() {
- install(PersistenceService.usingJpa().across(UnitOfWork.TRANSACTION).buildModule());
- bind(KunePersistenceService.class);
+ install(PersistenceService.usingJpa().across(UnitOfWork.TRANSACTION).buildModule());
+ bind(KunePersistenceService.class);
- bindManagers();
- bindRPC();
- bindServices();
- bind(KuneProperties.class).to(KunePropertiesDefault.class);
- bind(Mapper.class).to(DozerMapper.class);
- bind(ToolRegistry.class);
+ bindManagers();
+ bindRPC();
+ bindServices();
+ bind(KuneProperties.class).to(KunePropertiesDefault.class);
+ bind(Mapper.class).to(DozerMapper.class);
+ bind(ToolRegistry.class);
- bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authenticated.class),
- outermostCall(new AuthenticatedMethodInterceptor()));
- bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authorizated.class),
- outermostCall(new AuthorizatedMethodInterceptor()));
+ bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authenticated.class),
+ outermostCall(new AuthenticatedMethodInterceptor()));
+ bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authorizated.class),
+ outermostCall(new AuthorizatedMethodInterceptor()));
+ bindInterceptor(Matchers.any(), Matchers.annotatedWith(GroupAuthorizated.class),
+ outermostCall(new GroupAuthorizatedMethodInterceptor()));
}
private void bindManagers() {
- bind(UserManager.class).to(UserManagerDefault.class);
- bind(GroupManager.class).to(GroupManagerDefault.class);
- bind(ContentManager.class).to(ContentManagerDefault.class);
- bind(ToolConfigurationManager.class).to(ToolConfigurationManagerDefault.class);
- bind(ContainerManager.class).to(ContainerManagerDefault.class);
- bind(LicenseManager.class).to(LicenseManagerDefault.class);
- bind(SocialNetworkManager.class).to(SocialNetworkManagerDefault.class);
- bind(XmppManager.class).to(XmppManagerDefault.class);
- bind(RateManager.class).to(RateManagerDefault.class);
- bind(I18nCountryManager.class).to(I18nCountryManagerDefault.class);
- bind(I18nLanguageManager.class).to(I18nLanguageManagerDefault.class);
- bind(I18nTranslationManager.class).to(I18nTranslationManagerDefault.class);
- bind(TagManager.class).to(TagManagerDefault.class);
- bind(CommentManager.class).to(CommentManagerDefault.class);
+ bind(UserManager.class).to(UserManagerDefault.class);
+ bind(GroupManager.class).to(GroupManagerDefault.class);
+ bind(ContentManager.class).to(ContentManagerDefault.class);
+ bind(ToolConfigurationManager.class).to(ToolConfigurationManagerDefault.class);
+ bind(ContainerManager.class).to(ContainerManagerDefault.class);
+ bind(LicenseManager.class).to(LicenseManagerDefault.class);
+ bind(SocialNetworkManager.class).to(SocialNetworkManagerDefault.class);
+ bind(XmppManager.class).to(XmppManagerDefault.class);
+ bind(RateManager.class).to(RateManagerDefault.class);
+ bind(I18nCountryManager.class).to(I18nCountryManagerDefault.class);
+ bind(I18nLanguageManager.class).to(I18nLanguageManagerDefault.class);
+ bind(I18nTranslationManager.class).to(I18nTranslationManagerDefault.class);
+ bind(TagManager.class).to(TagManagerDefault.class);
+ bind(CommentManager.class).to(CommentManagerDefault.class);
}
private void bindRPC() {
- bind(SiteService.class).to(SiteRPC.class);
- bind(GroupService.class).to(GroupRPC.class);
- bind(ContentService.class).to(ContentRPC.class);
- bind(UserService.class).to(UserRPC.class);
- bind(SocialNetworkService.class).to(SocialNetworkRPC.class);
- bind(I18nService.class).to(I18nRPC.class);
+ bind(SiteService.class).to(SiteRPC.class);
+ bind(GroupService.class).to(GroupRPC.class);
+ bind(ContentService.class).to(ContentRPC.class);
+ bind(UserService.class).to(UserRPC.class);
+ bind(SocialNetworkService.class).to(SocialNetworkRPC.class);
+ bind(I18nService.class).to(I18nRPC.class);
}
private void bindServices() {
- bind(UserInfoService.class).to(UserInfoServiceDefault.class);
- bind(CreationService.class).to(CreationServiceDefault.class);
- bind(AccessService.class).to(AccessServiceDefault.class);
- bind(FinderService.class).to(FinderServiceDefault.class);
- bind(StateService.class).to(StateServiceDefault.class);
- bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
- bind(SessionService.class).to(SessionServiceDefault.class);
+ bind(UserInfoService.class).to(UserInfoServiceDefault.class);
+ bind(CreationService.class).to(CreationServiceDefault.class);
+ bind(AccessRightsService.class).to(AccessRightsServiceDefault.class);
+ bind(AccessService.class).to(AccessServiceDefault.class);
+ bind(FinderService.class).to(FinderServiceDefault.class);
+ bind(StateService.class).to(StateServiceDefault.class);
+ bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
+ bind(SessionService.class).to(SessionServiceDefault.class);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessRightsService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessRightsService.java 2008-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessRightsService.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -23,7 +23,7 @@
import org.ourproject.kune.platf.server.domain.AccessLists;
import org.ourproject.kune.platf.server.domain.User;
-interface AccessRightsService {
+public interface AccessRightsService {
public AccessRights get(User user, AccessLists lists);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessRightsServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessRightsServiceDefault.java 2008-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessRightsServiceDefault.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -29,52 +29,55 @@
import org.ourproject.kune.platf.server.domain.SocialNetwork;
import org.ourproject.kune.platf.server.domain.User;
+import com.google.inject.Singleton;
+
+@Singleton
public class AccessRightsServiceDefault implements AccessRightsService {
// TODO: check performance
- public AccessRights get(final User user, final AccessLists lists) {
- return get(user.getUserGroup(), lists);
- }
-
public AccessRights get(final Group userGroup, final AccessLists accessList) {
- boolean isAdministrable = false;
- boolean isEditable = false;
- boolean isVisible = false;
+ boolean isAdministrable = false;
+ boolean isEditable = false;
+ boolean isVisible = false;
- // FIXME, future: admin users can admin, edit, view everything
- // (not now while we are doing tests)
- isVisible = isEditable = isAdministrable = canAccess(userGroup, accessList, AccessRol.Administrator);
- if (!isEditable) {
- isVisible = isEditable = canAccess(userGroup, accessList, AccessRol.Editor);
- }
- if (!isVisible) {
- isVisible = accessList.getViewers().isEmpty() || canAccess(userGroup, accessList, AccessRol.Viewer);
- }
+ // FIXME, future: admin users can admin, edit, view everything
+ // (not now while we are doing tests)
+ isVisible = isEditable = isAdministrable = canAccess(userGroup, accessList, AccessRol.Administrator);
+ if (!isEditable) {
+ isVisible = isEditable = canAccess(userGroup, accessList, AccessRol.Editor);
+ }
+ if (!isVisible) {
+ isVisible = accessList.getViewers().isEmpty() || canAccess(userGroup, accessList, AccessRol.Viewer);
+ }
- return new AccessRights(isAdministrable, isEditable, isVisible);
+ return new AccessRights(isAdministrable, isEditable, isVisible);
}
+ public AccessRights get(final User user, final AccessLists lists) {
+ return get(user.getUserGroup(), lists);
+ }
+
private boolean canAccess(final Group searchedGroup, final AccessLists lists, final AccessRol rol) {
- GroupList list = lists.getList(rol);
- return depthFirstSearch(new HashSet<Group>(), searchedGroup, list, rol);
+ final GroupList list = lists.getList(rol);
+ return depthFirstSearch(new HashSet<Group>(), searchedGroup, list, rol);
}
/*
* http://en.wikipedia.org/wiki/Depth-first_search
*/
private boolean depthFirstSearch(final HashSet<Group> visited, final Group searchedGroup, final GroupList list,
- final AccessRol rol) {
- if (list.includes(searchedGroup)) {
- return true;
- }
- ArrayList<Group> noVisitedYet = list.duplicate();
- noVisitedYet.removeAll(visited);
- for (Group group : noVisitedYet) {
- visited.add(group);
- SocialNetwork socialNetwork = group.getSocialNetwork();
- GroupList groupList = socialNetwork.getAccessLists().getList(rol);
- return depthFirstSearch(visited, searchedGroup, groupList, rol);
- }
- return false;
+ final AccessRol rol) {
+ if (list.includes(searchedGroup)) {
+ return true;
+ }
+ final ArrayList<Group> noVisitedYet = list.duplicate();
+ noVisitedYet.removeAll(visited);
+ for (final Group group : noVisitedYet) {
+ visited.add(group);
+ final SocialNetwork socialNetwork = group.getSocialNetwork();
+ final GroupList groupList = socialNetwork.getAccessLists().getList(rol);
+ return depthFirstSearch(visited, searchedGroup, groupList, rol);
+ }
+ return false;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessServiceDefault.java 2008-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/access/AccessServiceDefault.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -41,6 +41,7 @@
private final AccessRightsService accessRightsService;
private final Group groupFinder;
+ @Inject
public AccessServiceDefault(final FinderService finder, final AccessRightsService accessRightsService,
final Group groupFinder) {
this.finder = finder;
@@ -48,11 +49,6 @@
this.groupFinder = groupFinder;
}
- @Inject
- public AccessServiceDefault(final FinderService finder, final Group groupFinder) {
- this(finder, new AccessRightsServiceDefault(), groupFinder);
- }
-
public Content accessToContent(final Long contentId, final User user, final AccessType accessType)
throws DefaultException {
final Content descriptor = finder.getContent(contentId);
Added: trunk/src/main/java/org/ourproject/kune/platf/server/auth/GroupAuthorizated.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/auth/GroupAuthorizated.java 2008-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/auth/GroupAuthorizated.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -0,0 +1,24 @@
+package org.ourproject.kune.platf.server.auth;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import org.ourproject.kune.platf.server.access.AccessType;
+
+import com.google.inject.BindingAnnotation;
+
+/**
+ * Use in RPC methods, for instance: <code>
+ * GroupAuthorizated(authLevelRequired = AuthLevelRequired.COLLAB) </code>
+ *
+ * The first parameter in the method must be the userHash, the second the group
+ * shortName
+ *
+ */
+@BindingAnnotation
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface GroupAuthorizated {
+
+ AccessType accessTypeRequired() default AccessType.READ;
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/server/auth/GroupAuthorizatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/auth/GroupAuthorizatedMethodInterceptor.java 2008-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/auth/GroupAuthorizatedMethodInterceptor.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -0,0 +1,89 @@
+/*
+ *
+ * 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.platf.server.auth;
+
+import javax.persistence.NoResultException;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+import org.ourproject.kune.platf.client.errors.AccessViolationException;
+import org.ourproject.kune.platf.server.UserSession;
+import org.ourproject.kune.platf.server.access.AccessRights;
+import org.ourproject.kune.platf.server.access.AccessRightsService;
+import org.ourproject.kune.platf.server.access.AccessType;
+import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.User;
+import org.ourproject.kune.platf.server.manager.GroupManager;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GroupAuthorizatedMethodInterceptor implements MethodInterceptor {
+
+ @Inject
+ Provider<UserSession> userSessionProvider;
+ @Inject
+ Provider<GroupManager> groupManagerProvider;
+ @Inject
+ Provider<AccessRightsService> accessRightsServiceProvider;
+
+ public Object invoke(final MethodInvocation invocation) throws Throwable {
+ final Object[] arguments = invocation.getArguments();
+ final String groupShortName = (String) arguments[1];
+
+ final UserSession userSession = userSessionProvider.get();
+ final GroupManager groupManager = groupManagerProvider.get();
+
+ final GroupAuthorizated authoAnnotation = invocation.getStaticPart().getAnnotation(GroupAuthorizated.class);
+ final AccessType accessType = authoAnnotation.accessTypeRequired();
+
+ final User user = userSession.getUser();
+
+ Group group = Group.NO_GROUP;
+ try {
+ group = groupManager.findByShortName(groupShortName);
+ } catch (final NoResultException e) {
+ throw new AccessViolationException();
+ }
+
+ if (!correctMember(user, group, accessType)) {
+ throw new AccessViolationException();
+ }
+
+ final Object result = invocation.proceed();
+ return result;
+ }
+
+ private boolean correctMember(final User user, final Group group, final AccessType memberType)
+ throws AccessViolationException {
+ final AccessRightsService accessRightsService = accessRightsServiceProvider.get();
+ final AccessRights accessRights = accessRightsService.get(user, group.getSocialNetwork().getAccessLists());
+
+ switch (memberType) {
+ case ADMIN:
+ return accessRights.isAdministrable();
+ case EDIT:
+ return accessRights.isEditable();
+ default:
+ return accessRights.isVisible();
+ }
+ }
+
+}
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-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -64,135 +64,131 @@
@Inject
public GroupManagerDefault(final Provider<EntityManager> provider, final Group finder, final User userFinder,
- final KuneProperties kuneProperties, final DatabaseProperties properties, final ToolRegistry registry,
- final License licenseFinder) {
- super(provider, Group.class);
- this.finder = finder;
- this.userFinder = userFinder;
- this.kuneProperties = kuneProperties;
- this.properties = properties;
- this.registry = registry;
- this.licenseFinder = licenseFinder;
+ final KuneProperties kuneProperties, final DatabaseProperties properties, final ToolRegistry registry,
+ final License licenseFinder) {
+ super(provider, Group.class);
+ this.finder = finder;
+ this.userFinder = userFinder;
+ this.kuneProperties = kuneProperties;
+ this.properties = properties;
+ this.registry = registry;
+ this.licenseFinder = licenseFinder;
}
- public Group getDefaultGroup() {
- final String shortName = properties.getDefaultSiteShortName();
- return findByShortName(shortName);
+ public void changeWsTheme(final User user, final Group group, final String theme) throws AccessViolationException {
+ // TODO: check theme
+ group.setWorkspaceTheme(theme);
}
- public Group findByShortName(final String shortName) {
- return finder.findByShortName(shortName);
+ public Group createGroup(final Group group, final User user) throws GroupNameInUseException,
+ UserMustBeLoggedException {
+ final String defaultSiteWorkspaceTheme = kuneProperties.get(KuneProperties.WS_THEMES_DEF);
+ if (User.isKnownUser(user)) {
+ if (group.getType().equals(GroupType.COMMUNITY)) {
+ group.setAdmissionType(AdmissionType.Open);
+ } else if (group.getType().equals(GroupType.ORGANIZATION)) {
+ group.setAdmissionType(AdmissionType.Moderated);
+ } else if (group.getType().equals(GroupType.PROJECT)) {
+ group.setAdmissionType(AdmissionType.Moderated);
+ } else if (group.getType().equals(GroupType.ORPHANED_PROJECT)) {
+ group.setAdmissionType(AdmissionType.Open);
+ }
+ final String licName = group.getDefaultLicense().getShortName();
+ final License license = licenseFinder.findByShortName(licName);
+ group.setDefaultLicense(license);
+ group.setWorkspaceTheme(defaultSiteWorkspaceTheme);
+ initSocialNetwork(group, user.getUserGroup());
+ initGroup(user, group);
+ return group;
+ } else {
+ throw new UserMustBeLoggedException();
+ }
+
}
- public List<Group> findAdminInGroups(final Long groupId) {
- return finder.findAdminInGroups(groupId);
+ public Group createUserGroup(final User user) throws GroupNameInUseException, EmailAddressInUseException {
+ final String defaultSiteWorkspaceTheme = kuneProperties.get(KuneProperties.WS_THEMES_DEF);
+ final String licenseDefId = properties.getDefaultLicense();
+ final License licenseDef = licenseFinder.findByShortName(licenseDefId);
+ final Group group = new Group(user.getShortName(), user.getName(), licenseDef, GroupType.PERSONAL);
+ User userSameEmail = null;
+ try {
+ userSameEmail = userFinder.getByEmail(user.getEmail());
+ } catch (final NoResultException e) {
+ // Ok, no more with this email
+ }
+ if (userSameEmail != null) {
+ throw new EmailAddressInUseException();
+ }
+ group.setAdmissionType(AdmissionType.Closed);
+ group.setWorkspaceTheme(defaultSiteWorkspaceTheme);
+ user.setUserGroup(group);
+ initSocialNetwork(group, group);
+ try {
+ initGroup(user, group);
+ super.persist(user, User.class);
+ } catch (final EntityExistsException e) {
+ throw new GroupNameInUseException();
+ }
+ return group;
}
- public List<Group> findCollabInGroups(final Long groupId) {
- return finder.findCollabInGroups(groupId);
+ public List<Group> findAdminInGroups(final Long groupId) {
+ return finder.findAdminInGroups(groupId);
}
- public Group createUserGroup(final User user) throws GroupNameInUseException, EmailAddressInUseException {
- String defaultSiteWorkspaceTheme = kuneProperties.get(KuneProperties.WS_THEMES_DEF);
- final String licenseDefId = properties.getDefaultLicense();
- final License licenseDef = licenseFinder.findByShortName(licenseDefId);
- final Group group = new Group(user.getShortName(), user.getName(), licenseDef, GroupType.PERSONAL);
- User userSameEmail = null;
- try {
- userSameEmail = userFinder.getByEmail(user.getEmail());
- } catch (NoResultException e) {
- // Ok, no more with this email
- }
- if (userSameEmail != null) {
- throw new EmailAddressInUseException();
- }
- group.setAdmissionType(AdmissionType.Closed);
- group.setWorkspaceTheme(defaultSiteWorkspaceTheme);
- user.setUserGroup(group);
- initSocialNetwork(group, group);
- try {
- initGroup(user, group);
- super.persist(user, User.class);
- } catch (final EntityExistsException e) {
- throw new GroupNameInUseException();
- }
- return group;
+ public Group findByShortName(final String shortName) {
+ return finder.findByShortName(shortName);
}
- public Group createGroup(final Group group, final User user) throws GroupNameInUseException,
- UserMustBeLoggedException {
- String defaultSiteWorkspaceTheme = kuneProperties.get(KuneProperties.WS_THEMES_DEF);
- if (User.isKnownUser(user)) {
- if (group.getType().equals(GroupType.COMMUNITY)) {
- group.setAdmissionType(AdmissionType.Open);
- } else if (group.getType().equals(GroupType.ORGANIZATION)) {
- group.setAdmissionType(AdmissionType.Moderated);
- } else if (group.getType().equals(GroupType.PROJECT)) {
- group.setAdmissionType(AdmissionType.Moderated);
- } else if (group.getType().equals(GroupType.ORPHANED_PROJECT)) {
- group.setAdmissionType(AdmissionType.Open);
- }
- String licName = group.getDefaultLicense().getShortName();
- License license = licenseFinder.findByShortName(licName);
- group.setDefaultLicense(license);
- group.setWorkspaceTheme(defaultSiteWorkspaceTheme);
- initSocialNetwork(group, user.getUserGroup());
- initGroup(user, group);
- return group;
- } else {
- throw new UserMustBeLoggedException();
- }
-
+ public List<Group> findCollabInGroups(final Long groupId) {
+ return finder.findCollabInGroups(groupId);
}
- public void changeWsTheme(final User user, final Group group, final String theme) throws AccessViolationException {
- if (group.getSocialNetwork().isAdmin(user.getUserGroup())) {
- group.setWorkspaceTheme(theme);
- // Check themes...
- } else {
- throw new AccessViolationException();
- }
+ public Group getDefaultGroup() {
+ final String shortName = properties.getDefaultSiteShortName();
+ return findByShortName(shortName);
}
public Group getGroupOfUserWithId(final Long userId) {
- return userId != null ? find(User.class, userId).getUserGroup() : null;
+ return userId != null ? find(User.class, userId).getUserGroup() : null;
}
public SearchResult<Group> search(final String search) {
- return this.search(search, null, null);
+ return this.search(search, null, null);
}
public SearchResult<Group> search(final String search, final Integer firstResult, final Integer maxResults) {
- MultiFieldQueryParser parser = new MultiFieldQueryParser(
- new String[] { "longName", "shortName", "publicDesc" }, new StandardAnalyzer());
- Query query;
- try {
- query = parser.parse(search);
- } catch (ParseException e) {
- throw new RuntimeException("Error parsing search");
- }
- return super.search(query, firstResult, maxResults);
+ final MultiFieldQueryParser parser = new MultiFieldQueryParser(new String[] { "longName", "shortName",
+ "publicDesc" }, new StandardAnalyzer());
+ Query query;
+ try {
+ query = parser.parse(search);
+ } catch (final ParseException e) {
+ throw new RuntimeException("Error parsing search");
+ }
+ return super.search(query, firstResult, maxResults);
}
- private void initSocialNetwork(final Group group, final Group userGroup) {
- final SocialNetwork network = group.getSocialNetwork();
- final AccessLists lists = network.getAccessLists();
- lists.getEditors().setMode(GroupListMode.NOBODY);
- lists.getViewers().setMode(GroupListMode.EVERYONE);
- if (!group.getType().equals(GroupType.ORPHANED_PROJECT)) {
- network.addAdmin(userGroup);
- }
+ private void initGroup(final User user, final Group group) throws GroupNameInUseException {
+ try {
+ persist(group);
+ } catch (final EntityExistsException e) {
+ throw new GroupNameInUseException();
+ }
+ for (final ServerTool tool : registry.all()) {
+ tool.initGroup(user, group);
+ }
}
- private void initGroup(final User user, final Group group) throws GroupNameInUseException {
- try {
- persist(group);
- } catch (final EntityExistsException e) {
- throw new GroupNameInUseException();
- }
- for (final ServerTool tool : registry.all()) {
- tool.initGroup(user, group);
- }
+ private void initSocialNetwork(final Group group, final Group userGroup) {
+ final SocialNetwork network = group.getSocialNetwork();
+ final AccessLists lists = network.getAccessLists();
+ lists.getEditors().setMode(GroupListMode.NOBODY);
+ lists.getViewers().setMode(GroupListMode.EVERYONE);
+ if (!group.getType().equals(GroupType.ORPHANED_PROJECT)) {
+ network.addAdmin(userGroup);
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java 2008-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -34,6 +34,7 @@
import org.ourproject.kune.platf.client.errors.LastAdminInGroupException;
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
import org.ourproject.kune.platf.server.ParticipationData;
+import org.ourproject.kune.platf.server.access.AccessRightsService;
import org.ourproject.kune.platf.server.domain.AdmissionType;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.GroupListMode;
@@ -51,11 +52,14 @@
public class SocialNetworkManagerDefault extends DefaultManager<SocialNetwork, Long> implements SocialNetworkManager {
private final Group finder;
+ private final AccessRightsService accessRightsService;
@Inject
- public SocialNetworkManagerDefault(final Provider<EntityManager> provider, final Group finder) {
+ public SocialNetworkManagerDefault(final Provider<EntityManager> provider, final Group finder,
+ final AccessRightsService accessRightsService) {
super(provider, SocialNetwork.class);
this.finder = finder;
+ this.accessRightsService = accessRightsService;
}
public void acceptJoinGroup(final User userLogged, final Group group, final Group inGroup) throws DefaultException,
@@ -252,7 +256,7 @@
}
private void checkUserLoggedIsAdmin(final User userLogged, final SocialNetwork sn) throws AccessViolationException {
- if (!sn.isAdmin(userLogged.getUserGroup())) {
+ if (!accessRightsService.get(userLogged, sn.getAccessLists()).isAdministrable()) {
throw new AccessViolationException();
}
}
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-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -29,7 +29,7 @@
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.access.AccessType;
import org.ourproject.kune.platf.server.auth.Authenticated;
-import org.ourproject.kune.platf.server.auth.Authorizated;
+import org.ourproject.kune.platf.server.auth.GroupAuthorizated;
import org.ourproject.kune.platf.server.content.ContentManager;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.User;
@@ -60,7 +60,7 @@
}
@Authenticated
- @Authorizated(accessTypeRequired = AccessType.ADMIN)
+ @GroupAuthorizated(accessTypeRequired = AccessType.ADMIN)
@Transactional(type = TransactionType.READ_WRITE, rollbackOn = DefaultException.class)
public void changeGroupWsTheme(final String userHash, final String groupShortName, final String theme)
throws DefaultException {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java 2008-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -27,7 +27,7 @@
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.access.AccessType;
import org.ourproject.kune.platf.server.auth.Authenticated;
-import org.ourproject.kune.platf.server.auth.Authorizated;
+import org.ourproject.kune.platf.server.auth.GroupAuthorizated;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.GroupManager;
@@ -58,7 +58,7 @@
}
@Authenticated
- @Authorizated(accessTypeRequired = AccessType.ADMIN)
+ @GroupAuthorizated(accessTypeRequired = AccessType.ADMIN)
@Transactional(type = TransactionType.READ_WRITE)
public SocialNetworkResultDTO AcceptJoinGroup(final String hash, final String groupShortName,
final String groupToAcceptShortName) throws DefaultException {
@@ -71,7 +71,7 @@
}
@Authenticated
- @Authorizated(accessTypeRequired = AccessType.ADMIN)
+ @GroupAuthorizated(accessTypeRequired = AccessType.ADMIN)
@Transactional(type = TransactionType.READ_WRITE)
public SocialNetworkResultDTO addAdminMember(final String hash, final String groupShortName,
final String groupToAddShortName) throws DefaultException {
@@ -84,7 +84,7 @@
}
@Authenticated
- @Authorizated(accessTypeRequired = AccessType.ADMIN)
+ @GroupAuthorizated(accessTypeRequired = AccessType.ADMIN)
@Transactional(type = TransactionType.READ_WRITE)
public SocialNetworkResultDTO addCollabMember(final String hash, final String groupShortName,
final String groupToAddShortName) throws DefaultException {
@@ -97,7 +97,7 @@
}
@Authenticated
- @Authorizated(accessTypeRequired = AccessType.ADMIN)
+ @GroupAuthorizated(accessTypeRequired = AccessType.ADMIN)
@Transactional(type = TransactionType.READ_WRITE)
public SocialNetworkResultDTO addViewerMember(final String hash, final String groupShortName,
final String groupToAddShortName) throws DefaultException {
@@ -110,7 +110,7 @@
}
@Authenticated
- @Authorizated(accessTypeRequired = AccessType.ADMIN)
+ @GroupAuthorizated(accessTypeRequired = AccessType.ADMIN)
@Transactional(type = TransactionType.READ_WRITE)
public SocialNetworkResultDTO deleteMember(final String hash, final String groupShortName,
final String groupToDeleleShortName) throws DefaultException {
@@ -123,7 +123,7 @@
}
@Authenticated
- @Authorizated(accessTypeRequired = AccessType.ADMIN)
+ @GroupAuthorizated(accessTypeRequired = AccessType.ADMIN)
@Transactional(type = TransactionType.READ_WRITE)
public SocialNetworkResultDTO denyJoinGroup(final String hash, final String groupShortName,
final String groupToDenyShortName) throws DefaultException {
@@ -137,7 +137,7 @@
@Authenticated(mandatory = false)
// At least you can access as Viewer to the Group
- @Authorizated(accessTypeRequired = AccessType.READ)
+ @GroupAuthorizated(accessTypeRequired = AccessType.READ)
@Transactional(type = TransactionType.READ_ONLY)
public SocialNetworkDTO getGroupMembers(final String hash, final String groupShortName) throws DefaultException {
final UserSession userSession = getUserSession();
@@ -148,7 +148,7 @@
@Authenticated(mandatory = false)
// At least you can access as Viewer to the Group
- @Authorizated(accessTypeRequired = AccessType.READ)
+ @GroupAuthorizated(accessTypeRequired = AccessType.READ)
@Transactional(type = TransactionType.READ_ONLY)
public ParticipationDataDTO getParticipation(final String hash, final String groupShortName)
throws DefaultException {
@@ -168,7 +168,7 @@
}
@Authenticated
- @Authorizated(accessTypeRequired = AccessType.ADMIN)
+ @GroupAuthorizated(accessTypeRequired = AccessType.ADMIN)
@Transactional(type = TransactionType.READ_WRITE)
public SocialNetworkResultDTO setAdminAsCollab(final String hash, final String groupShortName,
final String groupToSetCollabShortName) throws DefaultException {
@@ -181,7 +181,7 @@
}
@Authenticated
- @Authorizated(accessTypeRequired = AccessType.ADMIN)
+ @GroupAuthorizated(accessTypeRequired = AccessType.ADMIN)
@Transactional(type = TransactionType.READ_WRITE)
public SocialNetworkResultDTO setCollabAsAdmin(final String hash, final String groupShortName,
final String groupToSetAdminShortName) throws DefaultException {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-06 04:21:36 UTC (rev 832)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-07 12:07:05 UTC (rev 833)
@@ -18,7 +18,7 @@
import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.search.UserLiveSearcher;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
@@ -42,7 +42,7 @@
public GroupMembersSummaryPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
final ImageUtils imageUtils, final Session session,
final Provider<SocialNetworkServiceAsync> snServiceProvider,
- final Provider<UserLiveSearcher> userLiveSearcherProvider, final WsThemePresenter wsThemePresenter) {
+ final Provider<GroupLiveSearcher> liveSearcherProvider, final WsThemePresenter wsThemePresenter) {
super(i18n, stateManager, imageUtils, session, snServiceProvider);
this.i18n = i18n;
this.stateManager = stateManager;
@@ -73,12 +73,12 @@
addMember = new GridButton("images/add-green.gif", "", i18n
.t("Add a group or a person as member of this group"), new Slot<String>() {
public void onEvent(final String parameter) {
- userLiveSearcherProvider.get().onSelection(new Slot<LinkDTO>() {
+ liveSearcherProvider.get().onSelection(new Slot<LinkDTO>() {
public void onEvent(final LinkDTO link) {
view.confirmAddCollab(link.getShortName(), link.getLongName());
}
});
- userLiveSearcherProvider.get().show();
+ liveSearcherProvider.get().show();
}
});
super.addGroupOperation(gotoGroupMenuItem, false);
1
0
06 Aug '08
Author: vjrj
Date: 2008-08-06 06:21:36 +0200 (Wed, 06 Aug 2008)
New Revision: 832
Modified:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
Log:
Some adjusts in SN and chat. Search fixed.
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -51,7 +51,7 @@
public ChatContent create() {
final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
final ChatContentPresenter presenter = new ChatContentPresenter($(EmiteUIDialog.class), panel,
- $p(ChatInfo.class), $p(ChatRoom.class));
+ $$(ChatInfo.class), $$(ChatRoom.class));
return presenter;
}
});
@@ -59,7 +59,7 @@
register(SingletonScope.class, new Factory<ChatContext>(ChatContext.class) {
public ChatContext create() {
final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final ChatContextPresenter presenter = new ChatContextPresenter(panel, $p(RoomsAdmin.class));
+ final ChatContextPresenter presenter = new ChatContextPresenter(panel, $$(RoomsAdmin.class));
return presenter;
}
});
@@ -84,8 +84,8 @@
register(SingletonScope.class, new Factory<RoomsAdmin>(RoomsAdmin.class) {
public RoomsAdmin create() {
final RoomsAdminPresenter presenter = new RoomsAdminPresenter($(ContextItems.class),
- $(I18nUITranslationService.class), $p(StateManager.class), $(Session.class),
- $p(ContentServiceAsync.class));
+ $(I18nUITranslationService.class), $$(StateManager.class), $(Session.class),
+ $$(ContentServiceAsync.class));
return presenter;
}
});
@@ -93,8 +93,8 @@
register(SingletonScope.class, new Factory<ChatClientTool>(ChatClientTool.class) {
public ChatClientTool create() {
return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
- $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $p(GroupMembersSummary.class),
- $(ToolSelector.class), $(WsThemePresenter.class), $p(ChatContent.class), $p(ChatContext.class));
+ $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $$(GroupMembersSummary.class),
+ $(ToolSelector.class), $(WsThemePresenter.class), $$(ChatContent.class), $$(ChatContext.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -64,13 +64,18 @@
final ChatOptions chatOptions = new ChatOptions(initData.getChatHttpBase(), initData.getChatDomain(),
initData.getChatRoomHost());
chat = new ChatEngineXmpp(emiteUIDialog, chatOptions, i18n, ws);
- groupMembersSummaryProvider.get().addGroupOperation(
+ groupMembersSummaryProvider.get().addUserOperation(
new MenuItem<GroupDTO>("images/chat-basic.gif", i18n.t("Start a chat with this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
- emiteUIDialog.chat(XmppURI.jid(group.getShortName() + "@"
- + initData.getChatDomain()));
emiteUIDialog.show();
+ if (emiteUIDialog.isLoggedIn()) {
+ emiteUIDialog.chat(XmppURI.jid(group.getShortName() + "@"
+ + initData.getChatDomain()));
+ } else {
+ ws.showAlertMessage(i18n.t("Error"), i18n
+ .t("To start a chat you need to be 'online'."));
+ }
}
}), true);
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -57,9 +57,13 @@
}
public void joinRoom(final String roomName, final String userAlias) {
- final XmppURI roomURI = XmppURI.uri(roomName + "@" + chatOptions.roomHost + "/"
- + chatOptions.userOptions.getUserJid().getNode());
- emiteDialog.joinRoom(roomURI);
+ if (emiteDialog.isLoggedIn()) {
+ final XmppURI roomURI = XmppURI.uri(roomName + "@" + chatOptions.roomHost + "/"
+ + chatOptions.userOptions.getUserJid().getNode());
+ emiteDialog.joinRoom(roomURI);
+ } else {
+ ws.showAlertMessage(i18n.t("Error"), i18n.t("To join a chatroom you need to be 'online'."));
+ }
}
public void login(final String jid, final String passwd) {
@@ -92,6 +96,7 @@
});
ws.getSiteTraybar().addButton(traybarButton);
}
+ emiteDialog.setEnableStatusUI(true);
emiteDialog.hide();
emiteDialog.onChatAttended(new Slot<String>() {
public void onEvent(final String parameter) {
@@ -111,6 +116,7 @@
final UserChatOptions userChatOptions = getUserChatOptions("reset(a)example.com", "");
emiteDialog.refreshUserInfo(userChatOptions);
chatOptions.userOptions = userChatOptions;
+ emiteDialog.setEnableStatusUI(false);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -56,14 +56,14 @@
register(SingletonScope.class, new Factory<DocumentClientTool>(DocumentClientTool.class) {
public DocumentClientTool create() {
return new DocumentClientTool(i18n, $(ToolSelector.class), $(WsThemePresenter.class),
- $(WorkspaceSkeleton.class), $p(DocumentContent.class), $p(DocumentContext.class));
+ $(WorkspaceSkeleton.class), $$(DocumentContent.class), $$(DocumentContext.class));
}
});
register(SingletonScope.class, new Factory<AdminContext>(AdminContext.class) {
public AdminContext create() {
final AdminContextPresenter presenter = new AdminContextPresenter($(Session.class),
- $p(TagsSummary.class));
+ $$(TagsSummary.class));
final AdminContextView view = new AdminContextPanel(presenter, i18n);
presenter.init(view);
return presenter;
@@ -74,16 +74,16 @@
public DocumentContent create() {
final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
final DocumentContentPresenter presenter = new DocumentContentPresenter(panel, $(Session.class),
- $(RateIt.class), $p(DocumentReader.class), $p(DocumentReaderControl.class),
- $p(TextEditor.class), $p(FolderViewer.class), $p(FolderEditor.class));
+ $(RateIt.class), $$(DocumentReader.class), $$(DocumentReaderControl.class),
+ $$(TextEditor.class), $$(FolderViewer.class), $$(FolderEditor.class));
return presenter;
}
});
register(SingletonScope.class, new Factory<DocumentContext>(DocumentContext.class) {
public DocumentContext create() {
final WorkspaceDeckPanel view = new WorkspaceDeckPanel();
- final DocumentContextPresenter presenter = new DocumentContextPresenter(view, $p(FolderContext.class),
- $p(AdminContext.class));
+ final DocumentContextPresenter presenter = new DocumentContextPresenter(view, $$(FolderContext.class),
+ $$(AdminContext.class));
return presenter;
}
});
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-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -157,7 +157,7 @@
register(SingletonScope.class, new Factory<Session>(Session.class) {
public Session create() {
- return new SessionDefault(Cookies.getCookie(Site.USERHASH), $p(UserServiceAsync.class));
+ return new SessionDefault(Cookies.getCookie(Site.USERHASH), $$(UserServiceAsync.class));
}
}, new Factory<I18nServiceAsync>(I18nServiceAsync.class) {
public I18nServiceAsync create() {
@@ -243,7 +243,7 @@
register(SingletonScope.class, new Factory<KuneErrorHandler>(KuneErrorHandler.class) {
public KuneErrorHandler create() {
- return new KuneErrorHandler($(Session.class), i18n, $p(WorkspaceSkeleton.class), $p(StateManager.class));
+ return new KuneErrorHandler($(Session.class), i18n, $$(WorkspaceSkeleton.class), $$(StateManager.class));
}
});
@@ -294,7 +294,7 @@
register(SingletonScope.class, new Factory<SiteProgress>(SiteProgress.class) {
public SiteProgress create() {
final SiteProgressPresenter presenter = new SiteProgressPresenter();
- final SiteProgressPanel panel = new SiteProgressPanel(presenter, $p(SitePublicSpaceLink.class));
+ final SiteProgressPanel panel = new SiteProgressPanel(presenter, $$(SitePublicSpaceLink.class));
presenter.init(panel);
return presenter;
}
@@ -302,7 +302,7 @@
register(SingletonScope.class, new Factory<Site>(Site.class) {
public Site create() {
- return new Site(i18n, $(SiteProgress.class), $p(SiteMessage.class));
+ return new Site(i18n, $(SiteProgress.class), $$(SiteMessage.class));
}
});
@@ -339,7 +339,7 @@
register(SingletonScope.class, new Factory<SiteSignOutLink>(SiteSignOutLink.class) {
public SiteSignOutLink create() {
final SiteSignOutLinkPresenter presenter = new SiteSignOutLinkPresenter($(Session.class),
- $p(UserServiceAsync.class), $p(KuneErrorHandler.class));
+ $$(UserServiceAsync.class), $$(KuneErrorHandler.class));
final SiteSignOutLinkPanel panel = new SiteSignOutLinkPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
@@ -375,7 +375,7 @@
register(SingletonScope.class, new Factory<SiteSearcher>(SiteSearcher.class) {
public SiteSearcher create() {
- final SiteSearcherPresenter presenter = new SiteSearcherPresenter($p(StateManager.class));
+ final SiteSearcherPresenter presenter = new SiteSearcherPresenter($$(StateManager.class));
final SiteSearcherView view = new SiteSearcherPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
@@ -394,7 +394,7 @@
register(SingletonScope.class, new Factory<SiteSearch>(SiteSearch.class) {
public SiteSearch create() {
- final SiteSearchPresenter presenter = new SiteSearchPresenter($p(SiteSearcher.class));
+ final SiteSearchPresenter presenter = new SiteSearchPresenter($$(SiteSearcher.class));
final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n);
presenter.init(panel);
return presenter;
@@ -423,8 +423,8 @@
register(SingletonScope.class, new Factory<NewGroup>(NewGroup.class) {
public NewGroup create() {
final NewGroupPresenter presenter = new NewGroupPresenter(i18n, $(Session.class),
- $(StateManager.class), $p(GroupServiceAsync.class));
- final NewGroupPanel view = new NewGroupPanel(presenter, i18n, $p(LicenseChoose.class));
+ $(StateManager.class), $$(GroupServiceAsync.class));
+ final NewGroupPanel view = new NewGroupPanel(presenter, i18n, $$(LicenseChoose.class));
presenter.init(view);
return presenter;
}
@@ -442,7 +442,7 @@
register(SingletonScope.class, new Factory<WsThemePresenter>(WsThemePresenter.class) {
public WsThemePresenter create() {
- final WsThemePresenter presenter = new WsThemePresenter($(Session.class), $p(GroupServiceAsync.class),
+ final WsThemePresenter presenter = new WsThemePresenter($(Session.class), $$(GroupServiceAsync.class),
$(StateManager.class));
final WsThemePanel panel = new WsThemePanel(ws, presenter, i18n);
presenter.init(panel);
@@ -490,7 +490,7 @@
register(SingletonScope.class, new Factory<RateIt>(RateIt.class) {
public RateIt create() {
final RateItPresenter presenter = new RateItPresenter(i18n, $(Session.class),
- $p(ContentServiceAsync.class), $(StateManager.class));
+ $$(ContentServiceAsync.class), $(StateManager.class));
final RateItPanel panel = new RateItPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
@@ -501,7 +501,7 @@
public GroupMembersSummary create() {
final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n,
$(StateManager.class), $(ImageUtils.class), $(Session.class),
- $p(SocialNetworkServiceAsync.class), $p(UserLiveSearcher.class), $(WsThemePresenter.class));
+ $$(SocialNetworkServiceAsync.class), $$(UserLiveSearcher.class), $(WsThemePresenter.class));
final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
@@ -522,7 +522,7 @@
public ParticipationSummary create() {
final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(i18n,
$(StateManager.class), $(ImageUtils.class), $(Session.class),
- $p(SocialNetworkServiceAsync.class), $(WsThemePresenter.class));
+ $$(SocialNetworkServiceAsync.class), $(WsThemePresenter.class));
final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
@@ -532,7 +532,7 @@
register(SingletonScope.class, new Factory<TagsSummary>(TagsSummary.class) {
public TagsSummary create() {
final TagsSummaryPresenter presenter = new TagsSummaryPresenter($(Session.class),
- $p(SiteSearcher.class), $(StateManager.class), $(WsThemePresenter.class));
+ $$(SiteSearcher.class), $(StateManager.class), $(WsThemePresenter.class));
final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
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-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -55,7 +55,7 @@
private final Provider<UserServiceAsync> userServiceProvider;
public SessionDefault(final String userHash, final Provider<UserServiceAsync> userServiceProvider) {
- this.userHash = userHash;
+ this.userHash = userHash == null || userHash.equals("null") ? null : userHash;
this.userServiceProvider = userServiceProvider;
languagesArray = null;
this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -232,7 +232,7 @@
}
public void sort() {
- store.sort(GROUP);
+ store.sort(GROUP, SortDir.ASC);
}
public void updateItem(final GridItem<T> gridItem) {
@@ -311,7 +311,7 @@
final ArrayReader reader = new ArrayReader(1, recordDef);
store = new GroupingStore(proxy, reader);
- store.setSortInfo(new SortState(GROUP, SortDir.DESC));
+ store.setSortInfo(new SortState(GROUP, SortDir.ASC));
store.setGroupField(GROUP);
store.setGroupOnSort(true);
store.load();
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java 2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -33,22 +33,11 @@
public abstract class DefaultManager<T, K> {
private final Provider<EntityManager> provider;
- private final Provider<FullTextEntityManager> fullTextEntityManagerProvider;
private final Class<T> entityClass;
public DefaultManager(final Provider<EntityManager> provider, final Class<T> entityClass) {
this.provider = provider;
this.entityClass = entityClass;
- fullTextEntityManagerProvider = new Provider<FullTextEntityManager>() {
- private FullTextEntityManager searchManager;
-
- public FullTextEntityManager get() {
- if (searchManager == null) {
- searchManager = Search.createFullTextEntityManager(getEntityManager());
- }
- return searchManager;
- }
- };
}
public T find(final Long primaryKey) {
@@ -75,7 +64,8 @@
@SuppressWarnings("unchecked")
public void reIndex() {
- final FullTextEntityManager fullTextEm = fullTextEntityManagerProvider.get();
+ // Inject this?
+ final FullTextEntityManager fullTextEm = Search.createFullTextEntityManager(getEntityManager());
fullTextEm.purgeAll(entityClass);
fullTextEm.getTransaction().commit();
fullTextEm.getTransaction().begin();
@@ -93,7 +83,8 @@
@SuppressWarnings("unchecked")
public SearchResult<T> search(final Query query, final Integer firstResult, final Integer maxResults) {
- final FullTextQuery emQuery = fullTextEntityManagerProvider.get().createFullTextQuery(query, entityClass);
+ final FullTextQuery emQuery = Search.createFullTextEntityManager(getEntityManager()).createFullTextQuery(query,
+ entityClass);
if (firstResult != null && maxResults != null) {
emQuery.setFirstResult(firstResult);
emQuery.setMaxResults(maxResults);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java 2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -27,6 +27,10 @@
void addGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+ void addUserOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+
void removeGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+ void removeUserOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -81,7 +81,8 @@
userLiveSearcherProvider.get().show();
}
});
- super.addGroupOperation(gotoMemberMenuItem, false);
+ super.addGroupOperation(gotoGroupMenuItem, false);
+ super.addUserOperation(gotoMemberMenuItem, false);
}
public void addCollab(final String groupShortName) {
@@ -102,6 +103,10 @@
this.view = view;
}
+ public void onDoubleClick(final String groupShortName) {
+ stateManager.gotoToken(groupShortName);
+ }
+
private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) {
return userIsAdmin || userIsCollab;
}
@@ -175,8 +180,4 @@
}
}
- public void onDoubleClick(String groupShortName) {
- stateManager.gotoToken(groupShortName);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-06 04:21:36 UTC (rev 832)
@@ -41,6 +41,8 @@
private final GridMenuItemCollection<GroupDTO> otherOperations;
private final GridMenuItemCollection<GroupDTO> otherLoggedOperations;
private final ImageUtils imageUtils;
+ private final GridMenuItemCollection<GroupDTO> otherOperationsUsers;
+ private final GridMenuItemCollection<GroupDTO> otherLoggedOperationsUsers;
public SocialNetworkPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
final ImageUtils imageUtils, final Session session,
@@ -52,8 +54,11 @@
this.snServiceProvider = snServiceProvider;
createButtons();
createMenuActions();
+ otherOperationsUsers = new GridMenuItemCollection<GroupDTO>();
+ otherLoggedOperationsUsers = new GridMenuItemCollection<GroupDTO>();
otherOperations = new GridMenuItemCollection<GroupDTO>();
otherLoggedOperations = new GridMenuItemCollection<GroupDTO>();
+
}
public void addGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
@@ -62,12 +67,24 @@
collection.add(operation);
}
+ public void addUserOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
+ GridMenuItemCollection<GroupDTO> collection;
+ collection = mustBeLogged ? otherLoggedOperationsUsers : otherOperationsUsers;
+ collection.add(operation);
+ }
+
public void removeGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
GridMenuItemCollection<GroupDTO> collection;
collection = mustBeLogged ? otherLoggedOperations : otherOperations;
collection.remove(operation);
}
+ public void removeUserOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
+ GridMenuItemCollection<GroupDTO> collection;
+ collection = mustBeLogged ? otherLoggedOperationsUsers : otherOperationsUsers;
+ collection.remove(operation);
+ }
+
protected GridItem<GroupDTO> createGridItem(final GridGroup groupCategory, final GroupDTO group,
final AccessRightsDTO rights, final MenuItem<GroupDTO>... gridMenuItems) {
final GridItem<GroupDTO> gridItem = createDefMemberMenu(group, groupCategory);
@@ -116,15 +133,23 @@
private GridItem<GroupDTO> createDefMemberMenu(final GroupDTO group, final GridGroup gridGroup) {
final GridMenu<GroupDTO> menu = new GridMenu<GroupDTO>(group);
final String longName = group.getLongName();
+ final String toolTip = i18n.t(group.getType().equals(GroupDTO.PERSONAL) ? "User nickname: [%s]"
+ : "Group short name: [%s]", group.getShortName());
final GridItem<GroupDTO> gridItem = new GridItem<GroupDTO>(group, gridGroup, group.getShortName(), imageUtils
- .getImageHtml(ImageDescriptor.groupDefIcon), longName, longName, " ", longName, i18n.t(
- "User name: [%s]", group.getShortName()), menu);
- if (otherOperations != null) {
+ .getImageHtml(ImageDescriptor.groupDefIcon), longName, longName, " ", longName, toolTip, menu);
+ if (!group.getType().equals(GroupDTO.PERSONAL)) {
menu.addMenuItemList(otherOperations);
}
- if (session.isLogged() && otherOperations != null) {
+ if (session.isLogged() && !group.getType().equals(GroupDTO.PERSONAL)) {
menu.addMenuItemList(otherLoggedOperations);
}
+ if (group.getType().equals(GroupDTO.PERSONAL)) {
+ menu.addMenuItemList(otherOperationsUsers);
+ }
+ if (session.isLogged() && group.getType().equals(GroupDTO.PERSONAL)) {
+ menu.addMenuItemList(otherLoggedOperationsUsers);
+ }
+
return gridItem;
}
@@ -147,21 +172,21 @@
removeMemberAction(groupDTO);
}
});
- changeToCollabMenuItem = new MenuItem<GroupDTO>("images/arrow-down-green.gif", i18n
- .t("Change to collaborator"), new Slot<GroupDTO>() {
- public void onEvent(final GroupDTO group) {
- Site.showProgressProcessing();
- snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
- session.getCurrentState().getGroup().getShortName(), group.getShortName(),
- new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Type of member changed"));
- stateManager.setSocialNetwork(result);
- }
- });
- }
- });
+ changeToCollabMenuItem = new MenuItem<GroupDTO>("images/arrow-down-green.gif",
+ i18n.t("Change to collaborator"), new Slot<GroupDTO>() {
+ public void onEvent(final GroupDTO group) {
+ Site.showProgressProcessing();
+ snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(), group.getShortName(),
+ new AsyncCallbackSimple<SocialNetworkResultDTO>() {
+ public void onSuccess(final SocialNetworkResultDTO result) {
+ Site.hideProgress();
+ Site.info(i18n.t("Type of member changed"));
+ stateManager.setSocialNetwork(result);
+ }
+ });
+ }
+ });
removeMemberMenuItem = new MenuItem<GroupDTO>("images/del.gif", i18n.t("Remove this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
1
0
r831 - in trunk/src/test/java/org/ourproject/kune/platf: integration server server/auth
by vjrj 06 Aug '08
by vjrj 06 Aug '08
06 Aug '08
Author: vjrj
Date: 2008-08-06 04:36:00 +0200 (Wed, 06 Aug 2008)
New Revision: 831
Added:
trunk/src/test/java/org/ourproject/kune/platf/server/auth/
trunk/src/test/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptorTest.java
Modified:
trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
Log:
Incomplete - task 38: Auth*MethodInterceptors Tests
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java 2008-08-05 17:43:43 UTC (rev 830)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java 2008-08-06 02:36:00 UTC (rev 831)
@@ -18,24 +18,26 @@
public class IntegrationTestHelper {
public static Injector createInjector() {
- final Injector injector = Guice.createInjector(new PlatformServerModule(), new DocumentServerModule(),
- new ChatServerModule(), new AbstractModule() {
- @Override
- protected void configure() {
- bindScope(SessionScoped.class, Scopes.SINGLETON);
- // test: use memory
- // test_db: use mysql
- bindConstant().annotatedWith(JpaUnit.class).to("test");
- bindConstant().annotatedWith(PropertiesFileName.class).to("kune.properties");
- bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
- }
- });
- return injector;
+ final Injector injector = Guice.createInjector(new PlatformServerModule(), new DocumentServerModule(),
+ new ChatServerModule(), new AbstractModule() {
+ @Override
+ protected void configure() {
+ bindScope(SessionScoped.class, Scopes.SINGLETON);
+ // test: use memory
+ // test_db: use mysql
+ bindConstant().annotatedWith(JpaUnit.class).to("test");
+ bindConstant().annotatedWith(PropertiesFileName.class).to("kune.properties");
+ bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
+ }
+ });
+ return injector;
}
- public IntegrationTestHelper(final Object test) {
- final Injector injector = createInjector();
- injector.getInstance(KunePersistenceService.class).start();
- injector.injectMembers(test);
+ public IntegrationTestHelper(final Object... tests) {
+ final Injector injector = createInjector();
+ injector.getInstance(KunePersistenceService.class).start();
+ for (final Object test : tests) {
+ injector.injectMembers(test);
+ }
}
}
Added: trunk/src/test/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptorTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptorTest.java 2008-08-05 17:43:43 UTC (rev 830)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptorTest.java 2008-08-06 02:36:00 UTC (rev 831)
@@ -0,0 +1,81 @@
+package org.ourproject.kune.platf.server.auth;
+
+import java.lang.reflect.AccessibleObject;
+
+import org.aopalliance.intercept.MethodInvocation;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.errors.SessionExpiredException;
+import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
+import org.ourproject.kune.platf.integration.IntegrationTest;
+import org.ourproject.kune.platf.integration.IntegrationTestHelper;
+
+public class AuthenticatedMethodInterceptorTest extends IntegrationTest {
+
+ private AuthenticatedMethodInterceptor auth;
+ private MethodInvocation invocation;
+ private Authenticated authAnnotation;
+
+ @Before
+ public void before() {
+ auth = new AuthenticatedMethodInterceptor();
+ new IntegrationTestHelper(auth, this);
+ invocation = Mockito.mock(MethodInvocation.class);
+ final AccessibleObject accessibleObject = Mockito.mock(AccessibleObject.class);
+ Mockito.stub(invocation.getMethod()).toReturn(this.getClass().getMethods()[0]);
+ Mockito.stub(invocation.getStaticPart()).toReturn(accessibleObject);
+ authAnnotation = Mockito.mock(Authenticated.class);
+ Mockito.stub(accessibleObject.getAnnotation(Authenticated.class)).toReturn(authAnnotation);
+ }
+
+ @Test(expected = UserMustBeLoggedException.class)
+ public void hashNullAndMandatoryMustDoNothing() throws Throwable {
+ Mockito.stub(authAnnotation.mandatory()).toReturn(true);
+ final Object[] result = { null };
+ Mockito.stub(invocation.getArguments()).toReturn(result);
+ auth.invoke(invocation);
+ }
+
+ @Test
+ public void hashNullAndNotMandatoryMustDoNothing() throws Throwable {
+ Mockito.stub(authAnnotation.mandatory()).toReturn(false);
+ final Object[] result = { null };
+ Mockito.stub(invocation.getArguments()).toReturn(result);
+ auth.invoke(invocation);
+ }
+
+ @Test
+ public void hashNullAsStringAndNotMandatoryMustDoNothing() throws Throwable {
+ Mockito.stub(authAnnotation.mandatory()).toReturn(false);
+ final Object[] result = { "null" };
+ Mockito.stub(invocation.getArguments()).toReturn(result);
+ auth.invoke(invocation);
+ }
+
+ @Test(expected = SessionExpiredException.class)
+ public void otherHashAndMandatoryAndLoggedMustSessionExp() throws Throwable {
+ doLogin();
+ Mockito.stub(authAnnotation.mandatory()).toReturn(true);
+ final Object[] result = { "other-hash" };
+ Mockito.stub(invocation.getArguments()).toReturn(result);
+ auth.invoke(invocation);
+ }
+
+ @Test
+ public void sameHashAndMandatoryAndLoggedMustSessionExp() throws Throwable {
+ doLogin();
+ Mockito.stub(authAnnotation.mandatory()).toReturn(true);
+ final Object[] result = { getHash() };
+ Mockito.stub(invocation.getArguments()).toReturn(result);
+ auth.invoke(invocation);
+ }
+
+ @Test(expected = SessionExpiredException.class)
+ public void someHashAndMandatoryAndNotLoggedMustSessionExp() throws Throwable {
+ Mockito.stub(authAnnotation.mandatory()).toReturn(true);
+ final Object[] result = { "some-hash" };
+ Mockito.stub(invocation.getArguments()).toReturn(result);
+ auth.invoke(invocation);
+ }
+}
1
0
Author: vjrj
Date: 2008-08-05 19:43:43 +0200 (Tue, 05 Aug 2008)
New Revision: 830
Added:
trunk/TROUBLESHOOT
trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderImpl.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
Modified:
trunk/DEV-GUIDE
trunk/INSTALL
trunk/script/deploy_gwt.sh
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptor.java
trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java
trunk/src/main/java/org/ourproject/kune/rack/filters/LogFilter.java
trunk/src/main/java/org/ourproject/kune/rack/filters/gwts/GWTServiceFilter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
Log:
new TROUBLESHOOT file, and INSTALL instructions improved
Complete - task 21: Session timeout problems (cookies issue?)
Modified: trunk/DEV-GUIDE
===================================================================
--- trunk/DEV-GUIDE 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/DEV-GUIDE 2008-08-05 17:43:43 UTC (rev 830)
@@ -3,8 +3,24 @@
Development Environment
--------------------------------------------------------------------------------
-See INSTALL for dev specific instructions
+Install kune (see INSTALL file).
+
+mvn eclipse:eclipse generates .project and download necessary code jars.
+
+GWT Hosted Mode:
+
+We have a "Run configuration" (Run > Open Run Dialog) in eclipse with Project: "org.ourproject.kune" with Main class: "com.google.gwt.dev.GWTShell", with this program arguments (or similar): "-noserver -out gwt-out /kune/?locale=en&log_level=INFO -port 8080" and in the "Classpath User Entries":
+ - gwt-dev-[linux|mac|windows].jar
+ - java - /org.ourproject.kune/src/main
+ - org.ourproject.kune (default classpath)
+
+before run hosted mode compile once with:
+ mvn gwt:compile
+and deploy with:
+ script/deploy_gwt.sh
+and then we run jetty (with "mvn jetty:run" also you can run server in debug mode, see TROUBLESHOOT).
+
Code
--------------------------------------------------------------------------------
We use some eclipse code preferences for kune project:
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/INSTALL 2008-08-05 17:43:43 UTC (rev 830)
@@ -4,19 +4,17 @@
For development:
- Install java-jdk (>= 1.5), maven2, mysql (>= 5.0) and for example eclipse
-- Install gwt 1.4.60 and follow Appendix A for maven+gwt configuration
+- Install gwt 1.5rc1 and follow Appendix A for maven+gwt configuration
- Compile with maven:
# (in the trunk directory)
mvn compile
mvn gwt:compile
- Copy the target to src directory (only for test):
- mkdir -p src/main/webapp/gwt/org.ourproject.kune.app.Kune
- unison -batch -auto -ui text target/org.ourproject.kune-0.0.2/org.ourproject.kune.app.Kune/ src/main/webapp/gwt/org.ourproject.kune.app.Kune
+ bin/deploy_gwt.sh
(if you're using windows as dev plaftorm... you will have to write your own script ;). the idea is to
- copy everything from src/main/webapp/gwt/org.ourproject.kune.app.Kune to
- src/main/webapp/gwt/org.ourproject.kune.app.Kune)
+ copy everything from target/kune-0.0.VERSIONHERE/org.ourproject.kune.app.Kune to src/main/webapp/gwt/org.ourproject.kune.app.Kune)
- Make two databases in your mysql:
@@ -35,24 +33,19 @@
sudo chown yourUser:yourUser /var/lib/lucene/kune_dev/indexes
sudo chown yourUser:yourUser /var/lib/lucene/kune_test/indexes
- (in case you are using windows as dev platform you only have to create a couple of folders
- anywhere you like and then specify them in persistence.xml, as follows:
- <property name="hibernate.search.default.indexBase" value="C:\kune\kune-index"/>
+ In case you are using windows as dev platform you only have to create a couple of folders anywhere you like and then specify them in persistence.xml, as follows:
+ <property name="hibernate.search.default.indexBase" value="C:\kune\kune-index"/>
do the same with every persistence unit defined inside.
- )
-- Install and run a openfire jabber server (see Appendix B for proper configuration of openfire)
+- Install and run a openfire jabber server (see Appendix B for proper configuration of openfire) or ejabberd.
- Run jetty:
mvn jetty:run -Ddatabase.migrator.should.run=false # without liquibase db migraton (liquibase.should.run=false in new version)
once started (and initialized the db), you can stop a run jetty with de db migrator to insert initial data and migrate:
mvn jetty:run
-- And conect to http://yourIP:8080/kune
+- And connect to http://yourIP:8080/kune
-- For development with eclipse:
- mvn eclipse:eclipse
-
Appendix A: Configuration of maven
--------------------------------------------------------------------------------
Example of .m2/settings.xml:
@@ -144,4 +137,3 @@
--------------------------------------------------------------------------------
mvn package -Dmaven.test.skip=true -o
-
Added: trunk/TROUBLESHOOT
===================================================================
--- trunk/TROUBLESHOOT 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/TROUBLESHOOT 2008-08-05 17:43:43 UTC (rev 830)
@@ -0,0 +1,5 @@
+Server: debug with jetty in eclipse:
+http://docs.codehaus.org/display/JETTY/Debugging+with+the+Maven+Jetty+Plugin+inside+Eclipse
+
+Client code: you can debug with gwt hosted mode in eclipse (see DEV-GUIDE for hosted mode instructions).
+
Modified: trunk/script/deploy_gwt.sh
===================================================================
--- trunk/script/deploy_gwt.sh 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/script/deploy_gwt.sh 2008-08-05 17:43:43 UTC (rev 830)
@@ -1,4 +1,7 @@
#!/bin/bash
+
+mkdir -p src/main/webapp/gwt/org.ourproject.kune.app.Kune
+
find target/kune-0.0.4/org.ourproject.kune.app.Kune/ -name .DS_Store -exec rm {} \;
script/css-compact-and-tidy.css
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-08-05 01:32:52 UTC (rev 829)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -18,9 +18,9 @@
import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
import org.ourproject.kune.platf.client.state.ContentProvider;
-import org.ourproject.kune.platf.client.state.ContentProviderImpl;
+import org.ourproject.kune.platf.client.state.ContentProviderDefault;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.SessionImpl;
+import org.ourproject.kune.platf.client.state.SessionDefault;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.platf.client.tool.ToolSelector;
@@ -157,7 +157,7 @@
register(SingletonScope.class, new Factory<Session>(Session.class) {
public Session create() {
- return new SessionImpl(Cookies.getCookie(Site.USERHASH), $p(UserServiceAsync.class));
+ return new SessionDefault(Cookies.getCookie(Site.USERHASH), $p(UserServiceAsync.class));
}
}, new Factory<I18nServiceAsync>(I18nServiceAsync.class) {
public I18nServiceAsync create() {
@@ -230,7 +230,7 @@
}
}, new Factory<ContentProvider>(ContentProvider.class) {
public ContentProvider create() {
- return new ContentProviderImpl($(ContentServiceAsync.class));
+ return new ContentProviderDefault($(ContentServiceAsync.class));
}
}, new Factory<StateManager>(StateManager.class) {
public StateManager create() {
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderDefault.java (from rev 827, trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderImpl.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderImpl.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderDefault.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -0,0 +1,60 @@
+/*
+ *
+ * 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.platf.client.state;
+
+import java.util.HashMap;
+
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class ContentProviderDefault implements ContentProvider {
+
+ private final ContentServiceAsync server;
+ private final HashMap<StateToken, StateDTO> cache;
+
+ public ContentProviderDefault(final ContentServiceAsync server) {
+ this.server = server;
+ this.cache = new HashMap<StateToken, StateDTO>();
+ }
+
+ public void cache(final StateToken encodeState, final StateDTO content) {
+ cache.put(encodeState, content);
+ }
+
+ public void getContent(final String user, final StateToken newState, final AsyncCallback<StateDTO> callback) {
+ Site.showProgressLoading();
+ final StateDTO catched = getCached(newState);
+ if (catched != null) {
+ callback.onSuccess(catched);
+ } else {
+ server.getContent(user, newState.getGroup(), newState, callback);
+ }
+ }
+
+ private StateDTO getCached(final StateToken newState) {
+ return cache.remove(newState);
+ }
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderImpl.java 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderImpl.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -1,60 +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.platf.client.state;
-
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class ContentProviderImpl implements ContentProvider {
-
- private final ContentServiceAsync server;
- private final HashMap<StateToken, StateDTO> cache;
-
- public ContentProviderImpl(final ContentServiceAsync server) {
- this.server = server;
- this.cache = new HashMap<StateToken, StateDTO>();
- }
-
- public void cache(final StateToken encodeState, final StateDTO content) {
- cache.put(encodeState, content);
- }
-
- public void getContent(final String user, final StateToken newState, final AsyncCallback<StateDTO> callback) {
- Site.showProgressLoading();
- final StateDTO catched = getCached(newState);
- if (catched != null) {
- callback.onSuccess(catched);
- } else {
- server.getContent(user, newState.getGroup(), newState, callback);
- }
- }
-
- private StateDTO getCached(final StateToken newState) {
- return cache.remove(newState);
- }
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java (from rev 827, 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-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -0,0 +1,196 @@
+/*
+ *
+ * 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.platf.client.state;
+
+import java.util.Iterator;
+import java.util.List;
+
+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 org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Signal0;
+import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
+
+public class SessionDefault implements Session {
+ private String userHash;
+ private InitDataDTO initData;
+ private UserInfoDTO currentUserInfo;
+ private Object[][] languagesArray;
+ private Object[][] countriesArray;
+ private Object[][] timezonesArray;
+ private StateDTO currentState;
+ private I18nLanguageDTO currentLanguage;
+ private final Signal<InitDataDTO> onInitDataReceived;
+ private final Signal<UserInfoDTO> onUserSignIn;
+ private final Signal0 onUserSignOut;
+ private final Provider<UserServiceAsync> userServiceProvider;
+
+ public SessionDefault(final String userHash, final Provider<UserServiceAsync> userServiceProvider) {
+ this.userHash = userHash;
+ this.userServiceProvider = userServiceProvider;
+ languagesArray = null;
+ this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
+ this.onUserSignIn = new Signal<UserInfoDTO>("onUserSignIn");
+ this.onUserSignOut = new Signal0("onUserSignOut");
+ }
+
+ public void check(final AsyncCallbackSimple<?> callback) {
+ Log.debug("Checking session (userhash: " + getUserHash() + ")");
+ userServiceProvider.get().onlyCheckSession(getUserHash(), callback);
+ }
+
+ public List<I18nCountryDTO> getCountries() {
+ return initData.getCountries();
+ }
+
+ public Object[][] getCountriesArray() {
+ if (countriesArray == null) {
+ countriesArray = mapCountries();
+ }
+ return countriesArray;
+ }
+
+ public I18nLanguageDTO getCurrentLanguage() {
+ return currentLanguage;
+ }
+
+ public StateDTO getCurrentState() {
+ return currentState;
+ }
+
+ public UserInfoDTO getCurrentUserInfo() {
+ return currentUserInfo;
+ }
+
+ public List<I18nLanguageSimpleDTO> getLanguages() {
+ return initData.getLanguages();
+ }
+
+ public Object[][] getLanguagesArray() {
+ if (languagesArray == null) {
+ languagesArray = mapLangs();
+ }
+ return languagesArray;
+ }
+
+ public List<LicenseDTO> getLicenses() {
+ return initData.getLicenses();
+ }
+
+ public Object[][] getTimezones() {
+ if (timezonesArray == null) {
+ mapTimezones();
+ }
+ return timezonesArray;
+ }
+
+ public String getUserHash() {
+ return userHash;
+ }
+
+ public boolean isLogged() {
+ return userHash != null;
+ }
+
+ public void onInitDataReceived(final Slot<InitDataDTO> slot) {
+ onInitDataReceived.add(slot);
+ }
+
+ public void onUserSignIn(final Slot<UserInfoDTO> slot) {
+ onUserSignIn.add(slot);
+ }
+
+ public void onUserSignOut(final Slot0 slot) {
+ onUserSignOut.add(slot);
+ }
+
+ public void setCurrent(final StateDTO currentState) {
+ this.currentState = currentState;
+ }
+
+ public void setCurrentLanguage(final I18nLanguageDTO currentLanguage) {
+ this.currentLanguage = currentLanguage;
+ }
+
+ public void setCurrentState(final StateDTO currentState) {
+ this.currentState = currentState;
+ }
+
+ public void setCurrentUserInfo(final UserInfoDTO currentUserInfo) {
+ this.currentUserInfo = currentUserInfo;
+ if (currentUserInfo != null) {
+ onUserSignIn.fire(currentUserInfo);
+ } else {
+ onUserSignOut.fire();
+ }
+ }
+
+ public void setInitData(final InitDataDTO initData) {
+ this.initData = initData;
+ onInitDataReceived.fire(initData);
+ }
+
+ public void setUserHash(final String userHash) {
+ this.userHash = userHash;
+ }
+
+ private Object[][] mapCountries() {
+ final Object[][] objs = new Object[initData.getCountries().size()][1];
+ int i = 0;
+ for (final Iterator<I18nCountryDTO> iterator = initData.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() {
+ final Object[][] objs = new Object[initData.getLanguages().size()][1];
+ int i = 0;
+ for (final Iterator<I18nLanguageSimpleDTO> iterator = initData.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[initData.getTimezones().length][1];
+ for (int i = 0; i < getTimezones().length; i++) {
+ final Object[] obj = new Object[] { initData.getTimezones()[i] };
+ timezonesArray[i] = obj;
+ }
+ }
+
+}
Deleted: 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-08-05 01:32:52 UTC (rev 829)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -1,196 +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.platf.client.state;
-
-import java.util.Iterator;
-import java.util.List;
-
-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 org.ourproject.kune.platf.client.dto.UserInfoDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.container.Provider;
-import com.calclab.suco.client.signal.Signal;
-import com.calclab.suco.client.signal.Signal0;
-import com.calclab.suco.client.signal.Slot;
-import com.calclab.suco.client.signal.Slot0;
-
-public class SessionImpl implements Session {
- private String userHash;
- private InitDataDTO initData;
- private UserInfoDTO currentUserInfo;
- private Object[][] languagesArray;
- private Object[][] countriesArray;
- private Object[][] timezonesArray;
- private StateDTO currentState;
- private I18nLanguageDTO currentLanguage;
- private final Signal<InitDataDTO> onInitDataReceived;
- private final Signal<UserInfoDTO> onUserSignIn;
- private final Signal0 onUserSignOut;
- private final Provider<UserServiceAsync> userServiceProvider;
-
- public SessionImpl(final String userHash, final Provider<UserServiceAsync> userServiceProvider) {
- this.userHash = userHash;
- this.userServiceProvider = userServiceProvider;
- languagesArray = null;
- this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
- this.onUserSignIn = new Signal<UserInfoDTO>("onUserSignIn");
- this.onUserSignOut = new Signal0("onUserSignOut");
- }
-
- public void check(final AsyncCallbackSimple<?> callback) {
- Log.debug("Checking session (userhash: " + getUserHash() + ")");
- userServiceProvider.get().onlyCheckSession(getUserHash(), callback);
- }
-
- public List<I18nCountryDTO> getCountries() {
- return initData.getCountries();
- }
-
- public Object[][] getCountriesArray() {
- if (countriesArray == null) {
- countriesArray = mapCountries();
- }
- return countriesArray;
- }
-
- public I18nLanguageDTO getCurrentLanguage() {
- return currentLanguage;
- }
-
- public StateDTO getCurrentState() {
- return currentState;
- }
-
- public UserInfoDTO getCurrentUserInfo() {
- return currentUserInfo;
- }
-
- public List<I18nLanguageSimpleDTO> getLanguages() {
- return initData.getLanguages();
- }
-
- public Object[][] getLanguagesArray() {
- if (languagesArray == null) {
- languagesArray = mapLangs();
- }
- return languagesArray;
- }
-
- public List<LicenseDTO> getLicenses() {
- return initData.getLicenses();
- }
-
- public Object[][] getTimezones() {
- if (timezonesArray == null) {
- mapTimezones();
- }
- return timezonesArray;
- }
-
- public String getUserHash() {
- return userHash;
- }
-
- public boolean isLogged() {
- return userHash != null;
- }
-
- public void onInitDataReceived(final Slot<InitDataDTO> slot) {
- onInitDataReceived.add(slot);
- }
-
- public void onUserSignIn(final Slot<UserInfoDTO> slot) {
- onUserSignIn.add(slot);
- }
-
- public void onUserSignOut(final Slot0 slot) {
- onUserSignOut.add(slot);
- }
-
- public void setCurrent(final StateDTO currentState) {
- this.currentState = currentState;
- }
-
- public void setCurrentLanguage(final I18nLanguageDTO currentLanguage) {
- this.currentLanguage = currentLanguage;
- }
-
- public void setCurrentState(final StateDTO currentState) {
- this.currentState = currentState;
- }
-
- public void setCurrentUserInfo(final UserInfoDTO currentUserInfo) {
- this.currentUserInfo = currentUserInfo;
- if (currentUserInfo != null) {
- onUserSignIn.fire(currentUserInfo);
- } else {
- onUserSignOut.fire();
- }
- }
-
- public void setInitData(final InitDataDTO initData) {
- this.initData = initData;
- onInitDataReceived.fire(initData);
- }
-
- public void setUserHash(final String userHash) {
- this.userHash = userHash;
- }
-
- private Object[][] mapCountries() {
- final Object[][] objs = new Object[initData.getCountries().size()][1];
- int i = 0;
- for (final Iterator<I18nCountryDTO> iterator = initData.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() {
- final Object[][] objs = new Object[initData.getLanguages().size()][1];
- int i = 0;
- for (final Iterator<I18nLanguageSimpleDTO> iterator = initData.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[initData.getTimezones().length][1];
- for (int i = 0; i < getTimezones().length; i++) {
- final Object[] obj = new Object[] { initData.getTimezones()[i] };
- timezonesArray[i] = obj;
- }
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -68,9 +68,8 @@
if (panel.isRendered()) {
panel.syncSize();
panel.doLayout();
- doLayoutIfNeeded();
}
- // doLayoutIfNeeded();
+ doLayoutIfNeeded();
}
public void addStyle(final String style) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptor.java 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptor.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -23,6 +23,8 @@
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.ourproject.kune.platf.client.errors.SessionExpiredException;
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
import org.ourproject.kune.platf.server.UserSession;
@@ -32,6 +34,8 @@
public class AuthenticatedMethodInterceptor implements MethodInterceptor {
+ public static final Log log = LogFactory.getLog(AuthenticatedMethodInterceptor.class);
+
@Inject
Provider<UserSession> userSessionProvider;
@@ -42,33 +46,40 @@
Provider<SessionService> sessionServiceProvider;
public Object invoke(final MethodInvocation invocation) throws Throwable {
- Object[] arguments = invocation.getArguments();
- String userHash = (String) arguments[0];
+ final Object[] arguments = invocation.getArguments();
+ // Some browsers getCookie returns "null" as String instead of null
+ final String userHash = arguments[0] == null || arguments[0].equals("null") ? null : (String) arguments[0];
- UserSession userSession = userSessionProvider.get();
- SessionService sessionService = sessionServiceProvider.get();
+ log.info("Method: " + invocation.getMethod().getName());
+ log.info("Userhash received: " + userHash);
+ log.info("--------------------------------------------------------------------------------");
+ final UserSession userSession = userSessionProvider.get();
+ final SessionService sessionService = sessionServiceProvider.get();
- Authenticated authAnnotation = invocation.getStaticPart().getAnnotation(Authenticated.class);
- boolean mandatory = authAnnotation.mandatory();
+ final Authenticated authAnnotation = invocation.getStaticPart().getAnnotation(Authenticated.class);
+ final boolean mandatory = authAnnotation.mandatory();
- if (userHash == null && mandatory) {
- sessionService.getNewSession();
- throw new UserMustBeLoggedException();
- } else if (userSession.isUserNotLoggedIn() && mandatory) {
- sessionService.getNewSession();
- throw new SessionExpiredException();
- } else if (userSession.isUserNotLoggedIn() && userHash == null) {
- // Ok, do nothing
- } else if (userSession.isUserNotLoggedIn() && userHash != null) {
- sessionService.getNewSession();
- throw new SessionExpiredException();
- } else if (!userSession.getHash().equals(userHash)) {
- userSession.logout();
- sessionService.getNewSession();
- throw new SessionExpiredException();
- }
- Object result = invocation.proceed();
- return result;
+ if (userHash == null && mandatory) {
+ sessionService.getNewSession();
+ throw new UserMustBeLoggedException();
+ } else if (userSession.isUserNotLoggedIn() && mandatory) {
+ sessionService.getNewSession();
+ log.info("Session expired (not logged in server and mandatory)");
+ throw new SessionExpiredException();
+ } else if (userSession.isUserNotLoggedIn() && userHash == null) {
+ // Ok, do nothing
+ } else if (userSession.isUserNotLoggedIn() && userHash != null) {
+ sessionService.getNewSession();
+ log.info("Session expired (not logged in server)");
+ throw new SessionExpiredException();
+ } else if (!userSession.getHash().equals(userHash)) {
+ userSession.logout();
+ sessionService.getNewSession();
+ log.info("Session expired (userHash different in server)");
+ throw new SessionExpiredException();
+ }
+ final Object result = invocation.proceed();
+ return result;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -63,7 +63,7 @@
private void execute(final Filter filter, final ServletRequest request, final ServletResponse response)
throws IOException, ServletException {
- log.debug("RACK FILTER: " + filter.getClass().getSimpleName());
+ // log.debug("RACK FILTER: " + filter.getClass().getSimpleName());
filter.doFilter(request, response, this);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/rack/filters/LogFilter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/rack/filters/LogFilter.java 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/src/main/java/org/ourproject/kune/rack/filters/LogFilter.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -39,12 +39,12 @@
}
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
- throws IOException, ServletException {
- long start = System.currentTimeMillis();
- log.debug("REQUEST: " + RackHelper.getURI(request));
- chain.doFilter(request, response);
- long finish = System.currentTimeMillis();
- log.debug("TOTAL TIME: " + (finish - start) + " miliseconds");
+ throws IOException, ServletException {
+ // final long start = System.currentTimeMillis();
+ log.debug("REQUEST: " + RackHelper.getURI(request));
+ chain.doFilter(request, response);
+ // final long finish = System.currentTimeMillis();
+ // log.debug("TOTAL TIME: " + (finish - start) + " miliseconds");
}
public void init(final FilterConfig filterConfig) throws ServletException {
Modified: trunk/src/main/java/org/ourproject/kune/rack/filters/gwts/GWTServiceFilter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/rack/filters/gwts/GWTServiceFilter.java 2008-08-05 01:32:52 UTC (rev 829)
+++ trunk/src/main/java/org/ourproject/kune/rack/filters/gwts/GWTServiceFilter.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -43,22 +43,23 @@
private final DelegatedRemoteServlet servlet;
public GWTServiceFilter(final Class<? extends RemoteService> serviceClass) {
- this.serviceClass = serviceClass;
- this.servlet = new DelegatedRemoteServlet();
+ this.serviceClass = serviceClass;
+ this.servlet = new DelegatedRemoteServlet();
}
+ public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
+ throws IOException, ServletException {
+ log.info("--------------------------------------------------------------------------------");
+ log.debug("SERVICE: " + RackHelper.getURI(request) + " - " + serviceClass.getSimpleName());
+ final RemoteService service = getInstance(serviceClass);
+ servlet.setService(service);
+ servlet.doPost((HttpServletRequest) request, (HttpServletResponse) response);
+ }
+
@Override
public void init(final FilterConfig filterConfig) throws ServletException {
- super.init(filterConfig);
- servlet.setServletContext(filterConfig.getServletContext());
+ super.init(filterConfig);
+ servlet.setServletContext(filterConfig.getServletContext());
}
- public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
- throws IOException, ServletException {
- log.debug("SERVICE: " + RackHelper.getURI(request) + " - " + serviceClass.getSimpleName());
- RemoteService service = getInstance(serviceClass);
- servlet.setService(service);
- servlet.doPost((HttpServletRequest) request, (HttpServletResponse) response);
- }
-
}
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-08-05 01:32:52 UTC (rev 829)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-05 17:43:43 UTC (rev 830)
@@ -36,6 +36,9 @@
public void addInTools(final Widget widget) {
entityTools.add(widget);
+ if (entityTools.isRendered()) {
+ entityTools.doLayout(false);
+ }
mainPanel.doLayoutIfNeeded();
}
1
0
Author: vjrj
Date: 2008-08-05 03:32:52 +0200 (Tue, 05 Aug 2008)
New Revision: 829
Added:
trunk/img/emite-groups-logo.svg
trunk/img/emite-groups.png
Log:
emite groups images
Added: trunk/img/emite-groups-logo.svg
===================================================================
--- trunk/img/emite-groups-logo.svg 2008-08-05 01:29:31 UTC (rev 828)
+++ trunk/img/emite-groups-logo.svg 2008-08-05 01:32:52 UTC (rev 829)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="42"
+ height="42"
+ id="svg2533"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:export-filename="/Users/vjrj/Desktop/emite-groups.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docbase="/Users/vjrj/Desktop"
+ sodipodi:docname="emite-groups-logo.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2535" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="9.45"
+ inkscape:cx="29.482892"
+ inkscape:cy="20"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ width="42px"
+ height="42px"
+ inkscape:window-width="756"
+ inkscape:window-height="581"
+ inkscape:window-x="354"
+ inkscape:window-y="104" />
+ <metadata
+ id="metadata2538">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <text
+ xml:space="preserve"
+ style="font-size:23.88686371px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Emblem"
+ x="-0.14885554"
+ y="28.014141"
+ id="text2516"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan2518"
+ x="-0.14885554"
+ y="28.014141"
+ dy="0 0 -0.57697296"><tspan
+ style="fill:#ff6600"
+ id="tspan2520">((</tspan>e<tspan
+ style="fill:#ff6600"
+ id="tspan2522"
+ dy="0.57697296">))</tspan></tspan></text>
+ <g
+ id="g2551"
+ transform="matrix(0.126788,0,0,0.126788,107.24045,44.350445)">
+ <g
+ transform="matrix(1.7831728,0,0,1.7831728,-79.227654,-1724.5839)"
+ id="g2524">
+ <text
+ xml:space="preserve"
+ style="font-size:49.60492325px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:89.99999762%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#784421;fill-opacity:1;fill-rule:nonzero;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Emblem"
+ x="-219.35106"
+ y="817.05505"
+ id="text2526"
+ sodipodi:linespacing="89.999998%"
+ transform="scale(0.9684286,1.0326006)"><tspan
+ sodipodi:role="line"
+ x="-219.35106"
+ y="817.05505"
+ id="tspan2528">emite</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:23.32044411px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:89.99999762%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#784421;fill-opacity:1;fill-rule:nonzero;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Emblem"
+ x="-217.47432"
+ y="839.24841"
+ id="text2530"
+ sodipodi:linespacing="89.999998%"
+ transform="scale(0.9684286,1.0326006)"><tspan
+ sodipodi:role="line"
+ x="-217.47432"
+ y="839.24841"
+ id="tspan2532">xmpp & gwt</tspan></text>
+ </g>
+ <text
+ inkscape:export-ydpi="32.508678"
+ inkscape:export-xdpi="32.508678"
+ inkscape:export-filename="/home/vjrj/proyectos/ourproject.org/kune/dev/emite/emite/img/emite-ui.png"
+ transform="scale(0.9684286,1.0326006)"
+ sodipodi:linespacing="89.999998%"
+ id="text2534"
+ y="-133.38048"
+ x="-471.8595"
+ style="font-size:34.96242523px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:89.99999762%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Emblem"
+ xml:space="preserve"><tspan
+ id="tspan2536"
+ y="-133.38048"
+ x="-471.8595"
+ sodipodi:role="line">ui application</tspan></text>
+ </g>
+ </g>
+</svg>
Added: trunk/img/emite-groups.png
===================================================================
(Binary files differ)
Property changes on: trunk/img/emite-groups.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
Author: vjrj
Date: 2008-08-05 03:29:31 +0200 (Tue, 05 Aug 2008)
New Revision: 828
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java
trunk/src/test/java/org/ourproject/kune/workspace/client/tags/
trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java
Removed:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatComponents.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomListener.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextComponents.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocToolComponents.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentComponents.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentListener.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderListener.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextComponents.java
trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
trunk/src/main/java/org/ourproject/kune/platf/client/Component.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/
trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidget.java
trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetChild.java
trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetId.java
trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetsManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/BottomTrayIcon.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/
Modified:
trunk/TODO
trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfo.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/Document.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetLanguageAction.java
trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetPublishedOnAction.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControl.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlView.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java
Log:
Workspace refactorization
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/TODO 2008-08-05 01:29:31 UTC (rev 828)
@@ -38,6 +38,7 @@
- Remove pagination i18n's
- Chat rooms --> Chats
- Confirmation of chat close (see code)
+ - Participates as ... --> Participates in
MIND-TERM:
--------------------------------------------------------------------------------
Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-05 01:29:31 UTC (rev 828)
@@ -26,7 +26,7 @@
<iframe id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
<div id="kuneprogresspanel" class="kune-sitebar">
<table cellspacing="0" summary="Starting" cellpadding="0" border="0"
- style="height: 16px;">
+ style="height: 16px; margin-top: 5px; margin-left: 5px;">
<tbody>
<tr>
<td height="16" align="left" style="vertical-align: top;"
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,15 +1,31 @@
package org.ourproject.kune.chat.client;
+import org.ourproject.kune.chat.client.cnt.ChatContent;
+import org.ourproject.kune.chat.client.cnt.ChatContentPresenter;
+import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
+import org.ourproject.kune.chat.client.cnt.info.ui.ChatInfoPanel;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
+import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomControlPanel;
+import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomPanel;
+import org.ourproject.kune.chat.client.ctx.ChatContext;
+import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
+import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
+import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
import org.ourproject.kune.platf.client.KunePlatform;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
import com.calclab.suco.client.modules.AbstractModule;
@@ -24,12 +40,61 @@
@Override
public void onLoad() {
+
+ register(SingletonScope.class, new Factory<ChatInfo>(ChatInfo.class) {
+ public ChatInfo create() {
+ return new ChatInfoPanel();
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatContent>(ChatContent.class) {
+ public ChatContent create() {
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContentPresenter presenter = new ChatContentPresenter($(EmiteUIDialog.class), panel,
+ $p(ChatInfo.class), $p(ChatRoom.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatContext>(ChatContext.class) {
+ public ChatContext create() {
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContextPresenter presenter = new ChatContextPresenter(panel, $p(RoomsAdmin.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatRoomControl>(ChatRoomControl.class) {
+ public ChatRoomControl create() {
+ final ChatRoomControlPresenter presenter = new ChatRoomControlPresenter();
+ final ChatRoomControlPanel panel = new ChatRoomControlPanel($(I18nUITranslationService.class),
+ presenter);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatRoom>(ChatRoom.class) {
+ public ChatRoom create() {
+ final ChatRoomPanel panel = new ChatRoomPanel($(WorkspaceSkeleton.class));
+ final ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
+ return presenter;
+ }
+ });
+ register(SingletonScope.class, new Factory<RoomsAdmin>(RoomsAdmin.class) {
+ public RoomsAdmin create() {
+ final RoomsAdminPresenter presenter = new RoomsAdminPresenter($(ContextItems.class),
+ $(I18nUITranslationService.class), $p(StateManager.class), $(Session.class),
+ $p(ContentServiceAsync.class));
+ return presenter;
+ }
+ });
+
register(SingletonScope.class, new Factory<ChatClientTool>(ChatClientTool.class) {
public ChatClientTool create() {
return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
$(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $p(GroupMembersSummary.class),
- $p(StateManager.class), $p(ContentServiceAsync.class), $(ToolSelector.class),
- $(WsThemePresenter.class));
+ $(ToolSelector.class), $(WsThemePresenter.class), $p(ChatContent.class), $p(ChatContext.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,22 +20,21 @@
package org.ourproject.kune.chat.client;
+import org.ourproject.kune.chat.client.cnt.ChatContent;
+import org.ourproject.kune.chat.client.ctx.ChatContext;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
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.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
+import org.ourproject.kune.platf.client.ui.MenuItem;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
@@ -48,24 +47,25 @@
public static final String TYPE_ROOT = "chat.root";
public static final String TYPE_ROOM = "chat.room";
public static final String TYPE_CHAT = "chat.chat";
- private final ChatToolComponents components;
private ChatEngine chat;
+ private final Provider<ChatContext> chatContextProvider;
+ private final Provider<ChatContent> chatContentProvider;
public ChatClientTool(final Session session, final Application application, final I18nTranslationService i18n,
final EmiteUIDialog emiteUIDialog, final WorkspaceSkeleton ws,
- final Provider<GroupMembersSummary> groupMembersSummaryProvider,
- final Provider<StateManager> stateManagerProvider,
- final Provider<ContentServiceAsync> contentServiceProvider, final ToolSelector toolSelector,
- final WsThemePresenter wsThemePresenter) {
+ final Provider<GroupMembersSummary> groupMembersSummaryProvider, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter, final Provider<ChatContent> chatContentProvider,
+ final Provider<ChatContext> chatContextProvider) {
super(NAME, i18n.t("chat rooms"), toolSelector, wsThemePresenter, ws);
- components = new ChatToolComponents(emiteUIDialog, i18n, stateManagerProvider, session, contentServiceProvider);
+ this.chatContentProvider = chatContentProvider;
+ this.chatContextProvider = chatContextProvider;
session.onInitDataReceived(new Slot<InitDataDTO>() {
public void onEvent(final InitDataDTO initData) {
final ChatOptions chatOptions = new ChatOptions(initData.getChatHttpBase(), initData.getChatDomain(),
initData.getChatRoomHost());
chat = new ChatEngineXmpp(emiteUIDialog, chatOptions, i18n, ws);
groupMembersSummaryProvider.get().addGroupOperation(
- new GridMenuItem<GroupDTO>("images/chat-basic.gif", i18n.t("Start a chat with this member"),
+ new MenuItem<GroupDTO>("images/chat-basic.gif", i18n.t("Start a chat with this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
emiteUIDialog.chat(XmppURI.jid(group.getShortName() + "@"
@@ -96,24 +96,16 @@
return chat;
}
- public WorkspaceComponent getContent() {
- return components.getContent();
- }
-
- public WorkspaceComponent getContext() {
- return components.getContext();
- }
-
public String getName() {
return NAME;
}
public void setContent(final StateDTO state) {
- components.getContent().setState(state);
+ chatContentProvider.get().setState(state);
}
public void setContext(final StateDTO state) {
- components.getContext().setState(state);
+ chatContextProvider.get().setState(state);
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,98 +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.chat.client;
-
-import org.ourproject.kune.chat.client.cnt.ChatContent;
-import org.ourproject.kune.chat.client.cnt.ChatContentPresenter;
-import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.info.ui.ChatInfoPanel;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomListener;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
-import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomControlPanel;
-import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomPanel;
-import org.ourproject.kune.chat.client.ctx.ChatContext;
-import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-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.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
-
-import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.container.Provider;
-
-public class ChatFactory {
-
- private static I18nTranslationService i18n;
- private static Provider<StateManager> stateManagerProvider;
- private static Session session;
- private static Provider<ContentServiceAsync> contentServiceProvider;
-
- public static ChatContent createChatContent(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider) {
- ChatFactory.i18n = i18n;
- ChatFactory.stateManagerProvider = stateManagerProvider;
- ChatFactory.session = session;
- ChatFactory.contentServiceProvider = contentServiceProvider;
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final ChatContentPresenter presenter = new ChatContentPresenter(emiteUIDialog, panel);
- return presenter;
- }
-
- public static ChatContext createChatContext() {
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final ChatContextPresenter presenter = new ChatContextPresenter(panel);
- return presenter;
- }
-
- public static ChatInfo createChatInfo(final ChatRoomListener listener) {
- final ChatInfoPanel panel = new ChatInfoPanel(listener);
- return panel;
- }
-
- public static ChatRoomControl createChatRoomControlViewer(final ChatRoomListener listener) {
- final ChatRoomControlPanel panel = new ChatRoomControlPanel(listener, i18n);
- final ChatRoomControlPresenter presenter = new ChatRoomControlPresenter(panel);
- return presenter;
- }
-
- public static ChatRoom createChatRoomViewer(final ChatRoomListener listener) {
- final ChatRoomPanel panel = new ChatRoomPanel();
- final ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
- return presenter;
- }
-
- public static RoomsAdmin createRoomsAdmin() {
- final ContextItems contextItems = WorkspaceFactory.createContextItems();
- final RoomsAdminPresenter presenter = new RoomsAdminPresenter(contextItems, i18n, stateManagerProvider,
- session, contentServiceProvider);
- return presenter;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,67 +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.chat.client;
-
-import org.ourproject.kune.chat.client.cnt.ChatContent;
-import org.ourproject.kune.chat.client.ctx.ChatContext;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-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 com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.container.Provider;
-
-class ChatToolComponents {
- private ChatContent content;
- private ChatContext context;
- private final EmiteUIDialog emiteUIDialog;
- private final I18nTranslationService i18n;
- private final Provider<StateManager> stateManagerProvider;
- private final Session session;
- private final Provider<ContentServiceAsync> contentServiceProvider;
-
- public ChatToolComponents(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider) {
- this.emiteUIDialog = emiteUIDialog;
- this.i18n = i18n;
- this.stateManagerProvider = stateManagerProvider;
- this.session = session;
- this.contentServiceProvider = contentServiceProvider;
- }
-
- public ChatContent getContent() {
- if (content == null) {
- content = ChatFactory.createChatContent(emiteUIDialog, i18n, stateManagerProvider, session,
- contentServiceProvider);
- }
- return content;
- }
-
- public ChatContext getContext() {
- if (context == null) {
- context = ChatFactory.createChatContext();
- }
- return context;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,60 +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.chat.client.cnt;
-
-import org.ourproject.kune.chat.client.ChatFactory;
-import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
-
-class ChatComponents {
-
- private final ChatContentPresenter owner;
- private ChatRoom chatRoom;
- private ChatInfo chatInfo;
- private ChatRoomControl chatRoomControl;
-
- public ChatComponents(final ChatContentPresenter owner) {
- this.owner = owner;
- }
-
- public ChatRoom getChatRoom() {
- if (chatRoom == null) {
- chatRoom = ChatFactory.createChatRoomViewer(owner);
- }
- return chatRoom;
- }
-
- public ChatRoomControl getChatRoomControl() {
- if (chatRoomControl == null) {
- chatRoomControl = ChatFactory.createChatRoomControlViewer(owner);
- }
- return chatRoomControl;
- }
-
- public ChatInfo getChatInfo() {
- if (chatInfo == null) {
- chatInfo = ChatFactory.createChatInfo(owner);
- }
- return chatInfo;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,9 +21,9 @@
package org.ourproject.kune.chat.client.cnt;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface ChatContent extends WorkspaceComponent {
+public interface ChatContent {
+
void setState(StateDTO state);
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -23,37 +23,31 @@
import org.ourproject.kune.chat.client.ChatClientTool;
import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomListener;
-import org.ourproject.kune.platf.client.PlatformEvents;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
-import org.ourproject.kune.platf.client.ui.UnknowComponent;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
+import com.allen_sauer.gwt.log.client.Log;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
+import com.calclab.suco.client.container.Provider;
-public class ChatContentPresenter implements ChatContent, ChatRoomListener {
+public class ChatContentPresenter implements ChatContent {
private final WorkspaceDeckView view;
- private final ChatComponents components;
private StateDTO state;
private final EmiteUIDialog emiteUIDialog;
+ private final Provider<ChatInfo> chatInfoProvider;
+ private final Provider<ChatRoom> chatRoomProvider;
- public ChatContentPresenter(final EmiteUIDialog emiteUIDialog, final WorkspaceDeckView view) {
+ public ChatContentPresenter(final EmiteUIDialog emiteUIDialog, final WorkspaceDeckView view,
+ final Provider<ChatInfo> chatInfoProvider, final Provider<ChatRoom> chatRoomProvider) {
this.emiteUIDialog = emiteUIDialog;
this.view = view;
- this.components = new ChatComponents(this);
+ this.chatInfoProvider = chatInfoProvider;
+ this.chatRoomProvider = chatRoomProvider;
}
- public void attach() {
- }
-
- public void detach() {
- }
-
public View getView() {
return view;
}
@@ -67,20 +61,11 @@
this.state = state;
final String typeId = state.getTypeId();
if (typeId.equals(ChatClientTool.TYPE_ROOT)) {
- final ChatInfo info = components.getChatInfo();
- view.show(info.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ chatInfoProvider.get().show();
} else if (typeId.equals(ChatClientTool.TYPE_ROOM)) {
- final ChatRoom viewer = components.getChatRoom();
- view.show(viewer.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ chatRoomProvider.get().show();
} else {
- view.show(UnknowComponent.instance.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ Log.error("Programming error: unknown component!! please contact kune-devel(a)lists-ourproject.org");
}
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfo.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfo.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.chat.client.cnt.info;
-import org.ourproject.kune.platf.client.Component;
+public interface ChatInfo {
-public interface ChatInfo extends Component {
+ void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,23 +20,20 @@
package org.ourproject.kune.chat.client.cnt.info.ui;
import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomListener;
-import org.ourproject.kune.platf.client.View;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
-public class ChatInfoPanel extends VerticalPanel implements ChatInfo, View {
+public class ChatInfoPanel extends VerticalPanel implements ChatInfo {
private final VerticalPanel stateArea;
- public ChatInfoPanel(final ChatRoomListener listener) {
- FlowPanel flow = new FlowPanel();
+ public ChatInfoPanel() {
+ final FlowPanel flow = new FlowPanel();
add(flow);
stateArea = new VerticalPanel();
add(stateArea);
}
- public View getView() {
- return this;
+ public void show() {
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.chat.client.cnt.room;
-import org.ourproject.kune.platf.client.Component;
+public interface ChatRoom {
-public interface ChatRoom extends Component {
+ void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -19,8 +19,6 @@
*/
package org.ourproject.kune.chat.client.cnt.room;
-import org.ourproject.kune.platf.client.Component;
+public interface ChatRoomControl {
-public interface ChatRoomControl extends Component {
-
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -23,14 +23,19 @@
public class ChatRoomControlPresenter implements ChatRoomControl {
- private final ChatRoomControlView view;
+ private ChatRoomControlView view;
- public ChatRoomControlPresenter(final ChatRoomControlView view) {
- this.view = view;
+ public View getView() {
+ return view;
}
- public View getView() {
- return view;
+ public void init(final ChatRoomControlView view) {
+ this.view = view;
}
+ public void onEnterRoom() {
+ // TODO Auto-generated method stub
+
+ }
+
}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomListener.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomListener.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,24 +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.chat.client.cnt.room;
-
-public interface ChatRoomListener {
- void onEnterRoom();
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -25,7 +25,7 @@
private final ChatRoomView view;
- public ChatRoomPresenter(ChatRoomView view) {
+ public ChatRoomPresenter(final ChatRoomView view) {
this.view = view;
}
@@ -33,4 +33,7 @@
return view;
}
+ public void show() {
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,8 +20,8 @@
package org.ourproject.kune.chat.client.cnt.room.ui;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlView;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomListener;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.CustomPushButton;
@@ -32,18 +32,18 @@
public class ChatRoomControlPanel extends HorizontalPanel implements ChatRoomControlView {
private final CustomPushButton enterRoomBtn;
- public ChatRoomControlPanel(final ChatRoomListener listener, final I18nTranslationService i18n) {
- enterRoomBtn = new CustomPushButton(i18n.t("Enter room"), new ClickListener() {
- public void onClick(final Widget sender) {
- listener.onEnterRoom();
- }
- });
- add(enterRoomBtn);
- setEnterRoomEnabled(true);
+ public ChatRoomControlPanel(final I18nTranslationService i18n, final ChatRoomControlPresenter presenter) {
+ enterRoomBtn = new CustomPushButton(i18n.t("Enter room"), new ClickListener() {
+ public void onClick(final Widget sender) {
+ presenter.onEnterRoom();
+ }
+ });
+ add(enterRoomBtn);
+ setEnterRoomEnabled(true);
}
public void setEnterRoomEnabled(final boolean isEnabled) {
- enterRoomBtn.setEnabled(isEnabled);
+ enterRoomBtn.setEnabled(isEnabled);
}
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -22,12 +22,14 @@
import org.ourproject.kune.chat.client.cnt.room.ChatRoomView;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.ui.DefaultContentPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-public class ChatRoomPanel extends DefaultContentPanel implements ChatRoomView {
+import com.google.gwt.user.client.ui.Label;
- public ChatRoomPanel() {
- setContent("History of room conversations." + Site.IN_DEVELOPMENT);
+public class ChatRoomPanel implements ChatRoomView {
+
+ public ChatRoomPanel(final WorkspaceSkeleton ws) {
+ ws.getEntityWorkspace().setContent(new Label("History of room conversations." + Site.IN_DEVELOPMENT));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,9 +21,8 @@
package org.ourproject.kune.chat.client.ctx;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface ChatContext extends WorkspaceComponent {
+public interface ChatContext {
void setState(StateDTO state);
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,40 +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.chat.client.ctx;
-
-import org.ourproject.kune.chat.client.ChatFactory;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
-
-class ChatContextComponents {
-
- private RoomsAdmin roomsAdmin;
-
- public ChatContextComponents(final ChatContextPresenter chatContextPresenter) {
- }
-
- public RoomsAdmin getRoomsAdmin() {
- if (roomsAdmin == null) {
- roomsAdmin = ChatFactory.createRoomsAdmin();
- }
- return roomsAdmin;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -25,30 +25,25 @@
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
+import com.calclab.suco.client.container.Provider;
+
public class ChatContextPresenter implements ChatContext {
private final WorkspaceDeckView view;
- private final ChatContextComponents components;
+ private final Provider<RoomsAdmin> roomAdminsProvider;
- public ChatContextPresenter(final WorkspaceDeckView view) {
+ public ChatContextPresenter(final WorkspaceDeckView view, final Provider<RoomsAdmin> roomAdminsProvider) {
this.view = view;
- this.components = new ChatContextComponents(this);
+ this.roomAdminsProvider = roomAdminsProvider;
}
- public void attach() {
- }
-
- public void detach() {
- }
-
public View getView() {
return view;
}
public void setState(final StateDTO state) {
- RoomsAdmin rooms = components.getRoomsAdmin();
+ final RoomsAdmin rooms = roomAdminsProvider.get();
rooms.showRoom(state.getStateToken(), state.getFolder(), state.getFolderRights());
view.show(rooms.getView());
}
-
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/DocToolComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocToolComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocToolComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,52 +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.docs.client;
-
-import org.ourproject.kune.docs.client.cnt.DocumentContent;
-import org.ourproject.kune.docs.client.ctx.DocumentContext;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
-
-class DocToolComponents {
- private DocumentContent content;
- private DocumentContext context;
- private final DocumentClientTool documentClientTool;
- private final DocumentFactory documentFactory;
-
- public DocToolComponents(final DocumentFactory documentFactory, final DocumentClientTool documentClientTool) {
- this.documentFactory = documentFactory;
- this.documentClientTool = documentClientTool;
- }
-
- public DocumentContent getContent() {
- if (content == null) {
- content = documentFactory.createDocumentContent(documentClientTool);
- }
- return content;
- }
-
- public DocumentContext getContext() {
- if (context == null) {
- context = documentFactory.createDocumentContext();
- }
- return context;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -32,28 +32,21 @@
import org.ourproject.kune.docs.client.actions.GoParentFolderAction;
import org.ourproject.kune.docs.client.actions.RenameTokenAction;
import org.ourproject.kune.docs.client.actions.SaveDocumentAction;
-import org.ourproject.kune.docs.client.actions.WSSplitterStartResizingAction;
-import org.ourproject.kune.docs.client.actions.WSSplitterStopResizingAction;
import org.ourproject.kune.platf.client.extend.ClientModule;
import org.ourproject.kune.platf.client.extend.Register;
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.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
public class DocsClientModule implements ClientModule {
private final Session session;
- private final Workspace workspace;
private final StateManager stateManager;
private final I18nTranslationService i18n;
- public DocsClientModule(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
+ public DocsClientModule(final Session session, final StateManager stateManager, final I18nTranslationService i18n) {
this.session = session;
this.stateManager = stateManager;
- this.workspace = workspace;
this.i18n = i18n;
}
@@ -64,12 +57,10 @@
register.addAction(DocsEvents.GO_PARENT_FOLDER, new GoParentFolderAction(stateManager, session));
register.addAction(DocsEvents.ADD_AUTHOR, new ContentAddAuthorAction(stateManager, session));
register.addAction(DocsEvents.REMOVE_AUTHOR, new ContentRemoveAuthorAction(stateManager, session));
- register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session, workspace));
- register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session, workspace));
+ register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session));
+ register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session));
register.addAction(DocsEvents.RENAME_CONTENT, new ContentRenameAction(session));
register.addAction(DocsEvents.DEL_CONTENT, new ContentDelContentAction(stateManager, session));
register.addAction(DocsEvents.RENAME_TOKEN, new RenameTokenAction(session, stateManager));
- register.addAction(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, new WSSplitterStartResizingAction());
- register.addAction(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, new WSSplitterStopResizingAction());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/Document.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/Document.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/Document.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,8 +20,7 @@
package org.ourproject.kune.docs.client;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface Document extends WorkspaceComponent {
+public interface Document {
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,16 +1,42 @@
package org.ourproject.kune.docs.client;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
+import org.ourproject.kune.docs.client.cnt.DocumentContent;
+import org.ourproject.kune.docs.client.cnt.DocumentContentPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.FolderEditor;
+import org.ourproject.kune.docs.client.cnt.folder.FolderEditorPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.ui.FolderEditorPanel;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.ui.FolderViewerPanel;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlPresenter;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlView;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderPresenter;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
+import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderControlPanel;
+import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderPanel;
+import org.ourproject.kune.docs.client.ctx.DocumentContext;
+import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
+import org.ourproject.kune.docs.client.ctx.admin.ui.AdminContextPanel;
+import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
+import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter;
import org.ourproject.kune.platf.client.KunePlatform;
-import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
+import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
+import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
import com.calclab.suco.client.modules.AbstractModule;
import com.calclab.suco.client.provider.Factory;
@@ -24,30 +50,91 @@
@Override
public void onLoad() {
- register(SingletonScope.class, new Factory<DocumentFactory>(DocumentFactory.class) {
- public DocumentFactory create() {
- return new DocumentFactory($(I18nUITranslationService.class), $(Session.class), $p(TagsSummary.class),
- $(WorkspaceSkeleton.class), $(RateIt.class));
- }
- });
+ final I18nUITranslationService i18n = $(I18nUITranslationService.class);
+ final WorkspaceSkeleton ws = $(WorkspaceSkeleton.class);
register(SingletonScope.class, new Factory<DocumentClientTool>(DocumentClientTool.class) {
public DocumentClientTool create() {
- final DocumentFactory factory = $(DocumentFactory.class);
- return new DocumentClientTool(factory, $(I18nUITranslationService.class), $(ToolSelector.class),
- $(WsThemePresenter.class), $(WorkspaceSkeleton.class));
+ return new DocumentClientTool(i18n, $(ToolSelector.class), $(WsThemePresenter.class),
+ $(WorkspaceSkeleton.class), $p(DocumentContent.class), $p(DocumentContext.class));
}
});
+ register(SingletonScope.class, new Factory<AdminContext>(AdminContext.class) {
+ public AdminContext create() {
+ final AdminContextPresenter presenter = new AdminContextPresenter($(Session.class),
+ $p(TagsSummary.class));
+ final AdminContextView view = new AdminContextPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<DocumentContent>(DocumentContent.class) {
+ public DocumentContent create() {
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final DocumentContentPresenter presenter = new DocumentContentPresenter(panel, $(Session.class),
+ $(RateIt.class), $p(DocumentReader.class), $p(DocumentReaderControl.class),
+ $p(TextEditor.class), $p(FolderViewer.class), $p(FolderEditor.class));
+ return presenter;
+ }
+ });
+ register(SingletonScope.class, new Factory<DocumentContext>(DocumentContext.class) {
+ public DocumentContext create() {
+ final WorkspaceDeckPanel view = new WorkspaceDeckPanel();
+ final DocumentContextPresenter presenter = new DocumentContextPresenter(view, $p(FolderContext.class),
+ $p(AdminContext.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<DocumentReader>(DocumentReader.class) {
+ public DocumentReader create() {
+ final DocumentReaderView view = new DocumentReaderPanel(ws);
+ final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<DocumentReaderControl>(DocumentReaderControl.class) {
+ public DocumentReaderControl create() {
+ final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter();
+ final DocumentReaderControlView view = new DocumentReaderControlPanel(presenter, i18n, ws);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<FolderContext>(FolderContext.class) {
+ public FolderContext create() {
+ final FolderContextPresenter presenter = new FolderContextPresenter($(ContextItems.class), i18n);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<FolderEditor>(FolderEditor.class) {
+ public FolderEditor create() {
+ final FolderEditorPanel view = new FolderEditorPanel();
+ final FolderEditorPresenter presenter = new FolderEditorPresenter(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<FolderViewer>(FolderViewer.class) {
+ public FolderViewer create() {
+ final FolderViewerView view = new FolderViewerPanel(ws);
+ final FolderViewerPresenter presenter = new FolderViewerPresenter(view);
+ return presenter;
+ }
+ });
+
final KunePlatform platform = $(KunePlatform.class);
final DocumentClientTool docClientTool = $(DocumentClientTool.class);
platform.addTool(docClientTool);
final Session session = $(Session.class);
final StateManager stateManager = $(StateManager.class);
- final Application application = $(Application.class);
- final I18nUITranslationService i18n = $(I18nUITranslationService.class);
- platform.install(new DocsClientModule(session, stateManager, application.getWorkspace(), i18n));
+ platform.install(new DocsClientModule(session, stateManager, i18n));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,61 +21,54 @@
package org.ourproject.kune.docs.client;
import org.ourproject.kune.docs.client.cnt.DocumentContent;
-import org.ourproject.kune.docs.client.cnt.DocumentContentListener;
import org.ourproject.kune.docs.client.ctx.DocumentContext;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-public class DocumentClientTool extends AbstractClientTool implements DocumentContentListener {
+import com.calclab.suco.client.container.Provider;
+
+public class DocumentClientTool extends AbstractClientTool {
public static final String TYPE_ROOT = "docs.root";
public static final String TYPE_FOLDER = "docs.folder";
public static final String TYPE_DOCUMENT = "docs.doc";
public static final String NAME = "docs";
- private final DocToolComponents components;
+ private final Provider<DocumentContext> documentContextProvider;
+ private final Provider<DocumentContent> documentContentProvider;
- public DocumentClientTool(final DocumentFactory documentFactory, final I18nUITranslationService i18n,
- final ToolSelector toolSelector, final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws) {
+ public DocumentClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws,
+ final Provider<DocumentContent> documentContentProvider,
+ final Provider<DocumentContext> documentContextProvider) {
super(NAME, i18n.t("documents"), toolSelector, wsThemePresenter, ws);
- components = new DocToolComponents(documentFactory, this);
+ this.documentContentProvider = documentContentProvider;
+ this.documentContextProvider = documentContextProvider;
}
- public WorkspaceComponent getContent() {
- return components.getContent();
- }
-
- public WorkspaceComponent getContext() {
- return components.getContext();
- }
-
public String getName() {
return NAME;
}
public void onCancel() {
- components.getContext().showFolders();
+ documentContextProvider.get().showFolders();
}
public void onEdit() {
- components.getContext().showAdmin();
+ documentContextProvider.get().showAdmin();
}
public void setContent(final StateDTO state) {
- final DocumentContent docContent = components.getContent();
- docContent.setContent(state);
+ documentContentProvider.get().setContent(state);
// TODO: check trigger interface (setState)
// trigger.setState(state.getStateToken().toString());
}
public void setContext(final StateDTO state) {
- final DocumentContext context = components.getContext();
- context.setContext(state);
+ documentContextProvider.get().setContext(state);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetLanguageAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetLanguageAction.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetLanguageAction.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -27,32 +27,30 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
public class ContentSetLanguageAction implements Action<String> {
private final Session session;
- private final Workspace workspace;
- public ContentSetLanguageAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
+ public ContentSetLanguageAction(final Session session) {
+ this.session = session;
}
public void execute(final String value) {
- onContentSetLanguage(value);
+ onContentSetLanguage(value);
}
private void onContentSetLanguage(final String languageCode) {
- Site.showProgressProcessing();
- ContentServiceAsync server = ContentService.App.getInstance();
- StateDTO currentState = session.getCurrentState();
- server.setLanguage(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(),
- languageCode, new AsyncCallbackSimple<I18nLanguageDTO>() {
- public void onSuccess(final I18nLanguageDTO lang) {
- Site.hideProgress();
- workspace.getContentSubTitleComponent().setContentLanguage(lang.getEnglishName());
- }
- });
+ Site.showProgressProcessing();
+ final ContentServiceAsync server = ContentService.App.getInstance();
+ final StateDTO currentState = session.getCurrentState();
+ server.setLanguage(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(),
+ languageCode, new AsyncCallbackSimple<I18nLanguageDTO>() {
+ public void onSuccess(final I18nLanguageDTO lang) {
+ Site.hideProgress();
+ // FIXME
+ // workspace.getContentSubTitleComponent().setContentLanguage(lang.getEnglishName());
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetPublishedOnAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetPublishedOnAction.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetPublishedOnAction.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -28,32 +28,30 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
public class ContentSetPublishedOnAction implements Action<Date> {
- private final Workspace workspace;
private final Session session;
- public ContentSetPublishedOnAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
+ public ContentSetPublishedOnAction(final Session session) {
+ this.session = session;
}
public void execute(final Date value) {
- onContentsetPublishedOn(value);
+ onContentsetPublishedOn(value);
}
private void onContentsetPublishedOn(final Date publishedOn) {
- Site.showProgressProcessing();
- ContentServiceAsync server = ContentService.App.getInstance();
- StateDTO currentState = session.getCurrentState();
- server.setPublishedOn(session.getUserHash(), currentState.getGroup().getShortName(), currentState
- .getDocumentId(), publishedOn, new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- Site.hideProgress();
- workspace.getContentTitleComponent().setContentDate(publishedOn);
- }
- });
+ Site.showProgressProcessing();
+ final ContentServiceAsync server = ContentService.App.getInstance();
+ final StateDTO currentState = session.getCurrentState();
+ server.setPublishedOn(session.getUserHash(), currentState.getGroup().getShortName(), currentState
+ .getDocumentId(), publishedOn, new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ Site.hideProgress();
+ // FIXME
+ // workspace.getContentTitleComponent().setContentDate(publishedOn);
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,14 +21,19 @@
package org.ourproject.kune.docs.client.cnt;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface DocumentContent extends WorkspaceComponent {
+import com.calclab.suco.client.signal.Slot0;
- void setContent(StateDTO content);
+public interface DocumentContent {
+ void onCancel(Slot0 slot);
+
+ void onEdit(Slot0 slot);
+
void onSaved();
void onSaveFailed();
+ void setContent(StateDTO content);
+
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,81 +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.docs.client.cnt;
-
-import org.ourproject.kune.docs.client.cnt.folder.FolderEditor;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.editor.TextEditor;
-
-class DocumentContentComponents {
- private DocumentReader reader;
- private TextEditor editor;
- private final DocumentContentPresenter documentContentPresenter;
- private FolderViewer folderViewer;
- private FolderEditor folderEditor;
- private DocumentReaderControl readerControl;
- private final DocumentFactory documentFactory;
-
- public DocumentContentComponents(final DocumentFactory documentFactory,
- final DocumentContentPresenter documentContentPresenter) {
- this.documentFactory = documentFactory;
- this.documentContentPresenter = documentContentPresenter;
- }
-
- public TextEditor getDocumentEditor() {
- if (editor == null) {
- editor = WorkspaceFactory.createDocumentEditor(documentContentPresenter);
- }
- return editor;
- }
-
- public DocumentReader getDocumentReader() {
- if (reader == null) {
- reader = documentFactory.createDocumentReader(documentContentPresenter);
- }
- return reader;
- }
-
- public DocumentReaderControl getDocumentReaderControl() {
- if (readerControl == null) {
- readerControl = documentFactory.createDocumentReaderControl(documentContentPresenter);
- }
- return readerControl;
- }
-
- public FolderEditor getFolderEditor() {
- if (folderEditor == null) {
- folderEditor = documentFactory.createFolderEditor();
- }
- return folderEditor;
- }
-
- public FolderViewer getFolderViewer() {
- if (folderViewer == null) {
- folderViewer = documentFactory.createFolderViewer();
- }
- return folderViewer;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentListener.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentListener.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,27 +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.docs.client.cnt;
-
-public interface DocumentContentListener {
- void onEdit();
-
- void onCancel();
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -25,61 +25,66 @@
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderListener;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
-import org.ourproject.kune.platf.client.PlatformEvents;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.SaveDocumentActionParams;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.editor.TextEditorListener;
-public class DocumentContentPresenter implements DocumentContent, DocumentReaderListener, TextEditorListener {
+import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Signal0;
+import com.calclab.suco.client.signal.Slot0;
+
+public class DocumentContentPresenter implements DocumentContent, TextEditorListener {
private final WorkspaceDeckView view;
- private final DocumentContentComponents components;
private StateDTO content;
- private final DocumentContentListener listener;
- private final DocumentReader reader;
- private final DocumentReaderControl readerControl;
private final Session session;
private final RateIt rateIt;
+ private final Provider<DocumentReaderControl> docReaderControlProvider;
+ private final Provider<DocumentReader> docReaderProvider;
+ private final Provider<FolderEditor> folderEditorProvider;
+ private final Provider<TextEditor> textEditorProvider;
+ private final Provider<FolderViewer> folderViewerProvider;
+ private final Signal0 onEdit;
+ private final Signal0 onCancel;
- public DocumentContentPresenter(final DocumentFactory documentFactory, final DocumentContentListener listener,
- final WorkspaceDeckView view, final Session session, final RateIt rateIt) {
- this.listener = listener;
+ public DocumentContentPresenter(final WorkspaceDeckView view, final Session session, final RateIt rateIt,
+ final Provider<DocumentReader> docReaderProvider,
+ final Provider<DocumentReaderControl> docReaderControlProvider,
+ final Provider<TextEditor> textEditorProvider, final Provider<FolderViewer> folderViewerProvider,
+ final Provider<FolderEditor> folderEditorProvider) {
this.view = view;
this.session = session;
this.rateIt = rateIt;
- this.components = new DocumentContentComponents(documentFactory, this);
- reader = components.getDocumentReader();
- readerControl = components.getDocumentReaderControl();
+ this.docReaderProvider = docReaderProvider;
+ this.docReaderControlProvider = docReaderControlProvider;
+ this.textEditorProvider = textEditorProvider;
+ this.folderViewerProvider = folderViewerProvider;
+ this.folderEditorProvider = folderEditorProvider;
+ this.onEdit = new Signal0("onEdit");
+ this.onCancel = new Signal0("onCancel");
}
- public void attach() {
- }
-
- public void detach() {
- }
-
public View getView() {
return view;
}
public void onCancel() {
showContent();
- listener.onCancel();
+ onCancel.fire();
// Re-enable rateIt widget
rateIt.setVisible(true);
}
+ public void onCancel(final Slot0 slot) {
+ onCancel.add(slot);
+ }
+
public void onDelete() {
DefaultDispatcher.getInstance().fire(DocsEvents.DEL_CONTENT, content.getDocumentId());
}
@@ -90,38 +95,36 @@
if (content.hasDocument()) {
// Don't permit rate content while your are editing
rateIt.setVisible(false);
- final TextEditor editor = components.getDocumentEditor();
+ final TextEditor editor = textEditorProvider.get();
editor.setContent(content.getContent());
view.show(editor.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, editor.getToolBar()));
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
} else {
- final FolderEditor editor = components.getFolderEditor();
+ final FolderEditor editor = folderEditorProvider.get();
editor.setFolder(content.getFolder());
view.show(editor.getView());
}
- listener.onEdit();
+ onEdit.fire();
}
});
}
+ public void onEdit(final Slot0 slot) {
+ onEdit.add(slot);
+ }
+
public void onSave(final String text) {
content.setContent(text);
DefaultDispatcher.getInstance().fire(DocsEvents.SAVE_DOCUMENT, new SaveDocumentActionParams(content, this));
// Re-enable rateIt widget
rateIt.setVisible(true);
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
}
public void onSaved() {
- components.getDocumentEditor().onSaved();
+ textEditorProvider.get().onSaved();
}
public void onSaveFailed() {
- components.getDocumentEditor().onSaveFailed();
+ textEditorProvider.get().onSaveFailed();
}
public void onTranslate() {
@@ -134,19 +137,14 @@
private void showContent() {
if (content.hasDocument()) {
- reader.showDocument(content.getContent());
- components.getDocumentEditor().reset();
- readerControl.setRights(content.getContentRights());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, readerControl.getView()));
- view.show(reader.getView());
+ docReaderProvider.get().showDocument(content.getContent());
+ textEditorProvider.get().reset();
+ docReaderControlProvider.get().setRights(content.getContentRights());
+ docReaderControlProvider.get().show();
+ docReaderProvider.get().show();
} else {
- final FolderViewer viewer = components.getFolderViewer();
+ final FolderViewer viewer = folderViewerProvider.get();
viewer.setFolder(content.getFolder());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
view.show(viewer.getView());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -22,11 +22,13 @@
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.ui.DefaultContentPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-public class FolderViewerPanel extends DefaultContentPanel implements FolderViewerView {
+import com.google.gwt.user.client.ui.Label;
- public FolderViewerPanel() {
- setContent("Folder properties, translations ..." + Site.IN_DEVELOPMENT);
+public class FolderViewerPanel implements FolderViewerView {
+
+ public FolderViewerPanel(final WorkspaceSkeleton ws) {
+ ws.getEntityWorkspace().setContent(new Label("Folder properties, translations ..." + Site.IN_DEVELOPMENT));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -24,7 +24,9 @@
public interface DocumentReader {
+ View getView();
+
+ void show();
+
void showDocument(String text);
-
- View getView();
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControl.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControl.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -25,8 +25,10 @@
public interface DocumentReaderControl {
+ View getView();
+
void setRights(AccessRightsDTO accessRights);
- View getView();
+ void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -24,19 +24,32 @@
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
public class DocumentReaderControlPresenter implements DocumentReaderControl {
- private final DocumentReaderControlView view;
+ private DocumentReaderControlView view;
- public DocumentReaderControlPresenter(final DocumentReaderControlView view) {
- this.view = view;
+ public View getView() {
+ return view;
}
+ public void init(final DocumentReaderControlView view) {
+ this.view = view;
+ }
+
+ public void onDelete() {
+ }
+
+ public void onEdit() {
+ }
+
+ public void onTranslate() {
+ }
+
public void setRights(final AccessRightsDTO accessRights) {
- view.setEditEnabled(accessRights.isEditable());
- view.setDeleteEnabled(accessRights.isAdministrable());
- view.setTranslateEnabled(accessRights.isEditable());
+ view.setEditEnabled(accessRights.isEditable());
+ view.setDeleteEnabled(accessRights.isAdministrable());
+ view.setTranslateEnabled(accessRights.isEditable());
}
- public View getView() {
- return view;
+ public void show() {
+ view.show();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlView.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlView.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -24,10 +24,12 @@
public interface DocumentReaderControlView extends View {
+ public void setDeleteEnabled(boolean isEnabled);
+
public void setEditEnabled(boolean isEnabled);
- public void setDeleteEnabled(boolean isEnabled);
-
public void setTranslateEnabled(boolean isEnabled);
+ public void show();
+
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderListener.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderListener.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -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.docs.client.cnt.reader;
-
-public interface DocumentReaderListener {
-
- void onEdit();
-
- void onDelete();
-
- void onTranslate();
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -26,14 +26,17 @@
private final DocumentReaderView view;
public DocumentReaderPresenter(final DocumentReaderView view) {
- this.view = view;
+ this.view = view;
}
- public void showDocument(final String text) {
- view.setContent(text);
+ public View getView() {
+ return view;
}
- public View getView() {
- return view;
+ public void show() {
}
+
+ public void showDocument(final String text) {
+ view.setContent(text);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,10 +20,10 @@
package org.ourproject.kune.docs.client.cnt.reader.ui;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlPresenter;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlView;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderListener;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.CustomPushButton;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.ClickListener;
@@ -35,25 +35,25 @@
private final CustomPushButton deleteBtn;
private final CustomPushButton translateBtn;
- public DocumentReaderControlPanel(final DocumentReaderListener listener, final I18nTranslationService i18n,
- final WorkspaceSkeleton ws) {
+ public DocumentReaderControlPanel(final DocumentReaderControlPresenter presenter,
+ final I18nUITranslationService i18n, final WorkspaceSkeleton ws) {
editBtn = new CustomPushButton(i18n.tWithNT("Edit", "used in button"), new ClickListener() {
public void onClick(final Widget sender) {
- listener.onEdit();
+ presenter.onEdit();
editBtn.removeStyleDependentName("up-hovering");
}
});
deleteBtn = new CustomPushButton(i18n.tWithNT("Delete", "used in button"), new ClickListener() {
public void onClick(final Widget sender) {
- listener.onDelete();
+ presenter.onDelete();
deleteBtn.removeStyleDependentName("up-hovering");
}
});
translateBtn = new CustomPushButton(i18n.tWithNT("Translate", "used in button"), new ClickListener() {
public void onClick(final Widget sender) {
- listener.onTranslate();
+ presenter.onTranslate();
translateBtn.removeStyleDependentName("up-hovering");
ws.showAlertMessage(i18n.t("Alert"), i18n.t("Sorry, this functionality is currently in development"));
}
@@ -81,4 +81,8 @@
translateBtn.setVisible(isEnabled);
}
+ public void show() {
+
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,11 +21,19 @@
package org.ourproject.kune.docs.client.cnt.reader.ui;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
-import org.ourproject.kune.workspace.client.workspace.ui.DefaultContentPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-public class DocumentReaderPanel extends DefaultContentPanel implements DocumentReaderView {
+import com.google.gwt.user.client.ui.HTML;
- public DocumentReaderPanel() {
- setContent("This is the content");
+public class DocumentReaderPanel implements DocumentReaderView {
+
+ private final WorkspaceSkeleton ws;
+
+ public DocumentReaderPanel(final WorkspaceSkeleton ws) {
+ this.ws = ws;
}
+
+ public void setContent(final String content) {
+ ws.getEntityWorkspace().setContent(new HTML(content));
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,9 +21,9 @@
package org.ourproject.kune.docs.client.ctx;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface DocumentContext extends WorkspaceComponent {
+public interface DocumentContext {
+
void setContext(StateDTO state);
void showAdmin();
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,51 +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.docs.client.ctx;
-
-import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
-import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
-
-class DocumentContextComponents {
-
- private FolderContext folderContext;
- private AdminContext adminContext;
- private final DocumentFactory documentFactory;
-
- public DocumentContextComponents(final DocumentFactory documentFactory, final DocumentContextPresenter listener) {
- this.documentFactory = documentFactory;
- }
-
- public AdminContext getAdminContext() {
- if (adminContext == null) {
- adminContext = documentFactory.createAdminContext();
- }
- return adminContext;
- }
-
- public FolderContext getFolderContext() {
- if (folderContext == null) {
- folderContext = documentFactory.createFolderContext();
- }
- return folderContext;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -22,47 +22,43 @@
import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
+import com.calclab.suco.client.container.Provider;
+
public class DocumentContextPresenter implements DocumentContext {
private final WorkspaceDeckView view;
- private final DocumentContextComponents components;
+ private final Provider<FolderContext> folderContextProvider;
+ private final Provider<AdminContext> adminContextProvider;
- public DocumentContextPresenter(final DocumentFactory documentFactory, final WorkspaceDeckView view) {
- this.view = view;
- this.components = new DocumentContextComponents(documentFactory, this);
+ public DocumentContextPresenter(final WorkspaceDeckView view, final Provider<FolderContext> folderContexProvider,
+ final Provider<AdminContext> adminContextProvider) {
+ this.view = view;
+ this.folderContextProvider = folderContexProvider;
+ this.adminContextProvider = adminContextProvider;
}
- public void attach() {
- }
-
- public void detach() {
- }
-
public View getView() {
- return view;
+ return view;
}
public void setContext(final StateDTO content) {
- StateToken state = content.getStateToken();
- FolderContext folderContext = components.getFolderContext();
- folderContext.setContainer(state, content.getFolder(), content.getFolderRights());
- AdminContext adminContext = components.getAdminContext();
- adminContext.setState(content);
- view.show(folderContext.getView());
+ final StateToken state = content.getStateToken();
+ folderContextProvider.get().setContainer(state, content.getFolder(), content.getFolderRights());
+ adminContextProvider.get().setState(content);
+ view.show(folderContextProvider.get().getView());
}
public void showAdmin() {
- AdminContext adminContext = components.getAdminContext();
- view.show(adminContext.getView());
+ final AdminContext adminContext = adminContextProvider.get();
+ view.show(adminContext.getView());
}
public void showFolders() {
- FolderContext folderContext = components.getFolderContext();
- view.show(folderContext.getView());
+ final FolderContext folderContext = folderContextProvider.get();
+ view.show(folderContext.getView());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -36,7 +36,7 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
import com.calclab.suco.client.container.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -29,15 +29,13 @@
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
import com.google.gwt.user.client.ui.VerticalPanel;
-import com.gwtext.client.widgets.form.FormPanel;
public class AdminContextPanel extends VerticalPanel implements AdminContextView {
- private static final Images IMG = Images.App.getInstance();
+ // private static final Images IMG = Images.App.getInstance();
- private static final int FORMS_WIDTH = 145;
+ // private static final int FORMS_WIDTH = 145;
// private final IndexedStackPanelWithSubItems options;
// private final AdminContextPresenter presenter;
@@ -195,23 +193,24 @@
// tagsField.setValue(tags);
}
- private void addComponent(final String header, final String headerTitle, final VerticalPanel panel) {
- // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
- // final VerticalPanel vp = options.addStackItem(header, headerTitle,
- // false);
- // vp.setStyleName("kune-AdminContextPanel-inner");
- // vp.add(panel);
- // vp.setCellWidth(panel, "100%");
- // vp.setWidth("100%");
- }
+ // private void addComponent(final String header, final String headerTitle,
+ // final VerticalPanel panel) {
+ // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
+ // final VerticalPanel vp = options.addStackItem(header, headerTitle,
+ // false);
+ // vp.setStyleName("kune-AdminContextPanel-inner");
+ // vp.add(panel);
+ // vp.setCellWidth(panel, "100%");
+ // vp.setWidth("100%");
+ // }
- private FormPanel createDefaultForm() {
- final FormPanel form = new FormPanel();
- form.setHideLabels(true);
- form.setWidth(FORMS_WIDTH);
- form.setBorder(false);
- return form;
- }
+ // private FormPanel createDefaultForm() {
+ // final FormPanel form = new FormPanel();
+ // form.setHideLabels(true);
+ // form.setWidth(FORMS_WIDTH);
+ // form.setBorder(false);
+ // return form;
+ // }
// private VerticalPanel createPublicationComponent() {
// // final FormPanel form = createDefaultForm();
@@ -252,8 +251,8 @@
// return vp;
// }
- private void removeComponent(final String header) {
- // options.removeStackItem(header);
- }
+ // private void removeComponent(final String header) {
+ // options.removeStackItem(header);
+ // }
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,127 +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.docs.client.ui;
-
-import org.ourproject.kune.docs.client.cnt.DocumentContent;
-import org.ourproject.kune.docs.client.cnt.DocumentContentListener;
-import org.ourproject.kune.docs.client.cnt.DocumentContentPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.FolderEditor;
-import org.ourproject.kune.docs.client.cnt.folder.FolderEditorPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.ui.FolderEditorPanel;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.ui.FolderViewerPanel;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlPresenter;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlView;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderListener;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderPresenter;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
-import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderControlPanel;
-import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderPanel;
-import org.ourproject.kune.docs.client.ctx.DocumentContext;
-import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
-import org.ourproject.kune.docs.client.ctx.admin.ui.AdminContextPanel;
-import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
-import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.ui.rate.RateIt;
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
-
-import com.calclab.suco.client.container.Provider;
-
-public class DocumentFactory {
-
- private final I18nTranslationService i18n;
- private final Session session;
- private final Provider<TagsSummary> tagsSummaryProvider;
- private final WorkspaceSkeleton ws;
- private final RateIt rateIt;
-
- public DocumentFactory(final I18nTranslationService i18n, final Session session,
- final Provider<TagsSummary> tagsSummaryProvider, final WorkspaceSkeleton ws, final RateIt rateIt) {
- this.i18n = i18n;
- this.session = session;
- this.tagsSummaryProvider = tagsSummaryProvider;
- this.ws = ws;
- this.rateIt = rateIt;
- }
-
- public AdminContext createAdminContext() {
- final AdminContextPresenter presenter = new AdminContextPresenter(session, tagsSummaryProvider);
- final AdminContextView view = new AdminContextPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
- public DocumentContent createDocumentContent(final DocumentContentListener listener) {
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel, session, rateIt);
- return presenter;
- }
-
- public DocumentContext createDocumentContext() {
- final WorkspaceDeckPanel view = new WorkspaceDeckPanel();
- final DocumentContextPresenter presenter = new DocumentContextPresenter(this, view);
- return presenter;
- }
-
- public DocumentReader createDocumentReader(final DocumentReaderListener listener) {
- final DocumentReaderView view = new DocumentReaderPanel();
- final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
- return presenter;
- }
-
- public DocumentReaderControl createDocumentReaderControl(final DocumentReaderListener listener) {
- final DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n, ws);
- final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter(view);
- return presenter;
- }
-
- public FolderContext createFolderContext() {
- final ContextItems contextItems = WorkspaceFactory.createContextItems();
- final FolderContextPresenter presenter = new FolderContextPresenter(contextItems, i18n);
- return presenter;
- }
-
- public FolderEditor createFolderEditor() {
- final FolderEditorPanel view = new FolderEditorPanel();
- final FolderEditorPresenter presenter = new FolderEditorPresenter(view);
- return presenter;
- }
-
- public FolderViewer createFolderViewer() {
- final FolderViewerView view = new FolderViewerPanel();
- final FolderViewerPresenter presenter = new FolderViewerPresenter(view);
- return presenter;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/Component.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/Component.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/Component.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,24 +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.platf.client;
-
-public interface Component {
- View getView();
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -26,7 +26,6 @@
import org.ourproject.kune.platf.client.dispatch.ActionEvent;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ClientTool;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
import com.calclab.suco.client.signal.Slot0;
@@ -34,8 +33,6 @@
ClientTool getTool(String toolName);
- Workspace getWorkspace();
-
void init(StateManager stateManager, HashMap<String, ClientTool> tools);
void onApplicationStart(Slot0 slot);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -38,7 +38,6 @@
import org.ourproject.kune.platf.client.utils.PrefetchUtilities;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.signal.Signal0;
@@ -47,6 +46,7 @@
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.WindowCloseListener;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.RootPanel;
public class ApplicationDefault implements Application {
// private final Workspace workspace;
@@ -58,8 +58,6 @@
public ApplicationDefault(final Session session, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) {
this.session = session;
- // workspace = WorkspaceFactory.createWorkspace(session,
- // extensionPointManager, i18n, errorHandler);
tools = new HashMap<String, ClientTool>();
this.onApplicationStart = new Signal0("onApplicationStart");
this.onApplicationStop = new Signal0("onApplicationStop");
@@ -78,11 +76,6 @@
return tools.get(toolName);
}
- @Deprecated
- public Workspace getWorkspace() {
- return null;
- }
-
public void init(final StateManager stateManager, final HashMap<String, ClientTool> tools) {
this.stateManager = stateManager;
this.tools = tools;
@@ -125,6 +118,7 @@
final SiteServiceAsync server = SiteService.App.getInstance();
server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
public void onFailure(final Throwable error) {
+ RootPanel.get("kuneinitialcurtain").setVisible(false);
Site.error("Error fetching initial data");
Log.debug(error.getMessage());
}
@@ -134,6 +128,7 @@
session.setInitData(initData);
session.setCurrentUserInfo(initData.getUserInfo());
stateManager.reload();
+ RootPanel.get("kuneinitialcurtain").setVisible(false);
}
private void checkChatDomain(final String chatDomain) {
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidget.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidget.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidget.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,12 +0,0 @@
-package org.ourproject.kune.platf.client.extend;
-
-
-public interface ExtensibleWidget {
-
- public void attach(ExtensibleWidgetChild child);
-
- public void detach(ExtensibleWidgetChild child);
-
- public void detachAll(String id);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetChild.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetChild.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetChild.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,56 +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.platf.client.extend;
-
-import org.ourproject.kune.platf.client.View;
-
-public class ExtensibleWidgetChild {
- private final String parentId;
- private final View view;
-
- /**
- *
- * @param parentId
- * id of the extensible widget
- * @param view
- * view (a widget) to attach/detach to the extensible widget
- */
- public ExtensibleWidgetChild(final String parentId, final View view) {
- this.parentId = parentId;
- this.view = view;
- }
-
- /**
- *
- * @return the id of the extensible widget
- */
- public String getParentId() {
- return parentId;
- }
-
- /**
- *
- * @return the view to attach/dettach to the extensible widget
- */
- public View getView() {
- return view;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetId.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetId.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetId.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,33 +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.platf.client.extend;
-
-public interface ExtensibleWidgetId {
- // Not yet implemented/used EW:
- // public static final String CONTENT_TOOLBAR_RIGHT =
- // "ws.entity.content.toolbar.right";
- // public static final String CONTENT_BOTTOM_TOOLBAR_RIGHT =
- // "ws.entity.content.bottomtb.right";
- // public static final String CONTENT_BOTTOM_TOOLBAR_LEFT =
- // "ws.entity.content.bottomtb.left";
- public static final String CONTENT_TOOLBAR_LEFT = "ws.entity.content.toolbar.left";
- public static final String CONTENT_BOTTOM_ICONBAR = "ws.site.bottom.iconbar";
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetsManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetsManager.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetsManager.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,72 +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.platf.client.extend;
-
-import java.util.HashMap;
-
-public class ExtensibleWidgetsManager {
-
- private final HashMap<String, ExtensibleWidget> extWidgets;
-
- public ExtensibleWidgetsManager() {
- extWidgets = new HashMap<String, ExtensibleWidget>();
- }
-
- public void registerExtensibleWidget(final String id, final ExtensibleWidget extWidget) {
- extWidgets.put(id, extWidget);
- }
-
- public void attachToExtensible(final ExtensibleWidgetChild child) {
- ExtensibleWidget extWidget = getExtensible(child.getParentId());
- if (extWidget != null) {
- extWidget.attach(child);
- }
- }
-
- public void detachFromExtensible(final ExtensibleWidgetChild child) {
- ExtensibleWidget extWidget = getExtensible(child.getParentId());
- if (extWidget != null) {
- extWidget.detach(child);
- }
- }
-
- public void registerExtensibleWidgets(final HashMap<String, ExtensibleWidget> extWidgets) {
- this.extWidgets.putAll(extWidgets);
- }
-
- private ExtensibleWidget getExtensible(final String id) {
- ExtensibleWidget extWidget = this.extWidgets.get(id);
- return extWidget;
- }
-
- /**
- *
- * Detach all widtgets from a extensible widget
- *
- * @param id
- * id of the extensible widget
- */
- public void detachAll(final String id) {
- ExtensibleWidget extWidget = getExtensible(id);
- if (extWidget != null) {
- extWidget.detachAll(id);
- }
- }
-}
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-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -32,23 +32,35 @@
import org.ourproject.kune.platf.client.ui.rate.RateItPresenter;
import org.ourproject.kune.platf.client.ui.rate.RatePanel;
import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
-import org.ourproject.kune.workspace.client.WorkspaceClientModule;
+import org.ourproject.kune.workspace.client.editor.TextEditor;
+import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
+import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPresenter;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorView;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
import org.ourproject.kune.workspace.client.i18n.ui.I18nTranslatorPanel;
+import org.ourproject.kune.workspace.client.i18n.ui.LanguageSelectorPanel;
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.newgroup.NewGroup;
+import org.ourproject.kune.workspace.client.newgroup.NewGroupPanel;
import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
-import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
-import org.ourproject.kune.workspace.client.presence.ui.GroupSummaryPanel;
+import org.ourproject.kune.workspace.client.search.EntityLiveSearcherView;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearchPanel;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearcherPresenter;
import org.ourproject.kune.workspace.client.search.SiteSearcher;
import org.ourproject.kune.workspace.client.search.SiteSearcherPanel;
import org.ourproject.kune.workspace.client.search.SiteSearcherPresenter;
import org.ourproject.kune.workspace.client.search.SiteSearcherView;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcher;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcherPanel;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcherPresenter;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import org.ourproject.kune.workspace.client.sitebar.login.SignIn;
@@ -60,21 +72,27 @@
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserService;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
-import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherView;
-import org.ourproject.kune.workspace.client.socialnet.GroupLiveSearcherPresenter;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanel;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenter;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryView;
+import org.ourproject.kune.workspace.client.socialnet.ParticipationSummary;
+import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPanel;
import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPresenter;
import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryView;
-import org.ourproject.kune.workspace.client.socialnet.UserLiveSearcherPresenter;
-import org.ourproject.kune.workspace.client.socialnet.ui.GroupLiveSearchPanel;
-import org.ourproject.kune.workspace.client.socialnet.ui.ParticipationSummaryPanel;
-import org.ourproject.kune.workspace.client.socialnet.ui.UserLiveSearcherPanel;
+import org.ourproject.kune.workspace.client.summary.GroupSummary;
+import org.ourproject.kune.workspace.client.summary.GroupSummaryPanel;
import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPanel;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.entitylogo.EntityLogo;
+import org.ourproject.kune.workspace.client.ui.newtmp.entitylogo.EntityLogoPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.entitylogo.EntityLogoPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
@@ -111,15 +129,6 @@
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupLiveSearcher;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.workspace.GroupSummary;
-import org.ourproject.kune.workspace.client.workspace.ParticipationSummary;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
-import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher;
-import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
-import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel;
-import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPresenter;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.calclab.suco.client.container.Container;
@@ -377,7 +386,7 @@
public I18nTranslator create() {
final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter($(Session.class),
$(I18nServiceAsync.class), i18n);
- final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n);
+ final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n, $(LanguageSelector.class), ws);
presenter.init(view);
return presenter;
}
@@ -522,7 +531,7 @@
register(SingletonScope.class, new Factory<TagsSummary>(TagsSummary.class) {
public TagsSummary create() {
- final TagsSummaryPresenter presenter = new TagsSummaryPresenter($p(Session.class),
+ final TagsSummaryPresenter presenter = new TagsSummaryPresenter($(Session.class),
$p(SiteSearcher.class), $(StateManager.class), $(WsThemePresenter.class));
final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws);
presenter.init(panel);
@@ -558,6 +567,33 @@
}
});
+ register(SingletonScope.class, new Factory<TextEditor>(TextEditor.class) {
+ public TextEditor create() {
+ final TextEditorPresenter presenter = new TextEditorPresenter(null, true);
+ final TextEditorPanel panel = new TextEditorPanel(presenter, i18n);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<LanguageSelector>(LanguageSelector.class) {
+ public LanguageSelector create() {
+ final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter($(Session.class));
+ final LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ContextItems>(ContextItems.class) {
+ public ContextItems create() {
+ final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n, $(StateManager.class));
+ final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n, $(StateManager.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
load(new EmiteUIModule(), new DocumentClientNewModule(), new ChatClientNewModule());
$(SitePublicSpaceLink.class);
@@ -569,6 +605,11 @@
$(SiteSearch.class);
$(SiteLogo.class);
+ $(GroupMembersSummary.class);
+ $(ParticipationSummary.class);
+ $(TagsSummary.class);
+ $(GroupSummary.class);
+
$(EntityLogo.class);
$(EntityTitlePresenter.class);
$(EntitySubTitlePresenter.class);
@@ -577,11 +618,6 @@
$(RateIt.class);
$(RatePresenter.class);
- $(GroupMembersSummary.class);
- $(ParticipationSummary.class);
- $(TagsSummary.class);
- $(GroupSummary.class);
-
// Register of tokens like "signin", "newgroup", "translate" etcetera
$(StateManager.class).addSiteToken(SiteToken.signin.toString(), new Slot<StateToken>() {
public void onEvent(final StateToken previousStateToken) {
@@ -596,11 +632,8 @@
});
final KunePlatform platform = $(KunePlatform.class);
- platform.install(new WorkspaceClientModule($(Session.class), $(StateManager.class), $(Application.class)
- .getWorkspace(), i18n));
$(Application.class).init($(StateManager.class), platform.getIndexedTools());
$(Application.class).subscribeActions(platform.getActions());
- // $(Application.class).getWorkspace().attachTools(platform.getTools().iterator());
$(Application.class).start();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,14 +21,9 @@
package org.ourproject.kune.platf.client.tool;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
public interface ClientTool {
- WorkspaceComponent getContent();
-
- WorkspaceComponent getContext();
-
String getName();
void setContent(StateDTO state);
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/BottomTrayIcon.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/BottomTrayIcon.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/BottomTrayIcon.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,43 +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.platf.client.ui;
-
-import org.ourproject.kune.platf.client.View;
-
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.MenuBar;
-import com.google.gwt.user.client.ui.MenuItem;
-
-public class BottomTrayIcon extends MenuBar implements View {
-
- public BottomTrayIcon(final String title) {
- super(true);
- KuneUiUtils.setQuickTip(this, title);
- super.addStyleDependentName("kune-IconBottomMenu-offset");
- super.addStyleName("kune-Margin-Medium-r");
- super.setStyleName("kune-IconBottomPanel");
- }
-
- public MenuItem addMainButton(final AbstractImagePrototype icon, final Command cmd) {
- return super.addItem(icon.getHTML(), true, cmd);
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -66,9 +66,9 @@
public void add(final Panel panel, final Widget widget) {
panel.add(widget);
if (panel.isRendered()) {
- mainPanel.doLayout(false);
- // panel.syncSize();
- // panel.doLayout();
+ panel.syncSize();
+ panel.doLayout();
+ doLayoutIfNeeded();
}
// doLayoutIfNeeded();
}
@@ -111,12 +111,6 @@
}
}
- public void doLayoutIfNeeded(final boolean includeChilds) {
- if (mainPanel.isRendered()) {
- mainPanel.doLayout(!includeChilds);
- }
- }
-
public Panel getPanel() {
return mainPanel;
}
@@ -129,11 +123,6 @@
mainPanel.setBorder(border);
}
- @Deprecated
- public void setCls(final String style) {
- mainPanel.setCls(style);
- }
-
public void setPanel(final Panel panel, final Widget widget) {
panel.clear();
add(panel, widget);
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -0,0 +1,34 @@
+package org.ourproject.kune.platf.client.ui;
+
+import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Slot;
+
+public class MenuItem<T> {
+
+ final String icon;
+ final String title;
+ private final Signal<T> onClick;
+
+ public MenuItem(final String icon, final String title, final Slot<T> slot) {
+ this.icon = icon;
+ this.title = title;
+ this.onClick = new Signal<T>("onClick");
+ onClick(slot);
+ }
+
+ public void fire(final T id) {
+ onClick.fire(id);
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void onClick(final Slot<T> slot) {
+ onClick.add(slot);
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -19,12 +19,11 @@
*/
package org.ourproject.kune.platf.client.ui;
-import org.ourproject.kune.platf.client.Component;
import org.ourproject.kune.platf.client.View;
import com.google.gwt.user.client.ui.Label;
-public class UnknowComponent extends Label implements View, Component {
+public class UnknowComponent extends Label implements View {
public static final UnknowComponent instance = new UnknowComponent();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import org.ourproject.kune.platf.client.ui.MenuItem;
+
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.gwtext.client.core.EventObject;
@@ -47,7 +49,7 @@
menu = new Menu();
}
- public void addMenuItem(final GridMenuItem<T> menuItem) {
+ public void addMenuItem(final MenuItem<T> menuItem) {
final Item item = new Item(menuItem.getTitle());
item.setIcon(menuItem.getIcon());
menu.addItem(item);
@@ -65,7 +67,7 @@
@SuppressWarnings("unchecked")
public void addMenuItemList(final GridMenuItemCollection list) {
for (final Iterator iterator = list.iterator(); iterator.hasNext();) {
- final GridMenuItem item = (GridMenuItem) iterator.next();
+ final MenuItem item = (MenuItem) iterator.next();
addMenuItem(item);
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItem.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItem.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,34 +0,0 @@
-package org.ourproject.kune.platf.client.ui.gridmenu;
-
-import com.calclab.suco.client.signal.Signal;
-import com.calclab.suco.client.signal.Slot;
-
-public class GridMenuItem<T> {
-
- final String icon;
- final String title;
- private final Signal<T> onClick;
-
- public GridMenuItem(final String icon, final String title, final Slot<T> slot) {
- this.icon = icon;
- this.title = title;
- this.onClick = new Signal<T>("onClick");
- onClick(slot);
- }
-
- public void fire(final T id) {
- onClick.fire(id);
- }
-
- public String getIcon() {
- return icon;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void onClick(final Slot<T> slot) {
- onClick.add(slot);
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -23,8 +23,10 @@
import java.util.ArrayList;
-public class GridMenuItemCollection<T> extends ArrayList<GridMenuItem<T>> {
+import org.ourproject.kune.platf.client.ui.MenuItem;
+public class GridMenuItemCollection<T> extends ArrayList<MenuItem<T>> {
+
private static final long serialVersionUID = 1L;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -61,9 +61,6 @@
private final Signal<String> onDoubleClick;
private Toolbar topBar;
private Toolbar bottomBar;
- private final String emptyText;
- private final GridDragConfiguration gridDragConfiguration;
- private final GridDropConfiguration gridDropConfiguration;
private ColumnModel columnModel;
private final boolean withEndIcon;
@@ -92,9 +89,6 @@
public GridMenuPanel(final String emptyText, final GridDragConfiguration gridDragConfiguration,
final GridDropConfiguration gridDropConfiguration, final boolean grouped, final boolean withCounters,
final boolean withTopBar, final boolean withBottomBar, final boolean withEndIcon) {
- this.emptyText = emptyText;
- this.gridDragConfiguration = gridDragConfiguration;
- this.gridDropConfiguration = gridDropConfiguration;
this.onClick = new Signal<String>("onClick");
this.onDoubleClick = new Signal<String>("onDoubleClick");
this.grouped = grouped;
@@ -113,6 +107,7 @@
}
menuMap = new HashMap<String, GridMenu<T>>();
recordMap = new HashMap<T, Record>();
+ createGrid(emptyText, gridDragConfiguration, gridDropConfiguration);
}
public GridMenuPanel(final String emptyText, final GridDropConfiguration gridDropConfiguration) {
@@ -125,7 +120,6 @@
}
public void addItem(final GridItem<T> gridItem) {
- createGridIfNeeded();
final String id = gridItem.getId();
final Record newRecord = recordDef
.createRecord(id, new Object[] { gridItem.getGroup().getName(), gridItem.getGroup().getTooltipTitle(),
@@ -170,6 +164,12 @@
};
}
+ @Override
+ public void doLayout(final boolean shallow) {
+ // Grid rendered problems with shallow false
+ super.doLayout();
+ }
+
public void doLayoutIfNeeded() {
if (super.isRendered()) {
super.doLayout();
@@ -446,12 +446,6 @@
super.add(grid);
}
- private void createGridIfNeeded() {
- if (grid == null) {
- createGrid(emptyText, gridDragConfiguration, gridDropConfiguration);
- }
- }
-
private void onClick(final int rowIndex) {
final Record record = store.getRecordAt(rowIndex);
onClick.fire(record.getAsString(ID));
Modified: trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -3,7 +3,7 @@
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePresenter;
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView;
Added: trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -0,0 +1,47 @@
+package org.ourproject.kune.workspace.client.tags;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.suco.client.container.Provider;
+
+public class TagsSummaryPresenterTest {
+
+ private TagsSummaryPresenter tagsSummaryPresenter;
+ private TagsSummaryView view;
+
+ @SuppressWarnings("unchecked")
+ @Before
+ public void before() {
+ final Session session = Mockito.mock(Session.class);
+ final StateManager stateManager = Mockito.mock(StateManager.class);
+ final WsThemePresenter theme = Mockito.mock(WsThemePresenter.class);
+ final SiteSearcher searcher = Mockito.mock(SiteSearcher.class);
+ final Provider searcherProvider = Mockito.mock(Provider.class);
+ Mockito.stub(searcherProvider.get()).toReturn(searcher);
+ view = Mockito.mock(TagsSummaryView.class);
+ tagsSummaryPresenter = new TagsSummaryPresenter(session, searcherProvider, stateManager, theme);
+ tagsSummaryPresenter.init(view);
+ }
+
+ @Test
+ public void noTagsViewNotVisible() {
+ final StateDTO state = new StateDTO();
+ tagsSummaryPresenter.setState(state);
+ Mockito.verify(view).setVisible(false);
+ }
+
+ @Test
+ public void withTagsViewVisible() {
+ final StateDTO state = new StateDTO();
+ state.setTags("test test1");
+ tagsSummaryPresenter.setState(state);
+ Mockito.verify(view).setVisible(true);
+ }
+}
1
0
Author: vjrj
Date: 2008-08-05 03:27:25 +0200 (Tue, 05 Aug 2008)
New Revision: 827
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/
Log:
1
0
Author: vjrj
Date: 2008-08-05 03:27:03 +0200 (Tue, 05 Aug 2008)
New Revision: 826
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelector.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearchListener.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoView.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/
trunk/src/main/java/org/ourproject/kune/workspace/client/component/WorkspaceComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/
trunk/src/main/java/org/ourproject/kune/workspace/client/presence/
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/
trunk/src/main/java/org/ourproject/kune/workspace/client/theme/
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ThemeMenuComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceListener.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/BottomIconsTrayPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentBottomToolBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentSubTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentToolBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
Modified:
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.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/search/SiteSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/MessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessageView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.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/title/EntityTitlePresenter.java
Log:
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,52 +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;
-
-import org.ourproject.kune.platf.client.extend.ClientModule;
-import org.ourproject.kune.platf.client.extend.Register;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.actions.RecalculateWorkspaceAction;
-import org.ourproject.kune.workspace.client.actions.ReloadContextAction;
-import org.ourproject.kune.workspace.client.actions.i18n.ShowTranslatorAction;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class WorkspaceClientModule implements ClientModule {
-
- private final StateManager stateManager;
- private final Workspace workspace;
- private final Session session;
- 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;
- this.workspace = workspace;
- }
-
- public void configure(final Register register) {
- register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
- register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
- register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,29 +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;
-
-public interface WorkspaceEvents {
- public static final String SHOW_TRANSLATOR = "i18n.ShowTranslator";
- public static final String RELOAD_CONTEXT = "ws.ReoloadContext";
- public static final String WS_SPLITTER_STARTRESIZING = "ws.SplitterStartResizing";
- public static final String WS_SPLITTER_STOPRESIZING = "ws.SplitterStopResizing";
- public static final String RECALCULATE_WORKSPACE_SIZE = "ws.RecalculateWorkspaceSize";
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,130 +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;
-
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.KuneErrorHandler;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.editor.TextEditor;
-import org.ourproject.kune.workspace.client.editor.TextEditorListener;
-import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
-import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorComponent;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
-import org.ourproject.kune.workspace.client.i18n.ui.LanguageSelectorPanel;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
-import org.ourproject.kune.workspace.client.licensefoot.LicensePresenter;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseView;
-import org.ourproject.kune.workspace.client.licensefoot.ui.LicensePanel;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPanel;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitleComponent;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitleView;
-import org.ourproject.kune.workspace.client.workspace.ContentTitleComponent;
-import org.ourproject.kune.workspace.client.workspace.ContentTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentTitleView;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarComponent;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarPresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarView;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-import org.ourproject.kune.workspace.client.workspace.WorkspacePresenter;
-import org.ourproject.kune.workspace.client.workspace.WorkspaceView;
-import org.ourproject.kune.workspace.client.workspace.ui.ContentSubTitlePanel;
-import org.ourproject.kune.workspace.client.workspace.ui.ContentTitlePanel;
-import org.ourproject.kune.workspace.client.workspace.ui.ContentToolBarPanel;
-import org.ourproject.kune.workspace.client.workspace.ui.WorkspacePanel;
-
-import com.calclab.suco.client.container.Provider;
-
-public class WorkspaceFactory {
-
- private static Session session;
- private static I18nTranslationService i18n;
- private static KuneErrorHandler errorHandler;
- private static Provider<StateManager> stateManagerProvider;
-
- public static ContentSubTitleComponent createContentSubTitleComponent() {
- final ContentSubTitlePresenter presenter = new ContentSubTitlePresenter(i18n);
- final ContentSubTitleView view = new ContentSubTitlePanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
- public static ContentTitleComponent createContentTitleComponent() {
- final ContentTitlePresenter presenter = new ContentTitlePresenter(i18n, errorHandler);
- final ContentTitleView view = new ContentTitlePanel(presenter);
- presenter.init(view);
- return presenter;
- }
-
- public static ContentToolBarComponent createContentToolBarComponent() {
- final ContentToolBarPresenter presenter = new ContentToolBarPresenter();
- final ContentToolBarView view = new ContentToolBarPanel(presenter);
- presenter.init(view);
- return presenter;
- }
-
- public static ContextItems createContextItems() {
- final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n);
- final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n, stateManagerProvider);
- presenter.init(panel);
- return presenter;
- }
-
- public static TextEditor createDocumentEditor(final TextEditorListener listener) {
- final TextEditorPresenter presenter = new TextEditorPresenter(listener, true);
- final TextEditorPanel panel = new TextEditorPanel(presenter, i18n);
- presenter.init(panel);
- return presenter;
- }
-
- public static LanguageSelectorComponent createLanguageSelectorComponent() {
- final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter(session);
- final LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
- public static LicenseComponent createLicenseComponent() {
- final LicensePresenter presenter = new LicensePresenter();
- final LicenseView view = new LicensePanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
- public static Workspace createWorkspace(final Session session,
- final ExtensibleWidgetsManager extensionPointManager, final I18nTranslationService i18n,
- final KuneErrorHandler errorHandler, final Provider<StateManager> stateManagerProvider) {
- WorkspaceFactory.session = session;
- WorkspaceFactory.i18n = i18n;
- WorkspaceFactory.errorHandler = errorHandler;
- WorkspaceFactory.stateManagerProvider = stateManagerProvider;
- final WorkspacePresenter workspace = new WorkspacePresenter(session);
- final WorkspaceView view = new WorkspacePanel(workspace, i18n);
- workspace.init(view, extensionPointManager);
- return workspace;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/component/WorkspaceComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/component/WorkspaceComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/component/WorkspaceComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -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.component;
-
-import org.ourproject.kune.platf.client.Component;
-
-public interface WorkspaceComponent extends Component {
-
- void detach();
-
- void attach();
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -40,7 +40,6 @@
private final Timer saveTimer;
private final I18nTranslationService i18n;
- @Deprecated
public TextEditorPanel(final TextEditorPresenter presenter, final I18nTranslationService i18n) {
this.presenter = presenter;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -19,15 +19,10 @@
*/
package org.ourproject.kune.workspace.client.i18n;
-import org.ourproject.kune.platf.client.PlatformEvents;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -45,19 +40,18 @@
this.i18n = i18n;
}
- public void attachIconToBottomBar(final View view) {
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
- }
-
public void doClose() {
view.hide();
- DefaultDispatcher.getInstance().fire(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
}
public void doShowTranslator() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
+ Site.showProgressLoading();
+ if (session.isLogged()) {
+ view.show();
+ } else {
+ Site.info(i18n.t("Sign in or register to help with translation"));
+ }
+ Site.hideProgress();
}
public void doTranslation(final String id, final String trKey, final String translation) {
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelector.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelector.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,33 @@
+/*
+ *
+ * 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.i18n;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+
+public interface LanguageSelector {
+
+ String getSelectedLanguage();
+
+ View getView();
+
+ void setLanguage(I18nLanguageDTO language);
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -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.i18n;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-
-public interface LanguageSelectorComponent extends Component {
-
- String getSelectedLanguage();
-
- void setLanguage(I18nLanguageDTO language);
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -23,33 +23,32 @@
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.state.Session;
-public class LanguageSelectorPresenter implements LanguageSelectorComponent {
+public class LanguageSelectorPresenter implements LanguageSelector {
private LanguageSelectorView view;
private final Session session;
public LanguageSelectorPresenter(final Session session) {
- this.session = session;
+ this.session = session;
+ }
+ public Object[][] getLanguages() {
+ return session.getLanguagesArray();
}
- public void init(final LanguageSelectorView view) {
- this.view = view;
+ public String getSelectedLanguage() {
+ return view.getLanguage();
}
public View getView() {
- return view;
+ return view;
}
- public String getSelectedLanguage() {
- return view.getLanguage();
+ public void init(final LanguageSelectorView view) {
+ this.view = view;
}
- public Object[][] getLanguages() {
- return session.getLanguagesArray();
- }
-
public void setLanguage(final I18nLanguageDTO language) {
- view.setLanguage(language.getCode());
+ view.setLanguage(language.getCode());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -23,16 +23,15 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel;
-import org.ourproject.kune.platf.client.ui.BottomTrayIcon;
import org.ourproject.kune.platf.client.ui.KuneStringUtils;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPresenter;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorView;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorComponent;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
+import org.ourproject.kune.workspace.client.search.SiteBottomTrayButton;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.gwtext.client.core.EventObject;
@@ -69,260 +68,251 @@
private Window dialog;
private final I18nTranslatorPresenter presenter;
private LanguageSelectorPanel languageSelectorPanel;
-
private Store unTransStore;
private Store transStore;
-
- private BottomTrayIcon bottomIcon;
-
private GridPanel transGrid;
private GridPanel unTransGrid;
+ private final LanguageSelector languageSelector;
+ private final WorkspaceSkeleton ws;
+ private SiteBottomTrayButton traybarButton;
- public I18nTranslatorPanel(final I18nTranslatorPresenter initPresenter, final I18nTranslationService i18n) {
- super(i18n);
- this.presenter = initPresenter;
+ public I18nTranslatorPanel(final I18nTranslatorPresenter initPresenter, final I18nTranslationService i18n,
+ final LanguageSelector languageSelector, final WorkspaceSkeleton ws) {
+ super(i18n);
+ this.presenter = initPresenter;
+ this.languageSelector = languageSelector;
+ this.ws = ws;
}
public void close() {
- dialog.hide();
+ dialog.hide();
}
public void hide() {
- dialog.hide();
+ dialog.hide();
}
public void show() {
- if (dialog == null) {
- dialog = createDialog();
- }
- // By default we use the user lang to help in translation
- final I18nLanguageDTO lang = presenter.getLanguage();
- setLanguage(lang);
- final String languageNativeNameIfAvailable = lang.getNativeName().length() > 0 ? lang.getNativeName() : lang
- .getEnglishName();
- dialog.setTitle(i18n.t("Help to translate kune to [%s]", languageNativeNameIfAvailable));
- dialog.show();
- dialog.expand();
- dialog.center();
- if (bottomIcon == null) {
- bottomIcon = new BottomTrayIcon(i18n.t("Show/hide translator"));
- bottomIcon.addMainButton(Images.App.getInstance().language(), new Command() {
- public void execute() {
- if (dialog.isVisible()) {
- dialog.hide();
- } else {
- dialog.show();
- }
- }
- });
- presenter.attachIconToBottomBar(bottomIcon);
- }
+ if (dialog == null) {
+ dialog = createDialog();
+ }
+ // By default we use the user lang to help in translation
+ final I18nLanguageDTO lang = presenter.getLanguage();
+ setLanguage(lang);
+ final String languageNativeNameIfAvailable = lang.getNativeName().length() > 0 ? lang.getNativeName() : lang
+ .getEnglishName();
+ dialog.setTitle(i18n.t("Help to translate kune to [%s]", languageNativeNameIfAvailable));
+ dialog.show();
+ dialog.expand();
+ dialog.center();
+ if (traybarButton == null) {
+ traybarButton = new SiteBottomTrayButton("images/language.gif", i18n.t("Show/hide translator"), dialog, ws);
+ }
}
private Window createDialog() {
- final Panel north = new Panel();
- north.setBorder(false);
+ final Panel north = new Panel();
+ north.setBorder(false);
- final Panel center = new TabPanel();
- center.setAutoScroll(false);
- center.setClosable(false);
- center.setBorder(false);
+ final Panel center = new TabPanel();
+ center.setAutoScroll(false);
+ center.setClosable(false);
+ center.setBorder(false);
- final Window dialog = new BasicDialog("", false, false, 720, 330);
- // dialog.setResizable(false);
- dialog.setIconCls("i18n-icon");
+ final Window dialog = new BasicDialog("", false, false, 720, 330);
+ // dialog.setResizable(false);
+ dialog.setIconCls("i18n-icon");
- final Button close = new Button();
- close.setText(i18n.tWithNT("Close", "used in button"));
- close.addListener(new ButtonListenerAdapter() {
- public void onClick(final Button button, final EventObject e) {
- presenter.doClose();
- }
- });
- dialog.addButton(close);
+ final Button close = new Button();
+ close.setText(i18n.tWithNT("Close", "used in button"));
+ close.addListener(new ButtonListenerAdapter() {
+ public void onClick(final Button button, final EventObject e) {
+ presenter.doClose();
+ }
+ });
+ dialog.addButton(close);
- final Panel unTransCenterPanel = new Panel(i18n.t("Untranslated"));
- unTransCenterPanel.setAutoScroll(false);
- unTransCenterPanel.setLayout(new FitLayout());
+ final Panel unTransCenterPanel = new Panel(i18n.t("Untranslated"));
+ unTransCenterPanel.setAutoScroll(false);
+ unTransCenterPanel.setLayout(new FitLayout());
- final Panel transCenterPanel = new Panel(i18n.t("Translated"));
- transCenterPanel.setAutoScroll(false);
- transCenterPanel.setLayout(new FitLayout());
+ final Panel transCenterPanel = new Panel(i18n.t("Translated"));
+ transCenterPanel.setAutoScroll(false);
+ transCenterPanel.setLayout(new FitLayout());
- final Panel recommendationPanel = new Panel(i18n.t("Recommendations"));
- recommendationPanel.setAutoScroll(true);
- recommendationPanel.setLayout(new FitLayout());
+ final Panel recommendationPanel = new Panel(i18n.t("Recommendations"));
+ recommendationPanel.setAutoScroll(true);
+ recommendationPanel.setLayout(new FitLayout());
- transGrid = createGridPanel(true);
- unTransGrid = createGridPanel(false);
- final HorizontalPanel hp = new HorizontalPanel();
- final LanguageSelectorComponent langComponent = WorkspaceFactory.createLanguageSelectorComponent();
- languageSelectorPanel = (LanguageSelectorPanel) langComponent.getView();
- languageSelectorPanel.addChangeListener(new ComboBoxListenerAdapter() {
- public void onSelect(final ComboBox comboBox, final Record record, final int index) {
- setLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
- dialog.setTitle(i18n.t("Help to translate kune to [%s]", record.getAsString("language")));
- }
- });
- hp.add(languageSelectorPanel);
- hp.addStyleName("kune-Margin-Large-trbl");
- north.add(hp);
+ transGrid = createGridPanel(true);
+ unTransGrid = createGridPanel(false);
+ final HorizontalPanel hp = new HorizontalPanel();
+ languageSelectorPanel = (LanguageSelectorPanel) languageSelector.getView();
+ languageSelectorPanel.addChangeListener(new ComboBoxListenerAdapter() {
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ setLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
+ dialog.setTitle(i18n.t("Help to translate kune to [%s]", record.getAsString("language")));
+ }
+ });
+ hp.add(languageSelectorPanel);
+ hp.addStyleName("kune-Margin-Large-trbl");
+ north.add(hp);
- unTransCenterPanel.add(unTransGrid);
- transCenterPanel.add(transGrid);
- final Frame recommFrame = new Frame("html/i18n-recom.html");
- // recommFrame.setHeight("220");
- recommendationPanel.add(recommFrame);
+ unTransCenterPanel.add(unTransGrid);
+ transCenterPanel.add(transGrid);
+ final Frame recommFrame = new Frame("html/i18n-recom.html");
+ // recommFrame.setHeight("220");
+ recommendationPanel.add(recommFrame);
- center.add(unTransCenterPanel);
- center.add(transCenterPanel);
- center.add(recommendationPanel);
- dialog.add(north, new BorderLayoutData(RegionPosition.NORTH));
- dialog.add(center, new BorderLayoutData(RegionPosition.CENTER));
+ center.add(unTransCenterPanel);
+ center.add(transCenterPanel);
+ center.add(recommendationPanel);
+ dialog.add(north, new BorderLayoutData(RegionPosition.NORTH));
+ dialog.add(center, new BorderLayoutData(RegionPosition.CENTER));
- center.setActiveItemID(unTransCenterPanel.getId());
+ center.setActiveItemID(unTransCenterPanel.getId());
- return dialog;
+ return dialog;
}
private GridPanel createGridPanel(final boolean translated) {
- final Renderer renderNT = new Renderer() {
- public String render(Object value, CellMetadata cellMetadata, Record record, int rowIndex, int colNum,
- Store store) {
- String renderer;
- String[] splitted = splitNT((String) value);
- if (splitted.length > 1) {
- renderer = "{0} " + NOTE_FOR_TRANSLATORS_IMAGE_HTML;
- String tip = "<div style='min-width: 75px'>" + splitted[1] + "</div>";
- cellMetadata.setHtmlAttribute("ext:qtip=\"" + tip + "\" ext:qtitle=\"Note for translators\"");
- } else {
- renderer = "{0}";
- }
- return Format.format(renderer, splitted);
- }
- };
+ final Renderer renderNT = new Renderer() {
+ public String render(Object value, CellMetadata cellMetadata, Record record, int rowIndex, int colNum,
+ Store store) {
+ String renderer;
+ String[] splitted = splitNT((String) value);
+ if (splitted.length > 1) {
+ renderer = "{0} " + NOTE_FOR_TRANSLATORS_IMAGE_HTML;
+ String tip = "<div style='min-width: 75px'>" + splitted[1] + "</div>";
+ cellMetadata.setHtmlAttribute("ext:qtip=\"" + tip + "\" ext:qtitle=\"Note for translators\"");
+ } else {
+ renderer = "{0}";
+ }
+ return Format.format(renderer, splitted);
+ }
+ };
- Store store;
- final String id = "id";
- final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef("trKey"), new StringFieldDef("text"),
- new StringFieldDef(id) };
+ Store store;
+ final String id = "id";
+ final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef("trKey"), new StringFieldDef("text"),
+ new StringFieldDef(id) };
- if (translated) {
- final String url = "/kune/json/I18nTranslationJSONService/searchtranslated";
- transStore = createStore(fieldDefs, url, id);
- store = transStore;
- } else {
- final String url = "/kune/json/I18nTranslationJSONService/search";
- unTransStore = createStore(fieldDefs, url, id);
- store = unTransStore;
- }
+ if (translated) {
+ final String url = "/kune/json/I18nTranslationJSONService/searchtranslated";
+ transStore = createStore(fieldDefs, url, id);
+ store = transStore;
+ } else {
+ final String url = "/kune/json/I18nTranslationJSONService/search";
+ unTransStore = createStore(fieldDefs, url, id);
+ store = unTransStore;
+ }
- final ColumnConfig trKeyColumn = new ColumnConfig() {
- {
- setHeader(i18n.t("Text to translate"));
- setDataIndex("trKey");
- setWidth(335);
- setTooltip(i18n.t("Click to sort"));
- setRenderer(renderNT);
- }
- };
+ final ColumnConfig trKeyColumn = new ColumnConfig() {
+ {
+ setHeader(i18n.t("Text to translate"));
+ setDataIndex("trKey");
+ setWidth(335);
+ setTooltip(i18n.t("Click to sort"));
+ setRenderer(renderNT);
+ }
+ };
- final GridEditor textColumnEditor = new GridEditor(new TextField());
+ final GridEditor textColumnEditor = new GridEditor(new TextField());
- final ColumnConfig textColumn = new ColumnConfig() {
- {
- setHeader(i18n.t("Translation (click to edit)"));
- setDataIndex("text");
- setWidth(335);
- setEditor(textColumnEditor);
- }
- };
+ final ColumnConfig textColumn = new ColumnConfig() {
+ {
+ setHeader(i18n.t("Translation (click to edit)"));
+ setDataIndex("text");
+ setWidth(335);
+ setEditor(textColumnEditor);
+ }
+ };
- final ColumnModel columnModel = new ColumnModel(new ColumnConfig[] { trKeyColumn, textColumn });
+ final ColumnModel columnModel = new ColumnModel(new ColumnConfig[] { trKeyColumn, textColumn });
- columnModel.setDefaultSortable(true);
+ columnModel.setDefaultSortable(true);
- final EditorGridPanel grid = new EditorGridPanel((translated ? "grid-translated" : "grid-untranslated"), 695,
- 180, store, columnModel);
- createPagingToolbar(store, grid);
+ final EditorGridPanel grid = new EditorGridPanel((translated ? "grid-translated" : "grid-untranslated"), 695,
+ 180, store, columnModel);
+ createPagingToolbar(store, grid);
- // final PagingToolbar pag = new PagingToolbar(store);
- // pag.setPageSize(PAGINATION_SIZE);
- // pag.setDisplayInfo(true);
- // pag.setDisplayMsg(i18n.tWithNT("Displaying results {0} - {1} of
- // {2}",
- // "Respect {} values in translations, "
- // + "these will produce: 'Displaying results 1 - 25 of 95465' for
- // instance"));
- // pag.setEmptyMsg(i18n.t("No results to display"));
- // pag.setAfterPageText(i18n.tWithNT("of {0}", "Used to show
- // multiple results: '1 of 30'"));
- // pag.setBeforePageText(i18n.t("Page"));
- // pag.setFirstText(i18n.t("First Page"));
- // pag.setLastText(i18n.t("Last Page"));
- // pag.setNextText(i18n.t("Next Page"));
- // pag.setPrevText(i18n.t("Previous Page"));
- // pag.setRefreshText(i18n.t("Refresh"));
- // grid.setBottomToolbar(pag);
- // grid.setLoadMask(true);
- // grid.setLoadMask(i18n.t("Loading"));
- grid.setClicksToEdit(1);
- // grid.setStripeRows(true);
- // grid.setFrame(true);
- // grid.setSelectionModel(new RowSelectionModel());
+ // final PagingToolbar pag = new PagingToolbar(store);
+ // pag.setPageSize(PAGINATION_SIZE);
+ // pag.setDisplayInfo(true);
+ // pag.setDisplayMsg(i18n.tWithNT("Displaying results {0} - {1} of
+ // {2}",
+ // "Respect {} values in translations, "
+ // + "these will produce: 'Displaying results 1 - 25 of 95465' for
+ // instance"));
+ // pag.setEmptyMsg(i18n.t("No results to display"));
+ // pag.setAfterPageText(i18n.tWithNT("of {0}", "Used to show
+ // multiple results: '1 of 30'"));
+ // pag.setBeforePageText(i18n.t("Page"));
+ // pag.setFirstText(i18n.t("First Page"));
+ // pag.setLastText(i18n.t("Last Page"));
+ // pag.setNextText(i18n.t("Next Page"));
+ // pag.setPrevText(i18n.t("Previous Page"));
+ // pag.setRefreshText(i18n.t("Refresh"));
+ // grid.setBottomToolbar(pag);
+ // grid.setLoadMask(true);
+ // grid.setLoadMask(i18n.t("Loading"));
+ grid.setClicksToEdit(1);
+ // grid.setStripeRows(true);
+ // grid.setFrame(true);
+ // grid.setSelectionModel(new RowSelectionModel());
- grid.addEditorGridListener(new EditorGridListenerAdapter() {
- public void onAfterEdit(final GridPanel grid, final Record record, final String field,
- final Object newValue, final Object oldValue, final int rowIndex, final int colIndex) {
- final String idValue = record.getAsString(id);
- final String trKey = record.getAsString("trKey");
- presenter.doTranslation(idValue, trKey, (String) newValue);
- record.set(field, KuneStringUtils.escapeHtmlLight((String) newValue));
- }
- });
+ grid.addEditorGridListener(new EditorGridListenerAdapter() {
+ public void onAfterEdit(final GridPanel grid, final Record record, final String field,
+ final Object newValue, final Object oldValue, final int rowIndex, final int colIndex) {
+ final String idValue = record.getAsString(id);
+ final String trKey = record.getAsString("trKey");
+ presenter.doTranslation(idValue, trKey, (String) newValue);
+ record.set(field, KuneStringUtils.escapeHtmlLight((String) newValue));
+ }
+ });
- grid.addGridCellListener(new GridCellListenerAdapter() {
- public void onCellDblClick(final GridPanel grid, final int rowIndex, final int colIndex, final EventObject e) {
- final Record record = unTransStore.getRecordAt(rowIndex);
- final String idValue = record.getAsString(id);
- final String trKey = record.getAsString("trKey");
- final String text = record.getAsString("text");
- if (text == null || text.length() == 0) {
- final String trWithoutNT = removeNT(trKey);
- record.set("text", trWithoutNT);
- presenter.doTranslation(idValue, trKey, trWithoutNT);
- }
- }
- });
+ grid.addGridCellListener(new GridCellListenerAdapter() {
+ public void onCellDblClick(final GridPanel grid, final int rowIndex, final int colIndex, final EventObject e) {
+ final Record record = unTransStore.getRecordAt(rowIndex);
+ final String idValue = record.getAsString(id);
+ final String trKey = record.getAsString("trKey");
+ final String text = record.getAsString("text");
+ if (text == null || text.length() == 0) {
+ final String trWithoutNT = removeNT(trKey);
+ record.set("text", trWithoutNT);
+ presenter.doTranslation(idValue, trKey, trWithoutNT);
+ }
+ }
+ });
- return grid;
+ return grid;
}
private String removeNT(final String string) {
- return i18n.removeNT(string);
+ return i18n.removeNT(string);
}
private void setLanguage(final I18nLanguageDTO language) {
- languageSelectorPanel.setLanguage(language.getCode());
- setLanguage(language.getCode());
+ languageSelectorPanel.setLanguage(language.getCode());
+ setLanguage(language.getCode());
}
private void setLanguage(final String language) {
- Site.showProgressLoading();
- query(unTransStore, unTransGrid, language);
- query(transStore, transGrid, language);
- Site.hideProgress();
+ Site.showProgressLoading();
+ query(unTransStore, unTransGrid, language);
+ query(transStore, transGrid, language);
+ Site.hideProgress();
}
private String[] splitNT(final String textWithNT) {
- String[] nt;
- final String[] splitted = textWithNT.split(" \\[%NT ");
- if (splitted.length > 1) {
- nt = splitted[1].split("\\]$");
- splitted[1] = nt[0];
- }
- return splitted;
+ String[] nt;
+ final String[] splitted = textWithNT.split(" \\[%NT ");
+ if (splitted.length > 1) {
+ nt = splitted[1].split("\\]$");
+ splitted[1] = nt[0];
+ }
+ return splitted;
}
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,344 @@
+/*
+ *
+ * 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.newgroup;
+
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.KuneStringUtils;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.platf.client.ui.dialogs.WizardDialog;
+import org.ourproject.kune.platf.client.ui.dialogs.WizardListener;
+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.sitebar.msg.SiteMessagePanel;
+
+import com.calclab.suco.client.container.Provider;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+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.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.Position;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.ToolTip;
+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.Radio;
+import com.gwtext.client.widgets.form.TextArea;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class NewGroupPanel extends WizardDialog implements NewGroupView {
+ private static final AbstractImagePrototype INFO_IMAGE = Images.App.getInstance().info();
+ private static final String MUST_BE_BETWEEN_3_AND_15 = "Must be between 3 and 15 lowercase characters. Can only contain characters, numbers, and dashes";
+ private static final String SHORTNAME_FIELD = "short_name";
+ private static final String LONGNAME_FIELD = "long_name";
+ private static final String PUBLICDESC_FIELD = "public_desc";
+ private static final String TYPEOFGROUP_FIELD = "type_of_group";
+ private static final String TAGS_FIELD = "tags";
+
+ private final FormPanel newGroupInitialDataForm;
+ private Radio projectRadio;
+ private Radio orgRadio;
+ private Radio communityRadio;
+ private Radio orphanedProjectRadio;
+ private TextField shortNameField;
+ private TextField longNameField;
+ private TextArea publicDescField;
+ private final DeckPanel deck;
+ private final LicenseChoose licenseChoosePanel;
+ private final SiteMessagePanel messagesPanel;
+ private final I18nUITranslationService i18n;
+ private TextField tags;
+
+ public NewGroupPanel(final NewGroupPresenter presenter, final I18nUITranslationService i18n,
+ final Provider<LicenseChoose> licenseChooseProvider) {
+ super(i18n.t("Register a new Group"), true, false, 460, 480, new WizardListener() {
+ public void onBack() {
+ presenter.onBack();
+ }
+
+ public void onCancel() {
+ presenter.onCancel();
+ }
+
+ public void onClose() {
+ presenter.onClose();
+ }
+
+ public void onFinish() {
+ presenter.onFinish();
+ }
+
+ public void onNext() {
+ presenter.onNext();
+ }
+ }, i18n);
+ this.i18n = i18n;
+ Field.setMsgTarget("side");
+ final Panel centerPanel = new Panel();
+ 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();
+ final Images img = Images.App.getInstance();
+ 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.", KuneStringUtils.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);
+
+ 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");
+
+ messagesPanel = new SiteMessagePanel(null, false, i18n);
+ messagesPanel.setWidth("425");
+ messagesPanel.setMessage("", SiteErrorType.info, SiteErrorType.error);
+ newGroupInitialDataVP.add(messagesPanel);
+
+ 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"));
+ }
+
+ public void clearData() {
+ deck.showWidget(0);
+ newGroupInitialDataForm.getForm().reset();
+ ((LicenseChoosePanel) licenseChoosePanel.getView()).reset();
+ showNewGroupInitialDataForm();
+ initBottomButtons();
+ shortNameField.focus(false);
+ }
+
+ public LicenseDTO getLicense() {
+ return licenseChoosePanel.getLicense();
+ }
+
+ public String getLongName() {
+ return longNameField.getValueAsString();
+ }
+
+ public String getPublicDesc() {
+ return publicDescField.getValueAsString();
+ }
+
+ public String getShortName() {
+ return shortNameField.getValueAsString();
+ }
+
+ public String getTags() {
+ return tags.getRawValue();
+ }
+
+ public void hideMessage() {
+ messagesPanel.hide();
+ }
+
+ public boolean isCommunity() {
+ return communityRadio.getValue();
+ }
+
+ public boolean isFormValid() {
+ return newGroupInitialDataForm.getForm().isValid();
+ }
+
+ public boolean isOrganization() {
+ return orgRadio.getValue();
+ }
+
+ public boolean isOrphanedProject() {
+ return orphanedProjectRadio.getValue();
+ }
+
+ public boolean isProject() {
+ return projectRadio.getValue();
+ }
+
+ public void setMessage(final String message, final SiteErrorType type) {
+ messagesPanel.setMessage(message, type, type);
+ messagesPanel.show();
+ }
+
+ public void showLicenseForm() {
+ deck.showWidget(1);
+ }
+
+ public void showNewGroupInitialDataForm() {
+ deck.showWidget(0);
+ }
+
+ private FormPanel createNewGroupInitialDataForm(final NewGroupPresenter presenter) {
+ final FormPanel form = new FormPanel();
+ form.setBorder(false);
+ form.setWidth(420);
+ form.setLabelWidth(100);
+ form.setLabelAlign(Position.RIGHT);
+ form.setButtonAlign(Position.RIGHT);
+
+ shortNameField = new TextField();
+ shortNameField.setFieldLabel(i18n.t("Short name"));
+ shortNameField.
+
+ setName(SHORTNAME_FIELD);
+ shortNameField.setWidth(175);
+ shortNameField.setMinLength(3);
+ shortNameField.setMaxLength(15);
+ shortNameField.setAllowBlank(false);
+ shortNameField.setRegex("^[a-z0-9_\\-]+$");
+ shortNameField.setMinLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameField.setMaxLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameField.setRegexText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameField.setValidationDelay(1000);
+
+ form.add(shortNameField);
+
+ longNameField = new TextField();
+ longNameField.setFieldLabel(i18n.t("Long name"));
+ longNameField.setName(LONGNAME_FIELD);
+ longNameField.setWidth(300);
+ longNameField.setAllowBlank(false);
+
+ longNameField.setMinLength(3);
+ longNameField.setMaxLength(50);
+ longNameField.setValidationDelay(1000);
+ form.add(longNameField);
+
+ publicDescField = new TextArea();
+ publicDescField.setFieldLabel(i18n.t("Public description"));
+ publicDescField.setName(PUBLICDESC_FIELD);
+ publicDescField.setWidth(300);
+ publicDescField.setAllowBlank(false);
+ publicDescField.setMinLength(10);
+ publicDescField.setMaxLength(255);
+ publicDescField.setValidationDelay(1000);
+ form.add(publicDescField);
+
+ tags = new TextField();
+ tags.setFieldLabel(i18n.t("Group tags"));
+ tags.setName(TAGS_FIELD);
+ tags.setWidth(300);
+ tags.setAllowBlank(false);
+ final ToolTip fieldToolTip = new ToolTip(i18n.t("Some words related to this group (separated with spaces)."));
+ fieldToolTip.applyTo(tags);
+ tags.setValidationDelay(1000);
+ form.add(tags);
+
+ final FieldSet groupTypeFieldSet = new FieldSet(i18n.t("Type of group"));
+ groupTypeFieldSet.setStyle("margin-left: 105px");
+
+ form.add(groupTypeFieldSet);
+
+ projectRadio = new Radio();
+ createRadio(groupTypeFieldSet, projectRadio, "Project",
+ "A project is a kind of group in which new members inclusion "
+ + "is moderated by the project administrators. "
+ + "An administrator is the person who creates the project "
+ + "and other people she/he choose in the future as administrator too.");
+ projectRadio.setChecked(true);
+
+ orgRadio = new Radio();
+ createRadio(groupTypeFieldSet, orgRadio, "Organization", "An organization is like a project, "
+ + "but organizations must be a legal entity.");
+
+ communityRadio = new Radio();
+ createRadio(groupTypeFieldSet, communityRadio, "Community", "Communities are social group of persons "
+ + "with shared interests and they are open to new members "
+ + "(for instance the environmental community or the LGBT community). "
+ + "Normally they aren't a legal entity.");
+
+ orphanedProjectRadio = new Radio();
+ createRadio(groupTypeFieldSet, orphanedProjectRadio, "Orphaned Project",
+ "If you have an idea but you don't have " + "capacity/possibilities/resources to work on it, "
+ + "just register a orphaned project, and permit others to work and develop it.");
+
+ groupTypeFieldSet.setCollapsible(false);
+
+ return form;
+ }
+
+ private void createRadio(final FieldSet fieldSet, final Radio radio, final String radioLabel, final String radioTip) {
+ radio.setName(TYPEOFGROUP_FIELD);
+ radio.setBoxLabel(KuneUiUtils.genQuickTipLabel(i18n.t(radioLabel), null, i18n.t(radioTip), INFO_IMAGE));
+ radio.setAutoCreate(true);
+ radio.setHideLabel(true);
+ fieldSet.add(radio);
+ // ToolTip fieldToolTip = new ToolTip("Tooltip on a Field.");
+ // fieldToolTip.applyTo(captchaField);
+ // Image info = new Image("images/silk/information.gif");
+ //
+ // ToolTip tooltip = new ToolTip();
+ // tooltip.setHtml("A <b>CAPTCHA</b> is a challenge-response test to
+ // determine whether " +
+ // "the user is human.");
+ // tooltip.setWidth(150);
+ // tooltip.applyTo(info.getElement());
+
+ // Tested:
+ // Set tooltip
+ // Image info = new Image();
+ // ChatIcons.App.getInstance().info().applyTo(info);
+ // ToolTip tooltip = new ToolTip();
+ // tooltip.setHtml(i18n.t("Note that the 'Jabber Id' sometimes is the
+ // same as the email "
+ // + "(in gmail accounts for instance)."));
+ // tooltip.setWidth(250);
+ // tooltip.applyTo(info.getElement());
+ // jidPanel.addToRow(info, new ColumnLayoutData(1));
+ //
+ // formPanel.add(jidPanel);
+
+ }
+
+ 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-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -29,7 +29,6 @@
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.newgroup.ui.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
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-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -21,7 +21,6 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
public interface NewGroupView extends View {
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/SiteErrorType.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/SiteErrorType.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.newgroup;
+
+public enum SiteErrorType {
+ error, veryimp, imp, info
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearchListener.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearchListener.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,28 @@
+/*
+ *
+ * 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.search;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntityLiveSearchListener extends View {
+
+ void onSelection(String shortName, String longName);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcher.java (from rev 820, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.search;
+
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+
+import com.calclab.suco.client.signal.Slot;
+
+public interface EntityLiveSearcher {
+
+ void onSelection(Slot<LinkDTO> slot);
+
+ void show();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java (from rev 820, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,155 @@
+/*
+ *
+ * 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.search;
+
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.core.Connection;
+import com.gwtext.client.core.Template;
+import com.gwtext.client.core.UrlParam;
+import com.gwtext.client.data.DataProxy;
+import com.gwtext.client.data.FieldDef;
+import com.gwtext.client.data.HttpProxy;
+import com.gwtext.client.data.JsonReader;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.data.RecordDef;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.data.StringFieldDef;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
+
+public class EntityLiveSearcherPanel implements EntityLiveSearcherView {
+
+ private static final String LONG_NAME_FIELD = "longName";
+ private static final String SHORT_NAME_FIELD = "shortName";
+ private static final String ICON_URL_FIELD = "iconUrl";
+ private static final String LINK_FIELD = "link";
+ private static final int PAGINATION_SIZE = 10;
+ private final EntityLiveSearcherPresenter presenter;
+ private BasicDialog dialog;
+ private final int searchType;
+ private FormPanel searchForm;
+ private final I18nTranslationService i18n;
+
+ public EntityLiveSearcherPanel(final EntityLiveSearcherPresenter presenter, final int searchType,
+ final I18nTranslationService i18n) {
+ this.presenter = presenter;
+ this.searchType = searchType;
+ this.i18n = i18n;
+ }
+
+ public void center() {
+ dialog.center();
+ }
+
+ public void hide() {
+ dialog.hide();
+ searchForm.getForm().reset();
+ }
+
+ public void show() {
+ if (dialog == null) {
+ createGroupSearchDialog(searchType);
+ }
+ dialog.show();
+ dialog.center();
+ }
+
+ private void createGroupSearchDialog(final int searchType) {
+ String title;
+ if (searchType == EntityLiveSearcherView.SEARCH_GROUPS) {
+ title = i18n.t("Search existing users and groups");
+ } else {
+ title = i18n.t("Search existing users");
+ }
+ dialog = new BasicDialog(title, true, false, 285, 55);
+ dialog.setClosable(true);
+ dialog.setCollapsible(false);
+
+ DataProxy dataProxy = null;
+ switch (searchType) {
+ case EntityLiveSearcherView.SEARCH_GROUPS:
+ dataProxy = new HttpProxy("/kune/json/GroupJSONService/search", Connection.POST);
+ break;
+ case EntityLiveSearcherView.SEARCH_USERS:
+ dataProxy = new HttpProxy("/kune/json/UserJSONService/search", Connection.POST);
+ break;
+ default:
+ break;
+ }
+
+ final JsonReader reader = new JsonReader(new RecordDef(
+ new FieldDef[] { new StringFieldDef(SHORT_NAME_FIELD), new StringFieldDef(LONG_NAME_FIELD),
+ new StringFieldDef(LINK_FIELD), new StringFieldDef(ICON_URL_FIELD) }));
+ reader.setRoot("list");
+ reader.setTotalProperty("size");
+ reader.setId(SHORT_NAME_FIELD);
+
+ final Store store = new Store(dataProxy, reader);
+
+ store.load(new UrlParam[] { new UrlParam("query", "."), new UrlParam("first", 1),
+ new UrlParam("max", PAGINATION_SIZE) });
+
+ searchForm = new FormPanel();
+ searchForm.setBorder(false);
+ searchForm.setWidth(275);
+ searchForm.setHideLabels(true);
+
+ final Template resultTpl = new Template(
+ "<div class=\"search-item\"><span class=\"kune-IconHyperlink\"><img alt=\"group logo\" src=\"images/group-def-icon.png\" style=\"height: 16px; width: 16px;\" />{shortName}: {longName}</span></div>");
+ final ComboBox cb = new ComboBox();
+ cb.setStore(store);
+ cb.setEmptyText(i18n.t("Write here to search"));
+ cb.setDisplayField(LONG_NAME_FIELD);
+ cb.setTypeAhead(true);
+ cb.setLoadingText(i18n.t("Searching..."));
+ cb.setWidth(268);
+ cb.setPageSize(PAGINATION_SIZE);
+ cb.setTpl(resultTpl);
+ cb.setMode(ComboBox.REMOTE);
+ cb.setMinChars(2);
+ cb.setSelectOnFocus(false);
+ cb.setHideTrigger(true);
+ cb.setHideLabel(true);
+ // setTitle(i18n.t("User or group"));
+ cb.setItemSelector("div.search-item");
+
+ cb.addListener(new ComboBoxListenerAdapter() {
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ final LinkDTO link = new LinkDTO(record.getAsString(SHORT_NAME_FIELD), record
+ .getAsString(LONG_NAME_FIELD), record.getAsString(ICON_URL_FIELD), record
+ .getAsString(LINK_FIELD));
+ presenter.onSelection(link);
+ }
+ });
+ }
+ });
+
+ searchForm.add(cb);
+ dialog.add(searchForm);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPresenter.java (from rev 820, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,55 @@
+/*
+ *
+ * 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.search;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+
+import com.calclab.suco.client.signal.Slot;
+
+public class EntityLiveSearcherPresenter implements EntityLiveSearcher {
+
+ private EntityLiveSearcherView view;
+ private Slot<LinkDTO> slot;
+
+ public EntityLiveSearcherPresenter() {
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntityLiveSearcherView view) {
+ this.view = view;
+ }
+
+ public void onSelection(final LinkDTO link) {
+ slot.onEvent(link);
+ view.hide();
+ }
+
+ public void onSelection(final Slot<LinkDTO> slot) {
+ this.slot = slot;
+ }
+
+ public void show() {
+ view.show();
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,35 @@
+/*
+ *
+ * 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.search;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntityLiveSearcherView extends View {
+
+ final public static int SEARCH_GROUPS = 1;
+ final public static int SEARCH_USERS = 2;
+
+ void show();
+
+ void hide();
+
+ void center();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupLiveSearchPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupLiveSearchPanel.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.search;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+
+public class GroupLiveSearchPanel extends EntityLiveSearcherPanel {
+
+ public GroupLiveSearchPanel(final EntityLiveSearcherPresenter presenter, final I18nTranslationService i18n) {
+ super(presenter, EntityLiveSearcherView.SEARCH_GROUPS, i18n);
+ }
+
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcher.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,25 @@
+/*
+ *
+ * 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.search;
+
+public interface GroupLiveSearcher extends EntityLiveSearcher {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcherPresenter.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,25 @@
+/*
+ *
+ * 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.search;
+
+
+public class GroupLiveSearcherPresenter extends EntityLiveSearcherPresenter implements GroupLiveSearcher {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.Window;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+
+public class SiteBottomTrayButton {
+
+ private final ToolbarButton traybarButton;
+
+ public SiteBottomTrayButton(final String icon, final String tooltip, final Window dialog, final WorkspaceSkeleton ws) {
+ traybarButton = new ToolbarButton();
+ traybarButton.setTooltip(tooltip);
+ traybarButton.setIcon(icon);
+ traybarButton.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ if (dialog.isVisible()) {
+ dialog.hide();
+ } else {
+ dialog.show();
+ }
+ }
+
+ });
+ ws.getSiteTraybar().addButton(traybarButton);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -37,7 +37,6 @@
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.TabPanel;
-import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.Window;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
@@ -63,7 +62,7 @@
private GridPanel groupsGrid;
private GridPanel contentGrid;
private final WorkspaceSkeleton ws;
- private ToolbarButton traybarButton;
+ private SiteBottomTrayButton traybarButton;
public SiteSearcherPanel(final SiteSearcherPresenter initPresenter, final I18nTranslationService i18n,
final WorkspaceSkeleton ws) {
@@ -100,21 +99,8 @@
dialog.expand();
dialog.center();
if (traybarButton == null) {
- traybarButton = new ToolbarButton();
- traybarButton.setTooltip(i18n.t("Show/hide searcher"));
- traybarButton.setIcon("images/kune-search-ico-push.gif");
- traybarButton.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- if (dialog.isVisible()) {
- dialog.hide();
- } else {
- dialog.show();
- }
- }
-
- });
- ws.getSiteTraybar().addButton(traybarButton);
+ traybarButton = new SiteBottomTrayButton("images/kune-search-ico-push.gif", i18n.t("Show/hide searcher"),
+ dialog, ws);
}
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcher.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,25 @@
+/*
+ *
+ * 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.search;
+
+
+public interface UserLiveSearcher extends EntityLiveSearcher {
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearcherPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearcherPanel.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.search;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+
+public class UserLiveSearcherPanel extends EntityLiveSearcherPanel {
+
+ public UserLiveSearcherPanel(final EntityLiveSearcherPresenter presenter, final I18nTranslationService i18n) {
+ super(presenter, EntityLiveSearcherView.SEARCH_USERS, i18n);
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPresenter.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,25 @@
+/*
+ *
+ * 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.search;
+
+
+public class UserLiveSearcherPresenter extends EntityLiveSearcherPresenter implements UserLiveSearcher {
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessage;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgress;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -27,7 +27,7 @@
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
+import org.ourproject.kune.workspace.client.newgroup.NewGroupPanel;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import org.ourproject.kune.workspace.client.sitebar.login.SignInPanel;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,14 +20,12 @@
package org.ourproject.kune.workspace.client.sitebar.bar;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.GroupListDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
public class SiteBarPresenter implements SiteBar {
@@ -129,7 +127,6 @@
}
public void onHelpInTranslation() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
}
public void onLoginCancelled() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -22,7 +22,7 @@
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
import org.ourproject.kune.platf.client.ui.dialogs.InfoDialog;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.msg.SimpleMessagePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -33,7 +33,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.login;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public interface SignInView extends View {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/MessagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/MessagePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/MessagePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public interface MessagePresenter {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,7 +1,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.HTML;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public interface SiteMessage extends View {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public class SiteMessagePresenter implements SiteMessage, MessagePresenter {
private SiteMessageView view;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessageView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessageView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessageView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public interface SiteMessageView extends View {
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,28 +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.socialnet;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface EntityLiveSearchListener extends View {
-
- void onSelection(String shortName, String longName);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,56 +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.socialnet;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.LinkDTO;
-import org.ourproject.kune.workspace.client.workspace.EntityLiveSearcher;
-
-import com.calclab.suco.client.signal.Slot;
-
-public class EntityLiveSearcherPresenter implements EntityLiveSearcher {
-
- private EntityLiveSearcherView view;
- private Slot<LinkDTO> slot;
-
- public EntityLiveSearcherPresenter() {
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final EntityLiveSearcherView view) {
- this.view = view;
- }
-
- public void onSelection(final LinkDTO link) {
- slot.onEvent(link);
- view.hide();
- }
-
- public void onSelection(final Slot<LinkDTO> slot) {
- this.slot = slot;
- }
-
- public void show() {
- view.show();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,35 +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.socialnet;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface EntityLiveSearcherView extends View {
-
- final public static int SEARCH_GROUPS = 1;
- final public static int SEARCH_USERS = 2;
-
- void show();
-
- void hide();
-
- void center();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +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.socialnet;
-
-import org.ourproject.kune.workspace.client.workspace.GroupLiveSearcher;
-
-public class GroupLiveSearcherPresenter extends EntityLiveSearcherPresenter implements GroupLiveSearcher {
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.socialnet;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.ui.MenuItem;
+
+public interface GroupMembersSummary {
+
+ void addGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+
+ void removeGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -14,6 +14,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import com.calclab.emiteuimodule.client.users.UserGridPanel;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.gwtext.client.core.EventObject;
@@ -40,14 +41,19 @@
super.setHeaderTitle(i18n.t("People and groups collaborating in this group"));
super.setBorderStylePrimaryName("k-dropdownouter-members");
super.addStyleName("kune-Margin-Medium-t");
- // super.addStyleName("kune-Margin-Small-r");
final GridDragConfiguration dragConf = new GridDragConfiguration(UserGridPanel.USER_GROUP_DD, i18n
.t("Drop in the chat area to start a chat.")
+ "<br/>" + i18n.t("Drop into a room to invite the user to join the chat room"));
gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This is an orphaned project, if you are interested "
+ "please request to join to work on it"), dragConf, true, true, false, true, false);
+ gridMenuPanel.onDoubleClick(new Slot<String>() {
+ public void onEvent(final String groupShortName) {
+ presenter.onDoubleClick(groupShortName);
+ }
+ });
final EntitySummary entitySummary = ws.getEntitySummary();
+ this.setContent(gridMenuPanel);
entitySummary.addInSummary(this);
entitySummary.addListener(new ContainerListenerAdapter() {
@Override
@@ -56,7 +62,6 @@
gridMenuPanel.setWidth(adjWidth);
}
});
- this.setContent(gridMenuPanel);
buttonsCache = new HashMap<GridButton, ToolbarButton>();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -18,11 +18,10 @@
import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcher;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
@@ -176,4 +175,8 @@
}
}
+ public void onDoubleClick(String groupShortName) {
+ stateManager.gotoToken(groupShortName);
+ }
+
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummary.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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.socialnet;
+
+
+public interface ParticipationSummary {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java (from rev 822, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,75 @@
+/*
+ *
+ * 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.socialnet;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.DropDownPanel;
+import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
+import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.EntitySummary;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.gwtext.client.widgets.BoxComponent;
+import com.gwtext.client.widgets.event.ContainerListenerAdapter;
+
+public class ParticipationSummaryPanel extends DropDownPanel implements ParticipationSummaryView {
+
+ private final GridMenuPanel<GroupDTO> gridMenuPanel;
+
+ public ParticipationSummaryPanel(final ParticipationSummaryPresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ super(true);
+ // super.setHeaderText(i18n.t("Participates as..."));
+ super.setHeaderText(i18n.t("Participates in"));
+ super.setHeaderTitle(i18n.t("Groups in which participates"));
+ super.setBorderStylePrimaryName("k-dropdownouter-part");
+ super.addStyleName("kune-Margin-Medium-t");
+ gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This user is not member of any group"), false, false,
+ false, false, false);
+ final EntitySummary entitySummary = ws.getEntitySummary();
+ this.setContent(gridMenuPanel);
+ entitySummary.addInSummary(this);
+ entitySummary.addListener(new ContainerListenerAdapter() {
+ @Override
+ public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
+ final int rawWidth, final int rawHeight) {
+ gridMenuPanel.setWidth(adjWidth);
+ }
+ });
+ }
+
+ public void addItem(final GridItem<GroupDTO> gridItem) {
+ gridMenuPanel.addItem(gridItem);
+ }
+
+ public void clear() {
+ gridMenuPanel.removeAll();
+ }
+
+ public void hide() {
+ this.setVisible(false);
+ }
+
+ public void show() {
+ this.setVisible(true);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -34,7 +34,6 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.ParticipationSummary;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -10,11 +10,11 @@
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.MenuItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenu;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItemCollection;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
@@ -26,14 +26,14 @@
protected GridButton requestJoin;
protected GridButton unJoinButton;
- protected GridMenuItem<GroupDTO> changeToCollabMenuItem;
- protected GridMenuItem<GroupDTO> removeMemberMenuItem;
- protected GridMenuItem<GroupDTO> changeToAdminMenuItem;
- protected GridMenuItem<GroupDTO> acceptJoinGroupMenuItem;
- protected GridMenuItem<GroupDTO> denyJoinGroupMenuItem;
- protected GridMenuItem<GroupDTO> gotoMemberMenuItem;
- protected GridMenuItem<GroupDTO> gotoGroupMenuItem;
- protected GridMenuItem<GroupDTO> unJoinMenuItem;
+ protected MenuItem<GroupDTO> changeToCollabMenuItem;
+ protected MenuItem<GroupDTO> removeMemberMenuItem;
+ protected MenuItem<GroupDTO> changeToAdminMenuItem;
+ protected MenuItem<GroupDTO> acceptJoinGroupMenuItem;
+ protected MenuItem<GroupDTO> denyJoinGroupMenuItem;
+ protected MenuItem<GroupDTO> gotoMemberMenuItem;
+ protected MenuItem<GroupDTO> gotoGroupMenuItem;
+ protected MenuItem<GroupDTO> unJoinMenuItem;
private final I18nUITranslationService i18n;
private final StateManager stateManager;
private final Provider<SocialNetworkServiceAsync> snServiceProvider;
@@ -56,24 +56,24 @@
otherLoggedOperations = new GridMenuItemCollection<GroupDTO>();
}
- public void addGroupOperation(final GridMenuItem<GroupDTO> operation, final boolean mustBeLogged) {
+ public void addGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
GridMenuItemCollection<GroupDTO> collection;
collection = mustBeLogged ? otherLoggedOperations : otherOperations;
collection.add(operation);
}
- public void removeGroupOperation(final GridMenuItem<GroupDTO> operation, final boolean mustBeLogged) {
+ public void removeGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
GridMenuItemCollection<GroupDTO> collection;
collection = mustBeLogged ? otherLoggedOperations : otherOperations;
collection.remove(operation);
}
protected GridItem<GroupDTO> createGridItem(final GridGroup groupCategory, final GroupDTO group,
- final AccessRightsDTO rights, final GridMenuItem<GroupDTO>... gridMenuItems) {
+ final AccessRightsDTO rights, final MenuItem<GroupDTO>... gridMenuItems) {
final GridItem<GroupDTO> gridItem = createDefMemberMenu(group, groupCategory);
final GridMenu<GroupDTO> menu = gridItem.getMenu();
if (rights.isAdministrable()) {
- for (final GridMenuItem<GroupDTO> item : gridMenuItems) {
+ for (final MenuItem<GroupDTO> item : gridMenuItems) {
menu.addMenuItem(item);
}
}
@@ -129,25 +129,25 @@
}
private void createMenuActions() {
- gotoGroupMenuItem = new GridMenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this group homepage"),
+ gotoGroupMenuItem = new MenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this group homepage"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO groupDTO) {
stateManager.gotoToken(groupDTO.getShortName());
}
});
- gotoMemberMenuItem = new GridMenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this member homepage"),
+ gotoMemberMenuItem = new MenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this member homepage"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO groupDTO) {
stateManager.gotoToken(groupDTO.getShortName());
}
});
- unJoinMenuItem = new GridMenuItem<GroupDTO>("images/del.gif", i18n
+ unJoinMenuItem = new MenuItem<GroupDTO>("images/del.gif", i18n
.t("Don't participate more as a member in this group"), new Slot<GroupDTO>() {
public void onEvent(final GroupDTO groupDTO) {
removeMemberAction(groupDTO);
}
});
- changeToCollabMenuItem = new GridMenuItem<GroupDTO>("images/arrow-down-green.gif", i18n
+ changeToCollabMenuItem = new MenuItem<GroupDTO>("images/arrow-down-green.gif", i18n
.t("Change to collaborator"), new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
@@ -162,7 +162,7 @@
});
}
});
- removeMemberMenuItem = new GridMenuItem<GroupDTO>("images/del.gif", i18n.t("Remove this member"),
+ removeMemberMenuItem = new MenuItem<GroupDTO>("images/del.gif", i18n.t("Remove this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
@@ -181,7 +181,7 @@
});
}
});
- changeToAdminMenuItem = new GridMenuItem<GroupDTO>("images/arrow-up-green.gif", i18n.t("Change to admin"),
+ changeToAdminMenuItem = new MenuItem<GroupDTO>("images/arrow-up-green.gif", i18n.t("Change to admin"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
@@ -196,7 +196,7 @@
});
}
});
- acceptJoinGroupMenuItem = new GridMenuItem<GroupDTO>("images/accept.gif", i18n.t("Accept this member"),
+ acceptJoinGroupMenuItem = new MenuItem<GroupDTO>("images/accept.gif", i18n.t("Accept this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
@@ -211,7 +211,7 @@
});
}
});
- denyJoinGroupMenuItem = new GridMenuItem<GroupDTO>("images/cancel.gif", i18n.t("Don't accept this member"),
+ denyJoinGroupMenuItem = new MenuItem<GroupDTO>("images/cancel.gif", i18n.t("Don't accept this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +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.socialnet;
-
-import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher;
-
-public class UserLiveSearcherPresenter extends EntityLiveSearcherPresenter implements UserLiveSearcher {
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummary.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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.summary;
+
+
+public interface GroupSummary {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPanel.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,55 @@
+/*
+ *
+ * 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.summary;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.DropDownPanel;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class GroupSummaryPanel extends DropDownPanel implements GroupSummaryView {
+
+ private final VerticalPanel vp;
+
+ public GroupSummaryPanel(final GroupSummaryPresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ super(i18n.t("Group Summary"), true);
+ setHeaderTitle(i18n.t("Some summarized information about current project" + Site.IN_DEVELOPMENT));
+ vp = new VerticalPanel();
+ vp.setWidth("100%");
+ super.setContent(vp);
+ super.setContentVisible(true);
+ super.setBorderStylePrimaryName("k-dropdownouter-summary");
+ addStyleName("kune-Margin-Medium-t");
+ // Disabled while in development
+ // ws.getEntitySummary().addInSummary(this);
+ }
+
+ public void setComment(final String comment) {
+ final Label label = new Label(comment);
+ label.addStyleName("kune-Margin-Small-trbl");
+ vp.clear();
+ vp.add(label);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -24,7 +24,6 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupSummary;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummary.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,31 @@
+/*
+ *
+ * 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.tags;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+
+public interface TagsSummary {
+
+ void setGroupTags(List<TagResultDTO> result);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -29,10 +29,11 @@
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -60,31 +61,34 @@
addStyleName("kune-Margin-Medium-t");
flowPanel.addStyleName("kune-Margin-Small-trbl");
ws.getEntitySummary().addInSummary(this);
- RootPanel.get("kuneinitialcurtain").setVisible(false);
}
public void setTags(final List<TagResultDTO> groupTags) {
- flowPanel.clear();
- if (groupTags.size() == 0) {
- flowPanel.add(noTagsLabel);
- } else {
- for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
- final TagResultDTO tagResult = iterator.next();
- final Label label = new Label(tagResult.getName());
- // i18n pluralization
- if (tagResult.getCount().intValue() > 1) {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ flowPanel.clear();
+ if (groupTags.size() == 0) {
+ flowPanel.add(noTagsLabel);
} else {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
+ for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
+ final TagResultDTO tagResult = iterator.next();
+ final Label label = new Label(tagResult.getName());
+ // i18n pluralization
+ if (tagResult.getCount().intValue() > 1) {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
+ } else {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
+ }
+ label.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ presenter.doSearchTag(tagResult.getName());
+ }
+ });
+ label.addStyleName("kune-TagsPanel-tag");
+ flowPanel.add(label);
+ }
}
- label.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- presenter.doSearchTag(tagResult.getName());
- }
- });
- label.addStyleName("kune-TagsPanel-tag");
- flowPanel.add(label);
}
- }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -31,7 +31,6 @@
import org.ourproject.kune.workspace.client.search.SiteSearcherType;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
@@ -41,11 +40,11 @@
private TagsSummaryView view;
private final Provider<SiteSearcher> searcherProvider;
- private final Provider<Session> sessionProvider;
+ private final Session session;
- public TagsSummaryPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider,
+ public TagsSummaryPresenter(final Session session, final Provider<SiteSearcher> searcherProvider,
final StateManager stateManager, final WsThemePresenter wsThemePresenter) {
- this.sessionProvider = sessionProvider;
+ this.session = session;
this.searcherProvider = searcherProvider;
stateManager.onStateChanged(new Slot<StateDTO>() {
public void onEvent(final StateDTO state) {
@@ -61,7 +60,7 @@
public void doSearchTag(final String name) {
searcherProvider.get().doSearchOfType(
- "group:" + sessionProvider.get().getCurrentState().getGroup().getShortName() + " tag:" + name,
+ "group:" + session.getCurrentState().getGroup().getShortName() + " tag:" + name,
SiteSearcherType.content);
}
@@ -77,8 +76,13 @@
view.setTags(groupTags);
}
- private void setState(final StateDTO state) {
- view.setTags(state.getGroupTags());
+ void setState(final StateDTO state) {
+ if (state.getTags() != null && state.getTags().length() > 0) {
+ view.setVisible(true);
+ view.setTags(state.getGroupTags());
+ } else {
+ view.setVisible(false);
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -32,4 +32,6 @@
void setTheme(WsTheme oldTheme, WsTheme newTheme);
+ void setVisible(boolean visible);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -27,7 +27,6 @@
import org.ourproject.kune.platf.client.ui.HorizontalLine;
import org.ourproject.kune.platf.client.ui.IconLabel;
-import com.calclab.suco.client.container.Provider;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DockPanel;
@@ -46,10 +45,10 @@
private final I18nTranslationService i18n;
public ContextItemsPanel(final ContextItemsPresenter presenter, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider) {
+ final StateManager stateManager) {
this.presenter = presenter;
this.i18n = i18n;
- topBar = new ContextTopBar(presenter, i18n, stateManagerProvider);
+ topBar = new ContextTopBar(presenter, i18n, stateManager);
addTopBar(topBar);
items = new ItemsPanel(presenter);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -33,7 +33,7 @@
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ParamCallback;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
import com.calclab.suco.client.signal.Slot;
@@ -42,9 +42,11 @@
public class ContextItemsPresenter implements ContextItems {
protected ContextItemsView view;
private final I18nTranslationService i18n;
+ private final StateManager stateManager;
- public ContextItemsPresenter(final I18nTranslationService i18n) {
+ public ContextItemsPresenter(final I18nTranslationService i18n, final StateManager stateManager) {
this.i18n = i18n;
+ this.stateManager = stateManager;
}
public void canCreate(final String typeName, final String label, final Slot<?> slot) {
@@ -83,7 +85,7 @@
DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
new ParamCallback<String, Object>(text, new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
+ stateManager.reloadContextAndTitles();
Site.hideProgress();
}
}));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -26,7 +26,6 @@
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-import com.calclab.suco.client.container.Provider;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HorizontalPanel;
@@ -46,12 +45,12 @@
private final ContextItemsImages img;
private final MenuBar pathSubmenu;
private final I18nTranslationService i18n;
- private final Provider<StateManager> stateManagerProvider;
+ private final StateManager stateManager;
public ContextTopBar(final ContextItemsPresenter presenter, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider) {
+ final StateManager stateManager) {
this.i18n = i18n;
- this.stateManagerProvider = stateManagerProvider;
+ this.stateManager = stateManager;
img = ContextItemsImages.App.getInstance();
firstRow = new HorizontalPanel();
final HorizontalPanel secondRow = new HorizontalPanel();
@@ -114,7 +113,7 @@
}
pathSubmenu.addItem(indent + img.folder().getHTML() + " " + folderName, true, new Command() {
public void execute() {
- stateManagerProvider.get().gotoContainer(folder.getId());
+ stateManager.gotoContainer(folder.getId());
}
});
indent = indent + "  ";
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogo.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogo.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.entitylogo;
+
+
+public interface EntityLogo {
+
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,123 @@
+/*
+ *
+ * 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.ui.newtmp.entitylogo;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class EntityLogoPanel extends SimplePanel implements EntityLogoView {
+ class EntityTextLogo extends VerticalPanel {
+
+ private static final int GROUP_NAME_LIMIT_SIZE = 90;
+ private static final String LOGO_SMALL_FONT_SIZE = "108%";
+ private static final String LOGO_DEFAULT_FONT_SIZE = "167%";
+ private final Label defTextLogoLabel;
+ private final Hyperlink defTextPutYourLogoHL;
+ private final HorizontalPanel putYourLogoHP;
+
+ public EntityTextLogo() {
+ // Initialize
+ super();
+ defTextLogoLabel = new Label();
+ final HTML expandCell = new HTML("<b></b>");
+ putYourLogoHP = new HorizontalPanel();
+ defTextPutYourLogoHL = new Hyperlink();
+
+ // Layout
+ add(defTextLogoLabel);
+ add(putYourLogoHP);
+ putYourLogoHP.add(expandCell);
+ putYourLogoHP.add(defTextPutYourLogoHL);
+
+ // Set properties
+ // TODO: Put your logo here functionality
+ defTextPutYourLogoHL.setText(i18n.t("Put Your Logo Here"));
+ expandCell.setWidth("100%");
+ putYourLogoHP.setCellWidth(expandCell, "100%");
+ // TODO: link to configure the logo
+ setStylePrimaryName("k-entitytextlogo");
+ setDefaultText("");
+ }
+
+ public void setDefaultText(final String text) {
+ if (text.length() > GROUP_NAME_LIMIT_SIZE) {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_SMALL_FONT_SIZE);
+ } else {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_DEFAULT_FONT_SIZE);
+ }
+ defTextLogoLabel.setText(text);
+
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ putYourLogoHP.setVisible(visible);
+ }
+
+ }
+
+ private EntityTextLogo entityTextLogo;
+ private final I18nTranslationService i18n;
+
+ public EntityLogoPanel(final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ ws.getEntityMainHeader().add(this);
+ }
+
+ public void setLogo(final Image image) {
+ clear();
+ add(image);
+ }
+
+ public void setLogo(final String groupName) {
+ clear();
+ add(getEntityTextLogo());
+ entityTextLogo.setDefaultText(groupName);
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ getEntityTextLogo().setPutYourLogoVisible(visible);
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ getEntityTextLogo().removeStyleDependentName(oldTheme.toString());
+ }
+ getEntityTextLogo().addStyleDependentName(newTheme.toString());
+ }
+
+ private EntityTextLogo getEntityTextLogo() {
+ if (entityTextLogo == null) {
+ this.entityTextLogo = new EntityTextLogo();
+ }
+ return entityTextLogo;
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPresenter.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,37 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.entitylogo;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
+
+public class EntityLogoPresenter implements EntityLogo {
+ private EntityLogoView view;
+
+ public EntityLogoPresenter(final StateManager stateManager, final WsThemePresenter theme) {
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ final GroupDTO group = state.getGroup();
+ final boolean isAdmin = state.getGroupRights().isAdministrable();
+
+ view.setLogo(group.getLongName());
+ view.setPutYourLogoVisible(isAdmin);
+ }
+ });
+ theme.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void init(final EntityLogoView view) {
+ this.view = view;
+
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoView.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,17 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.entitylogo;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Image;
+
+public interface EntityLogoView {
+
+ // FIXME: Don' use Image
+ public abstract void setLogo(final Image image);
+
+ public abstract void setLogo(final String groupName);
+
+ public abstract void setPutYourLogoVisible(final boolean visible);
+
+ public abstract void setTheme(final WsTheme oldTheme, WsTheme newTheme);
+}
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-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -36,7 +36,7 @@
public void addInTools(final Widget widget) {
entityTools.add(widget);
- mainPanel.doLayoutIfNeeded(true);
+ mainPanel.doLayoutIfNeeded();
}
public void addListener(final ContainerListener listener) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -30,7 +30,6 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
import com.calclab.suco.client.signal.Slot;
@@ -42,11 +41,13 @@
private EntityTitleView view;
private final I18nTranslationService i18n;
private final KuneErrorHandler errorHandler;
+ private final StateManager stateManager;
public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler,
final StateManager stateManager) {
this.i18n = i18n;
this.errorHandler = errorHandler;
+ this.stateManager = stateManager;
stateManager.onStateChanged(new Slot<StateDTO>() {
public void onEvent(final StateDTO state) {
setState(state);
@@ -73,7 +74,7 @@
public void onSuccess(final String result) {
Site.hideProgress();
view.setContentTitle(result);
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
+ stateManager.reloadContextAndTitles();
}
};
DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,32 +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.workspace;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-
-public interface ContentBottomToolBarComponent extends Component {
-
- void setEnabledRateIt(boolean enabled);
-
- void setRate(StateDTO state, boolean logged);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,76 +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.workspace;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-
-public class ContentBottomToolBarPresenter implements ContentBottomToolBarComponent {
-
- private ContentBottomToolBarView view;
-
- public void init(final ContentBottomToolBarView view) {
- this.view = view;
- }
-
- public View getView() {
- return view;
- }
-
- public void setRate(final StateDTO state, boolean logged) {
- if (state.isRateable()) {
- if (!logged) {
- setRate(state.getRate(), state.getRateByUsers());
- } else {
- setRate(state.getRate(), state.getRateByUsers(), state.getCurrentUserRate());
- }
- } else {
- setRateVisible(false);
- setRateItVisible(false);
- }
- }
-
- private void setRate(final Double value, final Integer rateByUsers, final Double currentUserRate) {
- view.setRate(value, rateByUsers);
- view.setRateIt(currentUserRate);
- setRateVisible(true);
- setRateItVisible(true);
- }
-
- private void setRate(final Double value, final Integer rateByUsers) {
- view.setRate(value, rateByUsers);
- setRateVisible(true);
- setRateItVisible(false);
- }
-
- private void setRateVisible(final boolean visible) {
- view.setRateVisible(visible);
- }
-
- private void setRateItVisible(final boolean visible) {
- view.setRateItVisible(visible);
- }
-
- public void setEnabledRateIt(final boolean enabled) {
- view.setRateItVisible(enabled);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,35 +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.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ContentBottomToolBarView extends View {
-
- void setRate(Double value, Integer rateByUsers);
-
- void setRateIt(Double currentUserRate);
-
- void setRateVisible(boolean b);
-
- void setRateItVisible(boolean visible);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,32 +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.workspace;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-
-public interface ContentSubTitleComponent extends Component {
-
- void setState(StateDTO state);
-
- void setContentLanguage(String langName);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitlePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitlePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,65 +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.workspace;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-
-public class ContentSubTitlePresenter implements ContentSubTitleComponent {
-
- private ContentSubTitleView view;
- private final I18nTranslationService i18n;
-
- public ContentSubTitlePresenter(final I18nTranslationService i18n) {
- this.i18n = i18n;
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final ContentSubTitleView view) {
- this.view = view;
- }
-
- public void setContentLanguage(final String langName) {
- view.setContentSubTitleRight(i18n.t("Language: [%s]", langName));
- }
-
- public void setState(final StateDTO state) {
- if (state.hasDocument()) {
- view.setContentSubTitleLeft(i18n.tWithNT("by: [%s]", "used in a list of authors", state.getAuthors().get(0)
- .getName()));
- view.setContentSubTitleLeftVisible(true);
- } else {
- view.setContentSubTitleLeftVisible(false);
- }
- if (state.getLanguage() != null) {
- String langName = state.getLanguage().getEnglishName();
- setContentLanguage(langName);
- view.setContentSubTitleRightVisible(true);
- } else {
- view.setContentSubTitleRightVisible(false);
- }
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,34 +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.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ContentSubTitleView extends View {
-
- void setContentSubTitleLeft(String subTitle);
-
- void setContentSubTitleRight(String subTitle);
-
- void setContentSubTitleLeftVisible(boolean visible);
-
- void setContentSubTitleRightVisible(boolean visible);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,34 +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.workspace;
-
-import java.util.Date;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-
-public interface ContentTitleComponent extends Component {
-
- void setState(StateDTO state);
-
- void setContentDate(Date publishedOn);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitlePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitlePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,106 +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.workspace;
-
-import java.util.Date;
-
-import org.ourproject.kune.docs.client.actions.DocsEvents;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.rpc.ParamCallback;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.KuneErrorHandler;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class ContentTitlePresenter implements ContentTitleComponent {
-
- private ContentTitleView view;
- private final I18nTranslationService i18n;
- private final KuneErrorHandler errorHandler;
-
- public ContentTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler) {
- this.i18n = i18n;
- this.errorHandler = errorHandler;
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final ContentTitleView view) {
- this.view = view;
- }
-
- public void onTitleRename(final String text) {
- Site.showProgressSaving();
- AsyncCallback<String> callback = new AsyncCallback<String>() {
- public void onFailure(final Throwable caught) {
- view.restoreOldTitle();
- errorHandler.process(caught);
- }
-
- public void onSuccess(final String result) {
- Site.hideProgress();
- view.setContentTitle(result);
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
- }
- };
- DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
- new ParamCallback<String, String>(text, callback));
- }
-
- public void setContentDate(final Date publishedOn) {
- DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
- view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
- }
-
- public void setState(final StateDTO state) {
- if (state.hasDocument()) {
- setContentTitle(state.getTitle(), state.getContentRights().isEditable());
- setContentDateVisible(true);
- setContentDate(state.getPublishedOn());
- } else {
- if (state.getFolder().getParentFolderId() == null) {
- // We translate root folder names (documents, chat room,
- // etcetera)
- setContentTitle(i18n.t(state.getTitle()), false);
- } else {
- setContentTitle(state.getTitle(), state.getContentRights().isEditable());
- }
- setContentDateVisible(false);
- }
- }
-
- private void setContentDateVisible(final boolean visible) {
- view.setDateVisible(visible);
- }
-
- private void setContentTitle(final String title, final boolean editable) {
- view.setContentTitle(title);
- view.setContentTitleEditable(editable);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,37 +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.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ContentTitleView extends View {
-
- void setContentTitle(String title);
-
- void setContentDate(String date);
-
- void setDateVisible(boolean visible);
-
- void setContentTitleEditable(boolean editable);
-
- void restoreOldTitle();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +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.workspace;
-
-import org.ourproject.kune.platf.client.Component;
-
-public interface ContentToolBarComponent extends Component {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,36 +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.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public class ContentToolBarPresenter implements ContentToolBarComponent {
-
- private ContentToolBarView view;
-
- public void init(final ContentToolBarView view) {
- this.view = view;
- }
-
- public View getView() {
- return view;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,27 +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.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ContentToolBarView extends View {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,32 +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.workspace;
-
-import org.ourproject.kune.platf.client.dto.LinkDTO;
-
-import com.calclab.suco.client.signal.Slot;
-
-public interface EntityLiveSearcher {
-
- void onSelection(Slot<LinkDTO> slot);
-
- void show();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,25 +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.workspace;
-
-public interface GroupLiveSearcher extends EntityLiveSearcher {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,32 +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.workspace;
-
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
-
-public interface GroupMembersSummary {
-
- void addGroupOperation(GridMenuItem<GroupDTO> operation, boolean mustBeLogged);
-
- void removeGroupOperation(GridMenuItem<GroupDTO> operation, boolean mustBeLogged);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +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.workspace;
-
-
-public interface GroupSummary {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +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.workspace;
-
-
-public interface ParticipationSummary {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -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.workspace;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-
-public interface TagsSummary {
-
- void setGroupTags(List<TagResultDTO> result);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ThemeMenuComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ThemeMenuComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ThemeMenuComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -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.workspace;
-
-import org.ourproject.kune.platf.client.Component;
-
-public interface ThemeMenuComponent extends Component {
-
- void setThemes(String themes[]);
-
- void setVisible(boolean visible);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,24 +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.workspace;
-
-public interface UserLiveSearcher extends EntityLiveSearcher {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,57 +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.workspace;
-
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.tool.ClientTool;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
-
-public interface Workspace extends Component {
-
- public static final int MIN_WIDTH = 800;
-
- public static final int MIN_HEIGHT = 480;
-
- public void adjustSize(int windowWidth, int clientHeight);
-
- public void attachTools(Iterator<ClientTool> iterator);
-
- public int calculateHeight(int clientHeight);
-
- public int calculateWidth(int clientWidth);
-
- public ContentSubTitleComponent getContentSubTitleComponent();
-
- public ContentTitleComponent getContentTitleComponent();
-
- public LicenseComponent getLicenseComponent();
-
- public void setTheme(String theme);
-
- public void setTool(String toolName);
-
- public void setVisible(boolean visible);
-
- public void showGroup(GroupDTO group, boolean isAdmin);
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceListener.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceListener.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,24 +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.workspace;
-
-public interface WorkspaceListener {
- void onTabSelected(int tabIndex);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,164 +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.workspace;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidget;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.tool.ClientTool;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
-
-import com.google.gwt.user.client.ui.Widget;
-
-public class WorkspacePresenter implements Workspace {
- private WorkspaceView view;
- private WorkspaceComponent context;
- private WorkspaceComponent content;
- private WorkspaceUIComponents components;
- private ExtensibleWidgetsManager extensionPointManager;
-
- public WorkspacePresenter(final Session session) {
- }
-
- public void adjustSize(final int windowWidth, final int clientHeight) {
- view.adjustSize(windowWidth, clientHeight);
- }
-
- public void attachToExtensibleWidget(final ExtensibleWidgetChild child) {
- extensionPointManager.attachToExtensible(child);
- }
-
- public void attachTools(final Iterator<ClientTool> iterator) {
- ClientTool clientTool;
- while (iterator.hasNext()) {
- clientTool = iterator.next();
- // view.addTab(clientTool.getTrigger());
- }
- }
-
- /**
- * Calculates Workspaceheight depending of the client Window size but with a
- * limit
- */
- public int calculateHeight(final int clientHeight) {
- // 15 is the size of scrollbar
- return clientHeight <= MIN_HEIGHT ? MIN_HEIGHT - 15 : clientHeight;
- }
-
- /**
- * Calculates Workspace width depending of the client Window size but with a
- * limit
- */
- public int calculateWidth(final int clientWidth) {
- return clientWidth <= MIN_WIDTH ? MIN_WIDTH - 15 : clientWidth;
- }
-
- public void clearExtensibleWidget(final String id) {
- extensionPointManager.detachAll(id);
- }
-
- public void detachFromExtensibleWidget(final ExtensibleWidgetChild child) {
- extensionPointManager.detachFromExtensible(child);
- }
-
- public ContentSubTitleComponent getContentSubTitleComponent() {
- return components.getContentSubTitleComponent();
- }
-
- public ContentTitleComponent getContentTitleComponent() {
- return components.getContentTitleComponent();
- }
-
- public LicenseComponent getLicenseComponent() {
- return components.getLicenseComponent();
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final WorkspaceView view, final ExtensibleWidgetsManager extensionPointManager) {
- this.view = view;
- this.extensionPointManager = extensionPointManager;
- this.components = new WorkspaceUIComponents(this);
- view.setComponents(components);
- view.registerUIExtensionPoints();
- }
-
- public void onSplitterStartResizing(final Widget sender) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, null);
- }
-
- public void onSplitterStopResizing(final Widget sender) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, null);
- }
-
- public void registerExtensibleWidget(final String id, final ExtensibleWidget extensibleWidget) {
- extensionPointManager.registerExtensibleWidget(id, extensibleWidget);
- }
-
- public void registerExtensibleWidgets(final HashMap<String, ExtensibleWidget> extensibleWidget) {
- extensionPointManager.registerExtensibleWidgets(extensibleWidget);
- }
-
- public void setContent(final WorkspaceComponent contentComponent) {
- if (content != null) {
- content.detach();
- }
- content = contentComponent;
- content.attach();
- view.setContent(content.getView());
- }
-
- public void setContext(final WorkspaceComponent contextComponent) {
- if (context != null) {
- context.detach();
- }
- context = contextComponent;
- context.attach();
- view.setContext(context.getView());
- }
-
- public void setTheme(final String theme) {
- view.setTheme(theme);
- }
-
- public void setTool(final String toolName) {
- view.setTool(toolName);
- }
-
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
- }
-
- public void showGroup(final GroupDTO group, final boolean isAdmin) {
- view.setGroupLogo(group.getLongName());
- view.setPutYourLogoVisible(isAdmin);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,63 +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.workspace;
-
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
-
-public class WorkspaceUIComponents {
- private LicenseComponent license;
- private ContentTitleComponent contentTitle;
- private ContentSubTitleComponent contentSubTitle;
- private ContentToolBarComponent contentToolBar;
-
- public WorkspaceUIComponents(final WorkspacePresenter presenter) {
- }
-
- public ContentSubTitleComponent getContentSubTitleComponent() {
- if (contentSubTitle == null) {
- contentSubTitle = WorkspaceFactory.createContentSubTitleComponent();
- }
- return contentSubTitle;
- }
-
- public ContentTitleComponent getContentTitleComponent() {
- if (contentTitle == null) {
- contentTitle = WorkspaceFactory.createContentTitleComponent();
- }
- return contentTitle;
- }
-
- public ContentToolBarComponent getContentToolBarComponent() {
- if (contentToolBar == null) {
- contentToolBar = WorkspaceFactory.createContentToolBarComponent();
- }
- return contentToolBar;
- }
-
- public LicenseComponent getLicenseComponent() {
- if (license == null) {
- license = WorkspaceFactory.createLicenseComponent();
- }
- return license;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,73 +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.workspace;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.tool.ToolTrigger;
-
-import com.google.gwt.user.client.ui.Image;
-
-public interface WorkspaceView extends View {
-
- void setGroupLogo(String groupName);
-
- void setGroupLogo(Image image);
-
- void setContent(View contentView);
-
- void setContext(View contextView);
-
- void setTool(String toolName);
-
- void adjustSize(int windowWidth, int clientHeight);
-
- void addTab(ToolTrigger trigger);
-
- void setContentTitle(View view);
-
- void setContentSubTitle(View view);
-
- void setBottom(View view);
-
- void setGroupMembers(View view);
-
- void setParticipation(View view);
-
- void setSummary(View view);
-
- void addBottomIconComponent(View view);
-
- void setTheme(String theme);
-
- void setVisible(boolean visible);
-
- void setTags(View view);
-
- void setContentToolBar(View view);
-
- void setContentBottomToolBar(View view);
-
- void setPutYourLogoVisible(boolean visible);
-
- void registerUIExtensionPoints();
-
- void setComponents(WorkspaceUIComponents components);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/BottomIconsTrayPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/BottomIconsTrayPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/BottomIconsTrayPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,23 +0,0 @@
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.platf.client.extend.ExtensibleWidget;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class BottomIconsTrayPanel extends HorizontalPanel implements ExtensibleWidget {
-
- public void attach(final ExtensibleWidgetChild child) {
- super.add((Widget) child.getView());
- }
-
- public void detach(final ExtensibleWidgetChild child) {
- super.remove((Widget) child.getView());
- }
-
- public void detachAll(final String id) {
- super.clear();
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentBottomToolBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentBottomToolBarPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentBottomToolBarPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,88 +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.workspace.ui;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.CustomPushButton;
-import org.ourproject.kune.workspace.client.workspace.ContentBottomToolBarPresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentBottomToolBarView;
-
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class ContentBottomToolBarPanel extends HorizontalPanel implements ContentBottomToolBarView {
-
- // private final RatePanel rate;
- // private final RateItPresenter rateItPresenter;
- // private final RateItPanel rateIt;
- private CustomPushButton btn;
-
- public ContentBottomToolBarPanel(final ContentBottomToolBarPresenter presenter, final I18nTranslationService i18n) {
- // rate = new RatePanel(null, null, i18n);
- // rateItPresenter = null;
- // rateIt = new RateItPanel(rateItPresenter, i18n, null);
- // rateItPresenter.init(rateIt);
- final Label expand = new Label("");
- // this.add(rateIt);
- this.add(expand);
- // this.add(rate);
- this.setWidth("100%");
- expand.setWidth("100%");
- this.setCellWidth(expand, "100%");
- this.addStyleName("kune-ContentToolBarPanel");
- this.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- // this.setCellVerticalAlignment(rate, VerticalPanel.ALIGN_MIDDLE);
- // this.setCellVerticalAlignment(rateIt, VerticalPanel.ALIGN_MIDDLE);
- // rate.setVisible(false);
- // rateIt.setVisible(false);
- // TODO setEnabled false to RateIt
- }
-
- public void addButton(final String caption, final ClickListener listener) {
- btn = new CustomPushButton(caption, listener);
- this.insert(btn, 0);
- btn.addStyleName("kune-Button-Large-lrSpace");
- }
-
- public void setButtonVisible(final boolean isEnabled) {
- btn.setVisible(isEnabled);
- }
-
- public void setRate(final Double value, final Integer rateByUsers) {
- // rate.setRate(value);
- // rate.setByUsers(rateByUsers);
- }
-
- public void setRateIt(final Double currentUserRate) {
- // rateItPresenter.setRate(currentUserRate);
- }
-
- public void setRateItVisible(final boolean visible) {
- // rateIt.setVisible(visible);
- }
-
- public void setRateVisible(final boolean visible) {
- // rate.setVisible(visible);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentSubTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentSubTitlePanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentSubTitlePanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,82 +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.workspace.ui;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitleView;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class ContentSubTitlePanel extends HorizontalPanel implements ContentSubTitleView {
- private final Label subTitleLeftLabel;
- private final Label subTitleRightLabel;
-
- public ContentSubTitlePanel(final ContentSubTitlePresenter presenter, final I18nTranslationService i18n) {
-
- subTitleLeftLabel = new Label();
- HorizontalPanel rigthHP = new HorizontalPanel();
- subTitleRightLabel = new Label();
-
- add(subTitleLeftLabel);
- add(rigthHP);
- rigthHP.add(subTitleRightLabel);
-
- setWidth("100%");
- subTitleRightLabel.setText(i18n.t("Language:"));
- subTitleLeftLabel.addStyleName("kune-Margin-Large-l");
- subTitleLeftLabel.addStyleName("kune-ft15px");
- subTitleLeftLabel.addStyleName("kune-ContentSubTitleBar-l");
- subTitleRightLabel.addStyleName("kune-Margin-Large-r");
- subTitleRightLabel.addStyleName("kune-ft12px");
- rigthHP.addStyleName("kune-ContentSubTitleBar-r");
- setCellVerticalAlignment(rigthHP, VerticalPanel.ALIGN_MIDDLE);
- rigthHP.setCellVerticalAlignment(subTitleLeftLabel, VerticalPanel.ALIGN_MIDDLE);
- rigthHP.setCellVerticalAlignment(subTitleRightLabel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setColors(final String background, final String textColor) {
- DOM.setStyleAttribute(this.getElement(), "backgroundColor", background);
- DOM.setStyleAttribute(subTitleLeftLabel.getElement(), "color", textColor);
- DOM.setStyleAttribute(subTitleRightLabel.getElement(), "color", textColor);
- }
-
- public void setContentSubTitleLeft(final String subTitle) {
- subTitleLeftLabel.setText(subTitle);
- }
-
- public void setContentSubTitleLeftVisible(final boolean visible) {
- subTitleLeftLabel.setVisible(visible);
- }
-
- public void setContentSubTitleRight(final String subTitle) {
- subTitleRightLabel.setText(subTitle);
-
- }
-
- public void setContentSubTitleRightVisible(final boolean visible) {
- subTitleRightLabel.setVisible(visible);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentTitlePanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentTitlePanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,88 +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.workspace.ui;
-
-import org.ourproject.kune.platf.client.ui.EditableIconLabel;
-import org.ourproject.kune.platf.client.ui.EditableClickListener;
-import org.ourproject.kune.workspace.client.workspace.ContentTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentTitleView;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class ContentTitlePanel extends HorizontalPanel implements ContentTitleView {
- private final EditableIconLabel titleLabel;
- private final Label dateLabel;
-
- public ContentTitlePanel(final ContentTitlePresenter presenter) {
- titleLabel = new EditableIconLabel(new EditableClickListener() {
- public void onEdited(final String text) {
- presenter.onTitleRename(text);
- }
- });
- HorizontalPanel rigthHP = new HorizontalPanel();
- dateLabel = new Label();
-
- add(titleLabel);
- add(rigthHP);
- rigthHP.add(dateLabel);
-
- setWidth("100%");
- titleLabel.addStyleName("kune-Margin-Large-l");
- titleLabel.addStyleName("kune-ft17px");
- dateLabel.addStyleName("kune-Margin-Large-r");
- dateLabel.addStyleName("kune-ft12px");
- titleLabel.addStyleName("kune-ContentTitleBar-l");
- rigthHP.addStyleName("kune-ContentTitleBar-r");
- setCellVerticalAlignment(titleLabel, VerticalPanel.ALIGN_MIDDLE);
- setCellVerticalAlignment(rigthHP, VerticalPanel.ALIGN_MIDDLE);
- rigthHP.setCellVerticalAlignment(dateLabel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContentTitle(final String title) {
- titleLabel.setText(title);
- }
-
- public void setContentTitleEditable(final boolean editable) {
- titleLabel.setEditable(editable);
- }
-
- public void setContentDate(final String date) {
- dateLabel.setText(date);
- }
-
- public void setColors(final String background, final String textColor) {
- DOM.setStyleAttribute(this.getElement(), "backgroundColor", background);
- DOM.setStyleAttribute(titleLabel.getElement(), "color", textColor);
- DOM.setStyleAttribute(dateLabel.getElement(), "color", textColor);
- }
-
- public void setDateVisible(final boolean visible) {
- dateLabel.setVisible(visible);
-
- }
-
- public void restoreOldTitle() {
- titleLabel.restoreOldText();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentToolBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentToolBarPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentToolBarPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,70 +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.workspace.ui;
-
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.extend.ExtensibleWidget;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarPresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarView;
-
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-
-public class ContentToolBarPanel extends HorizontalPanel implements ContentToolBarView, ExtensibleWidget {
-
- private final HorizontalPanel leftHP;
-
- public ContentToolBarPanel(final ContentToolBarPresenter presenter) {
- leftHP = new HorizontalPanel();
- add(leftHP);
- add(new Label(""));
- this.setWidth("100%");
- this.addStyleName("kune-ContentToolBarPanel");
- leftHP.addStyleName("kune-Margin-Large-l");
- }
-
- public HashMap<String, ExtensibleWidget> getExtensionPoints() {
- HashMap<String, ExtensibleWidget> extPoints = new HashMap<String, ExtensibleWidget>();
- extPoints.put(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, this);
- return extPoints;
- }
-
- public void attach(final ExtensibleWidgetChild child) {
- if (child.getParentId().equals(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT)) {
- leftHP.add((Widget) child.getView());
- }
- }
-
- public void detach(final ExtensibleWidgetChild child) {
- if (child.getParentId().equals(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT)) {
- leftHP.remove((Widget) child.getView());
- }
- }
-
- public void detachAll(final String id) {
- if (id.equals(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT)) {
- leftHP.clear();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,6 +0,0 @@
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-
-public interface EntityLogo {
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,123 +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.workspace.ui;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Hyperlink;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class EntityLogoPanel extends SimplePanel implements EntityLogoView {
- class EntityTextLogo extends VerticalPanel {
-
- private static final int GROUP_NAME_LIMIT_SIZE = 90;
- private static final String LOGO_SMALL_FONT_SIZE = "108%";
- private static final String LOGO_DEFAULT_FONT_SIZE = "167%";
- private final Label defTextLogoLabel;
- private final Hyperlink defTextPutYourLogoHL;
- private final HorizontalPanel putYourLogoHP;
-
- public EntityTextLogo() {
- // Initialize
- super();
- defTextLogoLabel = new Label();
- final HTML expandCell = new HTML("<b></b>");
- putYourLogoHP = new HorizontalPanel();
- defTextPutYourLogoHL = new Hyperlink();
-
- // Layout
- add(defTextLogoLabel);
- add(putYourLogoHP);
- putYourLogoHP.add(expandCell);
- putYourLogoHP.add(defTextPutYourLogoHL);
-
- // Set properties
- // TODO: Put your logo here functionality
- defTextPutYourLogoHL.setText(i18n.t("Put Your Logo Here"));
- expandCell.setWidth("100%");
- putYourLogoHP.setCellWidth(expandCell, "100%");
- // TODO: link to configure the logo
- setStylePrimaryName("k-entitytextlogo");
- setDefaultText("");
- }
-
- public void setDefaultText(final String text) {
- if (text.length() > GROUP_NAME_LIMIT_SIZE) {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_SMALL_FONT_SIZE);
- } else {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_DEFAULT_FONT_SIZE);
- }
- defTextLogoLabel.setText(text);
-
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- putYourLogoHP.setVisible(visible);
- }
-
- }
-
- private EntityTextLogo entityTextLogo;
- private final I18nTranslationService i18n;
-
- public EntityLogoPanel(final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
- this.i18n = i18n;
- ws.getEntityMainHeader().add(this);
- }
-
- public void setLogo(final Image image) {
- clear();
- add(image);
- }
-
- public void setLogo(final String groupName) {
- clear();
- add(getEntityTextLogo());
- entityTextLogo.setDefaultText(groupName);
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- getEntityTextLogo().setPutYourLogoVisible(visible);
- }
-
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- if (oldTheme != null) {
- getEntityTextLogo().removeStyleDependentName(oldTheme.toString());
- }
- getEntityTextLogo().addStyleDependentName(newTheme.toString());
- }
-
- private EntityTextLogo getEntityTextLogo() {
- if (entityTextLogo == null) {
- this.entityTextLogo = new EntityTextLogo();
- }
- return entityTextLogo;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,37 +0,0 @@
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-
-import com.calclab.suco.client.signal.Slot;
-import com.calclab.suco.client.signal.Slot2;
-
-public class EntityLogoPresenter implements EntityLogo {
- private EntityLogoView view;
-
- public EntityLogoPresenter(final StateManager stateManager, final WsThemePresenter theme) {
- stateManager.onStateChanged(new Slot<StateDTO>() {
- public void onEvent(final StateDTO state) {
- final GroupDTO group = state.getGroup();
- final boolean isAdmin = state.getGroupRights().isAdministrable();
-
- view.setLogo(group.getLongName());
- view.setPutYourLogoVisible(isAdmin);
- }
- });
- theme.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
- public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
- });
- }
-
- public void init(final EntityLogoView view) {
- this.view = view;
-
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,17 +0,0 @@
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-
-import com.google.gwt.user.client.ui.Image;
-
-public interface EntityLogoView {
-
- // FIXME: Don' use Image
- public abstract void setLogo(final Image image);
-
- public abstract void setLogo(final String groupName);
-
- public abstract void setPutYourLogoVisible(final boolean visible);
-
- public abstract void setTheme(final WsTheme oldTheme, WsTheme newTheme);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,106 +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.workspace.ui;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.tool.ToolTrigger;
-import org.ourproject.kune.platf.client.tool.ToolTrigger.TriggerListener;
-import org.ourproject.kune.platf.client.ui.HasColor;
-import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-
-import com.google.gwt.user.client.ui.Hyperlink;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-class GroupToolsBar extends VerticalPanel {
- private static final String ITEM_SELECTED = "kune-GroupToolsBar-itemSelected";
- private static final String ITEM_NOT_SELECTED = "kune-GroupToolsBar-itemNotSelected";
- private Widget currentTab;
- private final HashMap<String, Widget> tabs;
-
- public GroupToolsBar() {
- // this.colorTheme = colorTheme;
- tabs = new HashMap<String, Widget>();
- currentTab = null;
- addStyleName("kune-GroupToolsBar");
- }
-
- public void addItem(final ToolTrigger trigger) {
- final int nextIndex = this.getWidgetCount();
- final Widget menuItem = createItem(nextIndex, trigger);
- setTabSelected(menuItem, false);
- tabs.put(trigger.getName(), menuItem);
- this.add(menuItem);
- }
-
- public void selectItem(final String toolName) {
- if (currentTab != null) {
- setTabSelected(currentTab, false);
- }
- currentTab = getWidget(toolName);
- setTabSelected(currentTab, true);
- }
-
- public void setTabsColors(final String selectedColor, final String unSelectedColor) {
- final Iterator<Widget> iter = tabs.values().iterator();
- while (iter.hasNext()) {
- final Widget w = iter.next();
- if (w == currentTab) {
- ((HasColor) w).setColor(selectedColor);
- } else {
- ((HasColor) w).setColor(unSelectedColor);
- }
- }
- }
-
- private Widget createItem(final int index, final ToolTrigger trigger) {
- final SimplePanel menuItem = new SimplePanel();
- addStyleName("Tab");
- final Hyperlink hl = new Hyperlink(trigger.getLabel(), "");
- trigger.setListener(new TriggerListener() {
- public void onStateChanged(final String encoded) {
- hl.setTargetHistoryToken(encoded);
- }
- });
- menuItem.add(hl);
- return new RoundedBorderDecorator(menuItem, RoundedBorderDecorator.RIGHT);
- }
-
- private Widget getWidget(final String toolName) {
- return tabs.get(toolName);
- }
-
- private void setTabSelected(final Widget tab, final boolean isSelected) {
- if (isSelected) {
- tab.removeStyleName(ITEM_NOT_SELECTED);
- tab.addStyleName(ITEM_SELECTED);
- } else {
- tab.removeStyleName(ITEM_SELECTED);
- tab.addStyleName(ITEM_NOT_SELECTED);
- }
- // tring color = isSelected ? colorTheme.getToolSelected() :
- // colorTheme.getToolUnselected();
- // ((HasColor) tab).setColor(color);
- }
-
-}
\ No newline at end of file
Deleted: 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-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,369 +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.workspace.ui;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.tool.ToolTrigger;
-import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-import org.ourproject.kune.platf.client.ui.SplitterListener;
-import org.ourproject.kune.platf.client.ui.gwtcustom.CustomHorizontalSplitPanel;
-import org.ourproject.kune.workspace.client.licensefoot.ui.LicensePanel;
-import org.ourproject.kune.workspace.client.workspace.WorkspacePresenter;
-import org.ourproject.kune.workspace.client.workspace.WorkspaceUIComponents;
-import org.ourproject.kune.workspace.client.workspace.WorkspaceView;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ChangeListener;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.HorizontalSplitPanelImages;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class WorkspacePanel extends Composite implements WorkspaceView {
- private static final int DEF_CONTEXT_WIDTH = 175;
- private static final Images img = Images.App.getInstance();
-
- // private final EntityLogoPanel groupLogoPanel;
- private final HorizontalPanel contentTitleBarHP;
- private final HorizontalPanel contentSubTitleBarHP;
- private final GroupToolsBar groupToolsBar;
- private final CustomHorizontalSplitPanel cntcxtHSP;
- private final VerticalPanel contextVP;
- private final VerticalPanel contentVP;
- private final HorizontalPanel contentBottomBarHP;
- private final VerticalPanel groupDropDownsVP;
- private final RoundedBorderDecorator contentTitleBarBorderDec;
- private final RoundedBorderDecorator bottomBorderDecorator;
- private final VerticalPanel cntcxtVP;
- private final ScrollPanel groupDropDownsSP;
- private final BottomIconsTrayPanel bottomIconsTrayPanel;
- private ContentTitlePanel contentTitlePanel;
- private ContentSubTitlePanel contentSubTitlePanel;
- private ContentToolBarPanel contentToolBarPanel;
- private final HorizontalPanel contentToolBarHP;
- private final ScrollPanel contentSP;
- private final HorizontalPanel contentBottomToolBarHP;
- private ContentBottomToolBarPanel contentBottomToolBarPanel;
- private LicensePanel bottomPanel;
-
- private int previousRightWidgetWidth;
- private final WorkspacePresenter presenter;
-
- public WorkspacePanel(final WorkspacePresenter presenter, final I18nTranslationService i18n) {
- this.presenter = presenter;
- // Initialize
- final VerticalPanel generalVP = new VerticalPanel();
- initWidget(generalVP);
- // groupLogoPanel = new EntityLogoPanel(i18n);
- final HorizontalPanel generalHP = new HorizontalPanel();
- cntcxtVP = new VerticalPanel();
- final VerticalPanel groupNavBarVP = new VerticalPanel();
- groupToolsBar = new GroupToolsBar();
- bottomIconsTrayPanel = new BottomIconsTrayPanel();
- groupDropDownsSP = new ScrollPanel();
- groupDropDownsVP = new VerticalPanel();
- contentTitleBarHP = new HorizontalPanel();
- contentTitleBarBorderDec = new RoundedBorderDecorator(contentTitleBarHP, RoundedBorderDecorator.TOPLEFT);
- contentSubTitleBarHP = new HorizontalPanel();
- contentToolBarHP = new HorizontalPanel();
- cntcxtHSP = new CustomHorizontalSplitPanel(new HorizontalSplitPanelImages() {
- public AbstractImagePrototype horizontalSplitPanelThumb() {
- return img.splitterVertBar();
- }
- });
- cntcxtHSP.addChangeListener(new ChangeListener() {
- public void onChange(final Widget sender) {
- adjustSizeContentSP();
- saveCurrentRightWidgetWidth(cntcxtHSP.getRightWidgetAvailableWidth());
- }
- });
- cntcxtHSP.addSplitterListener(new SplitterListener() {
- public void onStartResizing(final Widget sender) {
- presenter.onSplitterStartResizing(sender);
- }
-
- public void onStopResizing(final Widget sender) {
- presenter.onSplitterStopResizing(sender);
- }
- });
- contentVP = new VerticalPanel();
- contextVP = new VerticalPanel();
- contentSP = new ScrollPanel();
- contentBottomToolBarHP = new HorizontalPanel();
- contentBottomBarHP = new HorizontalPanel();
- bottomBorderDecorator = new RoundedBorderDecorator(contentBottomBarHP, RoundedBorderDecorator.BOTTOMLEFT);
-
- // Layout
- // generalVP.add(groupLogoPanel);
- generalVP.add(generalHP);
- generalHP.add(cntcxtVP);
- generalHP.add(groupNavBarVP);
- groupNavBarVP.add(groupToolsBar);
- groupNavBarVP.add(groupDropDownsSP);
- groupNavBarVP.add(bottomIconsTrayPanel);
- groupDropDownsSP.add(groupDropDownsVP);
- cntcxtVP.add(contentTitleBarBorderDec);
- cntcxtVP.add(contentSubTitleBarHP);
- cntcxtVP.add(cntcxtHSP);
- cntcxtHSP.setLeftWidget(contentVP);
- cntcxtHSP.setRightWidget(contextVP);
- cntcxtVP.add(bottomBorderDecorator);
- contentVP.add(contentToolBarHP);
- contentVP.add(contentSP);
- contentVP.add(contentBottomToolBarHP);
-
- contentVP.addStyleName("kune-WorkspacePanel-Content");
- contextVP.addStyleName("kune-WorkspacePanel-Context");
- contentVP.setWidth("100%");
- contextVP.setWidth("100%");
- contextVP.setHeight("100%");
-
- // Set properties
- addStyleName("kune-WorkspacePanel");
- setGroupLogo("");
- generalHP.addStyleName("GeneralHP");
- // contentTitleBarBorderDec.setColor(colorTheme.getContentMainBorder());
- contentTitleBarHP.setWidth("100%");
- contentSubTitleBarHP.setWidth("100%");
- contentTitleBarHP.addStyleName("kune-ContentTitleBar");
- contentSubTitleBarHP.addStyleName("kune-ContentSubTitleBar");
- contentToolBarHP.setWidth("100%");
- cntcxtVP.addStyleName("ContextPanel");
- cntcxtVP.setCellVerticalAlignment(contentTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
- cntcxtVP.setCellVerticalAlignment(contentSubTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
- cntcxtVP.setCellVerticalAlignment(bottomBorderDecorator, VerticalPanel.ALIGN_MIDDLE);
- contentTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- contentSubTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- contentBottomToolBarHP.setWidth("100%");
- contentBottomBarHP.addStyleName("kune-ContentBottomBar");
- contentBottomBarHP.addStyleName("kune-ft12px");
- groupDropDownsVP.addStyleName("kune-GroupSummaryPanel");
- // bottomBorderDecorator.setColor(colorTheme.getContentMainBorder());
- bottomIconsTrayPanel.addStyleName("kune-Margin-Medium-l");
- bottomIconsTrayPanel.addStyleName("kune-BottomIconsTrayPanel");
- bottomIconsTrayPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
- bottomIconsTrayPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- previousRightWidgetWidth = DEF_CONTEXT_WIDTH;
- }
-
- public void addBottomIconComponent(final View view) {
- bottomIconsTrayPanel.add((Widget) view);
- }
-
- public void addTab(final ToolTrigger trigger) {
- // groupToolsBar.addItem(trigger);
- }
-
- public void adjustSize(final int windowWidth, final int windowHeight) {
- final int contentWidth = windowWidth - 184;
- final int contentHeight = windowHeight - 176;
-
- // FireLog.debug("w1: " + windowWidth + ", h1: " + windowHeight);
- // FireLog.debug("w2: " + contentWidth + ", h2: " + contentHeight);
- // FireLog.debug("sp1: " + previousRightWidgetWidth);
- cntcxtHSP.setSize("" + contentWidth + "px", "" + contentHeight + "px");
- if (contentWidth > previousRightWidgetWidth) {
- cntcxtHSP.setSplitPosition("" + (contentWidth - previousRightWidgetWidth - 6) + "px");
- saveCurrentRightWidgetWidth(previousRightWidgetWidth);
- } else {
- setDefaultSplitterPosition();
- }
- adjustSizeContentSP();
-
- final int bottomMarginForTray = 35;
- final int distanceFromTop = 89;
- final int groupDropDownsHeight = windowHeight - groupToolsBar.getOffsetHeight() - distanceFromTop
- - bottomMarginForTray;
- groupDropDownsSP.setHeight("" + groupDropDownsHeight + "px");
- }
-
- public void registerUIExtensionPoints() {
- presenter.registerExtensibleWidgets(contentToolBarPanel.getExtensionPoints());
- presenter.registerExtensibleWidget(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, bottomIconsTrayPanel);
- }
-
- public void setBottom(final View view) {
- bottomPanel = (LicensePanel) view;
- contentBottomBarHP.add(bottomPanel);
- contentBottomBarHP.setCellVerticalAlignment(bottomPanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setComponents(final WorkspaceUIComponents components) {
- setContentTitle(components.getContentTitleComponent().getView());
- setContentSubTitle(components.getContentSubTitleComponent().getView());
- setContentToolBar(components.getContentToolBarComponent().getView());
- // setContentBottomToolBar(components.getContentBottomToolBarComponent().getView());
- setBottom(components.getLicenseComponent().getView());
- // addBottomIconComponent(components.getThemeMenuComponent().getView());
- }
-
- public void setContent(final View content) {
- contentSP.clear();
- final Widget widget = (Widget) content;
- contentSP.add(widget);
- }
-
- public void setContentBottomToolBar(final View view) {
- contentBottomToolBarPanel = (ContentBottomToolBarPanel) view;
- contentBottomToolBarHP.add(contentBottomToolBarPanel);
- contentBottomToolBarHP.setCellVerticalAlignment(contentBottomToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContentSubTitle(final View view) {
- contentSubTitlePanel = (ContentSubTitlePanel) view;
- contentSubTitleBarHP.add(contentSubTitlePanel);
- contentSubTitleBarHP.setCellVerticalAlignment(contentSubTitlePanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContentTitle(final View view) {
- contentTitlePanel = (ContentTitlePanel) view;
- contentTitleBarHP.add(contentTitlePanel);
- contentTitleBarHP.setCellVerticalAlignment(contentTitlePanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContentToolBar(final View view) {
- contentToolBarPanel = (ContentToolBarPanel) view;
- contentToolBarHP.add(contentToolBarPanel);
- contentToolBarHP.setCellVerticalAlignment(contentToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContext(final View contextMenu) {
- contextVP.clear();
- final Widget widget = (Widget) contextMenu;
- contextVP.add(widget);
- widget.setHeight("100%");
- widget.setWidth("100%");
- contextVP.setCellWidth(widget, "100%");
- contextVP.setCellHeight(widget, "100%");
- }
-
- public void setGroupLogo(final Image image) {
- // groupLogoPanel.setLogo(image);
- }
-
- public void setGroupLogo(final String groupName) {
- // groupLogoPanel.setLogo(groupName);
- }
-
- public void setGroupMembers(final View view) {
- // groupMembersPanel = (DropDownPanel) view;
- // AddDropDown(groupMembersPanel, colorTheme.getGroupMembersDD());
- }
-
- public void setParticipation(final View view) {
- // participationPanel = (DropDownPanel) view;
- // AddDropDown(participationPanel, colorTheme.getParticipationDD());
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- // groupLogoPanel.setPutYourLogoVisible(visible);
- }
-
- public void setSummary(final View view) {
- // groupSummaryPanel = (DropDownPanel) view;
- // AddDropDown(groupSummaryPanel, colorTheme.getSummaryDD());
- }
-
- public void setTags(final View view) {
- // tagsPanel = (DropDownPanel) view;
- // AddDropDown(tagsPanel, colorTheme.getTagsDD());
- }
-
- 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());
- }
-
- public void setTool(final String toolName) {
- groupToolsBar.selectItem(toolName);
- }
-
- public void setVisible(final boolean visible) {
- // false: Used when the app stops
- super.setVisible(visible);
- }
-
- private void adjustSizeContentSP() {
- final int width = cntcxtHSP.getLeftWidgetAvailableWidth() - 2;
- final int height = cntcxtHSP.getOffsetHeight() - 29 - contentToolBarHP.getOffsetHeight();
- if (width > 0 && height > 0) {
- contentSP.setSize("" + width + "px", "" + height + "px");
- } else {
- Log.debug("Can't resize ScrollPanel now");
- }
- }
-
- private void saveCurrentRightWidgetWidth(final int newRightWidgetWidth) {
- previousRightWidgetWidth = newRightWidgetWidth;
- }
-
- private void setDefaultSplitterPosition() {
- final int newLefttWidgetWidth = (int) (cntcxtHSP.getOffsetWidth() * 0.7);
- cntcxtHSP.setSplitPosition(newLefttWidgetWidth + "px");
- saveCurrentRightWidgetWidth(cntcxtHSP.getLeftWidgetAvailableWidth());
- }
-
- // private void logSplitter(final String count) {
- // FireLog.debug("" + count + " cntcxtHSP.getRightWidgetAvailableWidth: "
- // + cntcxtHSP.getRightWidgetAvailableWidth());
- // FireLog
- // .debug("" + count + " cntcxtHSP.getLeftWidgetAvailableWidth: "
- // + cntcxtHSP.getLeftWidgetAvailableWidth());
- // }
-
-}
1
0
Author: vjrj
Date: 2008-08-04 14:44:04 +0200 (Mon, 04 Aug 2008)
New Revision: 825
Added:
trunk/src/main/java/org/ourproject/kune/platf/public/images/language.gif
Log:
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/language.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/language.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
Author: vjrj
Date: 2008-08-03 23:45:16 +0200 (Sun, 03 Aug 2008)
New Revision: 824
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java
trunk/src/test/java/org/ourproject/kune/platf/client/tool/
trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/ToolState.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
Modified:
trunk/script/generateBasicUIElements.sh
trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
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/chat/client/ChatClientNewModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.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/StateManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceSaveTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java
Log:
Complete - task 36: New ToolSelector classes
Complete - task 24: Tests problems in SNMTest (close of transaction issue)
Incomplete - task 21: Session timeout problems (cookies issue?)
Modified: trunk/script/generateBasicUIElements.sh
===================================================================
--- trunk/script/generateBasicUIElements.sh 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/script/generateBasicUIElements.sh 2008-08-03 21:45:16 UTC (rev 824)
@@ -14,7 +14,7 @@
fi
# DO
-PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g'`
+PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g' | sed 's/.$//g'`
if [[ ! -d $DIR ]]
then
@@ -85,12 +85,12 @@
import $PACKAGE.${NAME}Panel;
import $PACKAGE.${NAME};
-builder.registerProvider(${NAME}.class, new Provider<${NAME}>() {
- public ${NAME} get() {
+register(SingletonScope.class, new Factory<${NAME}>(${NAME}.class) {
+ public ${NAME} create() {
final ${NAME}Presenter presenter = new ${NAME}Presenter();
final ${NAME}Panel panel = new ${NAME}Panel(presenter, ws);
presenter.init(panel);
return presenter;
}
-}, SingletonScope.class);
+});
EOF
Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-03 21:45:16 UTC (rev 824)
@@ -19,111 +19,6 @@
<link rel="shortcut icon" href="images/favicon.ico" />
<title>Kune</title>
-<script type="text/javascript" language="javascript">
-var defaultKuneTheme = {
- themeName: "Default",
- toolSelected: "#DD8A3D",
- toolUnselected: "#FFE9A5",
- contentMainBorder: "#DD8A3D",
- contentTitle: "#F1BB59",
- contentTitleText: "#69312F",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#FFD09D",
- splitter: "#DEAA87",
- groupMembersDD: "#DF5244",
- participationDD: "#CA5842",
- summaryDD: "#9F734B",
- tagsDD: "#87501E"
-};
-
-var greenKuneTheme = {
- themeName: "Green",
- toolSelected: "#5FD35F",
- toolUnselected: "#D6F4D6",
- contentMainBorder: "#5FD35F",
- contentTitle: "#AFA",
- contentTitleText: "#250",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#CFA",
- splitter: "#DCE8AB",
- groupMembersDD: "#008000",
- participationDD: "#00AA00",
- summaryDD: "#4CE14C",
- tagsDD: "#00D400"
-};
-
-var blueKuneTheme = {
- themeName: "Blue",
- toolSelected: "#0066FF",
- toolUnselected: "#D7D7F4",
- contentMainBorder: "#0066FF",
- contentTitle: "#AFDDE9",
- contentTitleText: "#000080",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#AACCFF",
- splitter: "#D5D5FF",
- groupMembersDD: "#5500D4",
- participationDD: "#6600FF",
- summaryDD: "#69A5FF",
- tagsDD: "#9955FF"
-};
-
-var greyKuneTheme = {
- themeName: "Grey",
- toolSelected: "#4D4D4D",
- toolUnselected: "#E6E6E6",
- contentMainBorder: "#4D4D4D",
- contentTitle: "#CCCCCC",
- contentTitleText: "#1A1A1A",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#B3B3B3",
- splitter: "#999999",
- groupMembersDD: "#4D4D4D",
- participationDD: "#666666",
- summaryDD: "#A6A6A6",
- tagsDD: "#808080"
-};
-
-var purpleKuneTheme = {
- themeName: "Purple",
- toolSelected: "#660080",
- toolUnselected: "#EED7F4",
- contentMainBorder: "#660080",
- contentTitle: "#DDAFE9",
- contentTitleText: "#440055",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#DDAFE9",
- splitter: "#A793AC",
- groupMembersDD: "#672178",
- participationDD: "#892CA0",
- summaryDD: "#C473D8",
- tagsDD: "#AB37C8"
-};
-
-var redKuneTheme = {
- themeName: "Red",
- toolSelected: "#D40000",
- toolUnselected: "#FFD5D5",
- contentMainBorder: "#D40000",
- contentTitle: "#FF8080",
- contentTitleText: "#800000",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#FFAAAA",
- splitter: "#FF5555",
- groupMembersDD: "#A02C2C",
- participationDD: "#C83737",
- summaryDD: "#E08F8F",
- tagsDD: "#D35F5F"
-};
-
-</script>
-
</head>
<body>
<script type="text/javascript" language="javascript"
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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-08-03 21:45:16 UTC (rev 824)
@@ -3172,27 +3172,27 @@
color: #FFF;
}
-.k-entity-bottom-rd-default, .k-entity-bottom-default {
+.k-entity-bottom-rd-default, .k-entity-bottom-default, .k-toolselectoritem-sel-default {
background: #DD8A3D;
}
-.k-entity-bottom-rd-green, .k-entity-bottom-green {
+.k-entity-bottom-rd-green, .k-entity-bottom-green, .k-toolselectoritem-sel-green {
background: #5FD35F;
}
-.k-entity-bottom-rd-blue, .k-entity-bottom-blue {
+.k-entity-bottom-rd-blue, .k-entity-bottom-blue, .k-toolselectoritem-sel-blue {
background: #0066FF;
}
-.k-entity-bottom-rd-grey, .k-entity-bottom-grey {
+.k-entity-bottom-rd-grey, .k-entity-bottom-grey, .k-toolselectoritem-sel-grey {
background: #4D4D4D;
}
-.k-entity-bottom-rd-purple, .k-entity-bottom-purple {
+.k-entity-bottom-rd-purple, .k-entity-bottom-purple, .k-toolselectoritem-sel-purple {
background: #660080;
}
-.k-entity-bottom-rd-red, .k-entity-bottom-red {
+.k-entity-bottom-rd-red, .k-entity-bottom-red, .k-toolselectoritem-sel-red {
background: #D40000;
}
@@ -3435,3 +3435,62 @@
background: red;
}
+/* Tool selector items */
+
+.k-toolselectoritem {
+ width: auto;
+ margin-bottom: 5px;
+ cursor: pointer;
+}
+
+.k-toolselectoritem-sel {
+}
+
+.k-toolselectoritem-notsel-default {
+ background: #FFE9A5;
+}
+
+.k-toolselectoritem-notsel-green {
+ background: #D6F4D6;
+}
+
+.k-toolselectoritem-notsel-blue {
+ background: #D7D7F4;
+}
+
+.k-toolselectoritem-notsel-grey {
+ background: #E6E6E6;
+}
+
+.k-toolselectoritem-notsel-purple {
+ background: #EED7F4;
+}
+
+.k-toolselectoritem-notsel-red {
+ background: #FFD5D5;
+}
+
+.k-toolselectoritem-sel a {
+ color: #FFF;
+ padding: 0 9px;
+ text-decoration: none;
+}
+
+.k-toolselectoritem-sel a:hover {
+ text-decoration: none;
+}
+
+.k-toolselectoritem-notsel {
+}
+
+.k-toolselectoritem-notsel a {
+ color: blue;
+ padding: 0 9px;
+ text-decoration: none;
+}
+
+.k-toolselectoritem-notsel a:hover {
+ text-decoration: none;
+}
+
+
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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-08-03 21:45:16 UTC (rev 824)
@@ -306,27 +306,27 @@
color: #FFF;
}
-.k-entity-bottom-rd-default, .k-entity-bottom-default {
+.k-entity-bottom-rd-default, .k-entity-bottom-default, .k-toolselectoritem-sel-default {
background: #DD8A3D;
}
-.k-entity-bottom-rd-green, .k-entity-bottom-green {
+.k-entity-bottom-rd-green, .k-entity-bottom-green, .k-toolselectoritem-sel-green {
background: #5FD35F;
}
-.k-entity-bottom-rd-blue, .k-entity-bottom-blue {
+.k-entity-bottom-rd-blue, .k-entity-bottom-blue, .k-toolselectoritem-sel-blue {
background: #0066FF;
}
-.k-entity-bottom-rd-grey, .k-entity-bottom-grey {
+.k-entity-bottom-rd-grey, .k-entity-bottom-grey, .k-toolselectoritem-sel-grey {
background: #4D4D4D;
}
-.k-entity-bottom-rd-purple, .k-entity-bottom-purple {
+.k-entity-bottom-rd-purple, .k-entity-bottom-purple, .k-toolselectoritem-sel-purple {
background: #660080;
}
-.k-entity-bottom-rd-red, .k-entity-bottom-red {
+.k-entity-bottom-rd-red, .k-entity-bottom-red, .k-toolselectoritem-sel-red {
background: #D40000;
}
@@ -567,4 +567,62 @@
.k-wstheme-icon-red {
background: red;
-}
\ No newline at end of file
+}
+
+/* Tool selector items */
+
+.k-toolselectoritem {
+ width: auto;
+ margin-bottom: 5px;
+ cursor: pointer;
+}
+
+.k-toolselectoritem-sel {
+}
+
+.k-toolselectoritem-notsel-default {
+ background: #FFE9A5;
+}
+
+.k-toolselectoritem-notsel-green {
+ background: #D6F4D6;
+}
+
+.k-toolselectoritem-notsel-blue {
+ background: #D7D7F4;
+}
+
+.k-toolselectoritem-notsel-grey {
+ background: #E6E6E6;
+}
+
+.k-toolselectoritem-notsel-purple {
+ background: #EED7F4;
+}
+
+.k-toolselectoritem-notsel-red {
+ background: #FFD5D5;
+}
+
+.k-toolselectoritem-sel a {
+ color: #FFF;
+ padding: 0 9px;
+ text-decoration: none;
+}
+
+.k-toolselectoritem-sel a:hover {
+ text-decoration: none;
+}
+
+.k-toolselectoritem-notsel {
+}
+
+.k-toolselectoritem-notsel a {
+ color: blue;
+ padding: 0 9px;
+ text-decoration: none;
+}
+
+.k-toolselectoritem-notsel a:hover {
+ text-decoration: none;
+}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -5,8 +5,10 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
@@ -26,7 +28,8 @@
public ChatClientTool create() {
return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
$(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $p(GroupMembersSummary.class),
- $p(StateManager.class), $p(ContentServiceAsync.class));
+ $p(StateManager.class), $p(ContentServiceAsync.class), $(ToolSelector.class),
+ $(WsThemePresenter.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -30,15 +30,18 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public class ChatClientTool extends AbstractClientTool implements ChatProvider {
public static final String NAME = "chats";
@@ -47,17 +50,14 @@
public static final String TYPE_CHAT = "chat.chat";
private final ChatToolComponents components;
private ChatEngine chat;
- private final Provider<StateManager> stateManagerProvider;
- private final Provider<ContentServiceAsync> contentServiceProvider;
public ChatClientTool(final Session session, final Application application, final I18nTranslationService i18n,
final EmiteUIDialog emiteUIDialog, final WorkspaceSkeleton ws,
final Provider<GroupMembersSummary> groupMembersSummaryProvider,
final Provider<StateManager> stateManagerProvider,
- final Provider<ContentServiceAsync> contentServiceProvider) {
- super(i18n.t("chat rooms"));
- this.stateManagerProvider = stateManagerProvider;
- this.contentServiceProvider = contentServiceProvider;
+ final Provider<ContentServiceAsync> contentServiceProvider, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter) {
+ super(NAME, i18n.t("chat rooms"), toolSelector, wsThemePresenter, ws);
components = new ChatToolComponents(emiteUIDialog, i18n, stateManagerProvider, session, contentServiceProvider);
session.onInitDataReceived(new Slot<InitDataDTO>() {
public void onEvent(final InitDataDTO initData) {
@@ -75,13 +75,13 @@
}), true);
}
});
- application.onApplicationStop(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ application.onApplicationStop(new Slot0() {
+ public void onEvent() {
chat.logout();
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
chat.logout();
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -5,9 +5,11 @@
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.TagsSummary;
import com.calclab.suco.client.modules.AbstractModule;
@@ -32,7 +34,8 @@
register(SingletonScope.class, new Factory<DocumentClientTool>(DocumentClientTool.class) {
public DocumentClientTool create() {
final DocumentFactory factory = $(DocumentFactory.class);
- return new DocumentClientTool(factory, $(I18nUITranslationService.class));
+ return new DocumentClientTool(factory, $(I18nUITranslationService.class), $(ToolSelector.class),
+ $(WsThemePresenter.class), $(WorkspaceSkeleton.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -26,8 +26,11 @@
import org.ourproject.kune.docs.client.ui.DocumentFactory;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
public class DocumentClientTool extends AbstractClientTool implements DocumentContentListener {
public static final String TYPE_ROOT = "docs.root";
@@ -36,42 +39,43 @@
public static final String NAME = "docs";
private final DocToolComponents components;
- public DocumentClientTool(final DocumentFactory documentFactory, final I18nUITranslationService i18n) {
- super(i18n.t("documents"));
- components = new DocToolComponents(documentFactory, this);
+ public DocumentClientTool(final DocumentFactory documentFactory, final I18nUITranslationService i18n,
+ final ToolSelector toolSelector, final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws) {
+ super(NAME, i18n.t("documents"), toolSelector, wsThemePresenter, ws);
+ components = new DocToolComponents(documentFactory, this);
}
public WorkspaceComponent getContent() {
- return components.getContent();
+ return components.getContent();
}
public WorkspaceComponent getContext() {
- return components.getContext();
+ return components.getContext();
}
public String getName() {
- return NAME;
+ return NAME;
}
public void onCancel() {
- components.getContext().showFolders();
+ components.getContext().showFolders();
}
public void onEdit() {
- components.getContext().showAdmin();
+ components.getContext().showAdmin();
}
public void setContent(final StateDTO state) {
- DocumentContent docContent = components.getContent();
- docContent.setContent(state);
+ final DocumentContent docContent = components.getContent();
+ docContent.setContent(state);
- // TODO: check trigger interface (setState)
- trigger.setState(state.getStateToken().toString());
+ // TODO: check trigger interface (setState)
+ // trigger.setState(state.getStateToken().toString());
}
public void setContext(final StateDTO state) {
- DocumentContext context = components.getContext();
- context.setContext(state);
+ final DocumentContext context = components.getContext();
+ context.setContext(state);
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ToolState.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ToolState.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ToolState.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -1,25 +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.platf.client;
-
-public class ToolState {
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -28,7 +28,7 @@
import org.ourproject.kune.platf.client.tool.ClientTool;
import org.ourproject.kune.workspace.client.workspace.Workspace;
-import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public interface Application {
@@ -38,12 +38,10 @@
void init(StateManager stateManager, HashMap<String, ClientTool> tools);
- void onApplicationStart(Slot<Object> slot);
+ void onApplicationStart(Slot0 slot);
- void onApplicationStop(Slot<Object> slot);
+ void onApplicationStop(Slot0 slot);
- void setGroupState(String groupShortName);
-
void start();
void stop();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -41,8 +41,8 @@
import org.ourproject.kune.workspace.client.workspace.Workspace;
import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.signal.Signal;
-import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Signal0;
+import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.WindowCloseListener;
@@ -52,8 +52,8 @@
// private final Workspace workspace;
private Map<String, ClientTool> tools;
private final Session session;
- private final Signal<Object> onApplicationStart;
- private final Signal<Object> onApplicationStop;
+ private final Signal0 onApplicationStart;
+ private final Signal0 onApplicationStop;
private StateManager stateManager;
public ApplicationDefault(final Session session, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) {
@@ -61,8 +61,8 @@
// workspace = WorkspaceFactory.createWorkspace(session,
// extensionPointManager, i18n, errorHandler);
tools = new HashMap<String, ClientTool>();
- this.onApplicationStart = new Signal<Object>("onApplicationStart");
- this.onApplicationStop = new Signal<Object>("onApplicationStop");
+ this.onApplicationStart = new Signal0("onApplicationStart");
+ this.onApplicationStop = new Signal0("onApplicationStop");
Window.addWindowCloseListener(new WindowCloseListener() {
public void onWindowClosed() {
stop();
@@ -88,24 +88,16 @@
this.tools = tools;
}
- public void onApplicationStart(final Slot<Object> slot) {
+ public void onApplicationStart(final Slot0 slot) {
onApplicationStart.add(slot);
}
- public void onApplicationStop(final Slot<Object> slot) {
+ public void onApplicationStop(final Slot0 slot) {
onApplicationStop.add(slot);
}
- public void setGroupState(final String groupShortName) {
- final Iterator<ClientTool> iterator = tools.values().iterator();
- while (iterator.hasNext()) {
- final ClientTool tool = iterator.next();
- tool.setGroupState(groupShortName);
- }
- }
-
public void start() {
- onApplicationStart.fire(null);
+ onApplicationStart.fire();
PrefetchUtilities.preFetchImpImages();
getInitData();
final Timer prefetchTimer = new Timer() {
@@ -117,7 +109,7 @@
}
public void stop() {
- onApplicationStop.fire(null);
+ onApplicationStop.fire();
}
public void subscribeActions(final ArrayList<ActionEvent<?>> actions) {
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperDefault.java (from rev 792, trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperDefault.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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.platf.client.app;
+
+import com.google.gwt.user.client.History;
+
+public class HistoryWrapperDefault implements HistoryWrapper {
+
+ public String getToken() {
+ return History.getToken();
+ }
+
+ public void newItem(final String historyToken) {
+ History.newItem(historyToken);
+ }
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -1,37 +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.platf.client.app;
-
-import com.google.gwt.user.client.History;
-
-public class HistoryWrapperImpl implements HistoryWrapper {
-
- public HistoryWrapperImpl() {
- }
-
- public void newItem(final String historyToken) {
- History.newItem(historyToken);
- }
-
- public String getToken() {
- return History.getToken();
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -27,158 +27,163 @@
public class StateToken implements IsSerializable {
private static final String[] EMPTY = new String[0];
private static final String DOT = ".";
+
+ public static String encode(final String group, final String tool, final String folder, final String document) {
+ String encoded = "";
+ if (group != null) {
+ encoded += group;
+ }
+ if (tool != null) {
+ encoded += DOT + tool;
+ }
+ if (folder != null) {
+ encoded += DOT + folder;
+ }
+ if (document != null) {
+ encoded += DOT + document;
+ }
+ return encoded;
+ }
private String group;
private String tool;
private String folder;
private String document;
+
private String encoded;
- public StateToken(final String group, final String tool, final String folder, final String document) {
- this.setGroup(group);
- this.setTool(tool);
- this.setFolder(folder);
- this.setDocument(document);
- encoded = null;
+ public StateToken() {
+ this(null, null, null, null);
}
- public StateToken() {
- this(null, null, null, null);
+ public StateToken(final String encoded) {
+ String[] splitted;
+ if (encoded != null && encoded.length() > 0) {
+ splitted = encoded.split("\\.");
+ } else {
+ splitted = EMPTY;
+ }
+ setGroup(conditionalAssign(0, splitted));
+ setTool(conditionalAssign(1, splitted));
+ setFolder(conditionalAssign(2, splitted));
+ setDocument(conditionalAssign(3, splitted));
}
- public String toString() {
- return getEncoded();
+ public StateToken(final String group, final String tool) {
+ this(group, tool, null, null);
}
- public String getEncoded() {
- if (encoded == null) {
- encoded = StateToken.encode(getGroup(), getTool(), getFolder(), getDocument());
- }
- return encoded;
+ public StateToken(final String group, final String tool, final String folder, final String document) {
+ this.setGroup(group);
+ this.setTool(tool);
+ this.setFolder(folder);
+ this.setDocument(document);
+ encoded = null;
}
- @Override
- public int hashCode() {
- return getEncoded().hashCode();
+ public String getDocument() {
+ return document;
}
- public StateToken(final String encoded) {
- String[] splitted;
- if (encoded != null && encoded.length() > 0) {
- splitted = encoded.split("\\.");
- } else {
- splitted = EMPTY;
- }
- setGroup(conditionalAssign(0, splitted));
- setTool(conditionalAssign(1, splitted));
- setFolder(conditionalAssign(2, splitted));
- setDocument(conditionalAssign(3, splitted));
+ public String getEncoded() {
+ if (encoded == null) {
+ encoded = StateToken.encode(getGroup(), getTool(), getFolder(), getDocument());
+ }
+ return encoded;
}
- private String conditionalAssign(final int index, final String[] splitted) {
- if (splitted.length > index) {
- return splitted[index];
- } else {
- return null;
- }
+ public String getFolder() {
+ return folder;
}
- public static String encode(final String group, final String tool, final String folder, final String document) {
- String encoded = "";
- if (group != null) {
- encoded += group;
- }
- if (tool != null) {
- encoded += DOT + tool;
- }
- if (folder != null) {
- encoded += DOT + folder;
- }
- if (document != null) {
- encoded += DOT + document;
- }
- return encoded;
+ public String getGroup() {
+ return group;
}
- public boolean isComplete() {
- return getDocument() != null;
+ public String getPublicUrl() {
+ String publicUrl = "http://";
+
+ if (group != null) {
+ publicUrl += group + DOT;
+ }
+
+ // FIXME: Maybe get from InitData the site.domain
+ publicUrl += WindowUtils.getLocation().getHostName() + "/";
+
+ if (tool != null) {
+ publicUrl += tool;
+ }
+ if (folder != null) {
+ publicUrl += DOT + folder;
+ }
+ if (document != null) {
+ publicUrl += DOT + document;
+ }
+
+ return publicUrl;
}
+ public String getTool() {
+ return tool;
+ }
+
public boolean hasAll() {
- return getGroup() != null && getTool() != null && getFolder() != null && getDocument() != null;
+ return getGroup() != null && getTool() != null && getFolder() != null && getDocument() != null;
}
- public boolean hasGroupToolAndFolder() {
- return getGroup() != null && getTool() != null && getFolder() != null;
+ public boolean hasGroup() {
+ return getGroup() != null;
}
public boolean hasGroupAndTool() {
- return getGroup() != null && getTool() != null;
+ return getGroup() != null && getTool() != null;
}
- public boolean hasGroup() {
- return getGroup() != null;
+ public boolean hasGroupToolAndFolder() {
+ return getGroup() != null && getTool() != null && getFolder() != null;
}
- public boolean hasNothing() {
- return getGroup() == null && getTool() == null && getFolder() == null && getDocument() == null;
+ @Override
+ public int hashCode() {
+ return getEncoded().hashCode();
}
- public void setGroup(final String group) {
- this.group = group;
- encoded = null;
+ public boolean hasNothing() {
+ return getGroup() == null && getTool() == null && getFolder() == null && getDocument() == null;
}
- public String getGroup() {
- return group;
+ public boolean isComplete() {
+ return getDocument() != null;
}
- public void setTool(final String tool) {
- this.tool = tool;
- encoded = null;
+ public void setDocument(final String document) {
+ this.document = document;
+ encoded = null;
}
- public String getTool() {
- return tool;
- }
-
public void setFolder(final String folder) {
- this.folder = folder;
- encoded = null;
+ this.folder = folder;
+ encoded = null;
}
- public String getFolder() {
- return folder;
+ public void setGroup(final String group) {
+ this.group = group;
+ encoded = null;
}
- public void setDocument(final String document) {
- this.document = document;
- encoded = null;
+ public void setTool(final String tool) {
+ this.tool = tool;
+ encoded = null;
}
- public String getDocument() {
- return document;
+ public String toString() {
+ return getEncoded();
}
- public String getPublicUrl() {
- String publicUrl = "http://";
-
- if (group != null) {
- publicUrl += group + DOT;
- }
-
- // FIXME: Maybe get from InitData the site.domain
- publicUrl += WindowUtils.getLocation().getHostName() + "/";
-
- if (tool != null) {
- publicUrl += tool;
- }
- if (folder != null) {
- publicUrl += DOT + folder;
- }
- if (document != null) {
- publicUrl += DOT + document;
- }
-
- return publicUrl;
+ private String conditionalAssign(final int index, final String[] splitted) {
+ if (splitted.length > index) {
+ return splitted[index];
+ } else {
+ return null;
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -34,15 +34,15 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.container.Provider;
-import com.calclab.suco.client.signal.Signal;
-import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Signal0;
+import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.core.client.GWT;
public class KuneErrorHandler {
private final Session session;
private final I18nTranslationService i18n;
private final Provider<WorkspaceSkeleton> wsProvider;
- private final Signal<Object> onSessionExpired;
+ private final Signal0 onSessionExpired;
private final Provider<StateManager> stateManagerProvider;
public KuneErrorHandler(final Session session, final I18nTranslationService i18n,
@@ -51,14 +51,14 @@
this.i18n = i18n;
this.wsProvider = wsProvider;
this.stateManagerProvider = stateManagerProvider;
- this.onSessionExpired = new Signal<Object>("onSessionExpired");
+ this.onSessionExpired = new Signal0("onSessionExpired");
}
public WorkspaceSkeleton getWorkspaceSkeleton() {
return wsProvider.get();
}
- public void onSessionExpired(final Slot<Object> slot) {
+ public void onSessionExpired(final Slot0 slot) {
onSessionExpired.add(slot);
}
@@ -107,7 +107,7 @@
}
private void doSessionExpired() {
- onSessionExpired.fire(null);
+ onSessionExpired.fire();
getWorkspaceSkeleton().showAlertMessage(i18n.t("Session expired"),
i18n.t("Your session has expired. Please login again."));
}
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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -6,7 +6,7 @@
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ApplicationDefault;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
-import org.ourproject.kune.platf.client.app.HistoryWrapperImpl;
+import org.ourproject.kune.platf.client.app.HistoryWrapperDefault;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentService;
@@ -23,6 +23,9 @@
import org.ourproject.kune.platf.client.state.SessionImpl;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.platf.client.tool.ToolSelectorPanel;
+import org.ourproject.kune.platf.client.tool.ToolSelectorPresenter;
import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.platf.client.ui.rate.RateItPanel;
@@ -214,7 +217,7 @@
register(SingletonScope.class, new Factory<HistoryWrapper>(HistoryWrapper.class) {
public HistoryWrapper create() {
- return new HistoryWrapperImpl();
+ return new HistoryWrapperDefault();
}
}, new Factory<ContentProvider>(ContentProvider.class) {
public ContentProvider create() {
@@ -545,6 +548,16 @@
}
});
+ register(SingletonScope.class, new Factory<ToolSelector>(ToolSelector.class) {
+ public ToolSelector create() {
+ final ToolSelectorPresenter presenter = new ToolSelectorPresenter($(StateManager.class),
+ $(WsThemePresenter.class));
+ final ToolSelectorPanel panel = new ToolSelectorPanel(presenter, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
load(new EmiteUIModule(), new DocumentClientNewModule(), new ChatClientNewModule());
$(SitePublicSpaceLink.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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -31,6 +31,7 @@
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public interface Session {
@@ -73,7 +74,7 @@
void onUserSignIn(Slot<UserInfoDTO> slot);
- void onUserSignOut(Slot<Object> slot);
+ void onUserSignOut(Slot0 slot);
void setCurrentUserInfo(UserInfoDTO currentUserInfo);
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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -36,7 +36,9 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Signal0;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public class SessionImpl implements Session {
private String userHash;
@@ -49,7 +51,7 @@
private I18nLanguageDTO currentLanguage;
private final Signal<InitDataDTO> onInitDataReceived;
private final Signal<UserInfoDTO> onUserSignIn;
- private final Signal<Object> onUserSignOut;
+ private final Signal0 onUserSignOut;
private final Provider<UserServiceAsync> userServiceProvider;
public SessionImpl(final String userHash, final Provider<UserServiceAsync> userServiceProvider) {
@@ -58,7 +60,7 @@
languagesArray = null;
this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
this.onUserSignIn = new Signal<UserInfoDTO>("onUserSignIn");
- this.onUserSignOut = new Signal<Object>("onUserSignOut");
+ this.onUserSignOut = new Signal0("onUserSignOut");
}
public void check(final AsyncCallbackSimple<?> callback) {
@@ -127,7 +129,7 @@
onUserSignIn.add(slot);
}
- public void onUserSignOut(final Slot<Object> slot) {
+ public void onUserSignOut(final Slot0 slot) {
onUserSignOut.add(slot);
}
@@ -148,7 +150,7 @@
if (currentUserInfo != null) {
onUserSignIn.fire(currentUserInfo);
} else {
- onUserSignOut.fire(null);
+ onUserSignOut.fire();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -25,6 +25,7 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
import com.google.gwt.user.client.HistoryListener;
public interface StateManager extends HistoryListener {
@@ -35,10 +36,14 @@
void gotoToken(String token);
+ void onGroupChanged(Slot2<String, String> slot);
+
void onSocialNetworkChanged(Slot<StateDTO> slot);
void onStateChanged(Slot<StateDTO> slot);
+ void onToolChanged(Slot2<String, String> slot);
+
void reload();
void reloadContextAndTitles();
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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -34,7 +34,10 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Signal2;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
+import com.calclab.suco.client.signal.Slot2;
public class StateManagerDefault implements StateManager {
private final ContentProvider contentProvider;
@@ -44,6 +47,8 @@
private final HashMap<String, Slot<StateToken>> siteTokens;
private final Signal<StateDTO> onStateChanged;
private final Signal<StateDTO> onSocialNetworkChanged;
+ private final Signal2<String, String> onToolChanged;
+ private final Signal2<String, String> onGroupChanged;
public StateManagerDefault(final ContentProvider contentProvider, final Session session,
final HistoryWrapper history) {
@@ -52,14 +57,16 @@
this.history = history;
this.oldState = null;
this.onStateChanged = new Signal<StateDTO>("onStateChanged");
+ this.onGroupChanged = new Signal2<String, String>("onGroupChanged");
+ this.onToolChanged = new Signal2<String, String>("onToolChanged");
this.onSocialNetworkChanged = new Signal<StateDTO>("onSocialNetworkChanged");
session.onUserSignIn(new Slot<UserInfoDTO>() {
public void onEvent(final UserInfoDTO parameter) {
restorePreviousState();
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
reload();
}
});
@@ -81,6 +88,10 @@
setState(new StateToken(token));
}
+ public void onGroupChanged(final Slot2<String, String> slot) {
+ onGroupChanged.add(slot);
+ }
+
public void onHistoryChanged(final String historyToken) {
final Slot<StateToken> tokenSlot = siteTokens.get(historyToken);
Log.debug("history token: " + historyToken);
@@ -107,6 +118,10 @@
onStateChanged.add(slot);
}
+ public void onToolChanged(final Slot2<String, String> slot) {
+ onToolChanged.add(slot);
+ }
+
/**
* <p>
* Reload current state (using client cache if available)
@@ -157,6 +172,20 @@
history.newItem(state.getEncoded());
}
+ private void checkGroupAndToolChange(final StateDTO oldState, final StateDTO newState) {
+ final String oldGroupName = oldState != null ? oldState.getGroup().getShortName() : null;
+ final String newGroupName = newState.getGroup().getShortName();
+ final String oldToolName = oldState != null ? oldState.getToolName() : null;
+ final String newToolName = newState.getToolName();
+ if (oldState == null || !oldGroupName.equals(newGroupName)) {
+ onGroupChanged.fire(oldGroupName, newGroupName);
+ }
+ if (oldState == null || !oldToolName.equals(newToolName)) {
+ onToolChanged.fire(oldToolName, newToolName);
+ }
+
+ }
+
private void loadContent(final StateDTO state) {
session.setCurrent(state);
onStateChanged.fire(state);
@@ -196,9 +225,10 @@
private void onHistoryChanged(final StateToken newState) {
contentProvider.getContent(session.getUserHash(), newState, new AsyncCallbackSimple<StateDTO>() {
- public void onSuccess(final StateDTO newStateDTO) {
- loadContent(newStateDTO);
- oldState = newStateDTO;
+ public void onSuccess(final StateDTO newState) {
+ loadContent(newState);
+ checkGroupAndToolChange(oldState, newState);
+ oldState = newState;
}
});
}
@@ -207,6 +237,8 @@
if (oldState == null) {
onHistoryChanged(new StateToken());
} else {
+ final StateDTO currentState = session.getCurrentState();
+ checkGroupAndToolChange(oldState, currentState);
loadContent(oldState);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -18,23 +18,19 @@
*
*/
-package org.ourproject.kune.platf.client.tool;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public abstract class AbstractClientTool implements ClientTool {
- protected final ToolTriggerDefault trigger;
-
- public AbstractClientTool(final String label) {
- trigger = new ToolTriggerDefault(getName(), label);
- }
-
- public ToolTrigger getTrigger() {
- return trigger;
- }
-
- public void setGroupState(final String groupShortName) {
- trigger.setState(new StateToken(groupShortName, getName(), null, null));
- }
-
-}
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+public abstract class AbstractClientTool implements ClientTool {
+
+ public AbstractClientTool(final String shortName, final String longName, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws) {
+ final ToolSelectorItemPresenter presenter = new ToolSelectorItemPresenter(shortName, longName, toolSelector,
+ wsThemePresenter);
+ final ToolSelectorItemPanel panel = new ToolSelectorItemPanel(presenter, ws);
+ presenter.init(panel);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -24,18 +24,15 @@
import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
public interface ClientTool {
- String getName();
- ToolTrigger getTrigger();
+ WorkspaceComponent getContent();
WorkspaceComponent getContext();
- WorkspaceComponent getContent();
+ String getName();
void setContent(StateDTO state);
void setContext(StateDTO state);
- void setGroupState(String groupShortName);
-
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,8 @@
+package org.ourproject.kune.platf.client.tool;
+
+
+public interface ToolSelector {
+
+ public void addTool(ToolSelectorItem item);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,11 @@
+package org.ourproject.kune.platf.client.tool;
+
+public interface ToolSelectorItem {
+
+ String getShortName();
+
+ void setGroupShortName(String groupShortName);
+
+ void setSelected(boolean selected);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,50 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.platf.client.ui.RoundedPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.ui.Hyperlink;
+
+public class ToolSelectorItemPanel extends RoundedPanel implements ToolSelectorItemView {
+ private final Hyperlink hl;
+
+ public ToolSelectorItemPanel(final ToolSelectorItemPresenter presenter, final WorkspaceSkeleton ws) {
+ super(RoundedPanel.RIGHT, 2);
+ hl = new Hyperlink();
+ super.setWidget(hl);
+ ws.getEntitySummary().addInTools(this);
+ super.sinkEvents(Event.ONCLICK);
+ super.addStyleName("k-toolselectoritem");
+ }
+
+ @Override
+ public void onBrowserEvent(final Event event) {
+ super.onBrowserEvent(event);
+ }
+
+ public void setLink(final String text, final String targetHistoryToken) {
+ hl.setText(text);
+ hl.setTargetHistoryToken(targetHistoryToken);
+ }
+
+ public void setSelected(final boolean selected) {
+ if (selected) {
+ hl.setStylePrimaryName("k-toolselectoritem-sel");
+ } else {
+ hl.setStylePrimaryName("k-toolselectoritem-notsel");
+ }
+ super.setCornerStyleName(hl.getStyleName());
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ final String oldName = oldTheme.getName();
+ hl.removeStyleDependentName(oldName);
+ }
+ final String newName = newTheme.getName();
+ hl.addStyleDependentName(newName);
+ super.setCornerStyleName(hl.getStyleName());
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,57 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.suco.client.signal.Slot2;
+
+public class ToolSelectorItemPresenter implements ToolSelectorItem {
+
+ private ToolSelectorItemView view;
+ private final ToolSelector toolSelector;
+ private final WsThemePresenter wsThemePresenter;
+ private final String shortName;
+ private final String longName;
+
+ public ToolSelectorItemPresenter(final String shortName, final String longName, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter) {
+ this.shortName = shortName;
+ this.longName = longName;
+ this.toolSelector = toolSelector;
+ this.wsThemePresenter = wsThemePresenter;
+ }
+
+ public String getShortName() {
+ return shortName;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final ToolSelectorItemView view) {
+ this.view = view;
+ toolSelector.addTool(this);
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void setGroupShortName(final String groupShortName) {
+ final StateToken token = new StateToken(groupShortName, getShortName(), null, null);
+ view.setLink(longName, token.toString());
+ }
+
+ public void setSelected(final boolean selected) {
+ view.setSelected(selected);
+ }
+
+ private void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,13 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface ToolSelectorItemView extends View {
+
+ void setLink(String text, String targetHistoryToken);
+
+ void setSelected(boolean selected);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,94 @@
+package org.ourproject.kune.platf.client.tool;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.ourproject.kune.platf.client.tool.ToolTrigger.TriggerListener;
+import org.ourproject.kune.platf.client.ui.HasColor;
+import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class ToolSelectorPanel extends VerticalPanel implements ToolSelectorView {
+
+ private static final String ITEM_SELECTED = "kune-GroupToolsBar-itemSelected";
+ private static final String ITEM_NOT_SELECTED = "kune-GroupToolsBar-itemNotSelected";
+ private Widget currentTab;
+ private final HashMap<String, Widget> tabs;
+
+ public ToolSelectorPanel(final ToolSelectorPresenter presenter, final WorkspaceSkeleton ws) {
+ tabs = new HashMap<String, Widget>();
+ currentTab = null;
+ addStyleName("kune-GroupToolsBar");
+ ws.getEntitySummary().addInTools(this);
+ }
+
+ public void addItem(final ToolTrigger trigger) {
+ final int nextIndex = this.getWidgetCount();
+ final Widget menuItem = createItem(nextIndex, trigger);
+ setTabSelected(menuItem, false);
+ tabs.put(trigger.getName(), menuItem);
+ this.add(menuItem);
+ }
+
+ public void selectItem(final String toolName) {
+ if (currentTab != null) {
+ setTabSelected(currentTab, false);
+ }
+ currentTab = getWidget(toolName);
+ setTabSelected(currentTab, true);
+ }
+
+ public void setTabsColors(final String selectedColor, final String unSelectedColor) {
+ final Iterator<Widget> iter = tabs.values().iterator();
+ while (iter.hasNext()) {
+ final Widget w = iter.next();
+ if (w == currentTab) {
+ ((HasColor) w).setColor(selectedColor);
+ } else {
+ ((HasColor) w).setColor(unSelectedColor);
+ }
+ }
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ // TODO Auto-generated method stub
+
+ }
+
+ private Widget createItem(final int index, final ToolTrigger trigger) {
+ final SimplePanel menuItem = new SimplePanel();
+ addStyleName("Tab");
+ final Hyperlink hl = new Hyperlink(trigger.getLabel(), "");
+ trigger.setListener(new TriggerListener() {
+ public void onStateChanged(final String encoded) {
+ hl.setTargetHistoryToken(encoded);
+ }
+ });
+ menuItem.add(hl);
+ return new RoundedBorderDecorator(menuItem, RoundedBorderDecorator.RIGHT);
+ }
+
+ private Widget getWidget(final String toolName) {
+ return tabs.get(toolName);
+ }
+
+ private void setTabSelected(final Widget tab, final boolean isSelected) {
+ if (isSelected) {
+ tab.removeStyleName(ITEM_NOT_SELECTED);
+ tab.addStyleName(ITEM_SELECTED);
+ } else {
+ tab.removeStyleName(ITEM_SELECTED);
+ tab.addStyleName(ITEM_NOT_SELECTED);
+ }
+ // tring color = isSelected ? colorTheme.getToolSelected() :
+ // colorTheme.getToolUnselected();
+ // ((HasColor) tab).setColor(color);
+ }
+
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,69 @@
+package org.ourproject.kune.platf.client.tool;
+
+import java.util.HashMap;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.suco.client.signal.Slot2;
+
+public class ToolSelectorPresenter implements ToolSelector {
+
+ private ToolSelectorView view;
+ private final HashMap<String, ToolSelectorItem> tools;
+
+ public ToolSelectorPresenter(final StateManager stateManager, final WsThemePresenter wsThemePresenter) {
+ tools = new HashMap<String, ToolSelectorItem>();
+ stateManager.onGroupChanged(new Slot2<String, String>() {
+ public void onEvent(final String oldGroupName, final String newGroupName) {
+ onGroupChanged(newGroupName);
+ }
+ });
+ stateManager.onToolChanged(new Slot2<String, String>() {
+ public void onEvent(final String oldTool, final String newTool) {
+ onToolChanged(oldTool, newTool);
+ }
+ });
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void addTool(final ToolSelectorItem item) {
+ final String name = item.getShortName();
+ if (name == null) {
+ throw new RuntimeException("You cannot add a tool without a name");
+ }
+ if (tools.get(name) != null) {
+ throw new RuntimeException("A tool with the same name already added");
+ }
+ tools.put(name, item);
+ item.setSelected(false);
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final ToolSelectorView view) {
+ this.view = view;
+ }
+
+ void onGroupChanged(final String newGroupName) {
+ for (final String name : tools.keySet()) {
+ tools.get(name).setGroupShortName(newGroupName);
+ }
+ }
+
+ void onToolChanged(final String oldTool, final String newTool) {
+ if (oldTool != null) {
+ tools.get(oldTool).setSelected(false);
+ }
+ tools.get(newTool).setSelected(true);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface ToolSelectorView extends View {
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -15,7 +15,7 @@
public static final int DEF_TOOLBAR_HEIGHT = 26;
- private static final int NO_SIZE = -1;
+ private static final int NO_SIZE = -666;
private static RegionPosition[] regionPositions = new RegionPosition[] { RegionPosition.NORTH,
RegionPosition.CENTER, RegionPosition.SOUTH, RegionPosition.EAST, RegionPosition.WEST };
@@ -66,10 +66,11 @@
public void add(final Panel panel, final Widget widget) {
panel.add(widget);
if (panel.isRendered()) {
- panel.syncSize();
- panel.doLayout();
+ mainPanel.doLayout(false);
+ // panel.syncSize();
+ // panel.doLayout();
}
- doLayoutIfNeeded();
+ // doLayoutIfNeeded();
}
public void addStyle(final String style) {
@@ -110,6 +111,12 @@
}
}
+ public void doLayoutIfNeeded(final boolean includeChilds) {
+ if (mainPanel.isRendered()) {
+ mainPanel.doLayout(!includeChilds);
+ }
+ }
+
public Panel getPanel() {
return mainPanel;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -27,16 +27,28 @@
import org.apache.lucene.search.Query;
import org.hibernate.search.jpa.FullTextEntityManager;
import org.hibernate.search.jpa.FullTextQuery;
+import org.hibernate.search.jpa.Search;
import com.google.inject.Provider;
public abstract class DefaultManager<T, K> {
private final Provider<EntityManager> provider;
+ private final Provider<FullTextEntityManager> fullTextEntityManagerProvider;
private final Class<T> entityClass;
public DefaultManager(final Provider<EntityManager> provider, final Class<T> entityClass) {
this.provider = provider;
this.entityClass = entityClass;
+ fullTextEntityManagerProvider = new Provider<FullTextEntityManager>() {
+ private FullTextEntityManager searchManager;
+
+ public FullTextEntityManager get() {
+ if (searchManager == null) {
+ searchManager = Search.createFullTextEntityManager(getEntityManager());
+ }
+ return searchManager;
+ }
+ };
}
public T find(final Long primaryKey) {
@@ -63,9 +75,7 @@
@SuppressWarnings("unchecked")
public void reIndex() {
- // TODO: Inject this
- final FullTextEntityManager fullTextEm = org.hibernate.search.jpa.Search
- .createFullTextEntityManager(getEntityManager());
+ final FullTextEntityManager fullTextEm = fullTextEntityManagerProvider.get();
fullTextEm.purgeAll(entityClass);
fullTextEm.getTransaction().commit();
fullTextEm.getTransaction().begin();
@@ -83,10 +93,7 @@
@SuppressWarnings("unchecked")
public SearchResult<T> search(final Query query, final Integer firstResult, final Integer maxResults) {
- // TODO: Inject this?
- final FullTextEntityManager fullTextEm = org.hibernate.search.jpa.Search
- .createFullTextEntityManager(getEntityManager());
- final FullTextQuery emQuery = fullTextEm.createFullTextQuery(query, entityClass);
+ final FullTextQuery emQuery = fullTextEntityManagerProvider.get().createFullTextQuery(query, entityClass);
if (firstResult != null && maxResults != null) {
emQuery.setFirstResult(firstResult);
emQuery.setMaxResults(maxResults);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -141,16 +141,19 @@
}
} else {
// Not translated and not in db, make a petition for translation
- i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text, new AsyncCallback<String>() {
- public void onFailure(final Throwable caught) {
- }
+ if (session.isLogged()) {
+ i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text,
+ new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ }
- public void onSuccess(final String result) {
- }
- });
- Log.debug("Registering in db '" + text + "' as pending translation");
+ public void onSuccess(final String result) {
+ }
+ });
+ Log.debug("Registering in db '" + text + "' as pending translation");
+ lexicon.put(encodeText, UNTRANSLATED_VALUE);
+ }
translation = removeNT(encodeText);
- lexicon.put(encodeText, UNTRANSLATED_VALUE);
}
return decodeHtml(translation);
}
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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -31,8 +31,10 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -50,10 +52,15 @@
this.session = session;
this.stateManager = stateManager;
this.groupServiceProvider = groupServiceProvider;
+ stateManager.addSiteToken(SiteToken.newgroup.toString(), new Slot<StateToken>() {
+ public void onEvent(final StateToken previousStateToken) {
+ doNewGroup(previousStateToken);
+ }
+ });
}
- public void doNewGroup(final StateToken previousTokenOrig) {
- previousToken = previousTokenOrig;
+ public void doNewGroup(final StateToken previousToken) {
+ this.previousToken = previousToken;
session.check(new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
if (session.isLogged()) {
@@ -62,7 +69,7 @@
view.center();
Site.hideProgress();
} else {
- stateManager.setState(previousTokenOrig);
+ stateManager.setState(previousToken);
Site.info(i18n.t("Sign in or register to create a group"));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -49,11 +49,13 @@
this.stateManager = stateManager;
this.session = session;
this.snServiceProvider = snServiceProvider;
- stateManager.onStateChanged(new Slot<StateDTO>() {
- public void onEvent(final StateDTO state) {
+ final Slot<StateDTO> setStateSlot = new Slot<StateDTO>() {
+ public void onEvent(StateDTO state) {
setState(state);
}
- });
+ };
+ stateManager.onStateChanged(setStateSlot);
+ stateManager.onSocialNetworkChanged(setStateSlot);
wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
view.setTheme(oldTheme, newTheme);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -58,11 +58,13 @@
collabOnlyCategory = new GridGroup(i18n.t("collaborator in:"), " ", i18n.t("Collaborate in these groups"),
false);
super.addGroupOperation(gotoGroupMenuItem, false);
- stateManager.onStateChanged(new Slot<StateDTO>() {
- public void onEvent(final StateDTO state) {
+ final Slot<StateDTO> setStateSlot = new Slot<StateDTO>() {
+ public void onEvent(StateDTO state) {
setState(state);
}
- });
+ };
+ stateManager.onStateChanged(setStateSlot);
+ stateManager.onSocialNetworkChanged(setStateSlot);
wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
view.setTheme(oldTheme, newTheme);
Deleted: 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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -1,54 +0,0 @@
-package org.ourproject.kune.workspace.client.ui.newtmp;
-
-import org.ourproject.kune.platf.client.ui.rate.RateIt;
-import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLink;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.workspace.GroupSummary;
-import org.ourproject.kune.workspace.client.workspace.ParticipationSummary;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
-import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
-
-import com.calclab.suco.client.container.Provider;
-
-public class WorkspaceManager {
-
- private final EntityLogo entityLogo;
- private final EntityTitlePresenter entityTitlePresenter;
- private final WsThemePresenter wsThemePresenter;
- private final EntityLicensePresenter entityLicensePresenter;
- private final EntitySubTitlePresenter entitySubTitlePresenter;
- private final Provider<TagsSummary> tagsProvider;
- private final Provider<GroupMembersSummary> groupMembersSummaryProvider;
- private final Provider<ParticipationSummary> participationSummaryProvider;
- private final Provider<GroupSummary> groupSummaryProvider;
- private final SitePublicSpaceLink publicSpaceLink;
- private final Provider<RateIt> rateItProvider;
- private final Provider<RatePresenter> ratePresenterProvider;
-
- public WorkspaceManager(final SitePublicSpaceLink publicSpaceLink, final EntityLogo entityLogo,
- final EntityTitlePresenter entityTitlePresenter, final EntitySubTitlePresenter entitySubTitlePresenter,
- final WsThemePresenter wsThemePresenter, final EntityLicensePresenter entityLicensePresenter,
- final Provider<GroupMembersSummary> groupMembersSummaryProvider,
- final Provider<ParticipationSummary> participationSummaryProvider,
- final Provider<TagsSummary> tagsSummaryProvider, final Provider<GroupSummary> groupSummaryProvider,
- final Provider<RateIt> rateItProvider, final Provider<RatePresenter> rateProvider) {
- this.publicSpaceLink = publicSpaceLink;
- this.entityLogo = entityLogo;
- this.entityTitlePresenter = entityTitlePresenter;
- this.entitySubTitlePresenter = entitySubTitlePresenter;
- this.entityLicensePresenter = entityLicensePresenter;
- this.wsThemePresenter = wsThemePresenter;
- this.groupMembersSummaryProvider = groupMembersSummaryProvider;
- this.participationSummaryProvider = participationSummaryProvider;
- this.tagsProvider = tagsSummaryProvider;
- this.groupSummaryProvider = groupSummaryProvider;
- this.rateItProvider = rateItProvider;
- this.ratePresenterProvider = rateProvider;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -5,6 +5,7 @@
import org.ourproject.kune.platf.client.state.Session;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public class SiteSignInLinkPresenter implements SiteSignInLink {
@@ -16,8 +17,8 @@
view.setVisible(false);
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
view.setVisible(true);
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -13,6 +13,7 @@
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -32,13 +33,13 @@
view.setVisible(true);
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
view.setVisible(false);
}
});
- kuneErrorHandlerProvider.get().onSessionExpired(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ kuneErrorHandlerProvider.get().onSessionExpired(new Slot0() {
+ public void onEvent() {
clientUIsignOut();
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -5,6 +5,7 @@
import org.ourproject.kune.platf.client.state.Session;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public class SiteUserMenuPresenter implements SiteUserMenu {
@@ -18,8 +19,8 @@
view.setUseGroupsIsMember(userInfoDTO.getGroupsIsAdmin(), userInfoDTO.getGroupsIsCollab());
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
view.setVisible(false);
view.setLoggedUserName("");
}
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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -16,6 +16,7 @@
public EntitySummary() {
mainPanel = new DefaultBorderLayout();
entityTools = new Panel();
+ entityTools.setAutoHeight(true);
entitySummary = new Panel();
entitySummary.setCls("k-entity-summary");
entityTools.setBorder(false);
@@ -23,7 +24,7 @@
entityTools.setAutoScroll(false);
entitySummary.setAutoScroll(true);
trayBar = mainPanel.createBottomBar(entitySummary, "k-site-traybar");
- mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH, 30);
+ mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH);
mainPanel.add(entitySummary, DefaultBorderLayout.Position.CENTER);
trayBar.addFill();
}
@@ -35,7 +36,7 @@
public void addInTools(final Widget widget) {
entityTools.add(widget);
- mainPanel.doLayoutIfNeeded();
+ mainPanel.doLayoutIfNeeded(true);
}
public void addListener(final ContainerListener listener) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -58,7 +58,7 @@
ClientTool clientTool;
while (iterator.hasNext()) {
clientTool = iterator.next();
- view.addTab(clientTool.getTrigger());
+ // view.addTab(clientTool.getTrigger());
}
}
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-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -176,7 +176,7 @@
}
public void addTab(final ToolTrigger trigger) {
- groupToolsBar.addItem(trigger);
+ // groupToolsBar.addItem(trigger);
}
public void adjustSize(final int windowWidth, final int windowHeight) {
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -9,6 +9,7 @@
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
import com.google.gwt.user.client.rpc.AsyncCallback;
public class StateManagerTest {
@@ -21,6 +22,28 @@
@SuppressWarnings("unchecked")
@Test
+ public void changeStateWithDifferentGroupsMustFireSlot() {
+ final Slot2<String, String> groupSlot = Mockito.mock(Slot2.class);
+ stateManager.onGroupChanged(groupSlot);
+ stateManager.onHistoryChanged("group1.tool1");
+ stateManager.onHistoryChanged("group2.tool1");
+ // TODO, think how to test this
+ // Mockito.verify(groupSlot).onEvent("group1", "group2");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void changeStateWithDifferentToolsMustFireSlot() {
+ final Slot2<String, String> toolSlot = Mockito.mock(Slot2.class);
+ stateManager.onToolChanged(toolSlot);
+ stateManager.gotoToken("group1.tool1");
+ stateManager.gotoToken("group1.tool2");
+ // TODO, think how to test this
+ // Mockito.verify(toolSlot).onEvent("tool1", "tool2");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
public void getDefGroup() {
stateManager.onHistoryChanged("site.docs");
Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
Added: trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,92 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+public class ToolSelectorPresenterTest {
+
+ private static final String TOOL1_NAME = "tool1";
+ private static final String TOOL2_NAME = "tool2";
+ private static final String GROUP1_NAME = "group1";
+ private ToolSelectorPresenter toolSelector;
+ private ToolSelectorItem toolSelectorItem1;
+ private ToolSelectorItem toolSelectorItem2;
+
+ @Test
+ public void addFirstToolMustNotSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void addToolWithoutNameMustGiveException() {
+ toolSelector.addTool(toolSelectorItem1);
+ }
+
+ @Test
+ public void addTwoToolsMustSelectNothing() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ Mockito.verify(toolSelectorItem2).setSelected(false);
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void addTwoToolsWithSameNameMustGiveException() {
+ setToolNames();
+ final ToolSelectorItem toolSelectorItemCopy = Mockito.mock(ToolSelectorItem.class);
+ Mockito.stub(toolSelectorItemCopy.getShortName()).toReturn(TOOL1_NAME);
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItemCopy);
+ }
+
+ @Before
+ public void begin() {
+ final StateManager stateManager = Mockito.mock(StateManager.class);
+ final WsThemePresenter themePresenter = Mockito.mock(WsThemePresenter.class);
+ toolSelector = new ToolSelectorPresenter(stateManager, themePresenter);
+ toolSelectorItem1 = Mockito.mock(ToolSelectorItem.class);
+ toolSelectorItem2 = Mockito.mock(ToolSelectorItem.class);
+ }
+
+ @Test
+ public void setStateFirstMustSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.onToolChanged(null, TOOL1_NAME);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(true);
+ }
+
+ @Test
+ public void setStateWithADifferentGroupMustSetLink() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onGroupChanged(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ }
+
+ @Test
+ public void setStateWithADifferentToolNameMustSelectAndUnSelectTheOlder() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onToolChanged(TOOL1_NAME, TOOL2_NAME);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(true);
+ }
+
+ public void setToolNames() {
+ Mockito.stub(toolSelectorItem1.getShortName()).toReturn(TOOL1_NAME);
+ Mockito.stub(toolSelectorItem2.getShortName()).toReturn(TOOL2_NAME);
+ }
+
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceSaveTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceSaveTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceSaveTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -15,34 +15,34 @@
@Before
public void init() throws Exception {
- new IntegrationTestHelper(this);
+ new IntegrationTestHelper(this);
- defaultContent = getDefaultContent();
- groupName = defaultContent.getGroup().getShortName();
- doLogin();
+ defaultContent = getDefaultContent();
+ groupName = defaultContent.getGroup().getShortName();
+ doLogin();
}
@Test
public void testSaveAndRetrieve() throws Exception {
- final String text = "Lorem ipsum dolor sit amet";
- final int version = defaultContent.getVersion();
- final int currentVersion = contentService.save(getHash(), groupName, defaultContent.getDocumentId(), text);
- assertEquals(version + 2, currentVersion);
- final StateDTO again = contentService.getContent(getHash(), groupName, defaultContent.getStateToken());
- assertEquals(text, again.getContent());
- assertEquals(0, (int) again.getRateByUsers());
- assertEquals(0, (double) again.getRate());
+ final String text = "Lorem ipsum dolor sit amet";
+ final int version = defaultContent.getVersion();
+ final int currentVersion = contentService.save(getHash(), groupName, defaultContent.getDocumentId(), text);
+ assertEquals(version + 2, currentVersion);
+ final StateDTO again = contentService.getContent(getHash(), groupName, defaultContent.getStateToken());
+ assertEquals(text, again.getContent());
+ assertEquals(0, (int) again.getRateByUsers());
+ assertEquals(new Double(0), again.getRate());
}
@Test
public void testSaveAndRetrieveBig() throws Exception {
- final String text = TestDomainHelper.createBigText();
- ;
- final int version = defaultContent.getVersion();
- final int currentVersion = contentService.save(getHash(), groupName, defaultContent.getDocumentId(), text);
- assertEquals(version + 2, currentVersion);
- final StateDTO again = contentService.getContent(getHash(), groupName, defaultContent.getStateToken());
- assertEquals(text, again.getContent());
+ final String text = TestDomainHelper.createBigText();
+ ;
+ final int version = defaultContent.getVersion();
+ final int currentVersion = contentService.save(getHash(), groupName, defaultContent.getDocumentId(), text);
+ assertEquals(version + 2, currentVersion);
+ final StateDTO again = contentService.getContent(getHash(), groupName, defaultContent.getStateToken());
+ assertEquals(text, again.getContent());
}
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -22,166 +22,166 @@
@Test
public void addRemoveAuthor() throws Exception {
- final List<UserSimpleDTO> authors = defaultContent.getAuthors();
- assertEquals(1, authors.size());
- final UserSimpleDTO author = authors.get(0);
- final String authorShortName = author.getShortName();
- contentService.removeAuthor(getHash(), groupShortName, defDocument, authorShortName);
- final List<UserSimpleDTO> authors2 = getDefaultContent().getAuthors();
- assertEquals(0, authors2.size());
- contentService.addAuthor(getHash(), groupShortName, defDocument, authorShortName);
- final List<UserSimpleDTO> authors3 = getDefaultContent().getAuthors();
- assertEquals(1, authors3.size());
- contentService.addAuthor(getHash(), groupShortName, defDocument, authorShortName);
- final List<UserSimpleDTO> authors4 = getDefaultContent().getAuthors();
- assertEquals(1, authors4.size());
+ final List<UserSimpleDTO> authors = defaultContent.getAuthors();
+ assertEquals(1, authors.size());
+ final UserSimpleDTO author = authors.get(0);
+ final String authorShortName = author.getShortName();
+ contentService.removeAuthor(getHash(), groupShortName, defDocument, authorShortName);
+ final List<UserSimpleDTO> authors2 = getDefaultContent().getAuthors();
+ assertEquals(0, authors2.size());
+ contentService.addAuthor(getHash(), groupShortName, defDocument, authorShortName);
+ final List<UserSimpleDTO> authors3 = getDefaultContent().getAuthors();
+ assertEquals(1, authors3.size());
+ contentService.addAuthor(getHash(), groupShortName, defDocument, authorShortName);
+ final List<UserSimpleDTO> authors4 = getDefaultContent().getAuthors();
+ assertEquals(1, authors4.size());
}
@Test
public void contentRateAndRetrieve() throws Exception {
- contentService.rateContent(getHash(), groupShortName, defDocument, 4.5);
- final StateDTO again = contentService.getContent(getHash(), groupShortName, defaultContent.getStateToken());
- assertEquals(true, again.isRateable());
- assertEquals(4.5, (double) again.getCurrentUserRate());
- assertEquals(4.5, (double) again.getRate());
- assertEquals(1, (double) again.getRateByUsers());
+ contentService.rateContent(getHash(), groupShortName, defDocument, 4.5);
+ final StateDTO again = contentService.getContent(getHash(), groupShortName, defaultContent.getStateToken());
+ assertEquals(true, again.isRateable());
+ assertEquals(new Double(4.5), again.getCurrentUserRate());
+ assertEquals(new Double(4.5), again.getRate());
+ assertEquals(new Integer(1), again.getRateByUsers());
}
@Test
public void contentSetLanguage() throws Exception {
- contentService.setLanguage(getHash(), groupShortName, defDocument, "es");
- final StateDTO contentRetrieved = contentService.getContent(getHash(), groupShortName, defaultContent
- .getStateToken());
- assertEquals("es", contentRetrieved.getLanguage().getCode());
+ contentService.setLanguage(getHash(), groupShortName, defDocument, "es");
+ final StateDTO contentRetrieved = contentService.getContent(getHash(), groupShortName, defaultContent
+ .getStateToken());
+ assertEquals("es", contentRetrieved.getLanguage().getCode());
}
@Test
public void folderRename() throws Exception {
- doLogin();
- defaultContent = getDefaultContent();
- final ContainerDTO folder = defaultContent.getFolder();
+ doLogin();
+ defaultContent = getDefaultContent();
+ final ContainerDTO folder = defaultContent.getFolder();
- final String oldTitle = "some title";
- String newTitle = "folder new name";
- final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
+ final String oldTitle = "some title";
+ String newTitle = "folder new name";
+ final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
- final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
+ final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
- assertEquals(oldTitle, newFolder.getName());
+ assertEquals(oldTitle, newFolder.getName());
- final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
- newFolder.getId().toString(), null);
- String result = contentService.rename(getHash(), groupShortName, folderToken.getEncoded(), newTitle);
+ final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
+ newFolder.getId().toString(), null);
+ String result = contentService.rename(getHash(), groupShortName, folderToken.getEncoded(), newTitle);
- assertEquals(newTitle, result);
+ assertEquals(newTitle, result);
- final StateToken newFolderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
- newFolder.getId().toString(), null);
- StateDTO folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
+ final StateToken newFolderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
+ newFolder.getId().toString(), null);
+ StateDTO folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
- assertEquals(newTitle, folderAgain.getFolder().getName());
+ assertEquals(newTitle, folderAgain.getFolder().getName());
- newTitle = "folder last name";
+ newTitle = "folder last name";
- result = contentService.rename(getHash(), groupShortName, newFolderToken.getEncoded(), newTitle);
+ result = contentService.rename(getHash(), groupShortName, newFolderToken.getEncoded(), newTitle);
- folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
+ folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
- assertEquals(newTitle, folderAgain.getFolder().getName());
+ assertEquals(newTitle, folderAgain.getFolder().getName());
}
@Test(expected = AccessViolationException.class)
public void folderRenameOtherGroupFails() throws Exception {
- doLogin();
- defaultContent = getDefaultContent();
- final ContainerDTO folder = defaultContent.getFolder();
- final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(), folder
- .getId().toString(), null);
+ doLogin();
+ defaultContent = getDefaultContent();
+ final ContainerDTO folder = defaultContent.getFolder();
+ final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(), folder
+ .getId().toString(), null);
- final String newTitle = "folder new name";
- contentService.rename(getHash(), super.getSiteAdminShortName(), folderToken.getEncoded(), newTitle);
+ final String newTitle = "folder new name";
+ contentService.rename(getHash(), super.getSiteAdminShortName(), folderToken.getEncoded(), newTitle);
}
@Test(expected = RuntimeException.class)
public void folderRootRenameMustFail() throws Exception {
- doLogin();
- defaultContent = getDefaultContent();
- final ContainerDTO folder = defaultContent.getFolder();
+ doLogin();
+ defaultContent = getDefaultContent();
+ final ContainerDTO folder = defaultContent.getFolder();
- final String newTitle = "folder new name";
- final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(), folder
- .getId().toString(), null);
- final String result = contentService.rename(getHash(), groupShortName, folderToken.getEncoded(), newTitle);
+ final String newTitle = "folder new name";
+ final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(), folder
+ .getId().toString(), null);
+ final String result = contentService.rename(getHash(), groupShortName, folderToken.getEncoded(), newTitle);
- assertEquals(newTitle, result);
+ assertEquals(newTitle, result);
- final ContainerDTO folderAgain = getDefaultContent().getFolder();
+ final ContainerDTO folderAgain = getDefaultContent().getFolder();
- assertEquals(newTitle, folderAgain.getName());
+ assertEquals(newTitle, folderAgain.getName());
}
@Before
public void init() throws Exception {
- new IntegrationTestHelper(this);
- doLogin();
- defaultContent = getDefaultContent();
- groupShortName = defaultContent.getStateToken().getGroup();
- defDocument = defaultContent.getStateToken().getDocument();
+ new IntegrationTestHelper(this);
+ doLogin();
+ defaultContent = getDefaultContent();
+ groupShortName = defaultContent.getStateToken().getGroup();
+ defDocument = defaultContent.getStateToken().getDocument();
}
@Test
public void setTagsAndResults() throws Exception {
- contentService.setTags(getHash(), groupShortName, defDocument, "bfoo cfoa afoo2");
- final List<TagResultDTO> summaryTags = contentService.getSummaryTags(getHash(), groupShortName);
- assertEquals(3, summaryTags.size());
+ contentService.setTags(getHash(), groupShortName, defDocument, "bfoo cfoa afoo2");
+ final List<TagResultDTO> summaryTags = contentService.getSummaryTags(getHash(), groupShortName);
+ assertEquals(3, summaryTags.size());
- TagResultDTO tagResultDTO = summaryTags.get(0);
- assertEquals("afoo2", tagResultDTO.getName());
- assertEquals(1, (long) tagResultDTO.getCount());
+ TagResultDTO tagResultDTO = summaryTags.get(0);
+ assertEquals("afoo2", tagResultDTO.getName());
+ assertEquals(1, (long) tagResultDTO.getCount());
- tagResultDTO = summaryTags.get(1);
- assertEquals("bfoo", tagResultDTO.getName());
- assertEquals(1, (long) tagResultDTO.getCount());
+ tagResultDTO = summaryTags.get(1);
+ assertEquals("bfoo", tagResultDTO.getName());
+ assertEquals(1, (long) tagResultDTO.getCount());
- tagResultDTO = summaryTags.get(2);
- assertEquals("cfoa", tagResultDTO.getName());
- assertEquals(1, (long) tagResultDTO.getCount());
+ tagResultDTO = summaryTags.get(2);
+ assertEquals("cfoa", tagResultDTO.getName());
+ assertEquals(1, (long) tagResultDTO.getCount());
}
@Test
public void setTagsAndRetrieve() throws Exception {
- contentService.setTags(getHash(), groupShortName, defDocument, "foo foa foo");
- final String tagsRetrieved = getDefaultContent().getTags();
- assertEquals("foo foa", tagsRetrieved);
+ contentService.setTags(getHash(), groupShortName, defDocument, "foo foa foo");
+ final String tagsRetrieved = getDefaultContent().getTags();
+ assertEquals("foo foa", tagsRetrieved);
}
@Test
public void tokenRename() throws Exception {
- doLogin();
- defaultContent = getDefaultContent();
- final ContainerDTO folder = defaultContent.getFolder();
+ doLogin();
+ defaultContent = getDefaultContent();
+ final ContainerDTO folder = defaultContent.getFolder();
- final String oldTitle = "some title";
- String newTitle = "folder new name";
- final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
+ final String oldTitle = "some title";
+ String newTitle = "folder new name";
+ final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
- final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
+ final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
- assertEquals(oldTitle, newFolder.getName());
+ assertEquals(oldTitle, newFolder.getName());
- final StateToken newFolderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
- newFolder.getId().toString(), null);
+ final StateToken newFolderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
+ newFolder.getId().toString(), null);
- newTitle = "folder last name";
+ newTitle = "folder last name";
- final String result = contentService.rename(getHash(), groupShortName, newFolderToken.getEncoded(), newTitle);
+ final String result = contentService.rename(getHash(), groupShortName, newFolderToken.getEncoded(), newTitle);
- assertEquals(newTitle, result);
+ assertEquals(newTitle, result);
- final StateDTO folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
+ final StateDTO folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
- assertEquals(newTitle, folderAgain.getFolder().getName());
+ assertEquals(newTitle, folderAgain.getFolder().getName());
}
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -34,75 +34,75 @@
@After
public void close() {
- if (getTransaction().isActive()) {
- getTransaction().rollback();
- }
+ if (getTransaction().isActive()) {
+ getTransaction().rollback();
+ }
}
@Before
public void insertData() throws Exception {
- english = new I18nLanguage(new Long(1819), "English", "English", "en");
- languageManager.persist(english);
- gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western", ",");
- countryManager.persist(gb);
+ english = new I18nLanguage(new Long(1819), "English", "English", "en");
+ languageManager.persist(english);
+ gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western", ",");
+ countryManager.persist(gb);
}
@Test
public void testContentNotRated() {
- final EntityManager manager = openTransaction();
+ final EntityManager manager = openTransaction();
- final Content cd = new Content();
- cd.setLanguage(english);
- cd.setPublishedOn(new Date());
- manager.persist(cd);
+ final Content cd = new Content();
+ cd.setLanguage(english);
+ cd.setPublishedOn(new Date());
+ manager.persist(cd);
- closeTransaction();
- final Double rate = rateFinder.calculateRate(cd);
- final Long rateByUsers = rateFinder.calculateRateNumberOfUsers(cd);
- assertEquals(0, (long) rateByUsers);
+ closeTransaction();
+ final Double rate = rateFinder.calculateRate(cd);
+ final Long rateByUsers = rateFinder.calculateRateNumberOfUsers(cd);
+ assertEquals(0, (long) rateByUsers);
- // FIXME: Why null? in other tests this return zero
- assertEquals(null, rate);
+ // FIXME: Why null? in other tests this return zero
+ assertEquals(null, rate);
}
@Test
public void testContentRateAverage() {
- final EntityManager manager = openTransaction();
+ final EntityManager manager = openTransaction();
- final User user1 = TestDomainHelper.createUser(1);
- final User user2 = TestDomainHelper.createUser(2);
+ final User user1 = TestDomainHelper.createUser(1);
+ final User user2 = TestDomainHelper.createUser(2);
- user1.setLanguage(english);
- user2.setLanguage(english);
+ user1.setLanguage(english);
+ user2.setLanguage(english);
- user1.setCountry(gb);
- user2.setCountry(gb);
+ user1.setCountry(gb);
+ user2.setCountry(gb);
- manager.persist(user1);
- manager.persist(user2);
+ manager.persist(user1);
+ manager.persist(user2);
- final Content cd = new Content();
- cd.setLanguage(english);
- cd.setPublishedOn(new Date());
- manager.persist(cd);
+ final Content cd = new Content();
+ cd.setLanguage(english);
+ cd.setPublishedOn(new Date());
+ manager.persist(cd);
- manager.persist(new Rate(user1, cd, 1.3));
- manager.persist(new Rate(user2, cd, 3.3));
- // same user and content other rate
- final Rate rateFinded = rateFinder.find(user2, cd);
- rateFinded.setValue(4.3);
- manager.persist(rateFinded);
+ manager.persist(new Rate(user1, cd, 1.3));
+ manager.persist(new Rate(user2, cd, 3.3));
+ // same user and content other rate
+ final Rate rateFinded = rateFinder.find(user2, cd);
+ rateFinded.setValue(4.3);
+ manager.persist(rateFinded);
- closeTransaction();
- final Double rate = rateFinder.calculateRate(cd);
- final Long rateByUsers = rateFinder.calculateRateNumberOfUsers(cd);
- final Double average = (1.3 + 4.3) / 2;
- assertEquals(average, rate);
- assertEquals(new Long(2), rateByUsers);
- final Rate newRate1 = rateFinder.find(user1, cd);
- final Rate newRate2 = rateFinder.find(user2, cd);
- assertEquals(1.3, (double) newRate1.getValue());
- assertEquals(4.3, (double) newRate2.getValue());
+ closeTransaction();
+ final Double rate = rateFinder.calculateRate(cd);
+ final Long rateByUsers = rateFinder.calculateRateNumberOfUsers(cd);
+ final Double average = (1.3 + 4.3) / 2;
+ assertEquals(average, rate);
+ assertEquals(new Long(2), rateByUsers);
+ final Rate newRate1 = rateFinder.find(user1, cd);
+ final Rate newRate2 = rateFinder.find(user2, cd);
+ assertEquals(new Double(1.3), newRate1.getValue());
+ assertEquals(new Double(4.3), newRate2.getValue());
}
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -29,6 +29,7 @@
private User user;
private User admin;
private User otherUser;
+ private DomainContext ctx;
@Test
public void acceptJoinGroup() throws Exception {
@@ -163,7 +164,7 @@
@Before
public void init() {
openTransaction();
- final DomainContext ctx = new DomainContext();
+ ctx = new DomainContext();
ctx.createUsers("user1");
ctx.createUsers("admin");
ctx.createUsers("otheruser");
1
0