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.client.ui.DetailsView;
25 import org.glom.web.shared.Documents;
26 import org.glom.web.shared.GlomDocument;
27 import org.glom.web.shared.GlomField;
28 import org.glom.web.shared.layout.LayoutGroup;
30 import com.google.gwt.user.client.rpc.RemoteService;
31 import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
33 @RemoteServiceRelativePath("libGlom")
34 public interface OnlineGlomService extends RemoteService {
36 GlomDocument getGlomDocument(String documentID);
39 * Gets a {@link LayoutGroup} for the given Glom document and table name.
42 * identifier for the Glom document
44 * name of the table in the Glom document
45 * @return filled in {@link LayoutGroup}
47 LayoutGroup getListLayout(String documentID, String tableName);
50 * Gets a {@link LayoutGroup} for the default table of the given Glom document.
53 * identifier for the Glom document
54 * @return filled in {@link LayoutGroup} for the default table
56 LayoutGroup getDefaultListLayout(String documentID);
58 ArrayList<GlomField[]> getListData(String documentID, String tableName, int start, int length);
60 ArrayList<GlomField[]> getSortedListData(String documentID, String tableName, int start, int length,
61 int sortColumnIndex, boolean isAscending);
64 * Gets a list of Glom documents found in the configured directory.
66 * @return an {@link ArrayList<String>} of Glom document titles. If the list is empty, no glom documents were found
67 * in the configured directory because it's empty or the directory is not configured correctly.
69 Documents getDocuments();
72 * Checks if the PostgreSQL authentication has been set for this document.
75 * identifier for the Glom document
76 * @return true if the authentication has been set, false if it hasn't
78 boolean isAuthenticated(String documentID);
81 * Checks if the provided PostgreSQL username and password are correct for the specified glom document. If the
82 * information is correct it is saved for future access.
85 * identifier for the Glom document
87 * the PostgreSQL username
89 * the POstgreSQL password
90 * @return true if username and password are correct, false otherwise
92 boolean checkAuthentication(String documentID, String username, String password);
95 * Gets a {@link LayoutGroup} that represents the layout of the {@link DetailsView} for the provided Glom document
99 * identifier for the Glom document
101 * name of the table in the Glom document or an empty {@link String} ("") to get the layout for the
103 * @return a {@link LayoutGroup} the represents the layout of the {@link DetailsView}
105 ArrayList<LayoutGroup> getDetailsLayout(String documentID, String tableName);
108 * Gets data for the Details View.
111 * identifier for the Glom document
113 * name of the table in the Glom document
114 * @param primaryKeyValue
115 * value of the primary key in the specified Glom table to use in the query
116 * @return the result of the SQL query as an array of {@link GlomField}s
118 GlomField[] getDetailsData(String documentID, String tableName, String primaryKeyValue);