| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| SessionDocumentService | 
  | 
  | 1.0;1 | 
| 1 |  /* | |
| 2 |   * Copyright 2005-2008 The Kuali Foundation | |
| 3 |   * | |
| 4 |   * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
| 5 |   * you may not use this file except in compliance with the License. | |
| 6 |   * You may obtain a copy of the License at | |
| 7 |   * | |
| 8 |   * http://www.opensource.org/licenses/ecl2.php | |
| 9 |   * | |
| 10 |   * Unless required by applicable law or agreed to in writing, software | |
| 11 |   * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 |   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 |   * See the License for the specific language governing permissions and | |
| 14 |   * limitations under the License. | |
| 15 |   */ | |
| 16 |  package org.kuali.rice.kns.service; | |
| 17 | ||
| 18 |  import java.sql.Timestamp; | |
| 19 | ||
| 20 |  import org.kuali.rice.kns.UserSession; | |
| 21 |  import org.kuali.rice.kns.web.spring.form.DocumentFormBase; | |
| 22 |  import org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase; | |
| 23 |  import org.kuali.rice.kns.workflow.service.KualiWorkflowDocument; | |
| 24 | ||
| 25 | ||
| 26 | ||
| 27 |  /** | |
| 28 |   * Defines the methods common to all AttachmentService implementations | |
| 29 |   * | |
| 30 |   * | |
| 31 |   */ | |
| 32 | ||
| 33 | public interface SessionDocumentService {  | |
| 34 | ||
| 35 |          /** | |
| 36 |       * Returns KualiDocumentFormBase object. It will check userSession first, if it failed then check database | |
| 37 |       * | |
| 38 |       * @param documentNumber | |
| 39 |       * @param docFormKey | |
| 40 |       * @param userSession | |
| 41 |       * @return KualiDocumentFormBase | |
| 42 |       * @throws | |
| 43 |       */ | |
| 44 |          public KualiDocumentFormBase getDocumentForm( String documentNumber, String docFormKey, UserSession userSession, String ipAddress); | |
| 45 | ||
| 46 |          /** | |
| 47 |           * This method retrieve's a document from the user session from the given docId.  | |
| 48 |           */ | |
| 49 |          public KualiWorkflowDocument getDocumentFromSession(UserSession userSession, String docId); | |
| 50 | ||
| 51 |          /** | |
| 52 |           * This method places a document into the user session.  | |
| 53 |           */ | |
| 54 | public void addDocumentToUserSession(UserSession userSession, KualiWorkflowDocument document);  | |
| 55 | ||
| 56 |          /** | |
| 57 |       * Delete KualiDocumentFormBase from session and database. | |
| 58 |       * | |
| 59 |       * @param documentNumber | |
| 60 |       * @param docFormKey | |
| 61 |       * @param userSession | |
| 62 |       * @throws | |
| 63 |       */ | |
| 64 | public void purgeDocumentForm(String documentNumber, String docFormKey, UserSession userSession, String ipAddress);  | |
| 65 | ||
| 66 |          /** | |
| 67 |       * Store KualiDocumentFormBase into session and database. | |
| 68 |       * | |
| 69 |       * @param KualiDocumentFormBase | |
| 70 |       * @param userSession | |
| 71 |       * @throws | |
| 72 |       */ | |
| 73 | public void setDocumentForm(KualiDocumentFormBase form, UserSession userSession, String ipAddress);  | |
| 74 | ||
| 75 | ||
| 76 |          //public void purgeAllSessionDocumentsFromMemory();  | |
| 77 | ||
| 78 |          /** | |
| 79 |       * Delete KualiDocumentFormBases from database. | |
| 80 |       * | |
| 81 |       * @param documentNumber | |
| 82 |       * @throws | |
| 83 |       */ | |
| 84 | public void purgeAllSessionDocuments(Timestamp expirationDate);  | |
| 85 | ||
| 86 |          /** | |
| 87 |           *  | |
| 88 |           * This method stores a UifFormBase into session and database | |
| 89 |           *  | |
| 90 |           * @param form | |
| 91 |           * @param userSession | |
| 92 |           * @param ipAddress | |
| 93 |           */ | |
| 94 | public void setDocumentForm(DocumentFormBase form, UserSession userSession, String ipAddress);  | |
| 95 | ||
| 96 |          /** | |
| 97 |           *  | |
| 98 |       * Returns DocumentFormBase object from the db | |
| 99 |           *  | |
| 100 |           * @param documentNumber | |
| 101 |           * @param docFormKey | |
| 102 |           * @param userSession | |
| 103 |           * @param ipAddress | |
| 104 |           * @return | |
| 105 |           */ | |
| 106 |          public DocumentFormBase getUifDocumentForm(String documentNumber, String docFormKey, UserSession userSession, String ipAddress); | |
| 107 | ||
| 108 | }  |