<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sling Filter with multiple resource type and specific query parameter in request in Adobe Experience Manager Discussions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454356#M33717</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17512404"&gt;&lt;/LI-USER&gt;&amp;nbsp;-&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Have you tried the relative paths with SlingServletFilter annotation like below?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;@SlingServletFilter&lt;/SPAN&gt;(scope = { SlingServletFilterScope.&lt;SPAN&gt;REQUEST&lt;/SPAN&gt;}&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;  resourceTypes = {"&lt;SPAN&gt;a/p1","a/p2","a/p3"&lt;/SPAN&gt;}&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  pattern = &lt;SPAN&gt;"/content/(parent)/.*"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  extensions = {&lt;SPAN&gt;".html"&lt;/SPAN&gt;}&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  methods = {&lt;SPAN&gt;"GET"&lt;/SPAN&gt;})&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2022 14:11:58 GMT</pubDate>
    <dc:creator>Fanindra_Surat</dc:creator>
    <dc:date>2022-06-01T14:11:58Z</dc:date>
    <item>
      <title>Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454045#M33711</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Below are two points I'm trying to cover via my Sling filter but seems not functional properly.&lt;/P&gt;&lt;P&gt;1. I want my filter to be chained on specific resource types e.g.&amp;nbsp; /apps/a/p1 ,&amp;nbsp; /apps/a/p2 , /apps/a/p3&lt;/P&gt;&lt;P&gt;2. I want my filter to be chained only on specific query parameters in request (e.g.&amp;nbsp; &lt;A href="https://helloworld.xyz/parent/page-1.html" target="_blank"&gt;https://helloworld.xyz/parent/page-1.html&lt;/A&gt;?&lt;FONT face="arial black,avant garde"&gt;&lt;STRONG&gt;q=&lt;/STRONG&gt;&lt;/FONT&gt;...., &lt;A href="https://helloworld.xyz/parent/page-2.html" target="_blank"&gt;https://helloworld.xyz/parent/page-2.html&lt;/A&gt;?&lt;FONT face="arial black,avant garde"&gt;&lt;STRONG&gt;q=&lt;/STRONG&gt;&lt;/FONT&gt;....,&amp;nbsp; &amp;nbsp;&lt;A href="https://helloworld.xyz/parent/page-3.html" target="_blank"&gt;https://helloworld.xyz/parent/page-3.html&lt;/A&gt;?&lt;FONT face="arial black,avant garde"&gt;&lt;STRONG&gt;q=&lt;/STRONG&gt;&lt;/FONT&gt;.... )etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are current state of my filter&lt;/P&gt;&lt;P&gt;1. Filter Scope is of "Request"&lt;/P&gt;&lt;P&gt;2. Tried multiple resource types as below syntax; Assume resource types of page-1 is " /apps/a/p1",&amp;nbsp;resource types of page-2 is " /apps/a/p2"&amp;nbsp; &amp;amp; resource types of page-3 is " /apps/a/p3".&amp;nbsp; Also assume content path of pages are as&amp;nbsp; /content/parent/page-1 etc.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;@Component &lt;/SPAN&gt;(service = Filter.&lt;SPAN&gt;class, &lt;/SPAN&gt;property = {&lt;BR /&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_SCOPE &lt;/SPAN&gt;+ &lt;SPAN&gt;"=" &lt;/SPAN&gt;+ EngineConstants.&lt;SPAN&gt;FILTER_SCOPE_REQUEST&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_METHODS &lt;/SPAN&gt;+ &lt;SPAN&gt;"=" &lt;/SPAN&gt;+ &lt;SPAN&gt;"GET"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_EXTENSIONS &lt;/SPAN&gt;+ &lt;SPAN&gt;"=" &lt;/SPAN&gt;+ &lt;SPAN&gt;"html"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_PATTERN &lt;/SPAN&gt;+ &lt;SPAN&gt;"=" &lt;/SPAN&gt;+ &lt;SPAN&gt;"/content/(parent)/.*"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_RESOURCETYPES &lt;/SPAN&gt;+ &lt;SPAN&gt;"=['/apps/a/p1','/apps/a/p2',/apps/a/p3']"&lt;BR /&gt;&lt;/SPAN&gt;})&lt;/PRE&gt;&lt;P&gt;But I'm unable to register (tried with comma separated values also) and also when i'm using&amp;nbsp;@SlingServletFilter annotation, same issue is taking place.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;@SlingServletFilter&lt;/SPAN&gt;(scope = { SlingServletFilterScope.&lt;SPAN&gt;REQUEST&lt;/SPAN&gt;}&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;  resourceTypes = {"&lt;SPAN&gt;/apps/a/p1","/apps/a/p2","/apps/a/p3"&lt;/SPAN&gt;}&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  pattern = &lt;SPAN&gt;"/content/(parent)/.*"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  extensions = {&lt;SPAN&gt;".html"&lt;/SPAN&gt;}&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  methods = {&lt;SPAN&gt;"GET"&lt;/SPAN&gt;})&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 08:40:20 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454045#M33711</guid>
      <dc:creator>DJSarkar</dc:creator>
      <dc:date>2022-05-31T08:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454104#M33712</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you check.&lt;/P&gt;&lt;P&gt;&lt;A href="https://sling.apache.org/documentation/the-sling-engine/filters.html" target="_blank"&gt;https://sling.apache.org/documentation/the-sling-engine/filters.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have achieve this in the past using regex pattern.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 13:40:24 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454104#M33712</guid>
      <dc:creator>arunpatidar</dc:creator>
      <dc:date>2022-05-31T13:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454122#M33713</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17512404"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is your resourceType getting resolved? Ignore below If not. (&lt;EM&gt;&lt;STRONG&gt;resourceType is an relative path just double check&lt;/STRONG&gt;&lt;/EM&gt;)&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;@Component &lt;/SPAN&gt;(service = Filter.&lt;SPAN&gt;class, &lt;/SPAN&gt;property = {&lt;BR /&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_SCOPE &lt;/SPAN&gt;+ &lt;SPAN&gt;"=" &lt;/SPAN&gt;+ EngineConstants.&lt;SPAN&gt;FILTER_SCOPE_REQUEST&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_METHODS &lt;/SPAN&gt;+ &lt;SPAN&gt;"=" &lt;/SPAN&gt;+ &lt;SPAN&gt;"GET"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_EXTENSIONS &lt;/SPAN&gt;+ &lt;SPAN&gt;"=" &lt;/SPAN&gt;+ &lt;SPAN&gt;"html"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_PATTERN &lt;/SPAN&gt;+ &lt;SPAN&gt;"=" &lt;/SPAN&gt;+ &lt;SPAN&gt;"/content/(parent)/.*"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  EngineConstants.&lt;SPAN&gt;SLING_FILTER_RESOURCETYPES &lt;/SPAN&gt;+ &lt;SPAN&gt;"=" + "/apps/a/p1",&lt;BR /&gt;  EngineConstants.SLING_FILTER_RESOURCETYPES + "=" + "/apps/a/p2",&lt;BR /&gt;  EngineConstants.SLING_FILTER_RESOURCETYPES + "=" + "/apps/a/p3",&lt;BR /&gt;&lt;/SPAN&gt;})&lt;/PRE&gt;&lt;P&gt;Then get queryString parameter from the URL to check and filter chain.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Santosh&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:35:28 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454122#M33713</guid>
      <dc:creator>SantoshSai</dc:creator>
      <dc:date>2022-05-31T14:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454307#M33714</link>
      <description>&lt;P&gt;Hi Santosh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response. I tried multiple resource types the way you mentioned. But seems it didn't work. Also I tried with absolute and relative path as well. and at last, I tried with regex pattern as -&amp;nbsp; "/apps/a/(p1|p2|p3)" but got no luck.&lt;/P&gt;&lt;P&gt;if I just remove the page resourceTypes and keep rest fields, it's working fine.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 12:23:10 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454307#M33714</guid>
      <dc:creator>DJSarkar</dc:creator>
      <dc:date>2022-06-01T12:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454308#M33715</link>
      <description>&lt;P&gt;Hi Arun,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with these two patterns for resourceTypes -- i) one with absolute path&amp;nbsp; "/apps/a/(p1|p2|p3)"&amp;nbsp; and ii) with relative path "a/(p1|p2|p3)"; Do I need to try something different?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 12:25:26 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454308#M33715</guid>
      <dc:creator>DJSarkar</dc:creator>
      <dc:date>2022-06-01T12:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454316#M33716</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Not sure if this will work with resourceType because the resourcetype argument is for component scope. I am not 100% sure but I used this when I need to intercept the component rendering&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;&lt;A href="https://github.com/arunpatidar02/aem63app-repo/blob/master/java/XFFilter.java" target="_blank"&gt;https://github.com/arunpatidar02/aem63app-repo/blob/master/java/XFFilter.java&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 12:56:35 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454316#M33716</guid>
      <dc:creator>arunpatidar</dc:creator>
      <dc:date>2022-06-01T12:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454356#M33717</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17512404"&gt;&lt;/LI-USER&gt;&amp;nbsp;-&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Have you tried the relative paths with SlingServletFilter annotation like below?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;@SlingServletFilter&lt;/SPAN&gt;(scope = { SlingServletFilterScope.&lt;SPAN&gt;REQUEST&lt;/SPAN&gt;}&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;  resourceTypes = {"&lt;SPAN&gt;a/p1","a/p2","a/p3"&lt;/SPAN&gt;}&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  pattern = &lt;SPAN&gt;"/content/(parent)/.*"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  extensions = {&lt;SPAN&gt;".html"&lt;/SPAN&gt;}&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  methods = {&lt;SPAN&gt;"GET"&lt;/SPAN&gt;})&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 14:11:58 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454356#M33717</guid>
      <dc:creator>Fanindra_Surat</dc:creator>
      <dc:date>2022-06-01T14:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454362#M33718</link>
      <description>&lt;P&gt;&lt;LI-USER uid="17512404"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It seems OOTB,&amp;nbsp;&lt;SPAN&gt;there's no possibility of associating Sling Filters with Sling Resource Types. Found one workaround here to achieve it:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/16886232/does-sling-allow-component-filters-configured-to-target-only-certain-resource-ty#comment24398528_16893230" target="_blank"&gt;https://stackoverflow.com/questions/16886232/does-sling-allow-component-filters-configured-to-target-only-certain-resource-ty#comment24398528_16893230&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that Helps!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 14:20:39 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454362#M33718</guid>
      <dc:creator>SantoshSai</dc:creator>
      <dc:date>2022-06-01T14:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454515#M33754</link>
      <description>&lt;P&gt;Hi Santosh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes! seems the resourceType is not considered in request scope (as Arun mentioned) so it was not working e.g. For the page requests, the resource type seems actually synonymous to primary type of the page node i.e. "cq:Page".&lt;/P&gt;&lt;P&gt;i) COMPONENT SCOPE is working fine with the specific resource types with the format which you mentioned earlier.&lt;/P&gt;&lt;P&gt;ii) But REQUEST SCOPE is working with REQUEST/RESOURCE_PATTERN but seems can not cover resource type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 07:58:12 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454515#M33754</guid>
      <dc:creator>DJSarkar</dc:creator>
      <dc:date>2022-06-02T07:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454516#M33755</link>
      <description>&lt;P&gt;Thanks Arun for sharing the input ! seems the resourceType is not considered in request scope (as you mentioned) so it was not working e.g. For the page requests, the resource type seems actually synonymous to primary type of the page node i.e. "cq:Page"..&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 07:59:54 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454516#M33755</guid>
      <dc:creator>DJSarkar</dc:creator>
      <dc:date>2022-06-02T07:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sling Filter with multiple resource type and specific query parameter in request</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454517#M33756</link>
      <description>&lt;P&gt;Yes, all the primary node types also considered as resource type when registered for filter, servlet etc.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 08:04:02 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-filter-with-multiple-resource-type-and-specific-query/m-p/454517#M33756</guid>
      <dc:creator>arunpatidar</dc:creator>
      <dc:date>2022-06-02T08:04:02Z</dc:date>
    </item>
  </channel>
</rss>

