001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.module.kra.web.struts.form;
017:
018: import org.kuali.core.datadictionary.HeaderNavigation;
019: import org.kuali.core.web.struts.form.KualiDocumentFormBase;
020: import org.kuali.module.kra.bo.AdhocOrg;
021: import org.kuali.module.kra.bo.AdhocPerson;
022: import org.kuali.module.kra.document.ResearchDocument;
023:
024: public abstract class ResearchDocumentFormBase extends
025: KualiDocumentFormBase {
026:
027: private AdhocPerson newAdHocPerson;
028: private AdhocOrg newAdHocOrg;
029: private String newAdHocWorkgroupPermissionCode;
030:
031: public ResearchDocumentFormBase() {
032: super ();
033: newAdHocPerson = new AdhocPerson();
034: newAdHocOrg = new AdhocOrg();
035: }
036:
037: abstract public ResearchDocument getResearchDocument();
038:
039: public void disableHeaderNavigation(String headerTabNavigateTo) {
040: for (int i = 0; i < this .getHeaderNavigationTabs().length; i++) {
041: HeaderNavigation currentNav = (HeaderNavigation) this
042: .getHeaderNavigationTabs()[i];
043: if (headerTabNavigateTo.equals(currentNav
044: .getHeaderTabNavigateTo())) {
045: currentNav.setDisabled(true);
046: return;
047: }
048: }
049: }
050:
051: public void enableHeaderNavigation(String headerTabNavigateTo) {
052: for (int i = 0; i < this .getHeaderNavigationTabs().length; i++) {
053: HeaderNavigation currentNav = (HeaderNavigation) this
054: .getHeaderNavigationTabs()[i];
055: if (headerTabNavigateTo.equals(currentNav
056: .getHeaderTabNavigateTo())) {
057: currentNav.setDisabled(false);
058: return;
059: }
060: }
061: }
062:
063: /**
064: * Gets the newAdHocPerson attribute.
065: *
066: * @return Returns the newAdHocPerson.
067: */
068: public AdhocPerson getNewAdHocPerson() {
069: return newAdHocPerson;
070: }
071:
072: /**
073: * Sets the newAdHocPerson attribute value.
074: *
075: * @param newAdHocPerson The newAdHocPerson to set.
076: */
077: public void setNewAdHocPerson(AdhocPerson newAdHocPerson) {
078: this .newAdHocPerson = newAdHocPerson;
079: }
080:
081: /**
082: * Gets the newAdHocOrg attribute.
083: *
084: * @return Returns the newAdHocOrg.
085: */
086: public AdhocOrg getNewAdHocOrg() {
087: return newAdHocOrg;
088: }
089:
090: /**
091: * Sets the newAdHocOrg attribute value.
092: *
093: * @param newAdHocOrg The newAdHocOrg to set.
094: */
095: public void setNewAdHocOrg(AdhocOrg newAdHocOrg) {
096: this .newAdHocOrg = newAdHocOrg;
097: }
098:
099: public String getNewAdHocWorkgroupPermissionCode() {
100: return newAdHocWorkgroupPermissionCode;
101: }
102:
103: public void setNewAdHocWorkgroupPermissionCode(
104: String newAdHocWorkgroupPermissionCode) {
105: this.newAdHocWorkgroupPermissionCode = newAdHocWorkgroupPermissionCode;
106: }
107: }
|