Changeset 642


Ignore:
Timestamp:
Apr 4, 2008, 3:35:42 PM (15 years ago)
Author:
Nicklas Nordborg
Message:

Updated examples so they work with the latest changes in the BASE core.

Location:
extensions/net.sf.basedb.examples/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.examples/trunk/src/net/sf/basedb/examples/extensions/HelloUserFactory.java

    r636 r642  
    77import net.sf.basedb.core.SessionControl;
    88import net.sf.basedb.core.User;
    9 import net.sf.basedb.util.extensions.Context;
    10 import net.sf.basedb.util.extensions.Extension;
     9import net.sf.basedb.util.extensions.ClientContext;
     10import net.sf.basedb.util.extensions.InvokationContext;
    1111import net.sf.basedb.util.extensions.xml.PathSetter;
    1212import net.sf.basedb.util.extensions.xml.VariableSetter;
     
    3636    Creates a menu item that displays: {prefix} {name of user}!
    3737  */
    38   public MenuItemAction[] getActions(Context context,
    39     Extension<? super MenuItemAction> extension)
     38  public MenuItemAction[] getActions(InvokationContext<? super MenuItemAction> context)
    4039  {
    41     String userName = getUserName(context);
     40    String userName = getUserName(context.getClientContext());
    4241    MenuItemBean helloUser = new MenuItemBean();
    4342    helloUser.setTitle(prefix + " " + userName + "!");
     
    5049    Get the name of the logged in user.
    5150  */
    52   private String getUserName(Context context)
     51  private String getUserName(ClientContext context)
    5352  {
    5453    DbControl dc = null;
  • extensions/net.sf.basedb.examples/trunk/src/net/sf/basedb/examples/extensions/HelloWorldFactory.java

    r641 r642  
    55import net.sf.basedb.clients.web.extensions.menu.MenuItemBean;
    66import net.sf.basedb.util.extensions.ActionFactory;
    7 import net.sf.basedb.util.extensions.Context;
    8 import net.sf.basedb.util.extensions.Extension;
     7import net.sf.basedb.util.extensions.InvokationContext;
    98
    109/**
     
    2524   
    2625  // Return true enable the extension, false to disable it
    27   public boolean prepareContext(Context context,
    28     Extension<? super MenuItemAction> extension)
     26  public boolean prepareContext(InvokationContext<? super MenuItemAction> context)
    2927  {
    3028    return true;
     
    3230
    3331  // An extension may create one or more actions
    34   public MenuItemAction[] getActions(Context context,
    35     Extension<? super MenuItemAction> extension)
     32  public MenuItemAction[] getActions(InvokationContext<? super MenuItemAction> context)
    3633  {
    3734    // This cast is always safe with the web client
    38     JspContext jspContext = (JspContext)context;
     35    JspContext jspContext = (JspContext)context.getClientContext();
    3936    if (helloWorld[0] == null)
    4037    {
    4138      MenuItemBean bean = new MenuItemBean();
    4239      bean.setTitle("Hello factory world!");
    43       bean.setIcon(jspContext.getRoot() + "/images/info.gif");
     40      bean.setIcon(jspContext.getHome(context.getExtension()) + "/images/factory.png");
    4441      bean.setOnClick("alert('Hello factory world!')");
    4542      helloWorld[0] = bean;
Note: See TracChangeset for help on using the changeset viewer.