From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:30:34 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <name>Library</name> <environment>Protocols</environment> <private>false</private> <imports> private Smalltalk.* </imports> <category>Protocols-LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> <class> <name>AbstractRandom</name> <environment>Protocols.Library</environment> <super>UI.Model</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.AbstractRandom
AbstractRandom is the abstract superclass of all the library demo (LD) classes that do or may employ a random number generator. Shared Variables: Random <MinimumStandardRandom> a random number generator
</comment> <class> <name>PersonName</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AbstractRandom</super> <private>false</private> none title firstName middleNames lastName femaleTitles maleTitles femaleFirstNames maleFirstNames femaleMiddleNames maleMiddleNames lastNames <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.PersonName
Represents that name of a Person. Instance Variables: title <String> firstName <String> middleNames <String> lastName <String> Class Instance Variables: femaleTitles <Array of: String> maleTitles <Array of: String> femaleFirstNames <Array of: String> maleFirstNames <Array of: String> femaleMiddleNames <Array of: String> maleMiddleNames <Array of: String> lastNames <Array of: String>
</comment> <class> <name>LibraryService</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AbstractRandom</super> <private>false</private> none library serviceCharge serviceId defaultServiceCharge defaultServiceId <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.LibraryService
This is the abstract superclass of all the classes that include APIs for the manipulation of the Library demo. The intention is that when writing IDL or WSDL for the library demo, only the interfaces of the classes in the service hierarchy need be addressed. A service is offered by a library for an optional service charge. Instance Variables: library <Library> the library offering the service serviceCharge <FixedPoint> serviceId <Symbol> the service identifier Class Instance Variables: defaultServiceCharge <FixedPoint> defaultServiceId <Symbol>
</comment> <class> <name>SearchService</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LibraryService</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.SearchService
SearchService presents an API for searching the library's holdings, or that of its affiliates, for books and other holdings of interest. SearchService provides a free-of-charge, library-mandatory service. Invoking the service does not entail either balance or transaction history changes. It has no effect on either the library's or the invoking patron's account.
</comment> <class> <name>Transaction</name> <environment>Protocols.Library</environment> <super>UI.Model</super> <private>false</private> none timestamp transactionId <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Transaction
A library transaction records the time when it occurred and acquires a transaction identifier. Instance Variables: timestamp <Timestamp> When the transaction occured transactionId <DwordArray> Shared Class Variables: NextTransactionId <DwordArray>
</comment> <class> <name>HoldingTransaction</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Transaction</super> <private>false</private> none holding <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.HoldingTransaction
This an abstract superclass for all transactions dealing with library holdings. Instance Variables: holding <Holding>
</comment> <class> <name>RequestDueDateExtension</name> <environment>Protocols.Library</environment> <super>Protocols.Library.HoldingTransaction</super> <private>false</private> none newDueDate <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.RequestDueDateExtension
Instance Variables: newDueDate <Date>
</comment> <class> <name>FinancialTransaction</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Transaction</super> <private>false</private> none amount <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.FinancialTransaction
This is an abstract superclass for all financial transaction involving some amount of funds. Instance Variables: amount <FixedPoint>
</comment> <class> <name>AcquireGrant</name> <environment>Protocols.Library</environment> <super>Protocols.Library.FinancialTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>Holding</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AbstractRandom</super> <private>false</private> none acquisitionCost acquisitionDate acquisitionNumber catalogNumber collectionId dueDate libraryName statusId nextHoldingId collectionIds statusIds <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Holding
This is the abstract supercalss of all Library holdings, such as Books and Recordings. The instance variable 'dueDate' is used to test 'Date or nil'. Instance Variables: acquisitionCost <FixedPoint> the cost of the holding acquisitionDate <Date> the date when the holding was acquired by the Library acquisitionNumber <Integer> catalogNumber <CatalogNumber> collectionId <Symbol> the Library collection in which the holding resides dueDate <Date | nil> if not nil, the date by which the LDHolding should be returned by its borrower libraryName <String> the name of the owning library statusId <Symbol> library workflow status indicator one of the #statusIds from the class side Class Instance Variables: nextHoldingId <Object> undocumented collectionIds <Array of: Symbol> names of various library collections statusIds <Array of: Symbol> undocumented Shared Class Variables: NextAcquisitionNumber <Integer>
</comment> <class> <name>RetainedHolding</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Holding</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.RetainedHolding
This is a library holding that isn't for loan, but can be used by patrons on the library premises.
</comment> <class> <name>ShipPlan</name> <environment>Protocols.Library</environment> <super>Protocols.Library.RetainedHolding</super> <private>false</private> none architects numberOfSheets scale sheetDimensions shipName yearDrawn shipNames <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.ShipPlan
This class represents drawings and specification of a ship. Instance Variables: architects <Array of: AuthorialName> qualified list of ship architects numberOfSheets <Integer> scale <Fraction> the scale of the drawings sheetDimensions <Point> shipName <String> the name of the ship design yearDrawn <Integer> Class Instance Variables: shipNames <Array of: String> list of various ship names
</comment> <class> <name>PhysicalAddress</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AbstractRandom</super> <private>false</private> none streetAddress1 streetAddress2 city stateOrProvince postalCode country address1StreetNames address2Descriptions <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.PhysicalAddress
Represents a phyical address (a.k.a. street address). Instance Variables: streetAddress1 <String> streetAddress2 <String> city <String> stateOrProvince <Symbol> postalCode <String> country <Symbol> Class Instance Variables: address1StreetNames <Array of: String> address2Descriptions <Array of: String>
</comment> <class> <name>Agent</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AbstractRandom</super> <private>false</private> none account borrowedHoldings emailAddresses physicalAddress serviceApprovals telephoneNumbers serviceApprovals <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Agent
Agent is the abstract superclass of those entities in the library demo (LD) that can are the nominal initiators of actions affecting the state of the simulation. However, note that entities in the LibraryService hierarchy may do so as well. Instance Variables: account <Account> the associated account of an agent borrowedHoldings <Bag of: Holding> a potentially empty Bag of items borrowed from Libraries indexed by 'dueDate' emailAddresses <Array of: EmailAddress> a potentially empty Array of email addresses physicalAddress <PhysicalAddress> a mailing and street address serviceApprovals <Set of: Symbol> list of services that are approved for agent's use telephoneNumbers <Set of: TelephoneNumber> a potentially empty set of phone number Class Instance Variables: serviceApprovals <Set of: Symbol> the list of recognized service approvals Shared Class Variables: NextAgentId <Array>
</comment> <class> <name>OrganizationName</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AbstractRandom</super> <private>false</private> none name organizationTypes <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.OrganizationName
Instance Variables: name <String> name of an organization Class Instance Variables: organizationTypes <Array of: String> various organization types
</comment> <class> <name>LibraryError</name> <environment>Protocols.Library</environment> <super>Core.Error</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.LibraryError
Abstract superclass of LibraryDemo specific errors.
</comment> <class> <name>PatronNotFound</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LibraryError</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.PatronNotFound
Error signalled when a search for patron fails.
</comment> <class> <name>LoanedHolding</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Holding</super> <private>false</private> none reservationList <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.LoanedHolding
This an abstract superclass of holdings that can be loaned to patrons. The 'reservationList' is used to test LinkedLists. Instance Variables: reservationList <LinkedList of: Reservation> patrons can make reservations on loaned holdings
</comment> <class> <name>Recording</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LoanedHolding</super> <private>false</private> none authors coverPhoto tracks year publisher title <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Recording
This class represents a "recording" of some kind. Recordings have a title, authors, tracks etc. Instance Variables: authors <Array of: AuthorialName> qualified list of book authors coverPhoto <Image> optional picture of the book cover tracks <Array of: String> the list of tracks on the CD year <Integer> publisher <String> the name of the publisher title <String> title of the book
</comment> <class> <name>AnalogRecording</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Recording</super> <private>false</private> none format <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.AnalogRecording
This is an abstract superclass of all non-digital recordings. Instance Variables: format <Symbol> different kinds of recordings use different formats
</comment> <class> <name>PhonographRecord</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AnalogRecording</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.PhonographRecord
This is a vinyl record popular in pre-CD era.
</comment> <class> <name>AgentTransaction</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Transaction</super> <private>false</private> none agentId <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.AgentTransaction
This is an abstract superclass of all transactions for agent relationship changes. Instance Variables: agentId <Symbol> subject of the transaction
</comment> <class> <name>AcquirePatron</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AgentTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>InformationService</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LibraryService</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.InformationService
This is an abstract superclass for information services provided by the library. For example, things like weather information.
</comment> <class> <name>ServiceTransaction</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Transaction</super> <private>false</private> none serviceId <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.ServiceTransaction
This an abstract superclass for all transactions dealing with library services. Instance Variables: serviceId <Symbol> the subject of the transaction
</comment> <class> <name>PublishService</name> <environment>Protocols.Library</environment> <super>Protocols.Library.ServiceTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>GeneralPublicService</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LibraryService</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.GeneralPublicService
GeneralPublicService provides an interface for queries about some free services provided by the library. Ordinary users of the Port Nowhere Library System need to inspect the current balance of their account, find out which of the books they have borrowed are due when, and so on. GeneralPublicService is a library-mandatory, free library service, that supports the interface for such queries.
</comment> <class> <name>RetireAffiliatedLibrary</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AgentTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>DigitalRecording</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Recording</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.DigitalRecording
This is an abstract superclass of all digital recordings.
</comment> <class> <name>DigitalVideoDisc</name> <environment>Protocols.Library</environment> <super>Protocols.Library.DigitalRecording</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.DigitalVideoDisc
This is a DVD.
</comment> <class> <name>CatalogNumber</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AbstractRandom</super> <private>false</private> none part1 part2 part3 part4 nextPart3 <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.CatalogNumber
CatalogNumber represents a catalog number something like the Library of Congress catalog number. It provides an occasion to test the marshaling of assorted types. Since it is used as a key in an IdentityDictionary (Library>>ownedHoldings), there are occasions when it may be a good idea to pass CatalogNumbers by reference. Instance Variables: part1 <TwoByteString> part1 of the LDDataCatalogNumber part2 <ByteArray> part2 of the LDDataCatalogNumber part3 <Double> part3 of the LDDataCatalogNumber part4 <Character> part4 of the LDDataCatalogNumber Class Instance Variables: nextPart3 <Object> undocumented
</comment> <class> <name>HoldingNotFound</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LibraryError</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.HoldingNotFound
Error signalled when a holding is not found.
</comment> <class> <name>AcquireHolding</name> <environment>Protocols.Library</environment> <super>Protocols.Library.HoldingTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>Patron</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Agent</super> <private>false</private> none patronId patronName <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Patron
Patron represents private patrons of a Library. Instance Variables: patronId <Symbol> a library-specific patron identifier patronName <PersonName | OrganizationName> the patron's name
</comment> <class> <name>Person</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Patron</super> <private>false</private> none birthDate sex ssn <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Person
Persons are library patrons representing people. They are identified by their social security number (SSN) and carry few additional attributes. Instance Variables: birthDate <Date> person's birth date sex <Symbol> one of #F or #M ssn <Integer> social security number
</comment> <class> <name>EmailAddress</name> <environment>Protocols.Library</environment> <super>UI.Model</super> <private>false</private> none address description <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.EmailAddress
Represents the e-mail address of a patron or an organization. Instance Variables: address <String> description <String>
</comment> <class> <name>AcquireAffiliatedLibrary</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AgentTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>TelephoneNumber</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AbstractRandom</super> <private>false</private> none type description number telephoneNumberTypes <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.TelephoneNumber
Instance Variables: type <Symbol> one of #telephoneNumberTypes description <String> number <String> Class Instance Variables: telephoneNumberTypes <Array of: Symbol> available types #(#voice #fax #home #office #cell #work)
</comment> <class> <name>AuthorialName</name> <environment>Protocols.Library</environment> <super>UI.Model</super> <private>false</private> none authorialType name authorialTypes <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.AuthorialName
AuthorialName represents the name and role of an 'author', as widely understood. The class is intended to provide an occasion for the testing of unions insofar as its 'name' instance variable may take either of two types. Instance Variables: authorialType <Symbol> identifies the authorial role name <LDDataPersonName|LDDataOrganizationName> a name
</comment> <class> <name>VideoTape</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AnalogRecording</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.VideoTape
This is a video tape used in VCRs.
</comment> <class> <name>PlaceReservation</name> <environment>Protocols.Library</environment> <super>Protocols.Library.HoldingTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>Payment</name> <environment>Protocols.Library</environment> <super>Protocols.Library.FinancialTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>Book</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LoanedHolding</super> <private>false</private> none authors braille coverPhoto language largePrint pages publicationYear publisher title publishers libraryBookData archiveBookData <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Book
Book represents a printed book. Instance Variables: authors <Array of: AuthorialName> qualified list of book authors braille <Boolean> is the book printed in Braille coverPhoto <Image> optional picture of the book cover language <Symbol> book language largePrint <Boolean> is the book printed in large print pages <Integer> the number of pages publicationYear <Integer> publisher <String> the name of the publisher title <String> title of the book Class Instance Variables: publishers <Array of: String> list of publisher names libraryBookData <Object> sample categorized library holdings archiveBookData <Object> sample categorized naval archive holdings
</comment> <class> <name>Account</name> <environment>Protocols.Library</environment> <super>UI.Model</super> <private>false</private> none balance transactionHistory <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Account
Account represents the account of an Agent, that is, of either a library or a library patron. Instance Variables: balance <FixedPoint> current balance of funds transactionHistory <OrderedCollection of: Transaction>
</comment> <class> <name>Reservation</name> <environment>Protocols.Library</environment> <super>UI.Model</super> <private>false</private> none holdingCatalogNumber patronId reservationType <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Reservation
Reservation represents a revervation on an Holding by an Patron. A reservation should be allowed only if the Holding is a LoanedHolding and has a 'statusId' of '#borrowed'. Normally, a LoanedHolding is reserved for #borrowing. But, if the Library provides a copying service, it can be reserved for #copying, in which case it's copied before it is loaned again. Instance Variables: holdingCatalogNumber <CatalogNumber> of the holding being reserved patronId <Symbol> the 'partonId' of the patron placing the reservation reservationType <Symbol> either #borrowing or #copying
</comment> <class> <name>ReturnHolding</name> <environment>Protocols.Library</environment> <super>Protocols.Library.HoldingTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>CompactDisc</name> <environment>Protocols.Library</environment> <super>Protocols.Library.DigitalRecording</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.CompactDisc
This is a CD.
</comment> <class> <name>RetirePatron</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AgentTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>BorrowHolding</name> <environment>Protocols.Library</environment> <super>Protocols.Library.HoldingTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>OverdueCharge</name> <environment>Protocols.Library</environment> <super>Protocols.Library.FinancialTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>Library</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Agent</super> <private>false</private> none affiliatedLibraries libraryId libraryName loanedHoldings ownedHoldings patrons reservedHoldings services <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Library
Library loans its holdings and provides additional services to its patrons. Libraries can be affiliated with each other to be able to share their offerings. Description: The Library Demo includes one pre-packaged example, based upon the model of a public library in a ficticious place called Port Nowhere. Port Nowhere is nestled on the shore of a mid-sized bay on the Pacific Coast of North America. The Disappearing Mountains of the Coast Range, largely granitic in composition, rise behind the town, which is nevertheless bordered by significant areas of mixed forest and oak scrubland. Port Nowhere is the home of the Port Nowhere Public Library. This library is affiliated with the Library and Ship Plan Archive of the well-respected Port Nowhere Maritime Museum. The economic life of Port Nowhere is principally maritime. It is the major port of The Lost Coast, a commercial and sport fishing center, the site of several canneries, as well as the home of several well-reputed naval architects, ship building firms, expedition outfitters, and smugglers. The mountains behind the town support a significant, but carefully-managed lumber industry. Many of the firms in Port Nowhere are have organizational accounts with the public library. Port Nowhere was settled by immigrants from throughout Europe and the Pacific Rim, and its inhabitants, though strongly given to intermarriage, maintain a strong attachment to both their native languages and the memory of the great maritime figures of their homelands. Thus, in Port Nowhere, one meets people with names like 'Heihachiro Guiseppe Tordenskjold' or 'Brendan Boris Caboto' as a matter of course. Almost all of the residents of Port Nowhere have library cards and read avidly in several languages. To serve the varied interests of its patrons, the Port Nowhere Public Library System provides a number of services. In the Library demo, these are represented by parts of the class hierarchy. GeneralPublicService: ordinary users of the Library System need to inspect the current balance of their account, find out which of the books they have borrowed are due when, and so on. Subclasses of GeneralPublicService represent library-mandatory, free library services, and so GeneralPublicService defines the interface for such queries. AdministrativeService: the librarians need to modify the state of the library system in ways that ordinary library patrons may not. AdministrativeService (a subclass of GeneralPublicService) provides the interface for their activities. SearchHoldingsService: users of the Library System often search its holdings, or the holdings of its affiliated libraries, for books and other holdings of interest. A Search is a free-of-charge, library-mandatory service. Invoking the service does not entail either balance or transaction history changes. Invoking it has no effect on either the library's or the invoking patron's account. WeatherForecastService: the mariners and foresters of Port Nowhere have a professional interest in the weather. A WeatherForecast is a library-optional, charged library service. Invoking the service entails a nominal use fee. It affects the account of the patron invoking it by changing the account balance and adding a transaction to the patron's account transaction history. It does not affect the library account. CopyRequestService: Copy requests debit a patron's account and add a service charge transaction to the patron's transaction history. Instance Variables: affiliatedLibraries <Set of: Library> affiliated libraries libraryId <Symbol> identifier libraryName <String> the name of the institution loanedHoldings <OrderedCollection of: Holding> holdings currently on loan ownedHoldings <Dictionary key: Integer value: Holding> registry of all the library holdings patrons <SortedCollection of: Patron> registry of all the library patrons reservedHoldings <IdentitySet of: Holding> holdings currently reserved for future loan services <IdentityDictionary key: Symbol value: LibraryService> registry of available library services Shared Class Variables: LibraryDepartments <Array of: Symbol> various deparments in a library
</comment> <class> <name>ServiceCharge</name> <environment>Protocols.Library</environment> <super>Protocols.Library.FinancialTransaction</super> <private>false</private> none serviceId <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.ServiceCharge
Represents a service charge. Instance Variables: serviceId <Symbol> for which service was charged
</comment> <class> <name>PatronNotApprovedForService</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LibraryError</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.PatronNotApprovedForService
Error signalled when a patron requests a service that is not approved for his/her use.
</comment> <class> <name>WeatherForecastService</name> <environment>Protocols.Library</environment> <super>Protocols.Library.InformationService</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.WeatherForecastService
WeatherForecastService is a library-optional, charged library service. Invoking the service entails a nominal fee. It affects the account of the patron invoking it by changing the account balance and adding a transaction to the parton's account transaction history. It does not affect the library account.
</comment> <class> <name>CopyService</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LibraryService</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.CopyService
CopyService presents an API for patrons to request copies of the library's holdings. A copy request debits a patron's account and adds a service charge transaction to the patron's transaction history. The libraries of Port Nowhere have a somewhat cavalier attitude toward copyright legislation. Several of their more generous patrons are professionally engaged in smuggling books to countries with aggressive censorship, and the Port Nowhere Library System Bindery stands ever ready to assist enlightened book distributors of this kind. If this were not sufficient to justify the service, mariners, on the eve of a voyage or shortly thereafter, often realize that they wish to take along a copy of, say, the 'Collected Poems' of Joseph Brodsky, or Rabelais' 'The Adventures of Gargantua and Pantagruel', and have no opportunity to rummage through a bookstore. In response, the Port Nowhere Library System Bindery is highly automated. It is noted for its guaranteed four-hour turnaround on all orders up to 500 volumes, and for the excellence of its offshore, speedboat delivery service. Naval architects and boat builders are also likely to experience a sudden interest in ship plans at odd hours of the morning or night. To serve the needs of such trusted patrons, the libraries of Port Nowhere, in conjunction with their bindery, offer unique book and ship plan copying and delivery services for a nearly nominal fee, that, nonetheless, accounts for much of their income, and allows them to purchase the additional books and plans that, in connection with this service, ever increase both their trade and the breadth of their holdings.
</comment> <class> <name>AdministrativeService</name> <environment>Protocols.Library</environment> <super>Protocols.Library.GeneralPublicService</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.AdministrativeService
The librarians of the Port Nowhere Library System need to modify the state of that system in ways that ordinary library patrons may not. An AdministrativeService provides the interface for their activities.
</comment> <class> <name>HoldingNotCopiedByBindery</name> <environment>Protocols.Library</environment> <super>Protocols.Library.LibraryError</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.HoldingNotCopiedByBindery
Error signalled when a holding cannot be copied by the library.
</comment> <class> <name>RetireHolding</name> <environment>Protocols.Library</environment> <super>Protocols.Library.HoldingTransaction</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <class> <name>Organization</name> <environment>Protocols.Library</environment> <super>Protocols.Library.Patron</super> <private>false</private> none taxIdNumber nextTaxIdNumber <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.Organization
Organization represents an organizational patron of the library. Organizations are idenified by a 'tax id number' or TIN rather than by a 'social security number' or SSN. Instance Variables: taxIdNumber <WordArray> a putatively unique organization identifier Class Instance Variables: nextTaxIdNumber <WordArray>
</comment> <class> <name>AudioTape</name> <environment>Protocols.Library</environment> <super>Protocols.Library.AnalogRecording</super> <private>false</private> none <imports></imports> <category>LibraryDemo</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> </class> <comment> Protocols.Library.AudioTape
This is an AudioTape.
</comment> <name>LibraryDepartments</name> <environment>Protocols.Library.Library</environment> <private>false</private> <constant>false</constant> <category>accessing</category> <initializer></initializer> <attributes> <package>Protocols-LibraryDemo</package> </attributes> <name>Random</name> <environment>Protocols.Library.AbstractRandom</environment> <private>false</private> <constant>false</constant> <category>random</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> <name>NextTransactionId</name> <environment>Protocols.Library.Transaction</environment> <private>false</private> <constant>false</constant> <category>ids</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> <name>NextAcquisitionNumber</name> <environment>Protocols.Library.Holding</environment> <private>false</private> <constant>false</constant> <category>shared</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> <name>NextAgentId</name> <environment>Protocols.Library.Agent</environment> <private>false</private> <constant>false</constant> <category>ids</category> <attributes> <package>Protocols-LibraryDemo</package> </attributes> <methods> Protocols.Library.AbstractRandom <category>accessing</category>
random ^self class random
</methods> <methods> Protocols.Library.AbstractRandom <category>initialize-release</category>
initialize
</methods> <methods> Protocols.Library.AbstractRandom class <category>instance creation</category>
new ^super new initialize
</methods> <methods> Protocols.Library.AbstractRandom class <category>utility</category>
randomDoubleLessThan: aPositiveNumber ^( self random next * aPositiveNumber ) asDouble
randomFloatLessThan: aPositiveNumber ^( self random next * aPositiveNumber ) asFloat
randomIntegerLessThan: aPositiveNumber "((( LDAbstractRandom randomIntegerLessThan: 3 )))" ^( self random next * aPositiveNumber ) truncated
randomPositiveIntegerWithMax: aPositiveNumber "((( LDAbstractRandom randomPositiveIntegerWithMax: 3 )))" ^1 + ( self random next * aPositiveNumber ) truncated
randomYear ^1800 + ( self randomPositiveIntegerWithMax: ( Date today year - 1800 ) )
setSeed: anInteger self random seed: anInteger
</methods> <methods> Protocols.Library.AbstractRandom class <category>class initialization</category>
initialize "((( LDAbstractRandom initialize )))" Random := MinimumStandardRandom new. self setSeed: 1072299453
</methods> <methods> Protocols.Library.AbstractRandom class <category>accessing</category>
random ^Random
</methods> <methods> Protocols.Library.PersonName <category>accessing</category>
firstName ^firstName
firstName: aString firstName := aString
lastName ^lastName
lastName: aString lastName := aString
middleNames ^middleNames
middleNames: aString middleNames := aString
title ^title
title: aString title := aString
</methods> <methods> Protocols.Library.PersonName <category>initialize-release</category>
initialize title := String new. firstName := String new. middleNames := String new. lastName := String new.
</methods> <methods> Protocols.Library.PersonName <category>printing</category>
printOn: aStream aStream nextPutAll: title; nextPut: Character space; nextPutAll: firstName; nextPut: Character space; nextPutAll: middleNames; nextPut: Character space; nextPutAll: lastName
</methods> <methods> Protocols.Library.PersonName <category>utility</category>
emailAddresses | str | str := WriteStream on: ( String new: 26 ). str nextPutAll: ( firstName select: [ :x | x isUppercase ] ); nextPutAll: ( middleNames select: [ :x | x isUppercase ] ); nextPutAll: ( lastName copyFrom: 1 to: ( ( 12 - str size ) min: lastName size ) ); nextPutAll: (#portnowherenet << #librarydemo >> '@portnowhere.net') asString. ^Array with: ( EmailAddress address: str contents asLowercase description: (#Personal << #librarydemo >> 'Personal') asString )
</methods> <methods> Protocols.Library.PersonName class <category>class initialization</category>
initialize "((( LDDataPersonName initialize )))" self initializeFemaleFirstNames. self initializeFemaleMiddleNames. self initializeFemaleTitles. self initializeMaleFirstNames. self initializeMaleMiddleNames. self initializeMaleTitles. self initializeLastNames.
initializeFemaleFirstNames "((( LDPersonName initializeFemaleFirstNames )))" femaleFirstNames := (OrderedCollection new add: (#Agnes << #librarydemo >> 'Agnes'); add: (#Anne << #librarydemo >> 'Anne'); add: (#Athene << #librarydemo >> 'Athene'); add: (#Azalais << #librarydemo >> 'Azalais'); add: (#Brigette << #librarydemo >> 'Brigette'); add: (#Calliope << #librarydemo >> 'Calliope'); add: (#Constance << #librarydemo >> 'Constance'); add: (#Daria << #librarydemo >> 'Daria'); add: (#Effie << #librarydemo >> 'Effie'); add: (#Ekaterina << #librarydemo >> 'Ekaterina'); add: (#Elizabeth << #librarydemo >> 'Elizabeth'); add: (#Filomena << #librarydemo >> 'Filomena'); add: (#Francesca << #librarydemo >> 'Francesca'); add: (#Gayle << #librarydemo >> 'Gayle'); add: (#Henrietta << #librarydemo >> 'Henrietta'); add: (#Isobella << #librarydemo >> 'Isobella'); add: (#Juliana << #librarydemo >> 'Juliana'); add: (#Katerina << #librarydemo >> 'Katerina'); add: (#Karolina << #librarydemo >> 'Karolina'); add: (#Krystyna << #librarydemo >> 'Krystyna'); add: (#Kyoko << #librarydemo >> 'Kyoko'); add: (#Lillian << #librarydemo >> 'Lillian'); add: (#Lisa << #librarydemo >> 'Lisa'); add: (#Ludwika << #librarydemo >> 'Ludwika'); add: (#Margaret << #librarydemo >> 'Margaret'); add: (#Mollie << #librarydemo >> 'Mollie'); add: (#Nancy << #librarydemo >> 'Nancy'); add: (#Naomi << #librarydemo >> 'Naomi'); add: (#Natella << #librarydemo >> 'Natella'); add: (#Olga << #librarydemo >> 'Olga'); add: (#Ophelia << #librarydemo >> 'Ophelia'); add: (#Patricia << #librarydemo >> 'Patricia'); add: (#Philippa << #librarydemo >> 'Philippa'); add: (#Q << #librarydemo >> 'Q.'); add: (#Rozalia << #librarydemo >> 'Rozalia'); add: (#Sophia << #librarydemo >> 'Sophia'); add: (#Suzanna << #librarydemo >> 'Suzanna'); add: (#Terpsichore << #librarydemo >> 'Terpsichore'); add: (#Ulricha << #librarydemo >> 'Ulricha'); add: (#Violeta << #librarydemo >> 'Violeta'); add: (#Wilhelmina << #librarydemo >> 'Wilhelmina'); add: (#Xavirea << #librarydemo >> 'Xavirea'); add: (#Yoshiko << #librarydemo >> 'Yoshiko'); add: (#Yvette << #librarydemo >> 'Yvette'); add: (#Yvonne << #librarydemo >> 'Yvonne'); add: (#Zaza << #librarydemo >> 'Zaza'); add: (#Zoe << #librarydemo >> 'Zoe'); asArray)
initializeFemaleMiddleNames femaleMiddleNames := (OrderedCollection new add: (#Alienor << #librarydemo >> 'Alienor'); add: (#Almodis << #librarydemo >> 'Almodis'); add: (#Artemisia << #librarydemo >> 'Artemisia'); add: (#Beatrice << #librarydemo >> 'Beatrice'); add: (#Catherine << #librarydemo >> 'Catherine'); add: (#Diana << #librarydemo >> 'Diana'); add: (#Douce << #librarydemo >> 'Douce'); add: (#Ermengard << #librarydemo >> 'Ermengard'); add: (#Ermessend << #librarydemo >> 'Ermessend'); "add: (#F << #librarydemo >> 'F.');" add: (#Gerberga << #librarydemo >> 'Gerberga'); "add: (#H << #librarydemo >> 'H.');" "add: (#I << #librarydemo >> 'I.');" "add: (#J << #librarydemo >> 'J.');" add: (#Klytemnestra << #librarydemo >> 'Klytemnestra'); "add: (#L << #librarydemo >> 'L.');" add: (#Moira << #librarydemo >> 'Moira'); "add: (#N << #librarydemo >> 'N.');" "add: (#O << #librarydemo >> 'O.');" "add: (#P << #librarydemo >> 'P.');" "add: (#Q << #librarydemo >> 'Q.');" add: (#Richildis << #librarydemo >> 'Richildis'); "add: (#S << #librarydemo >> 'S.');" "add: (#T << #librarydemo >> 'T.');" "add: (#U << #librarydemo >> 'U.');" "add: (#V << #librarydemo >> 'V.');" "add: (#W << #librarydemo >> 'W.');" "add: (#X << #librarydemo >> 'X.');" "add: (#Y << #librarydemo >> 'Y.');" "add: (#Z << #librarydemo >> 'Z.');" asArray)
initializeFemaleTitles | oc | oc := OrderedCollection new. 10 timesRepeat: [ oc addLast: (#Ms << #librarydemo >> 'Ms.') ]. 7 timesRepeat: [ oc addLast: (#Mrs << #librarydemo >> 'Mrs.') ]. femaleTitles := oc asArray.
initializeLastNames lastNames := (OrderedCollection new add: (#Abruzzi << #librarydemo >> 'Abruzzi'); add: (#Achenbach << #librarydemo >> 'Achenbach'); add: (#Agricola << #librarydemo >> 'Agricola'); add: (#Alarcon << #librarydemo >> 'Alarcon'); add: (#Amundsen << #librarydemo >> 'Amundsen'); add: (#Anson << #librarydemo >> 'Anson'); add: (#Atkin << #librarydemo >> 'Atkin'); add: (#Aviles << #librarydemo >> 'Aviles'); add: (#Ayllon << #librarydemo >> 'Ayllon'); add: (#Bakhuysen << #librarydemo >> 'Bakhuysen'); add: (#Bandiera << #librarydemo >> 'Bandiera'); add: (#Bart << #librarydemo >> 'Bart'); add: (#Bassett << #librarydemo >> 'Bassett'); add: (#Bazan << #librarydemo >> 'Bazan'); add: (#Beaufort << #librarydemo >> 'Beaufort'); add: (#Behring << #librarydemo >> 'Behring'); add: (#Bonny << #librarydemo >> 'Bonny'); add: (#Boscawen << #librarydemo >> 'Boscawen'); add: (#Bougainville << #librarydemo >> 'Bougainville'); add: (#Bowditch << #librarydemo >> 'Bowditch'); add: (#Brangwyn << #librarydemo >> 'Brangwyn'); add: (#Bretheryn << #librarydemo >> 'Bretheryn'); add: (#Caboto << #librarydemo >> 'Caboto'); add: (#Cadamosto << #librarydemo >> 'Cadamosto'); add: (#Cam << #librarydemo >> 'Cam'); add: (#Canute << #librarydemo >> 'Canute'); add: (#Carraciolo << #librarydemo >> 'Carraciolo'); add: (#Cassabianca << #librarydemo >> 'Cassabianca'); add: (#Castex << #librarydemo >> 'Castex'); add: (#Cavendish << #librarydemo >> 'Cavendish'); add: (#Celikkale << #librarydemo >> 'Celikkale'); add: (#Cervera << #librarydemo >> 'Cervera'); add: (#Chabaud << #librarydemo >> 'Chabaud'); add: (#ChateauRenault << #librarydemo >> 'Chateau-Renault'); add: (#ChojnowskaLiskiewicz << #librarydemo >> 'Chojnowska-Liskiewicz'); add: (#DAiguilliers << #librarydemo >> 'D''Aiguilliers'); add: (#Dallman << #librarydemo >> 'Dallman'); add: (#Dandolo << #librarydemo >> 'Dandolo'); add: (#Dawson << #librarydemo >> 'Dawson'); add: (#DeGrasse << #librarydemo >> 'De Grasse'); add: (#Decatur << #librarydemo >> 'Decatur'); add: (#DesBarres << #librarydemo >> 'Des Barres'); add: (#Doria << #librarydemo >> 'Doria'); add: (#DuguayTrouin << #librarydemo >> 'Duguay-Trouin'); add: (#Dumas << #librarydemo >> 'Dumas'); add: (#Esenc << #librarydemo >> 'Esenc'); add: (#Fletcher << #librarydemo >> 'Fletcher'); add: (#Ford << #librarydemo >> 'Ford'); add: (#Gaius << #librarydemo >> 'Gaius'); add: (#Garden << #librarydemo >> 'Garden'); add: (#Herreshoff << #librarydemo >> 'Herreshoff'); add: (#Hylan << #librarydemo >> 'Hylan'); add: (#Imakiire << #librarydemo >> 'Imakiire'); "add: (#J << #librarydemo >> 'J.');" add: (#Karlsefni << #librarydemo >> 'Karlsefni'); add: (#KerguelenTremarec << #librarydemo >> 'Kerguelen-Tremarec'); add: (#King << #librarydemo >> 'King'); add: (#Korzeniowski << #librarydemo >> 'Korzeniowski'); add: (#Kulczycki << #librarydemo >> 'Kulczycki'); add: (#L << #librarydemo >> 'L.'); add: (#Mickiewicz << #librarydemo >> 'Mickiewicz'); add: (#Munk << #librarydemo >> 'Munk'); add: (#Nagumo << #librarydemo >> 'Nagumo'); add: (#Nakhimov << #librarydemo >> 'Nakhimov'); add: (#Nansen << #librarydemo >> 'Nansen'); add: (#Napier << #librarydemo >> 'Napier'); add: (#Nepos << #librarydemo >> 'Nepos'); add: (#Oudray << #librarydemo >> 'Oudray'); add: (#Oughtred << #librarydemo >> 'Oughtred'); add: (#Payne << #librarydemo >> 'Payne'); add: (#Pellegrini << #librarydemo >> 'Pellegrini'); add: (#Pepys << #librarydemo >> 'Pepys'); add: (#Pinzon << #librarydemo >> 'Pinzon'); add: (#Pisani << #librarydemo >> 'Pisani'); add: (#Polo << #librarydemo >> 'Polo'); add: (#Pompeius << #librarydemo >> 'Pompeius'); add: (#Prien << #librarydemo >> 'Prien'); add: (#Quiros << #librarydemo >> 'Quiros'); add: (#Rasmusssen << #librarydemo >> 'Rasmusssen'); add: (#Reinel << #librarydemo >> 'Reinel'); add: (#Ribault << #librarydemo >> 'Ribault'); add: (#Rigaud << #librarydemo >> 'Rigaud'); add: (#Riou << #librarydemo >> 'Riou'); add: (#Roggeveen << #librarydemo >> 'Roggeveen'); add: (#Rozhestvensky << #librarydemo >> 'Rozhestvensky'); add: (#Ruyter << #librarydemo >> 'Ruyter'); add: (#Ryan << #librarydemo >> 'Ryan'); add: (#Sabran << #librarydemo >> 'Sabran'); add: (#Sanuto << #librarydemo >> 'Sanuto'); add: (#Schetky << #librarydemo >> 'Schetky'); add: (#Schouten << #librarydemo >> 'Schouten'); add: (#Selkirk << #librarydemo >> 'Selkirk'); add: (#Serres << #librarydemo >> 'Serres'); add: (#Semmes << #librarydemo >> 'Semmes'); add: (#Sniadecka << #librarydemo >> 'Sniadecka'); add: (#Spalding << #librarydemo >> 'Spalding'); add: (#Stambaugh << #librarydemo >> 'Stambaugh'); add: (#Suffren << #librarydemo >> 'Suffren'); add: (#Surcouf << #librarydemo >> 'Surcouf'); add: (#Tabarly << #librarydemo >> 'Tabarly'); add: (#Tattnall << #librarydemo >> 'Tattnall'); add: (#Tegetthof << #librarydemo >> 'Tegetthof'); add: (#Thurlow << #librarydemo >> 'Thurlow'); add: (#Tilman << #librarydemo >> 'Tilman'); add: (#Trompe << #librarydemo >> 'Trompe'); add: (#Togo << #librarydemo >> 'Togo'); add: (#Tordenskjold << #librarydemo >> 'Tordenskjold'); add: (#Toulouse << #librarydemo >> 'Toulouse'); add: (#Umberto << #librarydemo >> 'Umberto'); add: (#Vesconte << #librarydemo >> 'Vesconte'); add: (#Vespucci << #librarydemo >> 'Vespucci'); add: (#Vilkitsiy << #librarydemo >> 'Vilkitsiy'); add: (#Villaret << #librarydemo >> 'Villaret'); add: (#Villeneuve << #librarydemo >> 'Villeneuve'); add: (#Vivaldo << #librarydemo >> 'Vivaldo'); add: (#Weld << #librarydemo >> 'Weld'); add: (#White << #librarydemo >> 'White'); add: (#Woods << #librarydemo >> 'Woods'); add: (#Yamamoto << #librarydemo >> 'Yamamoto'); add: (#Yanez << #librarydemo >> 'Yanez'); add: (#Yarnell << #librarydemo >> 'Yarnell'); add: (#Yevgenov << #librarydemo >> 'Yevgenov'); add: (#Yokosuka << #librarydemo >> 'Yokosuka'); add: (#Zeebrugge << #librarydemo >> 'Zeebrugge'); add: (#Zimmer << #librarydemo >> 'Zimmer'); add: (#Zimmerman << #librarydemo >> 'Zimmerman'); add: (#Zubian << #librarydemo >> 'Zubian'); asArray)
initializeMaleFirstNames maleFirstNames := (OrderedCollection new add: (#Abel << #librarydemo >> 'Abel'); add: (#Adam << #librarydemo >> 'Adam'); add: (#Alphonse << #librarydemo >> 'Alphonse'); add: (#Amadeo << #librarydemo >> 'Amadeo'); add: (#Anatoly << #librarydemo >> 'Anatoly'); add: (#Andrea << #librarydemo >> 'Andrea'); add: (#Andreas << #librarydemo >> 'Andreas'); add: (#Antoine << #librarydemo >> 'Antoine'); add: (#Attilio << #librarydemo >> 'Attilio'); add: (#Baptiste << #librarydemo >> 'Baptiste'); add: (#Barnard << #librarydemo >> 'Barnard'); add: (#Baruch << #librarydemo >> 'Baruch'); add: (#Basil << #librarydemo >> 'Basil'); add: (#Bela << #librarydemo >> 'Bela'); add: (#Bernart << #librarydemo >> 'Bernart'); add: (#Bertran << #librarydemo >> 'Bertran'); add: (#Brendan << #librarydemo >> 'Brendan'); add: (#Cesar << #librarydemo >> 'Cesar'); add: (#Chay << #librarydemo >> 'Chay'); add: (#Chris << #librarydemo >> 'Chris'); add: (#Chuichi << #librarydemo >> 'Chuichi'); add: (#Claude << #librarydemo >> 'Claude'); add: (#Cyril << #librarydemo >> 'Cyril'); add: (#Dario << #librarydemo >> 'Dario'); add: (#David << #librarydemo >> 'David'); add: (#Diodorus << #librarydemo >> 'Diodorus'); add: (#Diogo << #librarydemo >> 'Diogo'); add: (#Douglas << #librarydemo >> 'Douglas'); add: (#Errol << #librarydemo >> 'Errol'); add: (#Fedor << #librarydemo >> 'Fedor'); add: (#Fernando << #librarydemo >> 'Fernando'); add: (#Fridtjof << #librarydemo >> 'Fridtjof'); add: (#Fritz << #librarydemo >> 'Fritz'); add: (#Gerardus << #librarydemo >> 'Gerardus'); add: (#Gilbert << #librarydemo >> 'Gilbert'); add: (#Giraut << #librarydemo >> 'Giraut'); add: (#Giuseppe << #librarydemo >> 'Giuseppe'); add: (#Gnaeus << #librarydemo >> 'Gnaeus'); add: (#Guilhem << #librarydemo >> 'Guilhem'); add: (#Gunther << #librarydemo >> 'Gunther'); add: (#Heihachiro << #librarydemo >> 'Heihachiro'); add: (#Hektor << #librarydemo >> 'Hektor'); add: (#Hernando << #librarydemo >> 'Hernando'); add: (#Herve << #librarydemo >> 'Herve'); add: (#Iain << #librarydemo >> 'Iain'); add: (#Isoroku << #librarydemo >> 'Isoroku'); add: (#Ivanovich << #librarydemo >> 'Ivanovich'); add: (#Jacques << #librarydemo >> 'Jacques'); add: (#Jan << #librarydemo >> 'Jan'); add: (#Jean << #librarydemo >> 'Jean'); add: (#Joel << #librarydemo >> 'Joel'); add: (#John << #librarydemo >> 'John'); add: (#Jorge << #librarydemo >> 'Jorge'); add: (#Jurgen << #librarydemo >> 'Jurgen'); add: (#Karl << #librarydemo >> 'Karl'); add: (#Ken << #librarydemo >> 'Ken'); add: (#Knud << #librarydemo >> 'Knud'); add: (#Krzystof << #librarydemo >> 'Krzystof'); add: (#Lemuel << #librarydemo >> 'Lemuel'); add: (#Lev << #librarydemo >> 'Lev'); add: (#Ludolph << #librarydemo >> 'Ludolph'); add: (#Luigi << #librarydemo >> 'Luigi'); add: (#Marc << #librarydemo >> 'Marc'); add: (#Marco << #librarydemo >> 'Marco'); add: (#Maarten << #librarydemo >> 'Maarten'); add: (#Marino << #librarydemo >> 'Marino'); add: (#Mathurin << #librarydemo >> 'Mathurin'); add: (#Michal << #librarydemo >> 'Michal'); add: (#Michiel << #librarydemo >> 'Michiel'); add: (#Mohammed << #librarydemo >> 'Mohammed'); add: (#Mustafa << #librarydemo >> 'Mustafa'); add: (#Nikolai << #librarydemo >> 'Nikolai'); add: (#Norman << #librarydemo >> 'Norman'); add: (#Olin << #librarydemo >> 'Olin'); add: (#Patricio << #librarydemo >> 'Patricio'); add: (#Pascual << #librarydemo >> 'Pascual'); add: (#Paul << #librarydemo >> 'Paul'); add: (#Pedro << #librarydemo >> 'Pedro'); add: (#Petrovich << #librarydemo >> 'Petrovich'); add: (#Pieter << #librarydemo >> 'Pieter'); "add: (#Q << #librarydemo >> 'Q.');" add: (#Raphael << #librarydemo >> 'Raphael'); add: (#Reginald << #librarydemo >> 'Reginald'); add: (#Roald << #librarydemo >> 'Roald'); add: (#Rob << #librarydemo >> 'Rob'); add: (#Rollin << #librarydemo >> 'Rollin'); add: (#Samuel << #librarydemo >> 'Samuel'); add: (#Semyon << #librarydemo >> 'Semyon'); add: (#Sextus << #librarydemo >> 'Sextus'); add: (#Stefan << #librarydemo >> 'Stefan'); add: (#Tadeusz << #librarydemo >> 'Tadeusz'); add: (#Teodor << #librarydemo >> 'Teodor'); add: (#Tevfic << #librarydemo >> 'Tevfic'); add: (#Thorfinn << #librarydemo >> 'Thorfinn'); add: (#Ugolino << #librarydemo >> 'Ugolino'); add: (#Ulysses << #librarydemo >> 'Ulysses'); add: (#Vettor << #librarydemo >> 'Vettor'); add: (#Vilhjalmur << #librarydemo >> 'Vilhjalmur'); add: (#Vincente << #librarydemo >> 'Vincente'); add: (#Vito << #librarydemo >> 'Vito'); add: (#Vitus << #librarydemo >> 'Vitus'); add: (#Wilhelm << #librarydemo >> 'Wilhelm'); "add: (#X << #librarydemo >> 'X.');" "add: (#Y << #librarydemo >> 'Y.');" add: (#Zinovi << #librarydemo >> 'Zinovi'); asArray)
initializeMaleMiddleNames maleMiddleNames := (OrderedCollection new add: (#Adlard << #librarydemo >> 'Adlard'); add: (#Alain << #librarydemo >> 'Alain'); add: (#Alexandre << #librarydemo >> 'Alexandre'); add: (#Alonzo << #librarydemo >> 'Alonzo'); add: (#Alvaro << #librarydemo >> 'Alvaro'); add: (#Alvise << #librarydemo >> 'Alvise'); add: (#Ambrose << #librarydemo >> 'Ambrose'); add: (#Amerigo << #librarydemo >> 'Amerigo'); add: (#Andrienszoon << #librarydemo >> 'Andrienszoon'); add: (#Anton << #librarydemo >> 'Anton'); add: (#Arleigh << #librarydemo >> 'Arleigh'); add: (#Arno << #librarydemo >> 'Arno'); add: (#Aymeri << #librarydemo >> 'Aymeri'); add: (#Augustine << #librarydemo >> 'Augustine'); add: (#Bartholomaus << #librarydemo >> 'Bartholomaus'); add: (#Belisarius << #librarydemo >> 'Belisarius'); add: (#Benedetto << #librarydemo >> 'Benedetto'); add: (#Bernhardus << #librarydemo >> 'Bernhardus'); add: (#Boris << #librarydemo >> 'Boris'); add: (#Christoval << #librarydemo >> 'Christoval'); add: (#Cornelis << #librarydemo >> 'Cornelis'); add: (#Cornelisz << #librarydemo >> 'Cornelisz'); add: (#Cuthbert << #librarydemo >> 'Cuthbert'); add: (#Diego << #librarydemo >> 'Diego'); add: (#Dudley << #librarydemo >> 'Dudley'); add: (#Duillius << #librarydemo >> 'Duillius'); add: (#Eratosthenes << #librarydemo >> 'Eratosthenes'); add: (#Ericus << #librarydemo >> 'Ericus'); add: (#Ernle << #librarydemo >> 'Ernle'); add: (#Eudoxus << #librarydemo >> 'Eudoxus'); add: (#Eugene << #librarydemo >> 'Eugene'); add: (#Fenimore << #librarydemo >> 'Fenimore'); add: (#Fernandez << #librarydemo >> 'Fernandez'); add: (#Flores << #librarydemo >> 'Flores'); add: (#Francois << #librarydemo >> 'Francois'); add: (#Francesco << #librarydemo >> 'Francesco'); add: (#Geoffrey << #librarydemo >> 'Geoffrey'); add: (#Gerhard << #librarydemo >> 'Gerhard'); add: (#Giovanni << #librarydemo >> 'Giovanni'); add: (#Graeme << #librarydemo >> 'Graeme'); add: (#Griffith << #librarydemo >> 'Griffith'); add: (#Henryk << #librarydemo >> 'Henryk'); add: (#Herlup << #librarydemo >> 'Herlup'); add: (#Hieronym << #librarydemo >> 'Hieronym'); add: (#Igor << #librarydemo >> 'Igor'); add: (#Isambard << #librarydemo >> 'Isambard'); add: (#Ivanov << #librarydemo >> 'Ivanov'); add: (#Jacob << #librarydemo >> 'Jacob'); add: (#Janszoon << #librarydemo >> 'Janszoon'); add: (#JeanBaptiste << #librarydemo >> 'Jean-Baptiste'); add: (#Jens << #librarydemo >> 'Jens'); add: (#Johan << #librarydemo >> 'Johan'); add: (#Jozef << #librarydemo >> 'Jozef'); add: (#Julius << #librarydemo >> 'Julius'); "add: (#K << #librarydemo >> 'K.');" add: (#Lech << #librarydemo >> 'Lech'); add: (#Leon << #librarydemo >> 'Leon'); add: (#Lucas << #librarydemo >> 'Lucas'); add: (#Luis << #librarydemo >> 'Luis'); add: (#Manrique << #librarydemo >> 'Manrique'); add: (#Marcin << #librarydemo >> 'Marcin'); add: (#MarinMarie << #librarydemo >> 'Marin-Marie'); add: (#Mario << #librarydemo >> 'Mario'); add: (#Mathieu << #librarydemo >> 'Mathieu'); add: (#Maurice << #librarydemo >> 'Maurice'); add: (#Menendez << #librarydemo >> 'Menendez'); add: (#Nathaniel << #librarydemo >> 'Nathaniel'); add: (#Nelson << #librarydemo >> 'Nelson'); add: (#Oswald << #librarydemo >> 'Oswald'); add: (#Owyn << #librarydemo >> 'Owyn'); add: (#Peder << #librarydemo >> 'Peder'); add: (#Petrovich << #librarydemo >> 'Petrovich'); add: (#Petrus << #librarydemo >> 'Petrus'); add: (#Picard << #librarydemo >> 'Picard'); add: (#Pierre << #librarydemo >> 'Pierre'); add: (#Philippe << #librarydemo >> 'Philippe'); add: (#Pythias << #librarydemo >> 'Pythias'); "add: (#Q << #librarydemo >> 'Q.');" add: (#Raimon << #librarydemo >> 'Raimon'); add: (#Raoul << #librarydemo >> 'Raoul'); add: (#Rene << #librarydemo >> 'Rene'); add: (#Reuben << #librarydemo >> 'Reuben'); add: (#Romeo << #librarydemo >> 'Romeo'); add: (#Sebastien << #librarydemo >> 'Sebastien'); add: (#Stepanovich << #librarydemo >> 'Stepanovich'); add: (#Stephan << #librarydemo >> 'Stephan'); add: (#Tedo << #librarydemo >> 'Tedo'); add: (#Thaddeus << #librarydemo >> 'Thaddeus'); add: (#Theodat << #librarydemo >> 'Theodat'); "add: (#U << #librarydemo >> 'U.');" add: (#Vasquez << #librarydemo >> 'Vasquez'); add: (#Victor << #librarydemo >> 'Victor'); add: (#Willem << #librarydemo >> 'Willem'); "add: (#X << #librarydemo >> 'X.');" add: (#Yulyevich << #librarydemo >> 'Yulyevich'); add: (#Yves << #librarydemo >> 'Yves'); "add: (#Z << #librarydemo >> 'Z.');" asArray)
initializeMaleTitles | oc | oc := OrderedCollection new. oc addLast: (#Mr << #librarydemo >> 'Mr.'). maleTitles := oc asArray.
</methods> <methods> Protocols.Library.PersonName class <category>utility</category>
randomFemaleFirstName ^( femaleFirstNames at: ( self randomPositiveIntegerWithMax: ( femaleFirstNames size ) ) ) asString
randomFemaleMiddleName ^( femaleMiddleNames at: ( self randomPositiveIntegerWithMax: ( femaleMiddleNames size ) ) ) asString
randomFemaleTitle ^( femaleTitles at: ( self randomPositiveIntegerWithMax: ( femaleTitles size ) ) ) asString
randomLastName ^( lastNames at: ( self randomPositiveIntegerWithMax: ( lastNames size ) ) ) asString
randomMaleFirstName ^( maleFirstNames at: ( self randomPositiveIntegerWithMax: ( maleFirstNames size ) ) ) asString
randomMaleMiddleName | siz ndx | siz := maleMiddleNames size. ndx := 1 + ( self randomIntegerLessThan: siz ). ^( maleMiddleNames at: ndx ) asString
randomMaleTitle | siz ndx | siz := maleTitles size. ndx := 1 + ( self randomIntegerLessThan: siz ). ^( maleTitles at: ndx ) asString
</methods> <methods> Protocols.Library.PersonName class <category>instance creation</category>
randomFemaleLDDataPersonName "((( LDDataPersonName randomFemaleLDDataPersonName )))" ^self title: self randomFemaleTitle firstName: self randomFemaleFirstName middleNames: self randomFemaleMiddleName lastName: self randomLastName
randomLDDataPersonName "((( LDDataPersonalName randomLDDataPersonName )))" | n | n := self randomIntegerLessThan: 2. ^( n == 0 ) ifTrue: [ self randomMaleLDDataPersonName ] ifFalse: [ self randomFemaleLDDataPersonName ]
randomMaleLDDataPersonName "((( LDDataPersonName randomMaleLDDataPersonName )))" ^self title: self randomMaleTitle firstName: self randomMaleFirstName middleNames: self randomMaleMiddleName lastName: self randomLastName
title: aString1 firstName: aString2 middleNames: aString3 lastName: aString4 ^( self new ) title: aString1; firstName: aString2; middleNames: aString3; lastName: aString4; yourself
</methods> <methods> Protocols.Library.LibraryService <category>accessing</category>
library ^library
library: aLDLibrary library := aLDLibrary
serviceCharge ^( serviceCharge isNil ) ifTrue: [ serviceCharge := self class defaultServiceCharge ] ifFalse: [ serviceCharge ]
serviceCharge: aFixedPoint serviceCharge := aFixedPoint
serviceId ^( serviceId isNil ) ifTrue: [ serviceId := self class defaultServiceId ] ifFalse: [ serviceId ]
serviceId: aSymbol serviceId := aSymbol
</methods> <methods> Protocols.Library.LibraryService <category>utility</category>
serviceFee ^self serviceCharge
</methods> <methods> Protocols.Library.LibraryService class <category>accessing</category>
defaultServiceCharge ^( defaultServiceCharge isNil ) ifTrue: [ defaultServiceCharge := FixedPoint numerator: 0 denominator: 100 scale: 2 ] ifFalse: [ defaultServiceCharge ]
defaultServiceId ^( defaultServiceId isNil ) ifTrue: [ defaultServiceId := self name ] ifFalse: [ defaultServiceId ]
</methods> <methods> Protocols.Library.SearchService <category>public api</category>
searchByAuthorsLastName: aString includeAffiliatedLibraries: aBoolean "receiver: LDSrvcSearch" "arguments: Symbol Boolean" "returns: Dictionary" "possible exceptions: " ^self searchServices: ( self searchServicesInclusive: aBoolean ) onAspect: #searchAuthorialLastNames withMatchString: aString
searchByExactTitle: aString includeAffiliatedLibraries: aBoolean "receiver: LDSrvcSearch" "arguments: Symbol Boolean" "returns: Dictionary" "possible exceptions: " ^self searchServices: ( self searchServicesInclusive: aBoolean ) onAspect: #searchTitles withMatchString: aString
searchByTitleWord: aString includeAffiliatedLibraries: aBoolean "receiver: LDSrvcSearch" "arguments: Symbol Boolean" "returns: Dictionary" "possible exceptions: " ^self searchServices: ( self searchServicesInclusive: aBoolean ) onAspect: #searchTitles withMatchString: ( '*', aString, '*' )
</methods> <methods> Protocols.Library.SearchService <category>private</category>
searchHoldingsOnAspect: aSymbol withMatchString: aString ^( library searchHoldingsOnAspect: aSymbol withMatchString: aString )
searchServices: anOrderedCollection onAspect: aSymbol withMatchString: aString | rd | rd := Dictionary new. anOrderedCollection do: [ :srv | rd addAll: ( srv searchHoldingsOnAspect: aSymbol withMatchString: aString ) ]. ^rd
searchServicesInclusive: aBoolean | oc | oc := OrderedCollection new. oc add: self. aBoolean ifTrue: [ library affiliatedLibraries do: [ :al | | ss | ( ( ss := ( al serviceById: SearchService defaultServiceId ) ) notNil ) ifTrue: [ oc add: ss ] ] ]. ^oc
</methods> <methods> Protocols.Library.SearchService class <category>class initialization</category>
initialize "((( LDSrvcSearch initialize )))" defaultServiceId := #SearchService
</methods> <methods> Protocols.Library.Transaction <category>accessing</category>
timestamp ^timestamp
timestamp: aTimestamp timestamp := aTimestamp
transactionId ^transactionId
transactionId: aDwordArray transactionId := aDwordArray
</methods> <methods> Protocols.Library.Transaction <category>initialize-release</category>
initialize timestamp := Timestamp now. transactionId := self class newTransactionId.
</methods> <methods> Protocols.Library.Transaction class <category>instance creation</category>
new ^super new initialize
</methods> <methods> Protocols.Library.Transaction class <category>utility</category>
newTransactionId | id | id := NextTransactionId. id at: 1 put: ( id at: 1 ) + 11. id at: 1 put: ( id at: 2 ) + 13. id at: 1 put: ( id at: 3 ) + 17. id at: 1 put: ( id at: 4 ) + 19. ^id
</methods> <methods> Protocols.Library.Transaction class <category>class initialization</category>
initialize "((( LDTrans initialize )))" NextTransactionId := DwordArray new: 4. NextTransactionId at: 1 put: ( 2 raisedTo: 15 ); at: 2 put: ( 2 raisedTo: 16 ); at: 3 put: ( 2 raisedTo: 30 ); at: 4 put: ( 2 raisedTo: 31 ).
</methods> <methods> Protocols.Library.HoldingTransaction <category>accessing</category>
holding ^holding
holding: aLDHolding holding := aLDHolding
</methods> <methods> Protocols.Library.RequestDueDateExtension <category>accessing</category>
newDueDate ^newDueDate
newDueDate: aDate newDueDate := aDate
</methods> <methods> Protocols.Library.FinancialTransaction <category>accessing</category>
amount ^amount
amount: aNumber amount := aNumber
</methods> <methods> Protocols.Library.FinancialTransaction class <category>instance creation</category>
amount: aNumber ^( self new ) amount: aNumber; yourself
</methods> <methods> Protocols.Library.Holding <category>accessing</category>
acquisitionCost ^acquisitionCost
acquisitionCost: aFixedPoint acquisitionCost := aFixedPoint
acquisitionDate ^acquisitionDate
acquisitionDate: aDate acquisitionDate := aDate
acquisitionNumber ^acquisitionNumber
acquisitionNumber: aLargePositiveInteger acquisitionNumber := aLargePositiveInteger
catalogNumber ^catalogNumber
catalogNumber: aLDCatalogNumber catalogNumber := aLDCatalogNumber
collectionId ^collectionId
collectionId: aCollectionId collectionId := aCollectionId
dueDate ^dueDate
dueDate: aDate dueDate := aDate
libraryName ^libraryName
libraryName: aString libraryName := aString
statusId ^statusId
statusId: aStatusId statusId := aStatusId
</methods> <methods> Protocols.Library.Holding <category>utility</category>
availableForLDSrvcCopyRequest ^false
isLoaned ^statusId == ( (#loaned << #librarydemo >> 'loaned') asString asSymbol )
isShelved ^statusId == ( (#shelved << #librarydemo >> 'shelved') asString asSymbol )
searchAuthorialLastNames ^self subclassResponsibility
searchTitles ^self subclassResponsibility
</methods> <methods> Protocols.Library.Holding <category>initialize-release</category>
initialize super initialize. acquisitionCost := self class randomAcquisitionCost. acquisitionDate := self class randomAcquisitionDate. acquisitionNumber := self class newAcquisitionNumber. catalogNumber := CatalogNumber randomLDDataCatalogNumber. "collectionId := nil." "dueDate := nil." "libraryName := nil." statusId := (#shelved << #librarydemo >> 'shelved') asString asSymbol
</methods> <methods> Protocols.Library.Holding class <category>class initialization</category>
initialize "((( LDHolding initialize )))" NextAcquisitionNumber := SmallInteger maxVal + 1. self initializeCollectionIds. self initializeStatusIds. collectionIds := #( #'Books on Tape' #'Biography and Autobiography' #'Braille' #'Computer Science and Mathematics' #'Electronic Books' #'Historical Fiction' #'History and Archaeology' #'Instructional Videos' #'Large Print' #'Literature' #'Meteorology' #'Movies' #'Musicology' #'Musical Recordings' #'Mystery' #'Naval Architecture' #'Nautical History and Literature' #'Philosophy' #Poetry' #'Rare Books' #'Readings' #Reference' #'Science Fiction' #'Theology and Religion' ). statusIds := ( Array new: 7 ) at: 1 put: #shelving; at: 2 put: #shelved; at: 3 put: #loaned; at: 4 put: #shipping; at: 5 put: #receiving; at: 6 put: #bindery; at: 7 put: #cataloging; yourself.
initializeCollectionIds collectionIds := ( OrderedCollection new ) add: (#BooksOnTape << #librarydemo >> 'Books on Tape') asString asSymbol; add: (#BiographyAndAutobiography << #librarydemo >> 'Biography and Autobiography') asString asSymbol; add: (#Braille << #librarydemo >> 'Braille') asString asSymbol; add: (#ComputerScienceAndMathematics << #librarydemo >> 'Computer Science and Mathematics') asString asSymbol; add: (#DigitalBooks << #librarydemo >> 'Digital Books') asString asSymbol; add: (#HistoricalFiction << #librarydemo >> 'Historical Fiction') asString asSymbol; add: (#HistoryandArchaeology << #librarydemo >> 'History and Archaeology') asString asSymbol; add: (#InstructionalVideos << #librarydemo >> 'Instructional Videos') asString asSymbol; add: (#LargePrint << #librarydemo >> 'Large Print') asString asSymbol; add: (#Literature << #librarydemo >> 'Literature') asString asSymbol; add: (#Meteorology << #librarydemo >> 'Meteorology') asString asSymbol; add: (#Movies << #librarydemo >> 'Movies') asString asSymbol; add: (#Musicology << #librarydemo >> 'Musicology') asString asSymbol; add: (#MusicalRecordings << #librarydemo >> 'Musical Recordings') asString asSymbol; add: (#Mystery << #librarydemo >> 'Mystery') asString asSymbol; add: (#NavalArchitecture << #librarydemo >> 'Naval Architecture') asString asSymbol; add: (#NauticalHistoryAndLiterature << #librarydemo >> 'Nautical History and Literature') asString asSymbol; add: (#Philosophy << #librarydemo >> 'Philosophy') asString asSymbol; add: (#Poetry << #librarydemo >> 'Poetry') asString asSymbol; add: (#RareBooks << #librarydemo >> 'Rare Books') asString asSymbol; add: (#Readings << #librarydemo >> 'Readings') asString asSymbol; add: (#Reference << #librarydemo >> 'Reference') asString asSymbol; add: (#ScienceFiction << #librarydemo >> 'Science Fiction') asString asSymbol; add: (#TheologyAndReligion << #librarydemo >> 'Theology and Religion') asString asSymbol; asArray
initializeStatusIds statusIds := ( Array new: 8 ) at: 1 put: (#shelving << #librarydemo >> 'shelving') asString asSymbol; at: 2 put: (#shelved << #librarydemo >> 'shelved') asString asSymbol; at: 3 put: (#loaned << #librarydemo >> 'loaned') asString asSymbol; at: 4 put: (#shipping << #librarydemo >> 'shipping') asString asSymbol; at: 5 put: (#receiving << #librarydemo >> 'receiving') asString asSymbol; at: 6 put: (#bindery << #librarydemo >> 'bindery') asString asSymbol; at: 7 put: (#cataloging << #librarydemo >> 'cataloging') asString asSymbol; at: 8 put: (#copying << #librarydemo >> 'copying') asString asSymbol; yourself
</methods> <methods> Protocols.Library.Holding class <category>utility</category>
newAcquisitionNumber ^NextAcquisitionNumber := ( NextAcquisitionNumber + 1 ).
randomAcquisitionCost ^FixedPoint numerator: ( 2900 + ( self randomIntegerLessThan: 9700 ) ) denominator: 100 scale: 2
randomAcquisitionDate "... assume the library opened a year ago." ^Date today subtractDays: ( self randomIntegerLessThan: 365 )
</methods> <methods> Protocols.Library.Holding class <category>accessing</category>
collectionIds ^collectionIds
statusIds ^statusIds
</methods> <methods> Protocols.Library.ShipPlan <category>accessing</category>
architects ^architects
architects: anArray ^architects := anArray
numberOfSheets ^numberOfSheets
numberOfSheets: aSmallInteger numberOfSheets := aSmallInteger
scale ^scale
scale: aFraction scale := aFraction
sheetDimensions ^sheetDimensions
sheetDimensions: aPoint sheetDimensions := aPoint
shipName ^shipName
shipName: aString shipName := aString
yearDrawn ^yearDrawn
yearDrawn: aSmallInteger yearDrawn := aSmallInteger
</methods> <methods> Protocols.Library.ShipPlan <category>utility</category>
availableForLDSrvcCopyRequest ^true
searchAuthorialLastNames ^( architects collect: [ :x | x name lastName ] ) asSet
searchTitles ^Set with: shipName
</methods> <methods> Protocols.Library.ShipPlan <category>initialize-release</category>
initialize super initialize. "architects := nil." numberOfSheets := self class randomNumberOfSheets. scale := self class randomScale. sheetDimensions := self class randomSheetDimensions. "shipName := nil." yearDrawn := self class randomYearDrawn.
</methods> <methods> Protocols.Library.ShipPlan class <category>class initialization</category>
initialize "((( LDHoldingShipPlan initialize )))" self initializeShipNames
initializeShipNames shipNames := (OrderedCollection new add: (#Achates << #librarydemo >> 'Achates'); add: (#Ailenroc << #librarydemo >> 'Ailenroc'); add: (#Alarm << #librarydemo >> 'Alarm'); add: (#AnneGallant << #librarydemo >> 'Anne Gallant'); add: (#Arethusa << #librarydemo >> 'Arethusa'); add: (#Astral << #librarydemo >> 'Astral'); add: (#Barnswallow << #librarydemo >> 'Barnswallow'); add: (#BlackBark << #librarydemo >> 'Black Bark'); add: (#Bluefin << #librarydemo >> 'Bluefin'); add: (#Bluejay << #librarydemo >> 'Bluejay'); add: (#BlueWater << #librarydemo >> 'Blue Water'); add: (#Bobcat << #librarydemo >> 'Bobcat'); add: (#BonnieLassie << #librarydemo >> 'Bonnie Lassie'); add: (#Cayuse << #librarydemo >> 'Cayuse'); add: (#Christmas << #librarydemo >> 'Christmas'); add: (#Congar << #librarydemo >> 'Congar'); add: (#Diana << #librarydemo >> 'Diana'); add: (#Dispatch << #librarydemo >> 'Dispatch'); add: (#Dormouse << #librarydemo >> 'Dormouse'); add: (#DueRepulse << #librarydemo >> 'Due Repulse'); add: (#Enterprise << #librarydemo >> 'Enterprise'); add: (#FalconInTheFetterlock << #librarydemo >> 'Falcon in the Fetterlock'); add: (#Felisi << #librarydemo >> 'Felisi'); add: (#Gadget << #librarydemo >> 'Gadget'); add: (#Growler << #librarydemo >> 'Growler'); add: (#Halcyon << #librarydemo >> 'Halcyon'); add: (#Highlander << #librarydemo >> 'Highlander'); add: (#Istalena << #librarydemo >> 'Istalena'); add: (#Javelin << #librarydemo >> 'Javelin'); add: (#Kingfisher << #librarydemo >> 'Kingfisher'); add: (#Lagavulin << #librarydemo >> 'Lagavulin'); add: (#LaVolatilla << #librarydemo >> 'La Volatilla'); add: (#Lightning << #librarydemo >> 'Lightning'); add: (#Lion << #librarydemo >> 'Lion'); add: (#LiveYankee << #librarydemo >> 'Live Yankee'); add: (#Lizard << #librarydemo >> 'Lizard'); add: (#MadreDeDios << #librarydemo >> 'Madre de Dios'); add: (#Mandalay << #librarydemo >> 'Mandalay'); add: (#Marjelia << #librarydemo >> 'Marjelia'); add: (#MaryRose << #librarydemo >> 'Mary Rose'); add: (#Mitena << #librarydemo >> 'Mitena'); add: (#Nautilus << #librarydemo >> 'Nautilus'); add: (#Nimbus << #librarydemo >> 'Nimbus'); add: (#Nina << #librarydemo >> 'Nina'); add: (#Ninette << #librarydemo >> 'Ninette'); add: (#NorEaster << #librarydemo >> 'Nor''Easter'); add: (#Ophiucus << #librarydemo >> 'Ophiucus'); add: (#Pawnee << #librarydemo >> 'Pawnee'); add: (#Phalarope << #librarydemo >> 'Phalarope'); add: (#Potemkin << #librarydemo >> 'Potemkin'); add: (#Prestige << #librarydemo >> 'Prestige'); add: (#Questa << #librarydemo >> 'Questa'); add: (#Rainbow << #librarydemo >> 'Rainbow'); add: (#Ranger << #librarydemo >> 'Ranger'); add: (#Rawalpindi << #librarydemo >> 'Rawalpindi'); add: (#Retriever << #librarydemo >> 'Retriever'); add: (#RoaringForty << #librarydemo >> 'Roaring Forty'); add: (#RoseGalley << #librarydemo >> 'Rose Galley'); add: (#Rowdy << #librarydemo >> 'Rowdy'); add: (#Rufina << #librarydemo >> 'Rufina'); add: (#Siva << #librarydemo >> 'Siva'); add: (#Tere << #librarydemo >> 'Tere'); add: (#Ticonderoga << #librarydemo >> 'Ticonderoga'); add: (#Tidbit << #librarydemo >> 'Tidbit'); add: (#Tinavire << #librarydemo >> 'Tinavire'); add: (#Tioga << #librarydemo >> 'Tioga'); add: (#Tradition << #librarydemo >> 'Tradition'); add: (#TregoRonnyger << #librarydemo >> 'Trego Ronnyger'); add: (#Unicorn << #librarydemo >> 'Unicorn'); add: (#Valcour << #librarydemo >> 'Valcour'); add: (#Valiant << #librarydemo >> 'Valiant'); add: (#Vieserre << #librarydemo >> 'Vieserre'); add: (#Walrus << #librarydemo >> 'Walrus'); add: (#Wasp << #librarydemo >> 'Wasp'); add: (#Whirlwind << #librarydemo >> 'Whirlwind'); add: (#Xanthippe << #librarydemo >> 'Xanthippe'); add: (#Yankee << #librarydemo >> 'Yankee'); add: (#Zanzibar << #librarydemo >> 'Zanzibar'); asArray)
</methods> <methods> Protocols.Library.ShipPlan class <category>utility</category>
randomArchitects | spread n a | spread := #[ 0 1 1 1 1 1 1 1 2 2 2 3 3 ]. n := spread at: ( self randomPositiveIntegerWithMax: spread size ). a := Array new: n. 1 to: n do: [ :ndx | a at: ndx put: ( AuthorialName authorialType: (#architect << #librarydemo >> 'architect') asString asSymbol name: ( PersonName randomLDDataPersonName ) ) ]. ^a
randomNumberOfSheets ^3 + ( self randomPositiveIntegerWithMax: 7 )
randomScale "((( LDShipPlan randomScale )))" ^1 / ( 1 + ( self randomPositiveIntegerWithMax: 281 ) )
randomSheetDimensions ^ (11.0 + ( self randomFloatLessThan: 41.0 ) ) @ ( 29.0 + ( self randomFloatLessThan: 43.0 ) )
randomShipName ^( shipNames at: ( self randomPositiveIntegerWithMax: shipNames size ) ) asString
randomYearDrawn | y d | y := Date today year. d := y - 1500. ^1500 + ( self randomIntegerLessThan: d )
</methods> <methods> Protocols.Library.ShipPlan class <category>instance creation</category>
architects: anArray shipName: aString ^( self new ) architects: anArray; shipName: aString; yourself
randomLDHoldingShipPlan "((( LDHoldingShipPlan randomLDHoldingShipPlan )))" ^( self architects: self randomArchitects shipName: self randomShipName ) collectionId: (#NavalArchitecture << #librarydemo >> 'Naval Architecture') asString asSymbol
</methods> <methods> Protocols.Library.PhysicalAddress <category>accessing</category>
city ^city
city: aString city := aString
country ^country
country: aSymbol country := aSymbol
postalCode ^postalCode
postalCode: aString postalCode := aString
stateOrProvince ^stateOrProvince
stateOrProvince: aSymbol stateOrProvince := aSymbol
streetAddress1 ^streetAddress1
streetAddress1: aString streetAddress1 := aString
streetAddress2 ^streetAddress2
streetAddress2: aString streetAddress2 := aString
</methods> <methods> Protocols.Library.PhysicalAddress <category>printing</category>
printOn: stream streetAddress1 ifNotNil: [ stream nextPutAll: streetAddress1; nextPutAll: ', ' ]. streetAddress2 ifNotNil: [ stream nextPutAll: streetAddress2; nextPutAll: ', ' ]. city ifNotNil: [ stream nextPutAll: city; nextPutAll: ', ' ]. stateOrProvince ifNotNil: [ stream nextPutAll: stateOrProvince; nextPutAll: ', ' ]. postalCode ifNotNil: [ stream nextPutAll: postalCode; nextPutAll: ', ' ]. country ifNotNil: [ stream nextPutAll: country; nextPutAll: ', ' ].
</methods> <methods> Protocols.Library.PhysicalAddress class <category>utility</category>
randomStreetAddress1 | siz ndx str | siz := address1StreetNames size. ndx := 1 + ( self randomIntegerLessThan: siz ). str := WriteStream on: ( String new: 16 ). str nextPutAll: ( 1 + ( self randomIntegerLessThan: 103 ) ) printString; nextPut: Character space; nextPutAll: ( address1StreetNames at: ndx ) asString; nextPut: Character space; nextPutAll: (#Road << #librarydemo >> 'Road') asString. ^str contents
randomStreetAddress2 | str bool | str := WriteStream on: ( String new: 16 ). bool := ( self randomIntegerLessThan: 3 ) == 2. bool ifTrue: [ | siz ndx | siz := address2Descriptions size. ndx := 1 + ( self randomIntegerLessThan: siz ). str nextPutAll: ( address2Descriptions at: ndx ) asString; nextPut: Character space; nextPutAll: ( 1 + ( self randomIntegerLessThan: 73 ) ) printString ]. ^str contents
</methods> <methods> Protocols.Library.PhysicalAddress class <category>class initialization</category>
initialize "((( LDDataPhysicalAddress initialize )))" self initializeAddress1StreetNames. self initializeAddress2Descriptions.
initializeAddress1StreetNames | oc | oc := ( OrderedCollection new ) add: (#Admiralty << #librarydemo >> 'Admiralty'); add: (#Alfa << #librarydemo >> 'Alfa'); add: (#Artemon << #librarydemo >> 'Artemon'); add: (#BarcaLonga << #librarydemo >> 'Barca Longa'); add: (#Binnacle << #librarydemo >> 'Binnacle'); add: (#Bravo << #librarydemo >> 'Bravo'); add: (#Caravel << #librarydemo >> 'Caravel'); add: (#Carling << #librarydemo >> 'Carling'); add: (#Carrack << #librarydemo >> 'Carrack'); add: (#Caisson << #librarydemo >> 'Caisson'); add: (#Catharpings << #librarydemo >> 'Catharpings'); add: (#Charlie << #librarydemo >> 'Charlie'); add: (#Chubasco << #librarydemo >> 'Chubasco'); add: (#Culverin << #librarydemo >> 'Culverin'); add: (#Davit << #librarydemo >> 'Davit'); add: (#Diaphone << #librarydemo >> 'Diaphone'); add: (#Delta << #librarydemo >> 'Delta'); add: (#Echo << #librarydemo >> 'Echo'); add: (#Ecliptic << #librarydemo >> 'Ecliptic'); add: (#Equinoctial << #librarydemo >> 'Equinoctial'); add: (#Esnecca << #librarydemo >> 'Esnecca'); add: (#Fairlead << #librarydemo >> 'Fairlead'); add: (#Flotsam << #librarydemo >> 'Flotsam'); add: (#Foxtrot << #librarydemo >> 'Foxtrot'); add: (#Gaiassa << #librarydemo >> 'Gaiassa'); add: (#Golf << #librarydemo >> 'Golf'); add: (#Gregale << #librarydemo >> 'Gregale'); add: (#Hailshot << #librarydemo >> 'Hailshot'); add: (#Hank << #librarydemo >> 'Hank'); add: (#Hawser << #librarydemo >> 'Hawser'); add: (#Hotel << #librarydemo >> 'Hotel'); add: (#Idlers << #librarydemo >> 'Idlers'); add: (#India << #librarydemo >> 'India'); add: (#Jackstay << #librarydemo >> 'Jackstay'); add: (#Jiggers << #librarydemo >> 'Jiggers'); add: (#Juliett << #librarydemo >> 'Juliett'); add: (#Kauskip << #librarydemo >> 'Kauskip'); add: (#Killick << #librarydemo >> 'Killick'); add: (#Kilo << #librarydemo >> 'Kilo'); add: (#Lagan << #librarydemo >> 'Lagan'); add: (#Lazaretto << #librarydemo >> 'Lazaretto'); add: (#Lima << #librarydemo >> 'Lima'); add: (#Manila << #librarydemo >> 'Manila'); add: (#Mike << #librarydemo >> 'Mike'); add: (#Mitre << #librarydemo >> 'Mitre'); add: (#Neap << #librarydemo >> 'Neap'); add: (#Nettle << #librarydemo >> 'Nettle'); add: (#Nipper << #librarydemo >> 'Nipper'); add: (#November << #librarydemo >> 'November'); add: (#Offing << #librarydemo >> 'Offing'); add: (#Oscar << #librarydemo >> 'Oscar'); add: (#Otter << #librarydemo >> 'Otter'); add: (#Pirogue << #librarydemo >> 'Pirogue'); add: (#Proa << #librarydemo >> 'Proa'); add: (#Quadrant << #librarydemo >> 'Quadrant'); add: (#Quay << #librarydemo >> 'Quay'); add: (#Quebec << #librarydemo >> 'Quebec'); add: (#Ribband << #librarydemo >> 'Ribband'); add: (#Ringtail << #librarydemo >> 'Ringtail'); add: (#Romeo << #librarydemo >> 'Romeo'); add: (#Scantlings << #librarydemo >> 'Scantlings'); add: (#Sextant << #librarydemo >> 'Sextant'); add: (#Sierra << #librarydemo >> 'Sierra'); add: (#Sirocco << #librarydemo >> 'Sirocco'); add: (#Swivel << #librarydemo >> 'Swivel'); add: (#Tango << #librarydemo >> 'Tango'); add: (#Thrum << #librarydemo >> 'Thrum'); add: (#Timoneer << #librarydemo >> 'Timoneer'); add: (#Ullage << #librarydemo >> 'Ullage'); add: (#Uniform << #librarydemo >> 'Uniform'); add: (#Uphroe << #librarydemo >> 'Uphroe'); add: (#Vakka << #librarydemo >> 'Vakka'); add: (#Victor << #librarydemo >> 'Victor'); add: (#Victualler << #librarydemo >> 'Victualler'); add: (#Whaleboat << #librarydemo >> 'Whaleboat'); add: (#Wheelhouse << #librarydemo >> 'Wheelhouse'); add: (#Whiskey << #librarydemo >> 'Whiskey'); add: (#Xebec << #librarydemo >> 'Xebec'); add: (#Yankee << #librarydemo >> 'Yankee'); add: (#Yawl << #librarydemo >> 'Yawl'); add: (#Yuloh << #librarydemo >> 'Yuloh'); add: (#Zenith << #librarydemo >> 'Zenith'); add: (#Zulu << #librarydemo >> 'Zulu'); yourself. address1StreetNames := oc asArray
initializeAddress2Descriptions | oc | oc := OrderedCollection new. oc addAll: (Array with: (#Building << #librarydemo >> 'Building') with: (#Unit << #librarydemo >> 'Unit') with: (#RuralRoute << #librarydemo >> 'Rural Route')). address2Descriptions := oc asArray
</methods> <methods> Protocols.Library.PhysicalAddress class <category>instance creation</category>
randomLDDataPhysicalAddress " self randomLDDataPhysicalAddress " ^self streetAddress1: self randomStreetAddress1 streetAddress2: self randomStreetAddress2 city: (#PortNowhere << #librarydemo >> 'Port Nowhere') asString stateOrProvince: (#California << #librarydemo >> 'California') asString asSymbol postalCode: '99999' country: (#USA << #librarydemo >> 'United States of America') asString asSymbol
streetAddress1: aString1 streetAddress2: aString2 city: aString3 stateOrProvince: aString4 postalCode: aString5 country: aString6 ^( self new ) streetAddress1: aString1; streetAddress2: aString2; city: aString3; stateOrProvince: aString4; postalCode: aString5; country: aString6; yourself
</methods> <methods> Protocols.Library.Agent <category>accessing</category>
account ^account
account: aAccount account := aAccount
borrowedHoldings ^borrowedHoldings
borrowedHoldings: aBag borrowedHoldings := aBag
emailAddresses ^emailAddresses
emailAddresses: anArray emailAddresses := anArray
physicalAddress ^physicalAddress
physicalAddress: aPhysicalAddress ^physicalAddress := aPhysicalAddress
serviceApprovals ^serviceApprovals
serviceApprovals: aSet ^serviceApprovals := aSet
telephoneNumbers ^telephoneNumbers
telephoneNumbers: aSet ^telephoneNumbers := aSet
</methods> <methods> Protocols.Library.Agent <category>initialize-release</category>
initialize account := Account new. borrowedHoldings := Bag new. emailAddresses := Array new. physicalAddress := PhysicalAddress randomLDDataPhysicalAddress. serviceApprovals := self class randomServiceApprovals. telephoneNumbers := Set new.
</methods> <methods> Protocols.Library.Agent class <category>class initialization</category>
initialize "((( LDAgent initialize )))" NextAgentId := #( 65 65 65 ). self initializeServiceApprovals.
initializeServiceApprovals serviceApprovals := #( #GeneralPublicService #SearchService #WeatherForecastService #CopyRequestService ) asSet
</methods> <methods> Protocols.Library.Agent class <category>utility</category>
newAgentId "Cycles agent identifiers from 'AAA' through 'ZZZ'." | a b c | a := NextAgentId at: 1. b := NextAgentId at: 2. c := NextAgentId at: 3. ( c == 90 ) ifFalse: [ c := c + 1 ] ifTrue: [ c := 65. ( b == 90 ) ifFalse: [ b := b + 1 ] ifTrue: [ b := 65. ( a == 90 ) ifFalse: [ a := a + 1 ] ifTrue: [ a := 65 ] ] ]. NextAgentId := ( Array with: a with: b with: c ). ^String withAll: ( NextAgentId collect: [ :z | z asCharacter ] )
randomServiceApprovals | s n | s := Set new: 4. s addAll: #( #GeneralPublicService #SearchService #WeatherForecastService ). n := self randomPositiveIntegerWithMax: 5. ( n == 5 ) ifTrue: [ s add: #CopyRequestService ]. ^s
</methods> <methods> Protocols.Library.OrganizationName <category>printing</category>
printOn: aStream aStream nextPutAll: name
</methods> <methods> Protocols.Library.OrganizationName <category>accessing</category>
name ^name
name: aString name := aString
</methods> <methods> Protocols.Library.OrganizationName <category>utility</category>
emailAddresses | str tok | str := WriteStream on: ( String new: 26 ). tok := name tokensBasedOn: Character space. 1 to: ( tok size - 1 ) do: [ :ndx | ( ( ( tok at: ndx ) at: 1 ) isUppercase ) ifTrue: [ str nextPutAll: ( ( tok at: ndx ) copyFrom: 1 to: 2 ) ] ]. str nextPutAll: ( tok last copyFrom: 1 to: ( ( 12 - str size ) min: ( tok last size ) ) ); nextPutAll: (#portnowherenet << #librarydemo >> '@portnowhere.net') asString. ^Array with: ( EmailAddress address: str contents asLowercase description: (#Business << #librarydemo >> 'Business') asString )
</methods> <methods> Protocols.Library.OrganizationName class <category>instance creation</category>
name: aString ^( self new ) name: aString; yourself
randomLDDataOrganizationName "((( self randomLDDataOrganizationName )))" | str | str := WriteStream on: ( String new: 64 ). str nextPutAll: PersonName randomLastName; nextPut: Character space; nextPutAll: self randomOrganizationType. ^self name: str contents
</methods> <methods> Protocols.Library.OrganizationName class <category>class initialization</category>
initialize "((( LDDataOrganizationName initialize )))" self initializeOrganizationTypes
initializeOrganizationTypes organizationTypes := (OrderedCollection new add: (#BaitShop << #librarydemo >> 'Bait Shop'); add: (#Barbershop << #librarydemo >> 'Barbershop'); add: (#BoatStorage << #librarydemo >> 'Boat Storage'); add: (#Cannery << #librarydemo >> 'Cannery'); add: (#Chandlery << #librarydemo >> 'Chandlery'); add: (#Chartering << #librarydemo >> 'Chartering'); add: (#Clothiers << #librarydemo >> 'Clothiers'); add: (#Cordage << #librarydemo >> 'Cordage'); add: (#GeneralContracting << #librarydemo >> 'General Contracting'); add: (#GeneralStore << #librarydemo >> 'General Store'); add: (#Hotel << #librarydemo >> 'Hotel'); add: (#KayakAndCanoe << #librarydemo >> 'Kayak and Canoe'); add: (#LoftingServices << #librarydemo >> 'Lofting Services'); add: (#Marina << #librarydemo >> 'Marina'); add: (#MarineElectronics << #librarydemo >> 'Marine Electronics'); add: (#MarineSalvage << #librarydemo >> 'Marine Salvage'); add: (#MarineSurvey << #librarydemo >> 'Marine Survey'); add: (#NavalArchitecture << #librarydemo >> 'Naval Architecture'); add: (#NavigationSupply << #librarydemo >> 'Navigation Supply'); add: (#PaperMill << #librarydemo >> 'Paper Mill'); add: (#PilotService << #librarydemo >> 'Pilot Service'); add: (#Restaurant << #librarydemo >> 'Restaurant'); add: (#RiggingSupply << #librarydemo >> 'Rigging Supply'); add: (#RopeWalk << #librarydemo >> 'Rope Walk'); add: (#Sailmakers << #librarydemo >> 'Sailmakers'); add: (#ShipBuilding << #librarydemo >> 'Ship Building'); add: (#SportFishing << #librarydemo >> 'Sport Fishing'); add: (#Supermarket << #librarydemo >> 'Supermarket'); add: (#VacationRental << #librarydemo >> 'Vacation Rental'); add: (#Victuallers << #librarydemo >> 'Victuallers'); asArray)
</methods> <methods> Protocols.Library.OrganizationName class <category>utility</category>
randomOrganizationType ^( organizationTypes at: ( self randomPositiveIntegerWithMax: ( organizationTypes size ) ) ) asString
</methods> <methods> Protocols.Library.LoanedHolding <category>initialize-release</category>
initialize super initialize. reservationList := LinkedList new.
</methods> <methods> Protocols.Library.AgentTransaction <category>accessing</category>
agentId ^agentId
agentId: aSymbol agentId := aSymbol
</methods> <methods> Protocols.Library.AgentTransaction class <category>instance creation</category>
agentId: aSymbol ^( self new ) agentId: aSymbol; yourself
</methods> <methods> Protocols.Library.ServiceTransaction <category>accessing</category>
serviceId ^serviceId
serviceId: aSymbol serviceId := aSymbol
</methods> <methods> Protocols.Library.GeneralPublicService <category>public api</category>
holdingByAcquisitionNumber: aLDHolding_acquisitionNumber ^library ownedHoldings detect: [ :x | x acquisitionNumber = aLDHolding_acquisitionNumber ] ifNone: [ HoldingNotFound raiseErrorString: ((#NoHoldingFoundWithAcquisitionNumber1s << #librarydemo >> 'No holding found with acquisition number <1s>.') expandMacrosWith: aLDHolding_acquisitionNumber printString) ]
lastFiveTransactionsForPatronId: aLDAgentPatron_patronId | patron th | patron := library patronById: aLDAgentPatron_patronId. th := patron account transactionHistory. ^( th size < 5 ) ifTrue: [ th ] ifFalse: [ th copyFrom: ( th size - 4 ) to: ( th size ) ]
libraryServicesDictionary ^library services
libraryServicesIds ^library services keys
providesServices ^library services isEmpty not
</methods> <methods> Protocols.Library.GeneralPublicService class <category>class initialization</category>
initialize "((( LDSrvcGeneralPublic initialize )))" defaultServiceCharge := FixedPoint numerator: 0 denominator: 100 scale: 2. defaultServiceId := #GeneralPublicService
</methods> <methods> Protocols.Library.CatalogNumber <category>accessing</category>
part1 ^part1
part1: aTwoByteString part1 := aTwoByteString
part2 ^part2
part2: aByteArray part2 := aByteArray
part3 ^part3
part3: aDouble part3 := aDouble
part4 ^part4
part4: aCharacter part4 := aCharacter
</methods> <methods> Protocols.Library.CatalogNumber class <category>class initialization</category>
initialize "((( LDDataCatalogNumber initialize )))" nextPart3 := 281 / 7.
</methods> <methods> Protocols.Library.CatalogNumber class <category>utility</category>
newPart1 "Generates the TwoByteString part of an LDCatalogNumber." | str | str := String new: 2. 1 to: 2 do: [ :ndx | str at: ndx put: ( Character value: ( 65 + ( self randomIntegerLessThan: 26 ) ) ) ]. ^str asTwoByteString
newPart2 "Generates the ByteArray part of a LDCatalogNumber." | ba | ba := ByteArray new: 7. 1 to: 7 do: [ :ndx | ba at: ndx put: ( self randomIntegerLessThan: 256 ) ]. ^ba
newPart3 "Cycles the Double part of a LDCatalogNumber." nextPart3 := ( nextPart3 numerator + 7 ) / ( nextPart3 denominator + 11 ). ^nextPart3 asDouble
newPart4 "Generates the Character part of an LDCatalogNumber." ^Character value: ( 97 + ( self randomIntegerLessThan: 26 ) )
</methods> <methods> Protocols.Library.CatalogNumber class <category>instance creation</category>
part1: aTwoByteString part2: aByteArray part3: aDouble part4: aCharacter ^( self new ) part1: aTwoByteString; part2: aByteArray; part3: aDouble; part4: aCharacter; yourself
randomLDDataCatalogNumber "((( LDDataCatalogNumber randomLDDataCatalogNumber )))" ^self part1: self newPart1 part2: self newPart2 part3: self newPart3 part4: self newPart4
</methods> <methods> Protocols.Library.Patron <category>accessing</category>
patronId ^patronId
patronId: aPatronId patronId := aPatronId
patronName ^patronName
patronName: aPersonNameOrOrganizationName patronName := aPersonNameOrOrganizationName. emailAddresses := aPersonNameOrOrganizationName emailAddresses
</methods> <methods> Protocols.Library.Patron <category>printing</category>
printOn: aStream aStream nextPut: $(; nextPutAll: self class name; nextPut: Character space; print: patronName; nextPut: $)
</methods> <methods> Protocols.Library.Patron <category>initialize-release</category>
initialize super initialize. patronId := self class newPatronId. "patronName := nil."
</methods> <methods> Protocols.Library.Patron class <category>instance creation</category>
randomLDPatron "((( LDAgentPatron randomLDPatron )))" | n | n := self randomPositiveIntegerWithMax: 10. ^( n < 8 ) ifTrue: [ Person randomLDPersonalPatron ] ifFalse: [ Organization randomLDOrganizationalPatron ]
</methods> <methods> Protocols.Library.Patron class <category>utility</category>
newPatronId ^( 'P-', super newAgentId ) asSymbol
patronIdSortBlock ^[:x :y | x patronId <= y patronId ]
</methods> <methods> Protocols.Library.Person <category>accessing</category>
birthDate ^birthDate
birthDate: aDate birthDate := aDate
sex ^sex
sex: aSymbol sex := aSymbol
ssn ^ssn
ssn: aLargePositiveInteger ssn := aLargePositiveInteger
</methods> <methods> Protocols.Library.Person <category>initialize-release</category>
initialize super initialize. telephoneNumbers := TelephoneNumber randomPersonalLDDataTelephoneNumbers. birthDate := self class randomBirthDate. "sex := nil." ssn := self class randomSSN.
</methods> <methods> Protocols.Library.Person class <category>utility</category>
patronName: aString sex: aSymbol ^( self new ) patronName: aString; sex: aSymbol; yourself
randomBirthDate "((( LDAgentPersonalPatron randomBirthDate )))" ^Date today subtractDays: ( ( 12 * 365 ) + ( self randomPositiveIntegerWithMax: ( ( 100 - 12 ) * 365 ) ) )
randomFemaleLDPersonalPatron "((( LDAgentPersonalPatron randomFemaleLDPersonalPatron )))" ^self patronName: PersonName randomFemaleLDDataPersonName sex: #F
randomMaleLDPersonalPatron "((( LDAgentPersonalPatron randomMaleLDPersonalPatron )))" ^self patronName: PersonName randomMaleLDDataPersonName sex: #M
randomSSN "((( LDAgentPersonalPatron randomSSN )))" ^100000000 + ( self randomIntegerLessThan: 899999999 )
</methods> <methods> Protocols.Library.Person class <category>instance creation</category>
randomLDPersonalPatron "((( LDAgentPersonalPatron randomLDPersonalPatron )))" | n | n := self randomPositiveIntegerWithMax: 2. ^( n == 1 ) ifTrue: [ self randomMaleLDPersonalPatron ] ifFalse: [ self randomFemaleLDPersonalPatron ]
</methods> <methods> Protocols.Library.EmailAddress <category>accessing</category>
address ^address
address: aString address := aString
description ^description
description: aString description := aString
</methods> <methods> Protocols.Library.EmailAddress class <category>instance creation</category>
address: aString1 description: aString2 ^( self new ) address: aString1; description: aString2; yourself
</methods> <methods> Protocols.Library.TelephoneNumber <category>accessing</category>
description ^description
description: aString description := aString
number ^number
number: aString number := aString
type ^type
type: aSymbol type := aSymbol
</methods> <methods> Protocols.Library.TelephoneNumber <category>initialize-release</category>
initialize type := #voice. description := String new. number := String new
</methods> <methods> Protocols.Library.TelephoneNumber <category>printing</category>
printOn: stream type ifNotNil: [ stream nextPutAll: type; nextPutAll: ': ' ]. number ifNotNil: [ stream nextPutAll: number ]. description ifNotNil: [ stream nextPutAll: ' ('; nextPutAll: description; nextPut: $) ].
</methods> <methods> Protocols.Library.TelephoneNumber class <category>utility</category>
randomCellLDDataTelephoneNumber "((( LDDataTelephoneNumber randomCellLDDataTelephoneNumber )))" ^self type: (#cell << #librarydemo >> 'cell') asString asSymbol number: self randomLDDataTelephoneNumber
randomFaxLDDataTelephoneNumber "((( LDDataTelephoneNumber randomFaxLDDataTelephoneNumber )))" ^self type: (#fax << #librarydemo >> 'fax') asString asSymbol number: self randomLDDataTelephoneNumber
randomHomeLDDataTelephoneNumber "((( LDDataTelephoneNumber randomHomeLDDataTelephoneNumber )))" ^self type: (#home << #librarydemo >> 'home') asString asSymbol number: self randomLDDataTelephoneNumber
randomLDDataTelephoneNumber "((( LDDataTelephoneNumber randomLDDataTelephoneNumber )))" | str | str := WriteStream on: ( String new: 12 ). str nextPutAll: '923-579-'. 4 timesRepeat: [ str nextPutAll: ( ( self randomIntegerLessThan: 10 ) printString ) ]. ^str contents
randomVoiceLDDataTelephoneNumber "((( LDDataTelephoneNumber randomVoiceLDDataTelephoneNumber )))" ^self type: (#voice << #librarydemo >> 'voice') asString asSymbol number: self randomLDDataTelephoneNumber
randomWorkLDDataTelephoneNumber "((( LDDataTelephoneNumber randomWorkLDDataTelephoneNumber )))" ^self type: (#work << #librarydemo >> 'work') asString asSymbol number: self randomLDDataTelephoneNumber
</methods> <methods> Protocols.Library.TelephoneNumber class <category>class initialization</category>
initialize telephoneNumberTypes := ( Array new: 6 ) at: 1 put: (#voice << #librarydemo >> 'voice') asString asSymbol; at: 2 put: (#fax << #librarydemo >> 'fax') asString asSymbol; at: 3 put: (#home << #librarydemo >> 'home') asString asSymbol; at: 4 put: (#office << #librarydemo >> 'office') asString asSymbol; at: 5 put: (#cell << #librarydemo >> 'cell') asString asSymbol; at: 6 put: (#work << #librarydemo >> 'work') asString asSymbol; yourself
</methods> <methods> Protocols.Library.TelephoneNumber class <category>instance creation</category>
randomOrganizationalLDDataTelephoneNumbers | n s | n := self randomIntegerLessThan: 3. s := Set new: n. ( n > 0 ) ifTrue: [ s add: self randomVoiceLDDataTelephoneNumber ]. ( n > 1 ) ifTrue: [ s add: self randomFaxLDDataTelephoneNumber ]. ^s
randomPersonalLDDataTelephoneNumbers | n s | n := self randomIntegerLessThan: 5. s := Set new: n. ( n > 0 ) ifTrue: [ s add: self randomHomeLDDataTelephoneNumber ]. ( n > 1 ) ifTrue: [ s add: self randomWorkLDDataTelephoneNumber ]. ( n > 2 ) ifTrue: [ s add: self randomCellLDDataTelephoneNumber ]. ( n > 3 ) ifTrue: [ s add: self randomFaxLDDataTelephoneNumber ]. ^s
type: aSymbol description: aString1 number: aString2 ^( self new ) type: aSymbol; description: aString1; number: aString2; yourself
type: aSymbol number: aString ^( self new ) type: aSymbol; number: aString; yourself
</methods> <methods> Protocols.Library.AuthorialName <category>accessing</category>
authorialType ^authorialType
authorialType: aSymbol authorialType := aSymbol
name ^name
name: aPersonNameOrOrganizationName name := aPersonNameOrOrganizationName
</methods> <methods> Protocols.Library.AuthorialName class <category>class initialization</category>
initialize "((( LDDataAuthorialName initialize )))" authorialTypes := #( #writer #translator #editor #illustrator #performer #architect #draftsman)
</methods> <methods> Protocols.Library.AuthorialName class <category>instance creation</category>
authorialType: aSymbol name: aLDPersonNameOrLDOrganizationName ^( self new ) authorialType: aSymbol; name: aLDPersonNameOrLDOrganizationName; yourself
</methods> <methods> Protocols.Library.Book <category>accessing</category>
authors ^authors
authors: anArray authors := anArray
braille ^braille
braille: aBoolean braille := aBoolean
coverPhoto ^coverPhoto
coverPhoto: anImage coverPhoto := anImage
language ^language
language: aSymbol language := aSymbol
largePrint ^largePrint
largePrint: aBoolean largePrint := aBoolean
pages ^pages
pages: anInteger pages := anInteger
publicationYear ^publicationYear
publicationYear: anInteger publicationYear := anInteger
publisher ^publisher
publisher: aString publisher := aString
title ^title
title: aString title := aString
</methods> <methods> Protocols.Library.Book <category>utility</category>
availableForLDSrvcCopyRequest ^true
searchAuthorialLastNames ^( authors collect: [ :x | x name lastName ] ) asSet
searchTitles ^Set with: title
</methods> <methods> Protocols.Library.Book <category>initialize-release</category>
initialize super initialize. "authors := nil." braille := false. "coverPhoto := nil." language := #English. largePrint := false. pages := self class randomPages. publicationYear := self class randomYear. publisher := self class randomPublisher. "title := nil."
</methods> <methods> Protocols.Library.Book class <category>instance creation</category>
authors: anArray title: aString ^( self new ) authors: anArray; title: aString; yourself
randomArchiveLDHoldingBook "((( LDHoldingBook randomArchiveLDHoldingBook )))" | cassoc ck cv t | cassoc := archiveBookData at: ( self randomPositiveIntegerWithMax: archiveBookData size ). ck := cassoc key. cv := cassoc value. t := ( cv at: ( 1 + ( self randomIntegerLessThan: cv size ) ) ) asString. ^( self authors: self randomAuthors title: t ) collectionId: ck; yourself
randomLibraryLDHoldingBook "((( LDHoldingBook randomLibraryLDHoldingBook )))" | cassoc ck cv t | cassoc := libraryBookData at: ( self randomPositiveIntegerWithMax: libraryBookData size ). ck := cassoc key. cv := cassoc value. t := ( cv at: ( 1 + ( self randomIntegerLessThan: cv size ) ) ) asString. ^( self authors: self randomAuthors title: t ) collectionId: ck; yourself
</methods> <methods> Protocols.Library.Book class <category>class initialization</category>
initialize "((( self initialize )))" self initializeArchiveBookData. self initializeLibraryBookData. self initializePublishers.
initializeArchiveBookData | oc | oc := OrderedCollection new. oc addLast: ( (#NauticalHistoryAndLiterature << #librarydemo >> 'Nautical History and Literature') asString asSymbol -> (OrderedCollection new add: (#BuildingTheTrireme << #librarydemo >> 'Building the Trireme'); add: (#HandReefAndSteer << #librarydemo >> 'Hand, Reef, and Steer'); add: (#Lofting << #librarydemo >> 'Lofting'); add: (#SeamanshipInTheAgeOfSail << #librarydemo >> 'Seamanship in the Age of Sail'); add: (#SextantHandbook << #librarydemo >> 'Sextant Handbook'); add: (#TheGaffRigHandbook << #librarydemo >> 'The Gaff Rig Handbook'); add: (#TheLastOfTheCapeHorners << #librarydemo >> 'The Last of the Cape Horners'); add: (#TheTudorNavy << #librarydemo >> 'The Tudor Navy'); asArray) ); addLast: ( (#NavalArchitecture << #librarydemo >> 'Naval Architecture') asString asSymbol -> (OrderedCollection new add: (#FortyWoodenBoats << #librarydemo >> 'Forty Wooden Boats'); add: (#HMSSultana << #librarydemo >> 'H. M. S. Sultana'); add: (#PrinciplesOfYachtDesign << #librarydemo >> 'Principles of Yacht Design'); add: (#TheSearchForSpeedUnderSail << #librarydemo >> 'The Search for Speed Under Sail'); add: (#Trimcomalee << #librarydemo >> 'Trimcomalee'); asArray) ). archiveBookData := oc asArray
initializeLibraryBookData | oc | oc := OrderedCollection new. oc addLast: ( (#BiographyAndAutobiography << #librarydemo >> 'Biography and Autobiography') asString asSymbol -> (Array with: (#MyLifeInGermany << #librarydemo >> 'My Life in Germany') with: (#PatrickOBrian << #librarydemo >> 'Patrick O''Brian')) ); addLast: ( (#ComputerScienceAndMathematics << #librarydemo >> 'Computer Science and Mathematics') asString asSymbol -> (OrderedCollection new add: (#ACMTuringAwardLectures << #librarydemo >> 'ACM Turing Award Lectures'); add: (#ArtificialIntelligenceProgramming << #librarydemo >> 'Artificial Intelligence Programming'); add: (#AstronomicalAlgorithms << #librarydemo >> 'Astronomical Algorithms'); add: (#ComputabilityAndLogic << #librarydemo >> 'Computability and Logic'); add: (#DistributedAlgorithms << #librarydemo >> 'Distributed Algorithms'); add: (#HandbookOfAppliedCryptography << #librarydemo >> 'Handbook of Applied Cryptography'); add: (#LambdaCalculusCombinatorsAnd << #librarydemo >> 'Lambda-Calculus, Combinators, and Functional Programming'); add: (#MathematicalLogic << #librarydemo >> 'Mathematical Logic'); add: (#PrinciplesOfArtificialIntelligence << #librarydemo >> 'Principles of Artificial Intelligence'); add: (#TheLambdaCalculus << #librarydemo >> 'The Lambda Calculus'); asArray) ); addLast: ( (#HistoryandArchaeology << #librarydemo >> 'History and Archaeology') asString asSymbol -> (OrderedCollection new add: (#AShortHistoryOfByzantium << #librarydemo >> 'A Short History of Byzantium'); add: (#BlackSea << #librarydemo >> 'Black Sea'); add: (#CathedralForgeAndWaterwheel << #librarydemo >> 'Cathedral, Forge, and Waterwheel'); add: (#EarlyChristianity << #librarydemo >> 'Early Christianity and Greek Paideia'); add: (#NewWorldsAncientTexts << #librarydemo >> 'New Worlds, Ancient Texts'); add: (#TheArchaeologyOfGreece << #librarydemo >> 'The Archaeology of Greece'); add: (#TheDawnOfHumanCulture << #librarydemo >> 'The Dawn of Human Culture'); add: (#TheEndOfTheBronzeAge << #librarydemo >> 'The End of the Bronze Age'); add: (#TheGrandStrategy << #librarydemo >> 'The Grand Strategy of the Roman Empire'); add: (#MindOfTheMiddleAges << #librarydemo >> 'The Mind of the Middle Ages: An Historical Survey A.D. 200 - 1500'); asArray) ); addLast: ( (#Literature << #librarydemo >> 'Literature') asString asSymbol -> (OrderedCollection new add: (#Hamlet << #librarydemo >> 'Hamlet'); add: (#JuliusCaesar << #librarydemo >> 'Julius Caesar'); add: (#Macbeth << #librarydemo >> 'Macbeth'); add: (#Oblomov << #librarydemo >> 'Oblomov'); add: (#TheMasterAndMargarita << #librarydemo >> 'The Master and Margarita'); add: (#DonQuixote << #librarydemo >> 'Don Quixote'); add: (#TheSongOfRoland << #librarydemo >> 'The Song of Roland'); add: (#PoemaDelCid << #librarydemo >> 'Poema del Cid'); add: (#TheMoonIsDown << #librarydemo >> 'The Moon is Down'); asArray) ); addLast: ( (#Musicology << #librarydemo >> 'Musicology') asString asSymbol -> (Array with: (#SanctiRomani << #librarydemo >> 'Sancti Romani Melodi Cantica: Cantica Genuina')) ); addLast: ( (#Philosophy << #librarydemo >> 'Philosophy') asString asSymbol -> (OrderedCollection new add: (#BeingAndTime << #librarydemo >> 'Being and Time'); add: (#Daybreak << #librarydemo >> 'Daybreak'); add: (#DeAnima << #librarydemo >> 'De anima'); add: (#DePrimoPrincipio << #librarydemo >> 'De primo principio'); add: (#Ethics << #librarydemo >> 'Ethics'); add: (#HumanAllTooHuman << #librarydemo >> 'Human, All Too Human'); add: (#Kommentar << #librarydemo >> 'Kommentar zur Kritik der reinen Vernunft'); add: (#KritikDerReinenVernunft << #librarydemo >> 'Kritik der reinen Vernunft'); add: (#HeideggerAndNihilism << #librarydemo >> 'Martin Heidegger and European Nihilism'); add: (#MutualAid << #librarydemo >> 'Mutual Aid'); add: (#NichomacheanEthics << #librarydemo >> 'Nichomachean Ethics'); add: (#PhanomenologieDesGeistes << #librarydemo >> 'Phanomenologie des Geistes'); add: (#PeriPsyche << #librarydemo >> 'Peri psyche'); add: (#QuaestionesQuodlibetales << #librarydemo >> 'Quaestiones quodlibetales'); add: (#ReportataParisiensia << #librarydemo >> 'Reportata parisiensia'); add: (#SkepicismAndNaturalism << #librarydemo >> 'Skepicism and Naturalism'); add: (#SpeculumSpinozanum << #librarydemo >> 'Speculum Spinozanum'); add: (#SummaTheologiae << #librarydemo >> 'Summa theologiae'); add: (#TheOxfordCommentary << #librarydemo >> 'The Oxford Commentary'); add: (#ThePreSocratics << #librarydemo >> 'The Pre-Socratics'); add: (#WhatIsArt << #librarydemo >> 'What is Art?'); asArray) ); addLast: ( (#Poetry << #librarydemo >> 'Poetry') asString asSymbol -> (OrderedCollection new add: (#Beowulf << #librarydemo >> 'Beowulf'); add: (#CloudlessAtFirst << #librarydemo >> 'Cloudless at First'); add: (#SelectedAndNewPoems << #librarydemo >> 'Selected and New Poems'); add: (#TheInfiniteMoment << #librarydemo >> 'The Infinite Moment'); add: (#TheMinersPaleChildren << #librarydemo >> 'The Miner''s Pale Children'); add: (#TheNarrowRoad << #librarydemo >> 'The Narrow Road to the Deep North'); add: (#TheNoiseOfTime << #librarydemo >> 'The Noise of Time'); add: (#TheVoronezhNotebooks << #librarydemo >> 'The Voronezh Notebooks'); asArray) ); addLast: ( (#Reference << #librarydemo >> 'Reference') asString asSymbol -> (OrderedCollection new add: (#TahitianAndEnglish << #librarydemo >> 'A Tahitian and English Dictionary with Introductory Remarks on the Polynesian Language'); add: (#GreekEnglishLexicon << #librarydemo >> 'Greek-English Lexicon'); add: (#JapaneseEnglishCharacterDictionary << #librarydemo >> 'Japanese-English Character Dictionary'); add: (#PatristicGreekLexicon << #librarydemo >> 'Patristic Greek Lexicon'); add: (#RussianDictionary << #librarydemo >> 'Russian Dictionary'); add: (#PortableWorld << #librarydemo >> 'The Portable World: A Complete Pocket Atlas'); asArray) ); addLast: ( (#ScienceFiction << #librarydemo >> 'Science Fiction') asString asSymbol -> (OrderedCollection new add: (#CosmonautKeep << #librarydemo >> 'Cosmonaut Keep'); add: (#CourtshipRite << #librarydemo >> 'Courtship Rite'); add: (#Solaris << #librarydemo >> 'Solaris'); add: (#TheCassiniDivision << #librarydemo >> 'The Cassini Division'); add: (#TheMoonIsAHarshMistress << #librarydemo >> 'The Moon is a Harsh Mistress'); add: (#TheSkyRoad << #librarydemo >> 'The Sky Road'); add: (#TheStarFraction << #librarydemo >> 'The Star Fraction'); add: (#TheStoneCanal << #librarydemo >> 'The Stone Canal'); asArray) ); addLast: ( (#TheologyAndReligion << #librarydemo >> 'Theology and Religion') asString asSymbol -> (Array with: (#Shobogenzo << #librarydemo >> 'Shobogenzo') with: (#TheBlueCliffRecord << #librarydemo >> 'The Blue Cliff Record')) ). libraryBookData := oc asArray
initializePublishers publishers := (OrderedCollection new add: (#BallantinePublishing << #librarydemo >> 'Ballantine Publishing'); add: (#ClarendonPress << #librarydemo >> 'Clarendon Press'); add: (#CopperCanyonPress << #librarydemo >> 'Copper Canyon Press'); add: (#Dover << #librarydemo >> 'Dover'); add: (#FarrarStrausAndGiroux << #librarydemo >> 'Farrar, Straus, and Giroux'); add: (#GrovePress << #librarydemo >> 'Grove Press'); add: (#IgnatiusPress << #librarydemo >> 'Ignatius Press'); add: (#MorganKaufmann << #librarydemo >> 'Morgan Kaufmann'); add: (#NakayamaShobo << #librarydemo >> 'Nakayama Shobo'); add: (#NewDirections << #librarydemo >> 'New Directions'); add: (#NorthpointPress << #librarydemo >> 'Northpoint Press'); add: (#OxfordUniversityPress << #librarydemo >> 'Oxford University Press'); add: (#Penguin << #librarydemo >> 'Penguin'); add: (#SpringerVerlag << #librarydemo >> 'Springer-Verlag'); add: (#Tor << #librarydemo >> 'Tor'); asArray)
</methods> <methods> Protocols.Library.Book class <category>utility</category>
randomAuthors | numericSpread n a typeSpread | numericSpread := #[ 1 1 1 1 1 1 1 1 2 2 2 3 3 4 ]. n := numericSpread at: ( self randomPositiveIntegerWithMax: numericSpread size ). typeSpread := ( ( self randomIntegerLessThan: 7 ) == 0 ) ifTrue: [ #( #editor #editor #editor #translator ) ] ifFalse: [ #( #writer #writer #writer #writer #translator #translator #illustrator ) ]. a := Array new: n. 1 to: n do: [ :ndx | a at: ndx put: ( AuthorialName authorialType: ( typeSpread at: ( 1 + ( self randomIntegerLessThan: typeSpread size ) ) ) name: ( PersonName randomLDDataPersonName ) ) ]. ^a
randomPages ^173 + ( self randomPositiveIntegerWithMax: 191 ) + ( self randomPositiveIntegerWithMax: 239 )
randomPublisher ^( publishers at: ( self randomPositiveIntegerWithMax: publishers size ) ) asString
</methods> <methods> Protocols.Library.Account <category>accessing</category>
balance ^balance
balance: aFixedPoint balance := aFixedPoint
transactionHistory ^transactionHistory
transactionHistory: anOrderedCollection transactionHistory := anOrderedCollection
</methods> <methods> Protocols.Library.Account <category>private</category>
addTransaction: aLDTransaction ( aLDTransaction isKindOf: FinancialTransaction ) ifTrue: [ balance := balance + aLDTransaction amount ]. transactionHistory addLast: aLDTransaction
agentTransactions ^transactionHistory select: [ :x | x isKindOf: AgentTransaction ]
currentBalance ^balance
financialTransactions ^transactionHistory select: [ :x | x isKindOf: FinancialTransaction ]
holdingTransactions ^transactionHistory select: [ :x | x isKindOf: HoldingTransaction ]
lastTransaction ^transactionHistory last
serviceTransactions ^transactionHistory select: [ :x | x isKindOf: ServiceCharge ]
</methods> <methods> Protocols.Library.Account <category>initialize-release</category>
initialize balance := FixedPoint numerator: 0 denominator: 100 scale: 2. transactionHistory := OrderedCollection new
</methods> <methods> Protocols.Library.Account class <category>instance creation</category>
balance: aFixedPoint transactionHistory: anOrderedCollection ^( self new ) balance: aFixedPoint; transactionHistory: anOrderedCollection; yourself
new ^super new initialize
</methods> <methods> Protocols.Library.Reservation <category>accessing</category>
holdingCatalogNumber ^holdingCatalogNumber
holdingCatalogNumber: anLDCatalogNumber holdingCatalogNumber := anLDCatalogNumber
patronId ^patronId
patronId: aSymbol patronId := aSymbol
reservationType ^reservationType
reservationType: aSymbol reservationType := aSymbol
</methods> <methods> Protocols.Library.Reservation class <category>instance creation</category>
holdingCatalogNumber: aLDCatalogNumber patronId: aSymbol1 reservationType: aSymbol2 ^( self new ) holdingCatalogNumber: aLDCatalogNumber; patronId: aSymbol1; reservationType: aSymbol2; yourself
</methods> <methods> Protocols.Library.Library <category>accessing</category>
affiliatedLibraries ^affiliatedLibraries
affiliatedLibraries: anIdentitySet affiliatedLibraries := anIdentitySet
libraryId ^libraryId
libraryId: aSymbol libraryId := aSymbol
libraryName ^libraryName
libraryName: aString libraryName := aString. emailAddresses := self emailAddresses
loanedHoldings ^loanedHoldings
loanedHoldings: aCollection loanedHoldings := aCollection
ownedHoldings ^ownedHoldings
ownedHoldings: aDictionary ownedHoldings := aDictionary
patrons ^patrons
patrons: aCollection patrons := aCollection
reservedHoldings ^reservedHoldings
reservedHoldings: aSet reservedHoldings := aSet
services ^services
services: anIdentityDictionary ^services := anIdentityDictionary
</methods> <methods> Protocols.Library.Library <category>public api</category>
randomAffiliatedLibraryExistingAuthorialLastName | als al | als := affiliatedLibraries asOrderedCollection. al := als at: ( self class randomPositiveIntegerWithMax: als size ). ^al randomExistingAuthorialLastName
randomAffiliatedLibraryExistingSearchTitle | als al | als := affiliatedLibraries asOrderedCollection. al := als at: ( self class randomPositiveIntegerWithMax: als size ). ^al randomExistingSearchTitle
randomExistingAuthorialLastName | hs ns | hs := self ownedHoldings values asOrderedCollection. ns := ( hs at: ( self class randomPositiveIntegerWithMax: hs size ) ) searchAuthorialLastNames asArray. ^ ns at: ( self class randomPositiveIntegerWithMax: ns size )
randomExistingPatronId | ps | ps := self patrons asOrderedCollection. ^( ps at: ( self class randomPositiveIntegerWithMax: ps size ) ) patronId
randomExistingSearchTitle | hs | hs := self ownedHoldings values asOrderedCollection. ^( hs at: ( self class randomPositiveIntegerWithMax: hs size ) ) searchTitles asOrderedCollection first
searchHoldingsOnAspect: aSymbol withMatchString: aString | rs | rs := Set new. ownedHoldings associationsDo: [ :assoc | ( assoc value perform: aSymbol ) do: [ :item | ( aString match: item ) ifTrue: [ rs add: assoc ] ] ]. ^rs
serviceById: aSymbol ^services at: aSymbol
</methods> <methods> Protocols.Library.Library <category>private</category>
addLDHolding: aLDHolding "... adds a holding without adding a transaction or affecting the library account balance." aLDHolding libraryName: libraryName. ownedHoldings add: ( aLDHolding acquisitionNumber ) -> aLDHolding
addService: aLDSrvc aLDSrvc library: self. self registerService: aLDSrvc id: aLDSrvc serviceId
patronById: aLDAgentPatron_patronId ^patrons detect: [ :x | x patronId == aLDAgentPatron_patronId ] ifNone: [ PatronNotFound raiseErrorString: ((#Patron1sNotFound << #librarydemo >> 'Patron <1s> not found.') expandMacrosWith: aLDAgentPatron_patronId) ]
registerService: aLDLibraryService id: aSymbol services at: aSymbol put: aLDLibraryService
</methods> <methods> Protocols.Library.Library <category>utility</category>
emailAddresses | oc | oc := OrderedCollection new. self class libraryDepartments do: [ :ld | | x y z | x := libraryName, ', ', ld asString. y := ( x select: [ :c | c isUppercase ] ) asLowercase. z := ((#x1sportnowherenet << #librarydemo >> '<1s>@portnowhere.net') expandMacrosWith: y). oc add: ( EmailAddress address: z description: ld asString ) ]. ^ oc asArray
</methods> <methods> Protocols.Library.Library <category>printing</category>
printOn: aStream aStream nextPut: $(; nextPutAll: self class name; nextPutAll: ': '; nextPutAll: self libraryName; nextPut: $)
</methods> <methods> Protocols.Library.Library <category>initialize-release</category>
initialize super initialize. telephoneNumbers := TelephoneNumber randomOrganizationalLDDataTelephoneNumbers. affiliatedLibraries := Set new. libraryId := self class newLibraryId. "libraryName := nil." loanedHoldings := OrderedCollection new. ownedHoldings := Dictionary new. patrons := SortedCollection sortBlock: Patron patronIdSortBlock. "requestBroker := nil." reservedHoldings := IdentitySet new. services := IdentityDictionary new
</methods> <methods> Protocols.Library.Library class <category>class initialization</category>
initialize "((( LDAgentLibrary initialize )))" self initializeLibraryDepartments
initializeLibraryDepartments LibraryDepartments := ( Array with: (#Director << #librarydemo >> 'Director') with: (#Cataloging << #librarydemo >> 'Cataloging') with: (#InformationDesk << #librarydemo >> 'Information Desk') with: (#ShippingAndReceiving << #librarydemo >> 'Shipping and Receiving'))
</methods> <methods> Protocols.Library.Library class <category>accessing</category>
libraryDepartments ^LibraryDepartments
</methods> <methods> Protocols.Library.Library class <category>utility</category>
newLibraryId ^( 'L-', super newAgentId ) asSymbol
</methods> <methods> Protocols.Library.Library class <category>ADvance</category>
ad2diagram_Library ^#(#{ICC.ADvance.AD2DiagramSpec} #name: 'Library' #creationDateSeconds: 3334311807 #modificationDateSeconds: 3334313356 #author: #(#{ICC.ADvance.AD2Identity} #nickName: '' #name: '' #company: '' ) #state: #(#{ICC.ADvance.AD2DiagramState} #bits: 15 #zoom: '85%' #translation: #(#{Core.Point} -60 300 ) #scriptDepth: 3 #associationDepth: 2 ) #filter: #(#{ICC.ADvance.AD2StructureFilter} #bits: 77 #filteredInstProtocols: #('access-*' 'accessing-*' 'aspects' 'backward*' 'boss*' 'chang*' 'encode-decod*' 'exampl*' 'fileI*' 'fileO*' 'interface*' 'menu*' 'primitiv*' 'resources' ) #filteredInstMethods: #('displayOn:*' 'displayString' 'init*' 'printOn:' 'printString' 'releas*' 'storeOn:' 'storeString' 'update:*' ) #filteredClassProtocols: #('*declarations' '*specs' 'access-*' 'accessing-*' 'ADvance*' 'backward*' 'constants' 'documentation' 'exampl*' 'fileIn/Out' 'info' 'resources' 'signal*' ) #filteredClassMethods: #('initialize' 'new' ) #filteredInstVars: #() #filteredClassInstVars: #() #filteredSharedVars: #() ) #classes: #(#(#{Protocols.Library.TelephoneNumber} 7288 295 0 ) #(#{Protocols.Library.AgentTransaction} 160 314 0 ) #(#{Protocols.Library.RetireAffiliatedLibrary} -8 426 0 ) #(#{Protocols.Library.ShipPlan} 4944 678 0 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.AuthorialName} #attribute: 'architects' ) ) ) #(#{Protocols.Library.AuthorialName} 248 1088 0 ) #(#{Protocols.Library.ReturnHolding} 1992 426 0 ) #(#{Protocols.Library.Person} 368 112 1 ) #(#{Protocols.Library.ServiceCharge} 2816 426 0 ) #(#{Protocols.Library.CatalogNumber} 6464 295 0 ) #(#{Protocols.Library.BorrowHolding} 1016 426 0 ) #(#{Protocols.Library.RequestDueDateExtension} 1496 426 0 ) #(#{Protocols.Library.LibraryError} 8056 186 0 ) #(#{Protocols.Library.DigitalVideoDisc} 640 866 0 ) #(#{Protocols.Library.HoldingTransaction} 1056 130 0 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Holding} #attribute: 'holding' #layout1: #(0.0 1.0 ) #layout2: #(1.0 0.0269058 ) ) ) ) #(#{Protocols.Library.Recording} 5760 679 0 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.AuthorialName} #attribute: 'authors' ) ) ) #(#{Protocols.Library.Reservation} 88 1089 0 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.CatalogNumber} #attribute: 'holdingCatalogNumber' ) ) ) #(#{Protocols.Library.AcquireGrant} 2608 426 0 ) #(#{Protocols.Library.PublishService} 784 426 0 ) #(#{Protocols.Library.AnalogRecording} 1048 754 0 ) #(#{Protocols.Library.ServiceTransaction} 784 314 0 ) #(#{Protocols.Library.Book} 200 570 0 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.AuthorialName} #attribute: 'authors' ) ) ) #(#{Protocols.Library.HoldingNotCopiedByBindery} 8208 298 0 ) #(#{Protocols.Library.HoldingNotFound} 7928 298 0 ) #(#{Protocols.Library.DigitalRecording} 528 754 0 ) #(#{Protocols.Library.Patron} 472 -30 1 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.AbstractRandom} #attribute: 'patronName' ) ) ) #(#{Protocols.Library.PatronNotFound} 8512 298 0 ) #(#{Protocols.Library.Payment} 2432 426 0 ) #(#{Protocols.Library.CompactDisc} 5400 978 0 ) #(#{Protocols.Library.Holding} 856 -333 1 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.CatalogNumber} #attribute: 'catalogNumber' ) ) ) #(#{Protocols.Library.EmailAddress} -64 1089 0 ) #(#{Protocols.Library.FinancialTransaction} 280 290 0 ) #(#{Protocols.Library.Library} 856 -31 1 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Library} #attribute: 'affiliatedLibraries' #layout2: #(1.0 0.534513 ) ) #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Holding} #attribute: 'loanedHoldings' #layout1: #(0.251938 0.0 ) #layout2: #(0.341584 1.0 ) ) #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Holding} #attribute: 'ownedHoldings' #layout1: #(0.507752 0.0 ) #layout2: #(0.504951 1.0 ) ) #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Patron} #attribute: 'patrons' #layout1: #(0.0 0.447917 ) #layout2: #(1.0 0.540984 ) ) #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Holding} #attribute: 'reservedHoldings' #layout1: #(0.693798 0.0 ) #layout2: #(0.623762 1.0 ) ) #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.LibraryService} #attribute: 'services' ) ) ) #(#{Protocols.Library.VideoTape} 6008 978 0 ) #(#{Protocols.Library.GeneralPublicService} 288 402 0 ) #(#{Protocols.Library.PersonName} 3528 298 0 ) #(#{Protocols.Library.RetireHolding} 1784 426 0 ) #(#{Protocols.Library.LoanedHolding} 184 434 0 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Reservation} #attribute: 'reservationList' ) ) ) #(#{Protocols.Library.WeatherForecastService} 4424 570 0 ) #(#{Protocols.Library.InformationService} 912 402 0 ) #(#{Protocols.Library.SearchService} 4040 458 0 ) #(#{Protocols.Library.PatronNotApprovedForService} 7600 298 0 ) #(#{Protocols.Library.CopyService} 4208 458 0 ) #(#{Protocols.Library.AcquireAffiliatedLibrary} 280 426 0 ) #(#{Protocols.Library.Organization} 568 113 1 ) #(#{Protocols.Library.AbstractRandom} 5280 186 0 ) #(#{Protocols.Library.RetainedHolding} -128 434 0 ) #(#{Protocols.Library.AudioTape} 5824 978 0 ) #(#{Protocols.Library.Agent} 472 -199 1 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Account} #attribute: 'account' #layout1: #(0.0 0.448718 ) #layout2: #(1.0 0.557377 ) ) #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Holding} #attribute: 'borrowedHoldings' ) #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.EmailAddress} #attribute: 'emailAddresses' ) #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.PhysicalAddress} #attribute: 'physicalAddress' ) #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.TelephoneNumber} #attribute: 'telephoneNumbers' ) ) ) #(#{Protocols.Library.Account} 192 -198 1 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Transaction} #attribute: 'transactionHistory' ) ) ) #(#{Protocols.Library.Transaction} 192 -23 1 ) #(#{Protocols.Library.OrganizationName} 3272 297 0 ) #(#{Protocols.Library.PlaceReservation} 2216 426 0 ) #(#{Protocols.Library.AcquireHolding} 1240 426 0 ) #(#{Protocols.Library.PhysicalAddress} 4680 300 0 ) #(#{Protocols.Library.OverdueCharge} 3040 426 0 ) #(#{Protocols.Library.LibraryService} 856 191 1 #layouts: #( #(#{ICC.ADvance.AD2LayoutSpec} #{Protocols.Library.Library} #attribute: 'library' ) ) ) #(#{Protocols.Library.AcquirePatron} 560 426 0 ) #(#{Protocols.Library.AdministrativeService} 288 514 0 ) #(#{Protocols.Library.PhonographRecord} 6216 978 0 ) #(#{Protocols.Library.RetirePatron} -240 426 0 ) ) )
advanceSubjectSpec ^#(#{ICC.ADvance.AD2Subject} #classNames: #('Protocols.Library.OverdueCharge' 'Protocols.Library.DigitalVideoDisk' 'Protocols.Library.ShipPlan' 'Protocols.Library.CopyRequest' 'Protocols.Library.AcquireGrant' 'Protocols.Library.Book' 'Protocols.Library.HoldingNotFound' 'Protocols.Library.Person' 'Protocols.Library.Patron' 'Protocols.Library.GeneralPublicService' 'Protocols.Library.WeatherForecast' 'Protocols.Library.Reservation' 'Protocols.Library.Search' 'Protocols.Library.PatronNotApprovedForService' 'Protocols.Library.Transaction' 'Protocols.Library.PhonographRecord' 'Protocols.Library.AcquirePatron' 'Protocols.Library.Payment' 'Protocols.Library.HoldingNotCopiedByBindery' 'Protocols.Library.AcquireAffiliatedLibrary' 'Protocols.Library.AgentTransaction' 'Protocols.Library.Library' 'Protocols.Library.PublishService' 'Protocols.Library.Account' 'Protocols.Library.RetireAffiliatedLibrary' 'Protocols.Library.HoldingTransaction' 'Protocols.Library.PlaceReservation' 'Protocols.Library.FinancialTransaction' 'Protocols.Library.PhysicalAddress' 'Protocols.Library.LibraryService' 'Protocols.Library.ReturnHolding' 'Protocols.Library.BorrowHolding' 'Protocols.Library.RetireHolding' 'Protocols.Library.LoanedHolding' 'Protocols.Library.DigitalRecording' 'Protocols.Library.ServiceTransaction' 'Protocols.Library.AnalogRecording' 'Protocols.Library.PatronNotFound' 'Protocols.Library.VideoTape' 'Protocols.Library.RetainedHolding' 'Protocols.Library.AudioTape' 'Protocols.Library.AuthorialName' 'Protocols.Library.Recording' 'Protocols.Library.Organization' 'Protocols.Library.RetirePatron' 'Protocols.Library.Agent' 'Protocols.Library.OrganizationName' 'Protocols.Library.EmailAddress' 'Protocols.Library.InformationService' 'Protocols.Library.CatalogNumber' 'Protocols.Library.LibraryError' 'Protocols.Library.AdministrativeService' 'Protocols.Library.TelephoneNumber' 'Protocols.Library.RequestDueDateExtension' 'Protocols.Library.CompactDisk' 'Protocols.Library.PersonName' 'Protocols.Library.AbstractRandom' 'Protocols.Library.AcquireHolding' 'Protocols.Library.ServiceCharge' 'Protocols.Library.Holding'))
markedAsSubjectClass
</methods> <methods> Protocols.Library.Library class <category>instance creation</category>
PortNowhere "Return an instance of the Port Nowhere <Library>" "self PortNowhere" | main affiliate | main := self portNowherePublicLibrary. affiliate := self portNowhereMaritimeMuseumLibraryAndShipPlanArchive. main affiliatedLibraries add: affiliate. ^main
portNowhereMaritimeMuseumLibraryAndShipPlanArchive "self portNowhereMaritimeMuseumLibraryAndShipPlanArchive" | lib | lib := (self new) libraryName: (#PNMMLaSPA << #librarydemo >> 'Port Nowhere Maritime Museum Library And Ship Plan Archive') asString; yourself. "... fake up an account balance." lib account balance: lib account balance + 7000. "... add some ship plans to the archive without touching the transaction record." 20 timesRepeat: [| sp | sp := ShipPlan randomLDHoldingShipPlan. lib addLDHolding: sp]. "... also add books on naval architecture without touching the transaction record." 10 timesRepeat: [| ab | ab := Book randomArchiveLDHoldingBook. lib addLDHolding: ab]. "... add some patrons to the archive without touching the transaction record." 20 timesRepeat: [lib patrons add: Patron randomLDPatron]. "... add services without touching the trsansaction record." lib addService: SearchService new. ^lib
portNowherePublicLibrary "self portNowherePublicLibrary" | lib | lib := (self new) libraryName: (#PNPL << #librarydemo >> 'Port Nowhere Public Library') asString; yourself. "... fake up an account balance." lib account balance: lib account balance + 11000. "... add books to the library without touching the transaction record." 20 timesRepeat: [| sp | sp := Book randomLibraryLDHoldingBook. lib addLDHolding: sp]. "... add some patrons to the library without touching the transaction record." 20 timesRepeat: [lib patrons add: Patron randomLDPatron]. "... add services." lib addService: WeatherForecastService new; addService: SearchService new. ^lib
</methods> <methods> Protocols.Library.ServiceCharge <category>accessing</category>
serviceId ^serviceId
serviceId: aSymbol serviceId := aSymbol
</methods> <methods> Protocols.Library.ServiceCharge class <category>instance creation</category>
amount: aNumber serviceId: aSymbol ^( self new ) amount: aNumber; serviceId: aSymbol; yourself
</methods> <methods> Protocols.Library.WeatherForecastService <category>public api</category>
currentWeatherForecastForPatronId: aLDPatron_patronId "receiver: LDSrvcWeatherForecast" "arguments: Symbol" "returns: Text" "possible exceptions: LDExcPatronNotFound" | patron trans | patron := library patronById: aLDPatron_patronId. trans := ServiceCharge amount: self serviceFee serviceId: self serviceId. patron account addTransaction: trans. ^self class randomWeatherForecast
</methods> <methods> Protocols.Library.WeatherForecastService class <category>class initialization</category>
initialize "((( LDSrvcWeatherForecast initialize )))" defaultServiceCharge := FixedPoint numerator: 1 denominator: 100 scale: 2. defaultServiceId := #WeatherForecastService
</methods> <methods> Protocols.Library.WeatherForecastService class <category>utility</category>
randomWeatherForecast "((( LDSrvcWeatherForecast randomWeatherForecast )))" | dat tstr | dat := Date today. tstr := TextStream on: ( String new: 256 ). tstr cr; emphasis: #( #bold #underline ); nextPutAll: (#FORECASTTITLE << #librarydemo >> 'FORECAST FOR CAPE NEMO AND THE LOST COAST') asString; emphasis: nil; cr; crtab; nextPutAll: (#REGIONALWEATHERSERVICE << #librarydemo >> 'REGIONAL WEATHER SERVICE') asString; crtab; nextPutAll: (#APORIABAYCALIFORNIA << #librarydemo >> 'APORIA BAY, CALIFORNIA') asString; crtab; nextPutAll: '0400 AM PST'; crtab; nextPutAll: ( dat weekday, ' ', dat printString ) asUppercase; cr; cr; emphasis: #( #bold #italic ); nextPutAll: (#TODAY << #librarydemo >> 'TODAY') asString; emphasis: nil; cr; cr; nextPutAll: (#PARTLYCLOUDY << #librarydemo >> '...PARTLY CLOUDY WITH PATCHY MORNING FOG...THEN MOSTLY SUNNY THIS AFTERNOON. HIGHS IN THE UPPER 50S TO THE MID 60S. NORTH WIND TO 15 MPH.') asString; cr; cr; emphasis: #( #bold #italic ); nextPutAll: (#TONIGHT << #librarydemo >> 'TONIGHT') asString; emphasis: nil; cr; cr; nextPutAll: (#MOSTLYCLEAR << #librarydemo >> '...MOSTLY CLEAR WITH PATCHY FOG LATE... LOWS IN THE 30S TO THE LOWER 40S. NORTH WIND 5 TO 10 MPH.') asString; cr. ^tstr contents
</methods> <methods> Protocols.Library.CopyService <category>public api</category>
requestCopyOfAcquisitionNumber: aLDHolding_acquisitionNumber forPatronId: aLDAgentPatron_patronId | patron srvc holding | patron := library patronById: aLDAgentPatron_patronId. ( patron serviceApprovals includes: serviceId ) ifFalse: [ ^PatronNotApprovedForService raiseErrorString: ((#Patron1sNotApprovedFor2s << #librarydemo >> 'Patron <1s> not approved for <2s>.') expandMacrosWith: aLDAgentPatron_patronId with: serviceId) ]. srvc := library serviceById: #GeneralPublicService. holding := srvc holdingByAcquisitionNumber: aLDHolding_acquisitionNumber. ( holding availableForLDSrvcCopyRequest ) ifFalse: [ ^HoldingNotCopiedByBindery raiseErrorString: ((#GenKey4 << #librarydemo >> 'Holding , <1s> cannot be copied by the Port Nowhere Bindery.') expandMacrosWith: aLDHolding_acquisitionNumber) ]
</methods> <methods> Protocols.Library.CopyService class <category>class initialization</category>
initialize "((( LDSrvcGeneralPublic initialize )))" defaultServiceCharge := FixedPoint numerator: 11 denominator: 100 scale: 2. defaultServiceId := #CopyRequestService
</methods> <methods> Protocols.Library.AdministrativeService <category>public api</category>
addAffiliatedLibrary: aLibrary library affiliatedLibraries add: aLibrary. library account addTransaction: ( AcquireAffiliatedLibrary agentId: aLibrary libraryId )
addMonetaryGrant: aPositiveNumber library account addTransaction: ( AcquireGrant amount: aPositiveNumber )
addPatron: aLDPatron library patrons add: aLDPatron. library account addTransaction: ( AcquirePatron agentId: aLDPatron patronId )
addService: aLDSrvc library addService: aLDSrvc. library account addTransaction: ( PublishService serviceId: aLDSrvc serviceId )
</methods> <methods> Protocols.Library.AdministrativeService class <category>class initialization</category>
initialize "((( LDSrvcAdministrative initialize )))" defaultServiceCharge := FixedPoint numerator: 0 denominator: 100 scale: 2. defaultServiceId := #AdministrativeService
</methods> <methods> Protocols.Library.Organization <category>initialize-release</category>
initialize super initialize. telephoneNumbers := TelephoneNumber randomOrganizationalLDDataTelephoneNumbers. taxIdNumber := self class newTaxIdNumber
</methods> <methods> Protocols.Library.Organization <category>accessing</category>
taxIdNumber ^taxIdNumber
taxIdNumber: aWordArray taxIdNumber := aWordArray
</methods> <methods> Protocols.Library.Organization class <category>instance creation</category>
patronName: aString ^( self new ) patronName: aString
randomLDOrganizationalPatron "((( LDAgentOrganizationalPatron randomLDOrganizationalPatron )))" ^self patronName: OrganizationName randomLDDataOrganizationName
</methods> <methods> Protocols.Library.Organization class <category>class initialization</category>
initialize "((( LDAgentOrganizationalPatron initialize )))" nextTaxIdNumber := WordArray new: 4. nextTaxIdNumber at: 1 put: ( 2 raisedTo: 7 ); at: 2 put: ( 2 raisedTo: 8 ); at: 3 put: ( 2 raisedTo: 14 ); at: 4 put: ( 2 raisedTo: 15 ).
</methods> <methods> Protocols.Library.Organization class <category>utility</category>
newTaxIdNumber "((( LDAgentOrganizationalPatron newTaxIdNumber )))" | tin ntin | tin := nextTaxIdNumber copy. ntin := WordArray new: 4. ntin at: 1 put: ( ( tin at: 1 ) + 11 ); at: 2 put: ( ( tin at: 2 ) + 13 ); at: 3 put: ( ( tin at: 3 ) + 17 ); at: 4 put: ( ( tin at: 4 ) + 19 ). nextTaxIdNumber := ntin. ^tin
</methods> <initialize> Protocols.Library.AbstractRandom </initialize> <initialize> Protocols.Library.PersonName </initialize> <initialize> Protocols.Library.SearchService </initialize> <initialize> Protocols.Library.Transaction </initialize> <initialize> Protocols.Library.Holding </initialize> <initialize> Protocols.Library.ShipPlan </initialize> <initialize> Protocols.Library.PhysicalAddress </initialize> <initialize> Protocols.Library.Agent </initialize> <initialize> Protocols.Library.OrganizationName </initialize> <initialize> Protocols.Library.GeneralPublicService </initialize> <initialize> Protocols.Library.CatalogNumber </initialize> <initialize> Protocols.Library.TelephoneNumber </initialize> <initialize> Protocols.Library.AuthorialName </initialize> <initialize> Protocols.Library.Book </initialize> <initialize> Protocols.Library.Library </initialize> <initialize> Protocols.Library.WeatherForecastService </initialize> <initialize> Protocols.Library.CopyService </initialize> <initialize> Protocols.Library.AdministrativeService </initialize> <initialize> Protocols.Library.Organization </initialize> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Model</name> <environment>UI</environment> <super>Core.Object</super> <private>false</private> none dependents <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>Error</name> <environment>Core</environment> <super>Core.Exception</super> <private>false</private> none <imports></imports> <category>Kernel-Exception Handling</category> <attributes> <package>Kernel-Exception Handling</package> </attributes> </class>