WebObjects is a Java web application framework that ran on the server Apple. WebObjects is an integrated suite of Java frameworks for rapidly developing scalable, sophisticated Internet and Enterprise applications.WebObjects is a scalable, high-availability, high-performance application server. From the viewpoint of a developer, though, WebObjects is an extensible object-oriented platform upon which you can rapidly develop and deploy applications that integrate existing data and systems.
WebObjects allows you to develop three different types of Internet applications: web applications, Java Client applications, and web services. Web applications are analogous to Common Gateway Interface (CGI) applications and consist of dynamically generated webpages accessed through a web browser. Java Client moves part of your application to the client-side computer and enlists Sun’s Java Foundation Classes (JFC) to give it the complete user interface found in a more traditional desktop application. Web services uses the same back-end components of web applications and Java Client applications to provide services to other web applications.
Installation procedure for Linux
Step 1: Install eclipse 3.7(This version must)
- Install eclipse 3.7 .Download from here
- Run eclipse.
Step 2: Install Wolips plugin
- Select help->Install new Software.
- Click on “Add” button . Provide any name you want. In the loacation field type ‘http://jenkins.wocommunity.org/job/WOLips37Stable/lastSuccessfulBuild/artifact/temp/dist/’ without quotes.Now select Wolips only(recommended). If you want additional features repeat this step after installing Wolips.
- Click next and finish. After installation restart eclipse. Wolips plugin is now installed.
Step 3: Install the WebObjects Framework
- Now run the following commands in terminal:
$ sudo mkdir -p /Library/WebObjects/Versions/WebObjects543
$ curl -O http://wocommunity.org/documents/tools/WOInstaller.jar
$ sudo java -jar WOInstaller.jar 5.4.3 /Library/WebObjects/Versions/WebObjects543
The frameworks are now in the location /Library/WebObjects/Versions/WebObjects543.
Step 4: Link the Framework to WOlips
This is the most intricate step in the installation process. The configuration file found in the WOlips preferences must correctly reference the framework directory structure. Failure to successfully complete this step will result in broken libraries.
- Create a new file called wolips.543.properties. Copy the code below (after modification) into that file.
- You must replace <YOUR_USER_NAME_HERE!> with your the username which installed the framework.
[php]
wo.system.root=/Library/WebObjects/Versions/WebObjects543/System
wo.user.frameworks=/Users/<YOUR_USER_NAME_HERE!>/Library/Frameworks
wo.system.frameworks=/Library/WebObjects/Versions/WebObjects543/System/Library/Frameworks
wo.bootstrapjar=/Library/WebObjects/Versions/WebObjects543/System/Library/WebObjects/JavaApplications/wotaskd.woa/WOBootstrap.jar
wo.network.frameworks=/Network/Library/Frameworks
wo.api.root=/Library/WebObjects/ADC%20Reference%20Library/documentation/WebObjects/Reference/API
wo.network.root=/Network
wo.extensions=/Library/WebObjects/Versions/WebObjects543/Library/WebObjects/Extensions
wo.user.root=/Users/<YOUR_USER_NAME_HERE!>
wo.local.frameworks=/Library/WebObjects/Versions/WebObjects543/Library/Frameworks
wo.dir.local.library.frameworks=/Library/WebObjects/Versions/WebObjects543/Library/Frameworks
wo.apps.root=/Library/WebObjects/Versions/WebObjects543/Library/WebObjects/Applications
wo.local.root=/Library/WebObjects/Versions/WebObjects543
wo.dir.user.home.library.frameworks=/Users/<YOUR_USER_NAME_HERE!>/Library/Frameworks
[/php]
- Place this file in ~/Library/Application Support/WOLips, this directory should already exist and may contain the default wolips.properties file.
- Now open the Eclipse menu -> Preferences -> WOlips. In the field ‘Wolips properties File’ type ‘wolips.543.properties’ and click ok. At this point, you should have a functioning WebObjects platform to work with.
Step 5: Import Project Wonder into your Eclipse workspace
- Clone the source repository from GitHub into a new directory named “WonderSource” using the command given below:
git clone git://github.com/projectwonder/wonder.git WonderSource
- Navigate to the WonderSource folder
- In the eclipse menu, select file->import.
- Select “Existing Projects into Workspace” as the import source.
- Click “Browse” to select the root directory containing the projects.
- To import framework projects, for example, navigate to and select “…/Wonder/Frameworks” and click “Choose”.
- The list of projects inside that folder appear checked. Uncheck the “Copy Projects into Workspace” checkbox and uncheck the projects you don’t want and click “Finish”.
- Eclipse will build the projects and you can now use Wonder source in Eclipse.
Your First Project – Hello World
- In Eclipse, open the File menu, select New and select Wonder Application.
- Enter HelloWorld as project name. Click Finish.
You have now successfully created your hello world application.
How a WebObject application work
In the project, open the Sources folder, open the your.app.components package and open Main.java. Main.java is the Java part of a Project Wonder component. If you check the content of the Related tab, you will see that Main.java is related to other files like Main.wo and Main.api, it’s a good way to find out if a Java class is part of a component. In the Main.java editor tab, you will need to put one variable + one setter and one getter.
[php]
private String myTextForDisplay = "Hello World from the Java world";
public String myTextForDisplay() {
return myTextForDisplay;
}
public void setMyTextForDisplay(String myTextForDisplay) {
this.myTextForDisplay = myTextForDisplay;
}
[/php]
The next step is to open the HTML part of the component to actually display the string. In the “Main.wo” file, remove the Hello World text from the HTML and replace it with:
[php]
<wo:str value = "$myTextForDisplay" />
[/php]
You have now modified the output using the Main.java and Main.wo file. To make the string truly variable by having a small text field to update the string,open the Main.wo file and add the following:
[php]
;
[/php]
Now we have a simple form to update the string. The only thing we need to do is to implement the updateString method. Open the Main.java file and add the following code:
[php]
public WOActionResults updateString() {
return null;
}
[/php]
Run the project again, and update the string in the text field. Since we added a setter for the variable a couple of steps before, you don’t need to set the string in the updateString method. This explains the power of binding in webobjects. Finally, we have passed the basic step to programming in WebObjects.
You can create web components graphically using WebObjects Builder or indirectly using Direct to Web. If you use Direct to Web, you can also freeze components, add them to your project, and edit them using WebObjects Builder. Database tables are represented in WebObjects as collections of Java classes called Enterprise Objects. The model maps objects to database rows. This high level of abstraction relieves developers from the drudgery of writing inflexible, database-specific code. With the use of drivers, such as JDBC, WebObjects automatically handles the writing of appropriate SQL code. WebObjects being 100% pure java makes it to be deployed on any platform with a certified Java 2 virtual machine.