Other Support Options
|
Page Tools
|
Feedback |
| Revised | : | January 4, 2006 (mc) |
| Version | : | All Versions |
| Revision | : | 1 |
SUMMARY
In some cases, libraries may want to break the link in ILLiad between the user and their requests. This document explains a possible way to do this, as well as explains the consequences in ILLiad.
LIMITATIONS
If you break the username link in ILLiad, you will not be able to do the following items:
BREAKING THE LINK BETWEEN USERS AND TRANSACTIONS
To break the link in ILLiad, basically you'll replace all instances of a username with a new, "standard" username. If you want to retain the status of the person, you can make several standard usernames (like "Faculty", "Staff", "Undergraduate", etc) or you can just make a single username to change the username to (like "BrokenUsername"). Create the username using the ILLiad web pages or through the SQL Enterprise Manager.
Once you've created the usernames, you need to change several items in the database:
In order to do this, you'll have to decide which transactions you want to break the link on. Once you've decided on the selection criteria, you'll take the list of TransactionNumbers and, using a SQL script or an Access link, you'll make the changes needed from the list above.
Breaking the link in this fashion will remove all ties in ILLiad between the user requesting the item and the item itself. But since the item remains in ILLiad, the Copyright tracking functionality will continue to work.
EXAMPLE
If you wanted to be able to break the links on all requests as soon as they were finished by changing the Username to "BrokenUsername", you could write a SQL Script to run once a day that would do this for you on the SQL Server. Be sure to read through the script and make any edits necessary before running on your database. This script is only an example and NOT designed to be run without editing/testing first. Here is an example:
-- BEGIN SCRIPT
-- Note that this should default to ILLData for all self-hosted servers.
Use ILLData
GO
-- This script defaults to changing the username to BrokenUsername. Note that if you
-- are on a shared server installation, you should change the username to BrokenUserABC
-- where ABC is your site code. You would also need to limit the requests to those that
-- are associated with your site code's users.
-- cursor to iterate through all finished transactions that meet criteria provided
declare finishedtn_cursor cursor for
select t.username, transactionnumber from Transactions t
-- joins on the Users table. If shared server, change Users to UsersALL
inner join Users u on t.username = u.username
-- only changes borrowing and doc del requests, not lending
where t.ProcessType in ('Borrowing','Doc Del')
-- only changes requests that are at a status of request finished
and t.TransactionStatus = 'Request Finished'
-- only changes requests for users that are not in the following list
and t.Username not in ('brokenusername','brokenuserABC','brokenuserXYZ')
-- only changes requests for users with the following NVTGC site code(s)
and u.NVTGC in ('ILL','ABC','XYZ')
-- only changes requests that are finished more than 30 days ago
and datediff(d,t.TransactionDate,getdate()) > 30
order by TransactionNumber;
-- declare local variables to store username and transactionnumber
declare @Username varchar(50);
declare @TN int;
open finishedtn_cursor;
fetch next from finishedtn_cursor into @userName, @TN;
-- Run through all Transactions that match the above query and edit the username fields
while @@FETCH_STATUS = 0 begin
-- Change the username to BrokenUsername and clear the internal account number
Update Transactions set Username = 'BrokenUsername', InternalAcctNo = ''
where TransactionNumber = @TN and username = @username;
-- Change the Changedby value for Tracking entries that have the user's username
Update Tracking set ChangedBy = 'BrokenUsername' where TransactionNumber = @TN and changedby = @username;
-- Change the AddedBy value for Notes entries that have the user's username
Update Notes set AddedBy = 'BrokenUsername' where TransactionNumber = @TN and addedby = @username;
-- DELETES the entire email entry from EmailCopies to remove any reference to that user
Delete from EMailCopies where TransactionNumber = @TN;
-- get the next username/transactionnumber from the initial query results
fetch next from finishedtn_cursor into @Username, @TN;
end;
close finishedtn_cursor;
deallocate finishedtn_cursor;
END
-- END SCRIPT
This script could be modified to allow, for example, only deleting items that are at Request Finished and are a certain length of time old, or only doing this for people who request it (or who request for it not to happen).
More Related Topics
|