Information Management IBM InfoSphere Master Data Management, Version 11.3

Learning data for code tables

The com.dwl.datastewardship.data.CodeTablesData class within the Data Stewardship UI API model retrieves and caches all of the data for code tables.

To add a new code table for data retrieval and caching, you must add lines of code to accomplish the following:

In the following example, retrieves, sorts, and caches data for the CdGroupingTp code table:

private static final String CD_GROUPING_TP = "CdGroupingTp";
private Collection allGroupingTypeCodes;

public Collection getAllGroupingTypeCodes() throws DataStewardshipException {

        if (allGroupingTypeCodes == null) {
            allGroupingTypeCodes = AdminServices.getAllAdminCodeTypesByLocale(
                    getLocale(), getUserId(), CD_GROUPING_TP);

            //set the Name tag to <no name> if is null
            Iterator it = allGroupingTypeCodes.iterator();

            while (it.hasNext()) {

                DWLEObjCdGroupingTpType eobj = (DWLEObjCdGroupingTpType) it
                        .next();

                if (eobj.getName() == null) {
                    eobj.setName(NO_NAME);
                }
            }
        }
        //sort the type codes by name
        EmfObjectSorter emfObjectSorter = new EmfObjectSorter();
        emfObjectSorter.sortLexical((List) allGroupingTypeCodes,
                AdminPackage.eINSTANCE.getDWLEObjCdGroupingTpType_Name(),
                getRequesterLocale());

        return allGroupingTypeCodes;
    }

public void setAllGroupingTypeCodes(Collection collection) {
        allGroupingTypeCodes = collection;
    }


Last updated: 27 June 2014