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 java.io.IOException;
import java.util.List;
import nosi.core.webapp.Controller;
import nosi.core.webapp.Core;
import nosi.core.webapp.Response;
import nosi.core.webapp.activit.rest.business.ProcessDefinitionIGRP;
import nosi.core.webapp.activit.rest.services.TaskServiceRest;
import nosi.webapps.igrp.dao.Application;
import java.util.ArrayList;
/*----#END-PRESERVED-AREA----*/
public class TaskController extends Controller {
public Response actionIndex() throws IOException, IllegalArgumentException, IllegalAccessException {
/*----#START-PRESERVED-AREA(INDEX)----*/
Task model = new Task();
model.load();
TaskView view = null;
List data = new ArrayList<>();
if (Core.isNotNull(model.getAplicacao())) {
Application app = new Application().findOne(Core.toInt(model.getAplicacao()));
if (Core.isNotNull(model.getProcesso())) {
new TaskServiceRest().getTasksByProcessKey(model.getProcesso(),app.getDad()).stream().forEach(t -> {
Task.Table_1 t1 = new Task.Table_1();
t1.setSelecionar(t.getProcessDefinitionId() + "_" + t.getId());
t1.setDescricao(t.getName());
data.add(t1);
});
}
view = new TaskView(model);
view.table_1.addData(data);
if (app != null) {
view.processo.setValue(new ProcessDefinitionIGRP().mapToComboBoxByKey(app.getDad()));
}
view.aplicacao.setValue(new Application().getListApps());
}
return this.renderView(view);
/*----#END-PRESERVED-AREA----*/
}
public Response actionGravar() throws IOException, IllegalArgumentException, IllegalAccessException{
/*----#START-PRESERVED-AREA(GRAVAR)----*/
Task model = new Task();
model.load();
return this.redirect("igrp","Task","index");
/*----#END-PRESERVED-AREA----*/
}
/*----#START-PRESERVED-AREA(CUSTOM_ACTIONS)----*/
/*----#END-PRESERVED-AREA----*/
}