nosi.webapps.igrp.pages.task.TaskController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of igrp-core Show documentation
Show all versions of igrp-core Show documentation
IGRP Framework is a powerful and highly customizable platform developed by the Operational Nucleus for the Information Society (NOSi) to create web applications, it provides out of box, several modules to make easy to create stand-alone, production-grade web applications: authentication and access-control, business processes automation, reporting, page builder with automatic code generation and incorporation of the Once-Only-Principle, written in Java. IGRP Framework WAR - Contains some keys resources that give UI to IGRP Framework and others supports files.
package nosi.webapps.igrp.pages.task;
import nosi.core.webapp.Controller;//
import nosi.core.webapp.databse.helpers.ResultSet;//
import nosi.core.webapp.databse.helpers.QueryInterface;//
import java.io.IOException;//
import nosi.core.webapp.Core;//
import nosi.core.webapp.Response;//
/* Start-Code-Block (import) */
/* End-Code-Block */
/*----#start-code(packages_import)----*/
import java.util.List;
import java.util.Map;
import nosi.core.webapp.activit.rest.business.ProcessDefinitionIGRP;
import nosi.core.webapp.activit.rest.services.TaskServiceRest;
import nosi.webapps.igrp.dao.Action;
import nosi.webapps.igrp.dao.Application;
import nosi.webapps.igrp.dao.TaskComponent;
import java.util.ArrayList;
/*----#end-code----*/
public class TaskController extends Controller {
public Response actionIndex() throws IOException, IllegalArgumentException, IllegalAccessException{
Task model = new Task();
model.load();
TaskView view = new TaskView();
/*----#gen-example
EXAMPLES COPY/PASTE:
INFO: Core.query(null,... change 'null' to your db connection name, added in Application Builder.
model.loadTable_1(Core.query(null,"SELECT 'Sit adipiscing officia magna voluptatem' as descricao,'Anim adipiscing perspiciatis iste adipiscing' as ordem "));
view.aplicacao.setQuery(Core.query(null,"SELECT 'id' as ID,'name' as NAME "));
view.processo.setQuery(Core.query(null,"SELECT 'id' as ID,'name' as NAME "));
----#gen-example */
/* Start-Code-Block (index) *//* End-Code-Block (index) */
/*----#start-code(index)----*/
view.aplicacao.setValue(Core.getListApps());
String dad = Core.getCurrentDad();
if (!"igrp".equalsIgnoreCase(dad) && !"igrp_studio".equalsIgnoreCase(dad)) {
model.setAplicacao("" + (Core.findApplicationByDad(dad)).getId());
view.aplicacao.propertie().add("disabled","true");
}
List data = new ArrayList<>();
if (Core.isNotNull(model.getAplicacao())) {
Application app = new Application().findOne(Core.toInt(model.getAplicacao()));
if (app != null) {
final Map mapToComboBoxByKey = new ProcessDefinitionIGRP().mapToComboBoxByKey(app.getDad());
view.processo.setValue(mapToComboBoxByKey);
if(view.processo.getListOptions().size()==2) {
view.processo.getListOptions().remove(null);
model.setProcesso(view.processo.getListOptions().keySet().toString().replace("[", "").replace("]", ""));
}
}
if (Core.isNotNull(model.getProcesso())) {
List