uygulamanın ayağa kaldırılması debug mod:
oguzhan@okinikdvc:~/Projects/y_S_SOURCE/hybris/bin/platform$ . ./setantenv.sh && ant clean all && ./hybrisserver.sh debug
uygulamanın ayağa kaldırılması:
oguzhan@okinikdvc:~/Projects/y_S_SOURCE/hybris/bin/platform$ . ./setantenv.sh && ant clean all && ./hybrisserver.sh start
uygulamanın durdurulması:
oguzhan@okinikdvc:~/Projects/y_S_SOURCE/hybris/bin/platform$ . ./setantenv.sh && ant clean all && ./hybrisserver.sh stop
*
*
*
*
*
debug modu aktifleştirme IntellijIDEA:
Run-> Edit Configurations…-> Remote-> Remote debug-> OK
Run-> Debug ‘Remote debug’
Konsolda “Connected to the target VM, address: ‘localhost:8000’, transport: ‘socket'” ifadesi görmelisiniz.
if an error occurred like the below line, check the ./hybrisserver.sh command executed with debug parameter as “./hybrisserver.sh debug”
“Error running ‘Remote debug’: Unable to open debugger port (localhost:8000): java.net.ConnectException “Connection refused (Connection refused)””
*
*
*
*
*
DEV,QA ve PROD properties dosyasındaki verilerin yerel properties dosyasına alınması:
config, config-local, config-dev, config-qa, config-prod modullerinde yapılacak değişikliklerin yerele aktarılması için config-local-> local.properties dosyasının içeriğinin aynısı config-> local.properties dosyası içeriğine alınabilir, burada dikkat edilmesi gereken nokta mesela veri tabanı kullanımınız farklı ise kendi yapılandırma ayarlarınızı korumalısınız.
*
*
*
*
*
Sabit değişkenlerin properties dosyasından okunması ve güncellenmesi:
Kod içerisinde elle String ifadeler kullanmak yerine project.properties dosyasına bu değeri yazıp yardımcı sınıflar ile bu değeri okumak için
MYAPPSOURCE/hybris/bin/custom/myapp/myapperpwebservices/project.properties
(MYAPPSOURCE/hybris/bin/custom/myapp/myappcore/project.properties)
(MYAPPSOURCE/hybris/bin/custom/myapp/myappbackoffice/project.properties) dosyasına aşağıdaki gibi key-value şeklinde satır eklenmeli
#ERP order statics
pwrtoolerpwebservices.order.type.proscore=XXX
(data.first.processing.type.code=ZB)
(default.category.code.of.sparepart=1500)
MYAPPSOURCE/hybris/bin/custom/myapp/
MYAPPSOURCE/hybris/bin/custom/myapp/myapperpwebservices/src/net/ycn/myapp/erpwebservices/constants/MyapperpwebservicesConstants.java
(Örnek02: MYAPPSOURCE/hybris/bin/custom/myapp/myapp/src/tr/ycn/myapp/core/constants/MyappCoreConstants.java)
(Örnek03: MYAPPSOURCE/hybris/bin/custom/myapp/myappcore/src/tr/ycn/myapp/core/constants/MyappCoreConstants.java) sınıfına aşağıdaki gibi tanım yapılmalı
[code lang=”java”]
// ERP order type for ProScore e.g. "XXX"
public static final String ORDER_ERP_TYPE_PROSCORE = "myapperpwebservices.order.type.proscore";
(Örnek02:
/**
* read value of "data.first.processing.type.code" from project.propeties
*/
public static final String PROJ_PROP_DATA_FISRT_CODE = "data.first.processing.type.code";
)
(Örnek03:
/**
* read value of "default.category.code.of.sparepart" from project.propeties
*/
public static final String PROJ_PROP_DEFAULT_CTGRY_CODE_OF_SPAREPART = "default.category.code.of.sparepart";
)
[/code]
DI için ise
MYAPPSOURCE/hybris/bin/custom/myapp/myapperpwebservices/resources/myapperpwebservices-spring.xml dosyasında aşağıdaki gibi bean’e property eklenmelidir.
[code lang=”xml”]
<alias name="defaultMyappErpOrderService" alias="myappErpOrderService"/>
<bean id="defaultMyappErpOrderService"
class="net.yazilimcity.myapp.erpwebservices.services.impl.DefaultMyappErpOrderService">
<property name="myappScoreService" ref="myappScoreService"/>
<property name="configurationService" ref="configurationService"/>
</bean>
(Örnek02:
<alias alias="myappServiceActionService" name="defaultMyappServiceActionService"/>
<bean id="defaultMyappServiceActionService"
class="net.yazilimcity.myapp.core.service.impl.DefaultMyappServiceActionService">
<property name="myappServiceRequestService" ref="defaultMyappServiceRequestService"/>
<property name="productService" ref="productService"/>
<property name="configurationService" ref="configurationService"/>
</bean>
)
(Örnek03:
nothing
)
[/code]
DI için kullanılan configurationservice property değeri MYAPPSOURCE/hybris/bin/platform/ext/core/resources/servicelayer-spring.xml dosyasında aşağıdaki gibi tanımlıdır.
[code lang=”xml”]
<!– Configuration Service –>
<alias alias="configurationService" name="defaultConfigurationService"/>
<bean id="defaultConfigurationService"
class="de.hybris.platform.servicelayer.config.impl.DefaultConfigurationService" parent="abstractService">
<property name="tenantService" ref="tenantService"/>
</bean>
(Örnek02: yukarıdaki gibi tanımlıdır)
(Örnek03: nothing)
[/code]
DefaultMyappErpOrderService.java sınfında ise kullanımı aşağıdaki gibidir.
[code lang=”java”]
private de.hybris.platform.servicelayer.config.ConfigurationService configurationService;
final String orderTypeProScore = configurationService.getConfiguration().getString(MyapperpwebservicesConstants.ORDER_ERP_TYPE_PROSCORE);
(Örnek02: private de.hybris.platform.servicelayer.config.ConfigurationService configurationService;
final String firstExecutionProcessTypeCode = configurationService.getConfiguration()
.getString(PwrtoolCoreConstants.PROJ_PROP_C4C_ODATA_FISRT_EXECUTION_CODE);
)
(Örnek03:
MYAPPSOURCE/hybris/bin/custom/myappbackoffice/backoffice/src/net/yazilimcity/myappbackoffice/widgets/explodedpicture/ExplodedPictureController.java
sınıfında kullanimi
String sparePartCode = Config.getParameter(PwrtoolCoreConstants.PROJ_PROP_DEFAULT_CTGRY_CODE_OF_SPAREPART);
)
[/code]
*
*
*
*
*
Değişkenlerin properties dosyasından okunup Bean dosyasında kullanılması: Bean oluştururken gerek duyacağınız değişkenleri properties dosyasında tanımlayabilir ve sonrasında Bean oluştururken bu değeri Bean’e atayabilirsiniz. MYYAPPSOURCES/hybris/bin/custom/pwrtool/pwrtoolcore/project.properties dosyasında şöyle tanımlama yapılır,
myapp.my.dynamic.bean.value01=7
myapp.my.dynamic.bean.value02=myval
myapp.my.dynamic.bean.value03=false
MYAPPSOURCES/hybris/bin/custom/myapp/myappcore/resources/myappcore-spring.xml dosyasında ise aşağıdaki gibi kullanabilirsiniz.
[code lang=”xml”]
<!– Exploded Picture Dao –>
<alias alias="pwrtoolExplodedPictureDao" name="defaultPwrtoolExplodedPictureDao"/>
<bean id="defaultPwrtoolExplodedPictureDao"
class="net.yazilimcity.myapp.core.dao.impl.DefaultPwrtoolExplodedPictureDao"> <!– parent="composedTModelGenericDao"> –>
<constructor-arg value="PwrtoolExplodedPictureModel"/>
<property name="value01" value="#{configurationService.configuration.getProperty(‘myapp.my.dynamic.bean.value01’)}"/>
<property name="value02" value="#{configurationService.configuration.getProperty(‘myapp.my.dynamic.bean.value02’)}"/>
<property name="value03" value="#{configurationService.configuration.getProperty(‘myapp.my.dynamic.bean.value03’)}"/>
</bean>
[/code]
Java sınıfımızdaki constructor ve değişkenler ise şöyle olmalıdır.
[code lang=”java”]
public class DefaultPwrtoolExplodedPictureDao extends DefaultGenericDao<PwrtoolExplodedPictureModel>
implements PwrtoolExplodedPictureDao
{
private String value01;
private String value02;
private String value03;
public DefaultPwrtoolExplodedPictureDao(String typecode)
{
super(typecode);
}
}
[/code]
*
*
*
*
*
Address içerisindeki Owner’ı elde etmek için PrincipalModel ile cast işlemi:
Burada cast işlemi yapılmazsa owner değerini B2BUnit tipi gibi göremezsiniz ve displatName özelliğine ulaşamazsınız.
((PrincipalModel)addressModelList.get(x).getOwner()).getDisplayName()
*
*
*
*
*
Uzak sunucuyu Remote Debug modu ile çalışırıp debuglama:
/hybris/bin/platform$ ./hybrisserver.sh stop
/hybris/bin/platform$ ./hybrisserver.sh debug
işiniz bittiğinde /hybris/bin/platform$ ./hybrisserver.sh start
Starting hybrisPlatform on Tomcat…
Waiting for hybrisPlatform on Tomcat……
running: PID:118001
IntellijIdea-> Run-> Edit Configuration-> Remote-> + (Add new configuration)->
Name: QA_Remote debug->
Host: 192.168.1.21->
Port: 8000->
Command line arg for remote JVM: “-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000”
IntelliJIdea-> Run-> Debug ‘QA_Remote debug’->
Debug atılacka satırı işaretleyin tick işareti ve krmızı nokta görmelisiniz. Konsoldan kendi çalıştırdığınız hybrisserver.sh debug durdurabilirsiniz. QA’de debug satırı için işlem yaptığınızda kendi kodunuzda debug’a düşmüş olacaksınız.
Debug moddan kendi kodunuz için çıkmak için, ancak bu işlem sunucunun debug modunu durdurmaz, ayrıca sunucuya gidip ./hybrisserver.sh stop yapıp sonra ./hybrisserver.sh.start yapmanız gerekir.
IntelliJIdea-> Run-> Stop ‘QA_Remote_debug’
Local Debug için:
IntellijIdea-> Run-> Edit Configuration-> Remote-> + (Add new configuration)->
Name: Remote debug->
Host: localhost->
Port: 8000->
Command line arg for remote JVM: “-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000”
Aktifleştirmek için:
IntelliJIdea-> Run-> Debug ‘Remote debug’ (Console’da “Connected to the target VM, address: ‘192.168.8.21:8000’, transport: ‘socket'” şeklinde başarılı bir bağlantı mesajı görülmelidir.)->
ve
./hybrisserver.sh debug
*
*
*
*
*
Language pack dosyası değişikliği
config-local,dev,qa-> languages-> langpack-tr.zip dosyasında bir değişiklik yapıldıktan sonra uygulamanın sorunsuz ayağa kalkması için önce ant customize && ant clean all komutlarını çalıştırmalısınız.
*
*
*
*
*
Ürün içerisindeki değişikliklerden sonra ve ant update sonrası ypaılack işlem:
facets -> sync
*
*
*
*
*
Parola Değiştirme İşlemi:
Backoffice-> B2B Commerce-> B2B Users->