Skip to content

Commit 7d0698c

Browse files
author
Pascal Robert
committed
Adding missing Java class
1 parent 2023be0 commit 7d0698c

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.wowodc.ui.components;
2+
3+
import com.webobjects.appserver.WOContext;
4+
import com.webobjects.eocontrol.EOEditingContext;
5+
import com.webobjects.foundation.NSArray;
6+
import com.wowodc.model.BlogEntry;
7+
8+
import er.extensions.components.ERXStatelessComponent;
9+
import er.extensions.eof.ERXEC;
10+
import er.rest.format.ERXRestFormat;
11+
import er.rest.routes.ERXRouteUrlUtils;
12+
13+
public class RssFeedPage extends ERXStatelessComponent {
14+
15+
public BlogEntry item;
16+
private EOEditingContext _editingContext;
17+
18+
public RssFeedPage(WOContext context) {
19+
super(context);
20+
}
21+
22+
public String linkToPost() {
23+
return ERXRouteUrlUtils.actionUrlForRecord(this.context(), item, "show", ERXRestFormat.html().name(), null, false, false);
24+
}
25+
26+
private EOEditingContext editingContext() {
27+
if (_editingContext == null) {
28+
_editingContext = ERXEC.newEditingContext();
29+
}
30+
return _editingContext;
31+
}
32+
33+
public NSArray<BlogEntry> blogEntries() {
34+
return BlogEntry.fetchAllBlogEntries(editingContext(), BlogEntry.LAST_MODIFED.descs());
35+
}
36+
37+
}

0 commit comments

Comments
 (0)