sexta-feira, 24 de janeiro de 2014

JOGET - POPULATE COMBO WITH USER

BEAN SHELL SCRIPT

Replace the variables with your parameters.
#envVariable.jdbcDefaultUrl#
#envVariable.jdbcDefaultUser#
#envVariable.jdbcDefaultPassword#

=============================================
// Lit all user
import java.sql.*;
import java.util.*;
import org.joget.apps.form.model.*;
import org.joget.apps.form.service.*;

public FormRowSet test() {
FormRowSet f = new FormRowSet();
f.setMultiRow(true);

Connection con = null;

Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("#envVariable.jdbcDefaultUrl#", "#envVariable.jdbcDefaultUser#", "#envVariable.jdbcDefaultPassword#"); // declare datasource

if(!con.isClosed())
{
PreparedStatement stmt = con.prepareStatement("select id, CONCAT(CONCAT(firstName, ' '), lastName) from dir_user order by firstname asc"); // SQL query
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
            FormRow r1 = new FormRow();
            r1.put(FormUtil.PROPERTY_VALUE, rs.getString(1));
            r1.put(FormUtil.PROPERTY_LABEL, rs.getString(2));
            f.add(r1);
        }
}

return f;
}
return test();

Using HASH VARIABLE - JOGET - BEAN SHELL FORM BINDER

This programming code has the purpose of populate a selectbox.


// Lit all user
import java.sql.*;
import java.util.*;
import org.joget.apps.form.model.*;
import org.joget.apps.form.service.*;

public FormRowSet test() {
FormRowSet f = new FormRowSet();
f.setMultiRow(true);

Connection con = null;

Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql://localhost:3307/jwdb?useUnicode=true&characterEncoding=UTF-8", "root", ""); // declare datasource

if(!con.isClosed())
{

String pId = "#currentUser.username#";
PreparedStatement stmt = con.prepareStatement("select id, CONCAT(CONCAT(firstName, ' '), lastName) from dir_user WHERE username=? order by firstname asc"); //  SQL query
stmt.setString(1, pId);

ResultSet rs = stmt.executeQuery();
while (rs.next()) {
            FormRow r1 = new FormRow();
            r1.put(FormUtil.PROPERTY_VALUE, rs.getString(1));
            r1.put(FormUtil.PROPERTY_LABEL, rs.getString(2));
            f.add(r1);
        }
}

return f;
}
return test();

quinta-feira, 23 de janeiro de 2014

JOGET Bean Shell Form Binder

An example of how to populate a combo using Bean Shell Form Binder.
Pay attention to the driver
com.microsoft.sqlserver.jdbc.SQLServerDriver
I'm connecting to a Microsoft SQLServer.



// Listar todas as demandas
import java.sql.*;
import java.util.*;
import org.joget.apps.form.model.*;
import org.joget.apps.form.service.*;

public FormRowSet test() {
FormRowSet f = new FormRowSet();
f.setMultiRow(true);

Connection con = null;

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
con = DriverManager.getConnection("jdbc:sqlserver://148.6.7.999:1433;databaseName=dbChapolim;user=usr_kiko;password=usr_kiko;"); // declare datasource

if(!con.isClosed())
{
PreparedStatement stmt = con.prepareStatement("select NomeSistema ID, NomeSistema from TB_SISTEMA order by NomeSistema ASC"); // SQL query
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
            FormRow r1 = new FormRow();
            r1.put(FormUtil.PROPERTY_VALUE, rs.getString(1));
            r1.put(FormUtil.PROPERTY_LABEL, rs.getString(2));
            f.add(r1);
        }
}

return f;
}
return test();

sexta-feira, 17 de janeiro de 2014

Aplicação Bloqueada por Definições de Segurança

Suas definições de segurança impediram a execução de uma aplicação autoassinada.

Depois de instalar o JAVA - VERSÃO 7, update 51, comecei a receber erros estranhos.
A mensagem dá a impressão que é algum problema de FIREWALL ou coisa parecida. Mas não é.
É o JAVA 7.

Para resolver.
Painel de Controle > Java > Segurança > Nível de Segurança -> Medio.

Que apurrinhação!!



Resolvido.


segunda-feira, 13 de janeiro de 2014

JOGET - After trying thousands of bpm applications.


After trying thousands of BPM applications I found JOGET.
I'm very excited with JOGET. Why?
After trying BonitaSOFT, Process Maker and Lombardi BPM, I found JOGET that has, in the community edition, enough features for you to make a complex workflow.
Amazing!!!!
The community version of Bonita and PM are not very, how can I say, enough. Even for study.
I'm just at the beginning of my evaluation, but my first impression of the product was excellent.
Há!

Here you have more details about it.

Joget Workflow

Joget Workflow v3 is an open source web platform that simplifies the development of BPM and workflow apps. Drag and drop to design processes, forms, lists and front-end UI.
Unlike typical workflow engines, Joget Workflow allows IT professionals to turn their processes into a full-fledge workflow web application. With v3′s user friendly drag-and-drop user interface, developers are able to quickly design and prototype complex processes, easily create and map dynamic forms to process activities, combine forms and data listing into CRUD (create-read-update-delete) seamlessly; and assemble web UI components to create the final application front-end.