Previous | Next | WireHose Developers Guide |
WHTagDrillerPage determines whether or not to show an "add this to
my page" button by calling WHApplicationHelper's
userCanEditObject
method, with the user as the object in
question. By default, the guest user isn't permitted to edit
anything, so you'll override that behavior by implementing a method
from the WHApplicationHelper.Delegate interface.
WHApplicationHelper.setDelegate(this);
public boolean userCanEditObject(WHUser user, Object object, WOContext context) { if (user.isGuest() && user.equals(object) && "WHTagDrillerPage".equals(context.page().valueForKey("pageName"))) { return true; } else { return super.userCanEditObject(user, object, context); } }
When the tag driller page checks to see if the user can edit itself, WHApplicationHelper will call this method, and it will return true, so the button will be displayed.
http://127.0.0.1:2020/
In the next section, you'll build a custom subclass of WHTagDrillerPage so Hello World can create a new user when the button is clicked.
Copyright ©2000-2003 Gary Teter. All rights reserved. WireHose is a trademark of Gary Teter.