| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| MaintenanceDocumentService |
|
| 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.util.List; | |
| 19 | ||
| 20 | import org.kuali.rice.kns.document.MaintenanceDocument; | |
| 21 | import org.kuali.rice.kns.document.MaintenanceLock; | |
| 22 | import org.kuali.rice.kns.maintenance.Maintainable; | |
| 23 | ||
| 24 | /** | |
| 25 | * Provides methods for working with <code>MaintenanceDocument</code>(s). | |
| 26 | */ | |
| 27 | public interface MaintenanceDocumentService { | |
| 28 | ||
| 29 | /** | |
| 30 | * Prepares the <code>MaintenanceDocument</code> on initial request | |
| 31 | * | |
| 32 | * <p> | |
| 33 | * This includes retrieving the data object for edit or copy, clearing | |
| 34 | * fields | |
| 35 | * </p> | |
| 36 | * | |
| 37 | * @param objectClassName | |
| 38 | * - class name for the object being maintained | |
| 39 | * @param docTypeName | |
| 40 | * - workflow doc type for the maintenance document requested | |
| 41 | * @param maintenanceAction | |
| 42 | * - indicates whether this is a new, copy, or edit maintenance | |
| 43 | * action | |
| 44 | * @return MaintenanceDocument prepared document instance | |
| 45 | */ | |
| 46 | public MaintenanceDocument setupNewMaintenanceDocument( | |
| 47 | String objectClassName, String docTypeName, String maintenanceAction); | |
| 48 | ||
| 49 | /** | |
| 50 | * Attempts to find any other active documents that are pending on the same | |
| 51 | * maintenance record. | |
| 52 | * | |
| 53 | * If any are pending and locked, thereby blocking this document, then the | |
| 54 | * docHeaderId/documentNumber of the blocking locked document is returned. | |
| 55 | * | |
| 56 | * Otherwise, if nothing is blocking, then null is returned. | |
| 57 | * | |
| 58 | * @param document | |
| 59 | * - document to test | |
| 60 | * @return A String representing the docHeaderId of any blocking document, | |
| 61 | * or null if none are blocking | |
| 62 | * | |
| 63 | */ | |
| 64 | public String getLockingDocumentId(MaintenanceDocument document); | |
| 65 | ||
| 66 | /** | |
| 67 | * Attempts to find any other active documents that are pending on the same | |
| 68 | * maintenance record. | |
| 69 | * | |
| 70 | * If any are pending and locked, thereby blocking this document, then the | |
| 71 | * docHeaderId/documentNumber of the blocking locked document is returned. | |
| 72 | * | |
| 73 | * Otherwise, if nothing is blocking, then null is returned. | |
| 74 | * | |
| 75 | * @param maintainable | |
| 76 | * - maintainable representing the document to test | |
| 77 | * @param documentNumber | |
| 78 | * - the documentNumber/docHeaderId of the document to test | |
| 79 | * @return A String representing the docHeaderId of any blocking document, | |
| 80 | * or null if none are blocking | |
| 81 | */ | |
| 82 | public String getLockingDocumentId(Maintainable maintainable, | |
| 83 | String documentNumber); | |
| 84 | ||
| 85 | /** | |
| 86 | * Call the same-named method in the Dao, since the service has access to | |
| 87 | * the Dao, but the caller doesn't. | |
| 88 | * | |
| 89 | * This method deletes the locks for the given document number. It is called | |
| 90 | * when the document is final, thus it can be unlocked, or when the locks | |
| 91 | * need to be regenerated (thus they get cleared first). | |
| 92 | * | |
| 93 | * @param documentNumber | |
| 94 | * - document number whose locks should be deleted | |
| 95 | */ | |
| 96 | public void deleteLocks(String documentNumber); | |
| 97 | ||
| 98 | /** | |
| 99 | * Call the same-named method in the Dao, since the service has access to | |
| 100 | * the Dao, but the caller doesn't. | |
| 101 | * | |
| 102 | * This method stores the given list of maintenance locks. Typically these | |
| 103 | * will all be for the same document. | |
| 104 | * | |
| 105 | * @param maintenanceLocks | |
| 106 | * - the list of maintenance locks to be stored | |
| 107 | */ | |
| 108 | public void storeLocks(List<MaintenanceLock> maintenanceLocks); | |
| 109 | ||
| 110 | } |