问题描述
我们可以通过点击以下URL来访问JUnit租户中的HMC
We can access HMC in JUnit tenant by hitting the below URL
https://localhost:9002/hmc_junit/hybris
像hmc.webroot=/hmc_junit
但是我没有在JUnit Tenant中看到任何可访问Backoffice的URL.
But I havn't seen anywhere URL to access Backoffice in JUnit Tenant.
有人可以帮助我访问JUnit Tenant中的Backoffice吗?
Can anybody help me please to access Backoffice in JUnit Tenant ?
推荐答案
我也在所有地方都在寻找它,在Wiki中找不到任何文档...它似乎没有得到官方支持,但是这里是我发现了什么.
I was looking for it everywhere as well, couldn't find any documentation in the wiki... It doesn't seem to be officially supported but here is what I found.
在Hybris 6.3中,后台应用程序没有junit上下文路径.这是您可以添加一个的方法:
Under Hybris 6.3 there is no junit context path for the backoffice application. Here is how you could add one :
-
在您的配置文件夹下创建一个名为 local_tenant_junit.properties 的文件,该文件应包含:
Create a file named : local_tenant_junit.properties under your configuration folder, it should contain :
backoffice.webroot =/backoffice_junit
backoffice.webroot=/backoffice_junit
在配置文件夹 customize/ext-backoffice/backoffice/web/webroot/WEB-INF/backoffice-spring-filter.xml 中创建一个用于自定义的文件.复制原始文件的内容,并更新 backofficeFilterChain bean.我们要使用 dynamicTenantActivationFilter 而不是 tenantActivationFilter ):
Create a file for customization inside your config folder customize/ext-backoffice/backoffice/web/webroot/WEB-INF/backoffice-spring-filter.xml. Copy the content of the original file and update the backofficeFilterChain bean. We want to use the dynamicTenantActivationFilter instead of the tenantActivationFilter) :
<bean id="backofficeFilterChain" class="de.hybris.platform.servicelayer.web.PlatformFilterChain">
<constructor-arg>
<list>
<ref bean="log4jFilter"/>
<ref bean="dynamicTenantActivationFilter"/>
<ref bean="backofficeRedirectFilter"/>
<ref bean="sessionFilter"/>
<ref bean="backofficeDataSourceSwitchingFilter"/>
<ref bean="backofficeCatalogVersionActivationFilter"/>
<ref bean="backofficeContextClassloaderFilter"/>
<ref bean="backofficeSecureMediaFilter" />
</list>
</constructor-arg>
执行 ant clean all custom
检查 bin/platform/tomcat/conf/server.xml 中是否有新上下文 backoffice_junit
Check that in bin/platform/tomcat/conf/server.xml you now have a new context backoffice_junit
启动服务器,您现在可以访问主租户和junit租户的后台应用程序
Start your server, you can now access the backoffice application for master and junit tenant
这篇关于如何在Junit Tenant中访问Backoffice的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!