[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ganymede Dev] Sensitive Invid Field

Date Wed, 30 Apr 2003 23:00:26 +0000
From "John King" <the_king17@hotmail.com>




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.

besides it's great you're alreadsy at your work!\



Regards,
Jan Bonne Aans
DTO, TU Delft
The Netherlands


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


----------------------------------------------------------------------------
To make changes to your subscription to the Ganymede Dev mailing list, send
mail to majordomo@arlut.utexas.edu.

To unsubcribe, include the line

unsubscribe ganymede-dev

in the body of your mail message

Visit the Ganymede web page at http://www.arlut.utexas.edu/gash2

----------------------------------------------------------------------------