Rename Server-Side Objects and Action Names

If you call an action or request a server-side object, you should know the name of the action or the object. Usually this isn't a big problem because it's your application and you know everything about it. But it's different if you use pre-defined application frames like ProjX.

The application frame has some prerequisites, e.g., the menu will be created after authentication. The application frame does the following call:

AbstractConnection con = getConnection();
Object[] oResult = String[] {"workScreenAccess", 
                            new String[] {"getAvailableWorkScreens", 

This means that you have the following in your Session LCO:

public IWorkScreenAccess getWorkScreenAccess() throws Exception
    IWorkScreenAccess wsac = (IWorkScreenAccess)get("workScreenAccess");
    if (wsac == null)
        wsac = new DBWorkScreenAccess();
        put("workScreenAccess", wsac);
    return wsac;

The application frame won't work if the method name isn't getWorkScreenAccess. If you have a specific naming schema and won't use the same method name, you could do the following:

public IWorkScreenAccess getWSAccess() throws Exception

The Replacement annotation maps the custom method to the expected name. This annotation can be used for object and action names:

public void notifyCustomer() throws Exception

The Replacement will work for LCO names as well:

@Replacement(name = "Public")
public class ExternalSession extends GenericBean 

The LCO can be used with the original name or the Replacement. Both names will work.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information