/** * GoTo annotation on methods * * @param proceedingJoinPoint Join point * * @throws AWException Error on pointcut */ @Around ("com.almis.awe.annotation.aspect.GoToAnnotation.annotatedMethod()") public Object goToMethodProcessor(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { MethodSignature methodSignature = (MethodSignature) proceedingJoinPoint.getSignature(); GoTo goToAnnotation = org.springframework.core.annotation.AnnotationUtils.getAnnotation(methodSignature.getMethod(), GoTo.class); Object result = proceedingJoinPoint.proceed(); if (result instanceof ServiceData) { if (!goToAnnotation.screenName().isEmpty()) { ServiceData resultObj = (ServiceData) result; ClientAction clientAction = generateClientAction(goToAnnotation); resultObj.addClientAction(clientAction); return resultObj; } } else if (result instanceof ClientAction && !goToAnnotation.screenName().isEmpty()) { return generateClientAction(goToAnnotation); } return result; }
/** * Delete columns from grid * * @return clientActionList */ public ServiceData deleteColumns() { // Variable initialization ServiceData serviceData = new ServiceData(); // Columns List<Column> columns = new ArrayList<>(); Column column = new Column(); column.setId("NONE"); columns.add(column); // Add columns to the multiselect grid ClientAction addColumnsGrid = new ClientAction("replace-columns"); addColumnsGrid.setTarget(SELECTED_GRID); addColumnsGrid.addParameter("columns", new CellData(columns)); serviceData.addClientAction(addColumnsGrid); return serviceData; }
return ((ServiceData) result).addClientAction(downloadAction); } else if (result instanceof ClientAction) { return downloadAction;
/** * Switch the languages * * @param fromLanguage Source language * @param toLanguage Target language * @param fromTarget Source target * @param toTarget Target target * @return Languages changed */ public ServiceData switchLanguages(String fromLanguage, String toLanguage, String fromTarget, String toTarget) { ServiceData serviceData = new ServiceData(); JsonNodeFactory factory = JsonNodeFactory.instance; ArrayNode from = factory.arrayNode(); ArrayNode to = factory.arrayNode(); // Add the values from.add(toLanguage); to.add(fromLanguage); // Select value action ClientAction fromAction = new ClientAction(SELECT); fromAction.addParameter(VALUES, new CellData(from)); fromAction.setTarget(fromTarget); // Select format action ClientAction toAction = new ClientAction(SELECT); toAction.addParameter(VALUES, new CellData(to)); toAction.setTarget(toTarget); // Add actions to list serviceData.addClientAction(fromAction); serviceData.addClientAction(toAction); return serviceData; }
messageAction.addParameter("message", new CellData(getLocale("DATABASE_MESSAGE_RESPONSE_OK"))); serviceData.addClientAction(messageAction);
/** * Fill grid with data * * @param rsMetaData Metadata * @param datalist Datalist * @return Client actions * @throws AWException Error filling grid */ private ServiceData fillGrid(ResultSetMetaData rsMetaData, DataList datalist) throws AWException { // Variable initialization ServiceData serviceData = new ServiceData(); try { // Build column structure List<Column> columns = getColumnList(rsMetaData); // Add columns to the multiselect grid ClientAction addColumnsGrid = new ClientAction("replace-columns"); addColumnsGrid.setTarget(SELECTED_GRID); addColumnsGrid.addParameter("columns", new CellData(columns)); // Fill Grid ClientAction fillGrid = new ClientAction("fill"); fillGrid.setTarget(SELECTED_GRID); fillGrid.addParameter("datalist", datalist); // Set variables serviceData.addClientAction(addColumnsGrid); serviceData.addClientAction(fillGrid); } catch (AWException exc) { throw new AWException(getLocale("ERROR_TITLE_SESSION_EXPIRED"), getLocale("ERROR_MESSAGE_SESSION_EXPIRED"), exc); } return serviceData; }
serviceData.addClientAction(selectTextValue); serviceData.addClientAction(selectMarkdownValue); serviceData.addClientAction(selectFormat); serviceData.addClientAction(selectFlag);
/** * Specific build that returns a service data with a screen client action. * * @return * * @throws AWException */ public ServiceData build() throws AWException { ServiceData serviceData = new ServiceData(); //Generate screen Screen screen = (Screen) build(new Screen()); //Override screen in cache aweElements.setScreen(screen); //Modify menu options with the new screen Menu menu = generateOptionMenu(screen); //Override menu in cache aweElements.setMenu(getMenuType(), menu); // Override menu in cache ClientAction clientAction = new ClientAction("screen"); clientAction.setTarget(screen.getId()); serviceData.addClientAction(clientAction); return serviceData; }
serviceData.addClientAction(updateCell); serviceData.addClientAction(updateCell);