* Set the blessing on a gem
* @param gem
* @param blessing the value to set the gem blessing to - NO_BLESSING to clear existing blessing
*/
private void blessGem(GemEntity gem, int blessing) {
ScopedEntityMetadata metadata = gem.getMetadata(GemManager.getLocaleForMetadata());
metadata.setAttribute(TriggerGemFilter.TRIGGER_ATTRIBUTE_NAME, blessing == TRIGGER_BLESSING ? "trigger" : null);
metadata.setAttribute(ActionGemFilter.ACTION_ATTRIBUTE_NAME, blessing == ACTION_BLESSING ? "action" : null);
metadata.setAttribute(MetricGemFilter.METRIC_ATTRIBUTE_NAME, blessing == METRIC_BLESSING ? "metric" : null);
if (!app.getCalServices().getCALWorkspace().saveMetadata(metadata)) {
JOptionPane.showMessageDialog(this, "The metadata for the gem could not be updated.\nIs the metadata XML file read-only?", "BAM Sample", JOptionPane.ERROR_MESSAGE);
}
}