Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AgendaBo |
|
| 0.0;0 |
1 | package org.kuali.rice.krms.impl.repository | |
2 | ||
3 | import org.kuali.rice.krad.bo.PersistableBusinessObjectBase | |
4 | ||
5 | import org.kuali.rice.krms.api.repository.agenda.AgendaDefinitionContract; | |
6 | ||
7 | ||
8 | public class AgendaBo extends PersistableBusinessObjectBase implements AgendaDefinitionContract { | |
9 | ||
10 | def String id | |
11 | def String namespace | |
12 | def String name | |
13 | def String typeId | |
14 | def String contextId | |
15 | def boolean active | |
16 | ||
17 | def String firstItemId | |
18 | def Set<AgendaAttributeBo> attributeBos | |
19 | ||
20 | def List<AgendaItemBo> items | |
21 | ||
22 | public String getNamespaceCode(){ | |
23 | 8 | return namespace |
24 | } | |
25 | ||
26 | public Map<String, String> getAttributes() { | |
27 | 16 | HashMap<String, String> attributes = new HashMap<String, String>(); |
28 | 16 | for (attr in attributeBos) { |
29 | 32 | attributes.put( attr.attributeDefinition.name, attr.value ) |
30 | } | |
31 | 16 | return attributes; |
32 | } | |
33 | ||
34 | ||
35 | ||
36 | // /** | |
37 | // * Converts a mutable bo to it's immutable counterpart | |
38 | // * @param bo the mutable business object | |
39 | // * @return the immutable object | |
40 | // */ | |
41 | // static AgendaDefinition to(AgendaBo bo) { | |
42 | // if (bo == null) { return null } | |
43 | // return org.kuali.rice.krms.api.repository.agenda.AgendaDefinition.Builder.create(bo).build() | |
44 | // } | |
45 | // | |
46 | // | |
47 | // /** | |
48 | // * Converts a immutable object to it's mutable bo counterpart | |
49 | // * TODO: move to() and from() to impl service | |
50 | // * @param im immutable object | |
51 | // * @return the mutable bo | |
52 | // */ | |
53 | // static public AgendaBo from(AgendaDefinition im) { | |
54 | // if (im == null) { return null } | |
55 | // | |
56 | // AgendaBo bo = new AgendaBo() | |
57 | // bo.setId( im.getId() ) | |
58 | // bo.setNamespace( im.getNamespaceCode() ) | |
59 | // bo.setName( im.getName() ) | |
60 | // bo.setTypeId( im.getTypeId() ) | |
61 | // bo.setContextId( im.getContextId() ) | |
62 | // bo.setFirstItemId( im.getFirstItemId() ) | |
63 | // | |
64 | // Map<String,String> attrList = convertAttributeKeys | |
65 | // Set<AgendaAttributeBo> attrList = new HashSet<AgendaAttributeBo>() | |
66 | // for (attr in im.getAttributes()){ | |
67 | // | |
68 | // attrList.add ( AgendaAttributeBo.from() ) | |
69 | // } | |
70 | // bo.setAttributes(attrList) | |
71 | // return bo | |
72 | // } | |
73 | ||
74 | ||
75 | } |