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


Java Page.getTitle方法代码示例

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


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

示例1: getItems

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
private List<NavigationItem> getItems(Page root) {
    List<NavigationItem> pages = new ArrayList<>();
    if (root.getDepth() < structureDepth) {
        Iterator<Page> it = root.listChildren(new PageFilter());
        while (it.hasNext()) {
            Page page = it.next();
            boolean active = currentPage.getPath().equals(page.getPath()) || currentPage.getPath().startsWith(page.getPath() + "/");
            String title = page.getNavigationTitle();
            if (title == null) {
                title = page.getTitle();
            }
            List<NavigationItem> children = getItems(page);
            int level = page.getDepth() - startLevel;
            Page localizedPage = getLocalizedPage(currentPage, page);
            if (localizedPage != null) {
                page = localizedPage;
            }
            pages.add(new LanguageNavigationItemImpl(page, active, request, level, children, title));
        }
    }

    return pages;
}
 
开发者ID:Adobe-Marketing-Cloud,项目名称:aem-core-wcm-components,代码行数:24,代码来源:LanguageNavigationImpl.java

示例2: activate

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
@Override
public void activate() throws Exception {
    Resource resource = getResource();
    ValueMap properties = getProperties();
    ResourceResolver resolver = getResourceResolver();
    buttonLinkTo = properties.get(PROP_BUTTON_LINK_TO, "");
    buttonLabel = properties.get(PROP_BUTTON_LABEL, "");
    if (StringUtils.isNotEmpty(buttonLinkTo)) {
        // if button label is not set, try to get it from target page's title
        if (StringUtils.isEmpty(buttonLabel)) {
            Resource linkResource = resolver.getResource(buttonLinkTo);
            if (linkResource != null) {
                Page targetPage = linkResource.adaptTo(Page.class);
                if (targetPage != null) {
                    buttonLabel = targetPage.getTitle();
                }
            }
        }
        buttonLinkTo = buttonLinkTo + ".html";
    }
    log.debug("resource: {}", resource.getPath());
    log.debug("buttonLinkTo: {}", buttonLinkTo);
    log.debug("buttonLabel: {}", buttonLabel);
}
 
开发者ID:Adobe-Marketing-Cloud,项目名称:aem-sample-we-retail,代码行数:25,代码来源:CategoryTeaser.java

示例3: getNavigationTitle

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
/**
 *
 * @param page This is a Page
 * @return navigationTitle This is the page title
 */
public static String getNavigationTitle(Page page) {
    String navigationTitle = null;
    if (null != page) {
        navigationTitle = page.getNavigationTitle();
        if (null == navigationTitle) {
            navigationTitle = page.getPageTitle() == null ? page.getTitle() : page.getPageTitle();
        }
    }
    return navigationTitle;
}
 
开发者ID:DantaFramework,项目名称:AEM,代码行数:16,代码来源:PageUtils.java

示例4: getTitle

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
/**
 * Returns the title of the given page. If the title is empty it will fallback to the name of the page.
 * @param page  The page.
 * @return      The best suited title found (or <code>null</code> if page is <code>null</code>).
 */
public static String getTitle(final Page page) {
    if (page != null) {
        final String title = page.getTitle();
        if (StringUtils.isBlank(title)) {
            return page.getName();
        }
        return title;
    } else {
        LOGGER.debug("Provided page argument is null");
        return null;
    }
}
 
开发者ID:Adobe-Marketing-Cloud,项目名称:aem-sample-we-retail,代码行数:18,代码来源:WeRetailHelper.java

示例5: getName

import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
public String getName() {
  Page currentPage = WCMUtils.getComponentContext(request).getPage();
  return currentPage.getTitle();

}
 
开发者ID:sinnerschrader,项目名称:aem-react,代码行数:6,代码来源:CityViewModel.java


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