1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.datadictionary.exporter; |
17 | |
|
18 | |
import org.kuali.rice.kns.datadictionary.CollectionDefinition; |
19 | |
import org.kuali.rice.kns.datadictionary.DataDictionaryEntryBase; |
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
public class CollectionsMapBuilder { |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | 0 | public CollectionsMapBuilder() { |
32 | 0 | } |
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
public ExportMap buildCollectionsMap(DataDictionaryEntryBase entry) { |
40 | 0 | ExportMap collectionsMap = new ExportMap("collections"); |
41 | |
|
42 | 0 | for ( CollectionDefinition collection : entry.getCollections() ) { |
43 | 0 | collectionsMap.set(buildCollectionMap(collection)); |
44 | |
} |
45 | |
|
46 | 0 | return collectionsMap; |
47 | |
} |
48 | |
|
49 | |
private ExportMap buildCollectionMap(CollectionDefinition collection) { |
50 | 0 | ExportMap collectionMap = new ExportMap(collection.getName()); |
51 | |
|
52 | 0 | collectionMap.set("name", collection.getName()); |
53 | 0 | collectionMap.set("label", collection.getLabel()); |
54 | 0 | collectionMap.set("shortLabel", collection.getShortLabel()); |
55 | 0 | if (collection.getSummary() != null) { |
56 | 0 | collectionMap.set("summary", collection.getSummary()); |
57 | |
} |
58 | 0 | if (collection.getDescription() != null) { |
59 | 0 | collectionMap.set("description", collection.getDescription()); |
60 | |
} |
61 | |
|
62 | 0 | return collectionMap; |
63 | |
} |
64 | |
|
65 | |
} |