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);
    }
}

_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to