1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.impl.type |
17 | |
|
18 | |
import org.kuali.rice.kew.api.repository.type.KewTypeDefinitionContract |
19 | |
import org.kuali.rice.core.api.mo.common.active.MutableInactivatable |
20 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
21 | |
|
22 | |
public class KewTypeBo extends PersistableBusinessObjectBase implements MutableInactivatable, KewTypeDefinitionContract { |
23 | |
|
24 | |
def String id |
25 | |
def String name |
26 | |
def String namespace |
27 | |
def String serviceName |
28 | |
def boolean active = true |
29 | |
def List<KewTypeAttributeBo> attributes |
30 | |
|
31 | |
public List<KewTypeAttributeBo> getAttributes() { |
32 | 0 | if (attributes == null) attributes = new ArrayList<KewTypeAttributeBo>(); |
33 | 0 | return attributes; |
34 | |
} |
35 | |
|
36 | |
public String getQualifiedName() { |
37 | 0 | if ((name != null) && (namespace != null)) { |
38 | 0 | return name + " - " + namespace; |
39 | |
} |
40 | |
|
41 | 0 | return ""; |
42 | |
} |
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
static org.kuali.rice.kew.api.repository.type.KewTypeDefinition to(KewTypeBo bo) { |
50 | 0 | if (bo == null) { return null } |
51 | 0 | return org.kuali.rice.kew.api.repository.type.KewTypeDefinition.Builder.create(bo).build(); |
52 | |
} |
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
static KewTypeBo from(org.kuali.rice.kew.api.repository.type.KewTypeDefinition im) { |
60 | 0 | if (im == null) { return null } |
61 | |
|
62 | 0 | KewTypeBo bo = new KewTypeBo() |
63 | 0 | bo.id = im.id |
64 | 0 | bo.name = im.name |
65 | 0 | bo.namespace = im.namespace |
66 | 0 | bo.serviceName = im.serviceName |
67 | 0 | bo.active = (im.active == null) ? true : im.active; |
68 | 0 | bo.attributes = new ArrayList<KewTypeAttributeBo>() |
69 | 0 | for( attr in im.attributes ){ |
70 | 0 | bo.attributes.add(KewTypeAttributeBo.from(attr)) |
71 | |
} |
72 | 0 | bo.versionNumber = im.versionNumber |
73 | 0 | return bo |
74 | |
} |
75 | |
|
76 | |
} |