Showing posts with label Repository. Show all posts
Showing posts with label Repository. Show all posts

Hidden Concepts of ATG Repository- Part 3

2. Last Modified Date and Version Properties

Last Modified Date: Last Modified Date is used at item level to identify the items that are being changed from given timestamp.

                <item-descriptor ......... last-modified-property="lastModDate">
                           <attribute name="updateLastModified" value="true"/>
                      <table ...>
                            <property name="lastModDate" data-type="timestamp"/>
                      </table>
                 </item-descriptor>


The five important must points to set the last modified date are
  • data-type of  last-modified-property has to be "date" or "timestamp".
  • Property should be persistent and single valued.
  • Property should be placed in Primary or Auxillary table.
  • item descriptor should contain last-modified-property.
  • Attribute "updateLastModified" should be set to true.
Additional Safety
  • Column in DataBase can have default value to set to sysdate, so that, in case of insertion of Null, DataBase Updates the row with system date(current date). 
  • Hide the Property in ACC and BCC by adding hidden="true".


Hidden Concepts of ATG Repository- Part 2

2. Required , Unique and Default Properties

Scenario 1: You have property of Item, that is must required for creating Item.From DataBase perspective, you have column which cannot be null and requires user entered value.

Solution 1: Use the attribute required=true at property level.

           <property name="mustNeeded" data-type="string" required="true" />

Dont's:
  • If DataBase defines NOT NULL constraint to column, then required attribute must be set to "true". Vice-versa is not always true, if you are not manually entering the data in DataBase.In other words, even if the NOT NULL constraint is not defined, it would still go good.
  • If Property reference to other Item, you can only set required="true" at repository level, but donot add constraint NOT NULL to column in DataBase.(Reason: During Deployments, BCC writes row without reference properties first and then Updates the same row with properties with referenced properties.)
  • Donot add required attribute to collection properties. like, data-type="set". Its not supported by ATG.

Hidden Concepts of ATG Repository- Part 1

ATG Repository is vast area in ATG box to explore. There are lot of hidden things, which gets unnoticed during the implementation. Though these points are covered in the ATG Repository, I will try to collect them and note down here.


1. Enumerated String: Till the ATG 9.x , Repository was supporting the Enumerated integer, where Integer code was stored in DataBase in place of string option values.