2 * Copyright (C) 2010, 2011 Openismus GmbH
4 * This file is part of GWT-Glom.
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.
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
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/>.
20 package org.glom.web.client;
22 import java.util.ArrayList;
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.Reports;
30 import org.glom.web.shared.TypedDataItem;
31 import org.glom.web.shared.layout.LayoutGroup;
33 import com.google.gwt.user.client.rpc.RemoteService;
34 import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
36 @RemoteServiceRelativePath("libGlom")
37 public interface OnlineGlomService extends RemoteService {
39 DocumentInfo getDocumentInfo(String documentID, String localeID);
41 LayoutGroup getListViewLayout(String documentID, String tableName, final String localeID);
43 String getReportHTML(String documentID, String tableName, String reportName, String quickFind, String localeID);
46 * Retrieves data for a list view table.
49 * identifier for the Glom document
51 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
54 * the start index in the data result set from the SQL query that should be retrieved
56 * the number of rows of data to retrieve
57 * @return an {@link ArrayList} of {@link DataItem} arrays that represents the requested data
59 ArrayList<DataItem[]> getListViewData(String documentID, String tableName, String quickFind, int start, int length);
62 * Retrieves sorted data for a list view table.
65 * identifier for the Glom document
67 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
70 * the start index in the data result set from the SQL query that should be retrieved
72 * the number of rows of data to retrieve
73 * @param sortColumnIndex
74 * the index of the column to sort
76 * <code>true</code> if the column should be sorted in ascending order, <code>false</code> if the column
77 * should be sorted in descending order
78 * @return an {@link ArrayList} of {@link DataItem} arrays that represents the requested data
81 ArrayList<DataItem[]> getSortedListViewData(String documentID, String tableName, String quickFind, int start,
82 int length, int sortColumnIndex, boolean isAscending);
85 * Gets a list of Glom documents found in the configured directory.
87 * @return an {@link ArrayList<String>} of Glom document titles. If the list is empty, no glom documents were found
88 * in the configured directory because it's empty or the directory is not configured correctly.
90 Documents getDocuments();
93 * Checks if the PostgreSQL authentication has been set for this document.
96 * identifier for the Glom document
97 * @return true if the authentication has been set, false if it hasn't
99 boolean isAuthenticated(String documentID);
102 * Checks if the provided PostgreSQL username and password are correct for the specified glom document. If the
103 * information is correct it is saved for future access.
106 * identifier for the Glom document
108 * the PostgreSQL username
110 * the POstgreSQL password
111 * @return true if username and password are correct, false otherwise
113 boolean checkAuthentication(String documentID, String username, String password);
116 * Get a list of reports for the specified table.
119 * identifier for the Glom document
121 * name of the table in the Glom document.
123 * The locale for the table titles.
124 * @return The names and titles of the table's reports.
126 Reports getReportsList(String documentID, String tableName, String localeID);
129 * Gets data for the details view.
132 * identifier for the Glom document
134 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
136 * @param primaryKeyValue
137 * value of the primary key in the specified Glom table to use in the query
138 * @return the result of the SQL query as an array of {@link DataItem}s
140 DataItem[] getDetailsData(String documentID, String tableName, TypedDataItem primaryKeyValue);
143 * Gets a {@link DetailsLayoutAndData} object that contains the layout and data of the details view.
146 * identifier for the Glom document
148 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
150 * @param primaryKeyValue
151 * value of the primary key in the specified Glom table to use in the query
152 * @return a {@link DetailsLayoutAndData} object for the layout and initial data of the details view.
154 DetailsLayoutAndData getDetailsLayoutAndData(String documentID, String tableName, TypedDataItem primaryKeyValue,
155 final String localeID);
158 * Retrieves data for the related list table with the specified relationship name and foreign key value.
161 * identifier for the Glom document
163 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
165 * @param relationshipName
166 * name of the relationship to use for setting up the SQL query
168 * the start index in the data result set from the SQL query that should be retrieved
170 * the number of rows of data to retrieve
171 * @param foreignKeyValue
172 * the value of the foreign key
173 * @return an {@link ArrayList} of {@link DataItem} arrays that represents the requested data
175 ArrayList<DataItem[]> getRelatedListData(String documentID, String tableName, String relationshipName,
176 TypedDataItem foreignKeyValue, int start, int length);
179 * Retrieves sorted data for the related list table with the specified relationship name and foreign key value.
182 * identifier for the Glom document
184 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
186 * @param relationshipName
187 * name of the relationship to use for setting up the SQL query
188 * @param foreignKeyValue
189 * the value of the foreign key
191 * the start index in the data result set from the SQL query that should be retrieved
193 * the number of rows of data to retrieve
194 * @param sortColumnIndex
195 * the index of the column to sort
197 * <code>true</code> if the column should be sorted in ascending order, <code>false</code> if the column
198 * should be sorted in descending order
199 * @return an {@link ArrayList} of {@link DataItem} arrays that represents the requested data
201 ArrayList<DataItem[]> getSortedRelatedListData(String documentID, String tableName, String relationshipName,
202 TypedDataItem foreignKeyValue, int start, int length, int sortColumnIndex, boolean ascending);
205 * Gets the expected row count for the related list table with the specified relationship name and foreign key
209 * identifier for the Glom document
211 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
213 * @param relationshipName
214 * name of the relationship to use for setting up the SQL query
215 * @param foreignKeyValue
216 * the value of the foreign key
217 * @return the expected row count
219 int getRelatedListRowCount(String documentID, String tableName, String relationshipName,
220 TypedDataItem foreignKeyValue);
222 NavigationRecord getSuitableRecordToViewDetails(String documentID, String tableName, String relationshipName,
223 TypedDataItem primaryKeyValue);
225 String getConfigurationErrorMessage();