Search in sources :

Example 1 with MasterListQuery

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();
        }
    }
}
Also used : MasterListQuery(net.geoprism.registry.MasterListQuery) QueryFactory(com.runwaysdk.query.QueryFactory) BusinessDAO(com.runwaysdk.dataaccess.BusinessDAO) MasterList(net.geoprism.registry.MasterList)

Aggregations

BusinessDAO (com.runwaysdk.dataaccess.BusinessDAO)1 QueryFactory (com.runwaysdk.query.QueryFactory)1 MasterList (net.geoprism.registry.MasterList)1 MasterListQuery (net.geoprism.registry.MasterListQuery)1