[kune-commits] r1337 - in trunk/src/main/java/cc/kune: core/client/sn domain gspace/client/actions gspace/client/viewers
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Tue May 3 15:30:15 CEST 2011
Author: vjrj_
Date: 2011-05-03 15:30:14 +0200 (Tue, 03 May 2011)
New Revision: 1337
Modified:
trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
trunk/src/main/java/cc/kune/domain/Container.java
trunk/src/main/java/cc/kune/domain/Content.java
trunk/src/main/java/cc/kune/domain/GroupList.java
trunk/src/main/java/cc/kune/gspace/client/actions/ParticipateInContentBtn.java
trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java
Log:
Fixes in domain, and wiab editor
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2011-05-03 11:32:25 UTC (rev 1336)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2011-05-03 13:30:14 UTC (rev 1337)
@@ -5,9 +5,9 @@
import cc.kune.common.client.actions.ui.IsActionExtensible;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
import cc.kune.core.client.sn.actions.registry.GroupSNAdminsMenuItemsRegistry;
import cc.kune.core.client.sn.actions.registry.GroupSNCollabsMenuItemsRegistry;
+import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
import cc.kune.core.client.sn.actions.registry.GroupSNPendingsMenuItemsRegistry;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.SocialNetworkChangedEvent;
@@ -31,173 +31,176 @@
import com.gwtplatform.mvp.client.proxy.Proxy;
import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
-public class GroupSNPresenter extends AbstractSNPresenter<GroupSNPresenter.GroupSNView, GroupSNPresenter.GroupSNProxy> {
+public class GroupSNPresenter extends
+ AbstractSNPresenter<GroupSNPresenter.GroupSNView, GroupSNPresenter.GroupSNProxy> {
- @ProxyCodeSplit
- public interface GroupSNProxy extends Proxy<GroupSNPresenter> {
- }
+ @ProxyCodeSplit
+ public interface GroupSNProxy extends Proxy<GroupSNPresenter> {
+ }
- public interface GroupSNView extends View {
+ public interface GroupSNView extends View {
- void addAdmin(GroupDTO group, String avatarUrl, String tooltip, String tooltipTitle,
- GuiActionDescCollection menu);
+ void addAdmin(GroupDTO group, String avatarUrl, String tooltip, String tooltipTitle,
+ GuiActionDescCollection menu);
- void addCollab(GroupDTO group, String avatarUrl, String tooltip, String tooltipTitle,
- GuiActionDescCollection menu);
+ void addCollab(GroupDTO group, String avatarUrl, String tooltip, String tooltipTitle,
+ GuiActionDescCollection menu);
- void addPending(GroupDTO group, String avatarUrl, String tooltip, String tooltipTitle,
- GuiActionDescCollection menu);
+ void addPending(GroupDTO group, String avatarUrl, String tooltip, String tooltipTitle,
+ GuiActionDescCollection menu);
- void clear();
+ void clear();
- IsActionExtensible getBottomToolbar();
+ IsActionExtensible getBottomToolbar();
- void setAdminsCount(int count);
+ void setAdminsCount(int count);
- void setCollabsCount(int count);
+ void setCollabsCount(int count);
- void setCollabsVisible(boolean visible);
+ void setCollabsVisible(boolean visible);
- void setPendingsCount(int count);
+ void setPendingsCount(int count);
- void setPendingVisible(boolean visible);
+ void setPendingVisible(boolean visible);
- void setVisible(boolean visible);
+ void setVisible(boolean visible);
- void showMemberNotPublic();
+ void showMemberNotPublic();
- void showMembers();
+ void showMembers();
- void showOrphan();
- }
+ void showOrphan();
+ }
- private final GroupSNConfActions actionsRegistry;
- private final GroupSNAdminsMenuItemsRegistry adminsMenuItemsRegistry;
- private final GroupSNCollabsMenuItemsRegistry collabsMenuItemsRegistry;
- private final GroupSNPendingsMenuItemsRegistry pendingsMenuItemsRegistry;
+ private final GroupSNConfActions actionsRegistry;
+ private final GroupSNAdminsMenuItemsRegistry adminsMenuItemsRegistry;
+ private final GroupSNCollabsMenuItemsRegistry collabsMenuItemsRegistry;
+ private final GroupSNPendingsMenuItemsRegistry pendingsMenuItemsRegistry;
- @Inject
- public GroupSNPresenter(final EventBus eventBus, final GroupSNView view, final GroupSNProxy proxy,
- final StateManager stateManager, final Session session, final Provider<FileDownloadUtils> downloadProvider,
- final GroupSNAdminsMenuItemsRegistry adminsMenuItemsRegistry,
- final GroupSNCollabsMenuItemsRegistry collabsMenuItemsRegistry,
- final GroupSNPendingsMenuItemsRegistry pendingsMenuItemsRegistry,
- final GroupSNConfActions actionsRegistry) {
- super(eventBus, view, proxy, downloadProvider);
- this.adminsMenuItemsRegistry = adminsMenuItemsRegistry;
- this.collabsMenuItemsRegistry = collabsMenuItemsRegistry;
- this.pendingsMenuItemsRegistry = pendingsMenuItemsRegistry;
- this.actionsRegistry = actionsRegistry;
- stateManager.onStateChanged(true, new StateChangedEvent.StateChangedHandler() {
- @Override
- public void onStateChanged(final StateChangedEvent event) {
- GroupSNPresenter.this.onStateChanged(event.getState());
- }
+ @Inject
+ public GroupSNPresenter(final EventBus eventBus, final GroupSNView view, final GroupSNProxy proxy,
+ final StateManager stateManager, final Session session,
+ final Provider<FileDownloadUtils> downloadProvider,
+ final GroupSNAdminsMenuItemsRegistry adminsMenuItemsRegistry,
+ final GroupSNCollabsMenuItemsRegistry collabsMenuItemsRegistry,
+ final GroupSNPendingsMenuItemsRegistry pendingsMenuItemsRegistry,
+ final GroupSNConfActions actionsRegistry) {
+ super(eventBus, view, proxy, downloadProvider);
+ this.adminsMenuItemsRegistry = adminsMenuItemsRegistry;
+ this.collabsMenuItemsRegistry = collabsMenuItemsRegistry;
+ this.pendingsMenuItemsRegistry = pendingsMenuItemsRegistry;
+ this.actionsRegistry = actionsRegistry;
+ stateManager.onStateChanged(true, new StateChangedEvent.StateChangedHandler() {
+ @Override
+ public void onStateChanged(final StateChangedEvent event) {
+ GroupSNPresenter.this.onStateChanged(event.getState());
+ }
+ });
+ stateManager.onSocialNetworkChanged(true,
+ new SocialNetworkChangedEvent.SocialNetworkChangedHandler() {
+ @Override
+ public void onSocialNetworkChanged(final SocialNetworkChangedEvent event) {
+ GroupSNPresenter.this.onStateChanged(event.getState());
+ }
});
- stateManager.onSocialNetworkChanged(true, new SocialNetworkChangedEvent.SocialNetworkChangedHandler() {
- @Override
- public void onSocialNetworkChanged(final SocialNetworkChangedEvent event) {
- GroupSNPresenter.this.onStateChanged(event.getState());
- }
- });
- session.onUserSignIn(true, new UserSignInHandler() {
- @Override
- public void onUserSignIn(final UserSignInEvent event) {
- refreshOnSignInSignOut(session);
- }
- });
- session.onUserSignOut(true, new UserSignOutHandler() {
- @Override
- public void onUserSignOut(final UserSignOutEvent event) {
- refreshOnSignInSignOut(session);
- }
+ session.onUserSignIn(true, new UserSignInHandler() {
+ @Override
+ public void onUserSignIn(final UserSignInEvent event) {
+ refreshOnSignInSignOut(session);
+ }
+ });
+ session.onUserSignOut(true, new UserSignOutHandler() {
+ @Override
+ public void onUserSignOut(final UserSignOutEvent event) {
+ refreshOnSignInSignOut(session);
+ }
- });
- createActions();
- }
+ });
+ createActions();
+ }
- private void createActions() {
- getView().getBottomToolbar().addAll(actionsRegistry);
- }
+ private void createActions() {
+ getView().getBottomToolbar().addAll(actionsRegistry);
+ }
- @Override
- public GroupSNView getView() {
- return (GroupSNView) super.getView();
- }
+ @Override
+ public GroupSNView getView() {
+ return (GroupSNView) super.getView();
+ }
- private void onStateChanged(final StateAbstractDTO state) {
- if (state.getGroup().isPersonal()) {
- getView().setVisible(false);
- } else {
- if (state.getSocialNetworkData().isMembersVisible()) {
- getView().clear();
- setGroupMembers(state.getGroupMembers(), state.getGroupRights());
- } else {
- getView().clear();
- getView().showMemberNotPublic();
- getView().setVisible(true);
- }
- }
+ private void onStateChanged(final StateAbstractDTO state) {
+ if (state.getGroup().isPersonal()) {
+ getView().setVisible(false);
+ } else {
+ if (state.getSocialNetworkData().isMembersVisible()) {
+ getView().clear();
+ setGroupMembers(state.getGroupMembers(), state.getGroupRights());
+ } else {
+ getView().clear();
+ getView().showMemberNotPublic();
+ getView().setVisible(true);
+ }
}
+ }
- private void refreshOnSignInSignOut(final Session session) {
- final StateAbstractDTO currentState = session.getCurrentState();
- if (currentState != null) {
- GroupSNPresenter.this.onStateChanged(currentState);
- }
+ private void refreshOnSignInSignOut(final Session session) {
+ final StateAbstractDTO currentState = session.getCurrentState();
+ if (currentState != null) {
+ GroupSNPresenter.this.onStateChanged(currentState);
}
+ }
- @Override
- protected void revealInParent() {
- RevealRootContentEvent.fire(this, this);
- }
+ @Override
+ protected void revealInParent() {
+ RevealRootContentEvent.fire(this, this);
+ }
- private void setGroupMembers(final SocialNetworkDTO socialNetwork, final AccessRights rights) {
- final AccessListsDTO accessLists = socialNetwork.getAccessLists();
+ private void setGroupMembers(final SocialNetworkDTO socialNetwork, final AccessRights rights) {
+ final AccessListsDTO accessLists = socialNetwork.getAccessLists();
- final List<GroupDTO> adminsList = accessLists.getAdmins().getList();
- final List<GroupDTO> collabList = accessLists.getEditors().getList();
- final List<GroupDTO> pendingCollabsList = socialNetwork.getPendingCollaborators().getList();
+ final List<GroupDTO> adminsList = accessLists.getAdmins().getList();
+ final List<GroupDTO> collabList = accessLists.getEditors().getList();
+ final List<GroupDTO> pendingCollabsList = socialNetwork.getPendingCollaborators().getList();
- final int numAdmins = adminsList.size();
- final int numCollabs = collabList.size();
- final int numPendings = pendingCollabsList.size();
+ final int numAdmins = adminsList.size();
+ final int numCollabs = collabList.size();
+ final int numPendings = pendingCollabsList.size();
- getView().setAdminsCount(numAdmins);
- getView().setCollabsCount(numCollabs);
- getView().setPendingsCount(numPendings);
+ getView().setAdminsCount(numAdmins);
+ getView().setCollabsCount(numCollabs);
+ getView().setPendingsCount(numPendings);
- if ((numAdmins + numCollabs) == 0) {
- getView().showOrphan();
- } else {
- final boolean userIsAdmin = rights.isAdministrable();
- final boolean userCanView = rights.isVisible();
+ if ((numAdmins + numCollabs) == 0) {
+ getView().showOrphan();
+ } else {
+ final boolean userIsAdmin = rights.isAdministrable();
+ final boolean userCanView = rights.isVisible();
- if (userCanView) {
- for (final GroupDTO admin : adminsList) {
- final String avatar = getAvatar(admin);
- getView().addAdmin(admin, avatar, admin.getLongName(), "",
- createMenuItems(admin, adminsMenuItemsRegistry, admin.getLongName()));
- }
- getView().setCollabsVisible(numCollabs > 0);
- for (final GroupDTO collab : collabList) {
- final String avatar = getAvatar(collab);
- getView().addCollab(collab, avatar, collab.getLongName(), "",
- createMenuItems(collab, collabsMenuItemsRegistry, collab.getLongName()));
- }
- if (userIsAdmin) {
- getView().setPendingVisible(numPendings > 0);
- for (final GroupDTO pendingCollab : pendingCollabsList) {
- final String avatar = getAvatar(pendingCollab);
- getView().addPending(pendingCollab, avatar, pendingCollab.getLongName(), "",
- createMenuItems(pendingCollab, pendingsMenuItemsRegistry, pendingCollab.getLongName()));
- }
- } else {
- getView().setPendingVisible(false);
- }
- getView().showMembers();
- }
+ if (userCanView) {
+ for (final GroupDTO admin : adminsList) {
+ final String avatar = getAvatar(admin);
+ getView().addAdmin(admin, avatar, admin.getLongName(), "",
+ createMenuItems(admin, adminsMenuItemsRegistry, admin.getLongName()));
}
- getView().setVisible(true);
+ getView().setCollabsVisible(numCollabs > 0);
+ for (final GroupDTO collab : collabList) {
+ final String avatar = getAvatar(collab);
+ getView().addCollab(collab, avatar, collab.getLongName(), "",
+ createMenuItems(collab, collabsMenuItemsRegistry, collab.getLongName()));
+ }
+ if (userIsAdmin) {
+ getView().setPendingVisible(numPendings > 0);
+ for (final GroupDTO pendingCollab : pendingCollabsList) {
+ final String avatar = getAvatar(pendingCollab);
+ getView().addPending(pendingCollab, avatar, pendingCollab.getLongName(), "",
+ createMenuItems(pendingCollab, pendingsMenuItemsRegistry, pendingCollab.getLongName()));
+ }
+ } else {
+ getView().setPendingVisible(false);
+ }
+ getView().showMembers();
+ }
}
+ getView().setVisible(true);
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/domain/Container.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/Container.java 2011-05-03 11:32:25 UTC (rev 1336)
+++ trunk/src/main/java/cc/kune/domain/Container.java 2011-05-03 13:30:14 UTC (rev 1337)
@@ -59,240 +59,242 @@
@Indexed
@Table(name = "containers")
public class Container implements HasId, HasStateToken {
- @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- private List<Container> absolutePath;
- @OneToOne(cascade = CascadeType.ALL)
- private AccessLists accessLists;
+ @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ private List<Container> absolutePath;
- @Fetch(FetchMode.JOIN)
- @OrderBy("createdOn DESC")
- @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
- private Set<Container> childs;
+ @OneToOne(cascade = CascadeType.ALL)
+ private AccessLists accessLists;
- @OneToMany(cascade = CascadeType.ALL)
- private List<ContainerTranslation> containerTranslations;
+ @Fetch(FetchMode.JOIN)
+ @OrderBy("createdOn DESC")
+ @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+ private Set<Container> childs;
- @Fetch(FetchMode.JOIN)
- @ContainedIn
- @OrderBy("createdOn DESC")
- @OneToMany(mappedBy = "container", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
- private Set<Content> contents;
+ @OneToMany(cascade = CascadeType.ALL)
+ private List<ContainerTranslation> containerTranslations;
- @Basic(optional = false)
- private Long createdOn;
+ @Fetch(FetchMode.JOIN)
+ @ContainedIn
+ @OrderBy("createdOn DESC")
+ @OneToMany(mappedBy = "container", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+ private Set<Content> contents;
- @Basic(optional = true)
- private Date deletedOn;
+ @Basic(optional = false)
+ private Long createdOn;
- @Id
- @GeneratedValue
- @DocumentId
- Long id;
+ @Basic(optional = true)
+ private Date deletedOn;
- @ManyToOne
- private I18nLanguage language;
+ @Id
+ @GeneratedValue
+ @DocumentId
+ Long id;
- @Column
- @Field(index = Index.TOKENIZED, store = Store.NO)
- private String name;
+ @ManyToOne
+ private I18nLanguage language;
- @IndexedEmbedded(depth = 1, prefix = "owner_")
- @OneToOne
- private Group owner;
+ @Column
+ @Field(index = Index.TOKENIZED, store = Store.NO)
+ private String name;
- // Parent/Child pattern:
- // http://www.hibernate.org/hib_docs/reference/en/html/example-parentchild.html
- // http://www.researchkitchen.co.uk/blog/archives/57
- @ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn
- private Container parent;
+ @IndexedEmbedded(depth = 1, prefix = "owner_")
+ @OneToOne
+ private Group owner;
- private String toolName;
+ // Parent/Child pattern:
+ // http://www.hibernate.org/hib_docs/reference/en/html/example-parentchild.html
+ // http://www.researchkitchen.co.uk/blog/archives/57
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn
+ private Container parent;
- private String typeId;
+ private String toolName;
- public Container() {
- this(null, null, null);
- }
+ private String typeId;
- public Container(final String title, final Group group, final String toolName) {
- this.name = title;
- owner = group;
- this.toolName = toolName;
- this.contents = new HashSet<Content>();
- this.childs = new HashSet<Container>();
- this.absolutePath = new ArrayList<Container>();
- this.createdOn = System.currentTimeMillis();
- }
+ public Container() {
+ this(null, null, null);
+ }
- public void addChild(final Container child) {
- child.setParent(this);
- childs.add(child);
- }
+ public Container(final String title, final Group group, final String toolName) {
+ this.name = title;
+ owner = group;
+ this.toolName = toolName;
+ this.contents = new HashSet<Content>();
+ this.childs = new HashSet<Container>();
+ this.absolutePath = new ArrayList<Container>();
+ this.createdOn = System.currentTimeMillis();
+ }
- public void addContent(final Content descriptor) {
- // FIXME: something related with lazy initialization (workaround using
- // size())
- contents.size();
- contents.add(descriptor);
- }
+ public void addChild(final Container child) {
+ child.setParent(this);
+ childs.add(child);
+ }
- public List<Container> getAbsolutePath() {
- return absolutePath;
- }
+ public void addContent(final Content descriptor) {
+ // FIXME: something related with lazy initialization (workaround using
+ // size())
+ contents.size();
+ contents.add(descriptor);
+ }
- @Transient
- public AccessLists getAccessLists() {
- return hasAccessList() ? accessLists : isRoot() ? getOwner().getAccessLists() : getParent().getAccessLists();
- }
+ public List<Container> getAbsolutePath() {
+ return absolutePath;
+ }
- public List<ContainerTranslation> getAliases() {
- return containerTranslations;
- }
+ @Transient
+ public AccessLists getAccessLists() {
+ return hasAccessList() ? accessLists : isRoot() ? getOwner().getAccessLists()
+ : getParent().getAccessLists();
+ }
- public Set<Container> getChilds() {
- return childs;
- }
+ public List<ContainerTranslation> getAliases() {
+ return containerTranslations;
+ }
- public List<ContainerTranslation> getContainerTranslations() {
- return containerTranslations;
- }
+ public Set<Container> getChilds() {
+ return childs;
+ }
- public Set<Content> getContents() {
- return contents;
- }
+ public List<ContainerTranslation> getContainerTranslations() {
+ return containerTranslations;
+ }
- public Long getCreatedOn() {
- return createdOn;
- }
+ public Set<Content> getContents() {
+ return contents;
+ }
- public Date getDeletedOn() {
- return deletedOn;
- }
+ public Long getCreatedOn() {
+ return createdOn;
+ }
- @Override
- public Long getId() {
- return id;
- }
+ public Date getDeletedOn() {
+ return deletedOn;
+ }
- public I18nLanguage getLanguage() {
- return language;
- }
+ @Override
+ public Long getId() {
+ return id;
+ }
- public String getName() {
- return name;
- }
+ public I18nLanguage getLanguage() {
+ return language;
+ }
- public Group getOwner() {
- return owner;
- }
+ public String getName() {
+ return name;
+ }
- public Container getParent() {
- return parent;
- }
+ public Group getOwner() {
+ return owner;
+ }
- public Long getParentFolderId() {
- return parent != null ? parent.getId() : null;
- }
+ public Container getParent() {
+ return parent;
+ }
- @Override
- @Transient
- public StateToken getStateToken() {
- return new StateToken(getOwner().getShortName(), getToolName(), getId());
- }
+ public Long getParentFolderId() {
+ return parent != null ? parent.getId() : null;
+ }
- @Transient
- public String getStateTokenEncoded() {
- return getStateToken().getEncoded();
- }
+ @Override
+ @Transient
+ public StateToken getStateToken() {
+ return new StateToken(getOwner().getShortName(), getToolName(), getId());
+ }
- public String getToolName() {
- return toolName;
- }
+ @Transient
+ public String getStateTokenEncoded() {
+ return getStateToken().getEncoded();
+ }
- public String getTypeId() {
- return typeId;
- }
+ public String getToolName() {
+ return toolName;
+ }
- @Transient
- public boolean hasAccessList() {
- return accessLists != null;
- }
+ public String getTypeId() {
+ return typeId;
+ }
- @Transient
- public boolean isLeaf() {
- return childs.size() == 0 && contents.size() == 0;
- }
+ @Transient
+ public boolean hasAccessList() {
+ return accessLists != null;
+ }
- @Transient
- public boolean isRoot() {
- return parent == null;
- }
+ @Transient
+ public boolean isLeaf() {
+ return childs.size() == 0 && contents.size() == 0;
+ }
- public void setAbsolutePath(final List<Container> absolutePath) {
- this.absolutePath = absolutePath;
- }
+ @Transient
+ public boolean isRoot() {
+ return parent == null;
+ }
- public void setAccessLists(final AccessLists accessLists) {
- this.accessLists = accessLists;
- }
+ public void setAbsolutePath(final List<Container> absolutePath) {
+ this.absolutePath = absolutePath;
+ }
- public void setAliases(final List<ContainerTranslation> containerTranslations) {
- this.containerTranslations = containerTranslations;
- }
+ public void setAccessLists(final AccessLists accessLists) {
+ this.accessLists = accessLists;
+ }
- public void setChilds(final Set<Container> childs) {
- this.childs = childs;
- }
+ public void setAliases(final List<ContainerTranslation> containerTranslations) {
+ this.containerTranslations = containerTranslations;
+ }
- public void setContainerTranslations(final List<ContainerTranslation> containerTranslations) {
- this.containerTranslations = containerTranslations;
- }
+ public void setChilds(final Set<Container> childs) {
+ this.childs = childs;
+ }
- public void setContents(final HashSet<Content> contents) {
- this.contents = contents;
- }
+ public void setContainerTranslations(final List<ContainerTranslation> containerTranslations) {
+ this.containerTranslations = containerTranslations;
+ }
- public void setCreatedOn(final Long createdOn) {
- this.createdOn = createdOn;
- }
+ public void setContents(final HashSet<Content> contents) {
+ this.contents = contents;
+ }
- public void setDeletedOn(final Date deletedOn) {
- this.deletedOn = deletedOn;
- }
+ public void setCreatedOn(final Long createdOn) {
+ this.createdOn = createdOn;
+ }
- @Override
- public void setId(final Long id) {
- this.id = id;
- }
+ public void setDeletedOn(final Date deletedOn) {
+ this.deletedOn = deletedOn;
+ }
- public void setLanguage(final I18nLanguage language) {
- this.language = language;
- }
+ @Override
+ public void setId(final Long id) {
+ this.id = id;
+ }
- public void setName(final String name) {
- this.name = name;
- }
+ public void setLanguage(final I18nLanguage language) {
+ this.language = language;
+ }
- public void setOwner(final Group owner) {
- this.owner = owner;
- }
+ public void setName(final String name) {
+ this.name = name;
+ }
- public void setParent(final Container parent) {
- this.parent = parent;
- }
+ public void setOwner(final Group owner) {
+ this.owner = owner;
+ }
- public void setToolName(final String toolName) {
- this.toolName = toolName;
- }
+ public void setParent(final Container parent) {
+ this.parent = parent;
+ }
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
- }
+ public void setToolName(final String toolName) {
+ this.toolName = toolName;
+ }
- @Override
- public String toString() {
- return "Container[(" + getStateTokenEncoded() + "): " + getName() + "]";
- }
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
+ }
+
+ @Override
+ public String toString() {
+ return "Container[(" + getStateTokenEncoded() + "): " + getName() + "]";
+ }
}
Modified: trunk/src/main/java/cc/kune/domain/Content.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/Content.java 2011-05-03 11:32:25 UTC (rev 1336)
+++ trunk/src/main/java/cc/kune/domain/Content.java 2011-05-03 13:30:14 UTC (rev 1337)
@@ -74,6 +74,7 @@
@OneToOne(cascade = CascadeType.ALL)
private AccessLists accessLists;
+ @Fetch(FetchMode.JOIN)
@IndexedEmbedded
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
private List<User> authors;
@@ -106,6 +107,7 @@
private Long id;
@IndexedEmbedded
+ @Fetch(FetchMode.JOIN)
@NotNull
@ManyToOne(fetch = FetchType.LAZY)
private I18nLanguage language;
Modified: trunk/src/main/java/cc/kune/domain/GroupList.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/GroupList.java 2011-05-03 11:32:25 UTC (rev 1336)
+++ trunk/src/main/java/cc/kune/domain/GroupList.java 2011-05-03 13:30:14 UTC (rev 1337)
@@ -35,103 +35,107 @@
import javax.persistence.OrderBy;
import javax.persistence.Table;
+import org.hibernate.annotations.Fetch;
+import org.hibernate.annotations.FetchMode;
+
import cc.kune.core.shared.domain.GroupListMode;
@Entity
@Table(name = "group_list")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class GroupList {
- @Id
- @GeneratedValue
- private Long id;
+ @Id
+ @GeneratedValue
+ private Long id;
- @OrderBy("shortName ASC")
- @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
- List<Group> list;
+ @Fetch(FetchMode.JOIN)
+ @OrderBy("shortName ASC")
+ @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+ List<Group> list;
- @Enumerated(EnumType.STRING)
- @Basic
- private GroupListMode mode;
+ @Enumerated(EnumType.STRING)
+ @Basic
+ private GroupListMode mode;
- public GroupList() {
- this(new ArrayList<Group>());
- this.mode = GroupListMode.NORMAL;
- }
+ public GroupList() {
+ this(new ArrayList<Group>());
+ this.mode = GroupListMode.NORMAL;
+ }
- public GroupList(final List<Group> list) {
- this.list = list;
- }
+ public GroupList(final List<Group> list) {
+ this.list = list;
+ }
- public void add(final Group group) {
- // No group duplicate
- // TODO: Get this outside Domain?
- if (!list.contains(group)) {
- list.add(group);
- }
- // TODO: Get this outside Domain?
- if (getMode() == GroupListMode.NOBODY) {
- setMode(GroupListMode.NORMAL);
- }
+ public void add(final Group group) {
+ // No group duplicate
+ // TODO: Get this outside Domain?
+ if (!list.contains(group)) {
+ list.add(group);
}
-
- public boolean checkIfIncludes(final Group group, final List<Group> list, final GroupListMode mode) {
- switch (mode) {
- case NOBODY:
- return false;
- case EVERYONE:
- return true;
- default:
- return list.contains(group);
- }
+ // TODO: Get this outside Domain?
+ if (getMode() == GroupListMode.NOBODY) {
+ setMode(GroupListMode.NORMAL);
}
+ }
- public ArrayList<Group> duplicate() {
- return new ArrayList<Group>(list);
+ public boolean checkIfIncludes(final Group group, final List<Group> list, final GroupListMode mode) {
+ switch (mode) {
+ case NOBODY:
+ return false;
+ case EVERYONE:
+ return true;
+ default:
+ return list.contains(group);
}
+ }
- public Long getId() {
- return id;
- }
+ public ArrayList<Group> duplicate() {
+ return new ArrayList<Group>(list);
+ }
- public List<Group> getList() {
- return list;
- }
+ public Long getId() {
+ return id;
+ }
- public GroupListMode getMode() {
- return mode;
- }
+ public List<Group> getList() {
+ return list;
+ }
- public boolean includes(final Group group) {
- return checkIfIncludes(group, this.list, mode);
- }
+ public GroupListMode getMode() {
+ return mode;
+ }
- public boolean isEmpty() {
- return list.size() == 0;
- }
+ public boolean includes(final Group group) {
+ return checkIfIncludes(group, this.list, mode);
+ }
- public void remove(final Group group) {
- list.remove(group);
- // TODO: Get this outside Domain?
- if (list.isEmpty()) {
- setMode(GroupListMode.NOBODY);
- }
- }
+ public boolean isEmpty() {
+ return list.size() == 0;
+ }
- public void setId(final Long id) {
- this.id = id;
+ public void remove(final Group group) {
+ list.remove(group);
+ // TODO: Get this outside Domain?
+ if (list.isEmpty()) {
+ setMode(GroupListMode.NOBODY);
}
+ }
- public void setList(final List<Group> list) {
- this.list = list;
- }
+ public void setId(final Long id) {
+ this.id = id;
+ }
- public void setMode(final GroupListMode mode) {
- this.mode = mode;
- }
+ public void setList(final List<Group> list) {
+ this.list = list;
+ }
- @Override
- public String toString() {
- return "GroupList[(" + mode + "): " + list + "]";
- }
+ public void setMode(final GroupListMode mode) {
+ this.mode = mode;
+ }
+ @Override
+ public String toString() {
+ return "GroupList[(" + mode + "): " + list + "]";
+ }
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/ParticipateInContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ParticipateInContentBtn.java 2011-05-03 11:32:25 UTC (rev 1336)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ParticipateInContentBtn.java 2011-05-03 13:30:14 UTC (rev 1337)
@@ -13,7 +13,6 @@
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.dto.HasContent;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.inject.Inject;
@@ -39,12 +38,12 @@
@Override
public void actionPerformed(final ActionEvent event) {
NotifyUser.showProgressProcessing();
- stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
contentService.get().addParticipant(session.getUserHash(), session.getCurrentStateToken(),
session.getCurrentUser().getShortName(), new AsyncCallbackSimple<Void>() {
@Override
public void onSuccess(final Void arg) {
NotifyUser.hideProgress();
+ stateManager.gotoStateToken(session.getCurrentStateToken());
}
});
}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java 2011-05-03 11:32:25 UTC (rev 1336)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java 2011-05-03 13:30:14 UTC (rev 1337)
@@ -22,6 +22,8 @@
import cc.kune.common.client.ui.HasEditHandler;
import cc.kune.common.client.ui.UiUtils;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
+import cc.kune.core.client.state.UserSignOutEvent;
+import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.GSpaceArmor;
@@ -69,11 +71,18 @@
@Inject
public DocViewerPanel(final GSpaceArmor wsArmor,
- final ContentCapabilitiesRegistry capabilitiesRegistry, final I18nTranslationService i18n) {
+ final ContentCapabilitiesRegistry capabilitiesRegistry, final I18nTranslationService i18n,
+ final cc.kune.core.client.state.Session session) {
this.gsArmor = wsArmor;
this.capabilitiesRegistry = capabilitiesRegistry;
widget = uiBinder.createAndBindUi(this);
contentTitle = new ContentTitleWidget(i18n, gsArmor, capabilitiesRegistry.getIconsRegistry());
+ session.onUserSignOut(true, new UserSignOutHandler() {
+ @Override
+ public void onUserSignOut(final UserSignOutEvent event) {
+ channel = null;
+ }
+ });
}
@Override
More information about the kune-commits
mailing list