[kune-commits] r1501 - in trunk: . src/main/java/cc/kune src/main/java/cc/kune/common/client/ui/dialogs/tabbed src/main/java/cc/kune/core src/main/java/cc/kune/core/client/resources src/main/java/cc/kune/core/public src/main/java/cc/kune/domain src/main/java/cc/kune/gspace/client src/main/java/cc/kune/gspace/client/i18n src/main/java/cc/kune/gspace/client/options/general src/main/java/cc/kune/gspace/client/resources src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/msgs/client src/main/java/cc/kune/msgs/public src/test/java/cc/kune/core/server/integration/site src/test/java/cc/kune/core/server/manager
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Thu Sep 1 05:36:24 CEST 2011
Author: vjrj_
Date: 2011-09-01 05:36:23 +0200 (Thu, 01 Sep 2011)
New Revision: 1501
Added:
trunk/src/main/java/cc/kune/core/client/resources/arrow-undo.png
trunk/src/main/java/cc/kune/core/client/resources/copy.png
trunk/src/main/java/cc/kune/gspace/client/i18n/CwCellList.java.txt
trunk/src/main/java/cc/kune/gspace/client/i18n/CwCellList.ui.xml
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.ui.xml
trunk/src/main/java/cc/kune/gspace/client/i18n/RangeLabelPager.java
trunk/src/main/java/cc/kune/gspace/client/i18n/ShowMorePagerPanel.java
Removed:
trunk/Blogs
trunk/blogs
Modified:
trunk/TODO
trunk/src/main/java/cc/kune/Kune.gwt.xml
trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml
trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
trunk/src/main/java/cc/kune/core/public/ws.css
trunk/src/main/java/cc/kune/domain/Group.java
trunk/src/main/java/cc/kune/domain/GroupList.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPanel.java
trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
trunk/src/main/java/cc/kune/msgs/client/UserMessagesPanel.java
trunk/src/main/java/cc/kune/msgs/client/UserMessagesPanel.ui.xml
trunk/src/main/java/cc/kune/msgs/public/kune-message.css
trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java
trunk/src/test/java/cc/kune/core/server/manager/GroupManagerDefaultTest.java
Log:
CLOSED - # 111: Rights problems in user space
http://kune.ourproject.org/issues/ticket/111
NEW - # 81: Minor CSS issues in chrommium
http://kune.ourproject.org/issues/ticket/81
Deleted: trunk/Blogs
===================================================================
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/TODO 2011-09-01 03:36:23 UTC (rev 1501)
@@ -285,6 +285,8 @@
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
* MID-TERM
+** Study mozilla web apps:
+https://apps.mozillalabs.com/
** Menubar submenus problem
https://groups.google.com/group/google-web-toolkit/browse_thread/thread/aa887d470ed609c/c76d622622e39a56?lnk=gst&q=menubar+left+#c76d622622e39a56
** Template system for new waves with legal free/open procedures
Deleted: trunk/blogs
===================================================================
Modified: trunk/src/main/java/cc/kune/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/Kune.gwt.xml 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/Kune.gwt.xml 2011-09-01 03:36:23 UTC (rev 1501)
@@ -16,7 +16,6 @@
<inherits name="cc.kune.pspace.PSpace" />
<inherits name="com.calclab.suco.Suco" />
<inherits name="org.adamtacy.GWTEffects"></inherits>
- <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd' />
<source path='client'
excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
<!-- <source path='shared'/> -->
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -26,14 +26,17 @@
import cc.kune.common.client.ui.dialogs.MessageToolbar;
import cc.kune.common.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter.AbstractTabbedDialogView;
+import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.logical.shared.HasCloseHandlers;
import com.google.gwt.resources.client.ImageResource;
-import com.google.gwt.user.client.ui.DecoratedTabPanel;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.TabLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
public abstract class AbstractTabbedDialogPanel implements AbstractTabbedDialogView {
@@ -51,7 +54,7 @@
private final ProvidersCollection provCollection;
private final String sndBtnId;
private final String sndBtnTitle;
- private DecoratedTabPanel tabPanel;
+ private TabLayoutPanel tabPanel;
private String title;
private int width;
@@ -108,6 +111,7 @@
public void addTab(final IsWidget view, final IsWidget tabWidget) {
createDialogIfNecessary();
tabPanel.add(view, tabWidget);
+ setPositions();
}
@Override
@@ -121,10 +125,12 @@
height).icon(iconCls).firstButtonId(firstBtnId).firstButtonTitle(firstBtnTitle).sndButtonId(
dialogId).sndButtonTitle(sndBtnTitle).sndButtonId(sndBtnId).title(title).build();
messageErrorBar = new MessageToolbar(images, errorLabelId);
- tabPanel = new DecoratedTabPanel();
+ tabPanel = new TabLayoutPanel(25, Unit.PX);
provCollection.createAll();
- tabPanel.getDeckPanel().setSize(String.valueOf(width), String.valueOf(height));
+ tabPanel.setSize(String.valueOf(width), String.valueOf(height));
dialog.getInnerPanel().add(tabPanel);
+ tabPanel.addStyleName("k-tabpanel-aditionalpadding");
+ tabPanel.addStyleName("k-tabs");
dialog.getFirstBtn().addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
@@ -187,6 +193,7 @@
public void insertTab(final IsWidget tab, final IsWidget tabTitle, final int index) {
createDialogIfNecessary();
tabPanel.insert(tab, tabTitle, index);
+ setPositions();
}
public boolean isVisible() {
@@ -214,6 +221,25 @@
}
}
+ // private void setPosition(final IsWidget widget) {
+ // // DOM.setStyleAttribute(widget.asWidget().getElement(), "position",
+ // // "relative");
+ // //
+ // (widget.asWidget()).getParent().getElement().getStyle().setPosition(Position.RELATIVE);
+ // }
+
+ private void setPositions() {
+ for (int i = 0; i < tabPanel.getWidgetCount(); i++) {
+ final Widget widget = tabPanel.getWidget(i);
+ DOM.setStyleAttribute(widget.getElement(), "position", "relative");
+
+ final Element parent = DOM.getParent(widget.getElement());
+ DOM.setStyleAttribute(parent, "overflowX", "visible");
+ DOM.setStyleAttribute(parent, "overflowY", "visible");
+ DOM.setStyleAttribute(parent, "position", "relative");
+ }
+ }
+
public void setTitle(final String title) {
this.title = title;
if (dialog != null) {
Modified: trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml 2011-09-01 03:36:23 UTC (rev 1501)
@@ -5,21 +5,22 @@
<!-- excluding test sources for this module workaround for open issue 4454
see http://code.google.com/p/google-web-toolkit/issues/detail?id=4454 -->
<source path='client'
- excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
- <source path="shared" />
- <public path="public" />
+ excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java"/>
+ <source path="shared"/>
+ <public path="public"/>
<!-- Dependencies ============================================= -->
- <inherits name="com.google.gwt.user.User" />
- <inherits name="com.google.gwt.xml.XML" />
- <inherits name="cc.kune.gspace.GSpace" />
- <inherits name="cc.kune.msgs.KuneMsgs" />
- <inherits name="cc.kune.common.KuneCommon" />
+ <inherits name="com.google.gwt.user.User"/>
+ <inherits name="com.google.gwt.xml.XML"/>
+ <inherits name="cc.kune.gspace.GSpace"/>
+ <inherits name="cc.kune.msgs.KuneMsgs"/>
+ <inherits name="cc.kune.common.KuneCommon"/>
<!-- Because of XML actions -->
- <inherits name='com.calclab.emite.core.EmiteCore' />
- <inherits name="com.extjs.gxt.ui.GXT" />
-<!-- <inherits name="com.jhickman.web.gwt.gxtuibinder.GxtUiBinder" />-->
- <inherits name="com.calclab.suco.Suco" />
- <inherits name='com.gwtplatform.mvp.Mvp' />
+ <inherits name='com.calclab.emite.core.EmiteCore'/>
+ <inherits name="com.extjs.gxt.ui.GXT"/>
+ <!-- <inherits name="com.jhickman.web.gwt.gxtuibinder.GxtUiBinder" /> -->
+ <inherits name="com.calclab.suco.Suco"/>
+ <inherits name='com.gwtplatform.mvp.Mvp'/>
+ <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/>
<!-- Styles =================================================== -->
<!-- <inherits name="com.google.gwt.user.theme.standard.Standard" /> -->
</module>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -79,6 +79,9 @@
@Source("arrow-right-white.gif")
ImageResource arrowRightWhite();
+ @Source("arrow-undo.png")
+ ImageResource arrowUndo();
+
@Source("arrow-up-green.png")
ImageResource arrowUpGreen();
@@ -316,6 +319,9 @@
@Source("content_edit.png")
ImageResource contentEdit();
+ @Source("copy.png")
+ ImageResource copy();
+
@Source("copyleft.png")
ImageResource copyleft();
Added: trunk/src/main/java/cc/kune/core/client/resources/arrow-undo.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/arrow-undo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/core/client/resources/copy.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/copy.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/core/public/ws.css 2011-09-01 03:36:23 UTC (rev 1501)
@@ -1,6 +1,4 @@
-CHARSET "UTF-8 ";
-
-body {
+CHARSET "UTF-8 "; body {
background-color: transparent;
color: black;
font-family: 'Ubuntu', Arial;
@@ -923,13 +921,13 @@
outline: 0 none;
}
-button[disabled]:active,button[disabled],input[type="reset"][disabled]:active,input[type="reset"][disabled],input[type="button"][disabled]:active,input[type="button"][disabled],select[disabled]>input[type="button"],select[disabled]>input[type="button"]:active,input[type="submit"][disabled]:active,input[type="submit"][disabled],.k-button-disabled, button.k-button-disabled
+button[disabled]:active,button[disabled],input[type="reset"][disabled]:active,input[type="reset"][disabled],input[type="button"][disabled]:active,input[type="button"][disabled],select[disabled]>input[type="button"],select[disabled]>input[type="button"]:active,input[type="submit"][disabled]:active,input[type="submit"][disabled],.k-button-disabled,button.k-button-disabled
{
color: gray !important;
border-color: #CCCCCC !important;
background: inherits !important;
- kfilter: alpha(opacity = 60
- ) !important;
+ kfilter: alpha(opacity =
+ 60) !important;
-moz-opacity: 0.60 !important;
-khtml-opacity: 0.60 !important;
opacity: 0.60 !important;
@@ -1214,8 +1212,8 @@
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-left-radius: 5px;
- kfilter: alpha(opacity = 90
- );
+ kfilter: alpha(opacity =
+ 90);
-moz-opacity: 0.90;
-khtml-opacity: 0.90;
opacity: 0.90;
@@ -1434,8 +1432,7 @@
border-radius: 4px;
}
-button.k-drop-allowed-hover,
-.k-drop-allowed-hover {
+button.k-drop-allowed-hover,.k-drop-allowed-hover {
border: dashed 2px #3a9fd6 !important;
}
@@ -1478,4 +1475,32 @@
.k-i18n-recommend {
border: 1px solid gray;
background-color: #F2F2F2;
+}
+
+.k-tabs .gwt-TabLayoutPanelTab {
+ background-color: #d38d5f;
+ color: #552200;
+ height: 20px !important;
+ margin: 0 2px;
+ padding: 2px;
+ cursor: pointer;
+ font-weight: bold;
+}
+
+.k-tabs .gwt-TabLayoutPanelTab-selected {
+ background-color: #552200;
+ color: #FFF;
+}
+
+.k-tabpanel-aditionalpadding {
+ padding-bottom: 27px !important;
+}
+
+.k-tabs .gwt-TabLayoutPanel, .k-tabs .gwt-TabLayoutPanelTab {
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+ border-top-right-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ border-top-left-radius: 5px;
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/domain/Group.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/Group.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/domain/Group.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -317,6 +317,6 @@
@Override
public String toString() {
- return "Group[" + shortName + "]";
+ return "Group[" + shortName + ", " + hashCode() + "]";
}
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/domain/GroupList.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/GroupList.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/domain/GroupList.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -82,7 +82,10 @@
case EVERYONE:
return true;
default:
- return list.contains(group);
+ // Workaround for:
+ // http://www.timo-ernst.net/2011/06/remove-and-contains-not-working-on-your-java-set/
+ return new HashSet<Group>(list).contains(group);
+ // return list.contains(group);
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -126,6 +126,7 @@
@Override
public void enableCenterScroll(final boolean enable) {
+ // TODO use here Element.getStyle()...
if (enable) {
centerScroll.setAlwaysShowScrollBars(false);
DOM.setStyleAttribute(centerScroll.getElement(), "position", "absolute");
Added: trunk/src/main/java/cc/kune/gspace/client/i18n/CwCellList.java.txt
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/CwCellList.java.txt (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/CwCellList.java.txt 2011-09-01 03:36:23 UTC (rev 1501)
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.showcase.client.content.cell;
+
+import com.google.gwt.cell.client.AbstractCell;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.i18n.client.Constants;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.cellview.client.CellList;
+import com.google.gwt.user.cellview.client.HasKeyboardPagingPolicy.KeyboardPagingPolicy;
+import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSelectionPolicy;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.view.client.SelectionChangeEvent;
+import com.google.gwt.view.client.SingleSelectionModel;
+import com.sun.corba.se.pept.transport.ContactInfo;
+
+public class CwCellList extends ContentWidget {
+
+ /**
+ * The UiBinder interface used by this example.
+ */
+ interface Binder extends UiBinder<Widget, CwCellList> {
+ }
+
+ /**
+ * The Cell used to render a {@link ContactInfo}.
+ */
+ static class ContactCell extends AbstractCell<ContactInfo> {
+
+ /**
+ * The html of the image used for contacts.
+ */
+ private final String imageHtml;
+
+ public ContactCell(final ImageResource image) {
+ this.imageHtml = AbstractImagePrototype.create(image).getHTML();
+ }
+
+ @Override
+ public void render(final Context context, final ContactInfo value, final SafeHtmlBuilder sb) {
+ // Value can be null, so do a null check..
+ if (value == null) {
+ return;
+ }
+
+ sb.appendHtmlConstant("<table>");
+
+ // Add the contact image.
+ sb.appendHtmlConstant("<tr><td rowspan='3'>");
+ sb.appendHtmlConstant(imageHtml);
+ sb.appendHtmlConstant("</td>");
+
+ // Add the name and address.
+ sb.appendHtmlConstant("<td style='font-size:95%;'>");
+ sb.appendEscaped(value.getFullName());
+ sb.appendHtmlConstant("</td></tr><tr><td>");
+ sb.appendEscaped(value.getAddress());
+ sb.appendHtmlConstant("</td></tr></table>");
+ }
+ }
+
+ /**
+ * The constants used in this Content Widget.
+ */
+ public static interface CwConstants extends Constants {
+ String cwCellListDescription();
+
+ String cwCellListName();
+ }
+
+ /**
+ * The images used for this example.
+ */
+ static interface Images extends ClientBundle {
+ ImageResource contact();
+ }
+
+ /**
+ * The CellList.
+ */
+ private CellList<ContactInfo> cellList;
+
+ /**
+ * The contact form used to update contacts.
+ */
+ @UiField
+ I18nTranslatorForm contactForm;
+
+ /**
+ * The pager used to change the range of data.
+ */
+ @UiField
+ ShowMorePagerPanel pagerPanel;
+
+ /**
+ * The pager used to display the current range.
+ */
+ @UiField
+ RangeLabelPager rangeLabelPager;
+
+ /**
+ * Constructor.
+ *
+ * @param constants
+ * the constants
+ */
+ public CwCellList(final CwConstants constants) {
+ super(constants.cwCellListName(), constants.cwCellListDescription(), false, "ContactDatabase.java",
+ "CwCellList.ui.xml", "ContactInfoForm.java", "ShowMorePagerPanel.java", "RangeLabelPager.java");
+ }
+
+ @Override
+ protected void asyncOnInitialize(final AsyncCallback<Widget> callback) {
+ GWT.runAsync(CwCellList.class, new RunAsyncCallback() {
+
+ @Override
+ public void onFailure(final Throwable caught) {
+ callback.onFailure(caught);
+ }
+
+ @Override
+ public void onSuccess() {
+ callback.onSuccess(onInitialize());
+ }
+ });
+ }
+
+ /**
+ * Initialize this example.
+ */
+ @Override
+ public Widget onInitialize() {
+ final Images images = GWT.create(Images.class);
+
+ // Create a CellList.
+ final ContactCell contactCell = new ContactCell(images.contact());
+
+ // Set a key provider that provides a unique key for each contact. If key is
+ // used to identify contacts when fields (such as the name and address)
+ // change.
+ cellList = new CellList<ContactInfo>(contactCell, ContactDatabase.ContactInfo.KEY_PROVIDER);
+ cellList.setPageSize(30);
+ cellList.setKeyboardPagingPolicy(KeyboardPagingPolicy.INCREASE_RANGE);
+ cellList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.BOUND_TO_SELECTION);
+
+ // Add a selection model so we can select cells.
+ final SingleSelectionModel<ContactInfo> selectionModel = new SingleSelectionModel<ContactInfo>(
+ ContactDatabase.ContactInfo.KEY_PROVIDER);
+ cellList.setSelectionModel(selectionModel);
+ selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
+ @Override
+ public void onSelectionChange(final SelectionChangeEvent event) {
+ contactForm.setContact(selectionModel.getSelectedObject());
+ }
+ });
+
+ // Create the UiBinder.
+ final Binder uiBinder = GWT.create(Binder.class);
+ final Widget widget = uiBinder.createAndBindUi(this);
+
+ // Add the CellList to the data provider in the database.
+ ContactDatabase.get().addDataDisplay(cellList);
+
+ // Set the cellList as the display of the pagers. This example has two
+ // pagers. pagerPanel is a scrollable pager that extends the range when the
+ // user scrolls to the bottom. rangeLabelPager is a pager that displays the
+ // current range, but does not have any controls to change the range.
+ pagerPanel.setDisplay(cellList);
+ rangeLabelPager.setDisplay(cellList);
+
+ return widget;
+ }
+}
Added: trunk/src/main/java/cc/kune/gspace/client/i18n/CwCellList.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/CwCellList.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/CwCellList.ui.xml 2011-09-01 03:36:23 UTC (rev 1501)
@@ -0,0 +1,51 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder
+ xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui"
+ xmlns:c='urn:import:com.google.gwt.user.cellview.client'
+ xmlns:s="urn:import:cc.kune.gspace.client.i18n">
+
+ <ui:style>
+ .scrollable {
+ height: 400px;
+ width: 250px;
+ border: 1px solid #ccc;
+ text-align: left;
+ }
+
+ .contactFormCell {
+ padding-left: 20px;
+ }
+ </ui:style>
+
+ <g:HTMLPanel>
+ <table>
+ <tr>
+ <td
+ valign='top'
+ align='center'>
+ <s:ShowMorePagerPanel
+ addStyleNames='{style.scrollable}'
+ ui:field='pagerPanel' />
+ <s:RangeLabelPager
+ ui:field='rangeLabelPager' />
+ </td>
+ <td
+ class='{style.contactFormCell}'
+ valign='top'
+ align='center'>
+ <s:I18nTranslatorForm
+ ui:field='contactForm' />
+ <br />
+ </td>
+ </tr>
+ <tr>
+ <td
+ align='center'>
+ <s:ShowMorePagerPanel
+ ui:field='pager' />
+ </td>
+ </tr>
+ </table>
+ </g:HTMLPanel>
+</ui:UiBinder>
Added: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package cc.kune.gspace.client.i18n;
+
+import cc.kune.common.client.tooltip.Tooltip;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.HasBlurHandlers;
+import com.google.gwt.event.dom.client.HasKeyPressHandlers;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.TextArea;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * A form used for editing contacts.
+ */
+public class I18nTranslatorForm extends Composite {
+
+ interface Binder extends UiBinder<Widget, I18nTranslatorForm> {
+ }
+
+ private static Binder uiBinder = GWT.create(Binder.class);
+
+ @UiField
+ Image copyIcon;
+ @UiField
+ Label noteForTranslators;
+ @UiField
+ Label toTranslate;
+ @UiField
+ TextArea translation;
+
+ public I18nTranslatorForm() {
+ initWidget(uiBinder.createAndBindUi(this));
+ Tooltip.to(copyIcon, "FIXME");
+ }
+
+ public HasBlurHandlers getBlurTraslation() {
+ return translation;
+ }
+
+ public HasKeyPressHandlers getKeysTraslation() {
+ return translation;
+ }
+
+ @UiHandler("copyIcon")
+ void handleClickOnCopyIcon(final ClickEvent e) {
+ translation.setText(toTranslate.getText());
+ }
+
+ public void setInfo(final String toTranslate, final String noteForTranslators, final String translation) {
+ this.toTranslate.setText(toTranslate);
+ this.noteForTranslators.setText(noteForTranslators);
+ this.translation.setText(translation);
+ }
+}
Added: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.ui.xml 2011-09-01 03:36:23 UTC (rev 1501)
@@ -0,0 +1,54 @@
+<!DOCTYPE ui:UiBinder SYSTEM 'http://dl.google.com/gwt/DTD/xhtml.ent'>
+<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
+ xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:d='urn:import:com.google.gwt.user.datepicker.client'
+ ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'
+ ui:generateLocales='default'>
+
+ <ui:with field='res' type='cc.kune.core.client.resources.CoreResources' />
+
+ <ui:style>
+ .titles {
+ font-size: bold;
+ text-align: right;
+ padding-right: 10px;
+ vertical-align: top;
+ }
+
+ .table {
+ display: table;
+ }
+
+ .copyicon {
+ vertical-align: top;
+ }
+
+ .row {
+ display: table-row;
+ margin: 5px 5px 15px 5px;
+ }
+
+ .cell {
+ display: table-cell;
+ margin: 5px;
+ }
+ </ui:style>
+ <g:FlowPanel addStyleNames="{style.table}">
+ <g:FlowPanel addStyleNames="{style.row}">
+ <g:Label ui:field="toTranslateTitle" addStyleNames="{style.titles} {style.cell}"
+ text="translate this:" />
+ <g:Label ui:field="toTranslate" addStyleNames="{style.cell}" />
+ </g:FlowPanel>
+ <g:FlowPanel addStyleNames="{style.row}">
+ <g:Label ui:field="toLanguageTitle" addStyleNames="{style.titles} {style.cell}"
+ text="to Spanish:" />
+ <g:TextArea ui:field='translation' addStyleNames="{style.cell}" />
+ <g:Image ui:field="copyIcon" addStyleNames="{style.cell} {style.copyicon}"
+ resource='{res.arrowUndo}' />
+ </g:FlowPanel>
+ <g:FlowPanel addStyleNames="{style.row}">
+ <g:Label ui:field="noteForTranslatorsTittle" text="Note:"
+ addStyleNames="{style.titles} {style.cell}" />
+ <g:Label ui:field="noteForTranslators" addStyleNames="{style.cell}" />
+ </g:FlowPanel>
+ </g:FlowPanel>
+</ui:UiBinder>
Added: trunk/src/main/java/cc/kune/gspace/client/i18n/RangeLabelPager.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/RangeLabelPager.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/RangeLabelPager.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package cc.kune.gspace.client.i18n;
+
+import com.google.gwt.i18n.client.HasDirection;
+import com.google.gwt.user.cellview.client.AbstractPager;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.view.client.HasRows;
+import com.google.gwt.view.client.Range;
+
+/**
+ * A pager that displays the current range without any controls to change the
+ * range.
+ */
+public class RangeLabelPager extends AbstractPager {
+
+ /**
+ * The label that shows the current range.
+ */
+ private final HTML label = new HTML();
+
+ /**
+ * Construct a new {@link RangeLabelPager}.
+ */
+ public RangeLabelPager() {
+ initWidget(label);
+ }
+
+ @Override
+ protected void onRangeOrRowCountChanged() {
+ final HasRows display = getDisplay();
+ final Range range = display.getVisibleRange();
+ final int start = range.getStart();
+ final int end = start + range.getLength();
+ label.setText(start + " - " + end + " : " + display.getRowCount(), HasDirection.Direction.LTR);
+ }
+}
Added: trunk/src/main/java/cc/kune/gspace/client/i18n/ShowMorePagerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/ShowMorePagerPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/ShowMorePagerPanel.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package cc.kune.gspace.client.i18n;
+
+import com.google.gwt.event.dom.client.ScrollEvent;
+import com.google.gwt.event.dom.client.ScrollHandler;
+import com.google.gwt.user.cellview.client.AbstractPager;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.view.client.HasRows;
+
+/**
+ * A scrolling pager that automatically increases the range every time the
+ * scroll bar reaches the bottom.
+ */
+public class ShowMorePagerPanel extends AbstractPager {
+
+ /**
+ * The default increment size.
+ */
+ private static final int DEFAULT_INCREMENT = 20;
+
+ /**
+ * The increment size.
+ */
+ private int incrementSize = DEFAULT_INCREMENT;
+
+ /**
+ * The last scroll position.
+ */
+ private int lastScrollPos = 0;
+
+ /**
+ * The scrollable panel.
+ */
+ private final ScrollPanel scrollable = new ScrollPanel();
+
+ /**
+ * Construct a new {@link ShowMorePagerPanel}.
+ */
+ public ShowMorePagerPanel() {
+ initWidget(scrollable);
+
+ // Do not let the scrollable take tab focus.
+ scrollable.getElement().setTabIndex(-1);
+
+ // Handle scroll events.
+ scrollable.addScrollHandler(new ScrollHandler() {
+ public void onScroll(ScrollEvent event) {
+ // If scrolling up, ignore the event.
+ int oldScrollPos = lastScrollPos;
+ lastScrollPos = scrollable.getScrollPosition();
+ if (oldScrollPos >= lastScrollPos) {
+ return;
+ }
+
+ HasRows display = getDisplay();
+ if (display == null) {
+ return;
+ }
+ int maxScrollTop = scrollable.getWidget().getOffsetHeight()
+ - scrollable.getOffsetHeight();
+ if (lastScrollPos >= maxScrollTop) {
+ // We are near the end, so increase the page size.
+ int newPageSize = Math.min(
+ display.getVisibleRange().getLength() + incrementSize,
+ display.getRowCount());
+ display.setVisibleRange(0, newPageSize);
+ }
+ }
+ });
+ }
+
+ /**
+ * Get the number of rows by which the range is increased when the scrollbar
+ * reaches the bottom.
+ *
+ * @return the increment size
+ */
+ public int getIncrementSize() {
+ return incrementSize;
+ }
+
+ @Override
+ public void setDisplay(HasRows display) {
+ assert display instanceof Widget : "display must extend Widget";
+ scrollable.setWidget((Widget) display);
+ super.setDisplay(display);
+ }
+
+ /**
+ * Set the number of rows by which the range is increased when the scrollbar
+ * reaches the bottom.
+ *
+ * @param incrementSize the incremental number of rows
+ */
+ public void setIncrementSize(int incrementSize) {
+ this.incrementSize = incrementSize;
+ }
+
+ @Override
+ protected void onRangeOrRowCountChanged() {
+ }
+}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPanel.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPanel.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -28,6 +28,7 @@
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
+import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.google.gwt.event.dom.client.ChangeHandler;
@@ -92,8 +93,15 @@
final Field field : super.getFormPanel().getFields()) {
// field.addListener(Events.Change, listener);
field.addListener(Events.Blur, listener);
+ field.addListener(Events.OnKeyPress, new Listener<FieldEvent>() {
+ @Override
+ public void handleEvent(final FieldEvent fe) {
+ if (fe.getEvent().getKeyCode() == 13) {
+ changeHandler.onChange(null);
+ }
+ }
+ });
}
-
}
@Override
Modified: trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css 2011-09-01 03:36:23 UTC (rev 1501)
@@ -214,7 +214,7 @@
}
.entityToolsCenter span {
- font-size: 26px;
+ font-size: 22px;
font-weight: bold;
}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -266,6 +266,7 @@
final StateContainerDTO stateContainer = (StateContainerDTO) state;
getView().setContainer(stateContainer);
final AccessRights rights = stateContainer.getContainerRights();
+ // NotifyUser.info("Rights: " + rights, true);
final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContainer.getGroup(),
stateContainer.getTypeId(), session.isLogged(), rights, ActionGroups.TOOLBAR);
final ContainerDTO container = stateContainer.getContainer();
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -49,14 +49,17 @@
interface MessageUiBinder extends UiBinder<Widget, UserMessage> {
}
+
public interface MsgTemplate extends SafeHtmlTemplates {
@Template("<span>{0}</span>")
SafeHtml format(SafeHtml message);
}
+
public interface MsgWithTitleTemplate extends SafeHtmlTemplates {
- @Template("<span><b>{0}</b><br/><p>{1}</p></span>")
+ @Template("<span><span class=\"k-msg-title\">{0}</span><p>{1}</p></span>")
SafeHtml format(SafeHtml title, SafeHtml message);
}
+
private static String closeTitle = "Close";
private static int fadeMills = 5000;
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessagesPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessagesPanel.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessagesPanel.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -23,9 +23,12 @@
import cc.kune.msgs.client.UserMessagesPresenter.UserMessagesView;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.logical.shared.AttachEvent;
+import com.google.gwt.event.logical.shared.AttachEvent.Handler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -36,7 +39,9 @@
private static MessagesPanelUiBinder uiBinder = GWT.create(MessagesPanelUiBinder.class);
@UiField
- VerticalPanel vp;
+ FlowPanel bottom;
+ @UiField
+ VerticalPanel panel;
public UserMessagesPanel() {
initWidget(uiBinder.createAndBindUi(this));
@@ -46,6 +51,17 @@
public void add(final NotifyLevel level, final String title, final String message, final String id,
final boolean closeable, final CloseCallback closeCallback) {
final UserMessage msg = new UserMessage(level, title, message, id, closeable, closeCallback);
- vp.add(msg);
+ panel.add(msg);
+ if (panel.getWidgetCount() == 2) {
+ bottom.setVisible(true);
+ }
+ msg.addAttachHandler(new Handler() {
+ @Override
+ public void onAttachOrDetach(final AttachEvent event) {
+ if (!event.isAttached() && panel.getWidgetCount() == 1) {
+ bottom.setVisible(false);
+ }
+ }
+ });
}
}
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessagesPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessagesPanel.ui.xml 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessagesPanel.ui.xml 2011-09-01 03:36:23 UTC (rev 1501)
@@ -1,9 +1,13 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
- <g:VerticalPanel verticalAlignment="ALIGN_TOP"
- ui:field="vp" width="100%" height=""
- addStyleNames="k-msg-panel, k-box-10shadow, k-top-10corners"
+ <g:VerticalPanel verticalAlignment="ALIGN_TOP" width="100%"
+ height="" addStyleNames="k-msg-panel, k-box-10shadow, k-top-10corners"
spacing="10">
+ <g:VerticalPanel ui:field="panel" width="100%"
+ height="">
+ </g:VerticalPanel>
+ <g:FlowPanel ui:field="bottom" visible="false"
+ addStyleNames="k-msg-panel-bottom"/>
</g:VerticalPanel>
</ui:UiBinder>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/msgs/public/kune-message.css
===================================================================
--- trunk/src/main/java/cc/kune/msgs/public/kune-message.css 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/main/java/cc/kune/msgs/public/kune-message.css 2011-09-01 03:36:23 UTC (rev 1501)
@@ -1,33 +1,38 @@
.k-msg-panel {
- background-color: #892c00;
- border-collapse: separate;
- border-spacing: 15px 8px;
+ background-color: #892c00;
+ border-collapse: separate !important;
}
-.k-msg-panel-title {
- color: #ffe9da;
- font-weight: bold;
- margin-bottom: 10px;
+.k-msg-panel table {
}
+.k-msg-panel-bottom {
+ margin-bottom: 8px;
+}
+
.k-msg {
- border: solid 1px #F2F2F2;
- background: #fff0e6;
- color: #280b0b;
- border-collapse: separate;
- border-spacing: 0px;
+ border: solid 1px #F2F2F2;
+ background: #fff0e6;
+ color: #280b0b;
+ margin: 8px 8px 0;
+ width: auto;
}
+.k-msg-title {
+ font-weight: bold;
+ margin-bottom: 8px;
+}
+
.k-msg-close {
- position: relative;
- right: -14px;
- top: 0px;
+ position: relative;
+ right: -14px;
+ top: 0px;
}
.k-msg-icon {
- padding: 10px 10px 5px;
+ padding: 10px 10px 5px;
}
.k-msg-label {
- font-size: 16px;
+ font-size: 16px;
}
\ No newline at end of file
Modified: trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -22,6 +22,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.Iterator;
@@ -36,6 +37,7 @@
import cc.kune.core.client.errors.GroupLongNameInUseException;
import cc.kune.core.client.errors.GroupShortNameInUseException;
import cc.kune.core.client.errors.SessionExpiredException;
+import cc.kune.core.client.rpcservices.ContentService;
import cc.kune.core.client.rpcservices.UserService;
import cc.kune.core.server.integration.IntegrationTest;
import cc.kune.core.server.integration.IntegrationTestHelper;
@@ -46,10 +48,13 @@
import cc.kune.core.server.users.UserInfo;
import cc.kune.core.server.users.UserInfoService;
import cc.kune.core.shared.domain.UserSNetVisibility;
+import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.core.shared.dto.I18nCountryDTO;
import cc.kune.core.shared.dto.I18nLanguageDTO;
import cc.kune.core.shared.dto.SocialNetworkDataDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.core.shared.dto.SubscriptionMode;
import cc.kune.core.shared.dto.TimeZoneDTO;
import cc.kune.core.shared.dto.UserDTO;
@@ -60,6 +65,8 @@
import com.google.inject.persist.UnitOfWork;
public class UserServiceTest extends IntegrationTest {
+ @Inject
+ ContentService contentService;
private I18nCountryDTO country;
@Inject
I18nLanguageManager i18nLangManager;
@@ -115,6 +122,22 @@
userService.createUser(user, false);
}
+ @Test
+ public void createUserShouldPermitEditOfSelfHomepage() throws Exception {
+ assertNull(session.getUser().getId());
+ final UserDTO user = new UserDTO("test", "test", "123456", "example1234 at example.com", lang, country,
+ timezone, null, true, SubscriptionMode.manual, "blue");
+ userService.createUser(user, true);
+ doLogin("test", "123456");
+ final StateAbstractDTO homepage = contentService.getContent(getHash(), new StateToken("test"));
+ assertTrue(homepage.getGroupRights().isAdministrable());
+ assertTrue(homepage.getGroupRights().isEditable());
+ assertTrue(((StateContentDTO) homepage).getContentRights().isAdministrable());
+ assertTrue(((StateContentDTO) homepage).getContentRights().isEditable());
+ assertTrue(((StateContentDTO) homepage).getContainerRights().isAdministrable());
+ assertTrue(((StateContentDTO) homepage).getContainerRights().isEditable());
+ }
+
@Before
public void init() {
new IntegrationTestHelper(this);
Modified: trunk/src/test/java/cc/kune/core/server/manager/GroupManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/manager/GroupManagerDefaultTest.java 2011-08-30 08:04:22 UTC (rev 1500)
+++ trunk/src/test/java/cc/kune/core/server/manager/GroupManagerDefaultTest.java 2011-09-01 03:36:23 UTC (rev 1501)
@@ -189,4 +189,13 @@
assertEquals(4, result2.getList().size());
rollbackTransaction();
}
+
+ @Test
+ public void sameGroupHasSameHash() throws Exception {
+ final Group group1 = new Group("ysei", "Yellow Submarine Environmental Initiative", defLicense,
+ GroupType.PROJECT);
+ final Group group2 = new Group("ysei", "", defLicense, GroupType.PROJECT);
+ assertEquals(group1, group2);
+ assertEquals(group1.hashCode(), group2.hashCode());
+ }
}
More information about the kune-commits
mailing list