All Downloads are FREE. Search and download functionalities are using the official Maven repository.

webapp.index.jsp Maven / Gradle / Ivy

The newest version!
<%@ page import="com.google.common.base.Joiner" %>
<%@ page import="com.google.common.collect.Lists" %>
<%@ page import="com.selesse.jxlint.model.rules.LintRule" %>
<%@ page import="com.selesse.jxlint.settings.ProgramSettings" %>
<%@ page import="com.selesse.jxlint.web.HtmlReportExecutor" %>
<%@ page import="java.util.List" %>
<%
    String folder = request.getParameter("folder");
    String[] rulesEnabled = request.getParameterValues("ruleEnabled");

    ProgramSettings programSettings = (ProgramSettings) application.getAttribute("programSettings");

    String nameAndVersion = programSettings.getProgramName() + " " + programSettings.getProgramVersion();
%>



     <%= nameAndVersion %> - web validator 
    
    
    


<%= nameAndVersion %> - web validator

<%! private boolean ruleIsChecked(String[] rulesEnabled, LintRule lintRule) { if (rulesEnabled == null) { return lintRule.isEnabled(); } List rulesEnabledList = Lists.newArrayList(rulesEnabled); return rulesEnabledList.contains(lintRule.getName()); } %>
<% for (LintRule lintRule : HtmlReportExecutor.getAvailableRules()) { %> > <%=lintRule.getName()%>
<% } %>
placeholder="Folder to run validations against" />
<% if (request.getParameter("folder") != null && rulesEnabled != null) { List jxlintArgs = Lists.newArrayList("--check"); jxlintArgs.add(Joiner.on(",").join(rulesEnabled)); jxlintArgs.add(folder); rulesEnabled = new String[jxlintArgs.size()]; jxlintArgs.toArray(rulesEnabled); HtmlReportExecutor htmlReportExecutor = new HtmlReportExecutor(folder, programSettings, rulesEnabled); if (htmlReportExecutor.directoryExists()) { htmlReportExecutor.generateReport(); response.sendRedirect("report.jsp"); %> <% } else { %> Directory '<%= jxlintArgs.get(jxlintArgs.size() - 1) %>' does not exist <% } } %>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy