@Override
public
ArrayList<AuthEntity> getOptionFields() {
// set option fields
ArrayList<AuthEntity> entities = new ArrayList<AuthEntity>();
AuthEntity entity = null;
entity = new AuthEntity(AuthEntity.AUTH_FIELD, "datasource");
entity.appendInfo("type", "datasource");
entity.appendInfo("label", "Data connection");
entity.appendInfo("description", "Database connection");
entity.appendInfo("required", true);
entities.add(entity);
entity = new AuthEntity(AuthEntity.AUTH_FIELD, "sql_groups");
entity.appendInfo("type", "textarea");
entity.appendInfo("label", "GroupList SQL");
entity.appendInfo("description", "Group list sql\n\nEx) SELECT DISTINCT department_id, department_description FROM fm_department WHERE department_description like lower(?) ORDER BY department_id");
entity.appendInfo("required", true);
entities.add(entity);
entity = new AuthEntity(AuthEntity.AUTH_FIELD, "sql_roles");
entity.appendInfo("type", "textarea");
entity.appendInfo("label", "RoleList SQL");
entity.appendInfo("description", "Role list sql\n\nEx) SELECT DISTINCT management_role FROM fm_position WHERE management_role like lower(?) ORDER BY management_role");
entity.appendInfo("required", true);
entities.add(entity);
entity = new AuthEntity(AuthEntity.AUTH_FIELD, "sql_users");
entity.appendInfo("type", "textarea");
entity.appendInfo("label", "UserList SQL");
entity.appendInfo("description", "User list sql\n\nEx) "
+ "select n10.employee_id AS emp_id, \n"
+ "n10.full_name AS uname, \n"
+ "lower(n10.first_name || '.' || n10.last_name || '@example.com') AS email,\n"
+ "lower(n10.first_name || '.' || n10.last_name || '@example.com') AS userid,\n"
+ "'example.com' AS upasswd,\n"
+ "n11.department_description AS groupname,\n"
+ "n12.management_role AS dutyname\n"
+ "from fm_employee n10\n"
+ "inner join fm_department n11 on n10.department_id=n11.department_id\n"
+ "left outer join fm_position n12 on n10.position_id=n12.position_id\n"
+ "WHERE lower(n10.full_name) like lower(?) ORDER BY emp_id");
entities.add(entity);
entity = new AuthEntity(AuthEntity.AUTH_FIELD, "sql_validate");
entity.appendInfo("type", "textarea");
entity.appendInfo("label", "User validation SQL");
entity.appendInfo("description", "User login check sql");
entity.appendInfo("required", false);
entities.add(entity);
return entities;
} |