Search in sources :

Example 1 with UseCaseGroup

use of com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseGroup in project sechub by mercedes-benz.

the class UseCaseRestDocModelAsciiDocGenerator method generateOverview.

private List<List<UseCaseRestDocEntry>> generateOverview(UseCaseRestDocModel model, Context context, int h) {
    context.addLine(headline(h) + "Overview");
    List<List<UseCaseRestDocEntry>> found = new ArrayList<>();
    for (UseCaseGroup group : UseCaseGroup.values()) {
        SortedSet<UseCaseEntry> entriesForGroup = model.getUseCaseModel().getGroup(group).getUseCases();
        if (entriesForGroup.isEmpty()) {
            continue;
        }
        StringBuilder linksToRestDocs = new StringBuilder();
        createEntriesForGroup(model, context, found, entriesForGroup, linksToRestDocs);
        boolean foundAtLeastOneRestDocForGroup = linksToRestDocs.length() > 0;
        if (!foundAtLeastOneRestDocForGroup) {
            continue;
        }
        context.addLine(headline(h + 1) + group.getTitle());
        context.addLine(group.getDescription());
        context.addLine("");
        context.addLine(linksToRestDocs.toString());
        context.addLine("");
    }
    return found;
}
Also used : ArrayList(java.util.ArrayList) UseCaseGroup(com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseGroup) UseCaseEntry(com.mercedesbenz.sechub.docgen.usecase.UseCaseModel.UseCaseEntry) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with UseCaseGroup

use of com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseGroup in project sechub by mercedes-benz.

the class UseCaseAsciiDocGenerator method generateOverview.

private void generateOverview(UseCaseModel model, Context context, int headlineLevel) {
    context.addLine(headline(headlineLevel) + "Overview about usecase groups");
    UseCaseModelType type = model.getType();
    switch(type) {
        case SECHUB:
            for (UseCaseGroup useCaseGroup : UseCaseGroup.values()) {
                generateGroupUseCaseLinks(context, headlineLevel, model.getGroup(useCaseGroup));
            }
            break;
        case PDS:
            for (PDSUseCaseGroup useCaseGroup : PDSUseCaseGroup.values()) {
                generateGroupUseCaseLinks(context, headlineLevel, model.getGroup(useCaseGroup));
            }
            break;
        default:
            throw new IllegalArgumentException("Unsupported type:" + type);
    }
}
Also used : PDSUseCaseGroup(com.mercedesbenz.sechub.pds.usecase.PDSUseCaseGroup) UseCaseModelType(com.mercedesbenz.sechub.docgen.usecase.UseCaseModel.UseCaseModelType) PDSUseCaseGroup(com.mercedesbenz.sechub.pds.usecase.PDSUseCaseGroup) UseCaseGroup(com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseGroup)

Example 3 with UseCaseGroup

use of com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseGroup in project sechub by mercedes-benz.

the class PDSUseCaseAsciiDocGenerator method generateOverview.

private void generateOverview(UseCaseModel model, Context context, int headlineLevel) {
    context.addLine(headline(headlineLevel) + "Overview about usecase groups");
    UseCaseModelType type = model.getType();
    switch(type) {
        case SECHUB:
            for (UseCaseGroup useCaseGroup : UseCaseGroup.values()) {
                generateGroupUseCaseLinks(context, headlineLevel, model.getGroup(useCaseGroup));
            }
            break;
        case PDS:
            for (PDSUseCaseGroup useCaseGroup : PDSUseCaseGroup.values()) {
                generateGroupUseCaseLinks(context, headlineLevel, model.getGroup(useCaseGroup));
            }
            break;
        default:
            throw new IllegalArgumentException("Unsupported type:" + type);
    }
}
Also used : PDSUseCaseGroup(com.mercedesbenz.sechub.pds.usecase.PDSUseCaseGroup) UseCaseModelType(com.mercedesbenz.sechub.docgen.usecase.UseCaseModel.UseCaseModelType) PDSUseCaseGroup(com.mercedesbenz.sechub.pds.usecase.PDSUseCaseGroup) UseCaseGroup(com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseGroup)

Aggregations

UseCaseGroup (com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseGroup)3 UseCaseModelType (com.mercedesbenz.sechub.docgen.usecase.UseCaseModel.UseCaseModelType)2 PDSUseCaseGroup (com.mercedesbenz.sechub.pds.usecase.PDSUseCaseGroup)2 UseCaseEntry (com.mercedesbenz.sechub.docgen.usecase.UseCaseModel.UseCaseEntry)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1