Search in sources :

Example 6 with DefinitionSpace

use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.

the class VSecurityManagerTest method testRole.

@Test
public void testRole() {
    final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
    final Role admin = definitionSpace.resolve("R_ADMIN", Role.class);
    Assert.assertTrue("R_ADMIN".equals(admin.getName()));
    final Role secretary = definitionSpace.resolve("R_SECRETARY", Role.class);
    Assert.assertTrue("R_SECRETARY".equals(secretary.getName()));
}
Also used : Role(io.vertigo.persona.security.metamodel.Role) DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) Test(org.junit.Test)

Example 7 with DefinitionSpace

use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.

the class AbstractSearchManagerTest method init.

/**
 * Initialise l'index.
 * @param indexName Nom de l'index
 */
protected final void init(final String indexName) {
    final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
    // On construit la BDD des voitures
    itemDataBase = new ItemDataBase();
    final ItemSearchLoader itemSearchLoader = getApp().getComponentSpace().resolve(ItemSearchLoader.class);
    itemSearchLoader.bindDataBase(itemDataBase);
    manufacturerFacetDefinition = definitionSpace.resolve("FCT_MANUFACTURER_ITEM", FacetDefinition.class);
    yearFacetDefinition = definitionSpace.resolve("FCT_YEAR_ITEM", FacetDefinition.class);
    itemIndexDefinition = definitionSpace.resolve(indexName, SearchIndexDefinition.class);
    itemFacetQueryDefinition = definitionSpace.resolve("QRY_ITEM_FACET", FacetedQueryDefinition.class);
    itemFacetMultiQueryDefinition = definitionSpace.resolve("QRY_ITEM_FACET_MULTI", FacetedQueryDefinition.class);
    clean(itemIndexDefinition);
}
Also used : ItemDataBase(io.vertigo.dynamo.search.data.domain.ItemDataBase) SearchIndexDefinition(io.vertigo.dynamo.search.metamodel.SearchIndexDefinition) DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) ItemSearchLoader(io.vertigo.dynamo.search.data.domain.ItemSearchLoader) FacetDefinition(io.vertigo.dynamo.collections.metamodel.FacetDefinition) FacetedQueryDefinition(io.vertigo.dynamo.collections.metamodel.FacetedQueryDefinition)

Example 8 with DefinitionSpace

use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.

the class AbstractStoreManagerTest method nativeLoadCarList.

protected final DtList<Car> nativeLoadCarList() {
    final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
    final Domain doCarList = definitionSpace.resolve("DO_DT_CAR_DTC", Domain.class);
    final TaskDefinition taskDefinition = TaskDefinition.builder("TK_LOAD_ALL_CARS").withEngine(TaskEngineSelect.class).withRequest("select * from CAR").withOutRequired("dtc", doCarList).build();
    final Task task = Task.builder(taskDefinition).build();
    return taskManager.execute(task).getResult();
}
Also used : TaskDefinition(io.vertigo.dynamo.task.metamodel.TaskDefinition) Task(io.vertigo.dynamo.task.model.Task) TaskEngineSelect(io.vertigo.dynamox.task.TaskEngineSelect) DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) Domain(io.vertigo.dynamo.domain.metamodel.Domain)

Example 9 with DefinitionSpace

use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.

the class OracleSqlStoreManagerTest method nativeInsertCar.

@Override
protected void nativeInsertCar(final Car car) {
    Assertion.checkArgument(car.getId() == null, "L'id n'est pas null {0}", car.getId());
    // -----
    final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
    final Domain doCar = definitionSpace.resolve("DO_DT_CAR_DTO", Domain.class);
    final TaskDefinition taskDefinition = TaskDefinition.builder("TK_INSERT_CAR").withEngine(TaskEngineProc.class).withRequest("insert into CAR (ID, FAM_ID,MAKE, MODEL, DESCRIPTION, YEAR, KILO, PRICE, MOTOR_TYPE) values " + "(SEQ_CAR.nextval, #DTO_CAR.FAM_ID#, #DTO_CAR.MAKE#, #DTO_CAR.MODEL#, #DTO_CAR.DESCRIPTION#, #DTO_CAR.YEAR#, #DTO_CAR.KILO#, #DTO_CAR.PRICE#, #DTO_CAR.MOTOR_TYPE#)").addInRequired("DTO_CAR", doCar).build();
    final Task task = Task.builder(taskDefinition).addValue("DTO_CAR", car).build();
    final TaskResult taskResult = taskManager.execute(task);
    nop(taskResult);
}
Also used : TaskDefinition(io.vertigo.dynamo.task.metamodel.TaskDefinition) Task(io.vertigo.dynamo.task.model.Task) DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) TaskEngineProc(io.vertigo.dynamox.task.TaskEngineProc) TaskResult(io.vertigo.dynamo.task.model.TaskResult) Domain(io.vertigo.dynamo.domain.metamodel.Domain)

Example 10 with DefinitionSpace

use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.

the class OOMEnvironmentManagerTest method testDomain.

@Test
public void testDomain() {
    final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
    final io.vertigo.dynamo.domain.metamodel.Domain domain = definitionSpace.resolve("DO_EMAIL", Domain.class);
    Assert.assertEquals(DataType.String, domain.getDataType());
    Assert.assertEquals(FormatterDefault.class.getName(), domain.getFormatterClassName());
}
Also used : DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) Domain(io.vertigo.dynamo.domain.metamodel.Domain) FormatterDefault(io.vertigo.dynamox.domain.formatter.FormatterDefault) Test(org.junit.Test)

Aggregations

DefinitionSpace (io.vertigo.core.definition.DefinitionSpace)29 Test (org.junit.Test)18 SearchIndexDefinition (io.vertigo.dynamo.search.metamodel.SearchIndexDefinition)9 Domain (io.vertigo.dynamo.domain.metamodel.Domain)6 FacetedQueryDefinition (io.vertigo.dynamo.collections.metamodel.FacetedQueryDefinition)4 DtDefinition (io.vertigo.dynamo.domain.metamodel.DtDefinition)4 TaskDefinition (io.vertigo.dynamo.task.metamodel.TaskDefinition)4 FormatterDefault (io.vertigo.dynamox.domain.formatter.FormatterDefault)4 ListFilter (io.vertigo.dynamo.collections.ListFilter)3 FacetDefinition (io.vertigo.dynamo.collections.metamodel.FacetDefinition)3 FormatterDefinition (io.vertigo.dynamo.domain.metamodel.FormatterDefinition)3 Task (io.vertigo.dynamo.task.model.Task)3 VTransactionWritable (io.vertigo.commons.transaction.VTransactionWritable)2 SqlConnection (io.vertigo.database.sql.connection.SqlConnection)2 DslDefinition (io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition)2 Item (io.vertigo.dynamo.search.data.domain.Item)2 ItemDataBase (io.vertigo.dynamo.search.data.domain.ItemDataBase)2 Car (io.vertigo.dynamo.search_2_4.data.domain.Car)2 CarDataBase (io.vertigo.dynamo.search_2_4.data.domain.CarDataBase)2 TaskResult (io.vertigo.dynamo.task.model.TaskResult)2