当前位置: 首页>>代码示例>>Java>>正文


Java Page.getParent方法代码示例

本文整理汇总了Java中com.day.cq.wcm.api.Page.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java Page.getParent方法的具体用法?Java Page.getParent怎么用?Java Page.getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.day.cq.wcm.api.Page的用法示例。


在下文中一共展示了Page.getParent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getParentWithParentPageReturnsParent

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
@Test
public void getParentWithParentPageReturnsParent() throws Exception {
	Page target = aPage("/content/test/ko/foobar");
	
	Page actual = target.getParent();
	
	assertThat(actual, pageExistsAt("/content/test/ko"));
}
 
开发者ID:quatico-solutions,项目名称:aem-testing,代码行数:9,代码来源:PageTestDriver.java

示例2: getParentIntWithZeroReturnsPageItself

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
@Test
public void getParentIntWithZeroReturnsPageItself() throws Exception {
	Page target = aPage("/content/test/ko/foobar");
	
	Page actual = target.getParent(0);
	
	assertThat(actual.adaptTo(Resource.class), resourceExistsAt(target.getPath()));
}
 
开发者ID:quatico-solutions,项目名称:aem-testing,代码行数:9,代码来源:PageTestDriver.java

示例3: getParentIntWithOneReturnsPageParent

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
@Test
public void getParentIntWithOneReturnsPageParent() throws Exception {
	Page target = aPage("/content/test/ko/foobar");
	
	Page actual = target.getParent(1);
	
	assertThat(actual, pageExistsAt("/content/test/ko"));
}
 
开发者ID:quatico-solutions,项目名称:aem-testing,代码行数:9,代码来源:PageTestDriver.java

示例4: getParentIntWithTwoReturnsPageParentsParent

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
@Test
public void getParentIntWithTwoReturnsPageParentsParent() throws Exception {
	Page target = aPage("/content/test/ko/foobar");
	
	Page actual = target.getParent(2);
	
	assertThat(actual, pageExistsAt("/content/test"));
}
 
开发者ID:quatico-solutions,项目名称:aem-testing,代码行数:9,代码来源:PageTestDriver.java

示例5: getParentIntWithThreeReturnsNull

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
@Test
public void getParentIntWithThreeReturnsNull() throws Exception {
	Page target = aPage("/content/test/ko/foobar");
	
	Page actual = target.getParent(3);
	
	assertNull(actual);
}
 
开发者ID:quatico-solutions,项目名称:aem-testing,代码行数:9,代码来源:PageTestDriver.java

示例6: findRootPage

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
private Page findRootPage() {
    Page page = currentPage;
    while (true) {
        Page parent = page.getParent();
        if (parent == null) {
            return page;
        } else {
            page = parent;
        }
    }
}
 
开发者ID:Adobe-Marketing-Cloud,项目名称:aem-core-wcm-components,代码行数:12,代码来源:SocialMediaHelperImpl.java

示例7: getCountries

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
/**
 * Returns the list of countries supported by the site
 */
private List<Country> getCountries(Page siteRoot) {
    List<Country> countries = new ArrayList<Country>();
    Page countryRoot = siteRoot.getParent(2);
    if (countryRoot == null) {
        return new ArrayList<Country>();
    }
    Iterator<Page> it = countryRoot.listChildren(new PageFilter());
    while (it.hasNext()) {
        Page countrypage = it.next();
        countries.add(new Country(countrypage.getName(), getLanguages(countrypage, siteRoot)));
    }
    return countries;
}
 
开发者ID:Adobe-Marketing-Cloud,项目名称:aem-sample-we-retail,代码行数:17,代码来源:Header.java

示例8: findRoot

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
/**
 * Returns the root page of the site
 * E.g.: /content/we-retail/us/en
 * @param resourcePage  the current Page
 * @return root page or null if a root cannot be found
 */
public static Page findRoot(Page resourcePage) {
    Page rootPage = resourcePage;
    while(rootPage != null && !isRoot(rootPage)) {
        rootPage = rootPage.getParent();
    }
    return rootPage;
}
 
开发者ID:Adobe-Marketing-Cloud,项目名称:aem-sample-we-retail,代码行数:14,代码来源:WeRetailHelper.java


注:本文中的com.day.cq.wcm.api.Page.getParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。