hi folks,
how is it possible to use in the bootstrapclass (-> workplace-Feature) the
“replaceLiteral”-method.
How can i get the session-context in this class to determin the ‘Language’-settings…
hi folks,
how is it possible to use in the bootstrapclass (-> workplace-Feature) the
“replaceLiteral”-method.
How can i get the session-context in this class to determin the ‘Language’-settings…
Hi Martin,
I assume you are currently using the multi frame workplace by supporting interface IMFWorkplaceBootstrapInfoProvider.
Please “upgrade” your implementation to “IMFWorkplaceBootstrapInfoProvider2” which is built in the following way:
public interface IMFWorkplaceBootstrapInfoProvider2
{
public MFWorkplaceInfo getWorkplaceInfo(IMFWorkplaceBootstrapInfo envInfo);
}
The parameter “envInfo” of IMFworkplaceBootstrapInfo passes you context information:
public interface IMFWorkplaceBootstrapInfo
{
public SessionContext getCISessionContext();
public Map getInitParamMap();
public ILookupContext getSessionContext();
public String getSessionId();
public HttpServletRequest findHttpServletRequest();
public HttpServletResponse findHttpServletResponse();
}
Use the SessionContext to acces the current language of the user’s session.
The method replaceLiteral() is only available in the adapter objects. But: this method is a simple wrapping of the Multi Language Management. Just directly call the multi language management on your own from your workplace implementation. Just to show to you: this is the Adpater.replaceLiteral-implementation:
public String replaceLiteral(String application,
String literal)
{
checkSessionContextAvailable();
return MLManagerFactory.
getMLManager().getString(m_sessionContext.getLanguage(),
m_pageContextRoot,
application,
literal);
}
This might give you an idea. Also have a look into the API doc.
Hope this helps…
Bjoern
hi Bj
…oops, I did some testing. And found no problems. This is my workplace adminstrating class:
import com.softwareag.cis.workplace.IMFWorkplaceBootstrapInfo;
import com.softwareag.cis.workplace.IMFWorkplaceBootstrapInfoProvider2;
import com.softwareag.cis.workplace.MFWorkplaceInfo;
public class MLWorkplaceInfoProvider implements
IMFWorkplaceBootstrapInfoProvider2
{
public MFWorkplaceInfo getWorkplaceInfo(IMFWorkplaceBootstrapInfo envInfo)
{
MFWorkplaceInfo result = new MFWorkplaceInfo();
System.out.println("Language = " + envInfo.getCISessionContext().getLanguage());
return result;
}
}
I look into the DOS box, and find the language information output when calling the workplace.
Are you sure that not one of your functions is somehow accessing the workplace prior to us…?
Bjoern