RE: using webobjects for the first time
RE: using webobjects for the first time
- Subject: RE: using webobjects for the first time
- From: "Fleetwood, Brett (DCS)" <email@hidden>
- Date: Mon, 14 Aug 2006 13:55:50 +0930
- Thread-topic: using webobjects for the first time
Hi Jake,
Cheers for yours and everyone elses help on this issue very much
appreciated.
Firstly I considered your first option and intend on doing this but
wanted to try an easier option first. I thought I'd just copy what youd
done for the Emplyee since it has a barCodeNumber.
Secondly, in the table view the diamond is next to the attribute
bacCodeNumber and its in the list of classProperties in the
corresponding .plist file like below. Note that barCodeNumber apprears 3
times in the .plist file, the instances below and the attribute field
that I pasted in my initial post.
attributesUsedForLocking = (
id,
active,
type,
lastName,
preferredName,
userName,
actualFirstName,
approver,
defaultContactID,
secondName,
barCodeNumber
);
className = Visitor;
classProperties = (
active,
creationDate,
type,
:
:
cardPersons,
cards,
secondName,
id,
photos,
userpreferences,
barCodeNumber
);
Thirdly, building and deploying. ProjectBuilder is the tool we have for
cleaning, building. the directories and files get deleted, then re-built
and I then copy the server so that when I build the IDCard application
looks like the makefile picks up and uses the Intranetframework.jar! I
know this happends because the the idcards application won't build
unless it uses the updated Intranetframework.jar with the additional
barcodenumber in it.
Note, although in heindsight updating the tools and my knowledge
properly would have been a better method my boss couldn't justify it and
wanted a quick fix... That's just commenced its 3rd week. Mangement
ehh:(
P.s. I read a post of yours from a few years back that helped me get
EOModeller to work, it was having the right java installed and in the
classpath.
P.p.s. you could have left me some doco :)
-----Original Message-----
From: email@hidden [mailto:email@hidden]
Sent: Saturday, 12 August 2006 3:39 AM
To: Fleetwood, Brett (DCS); email@hidden
Subject: RE: using webobjects for the first time
Brett,
G'day to you too. I must admit it is pretty freaky to see a post on a
mailing list about an application I originally developed. It feels a bit
like a message from the past :-)
I've got 3 tips for you.
1) If both your subclasses of 'Person' need to have a 'barCodeNumber'
property, then it may be best to add it to the parent class - instead of
repeating the same code in both subclasses.
2) As someone else said, it sounds like the WebObjects framework can't
see the property you've added as a 'class property'. This could be for a
range of reasons - first I'd check the EOModel to make sure
'barCodeNumber' has been set as a 'class' property. In the GUI it should
have a diamond next to it in 'Table View' or in the .plist it should be
included in the list of 'classProperties'. If the EOModel has this as a
'class property' and you've modified the java class as below then my
next guess would be that the application is not actually building
properly. I'd do a 'clean' and actually make sure the built product has
been deleted before doing another build.
3) Finally, I agree the tools are crap (especially on Windows (which I'm
*guessing* you're using)). I much prefer using Eclipse to develop
WebObjects applications. Eclipse 3.2 works well with a plugin called
WOLips which is available from:
http://www.objectstyle.org/confluence/display/WOL/Home
If you're familiar with Eclipse - you may find WebObjects to be much
more enjoyable by using Eclipse.
Let me know how you go.
Cheers,
Jake
-----Original Message-----
From: webobjects-dev-bounces+jake.macmullin=email@hidden
on behalf of Fleetwood, Brett (DCS)
Sent: Fri 8/11/2006 4:09 PM
To: email@hidden
Cc:
Subject: using webobjects for the first time
G'day,
I've been asked to "enhance" an existing webobjects 5.2 project. My
background is a Java J2EE developer. I've been working on this for the
best part of 2 weeks and find the tools extremely frustrating, (they
are old though and makes you appreciate modern IDE's). The update that i
been asked to do is add an extra field to a database that can then be
created/updated/deleted from the front end form.
I'm updating the visitor classes. which, like the employee class,
inherit from Person -> Item -> EOGenericRecord. I've added a String
barcodeNumber to Visitor the same way Employee has a barCodeNumber. Now,
I've added a getter/setter to the visitor object like so;
public String barCodeNumber() {
return (String)storedValueForKey("barCodeNumber");
}
public void setBarCodeNumber(String value) {
takeStoredValueForKey(value, "barCodeNumber");
}
I then added the reference to this in the WO file...
barCodeNumber: WOString {
value = newVisitor.barCodeNumber;
}
where newVisitor is of type Visitor. I then updated the database, after
spending ages getting the classpath correct for the adapter i finally
got the EOModeller tool to work but when i added the new barCodeNumber
field it wanted to drop the whole table and start again, so i ran an
alter statement to updated the database manually. I then saved the new
attribute in EOModeller so the visitor.plist and file was updated. Note
that the visitor.fspec file wasn't touched (i'm not sure how this file
is used)
the plist file looks like this;
{
allowsNull = Y;
columnName = barCodeNumber;
externalType = varchar;
name = barCodeNumber;
valueClassName = NSString;
width = 10;
},
The application builds and i then deploy and start it through Monitor.
The application runs untill i bring up a page that contains a
<WEBOBJECT NAME=barCodeNumber></WEBOBJECT> directive. it then throws a
run time exception of the following...
Application: pleaseWork
Error: com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException:
takeValueForKey(): attempt to assign value to unknown key:
'barCodeNumber'. This class does not have an instance variable of the
name barCodeNumber or _barCodeNumber, nor a method of the name
setBarCodeNumber or _setBarCodeNumber
Reason:
Stack trace: File Line# Method Package
________________________________
________________________________
NA : Non applicable, JIT activated
I've been on this for a while and tried to make sense of these set of
development tools, however they seem quite obtuse. Can anyone please
help and tell me where i went wrong. I more the happy to supply more
info if needed. Thank you in advance
Brett Fleetwood
Analyst/Programmer
Knowledge and Information Systems
Department for Correctional Services
Email: email@hidden
<mailto:email@hidden>
Phone: (08) 8226 9072
Fax: (08) 8226 9100
**************************************
This e-mail may contain confidential information, which also may be
legally privileged. Only the intended recipient(s) may access, use,
distribute or copy this e-mail. If this e-mail is received in error,
please inform the sender by return e-mail and delete the original. If
there are doubts about the validity of this message, please contact the
sender by telephone. It is the recipient's responsibility to check the
e-mail and any attached files for viruses.
**************************************
_______________________________________________
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