Re: New Web Components failing to compile?
Re: New Web Components failing to compile?
- Subject: Re: New Web Components failing to compile?
- From: "Jerry W. Walker" <email@hidden>
- Date: Thu, 23 Mar 2006 08:20:17 -0500
Hi, Jeffrey,
While he's walking away whistling, Chuck will soon have you believing
that the only way to develop a WO project is under Windows in
Eclipse. Because he's right about so many things on this list, his
biases here could easily fool you. To put it simply and without
justification, he's just plain wrong on this one. :-)
The easiest way to add a component on Mac OS X using the standard WO
tools is:
* Open your project in Xcode
* Create your new component in WOBuilder
* Save the new component you've built in WOBuilder into your
project's directory
* WOBuilder will ask whether you want the component added to the
project, click Yes.
The component is added to the correct target in the correct location
and automatically appears in Xcode within the Web Components group.
No muss, no fuss, no worries about targets.
You must have your project open in Xcode when you do this or it won't
work correctly. If it does work correctly, you'll notice that
Application and Session appear in the browser at the bottom of your
WOBuilder component window.
All of this is even easier if you start up WOBuilder by double
clicking on a WOComponent in Xcode. Then, when you create a new
component in WOBuilder, the WOBuilder Save dialog sheet is already
pointed at your project.
I've found it easiest to build my WOComponents in WOBuilder's Layout
mode. I add new keys and new Action methods by right clicking (Cntrl
clicking if you have a one-button mouse) in WOBuilder's browser panel
to bring up a drop-down menu. This creates the key or Action method
in your Java code and automatically saves it, making it immediately
available in WOBuilder for binding to your component.
I've often reorganized the class members in Xcode that WOBuilder adds
to the class, but I've found it easiest, overall, to mostly deal with
WOComponents in WOBuilder.
You'll find that the underlying assumption with the Mac OS X WO tools
is that certain parts of the project are best dealt with visually,
specifically the EOModel and the WOComponents. Unfortunately, two
issues have muddied this laudable objective:
* the tools used to deal with these parts of the project have
atrophied over the last six years or so, due primarily to Apple's
neglect
* Xcode is being used to develop projects in so many languages
with so many different project structures, that its Java and WO
capabilities seem buried, at times, under other priorities. Remember
that Cocoa development is the primary use of Xcode and Cocoa apps are
primarily developed in Objective C.
The good news is that:
* the tools were pretty wonderful to start with
* Apple seems to have taken a renewed interest in WebObjects as of
about two years ago and they are actively working on the tools again.
* Xcode's Java capabilities are improving
They haven't surmounted the entropy of four years of neglect and
Xcode will never be as precisely focused on Java development as
Eclipse, but I'm hoping that they'll have the tools in good shape by
this next WWDC. The EOModeler elements embedded in Xcode are not yet
ready for prime time, but what's there seems to be first class. The
new WOBuilder has changed, for the worse in some cases, but their aim
is to have the new WOBuilder better follow the Cocoa GUI guidelines
and I think they're getting there.
Now that they've officially dropped support for Windows development,
they can focus on making the WOTools first class Cocoa citizens and I
fully believe that they're achieving their aim.
If you follow Chuck's advice on this one, he will have you building
your WOComponents and EOModels by hand in BBEdit, or some such so you
can use Eclipse. Watch'im.
Regards,
Jerry
On Mar 22, 2006, at 9:33 PM, Chuck Hill wrote:
I somehow sense that you are starting a deep and long love affair
with targets. :-P
On Mar 22, 2006, at 6:27 PM, Jeffrey Pearson wrote:
Next issue.
When I add a web component, it fails to compile??
Steps I took:
Right-Click on Web Components in the Groups/Files panel.
Select Add->New File
Select WebObjects->Component
Click Next
Name it (ie Publishers)
Location is ~/metropolisadmin
Add to project: metropolisadmin
All Three targets selected (I have also tried just metropolisadmin
target selected)
Click Finish
When XCode finishes what it is doing, I select Build and Go.
Here is the class file created:
//
// Publishers.java: Class file for WO Component 'Publishers'
// Project metropolisadmin
//
// Created by jeffreypearson on 3/22/06
//
import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;
public class Publishers extends WOComponent {
public Publishers(WOContext context) {
super(context);
}
}
Get errors:
Publishers.java:9: package com.webobjects.appserver does not exist
Publishers.java:11: package com.webobjects.eoaccess does not exist
Changes are excellent that WebObjects does, in fact, exist. This
message is a hint from Xcode that you have added the web component
to the wrong target. It needs to be added to the Application
Server target.
Eclipse has no targets...
<walks away whistling>
Chuck
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
_______________________________________________
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