| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AgendaBo |
|
| 0.0;0 |
| 1 | /** | |
| 2 | * Copyright 2005-2011 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.krms.impl.repository | |
| 17 | ||
| 18 | import org.kuali.rice.krad.bo.PersistableBusinessObjectBase | |
| 19 | ||
| 20 | import org.kuali.rice.krms.api.repository.agenda.AgendaDefinitionContract; | |
| 21 | ||
| 22 | ||
| 23 | public class AgendaBo extends PersistableBusinessObjectBase implements AgendaDefinitionContract { | |
| 24 | ||
| 25 | def String id | |
| 26 | def String name | |
| 27 | def String typeId | |
| 28 | def String contextId | |
| 29 | def boolean active = true | |
| 30 | ||
| 31 | def String firstItemId | |
| 32 | def Set<AgendaAttributeBo> attributeBos | |
| 33 | ||
| 34 | def List<AgendaItemBo> items | |
| 35 | ||
| 36 | def ContextBo context | |
| 37 | ||
| 38 | public AgendaBo() { | |
| 39 | 0 | active = true; |
| 40 | 0 | items = new ArrayList<AgendaItemBo>(); |
| 41 | } | |
| 42 | ||
| 43 | public Map<String, String> getAttributes() { | |
| 44 | 0 | HashMap<String, String> attributes = new HashMap<String, String>(); |
| 45 | 0 | for (attr in attributeBos) { |
| 46 | 0 | attributes.put( attr.attributeDefinition.name, attr.value ) |
| 47 | } | |
| 48 | 0 | return attributes; |
| 49 | } | |
| 50 | ||
| 51 | ||
| 52 | ||
| 53 | // /** | |
| 54 | // * Converts a mutable bo to it's immutable counterpart | |
| 55 | // * @param bo the mutable business object | |
| 56 | // * @return the immutable object | |
| 57 | // */ | |
| 58 | // static AgendaDefinition to(AgendaBo bo) { | |
| 59 | // if (bo == null) { return null } | |
| 60 | // return org.kuali.rice.krms.api.repository.agenda.AgendaDefinition.Builder.create(bo).build() | |
| 61 | // } | |
| 62 | // | |
| 63 | // | |
| 64 | // /** | |
| 65 | // * Converts a immutable object to it's mutable bo counterpart | |
| 66 | // * TODO: move to() and from() to impl service | |
| 67 | // * @param im immutable object | |
| 68 | // * @return the mutable bo | |
| 69 | // */ | |
| 70 | // static public AgendaBo from(AgendaDefinition im) { | |
| 71 | // if (im == null) { return null } | |
| 72 | // | |
| 73 | // AgendaBo bo = new AgendaBo() | |
| 74 | // bo.setId( im.getId() ) | |
| 75 | // bo.setNamespace( im.getNamespace() ) | |
| 76 | // bo.setName( im.getName() ) | |
| 77 | // bo.setTypeId( im.getTypeId() ) | |
| 78 | // bo.setContextId( im.getContextId() ) | |
| 79 | // bo.setFirstItemId( im.getFirstItemId() ) | |
| 80 | // | |
| 81 | // Map<String,String> attrList = convertAttributeKeys | |
| 82 | // Set<AgendaAttributeBo> attrList = new HashSet<AgendaAttributeBo>() | |
| 83 | // for (attr in im.getAttributes()){ | |
| 84 | // | |
| 85 | // attrList.add ( AgendaAttributeBo.from() ) | |
| 86 | // } | |
| 87 | // bo.setAttributes(attrList) | |
| 88 | // return bo | |
| 89 | // } | |
| 90 | ||
| 91 | ||
| 92 | } |