Switching workplace to another page

Hi Again ,
In some cases I need to switch workplace to another page.( For example I don’t want to show my workplace page before logon and also I want to switch my workplace back to logon page after the user logged off. )
Also I need functions to close the browser like javascript’s close()function.

I couldn’t find relevant methods neither in developer’s guide nor in java doc. Can anyone tell me relevant methods ?

Thanks …

Hi,

please go on as follows:

(1) Create Workplace with empty topic/tree on the left, and with your logon as “empty page”. This is the page which is displayed when nothing is loaded inside the workplace. You pass the constructor inside the MFWorkplaceInfo-constructor.

(2) As reacion of logon inside your logon page build up a new MFWorkplaceInfo-object, now containing the topics/trees/functions for the logged on user and update the workplace:

public void onLogon()
{

IMFWorkpalce wp = (IMFWorkplace)findSessionContext().lookup(IMFWorkplace.WORKPLACE_LOOKUP);
if (wp != null)
{
wp.exchangeWorkplaceInfo();
wp.updateWorkplace(this);
}

}

The workplace should be exchanged now.

Bjoern

Hi Bjoern ,
This is not exactly what I want but it seems reasonable.( I guess you put some restrictions on page navigation because of SWT environment )
I also need functions to close all active pages in order to use in my logoff function .Can you tell me one ?

I’m sending this to share my solution.I don’t know if there is another solution but this one works for me. :wink:

public final class ADPWorkplaceHeader
    extends Adapter
{
 ...
...
  public void onLogout()
    {

         PopupYesNoModel pyn = (PopupYesNoModel)findAdapter(PopupYesNoModel.class);
        pyn.init(replaceLiteral("workplace","m_logout"),
        new LogoutYESCommand(),
        new LogoutNOCommand());
        this.openPopup("/HTMLBasedGUI/popupyesno.html");
        
    }

       public class LogoutYESCommand implements com.softwareag.cis.server.util.ICommand
    {
        public void execute(){
            logout();
        }
    }
   ...
... 
   protected final void logout(){
         ...
         ...         
        if (!checkIfInDevelopmentMode()){
                 //switches workplace to another page

                 //I preferred this way because changing workplace info 
                // doesn't close active pages
                 openPageInTarget("../ADFWorkplace/start.jsp","_top");
        }
    }
...
...
}