Search in sources :

Example 41 with Parameter

use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.

the class CrawlerImpl method updateExcludeRelCanonicalRegardingRef.

/**
     * This method update the relcanonical boolean regarding the referential.
     * For a11y refs, the boolean has to be set to false.
     */
private void updateExcludeRelCanonicalRegardingRef() {
    for (Parameter param : paramSet) {
        if (param.getParameterElement().getParameterElementCode().equals("LEVEL")) {
            String level = param.getValue().split(";")[0];
            if (keepRelCanonicalRefList.contains(level)) {
                LOGGER.info("Rel canonical pages are kept for ref " + level);
                excludeRelCanonical = false;
            } else {
                LOGGER.info("Rel canonical pages are excluded for ref " + level);
            }
            break;
        }
    }
}
Also used : Parameter(org.asqatasun.entity.parameterization.Parameter)

Example 42 with Parameter

use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.

the class MockParameterDataService method getParameter.

@Override
public Parameter getParameter(Audit audit, String string) {
    Parameter param = new ParameterImpl();
    param.setValue("1000");
    return param;
}
Also used : ParameterImpl(org.asqatasun.entity.parameterization.ParameterImpl) Parameter(org.asqatasun.entity.parameterization.Parameter)

Example 43 with Parameter

use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.

the class ParameterFactoryImpl method createParameter.

@Override
public Parameter createParameter(ParameterElement parameterElement, String value, Audit audit) {
    Parameter parameter = createParameter(parameterElement, value);
    audit.addParameter(parameter);
    return parameter;
}
Also used : Parameter(org.asqatasun.entity.parameterization.Parameter)

Example 44 with Parameter

use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.

the class CrawlerServiceImpl method crawlSite.

/**
     * Calls the crawler component process then updates the site.
     *
     * @param siteUrl the site to crawl
     * @param audit the current audit
     *
     * @return returns the site after modification
     */
@Override
public WebResource crawlSite(Audit audit, String siteUrl) {
    Crawler crawler = getCrawlerInstance((Set<Parameter>) audit.getParameterSet(), true);
    crawler.setSiteURL(siteUrl);
    return crawl(crawler, audit, true);
}
Also used : Parameter(org.asqatasun.entity.parameterization.Parameter) Crawler(org.asqatasun.crawler.Crawler)

Example 45 with Parameter

use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.

the class AuditSetUpCommandFactory method getPageAuditSetUpCommand.

/**
 * @param contract
 * @param url
 * @param auditParamset
 * @return an AuditSetUpCommand instance set for page audit
 */
public AuditSetUpCommand getPageAuditSetUpCommand(Contract contract, String url, Set<Parameter> auditParamset) {
    AuditSetUpCommand pageAuditSetUpCommand = new AuditSetUpCommand();
    pageAuditSetUpCommand.setScope(ScopeEnum.PAGE);
    pageAuditSetUpCommand.setContractId(contract.getId());
    pageAuditSetUpCommand.setRelaunch(true);
    List<String> urlList = new ArrayList();
    urlList.add(url);
    pageAuditSetUpCommand.setUrlList(urlList);
    for (Parameter param : auditParamset) {
        String paramCode = param.getParameterElement().getParameterElementCode();
        if (paramCode.equals(TgolKeyStore.LEVEL_PARAM_KEY)) {
            pageAuditSetUpCommand.setLevel(param.getValue());
        } else {
            pageAuditSetUpCommand.setAuditParameter(paramCode, param.getValue());
        }
    }
    return pageAuditSetUpCommand;
}
Also used : AuditSetUpCommand(org.asqatasun.webapp.command.AuditSetUpCommand) Parameter(org.asqatasun.entity.parameterization.Parameter)

Aggregations

Parameter (org.asqatasun.entity.parameterization.Parameter)59 ParameterElement (org.asqatasun.entity.parameterization.ParameterElement)13 Audit (org.asqatasun.entity.audit.Audit)8 ParameterImpl (org.asqatasun.entity.parameterization.ParameterImpl)6 NoResultException (javax.persistence.NoResultException)5 Query (javax.persistence.Query)5 HashSet (java.util.HashSet)4 AuditCommand (org.asqatasun.service.command.AuditCommand)4 AuditCommandFactory (org.asqatasun.service.command.factory.AuditCommandFactory)4 Test (org.junit.Test)4 File (java.io.File)3 IOException (java.io.IOException)3 Crawler (org.asqatasun.crawler.Crawler)3 ParameterElementImpl (org.asqatasun.entity.parameterization.ParameterElementImpl)3 LinkedHashSet (java.util.LinkedHashSet)2 ParameterFamily (org.asqatasun.entity.parameterization.ParameterFamily)2 WebResourceStatisticsDataService (org.asqatasun.entity.service.statistics.WebResourceStatisticsDataService)2 WebResourceStatisticsDataServiceImpl (org.asqatasun.entity.service.statistics.WebResourceStatisticsDataServiceImpl)2 WebResourceStatistics (org.asqatasun.entity.statistics.WebResourceStatistics)2 WebResourceStatisticsFactory (org.asqatasun.entity.statistics.factory.WebResourceStatisticsFactory)2