-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial v1.1 by Simmons College Library
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<Name>Internet Archive Search</Name> | ||
<Author>Simmons College Library</Author> | ||
<Version>1.1</Version> | ||
<Active>true</Active> | ||
<Description>Performs a search of internet archive for a loans' LoanTitle.</Description> | ||
<Forms> | ||
<Form>FormRequest</Form> | ||
</Forms> | ||
<Settings> | ||
<Setting name="AutoSearch" value="true" type="boolean"> | ||
<Description>Defines whether the search should be automatically performed when the form opens.</Description> | ||
</Setting> | ||
</Settings> | ||
<Files> | ||
<File>InternetArchiveSearch.lua</File> | ||
</Files> | ||
</Configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
-- About InternetArchiveSearch.lua | ||
-- | ||
-- Developed by Simmons College Library | ||
-- | ||
-- Version 1.1, April 2010 | ||
-- | ||
-- InternetArchiveSearch.lua does search of Internet Archive for the LoanTitle for loans. | ||
-- autoSearch (boolean) determines whether the search is performed automatically when a request is opened or not. | ||
-- | ||
-- "query" is the text box name on archive.org | ||
|
||
local autoSearch = GetSetting("AutoSearch"); | ||
|
||
local interfaceMngr = nil; | ||
local browser = nil; | ||
|
||
function Init() | ||
if GetFieldValue("Transaction", "RequestType") == "Loan" then | ||
interfaceMngr = GetInterfaceManager(); | ||
|
||
-- Create browser | ||
browser = interfaceMngr:CreateBrowser("Internet Archive Search", "Internet Archive Search", "Script"); | ||
|
||
-- Create buttons | ||
browser:CreateButton("Search", GetClientImage("Search32"), "Search", "Internet Archive"); | ||
|
||
browser:Show(); | ||
|
||
if autoSearch then | ||
Search(); | ||
end | ||
end | ||
end | ||
|
||
function Search() | ||
browser:RegisterPageHandler("formExists", "searchform","SearchFormLoaded", false); | ||
browser:Navigate("http://archive.org"); | ||
end | ||
|
||
function SearchFormLoaded() | ||
if GetFieldValue("Transaction", "RequestType") == "Loan" then | ||
browser:SetFormValue("searchform", "search", GetFieldValue("Transaction", "LoanTitle")); | ||
end | ||
browser:ClickObject("gobutton"); | ||
end | ||
|