/**
 * 
 */
package gov.nih.nci.cananolab.ui.document;

import gov.nih.nci.cananolab.dto.common.PublicationBean;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.DynaValidatorForm;

/**
 * @author tanq
 *
 */
public class SubmitPublicationForm extends DynaValidatorForm{
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		SubmitPublicationForm form = 
			(SubmitPublicationForm)request.getSession().getAttribute("submitPublicationForm");
		String dispatch = (String)form.get("dispatch");
		//if addAuthor and validator fail, do not reset
		if (dispatch!=null && !dispatch.equalsIgnoreCase("addAuthor")
				&& !dispatch.equalsIgnoreCase("create")) {
			PublicationBean pubBean = (PublicationBean)form.get("file");
			pubBean.setResearchAreas(new String[0]);
			pubBean.setVisibilityGroups(new String[0]);
			pubBean.setParticleNames(new String[0]);		
			this.set("file", pubBean);
		}
	}
}

@@ -535,16 +535,37 @@
 Form%22);%0A
+%09%09if (form!=null) %7B%0A%09
 %09%09String
@@ -606,16 +606,17 @@
 atch%22);%0A
+%09
 %09%09//if a
@@ -659,16 +659,17 @@
 reset%0A%09%09
+%09
 if (disp
@@ -722,16 +722,17 @@
 uthor%22)%0A
+%09
 %09%09%09%09&& !
@@ -773,16 +773,17 @@
 )) %7B%0A%09%09%09
+%09
 Publicat
@@ -835,16 +835,17 @@
 file%22);%0A
+%09
 %09%09%09pubBe
@@ -875,32 +875,33 @@
  String%5B0%5D);%0A%09%09%09
+%09
 pubBean.setVisib
@@ -928,16 +928,17 @@
 ng%5B0%5D);%0A
+%09
 %09%09%09pubBe
@@ -978,16 +978,17 @@
 );%09%09%0A%09%09%09
+%09
 this.set
@@ -1006,16 +1006,21 @@
 bBean);%0A
+%09%09%09%7D%0A
 %09%09%7D%0A%09%7D%0A%7D

fix nullPointerException