Search in sources :

Example 1 with LinkHandler

use of com.adobe.cq.wcm.core.components.internal.link.LinkHandler in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class NavigationItemImplTest method test.

@Test
protected void test() {
    Page page = mock(Page.class);
    when(page.getProperties()).thenReturn(ValueMap.EMPTY);
    LinkHandler linkHandler = mock(LinkHandler.class);
    Component component = mock(Component.class);
    NavigationItemImpl navigationItem = new NavigationItemImpl(page, true, true, linkHandler, 0, Collections.emptyList(), "id", component);
    assertEquals(page, navigationItem.getPage());
    assertTrue(navigationItem.isActive());
    assertEquals(Collections.emptyList(), navigationItem.getChildren());
    assertEquals(0, navigationItem.getLevel());
}
Also used : Page(com.day.cq.wcm.api.Page) Component(com.day.cq.wcm.api.components.Component) LinkHandler(com.adobe.cq.wcm.core.components.internal.link.LinkHandler) Test(org.junit.jupiter.api.Test)

Example 2 with LinkHandler

use of com.adobe.cq.wcm.core.components.internal.link.LinkHandler in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ContainerImplTest method setUp.

@BeforeEach
public void setUp() {
    context.load().json(TEST_BASE + CoreComponentTestContext.TEST_CONTENT_JSON, CONTAINING_PAGE);
    context.registerService(FormStructureHelperFactory.class, resource -> formStructureHelper);
    context.registerService(SlingModelFilter.class, new SlingModelFilter() {

        private final Set<String> IGNORED_NODE_NAMES = new HashSet<String>() {

            {
                add(NameConstants.NN_RESPONSIVE_CONFIG);
                add(MSMNameConstants.NT_LIVE_SYNC_CONFIG);
                add("cq:annotations");
            }
        };

        @Override
        public Map<String, Object> filterProperties(Map<String, Object> map) {
            return map;
        }

        @Override
        public Iterable<Resource> filterChildResources(Iterable<Resource> childResources) {
            return StreamSupport.stream(childResources.spliterator(), false).filter(r -> !IGNORED_NODE_NAMES.contains(r.getName())).collect(Collectors.toList());
        }
    });
    context.registerAdapter(MockSlingHttpServletRequest.class, LinkHandler.class, new LinkHandler());
    FormsHelperStubber.createStub();
}
Also used : SlingModelFilter(com.adobe.cq.export.json.SlingModelFilter) Resource(org.apache.sling.api.resource.Resource) Map(java.util.Map) LinkHandler(com.adobe.cq.wcm.core.components.internal.link.LinkHandler) HashSet(java.util.HashSet) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with LinkHandler

use of com.adobe.cq.wcm.core.components.internal.link.LinkHandler in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class SearchResultServlet method getResults.

/**
 * Gets the search results.
 *
 * @param request The search request.
 * @param searchComponent The search component.
 * @param pageManager A PageManager.
 * @return List of search results.
 */
@NotNull
private List<ListItem> getResults(@NotNull final SlingHttpServletRequest request, @NotNull final Search searchComponent, @NotNull final PageManager pageManager) {
    List<ListItem> results = new ArrayList<>();
    String fulltext = request.getParameter(PARAM_FULLTEXT);
    if (fulltext == null || fulltext.length() < searchComponent.getSearchTermMinimumLength()) {
        return results;
    }
    long resultsOffset = Optional.ofNullable(request.getParameter(PARAM_RESULTS_OFFSET)).map(Long::parseLong).orElse(0L);
    Map<String, String> predicatesMap = new HashMap<>();
    predicatesMap.put(FulltextPredicateEvaluator.FULLTEXT, fulltext);
    predicatesMap.put(PathPredicateEvaluator.PATH, searchComponent.getSearchRootPagePath());
    predicatesMap.put(TypePredicateEvaluator.TYPE, NameConstants.NT_PAGE);
    PredicateGroup predicates = PredicateConverter.createPredicates(predicatesMap);
    ResourceResolver resourceResolver = request.getResource().getResourceResolver();
    Query query = queryBuilder.createQuery(predicates, resourceResolver.adaptTo(Session.class));
    if (searchComponent.getResultsSize() != 0) {
        query.setHitsPerPage(searchComponent.getResultsSize());
    }
    if (resultsOffset != 0) {
        query.setStart(resultsOffset);
    }
    SearchResult searchResult = query.getResult();
    LinkHandler linkHandler = request.adaptTo(LinkHandler.class);
    // Query builder has a leaking resource resolver, so the following work around is required.
    ResourceResolver leakingResourceResolver = null;
    try {
        Iterator<Resource> resourceIterator = searchResult.getResources();
        while (resourceIterator.hasNext()) {
            Resource resource = resourceIterator.next();
            // Get a reference to QB's leaking resource resolver
            if (leakingResourceResolver == null) {
                leakingResourceResolver = resource.getResourceResolver();
            }
            Optional.of(resource).map(res -> resourceResolver.getResource(res.getPath())).map(pageManager::getContainingPage).map(page -> new PageListItemImpl(linkHandler, page, searchComponent.getId(), null)).ifPresent(results::add);
        }
    } finally {
        if (leakingResourceResolver != null) {
            leakingResourceResolver.close();
        }
    }
    return results;
}
Also used : ResourceResolver(org.apache.sling.api.resource.ResourceResolver) ScriptHelper(org.apache.sling.scripting.core.ScriptHelper) TypePredicateEvaluator(com.day.cq.search.eval.TypePredicateEvaluator) StringUtils(org.apache.commons.lang3.StringUtils) Page(com.day.cq.wcm.api.Page) SlingBindings(org.apache.sling.api.scripting.SlingBindings) SlingHttpServletRequest(org.apache.sling.api.SlingHttpServletRequest) SearchResult(com.day.cq.search.result.SearchResult) PredicateConverter(com.day.cq.search.PredicateConverter) Map(java.util.Map) PageListItemImpl(com.adobe.cq.wcm.core.components.internal.models.v1.PageListItemImpl) Search(com.adobe.cq.wcm.core.components.models.Search) PN_FRAGMENT_VARIATION_PATH(com.adobe.cq.wcm.core.components.models.ExperienceFragment.PN_FRAGMENT_VARIATION_PATH) PathPredicateEvaluator(com.day.cq.search.eval.PathPredicateEvaluator) Session(javax.jcr.Session) Servlet(javax.servlet.Servlet) SlingHttpServletResponse(org.apache.sling.api.SlingHttpServletResponse) StandardCharsets(java.nio.charset.StandardCharsets) BundleContext(org.osgi.framework.BundleContext) Objects(java.util.Objects) PageManager(com.day.cq.wcm.api.PageManager) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) Query(com.day.cq.search.Query) Optional(java.util.Optional) SlingSafeMethodsServlet(org.apache.sling.api.servlets.SlingSafeMethodsServlet) NotNull(org.jetbrains.annotations.NotNull) FulltextPredicateEvaluator(com.day.cq.search.eval.FulltextPredicateEvaluator) ModelFactory(org.apache.sling.models.factory.ModelFactory) LinkHandler(com.adobe.cq.wcm.core.components.internal.link.LinkHandler) HashMap(java.util.HashMap) LanguageManager(com.day.cq.wcm.api.LanguageManager) ArrayList(java.util.ArrayList) Component(org.osgi.service.component.annotations.Component) StreamSupport(java.util.stream.StreamSupport) Activate(org.osgi.service.component.annotations.Activate) SearchImpl(com.adobe.cq.wcm.core.components.internal.models.v1.SearchImpl) QueryBuilder(com.day.cq.search.QueryBuilder) Iterator(java.util.Iterator) ListItem(com.adobe.cq.wcm.core.components.models.ListItem) HttpServletResponse(javax.servlet.http.HttpServletResponse) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Resource(org.apache.sling.api.resource.Resource) IOException(java.io.IOException) LiveRelationshipManager(com.day.cq.wcm.msm.api.LiveRelationshipManager) LocalizationUtils(com.adobe.cq.wcm.core.components.internal.LocalizationUtils) PredicateGroup(com.day.cq.search.PredicateGroup) Template(com.day.cq.wcm.api.Template) NameConstants(com.day.cq.wcm.api.NameConstants) Reference(org.osgi.service.component.annotations.Reference) Query(com.day.cq.search.Query) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Resource(org.apache.sling.api.resource.Resource) SearchResult(com.day.cq.search.result.SearchResult) PredicateGroup(com.day.cq.search.PredicateGroup) PageListItemImpl(com.adobe.cq.wcm.core.components.internal.models.v1.PageListItemImpl) ResourceResolver(org.apache.sling.api.resource.ResourceResolver) ListItem(com.adobe.cq.wcm.core.components.models.ListItem) LinkHandler(com.adobe.cq.wcm.core.components.internal.link.LinkHandler) Session(javax.jcr.Session) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with LinkHandler

use of com.adobe.cq.wcm.core.components.internal.link.LinkHandler in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class Utils method getWrappedImageResourceWithInheritance.

/**
 * Wraps an image resource with the properties and child resources of the inherited featured image of either
 * the linked page or the page containing the resource.
 *
 * @param resource The image resource
 * @param linkHandler The link handler
 * @param currentStyle The style of the image resource
 * @param currentPage The page containing the image resource
 * @return The wrapped image resource augmented with inherited properties and child resource if inheritance is enabled, the plain image resource otherwise.
 */
public static Resource getWrappedImageResourceWithInheritance(Resource resource, LinkHandler linkHandler, Style currentStyle, Page currentPage) {
    if (resource == null) {
        LOGGER.error("The resource is not defined");
        return null;
    }
    if (linkHandler == null) {
        LOGGER.error("The link handler is not defined");
        return null;
    }
    ValueMap properties = resource.getValueMap();
    String fileReference = properties.get(DownloadResource.PN_REFERENCE, String.class);
    Resource fileResource = resource.getChild(DownloadResource.NN_FILE);
    boolean imageFromPageImage = properties.get(PN_IMAGE_FROM_PAGE_IMAGE, StringUtils.isEmpty(fileReference) && fileResource == null);
    boolean altValueFromPageImage = properties.get(PN_ALT_VALUE_FROM_PAGE_IMAGE, imageFromPageImage);
    if (imageFromPageImage) {
        Resource inheritedResource = null;
        String linkURL = properties.get(ImageResource.PN_LINK_URL, String.class);
        boolean actionsEnabled = (currentStyle != null) ? !currentStyle.get(Teaser.PN_ACTIONS_DISABLED, !properties.get(Teaser.PN_ACTIONS_ENABLED, true)) : properties.get(Teaser.PN_ACTIONS_ENABLED, true);
        Resource firstAction = Optional.of(resource).map(res -> res.getChild(Teaser.NN_ACTIONS)).map(actions -> actions.getChildren().iterator().next()).orElse(null);
        if (StringUtils.isNotEmpty(linkURL)) {
            // the inherited resource is the featured image of the linked page
            Optional<Link> link = linkHandler.getLink(resource);
            inheritedResource = link.map(link1 -> (Page) link1.getReference()).map(ComponentUtils::getFeaturedImage).orElse(null);
        } else if (actionsEnabled && firstAction != null) {
            // the inherited resource is the featured image of the first action's page (the resource is assumed to be a teaser)
            inheritedResource = Optional.of(linkHandler.getLink(firstAction, Teaser.PN_ACTION_LINK)).map(link1 -> {
                if (link1.isPresent()) {
                    Page linkedPage = (Page) link1.get().getReference();
                    return Optional.ofNullable(linkedPage).map(ComponentUtils::getFeaturedImage).orElse(null);
                }
                return null;
            }).orElse(null);
        } else {
            // the inherited resource is the featured image of the current page
            inheritedResource = Optional.ofNullable(currentPage).map(page -> {
                Template template = page.getTemplate();
                // make sure the resource is part of the currentPage or of its template
                if (StringUtils.startsWith(resource.getPath(), currentPage.getPath()) || (template != null && StringUtils.startsWith(resource.getPath(), template.getPath()))) {
                    return ComponentUtils.getFeaturedImage(currentPage);
                }
                return null;
            }).orElse(null);
        }
        Map<String, String> overriddenProperties = new HashMap<>();
        Map<String, Resource> overriddenChildren = new HashMap<>();
        String inheritedFileReference = null;
        Resource inheritedFileResource = null;
        String inheritedAlt = null;
        String inheritedAltValueFromDAM = null;
        if (inheritedResource != null) {
            // Define the inherited properties
            ValueMap inheritedProperties = inheritedResource.getValueMap();
            inheritedFileReference = inheritedProperties.get(DownloadResource.PN_REFERENCE, String.class);
            inheritedFileResource = inheritedResource.getChild(DownloadResource.NN_FILE);
            inheritedAlt = inheritedProperties.get(ImageResource.PN_ALT, String.class);
            inheritedAltValueFromDAM = inheritedProperties.get(PN_ALT_VALUE_FROM_DAM, String.class);
        }
        overriddenProperties.put(DownloadResource.PN_REFERENCE, inheritedFileReference);
        overriddenChildren.put(DownloadResource.NN_FILE, inheritedFileResource);
        // don't inherit the image title from the page image
        overriddenProperties.put(PN_TITLE_VALUE_FROM_DAM, "false");
        if (altValueFromPageImage) {
            overriddenProperties.put(ImageResource.PN_ALT, inheritedAlt);
            overriddenProperties.put(PN_ALT_VALUE_FROM_DAM, inheritedAltValueFromDAM);
        } else {
            overriddenProperties.put(PN_ALT_VALUE_FROM_DAM, "false");
        }
        return new CoreResourceWrapper(resource, resource.getResourceType(), null, overriddenProperties, overriddenChildren);
    }
    return resource;
}
Also used : ValueMap(org.apache.sling.api.resource.ValueMap) ModelFactory(org.apache.sling.models.factory.ModelFactory) LinkHandler(com.adobe.cq.wcm.core.components.internal.link.LinkHandler) ResourceResolver(org.apache.sling.api.resource.ResourceResolver) LoggerFactory(org.slf4j.LoggerFactory) AllowedComponentList(com.day.cq.wcm.foundation.AllowedComponentList) HashMap(java.util.HashMap) DownloadResource(com.day.cq.commons.DownloadResource) StringUtils(org.apache.commons.lang3.StringUtils) Page(com.day.cq.wcm.api.Page) SlingHttpServletRequest(org.apache.sling.api.SlingHttpServletRequest) HashSet(java.util.HashSet) JSONException(org.json.JSONException) Style(com.day.cq.wcm.api.designer.Style) JSONObject(org.json.JSONObject) Image(com.adobe.cq.wcm.core.components.models.Image) Map(java.util.Map) Link(com.adobe.cq.wcm.core.components.commons.link.Link) LinkedHashSet(java.util.LinkedHashSet) Logger(org.slf4j.Logger) ImmutableSet(com.google.common.collect.ImmutableSet) Designer(com.day.cq.wcm.api.designer.Designer) Collection(java.util.Collection) Set(java.util.Set) Resource(org.apache.sling.api.resource.Resource) ExperienceFragment(com.adobe.cq.wcm.core.components.models.ExperienceFragment) CoreResourceWrapper(com.adobe.cq.wcm.core.components.internal.resource.CoreResourceWrapper) ComponentUtils(com.adobe.cq.wcm.core.components.util.ComponentUtils) PageManager(com.day.cq.wcm.api.PageManager) Nullable(org.jetbrains.annotations.Nullable) Template(com.day.cq.wcm.api.Template) Optional(java.util.Optional) ImageResource(com.day.cq.commons.ImageResource) NotNull(org.jetbrains.annotations.NotNull) Teaser(com.adobe.cq.wcm.core.components.models.Teaser) Collections(java.util.Collections) HashMap(java.util.HashMap) ValueMap(org.apache.sling.api.resource.ValueMap) DownloadResource(com.day.cq.commons.DownloadResource) Resource(org.apache.sling.api.resource.Resource) ImageResource(com.day.cq.commons.ImageResource) CoreResourceWrapper(com.adobe.cq.wcm.core.components.internal.resource.CoreResourceWrapper) Page(com.day.cq.wcm.api.Page) Template(com.day.cq.wcm.api.Template) ComponentUtils(com.adobe.cq.wcm.core.components.util.ComponentUtils) Link(com.adobe.cq.wcm.core.components.commons.link.Link)

Example 5 with LinkHandler

use of com.adobe.cq.wcm.core.components.internal.link.LinkHandler in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class AdaptiveImageServlet method doGet.

@Override
protected void doGet(@NotNull SlingHttpServletRequest request, @NotNull SlingHttpServletResponse response) throws IOException {
    Timer.Context requestDuration = metrics.startDurationRecording();
    try {
        metrics.markServletInvocation();
        RequestPathInfo requestPathInfo = request.getRequestPathInfo();
        List<String> selectorList = selectorToList(requestPathInfo.getSelectorString());
        String suffix = requestPathInfo.getSuffix();
        String imageName = StringUtils.isNotEmpty(suffix) ? FilenameUtils.getName(suffix) : "";
        if (StringUtils.isNotEmpty(suffix)) {
            String suffixExtension = FilenameUtils.getExtension(suffix);
            if (StringUtils.isNotEmpty(suffixExtension)) {
                if (!suffixExtension.equals(requestPathInfo.getExtension())) {
                    LOGGER.error("The suffix part defines a different extension than the request: {}.", suffix);
                    metrics.markImageErrors();
                    response.sendError(HttpServletResponse.SC_NOT_FOUND);
                    return;
                }
            } else {
                LOGGER.error("Invalid suffix: {}.", suffix);
                metrics.markImageErrors();
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }
        }
        Resource component = request.getResource();
        ResourceResolver resourceResolver = request.getResourceResolver();
        if (!component.isResourceType(IMAGE_RESOURCE_TYPE)) {
            // image coming from template; need to switch resource
            Resource componentCandidate = null;
            PageManager pageManager = resourceResolver.adaptTo(PageManager.class);
            if (pageManager != null) {
                Page page = pageManager.getContainingPage(component);
                if (page != null) {
                    Template template = page.getTemplate();
                    if (template != null) {
                        if (StringUtils.isNotEmpty(suffix)) {
                            long lastModifiedSuffix = getRequestLastModifiedSuffix(suffix);
                            String relativeTemplatePath = lastModifiedSuffix == 0 ? // no timestamp info, but extension is valid; get resource name
                            suffix.substring(0, suffix.lastIndexOf('.')) : // timestamp info, get parent path from suffix
                            suffix.substring(0, suffix.lastIndexOf("/" + String.valueOf(lastModifiedSuffix)));
                            String imagePath = ResourceUtil.normalize(template.getPath() + relativeTemplatePath);
                            if (StringUtils.isNotEmpty(imagePath) && !template.getPath().equals(imagePath)) {
                                componentCandidate = resourceResolver.getResource(imagePath);
                            }
                        }
                    }
                }
            }
            if (componentCandidate == null) {
                LOGGER.error("Unable to retrieve an image from this page's template.");
                metrics.markImageErrors();
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }
            component = componentCandidate;
        }
        LinkHandler linkHandler = request.adaptTo(LinkHandler.class);
        Style currentStyle = WCMUtils.getStyle(request);
        Page currentPage = Optional.ofNullable(resourceResolver.adaptTo(PageManager.class)).map(pageManager -> pageManager.getContainingPage(request.getResource())).orElse(null);
        Resource wrappedImageResourceWithInheritance = getWrappedImageResourceWithInheritance(component, linkHandler, currentStyle, currentPage);
        ImageComponent imageComponent = new ImageComponent(wrappedImageResourceWithInheritance);
        if (imageComponent.source == Source.NOCONTENT || imageComponent.source == Source.NONEXISTING) {
            LOGGER.error("Either the image from {} does not have a valid file reference" + " or the containing page does not have a valid featured image", component.getPath());
            metrics.markImageErrors();
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
        ValueMap componentProperties = component.getValueMap();
        long lastModifiedEpoch = 0;
        Calendar lastModifiedDate = componentProperties.get(JcrConstants.JCR_LASTMODIFIED, Calendar.class);
        if (lastModifiedDate == null) {
            lastModifiedDate = componentProperties.get(NameConstants.PN_PAGE_LAST_MOD, Calendar.class);
        }
        if (lastModifiedDate != null) {
            lastModifiedEpoch = lastModifiedDate.getTimeInMillis();
        }
        Asset asset = null;
        if (imageComponent.source == Source.ASSET) {
            asset = imageComponent.imageResource.adaptTo(Asset.class);
            if (asset == null) {
                LOGGER.error("Unable to adapt resource {} used by image {} to an asset.", imageComponent.imageResource.getPath(), component.getPath());
                metrics.markImageErrors();
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }
            long assetLastModifiedEpoch = asset.getLastModified();
            if (assetLastModifiedEpoch > lastModifiedEpoch) {
                lastModifiedEpoch = assetLastModifiedEpoch;
            }
        }
        long requestLastModifiedSuffix = getRequestLastModifiedSuffix(suffix);
        if (requestLastModifiedSuffix >= 0 && requestLastModifiedSuffix != lastModifiedEpoch) {
            String redirectLocation = getRedirectLocation(request, lastModifiedEpoch);
            if (StringUtils.isNotEmpty(redirectLocation)) {
                response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
                response.setHeader("Location", redirectLocation);
                return;
            } else {
                LOGGER.error("Unable to determine correct redirect location.");
                metrics.markImageErrors();
                response.setStatus(HttpServletResponse.SC_NOT_FOUND);
                return;
            }
        }
        if (!handleIfModifiedSinceHeader(request, response, lastModifiedEpoch)) {
            Map<String, Integer> transformationMap = getTransformationMap(selectorList, component);
            Integer jpegQualityInPercentage = transformationMap.get(SELECTOR_QUALITY_KEY);
            double quality = jpegQualityInPercentage / 100.0d;
            int resizeWidth = transformationMap.get(SELECTOR_WIDTH_KEY);
            String imageType = getImageType(requestPathInfo.getExtension());
            if (imageComponent.source == Source.FILE) {
                transformAndStreamFile(response, componentProperties, resizeWidth, quality, imageComponent.imageResource, imageType, imageName);
            } else if (imageComponent.source == Source.ASSET) {
                transformAndStreamAsset(response, componentProperties, resizeWidth, quality, asset, imageType, imageName);
            }
            metrics.markImageStreamed();
        }
    } catch (IllegalArgumentException e) {
        LOGGER.error("Invalid image request", e.getMessage());
        metrics.markImageErrors();
        response.sendError(HttpServletResponse.SC_NOT_FOUND);
    } finally {
        requestDuration.stop();
    }
}
Also used : ValueMap(org.apache.sling.api.resource.ValueMap) ResourceResolver(org.apache.sling.api.resource.ResourceResolver) SortedSet(java.util.SortedSet) ResourceUtil(org.apache.sling.api.resource.ResourceUtil) ContentPolicyManager(com.day.cq.wcm.api.policies.ContentPolicyManager) LoggerFactory(org.slf4j.LoggerFactory) DownloadResource(com.day.cq.commons.DownloadResource) StringUtils(org.apache.commons.lang3.StringUtils) Page(com.day.cq.wcm.api.Page) Layer(com.day.image.Layer) SlingHttpServletRequest(org.apache.sling.api.SlingHttpServletRequest) WCMUtils(com.day.cq.wcm.commons.WCMUtils) Matcher(java.util.regex.Matcher) Image(com.adobe.cq.wcm.core.components.models.Image) CharEncoding(org.apache.commons.lang3.CharEncoding) Map(java.util.Map) MimeTypeService(org.apache.sling.commons.mime.MimeTypeService) Splitter(com.google.common.base.Splitter) JcrConstants(org.apache.jackrabbit.JcrConstants) BufferedImage(java.awt.image.BufferedImage) HttpConstants(org.apache.sling.api.servlets.HttpConstants) SlingHttpServletResponse(org.apache.sling.api.SlingHttpServletResponse) DamConstants(com.day.cq.dam.api.DamConstants) CoreResourceWrapper(com.adobe.cq.wcm.core.components.internal.resource.CoreResourceWrapper) PageManager(com.day.cq.wcm.api.PageManager) IOUtils(org.apache.commons.io.IOUtils) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) RequestPathInfo(org.apache.sling.api.request.RequestPathInfo) Optional(java.util.Optional) SlingSafeMethodsServlet(org.apache.sling.api.servlets.SlingSafeMethodsServlet) Pattern(java.util.regex.Pattern) NotNull(org.jetbrains.annotations.NotNull) FilenameUtils(org.apache.commons.io.FilenameUtils) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings) Utils.getWrappedImageResourceWithInheritance(com.adobe.cq.wcm.core.components.internal.Utils.getWrappedImageResourceWithInheritance) Joiner(com.google.common.base.Joiner) ComponentManager(com.day.cq.wcm.api.components.ComponentManager) LinkHandler(com.adobe.cq.wcm.core.components.internal.link.LinkHandler) HashMap(java.util.HashMap) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) Style(com.day.cq.wcm.api.designer.Style) Calendar(java.util.Calendar) Lists(com.google.common.collect.Lists) WCMRenditionPicker(com.day.cq.wcm.foundation.WCMRenditionPicker) Timer(org.apache.sling.commons.metrics.Timer) Asset(com.day.cq.dam.api.Asset) Logger(org.slf4j.Logger) Rendition(com.day.cq.dam.api.Rendition) HttpServletResponse(javax.servlet.http.HttpServletResponse) Resource(org.apache.sling.api.resource.Resource) IOException(java.io.IOException) AbstractImageDelegatingModel(com.adobe.cq.wcm.core.components.internal.models.v1.AbstractImageDelegatingModel) java.awt(java.awt) URLEncoder(java.net.URLEncoder) Template(com.day.cq.wcm.api.Template) NameConstants(com.day.cq.wcm.api.NameConstants) Text(org.apache.jackrabbit.util.Text) AssetStore(com.day.cq.dam.api.handler.store.AssetStore) AssetHandler(com.day.cq.dam.api.handler.AssetHandler) ContentPolicy(com.day.cq.wcm.api.policies.ContentPolicy) ImageResource(com.day.cq.commons.ImageResource) Comparator(java.util.Comparator) InputStream(java.io.InputStream) ValueMap(org.apache.sling.api.resource.ValueMap) Calendar(java.util.Calendar) DownloadResource(com.day.cq.commons.DownloadResource) Resource(org.apache.sling.api.resource.Resource) ImageResource(com.day.cq.commons.ImageResource) Page(com.day.cq.wcm.api.Page) Template(com.day.cq.wcm.api.Template) RequestPathInfo(org.apache.sling.api.request.RequestPathInfo) PageManager(com.day.cq.wcm.api.PageManager) Timer(org.apache.sling.commons.metrics.Timer) ResourceResolver(org.apache.sling.api.resource.ResourceResolver) Style(com.day.cq.wcm.api.designer.Style) Asset(com.day.cq.dam.api.Asset) LinkHandler(com.adobe.cq.wcm.core.components.internal.link.LinkHandler)

Aggregations

LinkHandler (com.adobe.cq.wcm.core.components.internal.link.LinkHandler)5 Page (com.day.cq.wcm.api.Page)4 Map (java.util.Map)4 Resource (org.apache.sling.api.resource.Resource)4 PageManager (com.day.cq.wcm.api.PageManager)3 Template (com.day.cq.wcm.api.Template)3 HashMap (java.util.HashMap)3 Optional (java.util.Optional)3 StringUtils (org.apache.commons.lang3.StringUtils)3 CoreResourceWrapper (com.adobe.cq.wcm.core.components.internal.resource.CoreResourceWrapper)2 Image (com.adobe.cq.wcm.core.components.models.Image)2 DownloadResource (com.day.cq.commons.DownloadResource)2 ImageResource (com.day.cq.commons.ImageResource)2 NameConstants (com.day.cq.wcm.api.NameConstants)2 Style (com.day.cq.wcm.api.designer.Style)2 SlingHttpServletRequest (org.apache.sling.api.SlingHttpServletRequest)2 ResourceResolver (org.apache.sling.api.resource.ResourceResolver)2 ValueMap (org.apache.sling.api.resource.ValueMap)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (org.jetbrains.annotations.Nullable)2