Search in sources :

Example 31 with Site

use of org.asqatasun.entity.subject.Site 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 32 with Site

use of org.asqatasun.entity.subject.Site 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 33 with Site

use of org.asqatasun.entity.subject.Site 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 34 with Site

use of org.asqatasun.entity.subject.Site 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)

Example 35 with Site

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

the class Rgaa30Rule120603Test method setUpWebResourceMap.

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

Aggregations

Site (org.asqatasun.entity.subject.Site)76 Page (org.asqatasun.entity.subject.Page)68 WebResource (org.asqatasun.entity.subject.WebResource)9 Audit (org.asqatasun.entity.audit.Audit)7 Query (javax.persistence.Query)6 ArrayList (java.util.ArrayList)5 ProcessResult (org.asqatasun.entity.audit.ProcessResult)4 ForbiddenPageException (org.asqatasun.webapp.exception.ForbiddenPageException)4 Contract (org.asqatasun.webapp.entity.contract.Contract)3 ForbiddenUserException (org.asqatasun.webapp.exception.ForbiddenUserException)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 List (java.util.List)2 Map (java.util.Map)2 Content (org.asqatasun.entity.audit.Content)2 DefiniteResult (org.asqatasun.entity.audit.DefiniteResult)2 SSP (org.asqatasun.entity.audit.SSP)2 ResultCounter (org.asqatasun.webapp.presentation.data.ResultCounter)2 Secured (org.springframework.security.access.annotation.Secured)2 Criterion (org.asqatasun.entity.reference.Criterion)1 Theme (org.asqatasun.entity.reference.Theme)1