Don't use Strings to hold primary key values.
[online-glom:gwt-glom.git] / src / main / java / org / glom / web / client / OnlineGlomServiceAsync.java
1 /*
2  * Copyright (C) 2011 Openismus GmbH
3  *
4  * This file is part of GWT-Glom.
5  *
6  * GWT-Glom is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * GWT-Glom is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
14  * for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with GWT-Glom.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 package org.glom.web.client;
21
22 import java.util.ArrayList;
23
24 import org.glom.web.shared.DataItem;
25 import org.glom.web.shared.DetailsLayoutAndData;
26 import org.glom.web.shared.DocumentInfo;
27 import org.glom.web.shared.Documents;
28 import org.glom.web.shared.NavigationRecord;
29 import org.glom.web.shared.PrimaryKeyItem;
30 import org.glom.web.shared.layout.LayoutGroup;
31
32 import com.google.gwt.core.client.GWT;
33 import com.google.gwt.user.client.rpc.AsyncCallback;
34
35 public interface OnlineGlomServiceAsync {
36
37         /**
38          * Utility class to get the RPC Async interface from client-side code
39          */
40         public static final class Util {
41                 private static OnlineGlomServiceAsync instance;
42
43                 public static final OnlineGlomServiceAsync getInstance() {
44                         if (instance == null) {
45                                 instance = (OnlineGlomServiceAsync) GWT.create(OnlineGlomService.class);
46                         }
47                         return instance;
48                 }
49
50                 private Util() {
51                         // Utility class should not be instantiated
52                 }
53         }
54
55         void getDocumentInfo(String documentID, AsyncCallback<DocumentInfo> callback);
56
57         void getListViewLayout(String documentID, String tableName, AsyncCallback<LayoutGroup> callback);
58
59         void getListViewData(String documentID, String tableName, int start, int length,
60                         AsyncCallback<ArrayList<DataItem[]>> callback);
61
62         void getSortedListViewData(String documentID, String tableName, int start, int length, int sortColumnIndex,
63                         boolean isAscending, AsyncCallback<ArrayList<DataItem[]>> callback);
64
65         void getDocuments(AsyncCallback<Documents> callback);
66
67         void isAuthenticated(String documentID, AsyncCallback<Boolean> callback);
68
69         void checkAuthentication(String documentID, String username, String password, AsyncCallback<Boolean> callback);
70
71         void getDetailsLayoutAndData(String documentID, String tableName, PrimaryKeyItem primaryKeyValue,
72                         AsyncCallback<DetailsLayoutAndData> callback);
73
74         void getDetailsData(String documentID, String tableName, PrimaryKeyItem primaryKeyValue,
75                         AsyncCallback<DataItem[]> callback);
76
77         void getRelatedListData(String documentID, String tableName, String relationshipName,
78                         PrimaryKeyItem foreignKeyValue, int start, int length, AsyncCallback<ArrayList<DataItem[]>> callback);
79
80         void getSortedRelatedListData(String documentID, String tableName, String relationshipName,
81                         PrimaryKeyItem foreignKeyValue, int start, int length, int sortColumnIndex, boolean ascending,
82                         AsyncCallback<ArrayList<DataItem[]>> callback);
83
84         void getRelatedListRowCount(String documentID, String tableName, String relationshipName,
85                         PrimaryKeyItem foreignKeyValue, AsyncCallback<Integer> callback);
86
87         void getSuitableRecordToViewDetails(String documentID, String tableName, String relationshipName,
88                         PrimaryKeyItem primaryKeyValue, AsyncCallback<NavigationRecord> callback);
89
90 }