| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
package net.sourceforge.pebble.web.view.impl; |
| 33 |
|
|
| 34 |
|
import net.sourceforge.pebble.Constants; |
| 35 |
|
import net.sourceforge.pebble.domain.BlogEntry; |
| 36 |
|
import net.sourceforge.pebble.api.decorator.ContentDecoratorContext; |
| 37 |
|
import net.sourceforge.pebble.web.view.HtmlView; |
| 38 |
|
|
| 39 |
|
import java.util.List; |
| 40 |
|
import java.util.Arrays; |
| 41 |
|
import java.util.Collections; |
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
@author |
| 47 |
|
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 3 |
Complexity Density: 0,23 |
|
| 48 |
|
public class BlogEntryFormView extends HtmlView { |
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 1 |
Complexity Density: 0,1 |
|
| 53 |
0
|
public void prepare() {... |
| 54 |
0
|
BlogEntry blogEntry = (BlogEntry)getModel().get(Constants.BLOG_ENTRY_KEY); |
| 55 |
0
|
BlogEntry previewBlogEntry = (BlogEntry)blogEntry.clone(); |
| 56 |
|
|
| 57 |
0
|
ContentDecoratorContext context = new ContentDecoratorContext(); |
| 58 |
0
|
context.setView(ContentDecoratorContext.PREVIEW); |
| 59 |
0
|
context.setMedia(ContentDecoratorContext.HTML_PAGE); |
| 60 |
0
|
blogEntry.getBlog().getContentDecoratorChain().decorate(context, previewBlogEntry); |
| 61 |
0
|
getModel().put("previewBlogEntry", previewBlogEntry); |
| 62 |
|
|
| 63 |
0
|
List timeZones = Arrays.asList(java.util.TimeZone.getAvailableIDs()); |
| 64 |
0
|
Collections.sort(timeZones); |
| 65 |
0
|
getModel().put("timeZones", timeZones); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| 71 |
|
@return |
| 72 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
| 73 |
0
|
public String getTitle() {... |
| 74 |
0
|
BlogEntry blogEntry = (BlogEntry)getModel().get(Constants.BLOG_ENTRY_KEY); |
| 75 |
0
|
return blogEntry.getTitle(); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
|
| 81 |
|
@return |
| 82 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 83 |
0
|
public String getUri() {... |
| 84 |
0
|
return "/WEB-INF/jsp/blogEntryForm.jsp"; |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
} |