Child: [85c2d9] (diff)

Download this file

DocumentService.java    72 lines (61 with data), 2.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package de.kuei.metafora.gwt.smack.client.documents;
import java.util.List;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import de.kuei.metafora.gwt.smack.shared.DocStructure;
import de.kuei.metafora.gwt.smack.shared.ThinDocStructure;
@RemoteServiceRelativePath("documents")
public interface DocumentService extends RemoteService {
/**
* This Method gets all documents with their complete "data" from the
* CouchDB thus causing a lot of traffic. A combination of getIdToNames()
* and getDocument(String) should therefore be preferred
*
* @return DocStructures of all the documents in the couchDB
*/
public DocStructure[] getDocIds();
/**
* Sets the attribute with this key of the Document with the given docId to
* this value
*
* @param docId
* ID of the Document in the couchDB
* @param key
* key of the attribute
* @param value
* value to which the attribute is to be set
*/
public void setAttribute(String docId, String key, String value);
/**
* gets the Revisions of the Document with the specified ID from the couchDB
*
* @param fileId
* ID of the Document in the couchDB
* @return String-Array with the Revisions or null, if the Document could
* not be found in the couchDB
*/
public String[] getRevisions(String docId);
/**
* This method gets the servers representation of the Documents in the
* couchDB
*
* @return An ArrayList-Object as described
*/
public List<ThinDocStructure> getIdToNames();
/**
* Gets the Document with the specified ID from the CouchDB
*
* @param id
* ID of the document
* @return The Document from the CouchDB
*/
public DocStructure getDocument(String id);
/**
* Gets the ThinDocStructure of the document with the specified ID
*
* @param id
* ID of the Document
* @return ThinDocStructure of the document
*/
public ThinDocStructure getThinDocument(String id);
}