By Kate Soglaeva
» FormHandlers do’s » Droplets do’s » Repositories do’s 2 ATG Hints by Kate Soglaeva
3
4
5 HTML JSP Droplets ServicesManagers view presenter model Form Handlers Tags Xml, json Repositories Web Services
6 ATG Hints by Kate Soglaeva Manager Form Handler Form Form Value Object Business Object Repositories Field Validator 1 : 1 Request Business logic v alidation logic
7 ATG Hints by Kate Soglaeva Form Manager Form Handler Form Field Validator Business Object Repositories Droplet
8 ATG Hints by Kate Soglaeva JSP Form Handler MyFormHandler.properties successURL=/… errorURL=/… MyFormHandler.java checkFormRedirect (suc cessURL, errorURL); sendLocalRedirect();
9 ATG Hints by Kate Soglaeva
10 ATG Hints by Kate Soglaeva HTML JSP Droplets ServicesManagers view presenter model Html code
» ParameterName instead of the strings. public class GiftlistDroplet extends DynamoServlet { static final ParameterName PROFILE = ParameterName.getParameterName("profile");... public void service(DynamoHttpServletRequest pReq, DynamoHttpServletResponse pResp) throws ServletException, IOException {... Object profileObject = pReq.getObjectParameter(PROFILE);... } } 11 ATG Hints by Kate Soglaeva
<dsp:param name="key" param="childCategory.repositoryId"/> No description. 12 ATG Hints by Kate Soglaeva
13 ATG Hints by Kate Soglaeva
1.Go to jsp 2.Go to Cache dropletCache droplet 3.Go to productproduct 4.Refresh cache droplet page 14 ATG Hints by Kate Soglaeva
15 ATG Hints by Kate Soglaeva
RQLQueryRange 16 ATG Hints by Kate Soglaeva
17 ATG Hints by Kate Soglaeva
1.Go to stores pagestores page 2.Check codecode 3.Add sort properties 4.Add Range droplet 18 ATG Hints by Kate Soglaeva
19 ATG Hints by Kate Soglaeva
<item-descriptor name=“myHoliday" display-property="name" > 20 ATG Hints by Kate Soglaeva Noun Camel case lowercase, ‘_’
<property name="favouriteColours" data-type="array“ column-name="favourite_colours” component-data-type="string" /> 21 ATG Hints by Kate Soglaeva Noun Camel case lowercase, ‘_’
public class King extends GenericService { private RqlStatement weaponQuery; } 22 ATG Hints by Kate Soglaeva
# /com/kings/Arthur $class=com.kingdom.King $scope=global weaponQuery=name = ?0 23 ATG Hints by Kate Soglaeva
public class King extends GenericService { protected static RqlStatement weaponQuery; static { try { weaponQuery = RqlStatement.parseRqlStatement("name = ?0"); } catch (RepositoryException re) { re.printStackTrace(); } 24 ATG Hints by Kate Soglaeva
public String getLogin(String repositoryId, String profileType) { RepositoryItem profileItem = getProfileRepository(). getItem(getRepositoryId(), getProfileType()); String loginPropertyName = getPropertyManager().getLoginPropertyName(); String login = (String) profileItem. getPropertyValue(loginPropertyName); return login; } 25 ATG Hints by Kate Soglaeva
<property name=“address" item-type=“address“ cascade="update,delete" /> 26 ATG Hints by Kate Soglaeva
» Property in the same group is retrieve in the same select statement » Be default: property in the same group are in the same table 27 ATG Hints by Kate Soglaeva
Never user one primary table in more than one item descriptor Avoid derived properties Don’t use derived and transient in RQL 28 ATG Hints by Kate Soglaeva
29
30 ATG Hints by Kate Soglaeva
» ATG Order object must follow a specific transactional pattern to avoid ˃exceptions and deadlocks, ˃ConcurrentUpdateExceptions, ˃InvalidVersionExceptions 31 ATG Hints by Kate Soglaeva
TransactionLockService service = configuration.getTransactionLockFactory().getServiceInstance( profileId, ); service.acquireTransactionLock( profileId ); try { TransactionDemarcation td = new TransactionDemarcation(); td.begin( transactionManager ); boolean shouldRollback = false; try { synchronized( order ) { // do order updates orderManager.updateOrder( order ); } } catch (... e ) { shouldRollback = true; throw e; } finally { td.end( shouldRollback ); } } finally { service.releaseTransactionLock( profileId ); } 32 ATG Hints by Kate Soglaeva 1) Obtain local-lock on profile ID 2) Begin Transaction 3) Synchronize on Order 4) Modify Order 5) Call OrderManager.updateOrder 6) End Synchronization 7) End Transaction 8) Release local-lock on profile ID
Verify that the PageFilter in web.xml Pre-Compiling JSPs Recheck components scope Disable Performance Monitor Check loggingDebug
34 ATG Hints by Kate Soglaeva