private String newScope(GameModel gameModel, VariableDescriptor vd) { StringBuilder sb = new StringBuilder(); try { descriptorFacade.detach(vd); String name = vd.getName(); String parentName = vd.getParentList().getName(); GameModelScope scope = new GameModelScope(); scope.setBroadcastScope("GameScope"); vd.setScope(scope); String json = vd.toJson(Views.Export.class); logger.error("JSON for " + parentName + "/" + name + " variable: " + json); descriptorFacade.remove(vd.getId()); descriptorFacade.flush(); logger.error("REMOVED"); sb.append("NAME: ") .append(name) .append(" -> ") .append(this.addVariable(gameModel, json, name, parentName)); } catch (IOException ex) { java.util.logging.Logger.getLogger(UpdateController.class.getName()) .log(Level.SEVERE, null, ex); } return sb.toString(); }
private String lawUpdateScope(GameModel gameModel) { this.updateListDescriptorScope(gameModel); StringBuilder sb = new StringBuilder(); try { sb.append("["); ListDescriptor etapes = (ListDescriptor) VariableDescriptorFacade.lookup().find(gameModel, "etapes"); for (VariableDescriptor item : etapes.getItems()) { this.updateScope(item); } sb.append("]"); } catch (WegasNoResultException ex) { java.util.logging.Logger.getLogger(UpdateController.class.getName()) .log(Level.SEVERE, null, ex); } return sb.toString(); }