use of com.axelor.meta.db.MetaAction in project axelor-open-suite by axelor.
the class StudioMetaService method removeMetaActions.
/**
* Removes MetaActions from comma separated names in string.
*
* @param actionNames Comma separated string of action names.
*/
@Transactional
public void removeMetaActions(String xmlIds) {
log.debug("Removing actions: {}", xmlIds);
if (xmlIds == null) {
return;
}
List<MetaAction> metaActions = metaActionRepo.all().filter("self.xmlId in ?1 OR self.name in ?1 ", Arrays.asList(xmlIds.split(","))).fetch();
for (MetaAction action : metaActions) {
List<MetaMenu> menus = metaMenuRepo.all().filter("self.action = ?1", action).fetch();
for (MetaMenu metaMenu : menus) {
metaMenu.setAction(null);
metaMenuRepo.save(metaMenu);
}
metaActionRepo.remove(action);
}
}
Aggregations