| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| DocumentLinkDTO |
|
| 2.0;2 |
| 1 | /* | |
| 2 | * Copyright 2007-2010 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.dto; | |
| 17 | ||
| 18 | import java.io.Serializable; | |
| 19 | ||
| 20 | import org.kuali.rice.kew.exception.WorkflowException; | |
| 21 | ||
| 22 | /** | |
| 23 | * Transport object for a documentLink | |
| 24 | * | |
| 25 | * @author Kuali Rice Team (kuali-rice@googlegroups.com) | |
| 26 | * | |
| 27 | */ | |
| 28 | 0 | public class DocumentLinkDTO implements Serializable { |
| 29 | ||
| 30 | private static final long serialVersionUID = 4454393424187842416L; | |
| 31 | ||
| 32 | private String docLinkId; | |
| 33 | private String orgnDocId; | |
| 34 | private String destDocId; | |
| 35 | /** | |
| 36 | * @return the linbkId | |
| 37 | */ | |
| 38 | public String getLinbkId() { | |
| 39 | 0 | return this.docLinkId; |
| 40 | } | |
| 41 | /** | |
| 42 | * @param linbkId the linbkId to set | |
| 43 | */ | |
| 44 | public void setLinbkId(String linkId) { | |
| 45 | 0 | this.docLinkId = linkId; |
| 46 | 0 | } |
| 47 | /** | |
| 48 | * @return the orgnDocId | |
| 49 | */ | |
| 50 | public String getOrgnDocId() { | |
| 51 | 0 | return this.orgnDocId; |
| 52 | } | |
| 53 | /** | |
| 54 | * @param orgnDocId the orgnDocId to set | |
| 55 | */ | |
| 56 | public void setOrgnDocId(String orgnDocId) { | |
| 57 | 0 | this.orgnDocId = orgnDocId; |
| 58 | 0 | } |
| 59 | /** | |
| 60 | * @return the destDocId | |
| 61 | */ | |
| 62 | public String getDestDocId() { | |
| 63 | 0 | return this.destDocId; |
| 64 | } | |
| 65 | /** | |
| 66 | * @param destDocId the destDocId to set | |
| 67 | */ | |
| 68 | public void setDestDocId(String destDocId) { | |
| 69 | 0 | this.destDocId = destDocId; |
| 70 | 0 | } |
| 71 | ||
| 72 | public static boolean checkDocLink(DocumentLinkDTO docLinkVO) throws WorkflowException{ | |
| 73 | 0 | if (docLinkVO == null) |
| 74 | 0 | throw new WorkflowException("doc link is null"); |
| 75 | ||
| 76 | 0 | if(docLinkVO.getOrgnDocId() == null || docLinkVO.getDestDocId() == null) |
| 77 | 0 | throw new WorkflowException("doc id is null"); |
| 78 | ||
| 79 | ||
| 80 | 0 | if(docLinkVO.getOrgnDocId().equals(docLinkVO.getDestDocId())) |
| 81 | 0 | throw new WorkflowException("no self link"); |
| 82 | ||
| 83 | 0 | return true; |
| 84 | } | |
| 85 | } | |
| 86 |