// Fields in config.jelly must match the parameter names in the "DataBoundConstructor" // Entry point when building @DataBoundConstructor public FodUploaderPlugin( String applicationId, String releaseId, String assessmentTypeId, String technologyStack, String languageLevel, boolean runOpenSourceAnalysis, boolean isExpressScan, boolean isExpressAudit, int pollingInterval, boolean doPrettyLogOutput, boolean includeAllFiles, boolean excludeThirdParty, boolean isRemediationScan, int entitlementId) { int frequencyType = 0; for (ReleaseAssessmentTypeDTO assessment : getDescriptor().assessments) { if (assessment.getEntitlementId() == entitlementId) { frequencyType = assessment.getFrequencyTypeId(); } } // load job model jobModel = new JobConfigModel( applicationId, releaseId, assessmentTypeId, technologyStack, languageLevel, runOpenSourceAnalysis, isExpressScan, isExpressAudit, pollingInterval, doPrettyLogOutput, includeAllFiles, excludeThirdParty, isRemediationScan, entitlementId, frequencyType); }
@SuppressWarnings("unused") public ListBoxModel doFillAssessmentTypeIdItems(@QueryParameter(RELEASE_ID) int releaseId) { ListBoxModel listBox = new ListBoxModel(); api.authenticate(); assessments = FilterNegativeEntitlements(api.getReleaseController().getAssessmentTypeIds(releaseId)); for (ReleaseAssessmentTypeDTO assessmentType : assessments) { final String value = String.valueOf(assessmentType.getAssessmentTypeId()); String infoText; if (assessmentType.getFrequencyTypeId() == EntitlementFrequencyType.Subscription.getValue()) { infoText = "Subscription"; } else { infoText = String.format("Single Scan: %s Unit(s) left", assessmentType.getUnitsAvailable()); } final String name = String.format("%s (%s)", assessmentType.getName(), infoText); listBox.add(new ListBoxModel.Option(name, value, false)); } return listBox; }