[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ganymede Dev] Sensitive Invid Field
|
On Wed, Apr 30, 2003 at 11:00:26PM +0000, John King wrote:
|
| Yep it's Jan. thats Dutch for John Anyway, my code is as follows and
| foregive me my bad writing now I've got my hads wrapped in boxing warapping
| s :))
|
| public ReturnVal setDName(String zone){
|
| //declare variables
| String compositAddress,parentDName;
|
| //Zone set override code override Zone begins with
| "override".
| //should be unimplemented
| if((!(zone==null))&(!override)){
| String keyword="";
| for(int k=0;(k<zone.length())&!override;k++){
| keyword+=zone.charAt(k)+"";
| if((k==7) &
| (keyword.equals("override"))){override=true;};};
| if(override){
| Ganymede.debug("Override command received. Checks
| are off.");
| DNameWizardEnabled=false;return
| Ganymede.createInfoDialog("Special","Override command received. Checks are
| off.");};};
|
| //check which field(s) was (were) defined
| if(zone==null){
| //zone was blank. thus parent just got defined. stop
| the wizard cus of lack of data
| DNameWizardEnabled=false;
| //perhaps the new value wasn't noticed yet.. give a
| refresh command too
| return
| ((InvidDBField)getField(PARENT)).rescanThisField(null);
| }
|
| //zone was defined, lets try the DName of the parent
| try{
| parentDName =
| ((StringDBField)getFieldInTarget(PARENT,DNAME)).getValueString();
| }
| //and catch errors on casting operations
| catch(ClassCastException ex){
| throw new RuntimeException("Error while trying to
| cast in parent "+ex.getMessage());
| }
| catch(NullPointerException ex){
| // exception! no need to panic, this is the null
| getFieldInTarget gives on error
| // we have no proper parent defined. end the wizard.
| DNameWizardEnabled=false;
| //perhaps the new value wasn't noticed yet.. give a
| refresh command too
| return
| ((InvidDBField)getField(PARENT)).rescanThisField(null);
| }
|
| //parent was defined too
| //construct the full address out of the zone name and the
| parent domain
| compositAddress=zone+"."+parentDName;
| //and set the DName-field overriding permissions
| return
| ((StringDBField)getField(DNAME)).rescanThisField(setFieldValueLocal(DNAME,
| compositAddress));
|
| }
|
| setDName is called on final;ize setvalue, wizardhook gives the same problem.
Well, it would have been helpful if you had actually included your
finalizeSetValue() method, rather than just the secondary setDName()
method.
The problem is almost certainly that you are trying to use
return ((InvidDBField)getField(PARENT)).rescanThisField(null);
to get the value of the PARENT field.. I assume that's the field that
your finalizeSetValue() method was called upon to trigger setDName()
being called?
If you look at the method signature for DBEditObject.finalizeSetValue(),
you'll see that it is defined as
public ReturnVal finalizeSetValue(DBField field, Object value)
in this case, value will be the new Invid to be set into that field.
If you do a getFieldValue() or something like that on an
InvidDBField() between the time that finalizeSetValue() is called and
the time that finalizeSetValue() is returned, you'll always see the
old value of the Invid field.
The whole point of finalizeSetValue() and the other finalize methods
is that if your finalize methods don't return a successful ReturnVal
or null, the change that you are being notified for will not actually
be performed.
Does this make sense?
| besides it's great you're alreadsy at your work!\
I haven't left yet.. it's only 6pm here. ;-)
| Regards,
| Jan Bonne Aans
| DTO, TU Delft
| The Netherlands
--
-------------------------------------------------------------------------------
Jonathan Abbey jonabbey@arlut.utexas.edu
Applied Research Laboratories The University of Texas at Austin
GPG Key: 71767586 at keyserver pgp.mit.edu, http://www.ganymeta.org/workkey.gpg
Attachment:
pgp00008.pgp
Description: PGP signature
Re: [Ganymede Dev] Sensitive Invid Field
- From: Jonathan Abbey <jonabbey@arlut.utexas.edu>