Switch to unified view

a b/Workbench/src/de/kuei/metafora/gwt/smack/shared/ThinDocStructure.java
1
package de.kuei.metafora.gwt.smack.shared;
2
3
import java.io.Serializable;
4
5
import com.google.gwt.user.client.rpc.IsSerializable;
6
7
public class ThinDocStructure implements Serializable, IsSerializable {
8
  /**
9
   * This class represents a document in the couchDB and serves the transport
10
   * of information about the corresponding document in the couchDB from the
11
   * server to the client
12
   */
13
  private static final long serialVersionUID = -2390885606058308353L;
14
  private String urlPrefix = "workbench/development/fileupload?id=";
15
16
  String docname;
17
  String url;
18
  String docId;
19
  String time;
20
  
21
  public ThinDocStructure(){
22
      
23
  }
24
  
25
26
  public ThinDocStructure(String server) {
27
      urlPrefix = server+urlPrefix;
28
  }
29
30
  /**
31
   * Creates a ThinDocStructure with this ID, name and time
32
   * 
33
   * @param docId
34
   *            ID of the document
35
   * @param docname
36
   *            filename of the document
37
   * @param time
38
   *            time stamp of the document
39
   */
40
  public ThinDocStructure(String docId, String docname, String time, String server) {
41
      urlPrefix = server+urlPrefix;
42
      
43
      this.docId = docId;
44
      this.docname = docname;
45
      url = urlPrefix + docId;
46
      this.time = time;
47
  }
48
49
  public String getDocname() {
50
      return docname;
51
  }
52
53
  public void setDocname(String docname) {
54
      this.docname = docname;
55
  }
56
57
  public String getUrl() {
58
      return url;
59
  }
60
61
  private void setUrl(String id) {
62
      this.url = urlPrefix + id;
63
  }
64
65
  public String getDocId() {
66
      return docId;
67
  }
68
69
  /**
70
   * Sets the docId of this ThinDocStructure and updates its URL
71
   * 
72
   * @param docId
73
   *            the ID of the document
74
   */
75
  public void setDocId(String docId) {
76
      this.docId = docId;
77
      setUrl(docId);
78
  }
79
80
  public String getTime() {
81
      return time;
82
  }
83
84
  public void setTime(String time) {
85
      this.time = time;
86
  }
87
88
}