return null;
}
private Design getResourceDesign(Object adaptable) {
Page resourcePage = getResourcePage(adaptable);
Designer designer = getDesigner(adaptable);
if (adaptable instanceof SlingHttpServletRequest) {
SlingHttpServletRequest request = (SlingHttpServletRequest) adaptable;
if (resourcePage != null && designer != null) {
String resourceDesignKey = COM_DAY_CQ_WCM_TAGS_DEFINE_OBJECTS_TAG + resourcePage.getPath();
Object cachedResourceDesign = request.getAttribute(resourceDesignKey);
if (cachedResourceDesign != null) {
return (Design) cachedResourceDesign;
} else {
Design resourceDesign = designer.getDesign(resourcePage);
request.setAttribute(resourceDesignKey, resourceDesign);
return resourceDesign;
}
}
}
if (adaptable instanceof Resource) {
return designer != null ? designer.getDesign(resourcePage) : null;
}
return null;
}