public void setProjectStage(ProjectStage projectStage)
{
if (getFaceted().hasFacet(ServletFacet.class))
{
ServletFacet servlet = getFaceted().getFacet(ServletFacet.class);
WebAppCommonDescriptor config = (WebAppCommonDescriptor) servlet.getConfig();
List<ParamValueCommonType> params = config.getAllContextParam();
ParamValueCommonType projectStageParam = null;
for (ParamValueCommonType param : params)
{
if (ProjectStage.PROJECT_STAGE_PARAM_NAME.equals(param.getParamName()))
{
projectStageParam = param;
break;
}
}
if (projectStageParam == null)
{
projectStageParam = config.createContextParam();
projectStageParam.paramName(ProjectStage.PROJECT_STAGE_PARAM_NAME);
}
projectStageParam.paramValue(projectStage.toString());
servlet.saveConfig(config);
}