Search in sources :

Example 1 with WebUtilities.getEntityReference

use of org.finos.waltz.web.WebUtilities.getEntityReference in project waltz by khartec.

the class CustomEnvironmentUsageExtractor method registerEnvironmentUsagesForParentRef.

private void registerEnvironmentUsagesForParentRef(String findByParentEntityRefPath) {
    get(findByParentEntityRefPath, (request, response) -> {
        EntityReference ref = WebUtilities.getEntityReference(request);
        SelectSeekStep3<Record, String, String, String> serverUsagesQuery = getServerUsagesQuery(ref);
        SelectSeekStep3<Record, String, String, String> databaseUsagesQuery = getDatabaseUsagesQuery(ref);
        return writeAsMultiSheetExcel(dsl, mkFilename(ref), response, tuple("Instructions", mkInstructions()), tuple("Servers", serverUsagesQuery), tuple("Databases", databaseUsagesQuery));
    });
}
Also used : EntityReference(org.finos.waltz.model.EntityReference) WebUtilities.getEntityReference(org.finos.waltz.web.WebUtilities.getEntityReference)

Example 2 with WebUtilities.getEntityReference

use of org.finos.waltz.web.WebUtilities.getEntityReference in project waltz by khartec.

the class PeopleExtractor method registerExtractForApp.

private void registerExtractForApp(String path) {
    post(path, (request, response) -> {
        EntityReference entityRef = WebUtilities.getEntityReference(request);
        IdSelectionOptions selectionOptions = mkOpts(entityRef, HierarchyQueryScope.determineUpwardsScopeForKind(entityRef.kind()));
        GenericSelector selector = genericSelectorFactory.apply(selectionOptions);
        SelectSeekStep1<Record5<String, String, String, String, String>, String> qry = dsl.select(PERSON.DISPLAY_NAME.as("Name"), PERSON.TITLE.as("Title"), PERSON.OFFICE_PHONE.as("Telephone"), PERSON.EMAIL.as("Email"), INVOLVEMENT_KIND.NAME.as("Role")).from(PERSON).innerJoin(INVOLVEMENT).on(INVOLVEMENT.EMPLOYEE_ID.eq(PERSON.EMPLOYEE_ID)).innerJoin(INVOLVEMENT_KIND).on(INVOLVEMENT_KIND.ID.eq(INVOLVEMENT.KIND_ID)).where(INVOLVEMENT.ENTITY_ID.in(selector.selector()).and(INVOLVEMENT.ENTITY_KIND.eq(selector.kind().name()))).orderBy(PERSON.DISPLAY_NAME);
        return writeExtract("involved_people", qry, request, response);
    });
}
Also used : EntityReference(org.finos.waltz.model.EntityReference) WebUtilities.getEntityReference(org.finos.waltz.web.WebUtilities.getEntityReference) GenericSelector(org.finos.waltz.data.GenericSelector) Record5(org.jooq.Record5) IdSelectionOptions(org.finos.waltz.model.IdSelectionOptions)

Aggregations

EntityReference (org.finos.waltz.model.EntityReference)2 WebUtilities.getEntityReference (org.finos.waltz.web.WebUtilities.getEntityReference)2 GenericSelector (org.finos.waltz.data.GenericSelector)1 IdSelectionOptions (org.finos.waltz.model.IdSelectionOptions)1 Record5 (org.jooq.Record5)1