You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by do...@apache.org on 2013/09/12 04:09:32 UTC

svn commit: r1522121 - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/activity/ client/src/main/java/org/apache/hupa/client/rf/ server/src/main/java/org/apache/hupa/server/domain/ widgets/src/main/java/org/apache/hupa/widgets/ui/

Author: dongxu
Date: Thu Sep 12 02:09:31 2013
New Revision: 1522121

URL: http://svn.apache.org/r1522121
Log:
get started to request factory

Added:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserProxy.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserRequest.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Identifiable.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Settings.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/User.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Versionable.java
Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java
    james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java?rev=1522121&r1=1522120&r2=1522121&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java Thu Sep 12 02:09:31 2013
@@ -457,17 +457,6 @@ public class IMAPMessageListActivity ext
 		this.placeController = placeController;
 		this.dispatcher = dispatcher;
 		this.messageSendPlaceProvider = messageSendPlaceProvider;
-		
-
-        // add this event on constructor because we don't want to remove it on unbind
-        eventBus.addHandler(LogoutEvent.TYPE, new LogoutEventHandler() {
-
-            public void onLogout(LogoutEvent logoutEvent) {
-            	IMAPMessageListActivity.this.display.reset();
-            	IMAPMessageListActivity.this.display.getSearchValue().setValue("");
-            }
-            
-        });
 	}
 	@Override
 	public void start(AcceptsOneWidget container, EventBus eventBus) {
@@ -477,6 +466,14 @@ public class IMAPMessageListActivity ext
 	}
 	
 	private void bind(){
+        eventBus.addHandler(LogoutEvent.TYPE, new LogoutEventHandler() {
+
+            public void onLogout(LogoutEvent logoutEvent) {
+            	IMAPMessageListActivity.this.display.reset();
+            	IMAPMessageListActivity.this.display.getSearchValue().setValue("");
+            }
+            
+        });
 		eventBus.addHandler(MessagesReceivedEvent.TYPE, new MessagesReceivedEventHandler() {
 
             public void onMessagesReceived(MessagesReceivedEvent event) {

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserProxy.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserProxy.java?rev=1522121&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserProxy.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserProxy.java Thu Sep 12 02:09:31 2013
@@ -0,0 +1,11 @@
+package org.apache.hupa.client.rf;
+
+import org.apache.hupa.server.domain.User;
+
+import com.google.web.bindery.requestfactory.shared.EntityProxy;
+import com.google.web.bindery.requestfactory.shared.ProxyFor;
+
+@ProxyFor(value = User.class)
+public interface UserProxy extends EntityProxy {
+
+}

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserRequest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserRequest.java?rev=1522121&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserRequest.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/UserRequest.java Thu Sep 12 02:09:31 2013
@@ -0,0 +1,11 @@
+package org.apache.hupa.client.rf;
+
+import org.apache.hupa.server.domain.User;
+
+import com.google.web.bindery.requestfactory.shared.RequestContext;
+import com.google.web.bindery.requestfactory.shared.Service;
+
+@Service(User.class)
+public interface UserRequest extends RequestContext {
+
+}

Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Identifiable.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Identifiable.java?rev=1522121&view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Identifiable.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Identifiable.java Thu Sep 12 02:09:31 2013
@@ -0,0 +1,5 @@
+package org.apache.hupa.server.domain;
+
+public interface Identifiable {
+  Long getId();
+}

Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Settings.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Settings.java?rev=1522121&view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Settings.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Settings.java Thu Sep 12 02:09:31 2013
@@ -0,0 +1,83 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you 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 org.apache.hupa.server.domain;
+
+import java.io.Serializable;
+
+public class Settings implements Serializable{
+
+    public static final String DEFAULT_INBOX = "INBOX"; 
+    public static final String DEFAULT_TRASH = "Trash"; 
+    public static final String DEFAULT_SENT = "Sent"; 
+    public static final String DEFAULT_DRAFT = "Draft"; 
+    
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -8051377307421345664L;
+    private String trashFolderName = DEFAULT_TRASH;
+    private String sentFolderName = DEFAULT_SENT;
+    private String inboxFolderName = DEFAULT_INBOX;
+    private String draftsFolderName = DEFAULT_DRAFT;
+    
+    private int prefetchCount = 20;
+    
+    public String getInboxFolderName() {
+        return inboxFolderName;
+    }
+    
+    public void setInboxFolderName(String inboxFolderName) {
+        this.inboxFolderName = inboxFolderName;
+    }
+    
+    public String getTrashFolderName() {
+        return trashFolderName;
+    }
+    
+    public void setTrashFolderName(String trashFolderName) {
+        this.trashFolderName = trashFolderName;
+    }
+    
+    public String getSentFolderName() {
+        return sentFolderName;
+    }
+    
+    public void setSentFolderName(String sentFolderName) {
+        this.sentFolderName = sentFolderName;
+    }
+    
+    public int getPostFetchMessageCount() {
+        return prefetchCount;
+    }
+    
+    public void setPostFetchMessageCount(int prefetchCount) {
+        this.prefetchCount  = prefetchCount;
+    }
+    
+    public String getDraftsFolderName() {
+        return draftsFolderName;
+    }
+
+    public void setDraftsFolderName(String draftFolderName) {
+        this.draftsFolderName = draftFolderName;
+    }
+
+    
+}

Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/User.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/User.java?rev=1522121&view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/User.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/User.java Thu Sep 12 02:09:31 2013
@@ -0,0 +1,152 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you 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 org.apache.hupa.server.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * User which will get used for login to the IMAP and SMTP account
+ * 
+ *
+ */
+public class User implements Identifiable, Versionable{
+    
+    private static final long serialVersionUID = -573674209289821920L;
+    private String name;
+    private String password;
+    private Date loginDate;
+    private boolean auth;
+    private Settings settings;
+	private Long id;
+	private Long version;
+    
+    
+    /**
+     * The name of the User
+     * 
+     * @param name
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Get name of the User
+     * 
+     * @return name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Set the Password of the User
+     * 
+     * @param password
+     */
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    /**
+     * Get the Password of the User
+     * 
+     * @return password
+     */
+    public String getPassword() {
+        return password;
+    }
+    
+    /*
+     * (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        return getName();
+    }
+    
+    /*
+     * (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals(Object object) {
+        if (object instanceof User) {
+            if (((User) object).getName().equals(getName())) {
+                return true;
+            }
+        }
+        return false;
+    }
+    
+    public int hashCode() {
+        return getName().hashCode();
+    }
+    /**
+     * Get the Date on which the User was logged in the last time
+     * 
+     * @return loginDate
+     */
+    public Date getLoginDate() {
+        return loginDate;
+    }
+
+    /**
+     * Set if the User was successful authenticated
+     * 
+     * @param auth
+     */
+    public void setAuthenticated(boolean auth) {
+        this.auth = auth;
+        if (auth) {
+            loginDate = new Date();
+        }
+    }
+
+    /**
+     * Get if the User was successful authenticated
+     * 
+     * @return auth
+     */
+    public boolean getAuthenticated() {
+        return auth;
+    }
+    
+    public void setSettings(Settings settings) {
+        this.settings = settings;
+    }
+    
+    public Settings getSettings() {
+        return settings;
+    }
+
+	@Override
+	public Long getVersion() {
+		return version;
+	}
+
+	@Override
+	public Long getId() {
+		return id;
+	}
+
+
+}

Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Versionable.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Versionable.java?rev=1522121&view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Versionable.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/Versionable.java Thu Sep 12 02:09:31 2013
@@ -0,0 +1,5 @@
+package org.apache.hupa.server.domain;
+
+public interface Versionable {
+  Long getVersion();
+}

Modified: james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java?rev=1522121&r1=1522120&r2=1522121&view=diff
==============================================================================
--- james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java (original)
+++ james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java Thu Sep 12 02:09:31 2013
@@ -57,10 +57,10 @@ public class PagingOptions extends Compo
     
     public PagingOptions(final PagingScrollTable<?> table, PagingOptionsConstants constants, Loading loading) {
         this.loading = loading;
-        firstLink = new EnableHyperlink("<< " + constants.pageFirst(),"");
-        prevLink = new EnableHyperlink("< " + constants.pagePrev(),"");
-        lastLink = new EnableHyperlink(constants.pageLast() + " >>","");
-        nextLink = new EnableHyperlink(constants.pageNext() + " >","");
+        firstLink = new EnableHyperlink("<< " + constants.pageFirst(),null);
+        prevLink = new EnableHyperlink("< " + constants.pagePrev(),null);
+        lastLink = new EnableHyperlink(constants.pageLast() + " >>",null);
+        nextLink = new EnableHyperlink(constants.pageNext() + " >",null);
         pagingPanel.setSpacing(3);
 
         pagingPanel.add(panel);



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org