Obtaining information about the user and the session
Typically, new Actuate Information Console web pages need access to session information. Your application server and Information Console store information about the session that you can use in your web pages. Obtain the serverURL, volume, and other information from your application server using the JSP request variable, as shown in the following example.
String volume = request.getParameter("volume");You can also obtain the context root path from your application server, as shown in the following code:
String contextRoot = request.getContextPath();Additionally, Actuate Information Console stores a wide variety of information about the session in UserInfoBean. To access UserInfoBean, place the following line of code near the top of your JSP:
<jsp:useBean id="userinfobean" class="com.actuate.activeportal.beans.UserInfoBean"scope="session"/>After this line, you can access information in the JavaBean by the appropriate get method. The most important method for new pages is the getIportalid( ) method. This method retrieves the user’s authentication ID with the server. This ID is based on the server, volume, and user name information that the user supplied on the login page.
To write generic code, you need to determine whether your application is running. Information Console includes a utility class, iPortalRepository, that provides this information. To access this class in your JSP, place the following code at the head of your JSP:
Then use code similar to the following line to check the repository type:
boolean isEnterprise =iPortalRepository.REPOSITORY_ENCYCLOPEDIA.equalsIgnoreCase(userinfobean.getRepositoryType());Use the authentication ID and the repository type to access the server with JSP custom Actuate tags and calls to Information Console beans, as shown in the following examples:
com.actuate.reportcast.utils.AcLocale acLocale =userinfobean.getAcLocale();boolean isEnterprise =iPortalRepository.REPOSITORY_ENCYCLOPEDIA.equalsIgnoreCase(userinfobean.getRepositoryType());
(c) Copyright Actuate Corporation 2011 |
![]() |