Search in sources :

Example 31 with Page

use of org.asqatasun.entity.subject.Page in project Asqatasun by Asqatasun.

the class ContentDAOImpl method findOrphanContentList.

@Override
public List<Content> findOrphanContentList(WebResource webResource, int start, int chunkSize) {
    if (webResource instanceof Page) {
        Query query = entityManager.createQuery("SELECT distinct s FROM " + SSPImpl.class.getName() + " s" + JOIN_WR + WEB_RESOURCE_CONDITION + HTTP_STATUS_CONDITION);
        query.setParameter(WEB_RESOURCE_KEY, webResource);
        query.setParameter(HTTP_STATUS_CODE_KEY, DEFAULT_HTTP_STATUS_VALUE);
        query.setFirstResult(start);
        query.setMaxResults(chunkSize);
        return (List<Content>) query.getResultList();
    } else if (webResource instanceof Site) {
        Query query = entityManager.createQuery("SELECT distinct s FROM " + SSPImpl.class.getName() + " s" + JOIN_WR + " JOIN w.parent p" + " WHERE p=:webResource" + HTTP_STATUS_CONDITION);
        query.setParameter(WEB_RESOURCE_KEY, webResource);
        query.setParameter(HTTP_STATUS_CODE_KEY, DEFAULT_HTTP_STATUS_VALUE);
        query.setFirstResult(start);
        query.setMaxResults(chunkSize);
        List<Content> contentList = (List<Content>) query.getResultList();
        flushAndCloseEntityManager();
        return contentList;
    }
    return Collections.emptyList();
}
Also used : Site(org.asqatasun.entity.subject.Site) Query(javax.persistence.Query) Page(org.asqatasun.entity.subject.Page)

Example 32 with Page

use of org.asqatasun.entity.subject.Page in project Asqatasun by Asqatasun.

the class ContentDAOImpl method findNumberOfRelatedContentFromWebResource.

@Override
public Long findNumberOfRelatedContentFromWebResource(WebResource webResource) {
    if (webResource instanceof Page) {
        Query query = entityManager.createQuery(SELECT_DISTINCT_RELATED_CONTENT + SSPImpl.class.getName() + " s" + " JOIN s.relatedContentSet rc" + JOIN_WR + WEB_RESOURCE_CONDITION + " AND s.httpStatusCode !=:httpStatusCode");
        query.setParameter(WEB_RESOURCE_KEY, webResource);
        query.setParameter(HTTP_STATUS_CODE_KEY, DEFAULT_HTTP_STATUS_VALUE);
        return (Long) query.getSingleResult();
    } else if (webResource instanceof Site) {
        Query query = entityManager.createQuery(SELECT_DISTINCT_RELATED_CONTENT + SSPImpl.class.getName() + " s" + " JOIN s.relatedContentSet rc" + JOIN_WR + " WHERE w.parent.id=:idWebResource" + " AND s.httpStatusCode !=:httpStatusCode");
        query.setParameter(ID_WEB_RESOURCE_KEY, webResource.getId());
        query.setParameter(HTTP_STATUS_CODE_KEY, DEFAULT_HTTP_STATUS_VALUE);
        return (Long) query.getSingleResult();
    }
    return (long) 0;
}
Also used : Site(org.asqatasun.entity.subject.Site) Query(javax.persistence.Query) Page(org.asqatasun.entity.subject.Page)

Example 33 with Page

use of org.asqatasun.entity.subject.Page in project Asqatasun by Asqatasun.

the class CheckTitleContentUnicityAtSiteLevelTest method setUpWebResourceMap.

@Override
protected void setUpWebResourceMap() {
    // file:Site-Passed1
    Site site = getWebResourceFactory().createSite("file:Site-Passed1");
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-1Passed-01", site);
    Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-1Passed-01.html");
    site.addChild(page);
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page01", page);
    page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-1Passed-02.html");
    site.addChild(page);
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page02", page);
    // file:Site-Failed1
    site = getWebResourceFactory().createSite("file:Site-Failed1");
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-2Failed-01", site);
    page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-2Failed-01.html");
    site.addChild(page);
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page03", page);
    page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-2Failed-02.html");
    site.addChild(page);
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page04", page);
    // file:Site-NA1
    site = getWebResourceFactory().createSite("file:Site-NA1");
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-4NA-01", site);
    page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-4NA-01.html");
    site.addChild(page);
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page05", page);
    page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-4NA-02.html");
    site.addChild(page);
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page06", page);
    // file:Site-Passed2
    site = getWebResourceFactory().createSite("file:Site-Passed2");
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-1Passed-02", site);
    page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-4NA-02.html");
    site.addChild(page);
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page07", page);
    page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-1Passed-01.html");
    site.addChild(page);
    getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page08", page);
}
Also used : Site(org.asqatasun.entity.subject.Site) Page(org.asqatasun.entity.subject.Page)

Example 34 with Page

use of org.asqatasun.entity.subject.Page in project Asqatasun by Asqatasun.

the class Rgaa30Rule121104Test method setUpWebResourceMap.

@Override
protected void setUpWebResourceMap() {
    getWebResourceMap().put("Rgaa30.Test.12.11.4-4NA-01", getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule121104/Rgaa30.Test.12.11.4-3NMI-01.html"));
    Site site = getWebResourceFactory().createSite("file:Site-NotTested");
    getWebResourceMap().put("Rgaa30.Test.12.11.4-5NT-01", site);
    Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule121104/Rgaa30.Test.12.11.4-3NMI-01.html");
    site.addChild(page);
    getWebResourceMap().put("Rgaa30.Test.12.11.4-5NT-01-page1", page);
    page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule121104/Rgaa30.Test.12.11.4-3NMI-01.html");
    site.addChild(page);
    getWebResourceMap().put("Rgaa30.Test.12.11.4-5NT-01-page1", page);
}
Also used : Site(org.asqatasun.entity.subject.Site) Page(org.asqatasun.entity.subject.Page)

Example 35 with Page

use of org.asqatasun.entity.subject.Page in project Asqatasun by Asqatasun.

the class Rgaa30Rule120101Test method setUpWebResourceMap.

@Override
protected void setUpWebResourceMap() {
    getWebResourceMap().put("Rgaa30.Test.12.01.01-4NA-01", getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule120101/Rgaa30.Test.12.01.01-3NMI-01.html"));
    Site site = getWebResourceFactory().createSite("file:Site-NotTested");
    getWebResourceMap().put("Rgaa30.Test.12.01.01-5NT-01", site);
    Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule120101/Rgaa30.Test.12.01.01-3NMI-01.html");
    site.addChild(page);
    getWebResourceMap().put("Rgaa30.Test.12.01.01-5NT-01-page1", page);
    page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule120101/Rgaa30.Test.12.01.01-3NMI-01.html");
    site.addChild(page);
    getWebResourceMap().put("Rgaa30.Test.12.01.01-5NT-01-page1", page);
}
Also used : Site(org.asqatasun.entity.subject.Site) Page(org.asqatasun.entity.subject.Page)

Aggregations

Page (org.asqatasun.entity.subject.Page)77 Site (org.asqatasun.entity.subject.Site)68 WebResource (org.asqatasun.entity.subject.WebResource)7 ArrayList (java.util.ArrayList)6 Query (javax.persistence.Query)6 Audit (org.asqatasun.entity.audit.Audit)4 ProcessResult (org.asqatasun.entity.audit.ProcessResult)4 List (java.util.List)3 Map (java.util.Map)3 SSP (org.asqatasun.entity.audit.SSP)3 Content (org.asqatasun.entity.audit.Content)2 DefiniteResult (org.asqatasun.entity.audit.DefiniteResult)2 ForbiddenPageException (org.asqatasun.webapp.exception.ForbiddenPageException)2 ColumnBuilderException (ar.com.fdvs.dj.domain.builders.ColumnBuilderException)1 IOException (java.io.IOException)1 JRException (net.sf.jasperreports.engine.JRException)1 PreProcessResult (org.asqatasun.entity.audit.PreProcessResult)1 Scope (org.asqatasun.entity.reference.Scope)1 ContentDataService (org.asqatasun.entity.service.audit.ContentDataService)1 WebResourceDataService (org.asqatasun.entity.service.subject.WebResourceDataService)1