Package sk.iway.iwcm.components
Class WebjetComponentAbstract
java.lang.Object
sk.iway.iwcm.components.WebjetComponentAbstract
- All Implemented Interfaces:
WebjetComponentInterface
- Direct Known Subclasses:
BannerApp,BasketInvoicesListApp,CalendarApp,Captcha,CarouselSliderApp,ContentBlockApp,CookieBarApp,DateApp,DayBookApp,DisqusApp,DmailApp,DocsEmbedApp,DoubleOptInComponent,EmoticonApp,FacebookCommentsApp,FacebookLikeApp,FacebookLikeBoxApp,FileArchiveApp,FormSimpleApp,ForumApp,GalleryApp,GdprApp,HtmlBoxApp,HtmlEmbedApp,ImpressSlideshowApp,InquiryApp,InquirySimpleApp,LanguageRedirectApp,MapApp,MediaApp,MenuApp,MultistepFormApp,MyReservationsApp,NewsApp,NewsCalendarApp,QaApp,QuizApp,RatingApp,RelatedPagesApp,ReservationApp,RestaurantMenuApp,SearchApp,SendLinkApp,SiteBrowserApp,SiteMapApp,SliderApp,SlitSliderApp,SmartsUppApp,SocialIconApp,StatApp,TestimonialsApp,TimeBookApp,UnsubscribeApp,UserApp,UsrLogonController,VideoApp,VyhladavanieApp,WeatherApp
Base/Abstract class for WebJET app
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCurrentValueToOptions(List<OptionDto> options, String value) Verify, that value is in options, if not, add itaddCurrentValueToOptions(List<OptionDto> options, String[] values) Verify, that values are in options, if not, add itaddOptions(List options, String labelProperty, String valueProperty, boolean includeOriginalObject) Add options from list type id:label, id will be converted to string and used as value for option.static String[]buildWrapperDiv(String wrapperClassValue, String wrapperIdValue, String wrapperTitleValue, String wrapperAriaLabelValue) Build wrapper div HTML for component output.getAppOptions(ComponentRequest componentRequest, jakarta.servlet.http.HttpServletRequest request) Returns list of options for app editor in webpagegetBaseAppOptions(jakarta.servlet.http.HttpServletRequest request) Returns base options for common fields (e.g.voidinit()Initialization method for custom component initialization Called every time a component is inserted into the pagevoidinit(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Initialization method for custom component initialization Called every time a component is inserted into the pagevoidinitAppEditor(ComponentRequest componentRequest, jakarta.servlet.http.HttpServletRequest request) Initialization method for app editor in webpagebooleanisEditorPreview(jakarta.servlet.http.HttpServletRequest request) Check if component is in editor preview mode (e.g.parseOptionsFromConfig(jakarta.servlet.http.HttpServletRequest request, String config) Parses a comma-separated string of translation-key:value or just value into a list of OptionDto.voidsetAppHideFields(String appHideFields) voidsetCacheMinutes(Integer cacheMinutes) voidvoidsetShowForLoggedUser(String showForLoggedUser) voidsetViewFolder(String viewFolder) voidsetWrapperAriaLabel(String wrapperAriaLabel) voidsetWrapperClass(String wrapperClass) voidsetWrapperId(String wrapperId) voidsetWrapperTitle(String wrapperTitle)
-
Field Details
-
EMPTY_PAGE
- See Also:
-
device
DEFAULT commonSettings TAB -
showForLoggedUser
-
cacheMinutes
-
appHideFields
-
wrapperClass
-
wrapperId
-
wrapperTitle
-
wrapperAriaLabel
-
-
Constructor Details
-
WebjetComponentAbstract
public WebjetComponentAbstract()
-
-
Method Details
-
init
public void init()Initialization method for custom component initialization Called every time a component is inserted into the page- Specified by:
initin interfaceWebjetComponentInterface
-
init
public void init(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Initialization method for custom component initialization Called every time a component is inserted into the page- Specified by:
initin interfaceWebjetComponentInterface
-
getAppOptions
public Map<String,List<OptionDto>> getAppOptions(ComponentRequest componentRequest, jakarta.servlet.http.HttpServletRequest request) Returns list of options for app editor in webpage- Specified by:
getAppOptionsin interfaceWebjetComponentInterface
-
getBaseAppOptions
public Map<String,List<OptionDto>> getBaseAppOptions(jakarta.servlet.http.HttpServletRequest request) Returns base options for common fields (e.g. wrapperClass) from configuration. These are merged with subclass-specific options in ComponentsService. Supports format: "label:value" or just "value". Label can be a translation key. -
parseOptionsFromConfig
protected List<OptionDto> parseOptionsFromConfig(jakarta.servlet.http.HttpServletRequest request, String config) Parses a comma-separated string of translation-key:value or just value into a list of OptionDto.- Parameters:
request- The request to retrieve translation properties.config- The configuration string to parse.- Returns:
- A list of parsed OptionDto.
-
buildWrapperDiv
public static String[] buildWrapperDiv(String wrapperClassValue, String wrapperIdValue, String wrapperTitleValue, String wrapperAriaLabelValue) Build wrapper div HTML for component output. Returns null if no wrapper attributes are set.- Parameters:
wrapperClassValue- - wrapper CSS class value (+ separated)wrapperIdValue- - wrapper id valuewrapperTitleValue- - wrapper title valuewrapperAriaLabelValue- - wrapper aria-label value- Returns:
- String array with [0] = opening tag, [1] = closing tag, or null if no wrapper needed
-
initAppEditor
public void initAppEditor(ComponentRequest componentRequest, jakarta.servlet.http.HttpServletRequest request) Initialization method for app editor in webpage- Specified by:
initAppEditorin interfaceWebjetComponentInterface
-
addCurrentValueToOptions
Verify, that value is in options, if not, add it- Parameters:
options-value-
-
addCurrentValueToOptions
Verify, that values are in options, if not, add it- Parameters:
options-values-- Returns:
-
addOptions
public List<OptionDto> addOptions(List options, String labelProperty, String valueProperty, boolean includeOriginalObject) Add options from list type id:label, id will be converted to string and used as value for option. Use in getAppOptions method like: Map<String, List<OptionDto>> options = new HashMap<>(); options.put("groups", addOptions(MediaDB.getGroups(), "mediaGroupName", "mediaGroupId", false)); return options;- Parameters:
options- - list of objectslabelProperty- - name of label property in options listvalueProperty- - name of value property in options listincludeOriginalObject- - if true, original object will be added to OptionDto- Returns:
-
isEditorPreview
public boolean isEditorPreview(jakarta.servlet.http.HttpServletRequest request) Check if component is in editor preview mode (e.g. in page editor)- Parameters:
request-- Returns:
- - true if in editor preview mode, false otherwise
-
getViewFolder
- Specified by:
getViewFolderin interfaceWebjetComponentInterface
-
setViewFolder
-
getDevice
-
setDevice
-
getCacheMinutes
-
setCacheMinutes
-
getShowForLoggedUser
-
setShowForLoggedUser
-
getAppHideFields
-
setAppHideFields
-
getWrapperClass
-
setWrapperClass
-
getWrapperId
-
setWrapperId
-
getWrapperTitle
-
setWrapperTitle
-
getWrapperAriaLabel
-
setWrapperAriaLabel
-