Coverage Report - org.kuali.rice.kew.api.doctype.DocumentTypePolicy
 
Classes in this File Line Coverage Branch Coverage Complexity
DocumentTypePolicy
92%
25/27
66%
4/6
3
DocumentTypePolicy$Codes
0%
0/1
N/A
3
 
 1  
 /**
 2  
  * Copyright 2005-2011 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.kew.api.doctype;
 17  
 
 18  
 import javax.xml.bind.annotation.XmlEnum;
 19  
 import javax.xml.bind.annotation.XmlEnumValue;
 20  
 import javax.xml.bind.annotation.XmlRootElement;
 21  
 import javax.xml.bind.annotation.XmlType;
 22  
 
 23  
 import org.kuali.rice.core.api.mo.common.Coded;
 24  
 
 25  
 /**
 26  
  * TODO...
 27  
  *
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 29  
  */
 30  3
 @XmlRootElement(name = "documentTypePolicy")
 31  
 @XmlType(name = "DocumentTypePolicyType")
 32  
 @XmlEnum
 33  
 public enum DocumentTypePolicy implements Coded {
 34  
     
 35  
         /**
 36  
      * FIXME: needs docs
 37  
      */
 38  1
     @XmlEnumValue(Codes.DISAPPROVE) DISAPPROVE(Codes.DISAPPROVE),
 39  
     
 40  
     /**
 41  
      * This policy determines whether to use the internal KEW Super User document handler URL when opening a document from
 42  
      * super user search. If set to false the client must implement a custom super user screen to be used when the doc
 43  
      * handler URL has a post variable of the name defined by {@link KewApiConstants#COMMAND_PARAMETER} and a value of
 44  
      * {@link KewApiConstants#SUPERUSER_COMMAND}. The default is 'true'.
 45  
      */
 46  1
     @XmlEnumValue(Codes.USE_KEW_SUPERUSER_DOCHANDLER) USE_KEW_SUPERUSER_DOCHANDLER(Codes.USE_KEW_SUPERUSER_DOCHANDLER),
 47  
 
 48  
     /**
 49  
      * determines how to handle the situation where the user has initiated an action but there is not a corresponding pending request. This policy has a default of true.
 50  
      * If set to false an exception should be thrown from ApproveAction, CompleteAction, AcknowledgeAction
 51  
      * and ClearFYIAction classes when there does not exist a corresponding pending request for the user who is submitting the action. 
 52  
      * When set to false, this will result in one of the users getting an error message if 2 users attempt to submit the same action
 53  
      * at the same time (this can happen in workgroup situtations). 
 54  
      */
 55  1
     @XmlEnumValue(Codes.ALLOW_UNREQUESTED_ACTION) ALLOW_UNREQUESTED_ACTION(Codes.ALLOW_UNREQUESTED_ACTION),
 56  
     
 57  
     /**
 58  
      * determines whether a document will go processed without any approval requests.  If
 59  
      * a document has this policy set to false and doesn't generate and approval requests the document will
 60  
      * be put in exception routing, which is the exception workgroup associated with the last route node or the
 61  
      * workgroup defined in the 'defaultExceptionGroupName'.  This policy if not defined in this or a parent
 62  
      * document type defaults to true
 63  
      */
 64  1
     @XmlEnumValue(Codes.DEFAULT_APPROVE) DEFAULT_APPROVE(Codes.DEFAULT_APPROVE),
 65  
     
 66  
     /**
 67  
      * determines if the user that initiated a document must 'route' the document when it is
 68  
      * in the initiated state.  Defaults to true.
 69  
      */
 70  1
     @XmlEnumValue(Codes.INITIATOR_MUST_ROUTE) INITIATOR_MUST_ROUTE(Codes.INITIATOR_MUST_ROUTE),
 71  
     
 72  
     /**
 73  
      * determines if the user that initiated a document must 'route' the document when it is
 74  
      * in the initiated state.  Defaults to true.
 75  
      */
 76  1
     @XmlEnumValue(Codes.INITIATOR_MUST_SAVE) INITIATOR_MUST_SAVE(Codes.INITIATOR_MUST_SAVE),
 77  
     
 78  1
     @XmlEnumValue(Codes.INITIATOR_MUST_CANCEL) INITIATOR_MUST_CANCEL(Codes.INITIATOR_MUST_CANCEL),
 79  
     
 80  1
     @XmlEnumValue(Codes.INITIATOR_MUST_BLANKET_APPROVE) INITIATOR_MUST_BLANKET_APPROVE(Codes.INITIATOR_MUST_BLANKET_APPROVE),
 81  
 
 82  
     /**
 83  
      * determines whether the document can be brought into a simulated route from the route log.  A
 84  
      * simulation of where the document would end up if it where routed to completion now.  Defaults to false.
 85  
      * 
 86  
      * determines if route log will show the look into the future link
 87  
      */
 88  1
     @XmlEnumValue(Codes.LOOK_FUTURE) LOOK_FUTURE(Codes.LOOK_FUTURE),
 89  
 
 90  1
     @XmlEnumValue(Codes.SEND_NOTIFICATION_ON_SU_APPROVE) SEND_NOTIFICATION_ON_SU_APPROVE(Codes.SEND_NOTIFICATION_ON_SU_APPROVE),
 91  
 
 92  1
     @XmlEnumValue(Codes.SUPPORTS_QUICK_INITIATE) SUPPORTS_QUICK_INITIATE(Codes.SUPPORTS_QUICK_INITIATE),
 93  
 
 94  1
     @XmlEnumValue(Codes.NOTIFY_ON_SAVE) NOTIFY_ON_SAVE(Codes.NOTIFY_ON_SAVE),
 95  
     
 96  
     /**
 97  
      * The Document Status Policy determines whether the KEW Route Status or the Application Document Status (or both) 
 98  
      * are to be used for a specific document type.
 99  
      */
 100  1
     @XmlEnumValue(Codes.DOCUMENT_STATUS_POLICY) DOCUMENT_STATUS_POLICY(Codes.DOCUMENT_STATUS_POLICY),
 101  
 
 102  
     /**
 103  
      * This document type policy allows us to configure if the "Perform Post Processor Logic" for the super user action on action requests is displayed.  
 104  
      * KULRICE-3584
 105  
      */
 106  1
     @XmlEnumValue(Codes.ALLOW_SU_POSTPROCESSOR_OVERRIDE) ALLOW_SU_POSTPROCESSOR_OVERRIDE(Codes.ALLOW_SU_POSTPROCESSOR_OVERRIDE),
 107  
 
 108  1
     @XmlEnumValue(Codes.FAIL_ON_INACTIVE_GROUP) FAIL_ON_INACTIVE_GROUP(Codes.FAIL_ON_INACTIVE_GROUP),
 109  
 
 110  1
     @XmlEnumValue(Codes.REGENERATE_ACTION_REQUESTS_ON_CHANGE) REGENERATE_ACTION_REQUESTS_ON_CHANGE(Codes.REGENERATE_ACTION_REQUESTS_ON_CHANGE);
 111  
 
 112  
     
 113  
     private final String code;
 114  
 
 115  16
     private DocumentTypePolicy(String code) {
 116  16
         this.code = code;
 117  16
     }
 118  
 
 119  
     @Override
 120  
     public String getCode() {
 121  1
         return code;
 122  
     }
 123  
 
 124  
     public static DocumentTypePolicy fromCode(String code) {
 125  2
         if (code == null) {
 126  0
             return null;
 127  
         }
 128  8
         for (DocumentTypePolicy policy : values()) {
 129  8
             if (policy.code.equals(code)) {
 130  2
                 return policy;
 131  
             }
 132  
         }
 133  0
         throw new IllegalArgumentException("Failed to locate the DocumentTypePolicy with the given code: " + code);
 134  
     }
 135  
         
 136  0
     private static final class Codes {
 137  
         private static final String DISAPPROVE = "DISAPPROVE";
 138  
         private static final String USE_KEW_SUPERUSER_DOCHANDLER = "USE_KEW_SUPERUSER_DOCHANDLER";
 139  
         private static final String ALLOW_UNREQUESTED_ACTION = "ALLOW_UNREQUESTED_ACTION";
 140  
         private static final String DEFAULT_APPROVE = "DEFAULT_APPROVE";
 141  
         private static final String INITIATOR_MUST_ROUTE = "INITIATOR_MUST_ROUTE";
 142  
         private static final String INITIATOR_MUST_SAVE = "INITIATOR_MUST_SAVE";
 143  
         private static final String INITIATOR_MUST_CANCEL = "INITIATOR_MUST_CANCEL";
 144  
         private static final String INITIATOR_MUST_BLANKET_APPROVE = "INITIATOR_MUST_BLANKET_APPROVE";
 145  
         private static final String LOOK_FUTURE = "LOOK_FUTURE";
 146  
         private static final String SEND_NOTIFICATION_ON_SU_APPROVE = "SEND_NOTIFICATION_ON_SU_APPROVE";
 147  
         private static final String SUPPORTS_QUICK_INITIATE = "SUPPORTS_QUICK_INITIATE";
 148  
         private static final String NOTIFY_ON_SAVE = "NOTIFY_ON_SAVE";
 149  
         private static final String DOCUMENT_STATUS_POLICY = "DOCUMENT_STATUS_POLICY";
 150  
         private static final String ALLOW_SU_POSTPROCESSOR_OVERRIDE = "ALLOW_SU_POSTPROCESSOR_OVERRIDE";
 151  
         private static final String FAIL_ON_INACTIVE_GROUP = "FAIL_ON_INACTIVE_GROUP";
 152  
         private static final String REGENERATE_ACTION_REQUESTS_ON_CHANGE = "REGENERATE_ACTION_REQUESTS_ON_CHANGE";       
 153  
     }
 154  
     
 155  
 }