Hi Richard,
the reason why there's no @OutputField annotation is because there is
an @OutputProperty annotation that is much more useful. More
information can be found here:
http://rifers.org/wiki/display/RIFE/Annotations+support+for+element
+declaration
We can add an @OutputField annotation, but I'm not sure that it will
be used much.
Take care,
Geert
On 30 Apr 2007, at 06:46, Richard Reich wrote:
I'm very new to RIFE. So I may be missing something very obvious.
I'm playing with the "friends" example. Adding stuff, changing stuff.
Right now, I'm trying to expunge as much XML as possible while
maintaining a clean component structure. I also want to remove as
many
string literals as possible from annotations. (I rely on smart IDE
searches and typing completions.) So I'd very much like to be able to
treat an element's output in the same way that the ExitField treats an
exit. That is, I'd like an annotation OutputField applicable to
public
static final Strings.
Is this a reasonable request, consistent with the RIFE design outlook?
FYI, the relevant fragment of the code I've been playing with is
below,
if that helps.
-r
Display.java:
@Elem(outputs = @Output(name="friendid")) // nice to get rid of the
"outputs"
public class Display extends Element {
@ExitField
public static final String EXIT_EDIT = "edit";
public void processElement() {
final Template t = getHtmlTemplate("display");
final Datasource ds =
Datasources.getRepInstance().getDatasource(Config.getRepInstance
().getString("DATASOURCE"));
GenericQueryManager<Friend> fm =
GenericQueryManagerFactory.getInstance(ds, Friend.class);
fm.restore(new DbBeanFetcher<Friend>(ds, Friend.class) {
public boolean gotBeanInstance(Friend friend) {
setExitQuery(t, EXIT_EDIT, new String[] {"friendid",
Integer.toString(friend.getId())});
t.setBean(friend);
t.appendBlock("rows", "row");
return true;
}
});
print(t);
}
}
--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users