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

--Rename server-side objects and action names

Documents for the development of and with JVx.

--Rename server-side objects and action names

Postby Development@SIB » Sat Feb 13, 2016 6:52 pm



This article is outdated - please use our new system at

https://doc.sibvisions.com




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 pre-requirements, e.g. the menu will be created after authentication. The application frame does following call:

Syntax: [ Download ] [ Hide ]
AbstractConnection con = getConnection();

Object[] oResult = con.call(new String[] {"workScreenAccess",
                                          "workScreenAccess",
                                          "workScreenAccess"},
                            new String[] {"getAvailableWorkScreens",
                                          "getAvailableRoles",
                                          "getAvailableMetaData"});

This means that you have following in your Session LCO:

Syntax: [ Download ] [ Hide ]
public IWorkScreenAccess getWorkScreenAccess() throws Exception
{
    IWorkScreenAccess wsac = (IWorkScreenAccess)get("workScreenAccess");

    if (wsac == null)
    {
        wsac = new DBWorkScreenAccess();
        ((DBWorkScreenAccess)wsac).setDBDataSource(getDBAccess());

        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 following:

Syntax: [ Download ] [ Hide ]
@Replacement(name="workScreenAccess")
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:

Syntax: [ Download ] [ Hide ]
@Replacement(name="sendCustomerEmail")
public void notifyCustomer() throws Exception
{
   ...
}
User avatar
Development@SIB
 
Posts: 325
Joined: Mon Sep 28, 2009 1:54 pm

Return to Documentation