📄 form.java
字号:
package com.ejsun.entapps.domain.simpleoa;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import com.ejsun.entapps.core.search.Searchable;
import com.ejsun.entapps.domain.Entity;
import com.ejsun.entapps.domain.organization.User;
/**
* @author Quake Wang
* @since 2004-4-5
* @version $Revision: 1.4 $
*
**/
public class Form extends Entity implements Searchable{
private String formNo;
private String version;
private String subject;
private Date createDate;
private Date effectiveDate;
private User author;
private long workflowId = -1;
private List attributes = new ArrayList();
private List comments = new ArrayList();
private List changeGroups = new ArrayList();
private List tempChangeItems = new ArrayList();
private boolean draft;
public void setAttributeValue(String name, Object value) {
FormAttribute attribute = getAttribute(name);
if(attribute == null) throw new IllegalArgumentException(name + " is not the attribute of the document " + getId());
attribute.setValue(value);
}
public Object getAttributeValue(String name) {
FormAttribute attribute = getAttribute(name);
if(attribute == null) throw new IllegalArgumentException(name + " is not the attribute of the document " + getId());
return attribute.getValue();
}
public FormAttribute getAttribute(String name) {
for (Iterator iter = attributes.iterator(); iter.hasNext();) {
FormAttribute attribute = (FormAttribute) iter.next();
if (attribute.getName().equals(name)) {
return attribute;
}
}
return null;
}
public void addAttribute(FormAttribute attribute) {
if(getAttribute(attribute.getName()) != null)
throw new IllegalArgumentException(attribute.getName() + " attribute duplicate");
attribute.setForm(this);
attributes.add(attribute);
}
public void addComment(Comment comment) {
comment.setForm(this);
comments.add(comment);
}
public void addChangeGroup(ChangeGroup changeGroup) {
changeGroup.setForm(this);
changeGroups.add(changeGroup);
}
public List getAttributes() {
return attributes;
}
public User getAuthor() {
return author;
}
public List getChangeGroups() {
return changeGroups;
}
public List getComments() {
return comments;
}
public Date getCreateDate() {
return createDate;
}
public Date getEffectiveDate() {
return effectiveDate;
}
public String getFormNo() {
return formNo;
}
public String getSubject() {
return subject;
}
public String getVersion() {
return version;
}
public long getWorkflowId() {
return workflowId;
}
public void setAttributes(List list) {
attributes = list;
}
public void setAuthor(User user) {
author = user;
}
public void setChangeGroups(List list) {
changeGroups = list;
}
public void setComments(List list) {
comments = list;
}
public void setCreateDate(Date date) {
createDate = date;
}
public void setEffectiveDate(Date date) {
effectiveDate = date;
}
public void setFormNo(String string) {
formNo = string;
}
public void setSubject(String string) {
subject = string;
}
public void setVersion(String string) {
version = string;
}
public void setWorkflowId(long l) {
workflowId = l;
}
public boolean isDraft() {
return draft;
}
public void setDraft(boolean b) {
draft = b;
}
public void addTempChangeItem(ChangeItem changeItem) {
tempChangeItems.add(changeItem);
}
public List getTempChangeItems() {
return tempChangeItems;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -