View Javadoc

1   /*
2    * Copyright 2005-2009 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.dto;
18  
19  /**
20   * Tracks changed to document content for lazy loading
21   *
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class ModifiableDocumentContentDTO extends DocumentContentDTO {
25  
26  	private static final long serialVersionUID = 5174192500065617616L;
27  
28  	private boolean modified = false;
29  	
30  	public ModifiableDocumentContentDTO(DocumentContentDTO documentContentVO) {
31  		super.setRouteHeaderId(documentContentVO.getRouteHeaderId());
32  		super.setApplicationContent(documentContentVO.getApplicationContent());
33  		super.setAttributeContent(documentContentVO.getAttributeContent());
34  		super.setSearchableContent(documentContentVO.getSearchableContent());
35  		super.setAttributeDefinitions(documentContentVO.getAttributeDefinitions());
36  		super.setSearchableDefinitions(documentContentVO.getSearchableDefinitions());
37  	}
38  	
39  	public boolean isModified() {
40  		return modified;
41  	}
42  	
43  	public void resetModified() {
44  		modified = false;
45  	}
46  
47  	public void addAttributeDefinition(WorkflowAttributeDefinitionDTO definition) {
48  		modified = true;
49  		super.addAttributeDefinition(definition);
50  	}
51  
52  	public void addSearchableDefinition(WorkflowAttributeDefinitionDTO definition) {
53  		modified = true;
54  		super.addSearchableDefinition(definition);
55  	}
56  
57  	public void removeAttributeDefinition(WorkflowAttributeDefinitionDTO definition) {
58  		modified = true;
59  		super.removeAttributeDefinition(definition);
60  	}
61  
62  	public void removeSearchableDefinition(WorkflowAttributeDefinitionDTO definition) {
63  		modified = true;
64  		super.removeSearchableDefinition(definition);
65  	}
66  
67  	public void setApplicationContent(String applicationContent) {
68  		modified = true;
69  		super.setApplicationContent(applicationContent);
70  	}
71  
72  	public void setAttributeContent(String attributeContent) {
73  		modified = true;
74  		super.setAttributeContent(attributeContent);
75  	}
76  
77  	public void setAttributeDefinitions(WorkflowAttributeDefinitionDTO[] attributeDefinitions) {
78  		modified = true;
79  		super.setAttributeDefinitions(attributeDefinitions);
80  	}
81  
82  	public void setRouteHeaderId(Long routeHeaderId) {
83  		modified = true;
84  		super.setRouteHeaderId(routeHeaderId);
85  	}
86  
87  	public void setSearchableContent(String searchableContent) {
88  		modified = true;
89  		super.setSearchableContent(searchableContent);
90  	}
91  
92  	public void setSearchableDefinitions(WorkflowAttributeDefinitionDTO[] searchableDefinitions) {
93  		modified = true;
94  		super.setSearchableDefinitions(searchableDefinitions);
95  	}	
96  	
97  }