How to override a render ISML template in Intershop7 - storefront

In Enfinity Suite 6.4 we used to customize storefront pages by overriding ISML templates of the PrimeTech cartridges. For example, it was possible to add a dependency in our custom cartridge to "sld_ch_consumer_app" and replace any Primetech ISML template by adding the template with the same name and hierarchy in our custom cartridge.
Is something like that possible in Intershop7? For example, we would like to change the order of the ISML elements in ProductTile.isml, without overriding the pagelet model. If we add a dependency in our custom cartridge to "app_sf_responsive_cm" and create the ISML template with the same name and folder hierarchy in our custom cartridge, the system still loads the ISML template from the "app_sf_responsive_cm".
Only way we managed to achieve to see the changes in storefront was by overriding the pagelet model and changing the render template name to "ProductTileCustom". Like this:
If we don't use the custom name for the render template, system will first load the ProductTile.isml from the app_sf_responsive_cm instead of the one n our custom cartridge (app_sf_a1_shop_cm).
The order of the cartridges in the cartridgelist.properties is this:
....
bc_urlrewrite_test \
bc_product_rating_orm_test \
commerce_management_b2c_component \
app_core_a1 \
app_sf_a1_shop \
app_sf_a1_shop_cm \
app_bo_a1 \
app_sf_responsive \
app_sf_responsive_cm \
app_sf_responsive_b2c \
app_sf_responsive_smb \
as_responsive \
as_a1 \
Is there some easier way of overriding the responsive store ISML templates other than overriding the pagelet model?

In addition to what Bas de Groot was mentioning in regards to use the intershop studio wizard to override an ISML template, I want to point out that your problem lies within the wrong order of cartridges in your cartridgelist.properties. So instead of:
bc_urlrewrite_test \
bc_product_rating_orm_test \
commerce_management_b2c_component \
app_core_a1 \
app_sf_a1_shop \
app_sf_a1_shop_cm \
app_bo_a1 \
app_sf_responsive \
app_sf_responsive_cm \
app_sf_responsive_b2c \
app_sf_responsive_smb \
as_responsive \
as_a1 \
You must use this order here:
bc_urlrewrite_test \
bc_product_rating_orm_test \
commerce_management_b2c_component \
app_sf_responsive \
app_sf_responsive_cm \
app_sf_responsive_b2c \
app_sf_responsive_smb \
as_responsive \
as_a1 \
app_core_a1 \
app_sf_a1_shop \
app_sf_a1_shop_cm \
app_bo_a1 \
In other words, your project cartridges must be loaded after the intershop stuff

There should be no need to override the pagelet model, just overriding the ISML template should do the trick. You can easily override ISML templates in Intershop 7 by doing the following:
Right click the custom cartridge to which you want to add the new template and select new > ISML Template.
In the popup window that appears click Override Existing....
Select the template you want to override and click open.
Click Finish.
Intershop Studio will now automatically create the template and correct folder structure inside your specified cartridge.
Depending on your settings in the appserver.properties file you might need to restart or even re-deploy the application server before the new template will show up in the frontend.

Related

Trigger Google Workflow from document update in Firestore

When there is an update in my Cloud Firestore, I would like it to trigger a workflows that consumes the document id as a parameter.
You can leverage EventArc to have an event reported to Audit Logs be picked up by EventArc and used as trigger for your Workflow.
Essentially the command is from this tutorial page:
gcloud eventarc triggers create TRIGGER \
--location=LOCATION \
--destination-workflow=DESTINATION_WORKFLOW \
--destination-workflow-location=DESTINATION_WORKFLOW_LOCATION \
--event-filters="type=google.cloud.audit.log.v1.written" \
--event-filters="serviceName=SERVICE_NAME" \
--event-filters="methodName=METHOD_NAME" \
--service-account="MY_SERVICE_ACCOUNT#PROJECT_ID.iam.gserviceaccount.com"
where the event-filter
serviceName= firestore.googleapis.com
methodName=pick from a list
the methodName options are described on this page.

Grpc Go Generated.pb.go import was not formatted

I imported proto file (validator.proto) from one of my project https://github.com/maanasasubrahmanyam-sd/customValidation to another project (test.proto) https://github.com/maanasasubrahmanyam-sd/customeValTest/tree/master/interfaces/test_server
go get github.com/maanasasubrahmanyam-sd/customValidation
protoc \
-I. \
-I $GOPATH/src/ \
--proto_path=${GOPATH}/pkg/mod/github.com/envoyproxy/protoc-gen-validate#v0.1.0 \
--proto_path=${GOPATH}/src/github.com/google/protobuf/src \
--go_out="plugins=grpc:./generated" \
--validate_out="lang=go:./generated" \
--govalidators_out=. \
./interfaces/test_server/*.proto
The correct import should come as github.com/maanasasubrahmanyam-sd/customValidation/validator. But test.pb.go import was coming as _ "./validator" which shows red line in Goland.
EDIT - All pb.go files are showing errors in them. I suspect it is due to bad import.
I google it but did not found any relevant information. Any suggestion experts ?
You can address the proto path in two ways,
One: if your import proto file is in your local then you should move it to your parent directory then address it from your parent path like this:
- parentDirectory
-- directory1
--- proto1.proto
-- importDirectory
--- proto2.proto
you can build this file(proto1.proto) with this command :
protoc --proto_path=parentDirectory/directory1 --proto_path=parentDirectory --go-grpc_out=***your output path*** --go_out=***your output path*** parentDirectory/directory1/proto1.proto
also if you use Goland you need to add parentDirectory to your setting(File | Settings | Languages & Frameworks | Protocol Buffers) then uncheck Configure automatically and add your parent path.
Two: If your proto file is in URL: then you can add it to your build command like this:
protoc --proto_path=src \
--go_opt=Mprotos/buzz.proto=example.com/project/protos/fizz \
--go_opt=Mprotos/bar.proto=example.com/project/protos/foo \
protos/buzz.proto protos/bar.proto

How to retrieve HTTP request header using CGI with BASH

I use a CGI script that calls a Java program using Apache 2.4.41.
The script is the following:
#!usr/bin/bash
java \
-Dcgi.content_type=$CONTENT_TYPE \
-Dcgi.content_length=$CONTENT_LENGTH \
-Dcgi.request_method=$REQUEST_METHOD \
-Dcgi.query_string=$QUERY_STRING \
-Dcgi.server_name=$SERVER_NAME \
-Dcgi.server_port=$SERVER_PORT \
-Dcgi.script_name=$SCRIPT_NAME \
-Dcgi.path_info=$PATH_INFO \
-Dcgi.http_cookie=$HTTP_COOKIE \
-classpath /home/be \
cgi.UserEndpointCGI
The client sends to the endpoint a custom header to tell the server which function is request. The header contains the key-value:
Y-Request: function_name
The problem is that I don't know how to retrieve Y-Request: function_name header field and i couldn't find an answer on the net.
From your example , this how you use a arbitrary header
-Dcgi.http_cookie=$HTTP_COOKIE \
The header Y-Request must be available in the variable HTTP_Y_REQUEST .
You CGI script has a big security, someone can inject arbritrary shell command , you must quote the usage of all variables .
-Dcgi.http_cookie="$HTTP_COOKIE" \

TeamCity API setting configuration parameters

I have configuration parametr current_build_date (User Defined Parameter) I want just to set this parameter to current date by API TeamCity.
On docs I have seen this:
http://teamcity:8111/httpAuth/app/rest/buildTypes/<buildTypeLocator>/parameters/<parameter_name>
I know my Build configuration ID, but I can't understand how by this to make buildTypeLocator.
I assume result will be something like this:
curl -u Login:Password \
-X PUT \
-d 'valueOfMyParam' \
-H 'Content-Type: text/plain' \
http://teamcity:8111/httpAuth/app/rest/buildTypes/<buildTypeLocator>/parameters/current_build_date
I will realy appreciate if somebody who knows TeamCity API will help me with this problem.
I made attempt just to pass instead of buildTypeLocator my Build configuration ID and I got ERROR:
[17:08:25][Step 3/3] Error has occurred during request processing (Not Found).
[17:08:25][Step 3/3] Error: jetbrains.buildServer.server.rest.errors.NotFoundException: No project found by name or internal/external id 'BuildConfigurationID'.
If there are any problems or ambiguities with my question please add comment, i'll try to fix it.
If you browse the REST API endpoints in a browser you'll be able to see the format of the build locator.
Visit http://teamcity:8111/httpAuth/app/rest/buildTypes/ and you'll see the entries have a href attribute that contains the buildLocator (generally a property:value combination)
You'll then be able to navigate using that url / communicate via the API
Hope this helps
I solved problem: build type locator was id:Build configuration ID
current_build_date=`date +%%Y-%%m-%%d:%%H:%%M:%%S`
echo $current_build_date;
curl -u Login:Password \
-X PUT \
-d $current_build_date \
-H 'Content-Type: text/plain' \
https://teamcity.billing.ru/httpAuth/app/rest/buildTypes/id:Build
configuration ID/parameters/current_build_date

JMeter distributed testing and command line parameters

I have been using JMeter parameters to specify test attributes like testduration, rampup period etc for load test. I specify these parameters in shell script and it looks like this -
JMETER_PATH="/home/<user>/apache-jmeter-2.13/bin/jmeter.sh"
${JMETER_PATH} \
-Jjmeter.save.saveservice.output_format=csv \
-Jjmeter.save.saveservice.response_data.on_error=true \
-Jjmeter.save.saveservice.print_field_names=true \
-JCUSTOMERS_THREADS=1 \
-JGTI_THREADS=1 \
// Some more properties
Everything goes good here.
Now I added distributed testing and modified above script with JMeter Server related info. Hence new script looks as -
JMETER_PATH="/home/<user>/apache-jmeter-2.13/bin/jmeter.sh"
${JMETER_PATH} \
-Jjmeter.save.saveservice.output_format=csv \
-Jjmeter.save.saveservice.response_data.on_error=true \
-Jjmeter.save.saveservice.print_field_names=true \
-Jsample_variables=counter,accessToken \
-JCUSTOMERS_THREADS=1 \
-JGTI_THREADS=1 \
// Some more properties
-n \
-R 127.0.0.1:24001,127.0.0.1:24002,127.0.0.1:24003,127.0.0.1:24004,127.0.0.1:24005,127.0.0.1:24006,127.0.0.1:24007,127.0.0.1:24008,127.0.0.1:24009,12$
-Djava.rmi.server.hostname=127.0.0.1 \
Distributed test runs well but test does not take parameters specified in script above into consideration rather it takes the default value from JMeter test plan -
Did I mess up any configuration?
Use -G instead of -J for properties to be sent to remote machines as well. -J is local only.
-D[prop_name]=[value] - defines a java system property value.
-J[prop name]=[value] - defines a local JMeter property.
-G[prop name]=[value] - defines a JMeter property to be sent to all remote servers.
-G[propertyfile] - defines a file containing JMeter properties to be sent to all remote servers.
From here
Replace -J with -G, for more details go to link below or can see the image atached.
If you want to run your load test in distributed mode refer to URL click here
And search for Server Mode (1.4.5)

Resources