Определить пользовательский тип приложения для backoffice
Мы пытаемся настроить пользовательский тип приложения для Backoffice в последней версии Intershop 7.9, но когда мы пытаемся запустить DBInit, мы получаем следующую ошибку:
[xx.xxx.webshop.dbinit.data.organization.Channel,xx.xxx.webshop.dbinit.data.organization.ChannelLocalization,ProcessChannel-DBInit] Version:null] com.intershop.beehive.core.pipelet.pipeline.ExecutePipeline [] [Unknown] [scHAqDIFBIAAAAFjuxgo2CwQ] [RbPAqDIFZAUAAAFjuxgo2CwQ] "main" ISH-CORE-2490: Synchronous called pipeline 'CreateSalesChannel-CreateChannelObjects' of application 'CustomShop@Custom-Site (app=xx.CustomBackoffice)' has finished with exception: com.intershop.beehive.core.internal.pipeline.PipelineCallStackException: com.intershop.beehive.core.capi.pipeline.PipelineExecutionException: Required input parameter 'AppID' missing of pipeline 'ProcessApplication defined in cartridge sld_ch_base' and start node 'Create'!
Ошибка появляется при вызове подготовителя для каналов. Это соответствующий код из файла apps.component, используемый для создания типа приложения backoffice:
<instance name="xx.CustomBackoffice.ApplicationTypes" with="AppRegistry"/>
<!-- register the custom B2CBackoffice to the Enterprise Backoffice of your choose -->
<fulfill of="intershop.EnterpriseBackoffice" requirement="namedObject">
<instance with="NamedObject">
<fulfill value="ChannelBackofficeApplicationType_52" requirement="name"/>
<fulfill with="xx.CustomBackoffice" requirement="object"/>
</instance>
</fulfill>
<!-- declaration of the cartridge list -->
<instance with="CartridgeListProvider" name="xx.CustomBackoffice.Cartridges">
<!-- Derive from standard webshop if you want to use the same cartridges like standard webshop -->
<fulfill requirement="parent" with="intershop.B2CBackoffice.Cartridges" />
</instance>
<!-- definition of the application type -->
<instance with="ApplicationType" name="xx.CustomBackoffice">
<fulfill requirement="id" value="xx.CustomBackoffice" />
<fulfill requirement="urlIdentifier" value="a1-shop-bo" />
<fulfill requirement="cartridgeListProvider" with="xx.CustomBackoffice.Cartridges" />
<fulfill requirement="namedObject">
<instance with="NamedObject">
<fulfill requirement="name" value="ChannelApps_52" />
<!-- register the AppRegistry containing all storefront applications of this channel -->
<fulfill requirement="object" with="xx.CustomBackoffice.ApplicationTypes" />
</instance>
</fulfill>
<!-- put additional NamedObjects, that are required by the particular business features -->
<!-- ... -->
</instance>
<!-- registration of the application type to the AppEngine -->
<fulfill of="AppEngine" with="xx.CustomBackoffice" requirement="app"/>
<fulfill requirement="namedObject" of="xx.CustomBackoffice" with="intershop.EnterpriseBackoffice.RESTAPI"/>
Как только я удаляю определение для пользовательского типа приложения backoffice, dbinit запускается успешно, и типы приложений frontoffice создаются без ошибок.
Кто-нибудь может увидеть, где ошибка или как правильно определить пользовательский тип приложения для backoffice?
Я разыскал эту проблему, чтобы определить 2 пользовательских типа приложений в apps.component, особенно эту часть:
<!-- register the custom B2CBackoffice to the Enterprise Backoffice of your choose -->
<fulfill of="intershop.EnterpriseBackoffice" requirement="namedObject">
<instance with="NamedObject">
<fulfill value="ChannelBackofficeApplicationType_52" requirement="name"/>
<fulfill with="xx.CustomBackoffice" requirement="object"/>
</instance>
</fulfill>
Если я добавлю второй тип приложения BO и попытаюсь зарегистрировать его в intershop.EnterpriseBackoffice с тем же кодом, что и выше (просто измените xx.CustomBackoffice на xx2.CustomBackoffice):
<!-- register the custom B2CBackoffice to the Enterprise Backoffice of your choose -->
<fulfill of="intershop.EnterpriseBackoffice" requirement="namedObject">
<instance with="NamedObject">
<fulfill value="ChannelBackofficeApplicationType_52" requirement="name"/>
<fulfill with="xx2.CustomBackoffice" requirement="object"/>
</instance>
</fulfill>
Показанная выше ошибка выдается при запуске DBinit. Так что, если кто-нибудь знает, как определить и зарегистрировать 2 пользовательских типа приложений для backoffice (xx.CustomBackoffice и xx2.CustomBackoffice)?
3 ответа
Очевидно, есть способ определить два типа приложений для BO и назначить их различным каналам. Это своего рода обходной путь, но он работает...
Вы должны определить два типа приложений BO в apps.component и назначить их для обоих каналов, например:
<fulfill requirement="app" with="channel1.Web" of="channel1.Backoffice.ApplicationTypes"/>
<fulfill requirement="app" with="channel1.Web" of="channel2.Backoffice.ApplicationTypes"/>
<fulfill requirement="app" with="channel2.Web" of="channel1.Backoffice.ApplicationTypes"/>
<fulfill requirement="app" with="channel2.Web" of="channel2.Backoffice.ApplicationTypes"/>
И добавьте пост-подготовитель DBinit, который выполняет SQL для обновления приложения BO канала channel1 к каналу 1.Backoffice (потому что с DBInit канал1 будет назначен каналу 2..Backoffice):
UPDATE application SET appid = 'channel1.Backoffice' WHERE urlidentifier IN ('channel1', 'channel1-organization-channel1');
Этот пример здесь должен работать:
<!-- ************************************************************************************ -->
<!-- * Application Type "custom.B2BBackoffice" * -->
<!-- ************************************************************************************ -->
<instance name="custom.B2BBackoffice.ApplicationTypes" with="AppRegistry"/>
<fulfill of="intershop.EnterpriseBackoffice" requirement="namedObject">
<instance with="NamedObject">
<fulfill value="customChannelBackofficeApplicationType_52" requirement="name"/>
<fulfill with="custom.B2BBackoffice" requirement="object"/>
</instance>
</fulfill>
<instance with="CartridgeListProvider" name="custom.B2BBackoffice.Cartridges">
<fulfill value="ish_app_bo_common" requirement="selectedCartridge"/>
<fulfill value="ish_app_bo_stock" requirement="selectedCartridge"/>
<fulfill value="ish_app_bo_user" requirement="selectedCartridge"/>
<fulfill value="sld_ch_consumer_plugin" requirement="selectedCartridge"/>
<fulfill with="intershop.EnterpriseBackoffice.Cartridges" requirement="parent"/>
</instance>
<instance with="ApplicationType" name="custom.B2BBackoffice">
<fulfill value="custom.B2BBackoffice" requirement="id"/>
<fulfill value="b2b" requirement="urlIdentifier"/>
<fulfill with="custom.B2BBackoffice.Cartridges" requirement="cartridgeListProvider"/>
<fulfill requirement="namedObject">
<instance with="NamedObject">
<fulfill requirement="name" value="ChannelApps_52" />
<fulfill requirement="object" with="custom.B2BBackoffice.ApplicationTypes" />
</instance>
</fulfill>
</instance>
<fulfill requirement="namedObject" of="intershop.EnterpriseBackoffice">
<instance with="NamedObject">
<fulfill requirement="name" value="ChannelApps_52" />
<fulfill requirement="object" with="custom.B2BBackoffice.ApplicationTypes" />
</instance>
</fulfill>
<fulfill of="AppEngine" with="custom.B2BBackoffice" requirement="app"/>
<fulfill requirement="namedObject" of="custom.B2BBackoffice" with="intershop.EnterpriseBackoffice.RESTAPI"/>
Присвоение действительному сайту может быть выполнено в базе данных, используя следующую инструкцию:
UPDATE application SET appid = 'custom.B2BBackoffice' WHERE urlidentifier IN ('IshB2B', 'IshB2B-xxxb2b');
Из того, что я вижу, есть ссылка на CartListProvider:
<fulfill requirement="cartridgeListProvider" with="a1.ShopBackoffice.Cartridges" />
указывая на a1.ShopBackoffice.Cartridges, но я не могу найти подходящее имя экземпляра в вашем фрагменте кода. Вместо этого я вижу только xx.CustomBackoffice.Cartridges.