@ProviderType
public interface ComponentHelper
| Modifier and Type | Method and Description |
|---|---|
String |
generateClassicUIPlaceholder(String classNames,
String title)
Build the placeholder image HTML for the Classic UI.
|
String |
getDDEditBlock(org.apache.sling.api.SlingHttpServletRequest request,
String name,
boolean... isConfigured)
Convenience wrapper for getDDEditBlock(SlingHttpServletRequest request,
String getName, WCMEditType editType, boolean...
|
String |
getDDEditBlock(org.apache.sling.api.SlingHttpServletRequest request,
String name,
ComponentEditType.Type editType,
boolean... isConfigured)
Returns the HTML for creating DropTarget Edit Icon(s) for a specific
(named) DropTargets defined by a Component.
|
String |
getEditBlock(org.apache.sling.api.SlingHttpServletRequest request,
ComponentEditType.Type editType,
boolean... isConfigured)
Creates a String HTML representation of the Component's edit block.
|
String |
getEditIconImgTag(ComponentEditType.Type editType)
Get the edit icon HTML img tag (>img ...<) for the specified
EditType
|
boolean |
isAuthoringMode(org.apache.sling.api.SlingHttpServletRequest request)
Checks if the mode equals in an "Authoring" mode; Edit or Design.
|
boolean |
printDDEditBlock(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
String name,
boolean... isConfigured)
Print the DropTarget Edit Icon to the response.
|
boolean |
printDDEditBlock(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
String name,
ComponentEditType.Type editType,
boolean... isConfigured)
Print the DropTarget Edit Icon to the response.
|
boolean |
printEditBlock(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
ComponentEditType.Type editType,
boolean... isConfigured)
Prints the HTML representation of the Component's edit block to the Response.
|
boolean |
printEditBlockOrNothing(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
ComponentEditType.Type editType,
boolean... isConfigured)
Wrapper for printEditBlock(...) with special handling for non-Authoring modes.
|
boolean isAuthoringMode(org.apache.sling.api.SlingHttpServletRequest request)
request - the current requestboolean printEditBlock(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
ComponentEditType.Type editType,
boolean... isConfigured)
request - the requestresponse - the responseeditType - the edit typeisConfigured - will display edit block if evaluates to FALSEboolean printEditBlockOrNothing(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
ComponentEditType.Type editType,
boolean... isConfigured)
Normal use: inclusion at top of component JSP before any markup is output:
<% if(WCMHelper.printEditBlockOrNothing(slingRequest, slingResponse, WCMEditType.NONE, StringUtils.isNotBlank(properties.get("foo", ""))) { return; // Stops execution of the JSP; leaving only the Edit Block rendered in Authoring Mode or nothing in non-Authoring Modes } %> *
request - the requestresponse - the responseeditType - the edit typeisConfigured - will display edit block if evaluates to FALSEboolean printDDEditBlock(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
String name,
boolean... isConfigured)
Allow the WCMHelper to automatically derive the placeholder icon based on the DropTarget's Groups and Accepts properties.
Only displays if an 'AND' of all 'visible' parameters evaluates to true.
request - response - isConfigured - will display edit block if evaluates to falseboolean printDDEditBlock(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
String name,
ComponentEditType.Type editType,
boolean... isConfigured)
Specify the DropTarget Icon to display.
Only displays if an 'AND' of all 'visible' parameters evaluates to true.
request - response - editType - isConfigured - will display edit block if evaluates to falseString getEditBlock(org.apache.sling.api.SlingHttpServletRequest request, ComponentEditType.Type editType, boolean... isConfigured)
request - editType - isConfigured - will display edit block if evaluates to falseString getDDEditBlock(org.apache.sling.api.SlingHttpServletRequest request, String name, boolean... isConfigured)
request - name - isConfigured - will display edit block if evaluates to falseString getDDEditBlock(org.apache.sling.api.SlingHttpServletRequest request, String name, ComponentEditType.Type editType, boolean... isConfigured)
Allows the developer to specific the EditType Icon to be used for the Drop Target via editType parameter. If editType equals left null, the edit type will be derived based on the DropTarget's Groups and Accepts properties.
request - editType - isConfigured - will display edit block if evaluates to falseString getEditIconImgTag(ComponentEditType.Type editType)
editType - String generateClassicUIPlaceholder(String classNames, String title)
classNames - the HTML class names which will be added to the generated HTML.title - the title (if any) for the generated HTML.Copyright © 2013–2020 Adobe. All rights reserved.