/**
* Copyright (C) 2008-2010, Squale Project - http://www.squale.org
*
* This file is part of Squale.
*
* Squale is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or any later version.
*
* Squale is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Squale. If not, see <http://www.gnu.org/licenses/>.
*/
package org.squale.squaleweb.applicationlayer.formbean.component.parameters;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionMapping;
import org.squale.squalecommon.enterpriselayer.businessobject.component.parameters.ParametersConstants;
import org.squale.squaleweb.transformer.component.parameters.AnalyserTransformer;
/**
* Bean pour la configuration de la r�cup�ration des sources via l'arborescence de fichiers
*/
public class AnalyserForm
extends AbstractParameterForm
{
/**
* La chemin racine du projet Ce chemin peut-�tre le chemin absolu d'un fichier compress� ou d'un r�pertoire.
*/
private String mPath;
/**
* Constructeur par d�faut
*/
public AnalyserForm()
{
mPath = "";
}
/**
* @return le chemin racine
*/
public String getPath()
{
return mPath;
}
/**
* @param pPath le chemin racine
*/
public void setPath( String pPath )
{
mPath = pPath;
}
/**
* @return le transformer � utiliser
* @see org.squale.squaleweb.applicationlayer.formbean.component.parameters.AbstractParameterForm#getTransformer()
*/
public Class getTransformer()
{
return AnalyserTransformer.class;
}
/**
* @return le nom en session
* @see org.squale.squaleweb.applicationlayer.formbean.component.parameters.AbstractParameterForm#getNameInSession()
*/
public String getNameInSession()
{
return "analyserForm";
}
/**
* @see org.squale.squaleweb.applicationlayer.formbean.component.parameters.AbstractParameterForm#getParametersConstants()
* {@inheritDoc}
*/
public String[] getParametersConstants()
{
return new String[] { ParametersConstants.ANALYSER };
}
/**
* @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping,
* javax.servlet.http.HttpServletRequest) {@inheritDoc}
*/
public void reset( ActionMapping mapping, HttpServletRequest request )
{
setPath( "" );
}
/**
* @see org.squale.squaleweb.applicationlayer.formbean.component.parameters.AbstractParameterForm#validateConf(org.apache.struts.action.ActionMapping,
* javax.servlet.http.HttpServletRequest) {@inheritDoc}
*/
protected void validateConf( ActionMapping pMapping, HttpServletRequest pRequest )
{
setPath( getPath().trim() );
if ( getPath().length() == 0 )
{
addError( "path", new ActionError( "error.field.required" ) );
}
}
/**
* @see org.squale.squaleweb.applicationlayer.formbean.component.parameters.AbstractParameterForm#getTaskName()
* {@inheritDoc}
*/
public String getTaskName()
{
return "SourceCodeAnalyserTask";
}
}