-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
66 lines (56 loc) · 2.64 KB
/
README
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
/********************************************************************************
*
* Product: GSA-JAPI
* Description: A Java API for programmatically accessing the Google Search
* Appliance.
*
* (c) Copyright 2006 Inxight Software, Inc.
*
* Licensed under the Inxight Software, Inc., GSA-JAPI License (the "License").
* You may not use this file except in compliance with the License. You should
* have received a copy of the License with this distribution. If not, you may
* obtain a copy by contacting:
*
* Inxight Software, Inc.
* 500 Macara Ave.
* Sunnyvale, CA 94085
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
********************************************************************************/
In this README:
1. Instructions to build from source
2. API Usage
1. Instructions to build from source
--------------------------------------------
You will need to have ant installed to be able to use the build
script provided.
1. Ensure "ant" is in your path
2. In console, change to directory where you extracted this distribution.
3. Run "ant --projecthelp" to get a list of public targets and descriptions
4. The default target creates a binary distribution in the form of a jar
file in the dist/ folder (relative to the current directory)
2. API Usage
---------------------------------------------
For a quick example see the source file: src/demo/net/sf/gsaapi/demo/GSAClientDemo.java
You may need to modify the values of the String constants before being able to
run the example successfully.
Briefly, the steps are as follows:
a. Create a GSAClient instance (point to desired GSA installation)
GSAClient gsaClient = new GSAClient("my.gsa.host");
Once created, you can reuse the GSAClient instance for making multiple "GSAQueries"
b. Create a GSAQuery instance as:
GSAQuery gsaQuery = new GSAQuery();
c. To create a simple text query:
GSAQueryTerm term = new GSAQuery.GSAQueryTerm("java sdk");
gsaQuery.setQueryTerm(term);
d. Execute the query using the client:
GSAResponse gsaResponse = gsaClient.getGSAResponse(gsaQuery);
And so on...
Depending on the exact configuration of your target GSA, some
additional parameters (ie calls to gsaQuery.set... ) may be mandatory.
See the javadocs for further details on how you can create
more complex filters and how to get individual results out
of the GSAResponse object.