public void navigate(OperationData operationData) { SingleResult newmodel = new SingleResult(); newmodel.setData(operationData); setModel(newmodel); }
protected void leftPaneSelectedElementChange(OperationData selectedModel) { if (selectedModel != null) { final SingleResult result = new SingleResult(); result.setData(selectedModel); tableViewController.setModel(result); } }
/** * {@inheritDoc} */ @Override public void doOperation(JsonObject params, Consumer<IOperationResult> resultHandler, Consumer<Throwable> exHandler) { final SingleResult result = new SingleResult(); final OperationData data = new OperationData(); result.setData(data); data.getAttributes().put("nickname", "Lorenzo"); data.getAttributes().put("fullId", "2:people.user"); resultHandler.accept(result); } }
/** * {@inheritDoc} */ @Override public void doOperation(JsonObject params, Consumer<IOperationResult> resultHandler, Consumer<Throwable> exHandler) { final SingleResult result = new SingleResult(); final OperationData data = new OperationData(); result.setData(data); data.getAttributes().put("path", "/"); data.getAttributes().put("displayName", "Application"); data.getAttributes().put("fullId", "2:people.user"); resultHandler.accept(result); }
/** * {@inheritDoc} */ @Override public void doOperation(JsonObject params, Consumer<IOperationResult> resultHandler, Consumer<Throwable> exHandler) { final SingleResult result = new SingleResult(); final OperationData data = new OperationData(); result.setData(data); data.getAttributes().put("path", "/"); data.getAttributes().put("displayName", "Application"); data.getAttributes().put("fullId", "2:people.user"); resultHandler.accept(result); }
@Override public void doOperation(JsonObject params, Consumer<IOperationResult> resultHandler, Consumer<Throwable> exHandler) { final SingleResult sr = new SingleResult(); final Serializable sessionId = UUID.randomUUID().toString(); sr.addMetaData("session_id", sessionId); final OperationData operationData = new OperationData(); sr.setData(operationData); JsonObject account = new JsonObject(); account.addProperty("login", "lorenzo@nexitia.com"); account.addProperty("nickName", "lorenzo"); final JsonObject user = new JsonObject(); user.addProperty("nickName", "lorenzo"); account.addProperty("mail", "lorenzo@nexitia.com"); final JsonObject container = new JsonObject(); container.addProperty("fullId", "1:people"); container.addProperty("path", "/"); operationData.getLinks().put("container", JsonUtils.toString(container)); operationData.getLinks().put("account", JsonUtils.toString(account)); operationData.getLinks().put("user", JsonUtils.toString(user)); resultHandler.accept(sr); } }
/** * {@inheritDoc} */ @Override public void doOperation(JsonObject params, Consumer<IOperationResult> resultHandler, Consumer<Throwable> exHandler) { final SingleResult result = new SingleResult(); final OperationData d = new OperationData(); result.setData(d); final String path = params.get("path").getAsString(); final List<String> lines = new ArrayList<>(); try { lines.addAll(FileUtils.readAllLines("/typesmanaged.csv", false)); } catch (final Exception e) { e.printStackTrace(); } for (final String line : lines) { if (line != null) { final String[] l = line.split(","); if (l[3].equals(path)) { final String[] cols = "fullId,logicalName,displayName,logicalPath".split(","); final String[] si = line.split(","); for (int j = 0; j < 4; j++) { d.getAttributes().put(cols[j], si[j]); } d.getAttributes().put("fullId", si[0]); } } } resultHandler.accept(result); }
/** * {@inheritDoc} */ @Override public void doOperation(JsonObject params, Consumer<IOperationResult> resultHandler, Consumer<Throwable> exHandler) { final SingleResult result = new SingleResult(); final OperationData d = new OperationData(); result.setData(d); final String oid = params.get("oid").getAsString(); try { final List<String> lines = FileUtils.readAllLines("/typesmanaged.csv", false); for (final String line : lines) { if (line != null) { final String[] l = line.split(","); if (l[0].equals(oid)) { final String[] cols = "fullId,logicalName,displayName,logicalPath".split(","); final String[] si = line.split(","); for (int j = 0; j < 4; j++) { d.getAttributes().put(cols[j], si[j]); } d.getAttributes().put("fullId", si[0]); } } } resultHandler.accept(result); } catch (final Exception e) { e.printStackTrace(); } }
/** * {@inheritDoc} */ @Override public IOperationResult loadModel(IEmaginController controller, String componentId) { // this is the current part displayed in the details view final OperationData data = ((AbstractViewController) controller).getStructureContent().getFormModelData(); // set it as model of current controller // the controller knows how to load the structure final SingleResult result = new SingleResult(); result.setData(data); controller.setModel(result); return result; } }
/** * @{inheritedDoc} */ @Override public Node provideIcon(IEmaginController controller, VLViewComponentXML configuration, Object forModel) { final OperationData data = (OperationData) forModel; final String fullId = (String) data.getAttributes().get("fullId"); content.getStyleClass().setAll(getStyleClass().split(",")); if (StringUtils.isEmpty(fullId)) { displayEmptyThumb(); } else { if (contentInfo.getData() == null) { final JsonObject query = new JsonObject(); query.addProperty("fullId", fullId); query.addProperty("role", "primary"); getContentInfoOperation.doOperation(query, res -> { final MultipleResult f = (MultipleResult) res; if (f.getData().size() == 1) { contentInfo.setData(f.getData().get(0)); } }, ex -> { // ex.printStackTrace(); }); } displayThumb(); } return content; }
@Override public void changed(ObservableValue<? extends OperationData> observable, OperationData oldValue, OperationData newValue) { if(newValue != null) { ts2.childTree().setAll(ts.childTree()); SingleResult sr = new SingleResult(); sr.setData(newValue); getTableController().setModel(sr); getTableController().refreshDatas(); } else { getTableController().getTableStructure().setNoContent(); } }});
/** * Load model associated to this controller * * @param controller */ private static void loadModel(AbstractViewController controller) { // use only in edition mode if (controller.getModelProvider() != null) { IModelProvider modelProvider = controller.getModelProvider(); modelProvider.loadModel(controller, null); } // in create mode do not provide // a modelProvider to your wizard else { SingleResult sr = new SingleResult(); sr.setData(new OperationData()); controller.setModel(sr); // add container sr.getData().getAttributes().put("fullId", controller.getModelContainerFullId()); } }
} else { final SingleResult singleResult = new SingleResult(); singleResult.setData(model); controller.setModel(singleResult);
} else { final SingleResult singleResult = new SingleResult(); singleResult.setData(model); controller.setModel(singleResult);
/** * Reload current Page, make server call. */ public void refreshDatas() { selections.clear(); getItems().clear(); loadFirstPageData = true; if(childTree().isEmpty()) { forceLoadFirstPage(); } // reload last item in tree else { OperationData data = childTree().get(childTree().size() - 1); SingleResult res = new SingleResult(); res.setData(data); controller.setModel(res); forceLoadFirstPage(); } }
public void doBuildLeftPane() { final String leftSectionView = getRootComponent().getPropertyValue("leftSectionView"); if (StringUtils.isNotBlank(leftSectionView)) { leftPaneController = StandardViewUtils.forId(getRootStructure(), structureContentController, leftSectionView); leftPaneController.setParent(this); NodeHelper.styleClassSetAll(leftPane, getRootComponent(), "leftSectionAreaStyleClass", ""); final String location = leftPaneController.getRootComponent().getPropertyValue("location"); if (StringUtils.isNotBlank(location)) { } final ChangeListener<OperationData> cl = (ChangeListener<OperationData>) (observable, oldValue, newValue) -> { final OperationData selectedModel = newValue; if (selectedModel != null) { getStructureContent().setFormModelData(selectedModel); getStructureContent().setForModelId((String) selectedModel.getAttributes().get("fullId")); final SingleResult result = new SingleResult(); result.setData(selectedModel); tableViewController.setModel(result); } }; leftPaneController.selectedElementProperty().addListener(cl); Platform.runLater(() -> { leftPane.getChildren().add(leftPaneController.processedView()); }); } }
/** * @{inheritedDoc} */ @Override protected void process() { super.process(); final String leftSectionView = getRootComponent().getPropertyValue("leftSectionView"); if (StringUtils.isNotBlank(leftSectionView)) { leftSection = (FullTreeViewController) StandardViewUtils.forId(getRootStructure(), structureContentController, leftSectionView); final String location = leftSection.getRootComponent().getPropertyValue("location"); if (StringUtils.isNotBlank(location)) { } leftSection.selectedElementProperty().addListener((ChangeListener<OperationData>) (observable, oldValue, newValue) -> { final OperationData selectedModel = newValue; if (selectedModel != null) { getStructureContent().setFormModelData(selectedModel); getStructureContent().setForModelId((String) selectedModel.getAttributes().get("fullId")); final SingleResult result = new SingleResult(); result.setData(selectedModel); righSection.setModel(result); righSection.forceLoadFirstPage(); } }); leftPane.getChildren().add(leftSection.processedView()); } rightSectionView = getRootComponent().getPropertyValue("rightSectionView"); doBuildRightPane(); NodeHelper.styleClassSetAll(leftPane, getRootComponent(), "leftSectionAreaStyleClass", ""); NodeHelper.styleClassSetAll(rightPane, getRootComponent(), "rightSectionAreaStyleClass", ""); }