Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.kuali.rice.kew.doctype;
 
 
 
 import static org.kuali.rice.kew.api.doctype.DocumentTypePolicy.*;

Model bean representing a policy of a document type.

Author(s):
Kuali Rice Team (rice.collab@kuali.org)
 
 @Table(name="KREW_DOC_TYP_PLCY_RELN_T")
 	private static final long serialVersionUID = -4612246888683336474L;
 
     @Column(name="PLCY_NM")
 	private Boolean policyValue;
     @Column(name="PLCY_VAL")
     private String policyStringValue;
     @Transient
     private Boolean inheritedFlag;
     @MapsId("documentTypeId")
     @ManyToOne(fetch=.)
 	@JoinColumn(name="DOC_TYP_ID")
     
     @Transient
     private String documentTypeId;
     @Transient
     private String policyName;
 
     public DocumentTypePolicy() {
     }
 
     public DocumentTypePolicy(String policyNameBoolean policyValue) {
     	this. = policyName;
     	this.getDocumentTypePolicyId().setPolicyName(policyName);
         this. = policyValue;
     }
 
     	if (this. == null) {
     		this. = new DocumentTypePolicyId();
     	}
 		return this.;
 	}
 
 	public void setDocumentTypePolicyId(DocumentTypePolicyId documentTypePolicyId) {
 		this. = documentTypePolicyId;
 	}
 
         if( != null){
             if(.booleanValue()){
                 return "Active";
             } else {
                 return "Inactive";
             }
         }
         return "Inherited";
     }
 
     public Boolean getInheritedFlag() {
         return ;
     }
 
     public void setInheritedFlag(Boolean inheritedFlag) {
         this. = inheritedFlag;
     }
     
     public boolean isAllowUnrequestedAction() {
         return .equals(this.getPolicyName());
     }
 
     public boolean isDefaultApprove() {
         return .equals(this.getPolicyName());
     }
    public boolean isDisApprove() {
        return .getCode().equals(this.getPolicyName());
    }
    public String getDocumentTypeId() {
    }
    public void setDocumentTypeId(String documentTypeId) {
    	this. = documentTypeId;
        this.getDocumentTypePolicyId().setDocumentTypeId(documentTypeId);
    }
    public String getPolicyName() {
        return (this.getDocumentTypePolicyId().getPolicyName() != null) ? this.getDocumentTypePolicyId().getPolicyName() : this.;
    }
    public void setPolicyName(String policyName) {
        /* Cleanse the input.
         * This is surely not the best way to validate the policy name;
         * it would probably be better to use typesafe enums accross the board
         * but that would probably entail refactoring large swaths of code, not
         * to mention reconfiguring OJB (can typesafe enums be used?) and dealing
         * with serialization compatibility issues (if any).
         * So instead, let's just be sure to fail-fast.
         */
        org.kuali.rice.kew.api.doctype.DocumentTypePolicy policy = fromCode(policyName);
        this. = policy.getCode();
        this.getDocumentTypePolicyId().setPolicyName(policy.getCode());
    }
    public Boolean getPolicyValue() {
        return ;
    }
    public void setPolicyValue(Boolean policyValue) {
        this. = policyValue;
    }
    public String getPolicyStringValue() {
        return ;
    }
    public void setPolicyStringValue(String policyStringValue) {
        this. = policyStringValue;
    }
    public Object copy(boolean preserveKeys) {
        DocumentTypePolicy clone = new DocumentTypePolicy();
        if(preserveKeys && this.getDocumentTypeId() != null){
            clone.setDocumentTypeId(this.getDocumentTypeId());
        }
        if(this.getPolicyName() != null){
            clone.setPolicyName(new String(this.getPolicyName()));
        }
        if( != null){
            clone.setPolicyValue(new Boolean(.booleanValue()));
        }
        
        if( != null){
            clone.setPolicyStringValue(new String());
        }
        return clone;
    }
    public DocumentType getDocumentType() {
        return ;
    }
    public void setDocumentType(DocumentType documentType) {
        this. = documentType;
    }
New to GrepCode? Check out our FAQ X