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.libglom.layout.LayoutGroup;
32 import org.glom.web.shared.libglom.layout.LayoutItemPortal;
34 import com.google.gwt.user.client.rpc.RemoteService;
35 import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
37 @RemoteServiceRelativePath("gwtGlom")
38 public interface OnlineGlomService extends RemoteService {
40 String getConfigurationErrorMessage();
43 * Gets data for the details view.
46 * identifier for the Glom document
48 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
50 * @param primaryKeyValue
51 * value of the primary key in the specified Glom table to use in the query
52 * @return the result of the SQL query as an array of {@link DataItem}s
54 DataItem[] getDetailsData(String documentID, String tableName, TypedDataItem primaryKeyValue);
57 * Gets a {@link DetailsLayoutAndData} object that contains the layout and data of the details view.
60 * identifier for the Glom document
62 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
64 * @param primaryKeyValue
65 * value of the primary key in the specified Glom table to use in the query
66 * @return a {@link DetailsLayoutAndData} object for the layout and initial data of the details view.
68 DetailsLayoutAndData getDetailsLayoutAndData(String documentID, String tableName, TypedDataItem primaryKeyValue,
69 final String localeID);
71 DocumentInfo getDocumentInfo(String documentID, String localeID);
74 * Gets a list of Glom documents found in the configured directory.
76 * @return an {@link ArrayList<String>} of Glom document titles. If the list is empty, no glom documents were found
77 * in the configured directory because it's empty or the directory is not configured correctly.
79 Documents getDocuments();
82 * Retrieves data for a list view table.
85 * identifier for the Glom document
87 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
90 * the start index in the data result set from the SQL query that should be retrieved
92 * the number of rows of data to retrieve
93 * @param sortColumnIndex
94 * the index of the column to sort, or -1 for none.
96 * <code>true</code> if the column should be sorted in ascending order, <code>false</code> if the column
97 * should be sorted in descending order
98 * @return an {@link ArrayList} of {@link DataItem} arrays that represents the requested data
101 ArrayList<DataItem[]> getListViewData(String documentID, String tableName, String quickFind, int start, int length,
102 int sortColumnIndex, boolean isAscending);
104 LayoutGroup getListViewLayout(String documentID, String tableName, final String localeID);
107 * Retrieves data for the related list table with the specified portal and foreign key value.
110 * identifier for the Glom document
112 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
115 * The portal to use for setting up the SQL query
116 * @param foreignKeyValue
117 * the value of the foreign key
119 * the start index in the data result set from the SQL query that should be retrieved
121 * the number of rows of data to retrieve
122 * @param sortColumnIndex
123 * the index of the column to sort, or -1 for none.
125 * <code>true</code> if the column should be sorted in ascending order, <code>false</code> if the column
126 * should be sorted in descending order
127 * @return an {@link ArrayList} of {@link DataItem} arrays that represents the requested data
129 ArrayList<DataItem[]> getRelatedListData(String documentID, String tableName, LayoutItemPortal portal,
130 TypedDataItem foreignKeyValue, int start, int length, int sortColumnIndex, boolean ascending);
133 * Gets the expected row count for the related list table with the specified portal and foreign key value.
136 * identifier for the Glom document
138 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
141 * The portal to use for setting up the SQL query
142 * @param foreignKeyValue
143 * the value of the foreign key
144 * @return the expected row count
146 int getRelatedListRowCount(String documentID, String tableName, LayoutItemPortal portal,
147 TypedDataItem foreignKeyValue);
149 String getReportHTML(String documentID, String tableName, String reportName, String quickFind, String localeID);
152 * Get a list of reports for the specified table.
155 * identifier for the Glom document
157 * name of the table in the Glom document.
159 * The locale for the table titles.
160 * @return The names and titles of the table's reports.
162 Reports getReportsList(String documentID, String tableName, String localeID);
164 // TODO: Do this only on the server side, or only on the client side?
165 NavigationRecord getSuitableRecordToViewDetails(String documentID, String tableName, LayoutItemPortal portal,
166 TypedDataItem primaryKeyValue);