| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.student.datadictionary; |
| 17 | |
|
| 18 | |
import java.util.ArrayList; |
| 19 | |
import java.util.List; |
| 20 | |
import org.kuali.rice.kns.datadictionary.AttributeDefinition; |
| 21 | |
import org.kuali.rice.kns.datadictionary.DataObjectEntry; |
| 22 | |
import org.kuali.student.datadictionary.dto.AttributeDefinitionInfo; |
| 23 | |
import org.kuali.student.datadictionary.dto.DictionaryEntryInfo; |
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | 35 | public class Rice2StudentDictionaryEntryConverter { |
| 30 | |
|
| 31 | 1 | private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(Rice2StudentDictionaryEntryConverter.class); |
| 32 | |
|
| 33 | |
public DictionaryEntryInfo convert(DataObjectEntry rice) { |
| 34 | 35 | DictionaryEntryInfo.Builder bldr = new DictionaryEntryInfo.Builder(); |
| 35 | 35 | bldr.setObjectClass(rice.getFullClassName()); |
| 36 | 35 | bldr.setName(rice.getName()); |
| 37 | 35 | bldr.setObjectLabel(rice.getObjectLabel()); |
| 38 | 35 | bldr.setObjectDescription(rice.getObjectDescription()); |
| 39 | 35 | bldr.setTitleAttribute(rice.getTitleAttribute()); |
| 40 | 35 | bldr.setPrimaryKeys(rice.getPrimaryKeys()); |
| 41 | 35 | if (rice.getAttributes() != null) { |
| 42 | 35 | List<AttributeDefinitionInfo> list = new ArrayList(rice.getAttributes().size()); |
| 43 | 35 | for (AttributeDefinition ad : rice.getAttributes()) { |
| 44 | 255 | list.add(new Rice2StudentAttributeDefinitionConverter ().convert(ad)); |
| 45 | |
} |
| 46 | 35 | bldr.setAttributes (list); |
| 47 | |
} |
| 48 | 35 | return bldr.build(); |
| 49 | |
} |
| 50 | |
} |