首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >SAP海布里不能创建自定义横幅组件

SAP海布里不能创建自定义横幅组件
EN

Stack Overflow用户
提问于 2020-05-25 02:48:56
回答 3查看 1.3K关注 0票数 2

我想要创建自定义横幅组件,从SimpleBannerComponent扩展。但是在我创建它之后,它无法在Backoffice中创建,请参见下面。

1)我将这个项目添加到我的*-items.xml文件中。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<itemtype code="PromotionBannerCMSComponent" autocreate="true" generate="true" extends="SimpleBannerComponent"
          jaloclass="my.package.core.jalo.components.PromotionBannerCMSComponent">
    <description>Promotion banner component</description>
    <deployment table="PromotionBanners" typecode="15301"/>
    <attributes>
        <attribute qualifier="code" type="java.lang.String">
            <persistence type="property"/>
            <modifiers/>
            <description>Banner name (not unique)</description>
        </attribute>
        <attribute qualifier="title" type="localized:java.lang.String">
            <description>Title</description>
            <modifiers read="true" write="true" search="true" initial="true"/>
            <persistence type="property"/>
        </attribute>
        <attribute qualifier="position" type="SimpleBannerPositionEnum">
            <description>Banner position</description>
            <modifiers optional="true" initial="true"/>
            <persistence type="property"/>
        </attribute>
        <attribute qualifier="altText" type="localized:java.lang.String">
            <description>Banner alt text</description>
            <modifiers optional="true" initial="true"/>
            <persistence type="property"/>
        </attribute>
        <attribute qualifier="titleSecondary" type="localized:java.lang.String">
            <description>Title secondary</description>
            <persistence type="property" />
            <modifiers />
        </attribute>
        <attribute qualifier="urlLoc" type="localized:java.lang.String">
            <description>Banner url</description>
            <persistence type="property" />
            <modifiers />
        </attribute>
    </attributes>
</itemtype>

2)我做了ant clean all,重新启动了服务器,我运行了HAC -> Update,我的自定义扩展检查了,Update running system也检查了。然后我又重新启动了服务器。

3)我想在Backoffice WCMS->Components->Add中创建组件,但是它失败了--我打开了flexible.search.exception.show.query.details来查看它:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
 [ConfigurableFlowController] Object  could not be saved
com.hybris.cockpitng.dataaccess.facades.object.exceptions.ObjectSavingException: Object  could not be saved

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
Caused by: de.hybris.platform.servicelayer.exceptions.ModelSavingException: [de.hybris.platform.servicelayer.interceptor.impl.UniqueAttributesInterceptor@716c1b71]: unexpected validator error: SQL search error - Unknown column 'item_t0.p_catalogversion' in 'where clause' query = 'SELECT  item_t0.PK  FROM cmscomponent item_t0 WHERE
.
.

现在,我甚至不能创建基本的SimpleBannerComponent,也不能创建其他组件。更新有什么问题吗?我用的是海布里斯1811.18。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2020-05-26 05:29:07

原来我有一个旧的部署表,它与这个组件发生了冲突,不知怎么的,它在ant clean all期间没有显示一个错误。

因此,我在HAC delete from ydeployments where typecode=XX;中运行(XX是在HAC中找到的类型代码),并以几乎相同的部署重新开始,但我删除了jaloclass和部署表描述:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<itemtype code="PromotionBannerCMSComponent" autocreate="true" generate="true" extends="SimpleBannerComponent">
    <description>Promotion banner component</description>
    <attributes>
        <attribute qualifier="code" type="java.lang.String">
            <persistence type="property"/>
            <modifiers/>
            <description>Banner name (not unique)</description>
        </attribute>
        <attribute qualifier="title" type="localized:java.lang.String">
            <description>Title</description>
            <modifiers read="true" write="true" search="true" initial="true"/>
            <persistence type="property"/>
        </attribute>
        <attribute qualifier="position" type="SimpleBannerPositionEnum">
            <description>Banner position</description>
            <modifiers optional="true" initial="true"/>
            <persistence type="property"/>
        </attribute>
        <attribute qualifier="altText" type="localized:java.lang.String">
            <description>Banner alt text</description>
            <modifiers optional="true" initial="true"/>
            <persistence type="property"/>
        </attribute>
        <attribute qualifier="titleSecondary" type="localized:java.lang.String">
            <description>Title secondary</description>
            <persistence type="property" />
            <modifiers />
        </attribute>
        <attribute qualifier="urlLoc" type="localized:java.lang.String">
            <description>Banner url</description>
            <persistence type="property" />
            <modifiers />
        </attribute>
    </attributes>
</itemtype>
票数 2
EN

Stack Overflow用户

发布于 2020-05-25 05:56:08

我能够看到的问题之一是,应该删除部署表,因为最佳实践是只在扩展GenericItem(when时才提供部署表,您没有指定将自动设置此类型的父类)。所以你的定义应该是这样的:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<itemtype code="PromotionBannerCMSComponent" autocreate="true" generate="true" extends="SimpleBannerComponent"
      jaloclass="my.package.core.jalo.components.PromotionBannerCMSComponent">
<description>Promotion banner component</description>
<attributes>
    <attribute qualifier="code" type="java.lang.String">
        <persistence type="property"/>
        <modifiers/>
        <description>Banner name (not unique)</description>
    </attribute>
    <attribute qualifier="title" type="localized:java.lang.String">
        <description>Title</description>
        <modifiers read="true" write="true" search="true" initial="true"/>
        <persistence type="property"/>
    </attribute>
    <attribute qualifier="position" type="SimpleBannerPositionEnum">
        <description>Banner position</description>
        <modifiers optional="true" initial="true"/>
        <persistence type="property"/>
    </attribute>
    <attribute qualifier="altText" type="localized:java.lang.String">
        <description>Banner alt text</description>
        <modifiers optional="true" initial="true"/>
        <persistence type="property"/>
    </attribute>
    <attribute qualifier="titleSecondary" type="localized:java.lang.String">
        <description>Title secondary</description>
        <persistence type="property" />
        <modifiers />
    </attribute>
    <attribute qualifier="urlLoc" type="localized:java.lang.String">
        <description>Banner url</description>
        <persistence type="property" />
        <modifiers />
    </attribute>
</attributes>

尝试初始化系统,以便对其进行测试,以便从数据库中删除旧类型及其关联表。

票数 0
EN

Stack Overflow用户

发布于 2020-05-25 06:17:54

我用1905.13测试了你的代码,它运行得很好。(我需要调整包名并添加SimpleBannerPositionEnum定义),我只是在平台更新期间在命令行和“更新运行系统”中做了“all”(没有检查任何扩展)。我能够在后台创建一个PromotionBannerCMSComponent实例。

您是否尝试过初始化并查看它是否对您有效?否则,您可能需要更多地共享有关错误/堆栈跟踪的信息。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62000873

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文