Search in sources :

Example 1 with SqlServerAppSearch

use of org.finos.waltz.data.application.search.SqlServerAppSearch in project waltz by khartec.

the class MsSqlSearchHarness method main.

public static void main(String[] args) {
    ApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    SqlServerAppSearch appSearch = new SqlServerAppSearch();
    EntitySearchOptions searchOptions = ImmutableEntitySearchOptions.builder().addEntityKinds(EntityKind.APPLICATION).userId("admin").limit(EntitySearchOptions.DEFAULT_SEARCH_RESULTS_LIMIT).searchQuery("sap").build();
    List<Application> results = appSearch.searchFullText(dsl, searchOptions);
    results.stream().filter(a -> a.entityLifecycleStatus() != EntityLifecycleStatus.REMOVED).forEach(a -> System.out.println(a.name() + " - " + a.lifecyclePhase()));
}
Also used : List(java.util.List) Application(org.finos.waltz.model.application.Application) EntityKind(org.finos.waltz.model.EntityKind) DSLContext(org.jooq.DSLContext) ImmutableEntitySearchOptions(org.finos.waltz.model.entity_search.ImmutableEntitySearchOptions) DIConfiguration(org.finos.waltz.service.DIConfiguration) ApplicationContext(org.springframework.context.ApplicationContext) SqlServerAppSearch(org.finos.waltz.data.application.search.SqlServerAppSearch) EntitySearchOptions(org.finos.waltz.model.entity_search.EntitySearchOptions) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) EntityLifecycleStatus(org.finos.waltz.model.EntityLifecycleStatus) ApplicationContext(org.springframework.context.ApplicationContext) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) SqlServerAppSearch(org.finos.waltz.data.application.search.SqlServerAppSearch) ImmutableEntitySearchOptions(org.finos.waltz.model.entity_search.ImmutableEntitySearchOptions) EntitySearchOptions(org.finos.waltz.model.entity_search.EntitySearchOptions) DSLContext(org.jooq.DSLContext) Application(org.finos.waltz.model.application.Application)

Example 2 with SqlServerAppSearch

use of org.finos.waltz.data.application.search.SqlServerAppSearch in project waltz by khartec.

the class AppHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    // Water & Vole
    // P&S Blotter
    // P & S Gorilla
    List<Application> jimmy = new SqlServerAppSearch().searchFullText(dsl, EntitySearchOptions.mkForEntity(EntityKind.APPLICATION, "Water & Vole"));
    System.out.println(jimmy);
// ApplicationService applicationService = ctx.getBean(ApplicationService.class);
// DSLContext dsl = ctx.getBean(DSLContext.class);
// 
// List<String> tagList = applicationService.findAllTags();
// 
// tagList.forEach(System.out::println);
// 
// System.out.println("---------------");
// 
// applicationService.findByTag("not-good-at-flying").forEach(a -> System.out.println(a.name()));
// 
// System.out.println(applicationService.findTagsForApplication(521L));
// 
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) SqlServerAppSearch(org.finos.waltz.data.application.search.SqlServerAppSearch) DSLContext(org.jooq.DSLContext) Application(org.finos.waltz.model.application.Application)

Aggregations

SqlServerAppSearch (org.finos.waltz.data.application.search.SqlServerAppSearch)2 Application (org.finos.waltz.model.application.Application)2 DSLContext (org.jooq.DSLContext)2 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)2 List (java.util.List)1 EntityKind (org.finos.waltz.model.EntityKind)1 EntityLifecycleStatus (org.finos.waltz.model.EntityLifecycleStatus)1 EntitySearchOptions (org.finos.waltz.model.entity_search.EntitySearchOptions)1 ImmutableEntitySearchOptions (org.finos.waltz.model.entity_search.ImmutableEntitySearchOptions)1 DIConfiguration (org.finos.waltz.service.DIConfiguration)1 ApplicationContext (org.springframework.context.ApplicationContext)1