Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Usages

...

用法

抽象类

org.joget.apps.userview.model.UserviewMenu

Field Detail

...

字段细节

常量
REDIRECT_URL_PROPERTY
public static final java.lang.String REDIRECT_URL_PROPERTY = "userviewRedirectUrl"“userviewRedirectUrl”;

Property key to set a url for redirection.属性键设置重定向的URL。

REDIRECT_PARENT_PROPERTY
public static final java.lang.String REDIRECT_PARENT_PROPERTY = "userviewRedirectParent";“userviewRedirectParent”;

属性键将重定向目标设置为父窗口。期望“真”或“假”作为值。Property key to set the redirection target to parent window. The property expecting "true" or "false" as value.

ALERT_MESSAGE_PROPERTY
public static final java.lang.String ALERT_MESSAGE_PROPERTY = "userviewAlertMessage";

Property key to set a alert message to show when a page loaded.

Method Detail

...

“userviewAlertMessage”;

属性键设置一个警告消息,显示何时加载页面。

方法细节

抽象方法
getCategory
public abstract java.lang.String getCategory()

Category to be displayed in Userview Builder palette 在UserView Builder调色板中显示的类别 

getIcon
public abstract java.lang.String getIcon()

Icon path to be displayed in Userview Builder palette图标路径将显示在UserView Builder调色板中

getRenderPage
public abstract java.lang.String getRenderPage()

Get render HTML template for UI获取用于UI的呈现HTML模板

isHomePageSupported
public abstract boolean isHomePageSupported公共抽象布尔isHomePageSupported()

Used to determine this menu item can used as home page or not.用于确定此菜单项是否可用作主页。

getDecoratedMenu
public abstract java.lang.String getDecoratedMenu()

Get Decorated menu HTML for rendering.

...

获取用于渲染的装饰菜单HTML。

可重写的方法
getMenu
public java.lang.String getMenu()

Get menu html for rendering. It will call getDecoratedMenu method to retrieve the menu HTML. If empty value is return, a default menu HTML will be generated based on getURL method and "label" property.获取用于渲染的菜单html。它将调用  getDecoratedMenu方法来检索菜单HTML。如果返回空值,则会根据getURL方法和“label”属性生成默认菜单HTML。

getJspPage
public java.lang.String getJspPage()

Get path of JSP file to render the HTML template. If this value is not NULL, value returned by getRenderPage will be ignored.

It is used to use the system predefined template for rendering. Options are as following:

获取JSP文件的路径来呈现HTML模板。如果这个值不是NULL,则getRenderPage返回的值  将被忽略。

它用于使用系统预定义的模板进行渲染。选项如下:

- userview - userview / plugin / datalist.jsp

-  userviewuserview / plugin / form.jsp

-  userviewuserview / plugin / runProcess.jsp

-  userviewuserview / plugin / unauthorized.jsp

...

效用方法
getUrl
getURL
public java.lang.String getUrl()

Gets URL of this menu获取此菜单的URL

setUrl
public void setUrl(java.lang.String url)

Sets URL of this menu设置此菜单的URL

getKey
public java.lang.String getKey()

Gets userview key of this menu

setKey

获取此菜单的userview键

setkey
public void setKey(java.lang.String key)

Sets userview key of this menu设置此菜单的用户视图键

getRequestParameters
public java.util.Map getRequestParameters()

Gets request parameters获取请求参数

setRequestParameters
public void setRequestParameters(java.util.Map requestParameters)

Sets request parameters设置请求参数

getRequestParameter
public java.lang.Object getRequestParameter(java.lang.String requestParameter)

Convenience method to get a parameter value便捷方法获取参数值

getRequestParameterString
public java.lang.String getRequestParameterString(java.lang.String requestParameter)

Convenience method to get a parameter String value.

便捷方法获取参数字符串值。

返回  空字符串而不是NULL。Return Empty string instead of NULL.

getReadyJspPage
public java.lang.String getReadyJspPage()

Used by the system to retrieve the JSP file page to avoid the logic to run again. It will called the getJspPage method once to initial the value.系统用于检索JSP文件页面以避免逻辑再次运行。它将调用一次getJspPage方法来初始化值。

getReadyRenderPage
public java.lang.String getReadyRenderPage()

Used by the system to retrieve the HTML template to avoid the logic to run again. It will called the getRenderPage method once to initial the value.系统用来检索HTML模板,以避免逻辑再次运行。它将调用一次getRenderPage方法来初始化值。

getUserview
public org.joget.apps.userview.model.Userview getUserview()

Gets the userview which this menu is belongs to.获取该菜单所属的用户视图。

setUserview
public void setUserview(org.joget.apps.userview.model.Userview userview)

Sets the userview which this menu is belongs to.设置此菜单所属的用户视图。

setRedirectUrl
public void setRedirectUrl(java.lang.String redirectUrl)

Set this property to force the userview to redirect to a specific URL.设置此属性强制用户视图重定向到一个特定的URL。

setRedirectUrl
public void setRedirectUrl(java.lang.String redirectUrl, booleanredirectUrl,boolean redirectToParent)

Set this property to force the userview to redirect to a specific URL with option to redirect in the parent window.将此属性设置为强制用户视图重定向到特定的URL,并在父窗口中选择重定向。

setAlertMessage
public void setAlertMessage(java.lang.String message)

Set this property to display an alert message/prompt.

Plugin Properties Options

Mandatory Property

id

  • All Userview Menu Plugin must has this property appear in the Properties Options JSON. 
  • This is used by the system to store the dynamic generated UUID.

设置此属性以显示警报消息/提示。

插件属性选项

强制性财产

ID

  • 所有的UserView菜单插件都必须在属性选项JSON中显示此属性。 
  • 系统使用它来存储动态生成的UUID。
Code Block
 {
Code Block
    {
        name : 'id',
        label : 'ID',
        type : 'hidden'
    }

customId

自定义id

  • 所有的UserView菜单插件都必须在属性选项JSON中显示此属性。 
  • 这用于管理员用户键入所需的菜单ID。
  • All Userview Menu Plugin must has this property appear in the Properties Options JSON. 
  • This is used for admin user to key in a desired menu id.
Code Block
    {
        name : 'customId',
        label : '@@userview.datalistmenu.customId@@',
        type : 'textfield',
        regex_validation : '^[a-zA-Z0-9_]+$',
        validation_message : '@@userview.datalistmenu.invalidId@@'
    }

label

标签

  • 所有的UserView菜单插件都必须在属性选项JSON中显示此属性。 
  • 这用于管理员用户键入菜单的显示标签。
  • All Userview Menu Plugin must has this property appear in the Properties Options JSON. 
  • This is used for admin user to key in a display label for the menu.
Code Block
    {
        name : 'label',
        label : '@@userview.datalistmenu.label@@',
        type : 'textfield',
        required : 'True',
        value : 'List'
    }

Userview Menu Plugin Template Sample

Userview菜单插件模板示例

以下是HTML页面菜单  元素的示例菜单模板  它使用  FreeMaker  语法构造。这个模板将被getRenderPage  方法使用并返回    Following is a sample menu template of a HTML Page menu element. It is constructed using FreeMaker syntax. This template will be used and returned by Userview Menu Plugin method.

Code Block
languagejava
    public String getRenderPage() {
        PluginManager pluginManager = (PluginManager) AppUtil.getApplicationContext().getBean("pluginManager");
 
        Map dataModel = new HashMap();
        dataModel.put("element", this);
    
        return pluginManager.getPluginFreeMarkerTemplate(dataModel, getClassName(), "/templates/htmlPageMenu.ftl", null);
    }
Code Block
languagexml
<div class="ui-html">
    ${element.properties.content!}
</div>

Explanations

说明

    • 没有指定的格式需要遵循。
    • 请注意,您的html模板需要在预览模式下禁用所有用户操作。您可以通过以下代码决定是否为预览模式:
    • There are no specify format need to follow.
    • Please take note that your html template need to disable all user action when it is in preview mode. You decide it is preview mode or not by following code:
"true".equals(getRequestParameterString("isPreview")

...

教程

Related Community Plugins

相关的社区插件

  • 列表菜单List Menu
    org.joget.apps.userview.lib.DataListMenu(wflow-core)Form Menu
  • 表单菜单
    org.joget.apps.userview.lib.FormMenu FormMenu(wflow-core)
  • HTML页面HTML Page
    org.joget.apps.userview.lib.HtmlPage HtmlPage(wflow-core)
  • 收件箱Inbox
    org.joget.apps.userview.lib.InboxMenu InboxMenu(wflow-core)
  • 链接Link
    org.joget.apps.userview.lib.Link Link(wflow-core)
  • 运行进程Run Process
    org.joget.apps.userview.lib.RunProcess RunProcess(wflow-core)