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


Java Resource.getParent方法代码示例

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


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

示例1: getTemplatesPatterns

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
private List<PatternModel> getTemplatesPatterns(Resource resource, String patternsPath, String patternId,
                                                List<String> templateNames) throws IOException {
    List<PatternModel> templatesPatterns = Lists.newArrayList();
    final Resource folderResource = resource.getParent();
    final List<String> jsonDataFiles = retrieveJsonDataFilesInFolder(folderResource, StringUtils.substringBefore(resource.getName(), PatternLabConstants.HTML_EXT));
    for (String templateName : templateNames) {
        final List<String> templateDedicatedDataFiles = getTemplateDedicatedFiles(templateName, jsonDataFiles, templateNames);
        if (CollectionUtils.isEmpty(templateDedicatedDataFiles)) {
            templatesPatterns.add(new PatternModel(resource, patternsPath, patternId, StringUtils.EMPTY, templateName, this.resourceResolver));
        } else {
            for (String jsonDataFileName : templateDedicatedDataFiles) {
                templatesPatterns.add(new PatternModel(resource, patternsPath, patternId, jsonDataFileName, templateName, this.resourceResolver));
            }
        }
    }
    return templatesPatterns;
}
 
开发者ID:deepthinkit,项目名称:patternlab-for-sling,代码行数:18,代码来源:PatternPatternCategoryFactoryImpl.java

示例2: loadConfigHierarchy

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
private void loadConfigHierarchy(final ComponentManager componentManager, final String resourceType)
        throws Exception {
    com.day.cq.wcm.api.components.Component component = componentManager.getComponent(resourceType);
    if (component != null) {
        if (!configCache.containsKey(component.getResourceType())) {
            while (component != null) {
                Resource configResource = component.getLocalResource(XK_CONFIG_RESOURCE_NAME);
                if (configResource == null)
                    break;
                Resource foundComponentResource = configResource.getParent();
                if (!foundComponentResource.getPath().equals(component.getPath())) {
                    component = componentManager.getComponent(foundComponentResource.getPath());
                }
                Node node = configResource.adaptTo(Node.class);

                Map<String, InertProperty> propsMap = getNodePropertiesMap(node, new HashMap<String, InertProperty>(), BLANK);
                configMembers.put(component.getResourceType(), propsMap);

                component = component.getSuperComponent();
            }
            configCache.put(component.getResourceType(), configMembers);
        } else {
            configMembers = configCache.get(component.getResourceType());
        }
    }
    propNamesDeepCache = names(false);
}
 
开发者ID:DantaFramework,项目名称:AEM,代码行数:28,代码来源:AEMConfigurationProviderImpl.java

示例3: getParent

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
@Override
public Resource getParent(Resource element) {
	return element.getParent();
}
 
开发者ID:apache,项目名称:sling-org-apache-sling-query,代码行数:5,代码来源:ResourceTreeProvider.java


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