Changes for page Your First D2W Project

Last modified by Bastian Triller on 2013/01/12 00:43

From version 9.1
edited by Pascal Robert
on 2012/08/05 06:39
Change comment: There is no comment for this version
To version 10.1
edited by Pascal Robert
on 2012/08/05 07:20
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -144,7 +144,7 @@
144 144  
145 145  {{code language="java"}}
146 146  
147 - public WOComponent listPageForEntityName(String entityName) {
147 +public WOComponent listPageForEntityName(String entityName) {
148 148   ListPageInterface listPage = D2W.factory().listPageForEntityNamed(entityName, session());
149 149   EODataSource dataSource = new EODatabaseDataSource(session().defaultEditingContext(), entityName);
150 150   listPage.setDataSource(dataSource);
... ... @@ -157,18 +157,18 @@
157 157  
158 158  {{code language="java"}}
159 159  
160 - public WOComponent listPostsAction() {
161 - return listPageForEntityName(BlogEntry.ENTITY_NAME);
160 +public WOComponent listPostsAction() {
161 + return listPageForEntityName(BlogEntry.ENTITY_NAME);
162 162   }
163 -
163 +
164 164   public WOComponent listAuthorsAction() {
165 - return listPageForEntityName(Author.ENTITY_NAME);
165 + return listPageForEntityName(Author.ENTITY_NAME);
166 166   }
167 -
167 +
168 168   public WOComponent createPostAction() {
169 169   return newObjectForEntityName(BlogEntry.ENTITY_NAME);
170 170   }
171 -
171 +
172 172   public WOComponent createAuthorAction() {
173 173   return newObjectForEntityName(Author.ENTITY_NAME);
174 174   }
... ... @@ -176,7 +176,7 @@
176 176   public WOComponent searchAuthorsAction() {
177 177   return queryPageForEntityName(Author.ENTITY_NAME);
178 178   }
179 -
179 +
180 180   public WOComponent searchPostsAction() {
181 181   return queryPageForEntityName(BlogEntry.ENTITY_NAME);
182 182   }
... ... @@ -187,13 +187,13 @@
187 187  
188 188  {{code language="java"}}
189 189  
190 - public WOComponent homeAction() {
190 +public WOComponent homeAction() {
191 191   return listPageForEntityName(BlogEntry.ENTITY_NAME);
192 192   }
193 193  
194 194  {{/code}}
195 195  
196 -Save the file and run the app.
196 +Save the file and run the app.
197 197  
198 198  After login, you will see the blog entries and if you click the **Authors** tab, you see the list of authors. Each item in the list have 3 actions by default: **Inspect** (view the object), **Edit** (modify the object) and the red X button to delete the object.
199 199  
... ... @@ -201,9 +201,10 @@
201 201  
202 202  Now, edit a blog entry. If you click on the field next to the **Creation Date** or **Last Modified**, a calendar widget appears because those two fields are marked as dates in the data model, that's EOF and D2W magic at work.
203 203  
204 -Viewing or editing a blog entry can be improve. The two things we want to customize:
204 +Viewing or editing a blog entry can be improve. The three things we want to customize:
205 205  
206 206  * to remove the email address of the author when viewing the blog entry
207 207  * to make the **Content** field to be a text area instead of a input field, and even better: attach TinyMCE to the text area
208 +* modifying the order of attributes when viewing or editing a blog entry so that the title field is the first field, followed by content, the two dates and the author
208 208  
209 209  Those two customizations can be done by adding D2W rules. The D2W rules are in two files, located in the **Resources** folder, **d2w.d2wmodel** and **user.d2wmodel**. To edit the files, make sure you installed RulesModeler, a Mac application that manages D2W rule files. If RuleModeler is present, you can simply double-click on **d2w.d2wmodel** and the file will open in RulesModeler.