Table of Contents |
---|
Usages
Thai |
---|
ตามธรรมเนียม |
Used for providing a different look and feel for a Userview. Please refer to Userview Theme.
Thai ใช้สำหรับมอบรูปลักษณ์และความรู้สึกที่แตกต่างสำหรับ Userview โปรดอ้างอิงถึง Userview Theme
English A useable Userview Theme plugin must extends org.joget.apps.userview.model.UserviewV5Theme or org.joget.apps.userview.model.UserviewTheme abstract class. Thai ปลั๊กอินธีม Userview Theme ที่ใช้งานได้ต้องขยาย org.joget.apps.userview.model.UserviewV5Theme หรือ org.joget.apps.userview.model.UserviewTheme ระดับนามธรรม
Since version 5.0, It is encourage to use org.joget.apps.userview.model.UserviewV5Theme instead of org.joget.apps.userview.model.UserviewTheme abstract class for Userview Theme plugin
Thai ตั้งแต่รุ่น 5.0 ขอแนะนำให้ใช้ org.joget.apps.userview.model.UserviewV5Theme แทน org.joget.apps.userview.model.UserviewTheme คลาสนามธรรมสำหรับปลั๊กอินธีม Userview
development as the new theme provided more flexibility to control how you want your theme to display to user.
Thai การพัฒนาเป็นชุดรูปแบบใหม่ที่ให้ความยืดหยุ่นมากขึ้นในการควบคุมวิธีที่คุณต้องการให้ชุดรูปแบบของคุณแสดงต่อผู้ใช้
Abstract Class
Thai |
---|
ชั้นนามธรรม |
org.joget.apps.userview.model.UserviewV5Theme
Under wflow-core module
Thai ภายใต้โมดูล wflow-core Extended org.joget.plugin.base.ExtDefaultPlugin. Please refer to Plugin Base Abstract Class and Interface.
Thai ขยาย org.joget.plugin.base.ExtDefaultPlugin โปรดอ้างอิงถึง Plugin Base Abstract Class and Interface
Implemented org.joget.plugin.property.model.PropertyEditable. Please refer to Plugin Base Abstract Class and Interface.
Thai ดำเนินการ org.joget.plugin.property.model.PropertyEditable โปรดอ้างอิงถึง Plugin Base Abstract Class and Interface.
A base abstract class to develop a Userview Theme plugin for version v5.0 onward.
Thai คลาส abstract พื้นฐานเพื่อพัฒนาปลั๊กอินธีม Userview สำหรับเวอร์ชัน v5.0 เป็นต้นไป
Please refer to V5 Predefined Theme Template on template options.
Thai โปรดอ้างอิง V5 Predefined Theme Template บนตัวเลือกเทมเพลต
Only need to override the function accordingly to change part of the display.
Thai จำเป็นต้องแทนที่ฟังก์ชั่นตามลำดับเพื่อเปลี่ยนส่วนของจอแสดงผล
Method Detail
Thai |
---|
รายละเอียดวิธีการ |
Overridable Methods
Thai |
---|
วิธีการ overridable |
handleContentError
public java.lang.String handleContentError(java.lang.Exception e, java.util.Map<java.lang.String, java.lang.Object> data)
HTML template to handle error when retrieving userview content.
Thai |
---|
เทมเพลต HTML เพื่อจัดการข้อผิดพลาดเมื่อดึงเนื้อหา userview |
handlePageNotFound
public java.lang.String handlePageNotFound(java.util.Map<java.lang.String, java.lang.Object> data)
HTML template to handle page not found. Default using /templates/userview/pageNotFound.ftl as template.
getLayout
Thai |
---|
ไม่พบเทมเพลต HTML สำหรับจัดการหน้า ค่าเริ่มต้นโดยใช้ /templates/userview/pageNotFound.ftl เป็นเทมเพลต |
getLayout
public java.langpublic java.lang.String getLayout(java.util.Map<java.lang.String, java.lang.Object> data)
HTML template to handle theme layout. Default using /templates/userview/layout.ftl as template.
Thai |
---|
เทมเพลต HTML เพื่อจัดการโครงร่างธีม ค่าเริ่มต้นโดยใช้ /templates/userview/layout.ftl เป็นแม่แบบ |
getHeader
public java.lang.String getHeader(java.util.Map<java.lang.String, java.lang.Object> data)
HTML template to handle page header. Default using /templates/userview/header.ftl as template.
Thai |
---|
เทมเพลต HTML เพื่อจัดการส่วนหัวของหน้า ค่าเริ่มต้นโดยใช้ /templates/userview/header.ftl เป็นแม่แบบ |
getFooter
public java.lang.String getFooter(java.util.Map<java.lang.String, java.lang.Object> data)
HTML template to handle page footer. Default using /templates/userview/footer.ftl as template.
Thai |
---|
เทมเพลต HTML เพื่อจัดการส่วนท้ายของหน้า ค่าเริ่มต้นโดยใช้ /templates/userview/footer.ftl เป็นแม่แบบ |
getContentContainer
public java.lang.String getContentContainer(java.util.Map<java.lang.String, java.lang.Object> data)
HTML template to handle userview menu content. Default using /templates/userview/contentContainer.ftl as template.
Thai |
---|
เทมเพลต HTML เพื่อจัดการเนื้อหาเมนู userview ค่าเริ่มต้นโดยใช้ /templates/userview/contentContainer.ftl เป็นเทมเพลต |
getMenus
public java.lang.String getMenus(java.util.Map<java.lang.String, java.lang.Object> data)
HTML template to handle menus. Default using /templates/userview/menus.ftl as template.
getJsCssLib
Thai |
---|
เทมเพลต HTML เพื่อจัดการเมนู ค่าเริ่มต้นโดยใช้ /templates/userview/menus.ftl เป็นแม่แบบ |
getJsCssLib
public java.lang.public java.lang.String getJsCssLib(java.util.Map<java.lang.String, java.lang.Object> data)
HTML template for putting javascript and css link for getHead() template.
Thai |
---|
เทมเพลต HTML สำหรับวาง javascript และลิงค์ css สำหรับแม่แบบ getHead () |
getCss
public java.lang.String getCss(java.util.Map<java.lang.String, java.lang.Object> data)
Gets dynamic generated CSS for getHead() template
Thai |
---|
รับ CSS สร้างขึ้นแบบไดนามิกสำหรับแม่แบบ getHead () |
getJs
public java.lang.String getJs(java.util.Map<java.lang.String, java.lang.Object> data)
Gets dynamic generated javascript for getHead() template
Thai |
---|
รับจาวาสคริปต์ที่สร้างขึ้นแบบไดนามิกสำหรับแม่แบบ getHead () |
getMetas
public java.lang.String getMetas(java.util.Map<java.lang.String, java.lang.Object> data)
Gets dynamic generated meta data for getHead() template
Thai |
---|
รับข้อมูลเมตาที่สร้างแบบไดนามิกสำหรับเทมเพลต getHead () |
getHead
public java.lang.String getHead(java.util.Map<java.lang.String, java.lang.Object> data)
HTML template to handle for <head> tag. Default using /templates/userview/head.ftl as template.
Thai |
---|
เทมเพลต HTML ที่จะจัดการกับแท็ก <head> ค่าเริ่มต้นโดยใช้ /templates/userview/head.ftl เป็นแม่แบบ |
getFavIconLink
public java.lang.String getFavIconLink(java.util.Map<java.lang.String, java.lang.Object> data)
Gets the fav icon relative path for getHead() template.
Thai |
---|
รับค่า path ไอคอน fav สำหรับเทมเพลต getHead () |
getLoginForm
public java.lang.String getLoginForm(java.util.Map<java.lang.String, java.lang.Object> data)
HTML template for login form. Default using /templates/userview/login.ftl as template.
decorateCategoryLabel
Thai |
---|
เทมเพลต HTML สำหรับแบบฟอร์มเข้าสู่ระบบ ค่าเริ่มต้นโดยใช้ /templates/userview/login.ftl เป็นแม่แบบ |
decorateCategoryLabel
public java.public java.lang.String decorateCategoryLabel(org.joget.apps.userview.model.UserviewCategory category)
HTML template for menu category label.
Thai |
---|
เทมเพลต HTML สำหรับป้ายกำกับหมวดหมู่เมนู |
Utility Methods
getUserview
...
Gets userview which using this theme
Thai |
---|
รับ userview ที่ใช้ชุดรูปแบบนี้ |
setUserview
public void setUserview(org.joget.apps.userview.model.Userview userview)
Sets userview which using this theme
Thai |
---|
ชุด userview ซึ่งใช้รูปแบบนี้ |
getRequestParameters
public java.util.Map getRequestParameters()
Gets request parameters
Thai |
---|
รับคำขอพารามิเตอร์ |
setRequestParameters
public void setRequestParameters(java.util.Map requestParameters)
Sets request parameters
Thai |
---|
ตั้งค่าคำขอพารามิเตอร์ |
getRequestParameter
public java.lang.Object getRequestParameter(java.lang.String requestParameter)
Convenience method to get a parameter value
Thai |
---|
วิธีการอำนวยความสะดวกในการรับค่าพารามิเตอร์ |
getRequestParameterString
...
Return Empty string instead of NULL.
Thai |
---|
วิธีการสะดวกในการรับพารามิเตอร์ค่าสตริง ส่งคืนสตริงที่ว่างเปล่าแทน NULL |
Deprecated Methods
getCss
public java.lang.String getCss()
Deprecated not use for UserviewV5Theme
Thai |
---|
เลิกใช้ไม่ได้สำหรับ UserviewV5 ธีม |
getJavascript
public java.lang.String getJavascript()
Deprecated not use for UserviewV5Theme
getHeader
Thai |
---|
เลิกใช้ไม่ได้สำหรับ UserviewV5 ธีม |
public
...
java.lang.String
...
getHeader()getHeader
Deprecated not use for UserviewV5Theme
Thai |
---|
เลิกใช้ไม่ได้สำหรับ UserviewV5 ธีม |
getFooter
public java.lang.String getFooter()
Deprecated not use for UserviewV5Theme
Thai |
---|
เลิกใช้ไม่ได้สำหรับ UserviewV5 ธีม |
getPageTop
public java.lang.String getPageTop()
Deprecated not use for UserviewV5Theme
Thai |
---|
เลิกใช้ไม่ได้สำหรับ UserviewV5 ธีม |
getPageBottom
public java.lang.String getPageBottom()
Deprecated not use for UserviewV5Theme
Thai |
---|
เลิกใช้ไม่ได้สำหรับ UserviewV5 ธีม |
getBeforeContent
public java.lang.String getBeforeContent()
Deprecated not use for UserviewV5ThemeUserviewV5Theme
Thai |
---|
เลิกใช้ไม่ได้สำหรับ UserviewV5 ธีม |
org.joget.apps.userview.model.UserviewTheme
Under wflow-core module
Thai ภายใต้โมดูล wflow-core
Extended org.joget.plugin.base.ExtDefaultPlugin. Please refer to Plugin Base Abstract Class and Interface.
Thai ขยาย org.joget.
...
plugin.
...
base.ExtDefaultPlugin โปรดอ้างอิงถึง Plugin Base Abstract Class and Interface
Implemented org
- Under wflow-core module
- Extended org
.joget.plugin.property.
basemodel.
ExtDefaultPluginPropertyEditable. Please refer to Plugin Base Abstract Class and Interface.
Implemented orgThai
. Please refer toดำเนินการ org.joget.plugin.property.model.PropertyEditable
โปรดอ้างอิงถึง Plugin Base Abstract Class and Interface.
A base abstract class to develop a Userview Theme plugin.
Thai คลาสนามธรรมพื้นฐานในการพัฒนาปลั๊กอินธีม Userview
Method Detail
Thai |
---|
รายละเอียดวิธีการ |
Abstract Methods
Thai |
---|
วิธีการเชิงนามธรรม |
getCss
public abstract java.lang.String getCss()
Return css to inject in <head> tag
Thai |
---|
ส่งคืน css เพื่อฉีดในแท็ก <head> |
getJavascript
public abstract java.lang.String getJavascript()
Return javascript to inject in <head> tag
Thai |
---|
ส่งคืนจาวาสคริปต์เพื่อฉีดในแท็ก <head> |
getHeader
public abstract java.lang.String getHeader()
Return HTML template to replace default header
Thai |
---|
ส่งคืนเทมเพลต HTML เพื่อแทนที่เริ่มต้นส่วนหัว |
getFooter
public abstract java.lang.String getFooter()
Return HTML template to replace default footer
Thai |
---|
ส่งคืนเทมเพลต HTML เพื่อแทนที่เริ่มต้นส่วนท้าย |
getPageTop
public abstract java.lang.String getPageTop()
Return HTML template to inject before the page container
Thai |
---|
ส่งคืนเท็มเพลต HTML เพื่อแทรกก่อนหน้าคอนเทนเนอร์ |
getPageBottom
public abstract java.lang.String getPageBottom()
Return HTML template to inject after the page container
Thai |
---|
ส่งคืนเท็มเพลต HTML เพื่อแทรกหลังจากคอนเทนเนอร์ของหน้า |
getBeforeContent
public abstract java.lang.String getBeforeContent()
Return HTML template to inject before content
Thai |
---|
ส่งคืนเทมเพลต HTML เพื่อแทรกก่อนเนื้อหา |
Utility Methods
getUserview
...
Gets userview which using this theme
Thai |
---|
รับ userview ที่ใช้ชุดรูปแบบธีมนี้ |
setUserview
public void setUserview(org.joget.apps.userview.model.Userview userview)
Sets userview which using this theme
Thai |
---|
ชุด userview ซึ่งใช้รูปแบบธีมนี้ |
getRequestParameters
public java.util.Map getRequestParameters()
Gets request parameters
Thai |
---|
รับพารามิเตอร์คำขอ |
setRequestParameters
public void setRequestParameters(java.util.Map requestParameters)
Sets request parameters
Thai |
---|
ตั้งค่าพารามิเตอร์คำขอ |
getRequestParameter
public java.lang.Object getRequestParameter(java.lang.String requestParameter)
Convenience method to get a parameter value
Thai |
---|
วิธีการอำนวยความสะดวกในการรับค่าพารามิเตอร์ |
getRequestParameterString
...
Return Empty string instead of NULL.
Thai |
---|
วิธีการความสะดวกสบายในการรับพารามิเตอร์ค่าสตริง ส่งคืนสตริงที่ว่างเปล่าแทน NULL |
V5 Predefined Theme Template
Thai |
---|
เทมเพลตธีมที่กำหนดไว้ล่วงหน้า V5 |
Predefined Variables
Thai |
---|
ตัวแปรที่กำหนดไว้ล่วงหน้า |
Predefined variable with value for template usage template.
Thai ตัวแปรที่กำหนดไว้ล่วงหน้าพร้อมค่าสำหรับเทมเพลตการใช้เทมเพลต
Name | Template | Data Type | Default Value | Description |
---|---|---|---|---|
base_link | - | java.lang.String |
Base URL of current Userview | ||
body_classes | layout.ftl | java.lang.String |
Used by system to add the following CSS classes and current locale code as CSS class to <body> tag. embeded - When userview is in embed mode. rtl - When System setting set display from right to left or language set to Arabic. | ||
body_id | layout.ftl | java.lang.String |
Use current userview menu page Id or Custom Id as <body> tag id | ||
build_number | - | java.lang.String |
Joget build number | ||||
categories_container_id | menus.ftl | java.lang.String | category-container | Id of the container which contains all menu categories |
categories_container_classes | menus.ftl | java.lang.String | nav nav-tabs nav-stacked main-menu | CSS classes of the container which contains all menu categories |
category_classes | menus.ftl | java.lang.String | category | CSS classes of menu category |
combine_single_menu_category | menus.ftl | boolean | false | Flag to display the only menu in a category to replace the category as 1st level menu. |
content | contentContainer.ftl | java.lang.String |
Main content of the current page. Content from the Userview Menu or login form. | ||
content_container | layout.ftl | java.lang.String |
Value from theme getContentContainer method | ||||
content_id | contentContainer.ftl | java.lang.String | content | Id of content container |
context_path | login.ftl | java.lang.String |
Context Path of the Joget Server URL | ||
css | head.ftl | java.lang.String |
Value from theme getCss method | ||||
current_category_classes | menus.ftl | java.lang.String | current-category active | Extra CSS classes for current menu category |
current_menu_classes | menus.ftl | java.lang.String | current active | Extra CSS classes for current menu |
embed | contentContainer.ftl | boolean |
Flag to decide whether userview is needed to display in embed mode | ||
fav_icon_link | head.ftl | java.lang.String |
Value from theme getFavIconLink method | ||||
first_category_classes | menus.ftl | java.lang.String | first | Extra CSS classes for first menu category |
first_menu_classes | menus.ftl | java.lang.String | first | Extra CSS classes for first menu in the menu category |
footer | layout.ftl | java.lang.String |
Value from theme getFooter method | ||
head | layout.ftl | java.lang.String |
Value from theme getHead method | ||
header | layout.ftl | java.lang.String |
Value from theme getHeader method | ||||
hide_nav | contentContainer.ftl | boolean | false | Flag to hide navigator |
home_page_link | pageNotFound.ftl, header.ftl | java.lang.String |
URL to the userview home page menu | ||
is_logged_in | header.ftl | boolean |
Flag to decide whether there is a logged in user | ||
is_login_page | - | boolean |
Whether or not the current page is a login form page | ||
joget_header | head.ftl | java.lang.String |
Additional HTML template injected by system to the header | ||
joget_footer | layout.ftl | java.lang.String |
Additional HTML template injected by system to the footer | ||
js | head.ftl | java.lang.String |
Value from theme getJs method | ||
js_css_lib | head.ftl | java.lang.String |
Value from theme getJsCssLib method | ||||
last_category_classes | menus.ftl | java.lang.String | last | Extra CSS classes for last menu category |
last_menu_classes | menus.ftl | java.lang.String | last | Extra CSS classes for last menu in the menu category |
locale | layout.ftl | java.lang.String |
Current language code of the system | ||||
login_error_classes | login.ftl | java.lang.String | form-errors alert alert-warning | CSS classes for login error message container |
login_exception | login.ftl | java.lang.String |
To keep exception message when a login attempt failure. | ||
login_form_after | login.ftl | java.lang.String |
Value from "Custom HTML (After Login Form)" under Userview Builder - Settings | ||
login_form_before | login.ftl | java.lang.String |
Value from "Custom HTML (Before Login Form)" under Userview Builder - Settings | ||
login_form_footer | login.ftl | java.lang.String |
HTML template retrieved from DirectoryUtil.getLoginFormFooter(). Used by User Security Implementation. | ||
login_link | header.ftl | java.lang.String |
URL to the login form | ||
logout_link | header.ftl | java.lang.String |
URL to log out from userview | ||||
main_container_id | contentContainer.ftl | java.lang.String | main | CSS classes for the main container |
menus | contentContainer.ftl |
Value from theme getMenus method | ||||
menu_classes | menus.ftl | java.lang.String | menu | CSS classes for the menu |
menus_container_classes | menus.ftl | java.lang.String | menu-container | CSS classes for the container which contains menus |
metas | head.ftl | java.lang.String |
Value from theme getMetas method | ||||
nav_id | menus.ftl | java.lang.String | navigation | Id of the navigator container |
nav_classes | menus.ftl | java.lang.String | nav-collapse sidebar-nav | CSS classes of the navigator container |
params | - | java.util.Map<java.lang.String, java.lang.Object> |
Received Request Parameters | ||
title | head.ftl | java.lang.String |
Userview name and the current menu label | ||
right_to_left | - | boolean |
Flag to decide whether or not userview need to display from right to left | ||||
sidebar_id | contentContainer.ftl | java.lang.String | sidebar | Id of the sidebar container |
user | - | org.joget.directory.model.User |
Current logged in User object | ||
username | - | java.lang.String |
Current logged in username | ||
userview | header.ftl, footer.ftl, menus.ftl, login.ftl | org.joget.apps.userview.model.Userview |
Userview object which using this theme |
Templates
Thai |
---|
แบบ |
All these template are used by org.joget.apps.userview.model.UserviewV5Theme abstract class.
Thai เทมเพลตเหล่านี้ทั้งหมดใช้โดย org.joget.apps.userview.model.UserviewV5Theme ธีมนามธรรม
Override the abstract class method to set different value for the variables used in template.
Thai แทนที่เมธอดคลาส abstract เพื่อตั้งค่าต่างกันสำหรับตัวแปรที่ใช้ในเทมเพลต
All templates are constructed using FreeMaker syntax.
Thai แม่แบบทั้งหมดสร้างขึ้นโดยใช้ไวยากรณ์ FreeMaker
/templates/userview/pageNotFound.ftl
...
How to use and override V5 template
Thai |
---|
วิธีใช้และแทนที่เทมเพลต V5 |
Reuse the predefined template
Thai |
---|
ใช้แม่แบบที่กำหนดไว้ล่วงหน้าอีกครั้ง |
To reuse the predefined template, just override the theme method and set your custom HTML to the available variable of the template.
Thai หากต้องการใช้แม่แบบที่กำหนดไว้ล่วงหน้าอีกครั้งให้แทนที่วิธีชุดรูปแบบและตั้งค่า HTML ที่กำหนดเองของคุณเป็นตัวแปรที่มีอยู่ของแม่แบบ
Example: To reuse the header.ftl template in getHeader method.
Thai ตัวอย่าง: เมื่อต้องการใช้เท็มเพลต header.ftl อีกครั้งในเมธอด getHeader
Code Block | ||
---|---|---|
| ||
@Override public String getHeader(Map<String, Object> data) { data.put("header_classes", "navbar"); data.put("header_inner_before", "<div class=\"navbar-inner\"><div class=\"container-fluid\">"); data.put("header_inner_after", "</div></div>"); data.put("header_info_after", "<a id=\"mobile_menu\" class=\"btn btn-navbar\"><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span></a>"); data.put("header_link_classes", "brand"); data.put("header_info_classes", "inline-block"); data.put("header_name_classes", "inline-block"); data.put("header_description_classes", "inline-block visible-desktop"); data.put("header_description_span_classes", "brand"); return super.getHeader(data); } |
Override or replace the predefined templatepredefined template
Thai |
---|
แทนที่หรือแทนที่แม่แบบที่กำหนดไว้ล่วงหน้า |
To override or replace the predefined template, you just need to create your own template using FreeMaker syntax.
Thai เพื่อแทนที่หรือแทนที่แม่แบบที่กำหนดไว้ล่วงหน้าคุณเพียงแค่ต้องสร้างแม่แบบของคุณเองโดยใช้ไวยากรณ์ FreeMaker
Example: Using a custom template file in getHeader method.
Thai ตัวอย่าง: การใช้ไฟล์เท็มเพลตที่กำหนดเองในวิธี getHeader
Code Block | ||
---|---|---|
| ||
@Override public String getHeader(Map<String, Object> data) { return UserviewUtil.getTemplate(this, data, "/templates/userview/customHeader.ftl"); } |
Plugin Properties Options
Thai |
---|
ตัวเลือกคุณสมบัติปลั๊กอิน |
Please refer to Plugin Properties Options for more information.
Thai โปรดดู Plugin Properties Options สำหรับข้อมูลเพิ่มเติม
Tutorials
Thai |
---|
สอน |
Related Community Plugins
Thai |
---|
ปลั๊กอินที่เกี่ยวข้อง |
Corporati Theme
Thai ธีม Corporati
org.joget.plugin.enterprise.CorporatiTheme (wflow-core)V3 Default Theme
Thai ธีม V3 Default
org.joget.apps.userview.lib.DefaultTheme (wflow-core)- V6 Universal Theme
org.joget.plugin.enterprise.UniversalTheme (wflow-core) - DX Progressive Theme
org.joget.plugin.enterprise.ProgressiveTheme (wflow-core)