OpenLLM-France/wikimedia huggingface dataset:
# WebObjects/Web Applications/Development/Thumbnailing
### Overview

Many people have asked how to create thumbnails of images using WebObjects. There is nothing specific to WebObjects about this problem, and there are quite a few options for solving it:
* On Mac OS X, you can use Runtime.exec(..) and call the commandline program "sips," which uses the ImageIO and CoreImage frameworks
* On Mac OS X, you can use Brendan Duddridge's ImageIO JNI Wrapper
* An all platforms, you can use Java2D with Java's ImageIO and BufferedImage
* On many platforms, you can run ImageMagick and use Runtime.exec to call the commandline "convert"
* On many platforms, you can build and run JMagick, a Java JNI wrapper around ImageMagick

### ImageMagick

A utility class to call ImageMagick binaries as an external process with Runtime.exec, to either discover height/width or resize an image. It has a few default filepaths that correspond to what I need on my systems, you probably want to change them for your system(s).
Anjo Krank: I may be wrong, but I'm pretty sure that this code won't work, at least not reliably. There is no guarantee that the contents of the supplied arrays are filled before the process exits. I had a lot of null-results when I tried this in Wonder. The only safe way I've seen so far is to actually wait until the stream is truly finished reading before accessing the result. And this can only be done by waiting on a sema. Take a look at ERXRuntimeUtilities for a version that does work.

### JAI example

An example how to resize an image with Java Advanced Imaging (http://java.sun.com/products/java-media/jai/). The jar files jai-codec.jar and jac-core.jar are in the NEXT_ROOT/Library/Java/Extensions folder and referenced in the classpath. This example uses logging capability from project wonder.
# WebObjects/Web Applications/Development/WODisplayGroup

A WODisplayGroup is a versatile way of fetching objects from the database and displaying them. Using WODisplayGroups requires very little code and most of the display choices can be wired up in WOBuilder. To get started you simply drag the entity you wish to display from your EOModel into the component where you want to create the WODisplayGroup. Another option is to drag a relationship from your EOModel which will automatically set up a WODisplayGroup with Master/Detail information already set. Another option is to create a DisplayGroup component using the template available to you in XCode under the "Add a new file" option.
Some of the options a WODisplayGroup can provide you are:
* paginate your results
* filter your results using queryOperators and pattern matching
* display Master/Detail pages
# WebObjects/Web Applications/Development/Sending Emails
### Overview

Sending emails is a very common requirement in a web application. There are several methods you can choose from, each with varying levels of complexity and power.

### JavaMail

JavaMail is Sun's API definition and open-source reference implementation of various methods of sending and receiving mail. All of the other WO mail-sending techniques are based on JavaMail, but you can choose to use it directly rather than use the higher level API's described below. If you would like to use JavaMail on your own, you will need to download and install the following jars and put them into your WOA's classpath:
* JavaMail
* Java Activation Framework

### WOMailDelivery

Built into WebObjects is the WOMailDelivery class. It provides a very simple API for sending mails, but lacks the power of Project Wonder's version. To use WOMailDelivery, you will need to set your SMTP server in one of the following ways:
* Add -DWOSMTPHost=smtp.yourmailserver as a launch parameter
* Set WOSMTPHost=smtp.yourmailserver.com in your Properties file
* Hardcode it with WOApplication.application.setSMTPHost("smtp.yourmailserver.com");
Refer to the WOMailDelivery API for more information, but to simply send an email, you can use the following command:
By default, WOMailDelivery with use Sun's old SMTP implementation. However, if you install JavaMail (as described above) into your WOA or /Library/WebObjects/Extensions, WOMailDelivery will use it instead.

### ERJavaMail

ERJavaMail is part of Project Wonder and provides an API for sending component-based emails. ERJavaMail also uses the JavaMail API's underneath, but it includes the jars inside its framework, so you don't need to manually install JavaMail to use it. Because it does not have any external dependencies on other Project Wonder frameworks, you can use it without bringing in any other Project Wonder frameworks. For more information on ERJavaMail, see the ERJavaMail page.
# WebObjects/Web Applications/Development/Persistent Sessions

Related question: Does anyone have a good example for how to save an expired session to database, and recreate it after it expires?
Nope, but perhaps take you could look at /Developer/Examples/JavaWebObjects/PersistentSessionStore.
From the readme file: The PersistentSessionStore application demonstrates one possible alternative session store object -- WXPersistentSessionStore. In WebObjects, the session store is the object that handles the storage of your session state between requests. The default session store is the ServerSessionStore, but that only stores the session while the app is running and cannot deal with interruptions in service and consumes virtual memory. The persistent session store solves these problems by putting the session on disk as a backup in the event the app dies or the in-memory session times out.
# WebObjects/Web Applications/Development/Profiling WO Apps

A profiler is a development tool that lets you examine memory usage and other bottlenecks in your app.

#### Ulrich Köster

I've tried some of them.
For the big problems jprofiler is great. The docs are useful, the interface is good and the performance is okay. I prefer jMechanic. It's small, free and works together with WOLips. Just some clicks to set it up.
I don't remember much about the others. Some of them don't run under MacOSX and it can take a lot of time to find how to use them together with WO.
profiler homepage: http://www.ej-technologies.com/products/jprofiler/overview.html j jmechanic homepage: http://sourceforge.net/projects/jmechanic/ to see jmechanic in action click on the profiler link: http://objectstyle.org/woproject/gallery.html Ulrich

#### Chuck Hill

If profiling on Windows is an option, you might also want to look at jSprint: http://www.javaperformancetuning.com/tools/jsprint/index.shtml
It is shareware, US$50. I've used it and was satisfied with it. It seems like a good deal for the price. I've not (yet) used jMechanic, so I can't compare the two.
Before you buy anything or try anything you would be well advised to spend a couple of hours at the above Java Performance Tuning site reading up on it: http://www.javaperformancetuning.com/index.shtml There is a lot of good information there.

#### David Hrivnak

(As of March 2007 the J-Sprint link above does not seem to work - the software may not be available anymore) None of the tools on this page appear to work with WebObjects 4.5.1 on Windows.

#### Mike Schrag

I use JProfiler from ej-technologies. It works as well as any of the other big named profilers, and it has explicit support for WebObjects. It is, however, not free like some of the other suggestions.

#### Pierce T. Wetter III

The CHUD tools (i.e. Shark) work on Java.
# WebObjects/Web Applications/Development/Tips and Tricks
### URL's

* wocontext.request.uri = the URL currently being requested
There are several different URL's associated with your application, all of which can be retrieved from various methods on WOApplication. Here is a quick cheat sheet of them:
* WOApplication.application.baseURL = /WebObjects
* WOApplication.application.applicationBaseURL = /WebObjects
* WOApplication.application.cgiAdaptorURL = http://hostname/cgi-bin/WebObjects
* WOApplication.application.directConnectURL = http://hostname:port/cgi-bin/WebObjects/MyApplication.woa
* WOApplication.application.frameworksBaseURL = /WebObjects/Frameworks
* WOApplication.application.servletConnectURL = http://hostname/cgi-bin/WebObjects/MyApplication.woa
* WOApplication.application.webserverConnectURL = http://hostname/cgi-bin/WebObjects/MyApplication.woa/-port

### NSArray

It's in the docs, but NSArray's implementation of KeyValueCoding is not really what I was expecting. To get an object at a specific numeric index of an NSArray, you'd use the
method. So what does
return?
Well, first read the docs: file:///OSX/Developer/Documentation/WebObjects/Reference/com/webobjects/foundation/NSArray.html#valueForKey(java.lang.String)
It turns out that calling valueForKey on an array is the same as calling valueForKey for each element of that array. So if you have an NSArray of Users, calling valueForKey("email"); will return an NSArray of email addresses. calling valueForKey("documents"); will return an NSArray of NSArrays containing document objects. In hindsight (and from looking at the way WOBuilder handles key paths for arrays) this is kind of obvious. But I think the real lesson here is that it is easy to ignore the docs towards the end of an alphabetical page...
# World Stamp Catalogue/Eastern Rumelia
## Eastern Rumelia

* Postage stamps and postal history of Eastern Rumelia
# World Stamp Catalogue/El Salvador
## El Salvador

* Postage stamps and postal history of El Salvador
# World Stamp Catalogue/Estonia
## Estonia

* Postage stamps and postal history of Estonia
* List of Estonian postage stamps

## Summary of pages for the stamps of Estonia

/1995
# World Stamp Catalogue/Epirus
## Northern Epirus

* Postage stamps and postal history of Northern Epirus
# World Stamp Catalogue/F
### F

* Falkland Islands
* Falkland Islands Dependencies
* Far Eastern Republic
* Faroe Islands
* Fiji
* Finland
* Finnish Post Abroad
* Fiume
* France
* French Antarctic Territory
* French Colonies
* French Morocco
* French Polynesia
* French Post Offices Abroad
# World Stamp Catalogue/E
### E

* East Africa (British)
* Eastern Rumelia
* Ecuador
* Egypt
* El Salvador
* Epirus
* Equatorial Guinea
* Eritrea
* Estonia
* Ethiopia (Abyssinia)
# World Stamp Catalogue/Egypt
## Egypt

* Postage stamps and postal history of Egypt
# World Stamp Catalogue/Estonia/1995
## Via Baltica highway project

EST-1995-15
| 1995-04-20 | Via Baltica, perf 14 | Via Baltica, perf 14 | Via Baltica, perf 14 | Via Baltica, perf 14 |
| Image | Catalogue Number | Description | Reference | Notes |
| File:EST-1995-1501.jpg | EST-1995-1501 | 1.70 kroon, Beach hotel in Parnu | Sc 288 | |
| File:EST-1995-1502.jpg | EST-1995-1502 | Souvenir sheet with three following stamps | Sc 289 | |
| File:EST-1995-1503.jpg | EST-1995-1503 | 3.20 kroon, Beach hotel in Parnu, Estonia | Sc 289a | |
| File:EST-1995-1504.jpg | EST-1995-1504 | 3.20 kroon, castle in Bausaka, Latvia | Sc 289b | |
| File:EST-1995-1505.jpg | EST-1995-1505 | 3.20 kroon, Kaunas, Lithuania | Sc 289c | |
See also corresponding stamps for Latvia and Lithuanis
# World Stamp Catalogue/Ethiopia
## Ethiopia

* Postage stamps and postal history of Ethiopia
# World Stamp Catalogue/Europe
## List of stamp-issuing entities in Europe

* Albania - ALB
* Andorra (French Post offices) - AND
* Andorra (Spanish Post offices)
* Armenia - ARM
* Austria - AUT
** UN Vienna Office
* Belarus - BLR
* Belgium - BEL
* Bosnia and Herzegovina - BIH
* Bulgaria - BGR
* Croatia - HRV
* Cyprus - CYP
** Turkish Republic of Northern Cyprus
* Czech Republic - CZE
* Czechoslovakia - CSK
* Denmark - DNK
** Faroe Islands - FRO
** Greenland - GRL
* Estonia - EST
* Finland - FIN
** Åland Islands - ALA
* France - FRA
* Georgia - GEO
* Germany - DEU
** East Germany - DDR
* Greece - GRC
* Hungary - HUN
* Iceland - ISL
* Ireland - IRL
* Italy - ITA
* Latvia - LVA
* Liechtenstein - LIE
* Lithuania - LTU
* Luxembourg - LUX
* Republic of Macedonia - MKD
* Malta - MLT
* Republic of Moldova - MDA
* Monaco - MCO
* The Netherlands - NLD
* Norway - NOR
* Poland - POL
* Portugal - PRT
** Madeira
** Azores
* Romania - ROU
* Russia - RUS
* San Marino - SMR
* Yugoslav Federation - YUG
* Montenegro - MNE
* Serbia - SRB
* Slovakia - SVK
* Slovenia - SVN
* Soviet Union - SUN
* Spain - ESP
* Sweden - SWE
* Switzerland - CHE
** Basel
** Bern
** Fribourg
** Geneva
** Lucerne
** Neuchâtel
** Valais
** International Olympic Committee
** International Refugee Organization
** World Intellectual Property Organization
* Ukraine - UKR
* Great Britain - GBR
** Guernsey - GGY
*** Alderney
** Gibraltar - GIB
** Isle of Man - IMN
** Jersey - JEY
* Vatican City - VAT
# Transportation Deployment Casebook/2020
## States

* California Streetcar
* Connecticut Streetcar
* Delaware Streetcar
* Florida Streetcar
* Georgia Streetcar
* Louisiana Streetcar
* Maryland Streetcar
* Minnesota Streetcar
* North Carolina Streetcar
* Oklahoma Streetcar
* Rhode Island Streetcars
* Washington Streetcar
# XForms/Insert with Origin
## Motivation

You want to insert new values into an instance of the model and specify where to find the initial values of the insert.

## Method

You can add an origin attribute to the insert statement to tell XForms where to get the initial data for the insert. This is the preferred method over doing many setvalues. The syntax of the insert is the following:

## Screen Image

A sample screen image. Many people do not have the ability to run the examples so this is critical.
Use this format:
Make SURE you label all images with a license. Please use creative commons "share alike 3.0 with attribution" if you can.

## XForms Application

Load XForms Application
Make sure that the mime-type is set in the svn system to be text/xml.
# XForms/Installing XForms in Firefox

To install Mozilla XForms on Firefox 3.0, click here.
For Firefox 3.5, click here
To install an experimental version of a Firefox 3.6.* plugin, click here.
# XForms/Installing XForms in FireFox

To get most of the programs working in this tutorial we recommend using the FireFox 1.5 XForms extension or the FireFox 2.0 XForms extension. We recommend these options because these programs do not require any modification to W3C compliant XForms examples. Our experience is it usually takes under a minute and you will not need to setup and configure a specialized web server to run the example programs. Just make sure to give the files an .xhtml extension and associate these file with FireFox an not another web browser.

## FireFox 1.5

* Click Here to download the FireFox XForms 0.7 extension (164KB)
* Select the button with the label "Install Now for Windows (164KB)"
* Select the "Install Now" button
* Restart FireFox

## Firefox 2.0

Firefox 2.0 has a different internal browser engine and needs a different version of the XForms extension. This version is available here:
FireFox 0.7.0.1 Extension
Note: XForms 0.7.0.1 is intended for Firefox 2.0.x (so Gecko 1.8.1.x browsers like Seamonkey 1.1).
The nightly builds are located at: http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla1.8/

## Installing FireFox Using Tools Menus

To download this extension:
* From the FireFox select the "Tools" Menu
* From "Tools" select "Extensions"
* This will bring up a list of your current XForms extensions that are running inside of FireFox.
* On the lower right corner of this window you will see a link to "Get More Extensions". Click that and it will direct you to the FireFox extensions page.
* This web page has a search box in the upper right corner. Type in "XForms" in the search box.
* This will display a page that has a button with the label "download the extension now". Just press the button.
* Remember to RESTART FireFox.

## Debugging Hints

Important Note! I have found that FireFox likes the file names to have the .xhtml extension.
Many people also install the web developer extension: Here is the link:
Firefox Web Developer Extension
# XForms/Input
## Basic Form Input

One of the most common user interface controls in a web form is a simple, one-line text area. In this example we have a very simple form with two input fields. Each input has its own label to the left of the input field.

## Link to XForms Application

Input Fields

## Program Structure

Our program has two parts, a model and a view. The model has instance data in it to store the values that the user enters in the form. The view is part of the presentation in the body of the HTML document.

## Hints

You can also provide the user with data entry hints using the <xf:hint> element.

## Discussion

Notice that as you type, the output gets immediately updated. This is because the XForms input control has an incremental="true" attribute.
Our model is simple, just the first and last name of a person.
Note that the label and hint tags are nested INSIDE the input tags.

## References

W3C XForms specification for input control
# XForms/Input Example
## Basic Form Input

One of the most common user interface controls in a web form is a simple, one-line text field. In this example we have a very simple form with two input fields. Each input has its own label to the left of the input field.

## Link to XForms Application

Input Fields

## Program Structure

Our program has two parts, a model and a view. The model has instance data in it to store the values that the user enters in the form. The view is part of the presentation in the body of the HTML document.

## Hints

You can also provide the user with data entry hints using the <xf:hint> element.

## Discussion

Notice that as you type, the output gets immediately updated. This is because the XForms input control has an incremental="true" attribute.
Our model is simple, just the first and last name of a person.
Note that the label and hint tags are nested INSIDE the input tags.

## References

W3C XForms specification for input control
# XForms/Input Field Width
## Motivation

Sometimes you want to be able to control the field width, even though the default input text scrolls. This can be done for the entire form or for on a field-by-field basis for all input fields within a form. For example if you have three places that a person's last name occurs they can all be controlled by changing a single CSS file that is imported into the form. This CSS file can also be generated directly from an XML Schema or metadata registry using XML transforms.

## Discussion

There are many tradeoffs as to where to put form width information. Ideally it would be generated by a script from a metadata registry. One of the questions concerns if a data element length should only have a default recommended value in a semantic registry and the actual constraints be stored in a constraint schema. We all know that zip codes should be 5 or 9 digits and that a 12 digit zip code may only have meaning in a specific context.
This example has been tested using the FireFox browser. The use of the .xf-value class selector may not work on other systems.
# XForms/Insert

This lab allows you to insert a new row into a tabular structure. We don't use a HTML table here, just a form that updates two items in the model.
Here is the input before you add any new data:

## Discussion

This program has a model of the existing phone list and one additional NewPerson data element at the end of the list. The new person data is linked to the two field form at the end of the table. When you hit the insert button (the trigger) it will copy the data elements from the mini-form and copy them into a new location inside the existing model. The entire list will then be updated. The exact location of where the insert occurs is determined by the index function. The index is the number of the row you last selected.
There are two items to note. First of all, you can select any row just before you do an insert. The new item will be inserted just after this row.
The second thing to note is that you will still need to be able to delete a record. That is the next lab.
# XForms/Insert and Delete into Table
## Motivation

You want to insert and delete records into a table. In this example records are appended to the end of a table but any selected row can be removed. This example does "in-place" table editing. There is no separate form to enable viewing a new record other than in the actual table.

## Discussion

This example uses the last and index XPath functions to find out what row of the table should be operated on.
You can also create a version that has a delete and add button in each row. In this design the index function is used to delete the current row selected and insert after the currently selected row.
In some applications the order of rows is important. You can also add buttons to each row to move the selected row up or down.
Note that after you add the row, you should move the insert cursor to the first field. This is done by using the setfocus element.
# XForms/Incremental Model Loading
## Motivation

You have a large model and you want to incrementally load different portions of the model when they are needed. This is frequently done when you have a multi-part form and each tab needs additional data. Loading only the data for the initial tab keeps your form load times fast and avoids unnecessarily locking shared data resources.

## Method

We will create a model with three separate instances, one for a list of people, one for a list of places and one for a list of things. The people will automatically be loaded into the form when the form loads. We will create triggers that will incrementally load the other portions of the model when they are needed. Each trigger will use a submission event that does a separate HTTP get to incrementally load data into a separate instance in the model.
Here is the empty place-holder instance in the model for the places and the submission to get the places data.
Here is the trigger (button) that gets the new model.

## Screen Image

The following are the before and after screen images. The before screen image is when the form initially loads. The after image is after the user has pressed the two triggers for loading the places and things.
The above example is designed to be very easy to see how data is loaded when an event is triggered. In practice each tab in a multi-tab form may have some data that is only needed if the users click on that tab. This is a perfect use of dynamic model loading. The example below illustrates this best-practice.

## Load XForms Application

Example with triggers that manually load incremental data: Load XForms Application
Example with tab-selection events that incrementally load data Load XForms Application
Note that in this example the event log shows that the data is only loaded once regardless of how many times the tab is selected.

## Avoiding Reloads

The following is an example of how to use conditional actions to check if a instance in the model already has its data loaded into the form:
The if attribute of the xf:action checks to see if there is at least one place in the places instance. If there is not at least one "place" the submission event is fired.

## XML Instance Samples

[people.xml] [places.xml] [things.xml]