/*
* Copyright (c) 2005-2011 Grameen Foundation USA
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
* See also http://www.apache.org/licenses/LICENSE-2.0.html for an
* explanation of the license and how it is applied.
*/
package org.mifos.customers.group.struts.actionforms;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.mifos.application.util.helpers.Methods;
import org.mifos.customers.group.util.helpers.GroupConstants;
import org.mifos.framework.struts.actionforms.BaseActionForm;
public class AddGroupMembershipForm extends BaseActionForm {
private String searchString;
private String officeId;
private String officeName;
private String parentGroupId;
private String parentGroupName;
@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
String method = request.getParameter(Methods.method.toString());
if (method.equals(Methods.updateParent.toString())) {
}
if (!method.equals(Methods.validate.toString())) {
request.setAttribute(GroupConstants.METHODCALLED, method);
}
return errors;
}
public String getSearchString() {
return searchString;
}
public void setSearchString(String searchString) {
this.searchString = searchString;
}
public String getOfficeId() {
return officeId;
}
public void setOfficeId(String officeId) {
this.officeId = officeId;
}
public String getOfficeName() {
return officeName;
}
public void setOfficeName(String officeName) {
this.officeName = officeName;
}
public String getParentGroupId() {
return parentGroupId;
}
public void setParentGroupId(String parentGroupId) {
this.parentGroupId = parentGroupId;
}
public String getParentGroupName() {
return parentGroupName;
}
public void setParentGroupName(String parentGroupName) {
this.parentGroupName = parentGroupName;
}
public Short getOfficeIdValue() {
return getShortValue(officeId);
}
public Integer getParentGroupIdValue() {
return getIntegerValue(parentGroupId);
}
}