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