Previous | Next
WireHose Developers Guide

Add this to my page

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.

  1. Uncomment this line in's constructor:
  2. Add this method:
    public boolean userCanEditObject(WHUser user, Object object, WOContext context) {
        if (user.isGuest() && user.equals(object) && 
            "WHTagDrillerPage".equals("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.

  3. Build and launch the application, then open this URL in your browser:
  4. When you browse to a tag which has matching resources, the "Add this to my page" will appear.

    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.

Previous | Next