--Rename server-side objects and action names
1 post
• Page 1 of 1
--Rename server-side objects and action names
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:
AbstractConnection con = getConnection();
Object[] oResult = con.call(new String[] {"workScreenAccess",
"workScreenAccess",
"workScreenAccess"},
new String[] {"getAvailableWorkScreens",
"getAvailableRoles",
"getAvailableMetaData"});
Object[] oResult = con.call(new String[] {"workScreenAccess",
"workScreenAccess",
"workScreenAccess"},
new String[] {"getAvailableWorkScreens",
"getAvailableRoles",
"getAvailableMetaData"});
This means that you have following in your Session LCO:
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;
}
{
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:
@Replacement(name="workScreenAccess")
public IWorkScreenAccess getWSAccess() throws Exception
{
...
}
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:
-
Development@SIB - Posts: 325
- Joined: Mon Sep 28, 2009 1:54 pm
1 post
• Page 1 of 1