001 /**
002 * Copyright 2005-2012 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.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/ecl2.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.rice.kns.datadictionary;
017
018 import org.kuali.rice.kns.document.authorization.DocumentAuthorizer;
019 import org.kuali.rice.kns.document.authorization.DocumentPresentationController;
020 import org.kuali.rice.kns.document.authorization.TransactionalDocumentAuthorizerBase;
021 import org.kuali.rice.kns.document.authorization.TransactionalDocumentPresentationControllerBase;
022 import org.kuali.rice.kns.rule.PromptBeforeValidation;
023 import org.kuali.rice.kns.web.derivedvaluesetter.DerivedValuesSetter;
024 import org.kuali.rice.krad.datadictionary.ReferenceDefinition;
025
026 import java.util.ArrayList;
027 import java.util.List;
028
029 /**
030 * @author Kuali Rice Team (rice.collab@kuali.org)
031 */
032 @Deprecated
033 public class TransactionalDocumentEntry extends org.kuali.rice.krad.datadictionary.TransactionalDocumentEntry implements KNSDocumentEntry {
034
035 protected Class<? extends PromptBeforeValidation> promptBeforeValidationClass;
036 protected Class<? extends DerivedValuesSetter> derivedValuesSetterClass;
037 protected List<String> webScriptFiles = new ArrayList<String>(3);
038 protected List<HeaderNavigation> headerNavigationList = new ArrayList<HeaderNavigation>();
039
040 protected boolean sessionDocument = false;
041
042 public TransactionalDocumentEntry() {
043 super();
044
045 documentAuthorizerClass = TransactionalDocumentAuthorizerBase.class;
046 documentPresentationControllerClass = TransactionalDocumentPresentationControllerBase.class;
047 }
048
049 @Override
050 public List<HeaderNavigation> getHeaderNavigationList() {
051 return headerNavigationList;
052 }
053
054 @Override
055 public List<String> getWebScriptFiles() {
056 return webScriptFiles;
057 }
058
059 /**
060 * @return Returns the preRulesCheckClass.
061 */
062 @Override
063 public Class<? extends PromptBeforeValidation> getPromptBeforeValidationClass() {
064 return promptBeforeValidationClass;
065 }
066
067 /**
068 * The promptBeforeValidationClass element is the full class name of the java
069 * class which determines whether the user should be asked any questions prior to running validation.
070 *
071 * @see KualiDocumentActionBase#promptBeforeValidation(org.apache.struts.action.ActionMapping,
072 * org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest,
073 * javax.servlet.http.HttpServletResponse, String)
074 */
075 @Override
076 public void setPromptBeforeValidationClass(Class<? extends PromptBeforeValidation> preRulesCheckClass) {
077 this.promptBeforeValidationClass = preRulesCheckClass;
078 }
079
080 /**
081 * The webScriptFile element defines the name of javascript files
082 * that are necessary for processing the document. The specified
083 * javascript files will be included in the generated html.
084 */
085 @Override
086 public void setWebScriptFiles(List<String> webScriptFiles) {
087 this.webScriptFiles = webScriptFiles;
088 }
089
090 /**
091 * The headerNavigation element defines a set of additional
092 * tabs which will appear on the document.
093 */
094 @Override
095 public void setHeaderNavigationList(List<HeaderNavigation> headerNavigationList) {
096 this.headerNavigationList = headerNavigationList;
097 }
098
099 @Override
100 public boolean isSessionDocument() {
101 return this.sessionDocument;
102 }
103
104 @Override
105 public void setSessionDocument(boolean sessionDocument) {
106 this.sessionDocument = sessionDocument;
107 }
108
109 /**
110 * @return the derivedValuesSetter
111 */
112 @Override
113 public Class<? extends DerivedValuesSetter> getDerivedValuesSetterClass() {
114 return this.derivedValuesSetterClass;
115 }
116
117 /**
118 * @param derivedValuesSetter the derivedValuesSetter to set
119 */
120 @Override
121 public void setDerivedValuesSetterClass(Class<? extends DerivedValuesSetter> derivedValuesSetter) {
122 this.derivedValuesSetterClass = derivedValuesSetter;
123 }
124
125 /**
126 * Returns the document authorizer class for the document. Only framework code should be calling this method.
127 * Client devs should use {@link DocumentTypeService#getDocumentAuthorizer(org.kuali.rice.krad.document.Document)}
128 * or
129 * {@link DocumentTypeService#getDocumentAuthorizer(String)}
130 *
131 * @return a document authorizer class
132 */
133 @Override
134 public Class<? extends DocumentAuthorizer> getDocumentAuthorizerClass() {
135 return (Class<? extends DocumentAuthorizer>) super.getDocumentAuthorizerClass();
136 }
137
138 /**
139 * Returns the document presentation controller class for the document. Only framework code should be calling
140 * this
141 * method.
142 * Client devs should use {@link DocumentTypeService#getDocumentPresentationController(org.kuali.rice.krad.document.Document)}
143 * or
144 * {@link DocumentTypeService#getDocumentPresentationController(String)}
145 *
146 * @return the documentPresentationControllerClass
147 */
148 @Override
149 public Class<? extends DocumentPresentationController> getDocumentPresentationControllerClass() {
150 return (Class<? extends DocumentPresentationController>) super.getDocumentPresentationControllerClass();
151 }
152
153 /**
154 * @see org.kuali.rice.krad.datadictionary.DocumentEntry#completeValidation()
155 */
156 @Override
157 public void completeValidation() {
158 super.completeValidation();
159 for (ReferenceDefinition reference : defaultExistenceChecks) {
160 reference.completeValidation(documentClass, null);
161 }
162 }
163
164 @Override
165 public String toString() {
166 return "TransactionalDocumentEntry for documentType " + getDocumentTypeName();
167 }
168 }