Re: WebServices Sample Code Location ?
Re: WebServices Sample Code Location ?
- Subject: Re: WebServices Sample Code Location ?
- From: Randy Becker <email@hidden>
- Date: Thu, 19 Jan 2006 13:33:16 -0500
I too have looked for AmazonClient in the past, but have been unable
to find it. My /Developer/Examples/JavaWebObjects dir looks like this:
DatabaseSetup
FileUpload
Frameworks
HelloWorld
JCDiscussionBoard
JCEntityViewer
JCMovies
JCPointOfSale
JCRealEstate
JCRealEstatePhotos
JCRentalStore
JCStudios
JavaClientLauncher
LongRequest
PersistentSessionStore
PetStoreWOJava
RelatedLinks
SchoolToolsClient
SophisticatedDatabaseExample
Source
TCPMonitor.app
ThinkMovies
WOExamples
WOInheritanceExample
XMLInteroperate
iShacks
-Randy
On Jan 19, 2006, at 12:17 PM, Zak Burke wrote:
Denis Stanton wrote on 1/18/06 9:55 PM:
On 19/01/2006, at 3:23 PM, Louis Demers wrote:
the archives (and even documentation) refers to sample code
for webservices [...]
where can i find them ?
:/Developer/Examples/JavaWebObjects/AmazonClient
I couldn't find a list of what all these examples do, and since
their names often don't explain the topic (how are you supposed to
know AmazonClient is a WebService example?) I wrote a script that
pulls out the "Overview" text from each one. Here are the details:
AmazonClient
The AmazonClient application is a simple application that asks you
to enter the name of an author.Then it uses the Amazon web service
to request a list of books by that author, and displays theresult.
This example shows how to use the WebObjects Web service client to
access a third partyWeb service.
CreatePlot
The Create Plot application is a simple application that displays
dynamically generated graphs, counters and a pie-chart. All graphs
are configurable on the fly by editing the dictionary in the text
area. The dictionary is in a plist format. Data can be added to the
pie-chart dictionary and the changes will be reflected.
FileUpload
This example application demonstrates the creation and use of
WOFileUpload elements,allowing you to transport files from client
machines to your application server (and theapplication, if required).
HelloWorld
The Hello World application is a simple application that asks you
to enter your name. Then itdisplays a personalized message. It's a
good example of how to dynamically generate HTML withuser input.
iShacks
This is an HTML based application that uses the JavaRealEstate
Framework (also usedby the JCRealEstate example which is Java
Client based).This example implements a simpleReal Estate site in
which Agents make recommendations to their Customers aboutwhich
Listings they should look at. There is also a general Listings
searchmechanism, including the support of searching via Direct
Actions. New Listings,Customers and Agents can be added to the Data
Base. The edit pages for Listingsand Customers use component
validation to make sure the field input is correct.WOCookies are
used to implementand automatic login functionality.
JavaClientLauncher
Launch any Java Client applications (including Direct to Java
Client applications) using a single Mac OS X application. Based on
this example, you can easily build a double-clickable desktop Java
application able to connect to any Java Client WebObjects
application server. This application displays a URL dialog for
connecting to a WebObjects application server and supports multiple
languages all based on the project's properties.
JCDiscussionBoard
When the client starts up, it shows a login panel in which users
authenticate with a name and password. New users can jump into a
registration panel. While registering, users can choose whether
they are administrators or regular users (which is something you
would not do outside of an example, but it nicely solves the
problem of setting up administrator accounts).After logging in,
administrators and normal users will see different types of user
interfaces. While administrators see a standard Direct to Java
Client application, which was only customized with the help of the
Direct to Java Client Assistant (see the rules in the user.d2wmodel
file), non-adminstrators see a highly customized application which
is much simpler, only allows postings to one board (no multi-board
messages) and forbids adminstrative tasks like removing messages.
Users can switch identity by invoking the Logout menu item in the
Document menu at any time.
JCEntityViewer
After starting server and client applications, the user is
presented with a choice of user interface options to browse data.
Clicking on one of the choices opens more windows.
JCMovies
After starting server and client applications, the user is
presented with a window to browse and edit Movies information.
JCPointOfSale
JCPointOfSale is a multi-window application to perform typical
tasks in a video rental store (checking items in and out,
calculating fees). The application presents the user with a
customer selection table, which then allows the initiation of a new
business transaction with the selected customer. The resulting
transaction window maintains a list of fees currently owed by the
customer and allows the user to update this list by checking out or
returning products via modal panels.
JCRealEstate
When the client starts up, it shows a login panel in which users
authenticate with a name and password. New users can jump into a
registration panel. While registering, users can choose whether
they are administrators, agents or customers (which is something
you would not do outside of an example, but it nicely solves the
problem of setting up administrator accounts). The example does not
implement all security hooks desirable, see the JCDiscussionBoard
example for more details in this area, but it makes sure that only
the administrator user interface shows login names and
administrator users (the properties/entities are simply hidden in
the interface for the other user types).
JCRealEstatePhotos
This application has two primary uses. First, you can use it to
upload files to the WORealEstate database. Second, you can use it
to search for real estate listings. Unlike the JCRealEstate
example, the search returns pictures of matching listings, rather
than the listing information itself. Clicking an image in the
scroll view displays more information about that photo and allows
you to add it to the download queue.
JCRentalStore
JCRentalStore is a pure Direct to Java Client application which
uses various customization techniques to enhance the client
application. There are no client side classes or interface files in
JCRentalStore. On startup the application presents the user with a
query window containing a tabbed pane for all main entities the
user can work with. In this window users can search for objects and
open these in other form windows to edit them. Additionally users
can open an enumeration window to modify the very simple entities.
JCStudios
After starting server and client applications, the user is
presented with a window to transfer Movies between Studios. The
user can trigger an action to buy all movies of a selected Talent
for a Studio.
LongRequest
This example application demonstrates the creation and use of long
runningrequest/response pages which enables web-based applications
to perform lengthy tasks whileproviding feedback and means of
interruption to the user.
PersistentSessionStore
The PersistentSessionStore application demonstrates one possible
alternative session storeobject -- WXPersistentSessionStore. In
WebObjects, the session store is the object thathandles the storage
of your session state between requests. The default session store
is theServerSessionStore, but that only stores the session while
the app is running and cannot dealwith interruptions in service and
consumes virtual memory. The persistent session storesolves these
problems by putting the session on disk as a backup in the event
the app dies orthe in-memory session times
out.Description:Asynchronous ArchivingAt present, there are two
subclasses of WXSessionWriter -- WXSynchronousSessionWriter
andWXAsynchronousSessionWriter. The synchronous session writer is
very straightforward and youmay find it easier to start by looking
at this class first. Once you understand what's goingon with the
synchronous version, you may then want to look at the asynchronous
version. Theasynchronous version employs a "write queue" into which
are placed NSData objectsto be written to disk. A separate thread
is forked to handle writing these archivedsessions. When a new
session archive is placed in the write queue, the thread which does
thewriting is signalled and the data is written to disk
asynchronously.Session TimeoutsThe scheme employed by this example
allows for sessions to reside in memory and on disk tosupport a
fail-over mechanism. To restore a session, we first attempt to get
the sessionfrom the server session store and, if that fails because
the session has timed out, then weattempt to get the session from
disk (via the WXPersistentSessionStore class). The sessiontimeout
scheme employed by the server session store works the same way it
always has in WOF,but the time out scheme for archived session is
managed by a separate class calledWXArchiveTimeOutManager.The
ArchiveTimeOutManager is a utility class employed by
theWXSessionWriter superclass. Its job is to periodically scan the
session archive directoryand purge any stale session archives. The
user default WOSessionArchiveTimeOut can be usedto adjust the time
which any archived session lives on disk; by default this is set to
86400seconds (1 day). The timestamp on the file is used to
determine if the file is stale. Tokeep system resource consumption
minimal, the scan and purge activity happens on a separatethread
and is only invoked every 600 seconds (10 minutes); this period is
hard coded intothe class.
PetStoreEJBClient
PetStoreBeans, PetStoreEJBServer and PetStoreEJBClient contain
thestandard Sun PetStore. PetStoreBeans contains the
beans.PetStoreEJBServer is a WebObjects application (EJB-tier)
which alsoruns a EJB server. PetStoreEJBClient contains the WEB-tier.
PetStoreEJBServer
PetStoreBeans, PetStoreEJBServer and PetStoreEJBClient contain
thestandard Sun PetStore. PetStoreBeans contains the
beans.PetStoreEJBServer is a WebObjects application (EJB-tier)
which alsoruns a EJB server. PetStoreEJBClient contains the WEB-tier.
PetStoreWOJava
RealEstateApp
This example demonstrates how entity beans are deployed for use in
a WebObjectsapplication. The beans were generated by the
EOBeanAssistent from the EOModelfile that is part of the
RealEstateApp project.The example is not intended to be a tutorial
on writing Enterprise Java Beansin general.
RelatedLinks
This example application demonstrates the use of
WOHTTPConnections, WORequests, and XMLfor communication between web
sites. This application takes a qualified website URL
andcommunicates with the Netscape related-link site (www-
rl.netscape.com) to get a list ofsites with related information.
SchoolToolsClient
Together, SchoolToolsClient and SchoolToolsServer make up the
SchoolTools example. The Client is a WebObjects application with
JSP and Servlet integration. The Server is a WebObjects application
providing a SOAP RPC service. The Client and Server applications
communicate using the AXIS toolkit.
SchoolToolsServer
SchoolToolsClient and SchoolToolsServer make up the SchoolTools
example. The Client is a WebObjects application with JSP and
Servlet integration. The Server is a WebObjects application vending
a SOAP service. The Client and Server applications communicate
using the AXIS SOAP toolkit.
SophisticatedDatabaseExample
The SophisticatedDatabaseExample application maintains a simple
universityweb site that allows students to enroll and sign up for
classes.The site is administered by an "admin" user who adds and
deletes students,classes, classrooms, and teachers.The purpose of
the example is to demonstrate the moresophisticated modeling
techniques, such as inheritance, flattened attributesand
relationships, and the use of multiple models.
ThinkMovies
The ThinkMovies application allows you to search and browse the
contents of the example Movies database, which is supplied with
WebObjects. This application is implemented in Java and uses Direct
Actions. Direct Actions enable bookmarkable URLs and session-less
applications that do not require clients to be bound to a session,
and hence be bound to a particular instance of a WebObjects
application. Another feature of the application is the ability to
add reviews/ratings of the Movies, providing the essence of a
"public poll" on the quality and popularity of each movie.
VirtualStoreLite
The VirtualStore Lite application presents potential customers
with a virtual store. In this store, users will see the merchandise
using a QuickTime virtual reality movie. Three different PowerBooks
are available in the store. Users can select a PowerBook from the
virtual reality image and then indicate the quantity to
order.VirtualStore Lite demonstrates the integration of the
WOQuickTime element with a WebObjects application. The QuickTime
plug-in must be installed with the user's browser.
WOExamples
The Component Element Tour allows you to see and try a variety of
examples where components are used to re-create the basic
functionality of many of the WebObject Framework's built-in dynamic
HTML elements. All example components in this tour are created as
non-synchronizing components, and they almost all employ
WOComponentContent. Furthermore, only the primitive dynamic
elements such as WOString, WORepetition, WOConditional,
WOGenericElement, and WOGenericContainer are required to recreate
any of the basic HTML dynamic elements. These components have the
basic functionality of their dynamic elements counterparts but can
be easily modified and treated as components.Description:Simple
Dynamic ElementsActiveImages, Hyperlink, Image, LocalizedStrings,
and Optional Containers examples demonstrate simple dynamic
elements. You can interact with each action-oriented element to see
how it feels to the end user. Each time you click, you will be
taken to a different page; simply use the back arrow button to
return to this page.Dynamic Form ElementsExamples of various form-
related elements are:BrowserFramesInline FramesMultiple Submit
ButtonsPopUp ButtonYou may interact with each element in some way
(either typing into it or making some choice(s)). You can see the
results by clicking the WOSubmitButton or WOImageButton to submit
the form. The values for every form element will be displayed. You
can use your browser's back arrow button to return to the previous
page.WOExtensions ElementsThe CheckBox List, Nested List, and
RadioButton List examples demonstrate three of the more generic
WOExtensions components. There are many more components available
in WOExtensions (most of which support DirectToWeb development).
The source for all WOExtensions components is provided with this
release.
WOInheritanceExample
Entity inheritance is more complex to set up and is not needed
very often, but when it is, you can usethis example to better
understand how it works and what to expect. Three different styles
of entity inheritance are presented: vertical, horizontal,
andsingle-table. The databases for each style of inheritance
contain the same data to provide a goodcomparison of the SQL
generated to fetch inherited or abstract entities. Users select an
inheritancestyle from a list on the initial page of the application
and add, associate, group entities as explainedbelow. The app
itself behaves the same regardless of the inheritance style chosen
- the educationalvalue of the example comes from studying the
entity and inheritance diagrams, the EOModels, the SQLgenerated by
various user actions, and the structure of data in the database for
each inheritance style.
WOSmilExample
XMLInteroperate
This example simulates a client/server backend system that
communicates using XML.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden