Как настроить атрибут для редактирования с помощью редактора RichTextBox в SmartEdit? - PullRequest
0 голосов
/ 25 октября 2018

Я заметил, что атрибут CMSParagraphComponent content можно редактировать с помощью RichTextBox, как показано на изображении ниже: enter image description here

Я хочу отредактировать свой пользовательский атрибут таким же образом (с изображенным RichTextBox).Как я могу это сделать?

Я попытался настроить backoffice-config.xml для использования wysiwyg:

<context merge-by="type" type="MyType" component="editor-area" module="moduleBackoffice">
    <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
        <editorArea:tab merge-mode="replace" name="hmc.properties">
            <editorArea:section  name="hmc.properties">
                <editorArea:attribute
                        editor="com.hybris.cockpitng.editor.localized(com.hybris.cockpitng.editor.wysiwyg)"
                        qualifier="customStringAttribute"/>
            </editorArea:section>
        </editorArea:tab>
    </editorArea:editorArea>
</context>

Но это толькоотражается в backoffice и не влияет на SmartEdit.

Как я могу использовать RichTextBox в smartEdit?

Версия Hybris: 6.7.0.3

1 Ответ

0 голосов
/ 26 октября 2018

Эту проблему можно решить путем создания ниже Spring bean:

<bean class="de.hybris.platform.cmsfacades.types.service.impl.DefaultComponentTypeAttributeStructure" p:typecode="MyType" p:qualifier="customStringAttribute">
    <property name="populators">
        <set>
            <ref bean="richTextComponentTypeAttributePopulator" />
            <ref bean="requiredComponentTypeAttributePopulator" />
        </set>
    </property>
</bean>

Я добавил выше определенный bean в мой $ {extensionname} -spring.xml ,перезапустил сервер и все заработало как положено. MyType customStringAttribute теперь настраивается из smartedit точно так же, как CMSParagraphComponent content is.

...