Package com.composum.ai.aem.core.impl
Class AemContentCreationSelectorsServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- org.apache.sling.api.servlets.SlingSafeMethodsServlet
-
- com.composum.ai.aem.core.impl.AemContentCreationSelectorsServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class AemContentCreationSelectorsServlet extends org.apache.sling.api.servlets.SlingSafeMethodsServlet
Servlet that reads the content selectors from a JSON file, adds links in the content and provides that to the dialog.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
PATH_CONTENTSELECTORS
JCR path to a JSON with the basic content selectors supported by the dialog.
-
Constructor Summary
Constructors Constructor Description AemContentCreationSelectorsServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addContentPaths(org.apache.sling.api.resource.Resource resource, Map<String,String> contentSelectors)
We look for content paths in the component and it's parent.protected void
doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
protected Map<String,String>
readPredefinedContentSelectors(org.apache.sling.api.SlingHttpServletRequest request)
-
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doHead, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service
-
-
-
-
Field Detail
-
PATH_CONTENTSELECTORS
public static final String PATH_CONTENTSELECTORS
JCR path to a JSON with the basic content selectors supported by the dialog.- See Also:
- Constant Field Values
-
-
Method Detail
-
doGet
protected void doGet(@Nonnull org.apache.sling.api.SlingHttpServletRequest request, @Nonnull org.apache.sling.api.SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException
- Overrides:
doGet
in classorg.apache.sling.api.servlets.SlingSafeMethodsServlet
- Throws:
javax.servlet.ServletException
IOException
-
addContentPaths
protected void addContentPaths(org.apache.sling.api.resource.Resource resource, Map<String,String> contentSelectors)
We look for content paths in the component and it's parent. That seems more appropriate than the component itself in AEM - often interesting links are contained one or more levels up, e.g. for text fields in teasers.
-
readPredefinedContentSelectors
protected Map<String,String> readPredefinedContentSelectors(org.apache.sling.api.SlingHttpServletRequest request) throws IOException
- Throws:
IOException
-
-