contextualcode / ezplatform-xmltext-fieldtype
eZ Platform 的 XmlText 字段类型实现
Requires
- php: ^7.3
- ext-dom: *
- ext-xsl: *
- ezsystems/ezplatform-content-forms: ^1.0
- ezsystems/ezplatform-rest: ^1.0
- ezsystems/ezplatform-richtext: ^2.0
- ezsystems/ezpublish-kernel: ^8.0
Requires (Dev)
- ezsystems/ezplatform-solr-search-engine: 3.0.x-dev
- friendsofphp/php-cs-fixer: v2.14.2
- matthiasnoback/symfony-dependency-injection-test: ^4.0
- phpunit/phpunit: ^8.4
Conflicts
- phpunit/phpunit: 8.4.0
- dev-master / 2.0.x-dev
- v2.0.0-beta1
- v1.9.1
- v1.9.0
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- 1.7.x-dev
- v1.7.3
- v1.7.2
- v1.7.1
- 1.7.0
- v1.6.2
- v1.6.1
- v1.6.0
- v1.6.0-rc1
- v1.6.0-beta1
- v1.5.1
- v1.5.0
- v1.5.0-rc1
- v1.4.0
- v1.3.0
- 1.2.x-dev
- v1.2.1
- v1.2.0
- v1.2.0-rc1
- 1.1.x-dev
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.1.0-rc1
- v1.0.0
- v1.0.0-rc1
- 1.0.0-beta2
- 1.0.0-beta1
- 0.1.0
- dev-test_tests
- dev-commands_exit_status_code
- dev-fix_commands_exit_status_code
- dev-fix-custom-align
- dev-generate_custom_tags_config
- dev-fix-nested-embeds
- dev-fix_custom_tag_align
- dev-pull-request-template
- dev-custom_attributes
- dev-use-richtext-validator
- dev-disable-inline-customtag-warning
- dev-allow-override-richtext-converter
- dev-fix_ezp29846
- dev-tmp_mastermerge
- dev-dbal
- dev-converter_cleanup
- dev-release-rc
This package is not auto-updated.
Last update: 2024-09-28 11:25:09 UTC
README
这是 eZ Platform 的 XmlText 字段类型。它是从 eZ Publish / Platform 5.x 中提取出来的,因为后来被基于 docbook 的 RichText 字段类型所取代。
注意:此字段类型支持通过平台 UI v1 / 管理员 UI v2 进行编辑,但仅作为原始(简化)XML。目前还没有尝试让旧扩展的在线编辑器在平台 UI 中工作,为此需要做很多工作,比如将来自 oe 扩展的定制 HTML 处理器移植到该字段类型。因此,此字段类型主要适用于迁移到 RichText,如下所示。
安装
注意:此包已包含 Legacy Bridge。但是,如果您想1.直接将内容迁移到 eZ Platform 以充分利用它,或者2.不使用旧版本,但需要在纯 eZ Platform 设置中使用此字段类型来处理某些旧内容,那么请运行以下命令
composer require --update-with-all-dependencies "ezsystems/ezplatform-xmltext-fieldtype"
最后,通过将 new EzSystems\EzPlatformXmlTextFieldTypeBundle\EzSystemsEzPlatformXmlTextFieldTypeBundle(),
添加到 app/AppKernel.php
的捆绑包列表中,启用捆绑包。
一旦您迁移了内容,您可以从 app/AppKernel.php
和 composer.json
中删除捆绑包。
从 XmlText 迁移到 RichText
警告:从 1.6 版本开始,现在完全支持,但无论如何,在迁移工具使用前始终进行备份。
此包提供了迁移现有 XmlText 字段到 RichText 的工具,这是 eZ Platform 使用的富文本格式。此工具是一个 Symfony 命令,ezxmltext:convert-to-richtext
。
它将执行以下两项操作
- 将
ezxmltext
字段定义转换为ezrichtext
字段定义 - 将
ezxmltext
字段(内容)转换为ezrichtext
我们建议您首先进行测试运行,例如
php bin/console ezxmltext:convert-to-richtext -v --concurrency=2 --dry-run
使用 -v
标志将日志输出到控制台,以便轻松跟踪正在进行的转换工作。以下是一个成功转换日志条目的示例
[2016-02-03 15:25:52] app.INFO: Converted ezxmltext field #745 to richtext {"original":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<section xmlns:image=\"http://ez.no/namespaces/ezpublish3/image/\" xmlns:xhtml=\"http://ez.no/namespaces/ezpublish3/xhtml/\" xmlns:custom=\"http://ez.no/namespaces/ezpublish3/custom/\"/>\n","converted":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<section xmlns=\"http://docbook.org/ns/docbook\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:ezxhtml=\"http://ez.no/xmlns/ezpublish/docbook/xhtml\" xmlns:ezcustom=\"http://ez.no/xmlns/ezpublish/docbook/custom\" version=\"5.0-variant ezpublish-1.0\"/>\n"}
它包含在 JSON 结构中,有 original
(ezxmltext)值和写入数据库的 converted
(ezrichtext)值。
准备好转换后,删除 -v
和 --dry-run
。