Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rename macro 'n' to 'mgnl-n'.

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名
Mgnl f
server
 

Mgnl f
modules

 

Mgnl f
tutorial-products

 

mgnl-p
version

1.0.0

配置应用

/modules/tutorial-products下,创建一个基本的应用配置:

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
modules

 

Mgnl f
tutorial-products

 

Mgnl f
apps

 

Mgnl n
products

 

mgnl-p
appClass

info.magnolia.ui.contentapp.ContentApp

mgnl-p
class

info.magnolia.ui.api.app.registry.ConfiguredAppDescriptor

mgnl-p
icon

icon-items

mgnl-p
label

Products

将应用添加到启动器中

  1. 打开/modules/ui-admincentral/config/appLauncherLayout/groups/edit/apps
  2. 创建一个products内容节点。这将会在应用启动器中添加一个新的板块。
Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
ui-admincentral

Mgnl f
config

Mgnl n
appLauncherLayout

Mgnl n
groups

Mgnl n
edit

Mgnl n
apps

Mgnl n

apps

pages

Mgnl n
assets

Mgnl n
contacts

Mgnl n
categories

Mgnl n
products

打开应用启动器,验证您是否能看到Products应用图标。如需重启启动器,打开http://localhost:8080/magnoliaAuthor/.magnolia/admincentral?restartApplication网页。

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
modules

 

Mgnl f
tutorial-products

 

Mgnl f
apps

 

Mgnl n
products

 

Mgnl n
subApps

 

Mgnl n
browser

 

mgnl-p
class

info.magnolia.ui.contentapp.browser.BrowserSubAppDescriptor

mgnl-p
subAppClass

info.magnolia.ui.contentapp.browser.BrowserSubApp

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
browser

 

Mgnl n
workbench

 

Mgnl n
nodeTypes

 

Mgnl n
product

 

mgnl-p
icon

icon-items

mgnl-p
name

mgnl:product 

Mgnl n
folder

 

mgnl-p
icon

icon-folder

mgnl-p
name

mgnl:folder

mgnl-p
defaultOrder

jcrName

mgnl-p
dropConstraintClass

info.magnolia.ui.workbench.tree.drop.AlwaysTrueDropConstraint

mgnl-p
editable

false

mgnl-p
includeProperties

false

mgnl-p
path

/

mgnl-p
workspace

products

配置树型视图

workbench里,创建一个树型视图,并定义它的列:

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名
Mgnl n
workbench
 

Mgnl n
contentViews

 

Mgnl n
tree

 

Mgnl n
columns

 

Mgnl n
jcrName

 

mgnl-p
class

info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition

mgnl-p
editable

true

mgnl-p
label

Product name

mgnl-p
propertyName

jcrName

mgnl-p
sortable

true

Mgnl n
status

 

mgnl-p
class

info.magnolia.ui.workbench.column.definition.StatusColumnDefinition

mgnl-p
displayInChooseDialog

false

mgnl-p
formatterClass

info.magnolia.ui.workbench.column.StatusColumnFormatter

mgnl-p
label

Status

mgnl-p
width

45

Mgnl n
moddate

 

mgnl-p
class

info.magnolia.ui.workbench.column.definition.MetaDataColumnDefinition

mgnl-p
displayInChooseDialog

false

mgnl-p
formatterClass

info.magnolia.ui.workbench.column.DateColumnFormatter

mgnl-p
label

Modification date

mgnl-p
propertyName

mgnl:lastModified

mgnl-p
sortable

true

mgnl-p
width

160

mgnl-p
class

info.magnolia.ui.workbench.tree.TreePresenterDefinition

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名
Mgnl n
browser
 

Mgnl n
actions

 

Mgnl n
addFolder

 

Mgnl n
availability

 

mgnl-p
root

true

mgnl-p
class

info.magnolia.ui.framework.action.AddFolderActionDefinition

mgnl-p
icon

icon-add-item

mgnl-p
label

New folder

Mgnl n
editFolder

 

mgnl-p
class

info.magnolia.ui.framework.action.OpenEditDialogActionDefinition

mgnl-p
dialogName

ui-framework:folder

mgnl-p
icon

icon-edit

mgnl-p
label

Rename folder

Mgnl n
deleteFolder

 

mgnl-p
class

info.magnolia.ui.framework.action.DeleteItemActionDefinition

mgnl-p
icon

icon-delete

mgnl-p
label

Delete folder

创建动作栏

browser子应用里,创建一个动作栏,并将文件夹动作添加进去。

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
browser

 

Mgnl n
actionbar

 

Mgnl n
sections

 

Mgnl n
root

 

Mgnl n
groups

 

Mgnl n
addActions

 

Mgnl n
items

 

Mgnl n
addFolder

 

Mgnl n
availability

 

mgnl-p
nodes

false

mgnl-p
root

true

mgnl-p
label

Products

Mgnl n
folder

 

Mgnl n
groups

 

Mgnl n
addActions

 

Mgnl n
items

 

Mgnl n
addFolder

 

Mgnl n
editActions

 

Mgnl n
items

 

Mgnl n
editFolder

 

Mgnl n
deleteFolder

 

Mgnl n
availability

 

Mgnl n
nodeTypes

 

mgnl-p
mgnl-folder

mgnl:folder

mgnl-p
label

Folder

启动Products应用,验证您是否能够创建、编辑和删除文件夹。

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
browser

 

Mgnl n
actions

 

Mgnl n
addFolder

 

Mgnl n
editFolder

 

Mgnl n
deleteFolder

 

Mgnl n
addProduct

 

Mgnl n
availability

 

Mgnl n
nodeTypes

 

mgnl-p
folder

mgnl:folder

mgnl-p
root

true

mgnl-p
appName

products 

mgnl-p
class

info.magnolia.ui.contentapp.detail.action.CreateItemActionDefinition

mgnl-p
icon

icon-add-item

mgnl-p
label

New product

mgnl-p
nodeType

mgnl:product

mgnl-p
subAppId

detail

Mgnl n
editProduct

 

mgnl-p
appName

products

mgnl-p
class

info.magnolia.ui.contentapp.detail.action.EditItemActionDefinition

mgnl-p
icon

icon-edit

mgnl-p
label

Edit product

mgnl-p
nodeType

mgnl:product

mgnl-p
subAppId

detail

Mgnl n
deleteProduct

 

mgnl-p
class

info.magnolia.ui.framework.action.DeleteItemActionDefinition

mgnl-p
icon

icon-delete

mgnl-p
label

Delete product

将产品动作添加到动作栏

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
browser

 

Mgnl n
actionbar

 

Mgnl n
sections

 

Mgnl n
root

 

Mgnl n
groups

 

Mgnl n
addActions

 

Mgnl n
items

 

Mgnl n
addFolder

 

Mgnl n
addProduct

 

Mgnl n
availability

 

mgnl-p
nodes

false

mgnl-p
root

true

mgnl-p
label

Products

Mgnl n
folder

 

Mgnl n
groups

 

Mgnl n
addActions

 

Mgnl n
items

 

Mgnl n
addFolder

 

Mgnl n
addProduct

 

Mgnl n
editActions

 

Mgnl n
items

 

Mgnl n
editFolder

 

Mgnl n
deleteFolder

 

Mgnl n
availability

 

Mgnl n
nodeTypes

 

mgnl-p
mgnl-folder

mgnl:folder

mgnl-p
label

Folder

Mgnl n
product

 

Mgnl n

 

groups

 

Mgnl n
editActions

 

Mgnl n
items

 

Mgnl n
editProduct

 

Mgnl n
deleteProduct

 

Mgnl n
availability

 

Mgnl n
nodeTypes

 

mgnl-p
mgnl-product

mgnl:prodcut

mgnl-p
label

Product

mgnl-p
defaultAction

editProduct

配置detail子应用

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
subApps

 

Mgnl n
detail

 

mgnl-p
class

 info.magnolia.ui.contentapp.detail.DetailSubAppDescriptor

mgnl-p
subAppClass

 info.magnolia.ui.contentapp.detail.DetailSubApp

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
detail

 

Mgnl n
editor

 

Mgnl n
nodeType

 

mgnl-p
icon

icon-items

mgnl-p
name

mgnl:product

mgnl-p
workspace

products

配置表单

您的应用可以创建和编辑任何内容,所以内容决定了您在表单里需要的字段。本教程中,产品为古董车,所以我们创建了一个表单,包含以下三个字段内容:产品名,照片,以及照片评分。

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse

节点名

Mgnl n
editor

 

Mgnl n
form

 

Mgnl n
tabs

 

Mgnl n
product

 

Mgnl n
fields

 

Mgnl n
name

 

mgnl-p
class

info.magnolia.ui.form.field.definition.TextFieldDefinition

mgnl-p
label

Product name

mgnl-p
name

jcrName

Mgnl n
fileUpload

 

mgnl-p
allowedMimeTypePattern

image.*

mgnl-p
binaryNodeName

photo

mgnl-p
class

info.magnolia.dam.asset.field.definition.DamUploadFieldDefinition

mgnl-p
label

Photo

Mgnl n
photoCredit

 

mgnl-p
class

info.magnolia.ui.form.field.definition.TextFieldDefinition

mgnl-p
description

Please define a photo credit

mgnl-p
label

Photo credit

mgnl-p
label

Product

mgnl-p
description

Define the product information

mgnl-p
label

Edit product

配置保存和取消动作

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
detail

 

Mgnl n
actions

 

Mgnl n
cancel

 

mgnl-p
class

info.magnolia.ui.form.action.CancelFormActionDefinition

mgnl-p
label

Cancel

Mgnl n
save

 

mgnl-p
class

info.magnolia.ui.form.action.SaveFormActionDefinition

mgnl-p
implementationClass

info.magnolia.ui.form.action.SaveFormAction

mgnl-p
label

Save changes

在编辑器里添加保存和取消按钮

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
editor

Mgnl n
actions

Mgnl n
cancel

Mgnl n
save

测试detail子应用

创建一些项,验证您是否也能编辑已有的项。

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
browser

 

Mgnl n
imageProvider

 

mgnl-p
class

info.magnolia.ui.imageprovider.definition.ConfiguredImageProviderDefinition

mgnl-p
imageProviderClass

info.magnolia.ui.imageprovider.DefaultImageProvider

mgnl-p
originalImageNodeName

photo

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
workbench

 

Mgnl n
contentViews

 

Mgnl n
tree

 

Mgnl n
columns

 

Mgnl n
jcrName

 

mgnl-p
class

info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition

mgnl-p
editable

true

mgnl-p
label

Product name

mgnl-p
propertyName

jcrName

mgnl-p
sortable

true

mgnl-p
class

info.magnolia.ui.workbench.tree.TreePresenterDefinition

Mgnl n
list

 

Mgnl n
columns

 

mgnl-p
extends

../../tree/columns

mgnl-p
class

info.magnolia.ui.workbench.list.ListPresenterDefinition

Mgnl n
thumbnail

 

mgnl-p
class

info.magnolia.ui.workbench.thumbnail.ThumbnailPresenterDefinition

Mgnl n
search

 

Mgnl n
columns

 

mgnl-p
extends

../../tree/columns

mgnl-p
class

info.magnolia.ui.workbench.search.SearchPresenterDefinition

...