Friday, February 27, 2015

How to set up a default value to item-type property on ATG Oracle commerce

Oracle documentation says that you can set up a default value for properties into the repository definition, however all the OOTB definitions are for simple data-types such Boolean, string or enumerated, this can be set as well to item-type properties, but is important to mention that this can not be done on multi-valued properties.

This can be found at http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGRepositoryGuide/html/s1302property01.html but does not mention anything about item-type properties, so I was not sure if this was possible until I did it.

Below is an example of how to set up a default value to product's template property.

This is a hard coded value, just to show how this can be done. however this can be pointed to a component property

It was just as simple as ste the id of the component you want to point:

Tuesday, February 17, 2015

Where is Stored the BCC Internal user information?

There will be times where you need to know about this, you can find that inside table dpi_user,
All passwords are hashed, so you will not be able to see the password out.

ATG How to Make Staging Do not Switch when deployment

Staging deployment can be 50% faster if we configure it to not switch, this is useful when staging is used as preview environment for your business.

The First thing to do is configure all the Data Sources that use SwitchingDataSource to point to one of the Catalogs, these are the ones that are out of the box, you need to do the same for the custom Repositories that uses Switching Data source on your Store instance.

/atg/commerce/catalog/ProductCatalog.properties
/atg/commerce/pricing/priceLists/PriceLists.properties
/atg/multisite/SiteRepository.properties
/atg/seo/SEORepository.properties
/atg/store/stores/StoreRepository.properties  

These should point to CatalogA as example

 dataSource=/atg/dynamo/service/jdbc/SwitchingDataSourceA

Then you need to configure the Agent to not switch, this needs to be done at Component /atg/epub/DeploymentAgent/ on your Pub Instance
  • switchableDataStores^=/Constants.null
After this change is done this will be shown as follows:
If everything is well configured you will see your Staging as follows:



Monday, February 9, 2015

Print DDL from Oracle Commerce (ATG) Repository

All Oracle Commerce (ATG) Repositories have the availability to print the DDL for all the tables, and constraints that creates it, this can be done by typing
<print-ddl/>
And run the the xml operation on any repository as follows:

This will return the drop and the create for each table/constraint/index on the repository.




This feature is out there at least since atg 9.4 http://docs.oracle.com/cd/E26180_01/Platform.94/RepositoryGuide/html/s1202printddl01.html


Wednesday, February 4, 2015

Find text inside a .jar with shell script

There will be cases, where you need to find which java class is throwing an exception or is saving a file, and that class is inside a .jar file. in order to search across all your jar files on your app in linux you can do the following: