Coverage Report - org.kuali.rice.ken.document.kew.NotificationWorkflowDocument
 
Classes in this File Line Coverage Branch Coverage Complexity
NotificationWorkflowDocument
0%
0/5
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007 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.ken.document.kew;
 17  
 
 18  
 import org.kuali.rice.ken.util.NotificationConstants;
 19  
 import org.kuali.rice.kew.exception.WorkflowException;
 20  
 import org.kuali.rice.kew.service.WorkflowDocument;
 21  
 
 22  
 
 23  
 /**
 24  
  * This class extends the KEW WorkflowDocument object and becomes our gateway for 
 25  
  * get a handle on KEW documents in workflow.
 26  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 27  
  */
 28  
 public class NotificationWorkflowDocument extends WorkflowDocument {
 29  
         
 30  
     private static final long serialVersionUID = 6125662798733898964L;
 31  
 
 32  
     /**
 33  
      * Constructs a NotificationWorkflowDocument instance - this essentially creates a new routable document in KEW
 34  
      * for the given user.
 35  
      * @param principalId
 36  
      * @throws WorkflowException
 37  
      */
 38  
     public static NotificationWorkflowDocument createNotificationDocument(String principalId) throws WorkflowException {
 39  0
             return new NotificationWorkflowDocument(principalId, NotificationConstants.KEW_CONSTANTS.NOTIFICATION_DOC_TYPE, null);
 40  
     }
 41  
     
 42  
     /**
 43  
      * Constructs a NotificationWorkflowDocument instance - this essentially creates a new routable document in KEW
 44  
      * for the given user and document type name.
 45  
      * @param user
 46  
      * @param documentTypeName
 47  
      * @throws WorkflowException
 48  
      */
 49  
     public static NotificationWorkflowDocument createNotificationDocument(String principalId, String documentTypeName) throws WorkflowException {
 50  0
             return new NotificationWorkflowDocument(principalId, documentTypeName, null);
 51  
     }
 52  
     
 53  
     /**
 54  
      * Constructs a NotificationWorkflowDocument instance - this one is used to get a handle on a workflow 
 55  
      * document that was already created in the system.
 56  
      * @param user
 57  
      * @param documentId
 58  
      * @throws WorkflowException
 59  
      */
 60  
     public static NotificationWorkflowDocument loadNotificationDocument(String principalId, String documentId) throws WorkflowException {
 61  0
             return new NotificationWorkflowDocument(principalId, null, documentId);
 62  
     }
 63  
             
 64  
     private NotificationWorkflowDocument(String principalId, String documentTypeName, String documentId) throws WorkflowException {
 65  0
             super(principalId, documentTypeName, documentId);
 66  0
     }
 67  
 
 68  
 }