Accost Apple - Your First WebObjects Appliance
| |
19 July 01:58
Launch Xcode (found in Developer->Applications). Accept ‘New Project...’ from the ‘File’ card to affectation to ‘New Project’ Assistant.
Scroll to the basal of the account of activity types and accept ‘WebObjects Application’.
Click ‘Next’.
Type ‘HelloWorld’ as the ‘Project Name’ and bang on the ‘Set...’ button to specify that you’d like to save your activity to the desktop, or area anytime you’d like to save your project. Agenda that beforehand versions of WebObjects had problems architecture projects if their aisle had any spaces.
Click ‘Next’ lots added times until you appear to a ‘Finish’ button, and bang it (we’ll awning all those additional screens later).
If you did aggregate right, you’ll end up with something that looks like this (depending on how you’ve configured Xcode).
You should now be searching at a aboriginal WebObjects project. This is your ‘blank canvas’ if you’re addicted of analogies.
It may assume a little complicated if you’re acclimated to creating web sites that abide alone of HTML files and images, but it isn’t too abundant added complicated. The capital files we’re absorbed in are in the ‘Web Components’ group.
When you first make a WebObjects project, you will accept just one ‘Component’, the ‘Main’ one.
A WebObjects basic consists of a binder and a agglomeration of files, but at this date we’re absolutely alone absorbed in 2:
Double-click on the ‘Main.wo’ book to adapt the interface in WebObjects Builder.
?You should see something like the awning above. This is how a WebObjects basic looks in WebObjects Builder. The top bisected of the window is a What-You-See-Is-What-You-Get (most of the time (WYSIWYG(MOTT)) HTML editor area you can architecture your pages. The basal bisected of the window is acclimated to affix interface elements to variables in the ‘logic’ area of your web application.
Add the argument “Hello, what is your name?” by accounting in the top bisected of the window.
Add some anatomy elements to the page by selecting a ‘WOForm’, a ‘Text Field’ and a ‘Submit Button’ from the ‘Forms’ card bar item.
Finally, add a place-holder String2 by selecting ‘String’ from the ‘WebObject’ card bar item.
You now accept a accomplished interface: a branch agreeable visitors to your web appliance to access their name, a argument acreage area they can blazon their name, a button so they can abide the anatomy and a place-holder for the cord of characters that you wish to affectation in response.
Now that you accept an interface, you charge to address the argumentation of your first WebObjects application. This appliance allows a user to blazon their name in to a anatomy and displays a bulletin in response. In adjustment to accomplish this, we’re traveling to address a little Java code.
Each WebObjects basic has a Java book that contains the argumentation for the component. Java is an acquisitive programming accent so if you’re not accustomed with acquisitive programming the next area ability acquaint some new concepts. At this date you don’t charge to understand the bleeding data of acquisitive programming, but it ability advice to accept some basal terminology.
Each Java book contains a chic which is like a compound (it seems I like the analogies). The chic contains both variables which are affectionate of like capacity and methods which are like the accomplish in a recipe.
The capital aberration amid a Java chic and a compound is that with Java you don’t understand what you’re baking until you start, so whilst a compound ability say ‘take 1 cup of abrade and mix it’, a Java chic will say ‘take 1 cup of being and mix it’ and you get to adjudge absolutely what being is if the appliance is running.
Anyway, abundant accomplishments - let’s get our easily dirty. In adjustment for our appliance to behave in the way that we wish we charge to adapt the ‘Main’ chic associated with our page. We wish to add two things: a capricious (think ingredient) to accumulate clue of what the user types in and a adjustment (think step) analogue what we should do with the variable.
To create affairs even added interesting, WebObjects architect uses its own analogue if talking about variables and methods. It refers to ‘Keys’ and ‘Actions’. I’m traveling to do what WebObjects should and create things simpler by using the analogue that the blow of the apple uses to accredit to Java classes, so if WebObjects says ‘Key’ anticipate ‘Variable’ and if you apprehend ‘Action’ anticipate ‘Method’ (you’ll get acclimated to it).
So, to add a capricious to accumulate clue of our visitors name, bang on the ‘Interface’ card bar account and baddest ‘Add Key...’.
In the acreage area that slides down, blazon visitorsName (the capitalisation is a assemblage if programming in Java) in the ‘Name’ field, ‘String’ in the ‘Type’ acreage and create abiding ‘An instance variable’ is ticked afore beat ‘Add’.
You should now see ‘visitorsName’ in the bottom-half of the window beneath ‘Application’ and ‘Session’. This indicates that the Java chic associated with this basic has a capricious alleged visitorsName that is accessible to ‘bind’ to interface components.
Repeat this move to add a ‘message’ capricious to the ‘Main’ component.
Next, we charge to add a adjustment to the chic that we will assassinate if visitors bang on the abide button.
Click afresh on the ‘Interface’ card account and this time accept ‘Add Action...’.
Type ‘sayHello’ as the ‘Action name’ and bang ‘Add’.
Open up the Main.java book to see the variables and adjustment that accept been added to this file. It should now attending like the cipher below:
Now you’ve created the interface and added a capricious and adjustment to the basal Java code, all that we charge to do is ‘hook-up’ the interface to the logic.
We charge to specify that the ‘sayHello’ adjustment should appear if the button is clicked and that the amount for the ‘visitorsName’ capricious should appear from the argument field. To do this we charge to about-face aback to WebObjects Builder.
Click and annoyance from the amplitude next to ‘visitorsName’ in the basal bisected of the window to the argument acreage and accept ‘value’ from the drop-down card to announce that you wish the ‘visitorsName’ capricious to get its amount from the argument field.
Repeat this move to bind the ‘value’ of the activating Cord to the ‘message’ capricious and the ‘action’ of the ‘Submit’ button to the ‘sayHello’ adjustment in the basal Java class.
Once you’ve absorbed up the interface to the logic, the alone affair larboard to do is address a band (or two) of Java cipher to compose a custom bulletin in acknowledgment to the bang of the button.
Open the ‘Main.java’ book by double-clicking on it.
Fill out the data of the sayHello adjustment like the archetype below. Basically, if this adjustment is accomplished we wish to assemble a custom bulletin based on the capricious ‘visitorsName’ which will accommodate the name of the being we wish to greet.
Congratulations - you’ve just accounting your first WebObjects application. Create abiding you’ve adored both the Main.wo book in WebObjects Architect and the Main.java book in XCode and you’re accessible to abridge your cipher and run the application. Bang on the ‘Build and Go’ button in XCode to analysis your application.
Launch Xcode (found in Developer->Applications). Accept ‘New Project...’ from the ‘File’ card to affectation to ‘New Project’ Assistant.
Scroll to the basal of the account of activity types and accept ‘WebObjects Application’.
Click ‘Next’.
Type ‘HelloWorld’ as the ‘Project Name’ and bang on the ‘Set...’ button to specify that you’d like to save your activity to the desktop, or area anytime you’d like to save your project. Agenda that beforehand versions of WebObjects had problems architecture projects if their aisle had any spaces.
Click ‘Next’ lots added times until you appear to a ‘Finish’ button, and bang it (we’ll awning all those additional screens later).
If you did aggregate right, you’ll end up with something that looks like this (depending on how you’ve configured Xcode).
You should now be searching at a aboriginal WebObjects project. This is your ‘blank canvas’ if you’re addicted of analogies.
It may assume a little complicated if you’re acclimated to creating web sites that abide alone of HTML files and images, but it isn’t too abundant added complicated. The capital files we’re absorbed in are in the ‘Web Components’ group.
When you first make a WebObjects project, you will accept just one ‘Component’, the ‘Main’ one.
A WebObjects basic consists of a binder and a agglomeration of files, but at this date we’re absolutely alone absorbed in 2:
- Main.wo - which contains the interface
- Main.java - area we’ll put the argumentation for the Main.wo page.
Double-click on the ‘Main.wo’ book to adapt the interface in WebObjects Builder.
?You should see something like the awning above. This is how a WebObjects basic looks in WebObjects Builder. The top bisected of the window is a What-You-See-Is-What-You-Get (most of the time (WYSIWYG(MOTT)) HTML editor area you can architecture your pages. The basal bisected of the window is acclimated to affix interface elements to variables in the ‘logic’ area of your web application.
Add the argument “Hello, what is your name?” by accounting in the top bisected of the window.
Add some anatomy elements to the page by selecting a ‘WOForm’, a ‘Text Field’ and a ‘Submit Button’ from the ‘Forms’ card bar item.
Finally, add a place-holder String2 by selecting ‘String’ from the ‘WebObject’ card bar item.
You now accept a accomplished interface: a branch agreeable visitors to your web appliance to access their name, a argument acreage area they can blazon their name, a button so they can abide the anatomy and a place-holder for the cord of characters that you wish to affectation in response.
Now that you accept an interface, you charge to address the argumentation of your first WebObjects application. This appliance allows a user to blazon their name in to a anatomy and displays a bulletin in response. In adjustment to accomplish this, we’re traveling to address a little Java code.
Each WebObjects basic has a Java book that contains the argumentation for the component. Java is an acquisitive programming accent so if you’re not accustomed with acquisitive programming the next area ability acquaint some new concepts. At this date you don’t charge to understand the bleeding data of acquisitive programming, but it ability advice to accept some basal terminology.
Each Java book contains a chic which is like a compound (it seems I like the analogies). The chic contains both variables which are affectionate of like capacity and methods which are like the accomplish in a recipe.
The capital aberration amid a Java chic and a compound is that with Java you don’t understand what you’re baking until you start, so whilst a compound ability say ‘take 1 cup of abrade and mix it’, a Java chic will say ‘take 1 cup of being and mix it’ and you get to adjudge absolutely what being is if the appliance is running.
Anyway, abundant accomplishments - let’s get our easily dirty. In adjustment for our appliance to behave in the way that we wish we charge to adapt the ‘Main’ chic associated with our page. We wish to add two things: a capricious (think ingredient) to accumulate clue of what the user types in and a adjustment (think step) analogue what we should do with the variable.
To create affairs even added interesting, WebObjects architect uses its own analogue if talking about variables and methods. It refers to ‘Keys’ and ‘Actions’. I’m traveling to do what WebObjects should and create things simpler by using the analogue that the blow of the apple uses to accredit to Java classes, so if WebObjects says ‘Key’ anticipate ‘Variable’ and if you apprehend ‘Action’ anticipate ‘Method’ (you’ll get acclimated to it).
So, to add a capricious to accumulate clue of our visitors name, bang on the ‘Interface’ card bar account and baddest ‘Add Key...’.
In the acreage area that slides down, blazon visitorsName (the capitalisation is a assemblage if programming in Java) in the ‘Name’ field, ‘String’ in the ‘Type’ acreage and create abiding ‘An instance variable’ is ticked afore beat ‘Add’.
You should now see ‘visitorsName’ in the bottom-half of the window beneath ‘Application’ and ‘Session’. This indicates that the Java chic associated with this basic has a capricious alleged visitorsName that is accessible to ‘bind’ to interface components.
Repeat this move to add a ‘message’ capricious to the ‘Main’ component.
Next, we charge to add a adjustment to the chic that we will assassinate if visitors bang on the abide button.
Click afresh on the ‘Interface’ card account and this time accept ‘Add Action...’.
Type ‘sayHello’ as the ‘Action name’ and bang ‘Add’.
Open up the Main.java book to see the variables and adjustment that accept been added to this file. It should now attending like the cipher below:
public chic Capital extends WOComponent
accessible WOComponent sayHello()
}
Now you’ve created the interface and added a capricious and adjustment to the basal Java code, all that we charge to do is ‘hook-up’ the interface to the logic.
We charge to specify that the ‘sayHello’ adjustment should appear if the button is clicked and that the amount for the ‘visitorsName’ capricious should appear from the argument field. To do this we charge to about-face aback to WebObjects Builder.
Click and annoyance from the amplitude next to ‘visitorsName’ in the basal bisected of the window to the argument acreage and accept ‘value’ from the drop-down card to announce that you wish the ‘visitorsName’ capricious to get its amount from the argument field.
Repeat this move to bind the ‘value’ of the activating Cord to the ‘message’ capricious and the ‘action’ of the ‘Submit’ button to the ‘sayHello’ adjustment in the basal Java class.
Once you’ve absorbed up the interface to the logic, the alone affair larboard to do is address a band (or two) of Java cipher to compose a custom bulletin in acknowledgment to the bang of the button.
Open the ‘Main.java’ book by double-clicking on it.
Fill out the data of the sayHello adjustment like the archetype below. Basically, if this adjustment is accomplished we wish to assemble a custom bulletin based on the capricious ‘visitorsName’ which will accommodate the name of the being we wish to greet.
public chic Capital extends WOComponent
accessible WOComponent sayHello()
}
Congratulations - you’ve just accounting your first WebObjects application. Create abiding you’ve adored both the Main.wo book in WebObjects Architect and the Main.java book in XCode and you’re accessible to abridge your cipher and run the application. Bang on the ‘Build and Go’ button in XCode to analysis your application.
|
webobjects, click, application, class, variable, method, interface, button, field, project, component, builder, window, logic, ‘visitorsname’, you’ve, you’re, wocomponent, programming, recipe, think, public, variables, contains, xcode, ‘main’, we’re, files, sayhello, ‘sayhello’, world, oriented, object, write, terminology, visitors, response, message, , webobjects builder, java file, java class, webobjects application, text field, oriented programming, webobjects component, object oriented, menu bar, java code, bar item, object oriented programming, main extends wocomponent, class main extends, extends wocomponent public, public class main, wocomponent public wocomponent, public wocomponent sayhello, main java file, save your project, type their name, class associated with, repeat this step, world your first, |
Also see ...
WebObjects Development Accoutrement Concealment and WOlips
[http://www.eclipse.org Eclipse] is an open source, cross platform development ambiance developed by IBM in Java and advised with about the abstraction of plugins and extensions. This axiological architectonics allows any amount of additions to the amount appliance that can be chip throughout the a
[http://www.eclipse.org Eclipse] is an open source, cross platform development ambiance developed by IBM in Java and advised with about the abstraction of plugins and extensions. This axiological architectonics allows any amount of additions to the amount appliance that can be chip throughout the a
WebObjects Activity Admiration Installing
There are two means to install Activity Admiration bifold administration or architecture from source.The easiest way is to install the bifold distribution. m Ambit Technology runs a nightly body server for Activity Admiration that preserves actual builds at http://www.mdimension.com/~wonder
There are two means to install Activity Admiration bifold administration or architecture from source.The easiest way is to install the bifold distribution. m Ambit Technology runs a nightly body server for Activity Admiration that preserves actual builds at http://www.mdimension.com/~wonder
Attenuated Acquirements in K-12 Types of Attenuated Acquirements Classroom Websites
Using Websites for Attenuated Acquirements in K 12This area focuses on the use of websites in the classroom. Classroom websites advice facilitate the conception of a attenuated acquirements environment. Agents use classroom websites to column assignments, accept appointment submissions, ad
Using Websites for Attenuated Acquirements in K 12This area focuses on the use of websites in the classroom. Classroom websites advice facilitate the conception of a attenuated acquirements environment. Agents use classroom websites to column assignments, accept appointment submissions, ad
Using Firefox Browsing with Tabs
Firefox has been advised to be adapted by any user immediately with no acquirements curve. About to absolutely balance the web, you should become adequate with Firefoxs avant garde features. One of these is the use of tabs. Firefox uses tabs to appearance assorted web pages in the aforementione
Firefox has been advised to be adapted by any user immediately with no acquirements curve. About to absolutely balance the web, you should become adequate with Firefoxs avant garde features. One of these is the use of tabs. Firefox uses tabs to appearance assorted web pages in the aforementione
PHP vs ColdFusion Accost Apple
was apparent as aboriginal as 1974 in centralized announcement by Kernighan —Programming in C: A Tutorial— which shows the first accepted adaptation of the program: main( ) In this tutorial we will use one called bulletin to affectation a of text.These files should consist
was apparent as aboriginal as 1974 in centralized announcement by Kernighan —Programming in C: A Tutorial— which shows the first accepted adaptation of the program: main( ) In this tutorial we will use one called bulletin to affectation a of text.These files should consist
PHP vs ColdFusion Editors
Acrimonious the appropriate editor is capital for web designers. Actuality we will awning some of the pros and cons of alive with assertive editors. is a actual accurate and accessible utility. It offers humans to make websites who understand aught .Cost: $199 USPros:Easy to use: Any
Acrimonious the appropriate editor is capital for web designers. Actuality we will awning some of the pros and cons of alive with assertive editors. is a actual accurate and accessible utility. It offers humans to make websites who understand aught .Cost: $199 USPros:Easy to use: Any
Web Architecture Alice in Wonderland
Accommodated Alice! [http://alice.org/ Alice] is an abundantly fun program that has been create advisedly accessible as a accessible account by [http://www.cmu.edu/ Carnegie Allotment University].The abundant allotment about Alice is that youll alpha acquirements the basics of computer prog
Accommodated Alice! [http://alice.org/ Alice] is an abundantly fun program that has been create advisedly accessible as a accessible account by [http://www.cmu.edu/ Carnegie Allotment University].The abundant allotment about Alice is that youll alpha acquirements the basics of computer prog
simple
Go aback to Go aback to Go aback to This tutorial is accounting by and may be acclimated in any educational and non commercial way. Amuse add comments in and if you adapt this tutorial, amuse add your name below:Please agenda that the Software is not activated as i dont accept a lo
Go aback to Go aback to Go aback to This tutorial is accounting by and may be acclimated in any educational and non commercial way. Amuse add comments in and if you adapt this tutorial, amuse add your name below:Please agenda that the Software is not activated as i dont accept a lo
WebObjects Database Affinity and Comparisons Sybase
[http://www.sybase.com/products/informationmanagement/sybaseiq Sybase IQ] Highly scalable relational database optimized for incomparable concern achievement in business intelligence and ample data warehouses. [http://www.sybase.com/products/informationmanagement/adaptiveserverenterprise Syba
[http://www.sybase.com/products/informationmanagement/sybaseiq Sybase IQ] Highly scalable relational database optimized for incomparable concern achievement in business intelligence and ample data warehouses. [http://www.sybase.com/products/informationmanagement/adaptiveserverenterprise Syba
Developing a library websites
Developing a LIBRARY WEBSITE: A DISSCUSIONcontents 1 INTRODUCTION2 WEBSITE: its Definitation3 LIBRARY WEBSITE: Charge AND PURPOSE 4. USERS OF LIBRARY WEBSITE5. LIBRARY WEBSITE: Problem IN DEVELOPING6. Attempt FOR DESIGNING A LIBRARY WEBSITE7.STEPS IN THE Conceptio
Developing a LIBRARY WEBSITE: A DISSCUSIONcontents 1 INTRODUCTION2 WEBSITE: its Definitation3 LIBRARY WEBSITE: Charge AND PURPOSE 4. USERS OF LIBRARY WEBSITE5. LIBRARY WEBSITE: Problem IN DEVELOPING6. Attempt FOR DESIGNING A LIBRARY WEBSITE7.STEPS IN THE Conceptio