/** * @{inheritedDoc} */ @Override public void count(IEmaginController controller, IOperationResult currentResult, Consumer<IOperationResult> consumer) { final SingleResult result = new SingleResult(); result.addMetaData("count", "0"); }
/** * @{inheritedDoc} */ @Override public void count(IEmaginController controller, IOperationResult currentResult, Consumer<IOperationResult> consumer) { final SingleResult result = new SingleResult(); result.addMetaData("count", "0"); }
/** * @param key * @param val */ public static void addImage(String key, byte[] val) { final IOperationResult res = new SingleResult(); res.addMetaData(key, val); IMAGES_CACHE.put(key, res); }
public void createSavedSearch(JsonObject query, Consumer<IOperationResult> sa, Consumer<Throwable> object2) { String name = query.get("name").getAsString(); Integer id = datas.size() + 1; datas.add(id + "," + name + "," + "No description"); IOperationResult r = new SingleResult(); OperationData data = new OperationData(); data.getAttributes().put("fullId", id); data.getAttributes().put("id", id); data.getAttributes().put("name", name); data.getAttributes().put("description", "No description"); sa.accept(r); }
protected void leftPaneSelectedElementChange(OperationData selectedModel) { if (selectedModel != null) { final SingleResult result = new SingleResult(); result.setData(selectedModel); tableViewController.setModel(result); } }
public void navigate(OperationData operationData) { SingleResult newmodel = new SingleResult(); newmodel.setData(operationData); setModel(newmodel); }
/** * {@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); } }
@Override protected IOperationResult call() throws Exception { final IOperationResult r = new SingleResult(); getCurrentUserOperation.doOperation(new JsonObject(), res -> { r.setData(res.rootData()); }); return r; }
@Override public IOperationResult getCurrentUserAccount() { try { int tries = 0; try { String url = rootUrl.concat(String.format(account_current_URL)); IOperationResult result = doGet(new JsonObject(), url, SingleResult.class); return result; } catch (Exception e) { if (tries < 2) { tries++; Thread.sleep(2000); return getCurrentUserAccount(); } } return new SingleResult(); } catch (Throwable e) { e.printStackTrace(); return IOperationResult.getGeneralSingleResultError(); } }
/** * {@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); } }
/** * @{inheritedDoc} */ @Override public void count(IEmaginController controller, IOperationResult currentResult, Consumer<IOperationResult> consumer) { String containerFullId = controller.getModelContainerFullId(); String fullId = controller.getModelFullId(); JsonObject query = new JsonObject(); query.addProperty("fullId", fullId); query.addProperty("oid", fullId); if (StringUtils.isEmpty(containerFullId)) { return; } if (StringUtils.isNotBlank(queryPredicate)) { query.addProperty("queryPredicate", queryPredicate); } query.addProperty("containerOid", containerFullId); if (countOperation != null) { countOperation.doOperation(query, consumer); } else { consumer.accept(new SingleResult()); } }
/** * @{inheritedDoc} */ @Override public void count(IEmaginController controller, IOperationResult currentPage, Consumer<IOperationResult> consumer) { IOperationResult operationResult = new SingleResult(); if (rootData == null) { operationResult.addMetaData("totalElements", 0); consumer.accept(operationResult); return; } if (rootData.hasSubComponent()) { operationResult.addMetaData("totalElements", rootData.getSubcomponents().size()); consumer.accept(operationResult); return; } operationResult.addMetaData("totalElements", 0); consumer.accept(operationResult); return; }
/** * {@inheritDoc} */ @Override public IOperationResult loadModel(IEmaginController controller, String componentId) { IOperationResult operationResult = new SingleResult(); OperationData datato = new OperationData(); operationResult.setData(datato); OperationData datafrom = ((AbstractViewController) controller).getStructureContent().getFormModelData(); for (Object key : datafrom.getAttributes().keySet()) { datato.getAttributes().put((String) key, datafrom.getAttributes().get(key)); } controller.setModel(operationResult); return operationResult; }
/** * {@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; } }
@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()); } }
/** * 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()); }); } }