Thursday, August 31, 2017

Oracle Commerce - Create custom Derivation method

ATG Repositories have a feature called Derivations, that allow you to derive the value of a property based on other values.

This si a great way to help you design your repository definition and avoid duplicate data.

Here is an example of what you can do with an OOTB derivation:

Now, you can create your own Derivation method to do what you want.

Just do the following:
Create a Class that extends DerivationMethodImpl.

Override derivePropertyValue method

And in order to user it:
Now you can reuse this derivation to get the first element of a collection by just configuring the collection in the expression

There are several derivations already, just make sure that the one you want to implement is not already created OOTB

Thursday, May 4, 2017

Create Rest Service on Oracle Commerce ATG11.x

Oracle Commerce does provide with a rest service module that we can use to expose services. it is very easy to do, in this diagram is explained in high level how this can be done.
Let's say we are gonna create a Service that returns the review for a particular product.
We need to create a service component that will get the Reviews, that will be as follows:

Then, we need to register that new service as an Actor as follows:

Then register that new service chain url into, OOTB that already exist and holds the configuration for all the services.

Everything on how to do this is documented at

And in the top of this you can add a new layer for cache the data using Cache Adapter.
That will looks like this.
In order to do implement the cache, you can use this page that is a very useful guide
The Actor chain definition will change a little bit to use the cache instead of the service, that will look like:

Give it a try.

Friday, December 30, 2016

ScenarioManager is not accepting new scenarios

I was creating new scenarios and those were not reflected on the ScenarioManager, I have listed all the OOTB scenearios, but not my custom ones.

I found this Warning on the Logs:

/atg/scenario/ScenarioManager   Unable to declare this instance as the default ProcessEditorServer. Another instance has already been run against this schema, and has declared itself as the default ProcessEditorServer. This instance will be started as an individual server. To declare this instance as the ProcessEditorServer, either configure the /atg/scenario/scenarioManager.xml file, or remove the applicable row from the dss_server_id table. The first option is the recommended one, since it will prohibit this problem from occurring in the future. Turn on debug logging for this component to see further details (server restart may be required).

So I turned on logging debug on Scneario Manager, and found that all my custom Scmearios were not considered at all.

The problem was that the table dss_server_id was having a record for another computer (an other VM) I just updated this to use the actual name for the processEditor Server and that fixed the problem.

This is a common problem that you could face if you get a database dump from other computer.

How To Remove an EAC application

While installing an endeca application I faced a problem where I needed to reinstall again, in order to do such thing you need to remove the EAC application first, otherwise Error saying that the application already exist.

In order to remove an EAC application just run the follwoing scripts:

Then you will be able to install the application again with not a problem.

CRS configuration guide has the stesp listed as well:

Thursday, December 29, 2016

How to disable basic http auth on WebLogic 12

WebLogic by defeault has enabled basic http authentication.

This can be a problem if you want to run some application that connect to your instances like Oracle Commerce ACC (Admin Control Center)

In order to disable this you just need to go to config.xml on your domin config.

<WEBLOGIC_HOME >/user_projects/domains/mydomain/config/config.xml

and add insdide node the  


With this configuration basic auth is disabled and ACC or other apps that does not have a way to provide basic http auth credentials will be able to connect to your application deployed on web logic.