-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SLING-10096 - Allow the SlingHttpServletRequest in the IncludeGenerat…
…or or Sling dynamic includes Extend the IncludeGenerator interface with the Sling Request object to give more flexibility to custom implementators of the interface Co-authored-by: Santiago Garcia Pimentel <santiago.pimentel@netcentric.biz>
- Loading branch information
1 parent
07fc5b9
commit e2c70ea
Showing
9 changed files
with
69 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/org/apache/sling/dynamicinclude/api/IncludeGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*- | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.sling.dynamicinclude.api; | ||
|
||
import org.apache.sling.api.SlingHttpServletRequest; | ||
|
||
/** | ||
* Include generator interface | ||
*/ | ||
public interface IncludeGenerator { | ||
String getType(); | ||
|
||
/** | ||
* Returns the string used to include the resource. | ||
* For example, this might be a Javascript code that retrieves a snippet of html, | ||
* an Apache SSI Tag, or an Edge Side Include Tag. | ||
* <p> | ||
* This method receives the sling request and an Url that has already be normalized as followed: | ||
* <ul> | ||
* <li>The query string has been removed</li> | ||
* <li>The Url has been mapped using the ResourceResolver</li> | ||
* <li>The jcr:content paths have been encoded to _jcr_content.</li> | ||
* </ul> | ||
* | ||
* @param request the Sling request object | ||
* @param normalizedUrl the requested url, normalized | ||
* @return a String used to include the resource | ||
**/ | ||
String getInclude(SlingHttpServletRequest request, String normalizedUrl); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters