View Javadoc

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.kns.datadictionary.exporter;
17  
18  import org.kuali.rice.krad.datadictionary.CollectionDefinition;
19  import org.kuali.rice.krad.datadictionary.DataDictionaryEntryBase;
20  import org.kuali.rice.krad.datadictionary.exporter.ExportMap;
21  
22  /**
23   * CollectionsMapBuilder
24   * 
25   * 
26   */
27  @Deprecated
28  public class CollectionsMapBuilder {
29  
30      /**
31       * Default constructor
32       */
33      public CollectionsMapBuilder() {
34      }
35  
36  
37      /**
38       * @param entry
39       * @return ExportMap containing the standard entries for the entry's CollectionsDefinition
40       */
41      public ExportMap buildCollectionsMap(DataDictionaryEntryBase entry) {
42          ExportMap collectionsMap = new ExportMap("collections");
43  
44          for ( CollectionDefinition collection : entry.getCollections() ) {
45              collectionsMap.set(buildCollectionMap(collection));
46          }
47  
48          return collectionsMap;
49      }
50  
51      private ExportMap buildCollectionMap(CollectionDefinition collection) {
52          ExportMap collectionMap = new ExportMap(collection.getName());
53  
54          collectionMap.set("name", collection.getName());
55          collectionMap.set("label", collection.getLabel());
56          collectionMap.set("shortLabel", collection.getShortLabel());
57          if (collection.getSummary() != null) {
58              collectionMap.set("summary", collection.getSummary());
59          }
60          if (collection.getDescription() != null) {
61              collectionMap.set("description", collection.getDescription());
62          }
63  
64          return collectionMap;
65      }
66  
67  }