using webobjects for the first time
using webobjects for the first time
- Subject: using webobjects for the first time
- From: "Fleetwood, Brett (DCS)" <email@hidden>
- Date: Fri, 11 Aug 2006 15:39:49 +0930
- Thread-topic: 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
Analyst/Programmer
Knowledge
and Information Systems
Department
for Correctional Services
Email:
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