use of com.developmentontheedge.be5.metadata.model.Entity in project be5 by DevelopmentOnTheEdge.
the class SilentEditOperation method getParameters.
@Override
public Object getParameters(Map<String, Object> presetValues) throws Exception {
Entity entity = getInfo().getEntity();
DynamicPropertySet dps = dpsHelper.addDpExcludeAutoIncrement(new DynamicPropertySetSupport(), getInfo().getModel());
dpsHelper.setValues(dps, database.getEntity(entity.getName()).get(context.records[0]));
dpsHelper.setOperationParams(dps, context.getOperationParams());
return dpsHelper.setValues(dps, presetValues);
}
use of com.developmentontheedge.be5.metadata.model.Entity in project be5 by DevelopmentOnTheEdge.
the class ColumnSelector method getTags.
@Override
public String[] getTags() {
final Entity entity = (Entity) getBean();
final TableDef tableDefinition = entity.findTableDefinition();
if (tableDefinition == null)
return Strings2.EMPTY;
return tableDefinition.getColumns().names().toArray(String[]::new);
}
use of com.developmentontheedge.be5.metadata.model.Entity in project be5 by DevelopmentOnTheEdge.
the class ProjectGenerator method createLoginAndLogoutOperations.
private void createLoginAndLogoutOperations(final Project project) {
final Entity logoutEntity = new Entity("_logout_", project.getApplication(), EntityType.TABLE);
logoutEntity.setDisplayName("Logout");
logoutEntity.setOrder("99");
logoutEntity.setPrimaryKey("dummy");
logoutEntity.getIcon().setSource(Icon.SOURCE_BE);
logoutEntity.getIcon().setName("logout.gif");
final Query logout = new Query("Logout", logoutEntity);
logout.setType(QueryType.STATIC);
logout.getRoles().add('@' + SpecialRoleGroup.ALL_ROLES_EXCEPT_GUEST_GROUP);
logout.setQuery("logout");
DataElementUtils.saveQuiet(logout);
EntitiesFactory.addToModule(logoutEntity, project.getApplication());
Module beModule = project.getModule(SYSTEM_MODULE);
Entity usersEntity = new Entity("users", beModule, EntityType.TABLE);
usersEntity.setOrder("90");
usersEntity.getIcon().setSource("be:people.gif");
DataElementUtils.saveQuiet(usersEntity);
Query loginQuery = new Query("Login", usersEntity);
loginQuery.setType(QueryType.STATIC);
loginQuery.setQuery("login");
loginQuery.getRoles().add("Guest");
DataElementUtils.saveQuiet(loginQuery);
// Query forgotPassword = new Query("Forgot Password?", usersEntity);
// forgotPassword.getRoles().add( "Guest" );
// forgotPassword.setParametrizingOperationName( "Send password" );
// DataElementUtils.saveQuiet( forgotPassword );
// Operation sendPassword = Operation.createOperation( "Send password", Operation.OPERATION_TYPE_JAVA, usersEntity );
// sendPassword.setCode( SendPassword.class.getName() );
// DataElementUtils.saveQuiet( sendPassword );
}
use of com.developmentontheedge.be5.metadata.model.Entity in project be5 by DevelopmentOnTheEdge.
the class ActionHelperTest method getQuery.
private Query getQuery(QueryType type, String queryCode) {
Entity entity = meta.getEntity("testtable");
Query query = new Query("ActionHelperTest", entity);
query.setType(type);
query.setQuery(queryCode);
return query;
}
Aggregations