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));
});
}
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);
});
}
Aggregations