At line 26 changed 1 line. |
* Execute __ant -Dobject.name=Person -Dappgen.type=pojo__ to generate a bunch of files in __extras/appgen/build/gen__. In fact, it'll generate all the files you need to complete this tutorial. However, let's just grab the ones you need. |
* Execute __ant -Dobject.name=Person -Dappgen.type=pojo -Dapp.module=__ to generate a bunch of files in __extras/appgen/build/gen__. In fact, it'll generate all the files you need to complete this tutorial. However, let's just grab the ones you need. |
At line 32 changed 1 line. |
* Copy the contents of Person.properties into web/WEB-INF/classes/ApplicationResources_en.properties. These are all the keys you will need for titles/headings and form properties. Here is an example of what you should add to ApplicationResources_en.properties: |
* Copy the contents of Person.properties into web/WEB-INF/classes/ApplicationResources.properties. These are all the keys you will need for titles/headings and form properties. Here is an example of what you should add to ApplicationResources.properties: |
At line 36 changed 3 lines. |
personForm.id=Id |
personForm.firstName=First Name |
personForm.lastName=Last Name |
person.id=Id |
person.firstName=First Name |
person.lastName=Last Name |
At line 154 added 1 line. |
import org.apache.tapestry.engine.ILink; |
At line 155 changed 1 line. |
import org.apache.tapestry.event.PageRenderListener; |
import org.apache.tapestry.event.PageBeginRenderListener; |
At line 160 changed 1 line. |
public abstract class PersonForm extends BasePage implements PageRenderListener { |
public abstract class PersonForm extends BasePage implements PageBeginRenderListener { |
At line 162 removed 1 line. |
public abstract void setPersonManager(PersonManager mgr); |
At line 174 changed 6 lines. |
public void cancel(IRequestCycle cycle) { |
if (log.isDebugEnabled()) { |
log.debug("Entering 'cancel' method"); |
} |
|
cycle.activate("mainMenu"); |
public ILink cancel(IRequestCycle cycle) { |
log.debug("Entering 'cancel' method"); |
return getEngineService().getLink(false, "persons"); |
At line 182 changed 4 lines. |
public void delete(IRequestCycle cycle) { |
if (log.isDebugEnabled()) { |
log.debug("entered 'delete' method"); |
} |
public ILink delete(IRequestCycle cycle) { |
log.debug("entered 'delete' method"); |
At line 187 changed 1 line. |
getPersonManager().removePerson(getPerson().getId().toString()); |
getPersonManager().removePerson(getPerson().getPersonId().toString()); |
At line 189 changed 3 lines. |
MainMenu nextPage = (MainMenu) cycle.getPage("mainMenu"); |
nextPage.setMessage(getMessage("person.deleted")); |
cycle.activate(nextPage); |
PersonList nextPage = (PersonList) cycle.getPage("persons"); |
nextPage.setMessage(getText("person.deleted")); |
return getEngineService().getLink(false, nextPage.getPageName()); |
At line 194 changed 6 lines. |
public void edit(IRequestCycle cycle) { |
Object[] parameters = cycle.getServiceParameters(); |
Long id = (Long) parameters[0]; |
|
if (log.isDebugEnabled()) { |
log.debug("getting person with id: " + id); |
public ILink save(IRequestCycle cycle) { |
if (getDelegate().getHasErrors()) { |
return null; |
At line 201 removed 9 lines. |
|
setPerson(getPersonManager().getPerson(id.toString())); |
cycle.activate(this); |
} |
|
public void save(IRequestCycle cycle) { |
if (getValidationDelegate().getHasErrors()) { |
return; |
} |
At line 211 changed 1 line. |
boolean isNew = (getPerson().getId() == null); |
boolean isNew = (getPerson().getPersonId() == null); |
At line 218 changed 3 lines. |
MainMenu nextPage = (MainMenu) cycle.getPage("mainMenu"); |
nextPage.setMessage(getMessage(key)); |
cycle.activate(nextPage); |
PersonList nextPage = (PersonList) cycle.getPage("persons"); |
nextPage.setMessage(getText(key)); |
return getEngineService().getLink(false, nextPage.getPageName()); |
At line 222 changed 3 lines. |
PersonForm nextPage = (PersonForm) cycle.getPage("personForm"); |
nextPage.setMessage(getMessage(key)); |
cycle.activate("personForm"); // return to current page |
setMessage(getText(key)); |
return null; // return to current page |
At line 230 changed 1 line. |
You'll notice a number of keys in this file - "person.deleted", "person.added" and "person.updated". These are all keys that need to be in your i18n bundle (ApplicationResources_en.properties). You should've added these at the beginning of this tutorial. If you want to customize these messages, to add the a person's name or something, simply add a {0} placeholder in the key's message and then use setMessage(format(key, stringtoreplace)) method. |
You'll notice a number of keys in this file - "person.deleted", "person.added" and "person.updated". These are all keys that need to be in your i18n bundle (ApplicationResources.properties). You should've added these at the beginning of this tutorial. If you want to customize these messages, to add the a person's name or something, simply add a {0} placeholder in the key's message and then use setMessage(format(key, stringtoreplace)) method. |
At line 329 added 1 line. |
<verifytext description="verify success message" text="${person.updated}"/> |
At line 363 added 1 line. |
<prepareDialogResponse description="Confirm delete" dialogType="confirm" response="true"/> |
At line 365 added 1 line. |
<verifyNoDialogResponses/> |