use of net.geoprism.registry.MasterListQuery in project geoprism-registry by terraframe.
the class LocalizeListMetadataFieldsPatch method migrateExistingLists.
private void migrateExistingLists() {
MasterListQuery mlq = new MasterListQuery(new QueryFactory());
logger.info("Migrating metadata for " + mlq.getCount() + " existing lists.");
try (OIterator<? extends MasterList> it = mlq.getIterator()) {
while (it.hasNext()) {
MasterList list = it.next();
BusinessDAO listDAO = (BusinessDAO) BusinessFacade.getEntityDAO(list);
list.getDescriptionLocal().setDefaultValue(listDAO.getValue(LISTABSTRACT));
list.getProcessLocal().setDefaultValue(listDAO.getValue(PROCESS));
list.getProgressLocal().setDefaultValue(listDAO.getValue(PROGRESS));
list.getAccessConstraintsLocal().setDefaultValue(listDAO.getValue(ACCESSCONSTRAINTS));
list.getUseConstraintsLocal().setDefaultValue(listDAO.getValue(USECONSTRAINTS));
list.getAcknowledgementsLocal().setDefaultValue(listDAO.getValue(ACKNOWLEDGEMENTS));
list.getDisclaimerLocal().setDefaultValue(listDAO.getValue(DISCLAIMER));
list.apply();
}
}
}
Aggregations