Search in sources :

Example 6 with Nomenclature

use of org.asqatasun.entity.reference.Nomenclature in project Asqatasun by Asqatasun.

the class NomenclatureDataServiceImpl method findByCode.

@Override
public Nomenclature findByCode(String code) {
    if (nomenclatureMapByCode.containsKey(code)) {
        return nomenclatureMapByCode.get(code);
    } else {
        Nomenclature nom = ((NomenclatureDAO) entityDao).retrieveByCode(code);
        nomenclatureMapByCode.put(code, nom);
        return nom;
    }
}
Also used : Nomenclature(org.asqatasun.entity.reference.Nomenclature) NomenclatureDAO(org.asqatasun.entity.dao.reference.NomenclatureDAO)

Example 7 with Nomenclature

use of org.asqatasun.entity.reference.Nomenclature in project Asqatasun by Asqatasun.

the class Aw22Rule10011 method select.

@Override
protected void select(SSPHandler sspHandler) {
    // retrieve element from the nomenclature
    Nomenclature deprecatedHtmlTags = nomenclatureLoaderService.loadByCode(DEPREC_TAG_NOM);
    // add each element of the nomenclature to the selector
    MultipleElementSelector mes = (MultipleElementSelector) getElementSelector();
    for (String deprecatedTag : deprecatedHtmlTags.getValueList()) {
        mes.addCssQuery(deprecatedTag.toLowerCase());
    }
    totalNumberOfElements = sspHandler.getTotalNumberOfElements();
    super.select(sspHandler);
}
Also used : Nomenclature(org.asqatasun.entity.reference.Nomenclature) MultipleElementSelector(org.asqatasun.rules.elementselector.MultipleElementSelector)

Example 8 with Nomenclature

use of org.asqatasun.entity.reference.Nomenclature in project Asqatasun by Asqatasun.

the class LangChecker method loadValidLanguages.

/**
     * This method loads the valid languages nomenclature
     */
protected void loadValidLanguages() {
    if (validLanguagesSet == null) {
        Nomenclature validLanguages = getNomenclatureLoaderService().loadByCode(LANG_NOM);
        validLanguagesSet = validLanguages.getValueList();
    }
}
Also used : Nomenclature(org.asqatasun.entity.reference.Nomenclature)

Example 9 with Nomenclature

use of org.asqatasun.entity.reference.Nomenclature in project Asqatasun by Asqatasun.

the class Rgaa30Rule100101 method select.

@Override
protected void select(SSPHandler sspHandler) {
    // retrieve element from the nomenclature
    Nomenclature deprecatedHtmlTags = nomenclatureLoaderService.loadByCode(DEPREC_TAG_NOM);
    // add each element of the nomenclature to the selector
    MultipleElementSelector mes = (MultipleElementSelector) getElementSelector();
    for (String deprecatedTag : deprecatedHtmlTags.getValueList()) {
        mes.addCssQuery(deprecatedTag.toLowerCase());
    }
    totalNumberOfElements = sspHandler.getTotalNumberOfElements();
    super.select(sspHandler);
}
Also used : Nomenclature(org.asqatasun.entity.reference.Nomenclature) MultipleElementSelector(org.asqatasun.rules.elementselector.MultipleElementSelector)

Example 10 with Nomenclature

use of org.asqatasun.entity.reference.Nomenclature in project Asqatasun by Asqatasun.

the class Rgaa30Rule100102 method select.

@Override
protected void select(SSPHandler sspHandler) {
    totalNumberOfElements = sspHandler.getTotalNumberOfElements();
    // retrieve element from the nomenclature
    Nomenclature deprecatedHtmlAttr = nomenclatureLoaderService.loadByCode(PRESENTATION_ATTR_NOM);
    for (String deprecatedAttr : deprecatedHtmlAttr.getValueList()) {
        SimpleElementSelector sec = new SimpleElementSelector(buildQuery(deprecatedAttr));
        ElementHandler<Element> eh = new ElementHandlerImpl();
        sec.selectElements(sspHandler, eh);
        attrElementHandlerMap.put(deprecatedAttr, eh);
    }
    // elements with width attribute that are not img
    SimpleElementSelector secWidthAttrNotImg = new SimpleElementSelector(ELEMENT_WITH_WITDH_ATTR_NOT_IMG_V2);
    ElementHandler<Element> ehWithAttrNotImg = new ElementHandlerImpl();
    secWidthAttrNotImg.selectElements(sspHandler, ehWithAttrNotImg);
    attrElementHandlerMap.put(WIDTH_ATTR, ehWithAttrNotImg);
    // elements with width attribute that are not img
    SimpleElementSelector secHeightAttrNotImg = new SimpleElementSelector(ELEMENT_WITH_HEIGHT_ATTR_NOT_IMG_V2);
    ElementHandler<Element> ehHeightAttrNotImg = new ElementHandlerImpl();
    secHeightAttrNotImg.selectElements(sspHandler, ehHeightAttrNotImg);
    attrElementHandlerMap.put(HEIGHT_ATTR, ehHeightAttrNotImg);
}
Also used : Nomenclature(org.asqatasun.entity.reference.Nomenclature) Element(org.jsoup.nodes.Element) ElementHandlerImpl(org.asqatasun.ruleimplementation.ElementHandlerImpl) SimpleElementSelector(org.asqatasun.rules.elementselector.SimpleElementSelector)

Aggregations

Nomenclature (org.asqatasun.entity.reference.Nomenclature)12 ElementHandlerImpl (org.asqatasun.ruleimplementation.ElementHandlerImpl)4 MultipleElementSelector (org.asqatasun.rules.elementselector.MultipleElementSelector)4 SimpleElementSelector (org.asqatasun.rules.elementselector.SimpleElementSelector)4 Element (org.jsoup.nodes.Element)3 Query (javax.persistence.Query)1 NomenclatureDAO (org.asqatasun.entity.dao.reference.NomenclatureDAO)1 ElementHandler (org.asqatasun.ruleimplementation.ElementHandler)1 Node (org.w3c.dom.Node)1