Hi,
I would like to always show the LoggedIn.RegularUser Name in the banner area. I am using a custom banner with just straight forward html in it. Is there a way to add a tag into this area?
Thanks,
Pete
Data in custom banner
-
- Posts: 7526
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Yes, I figured it would be that way. If you could let me know which jsp file it is to modify and which folder, I will take it from there. If it is any easier to work with the status line rather than the banner, I could put the information at the bottom of the page but I would like to add the usertype as well. I am already having to paste in the form corners on each version anyway.
Cheers,
Pete
Cheers,
Pete
-
- Posts: 7526
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
There must be a directory under AwareIM/Tomcat/webapps/AwareIM. Its name starts with Header_ and is followed by the business space name. In this directory there is a file called BAS_Header.jsp
You need to modify the file to do the following:
1) Add these lines at the top of the file:
<%@ page import="com.bas.connectionserver.server.IInteractionSession" %>
<%@ page import="com.bas.webapp.misc.WebAppConstants" %>
2) Add the following lines before the <body> tag:
<%
IInteractionSession is = (IInteractionSession) session.getAttribute (WebAppConstants.SERVER_SESSION);
String userName = (String) session.getAttribute (WebAppConstants.LOGIN_NAME);
%>
3) You can now use userName variable inside your HTML. You need to refer to this variable like this:
<%=userName%>
for example,
<p> User name is <%=userName%> </p>
You need to modify the file to do the following:
1) Add these lines at the top of the file:
<%@ page import="com.bas.connectionserver.server.IInteractionSession" %>
<%@ page import="com.bas.webapp.misc.WebAppConstants" %>
2) Add the following lines before the <body> tag:
<%
IInteractionSession is = (IInteractionSession) session.getAttribute (WebAppConstants.SERVER_SESSION);
String userName = (String) session.getAttribute (WebAppConstants.LOGIN_NAME);
%>
3) You can now use userName variable inside your HTML. You need to refer to this variable like this:
<%=userName%>
for example,
<p> User name is <%=userName%> </p>
Aware IM Support Team
Banner - business object attributes displayed
Hi Support.
To make further use of the banner, would it be possible to display Business Object attributes in a custom banner, by referencing / modifying a .jsp file, similar to the previous suggestion <%=userName%> in this post?
To make further use of the banner, would it be possible to display Business Object attributes in a custom banner, by referencing / modifying a .jsp file, similar to the previous suggestion <%=userName%> in this post?
-
- Posts: 7526
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
-
- Posts: 7526
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Oh well, here goes:
1) Add the following lines at the top of the file:
<%@ page import="com.bas.shared.domain.configuration.elements.Query" %>
<%@ page import="com.bas.shared.domain.operation.IEntity" %>
<%@ page import="com.bas.shared.data.QueryResult" %>
<%@ page import="com.bas.webapp.misc.WebAppUtils" %>
2) Add the following lines before the <body> tag:
<%
String attrValue = "";
Query q = Query.createFromRuleLanguageString ("FIND MyObject WHERE ...");
QueryResult result = (QueryResult) WebAppUtils.sendMessageToExecutionEngine (session.getServletContext(), session, "executeQuery", new Object [] { q, new Integer (1), new Integer (1), null, null }, 1000000);
IEntity [] ents = result.getEntities ();
if (ents != null && ents.length > 0)
attrValue = ents [0].getAttributeValue ("NameOfObjectAttribute");
%>
You can then use attrValue in the HTML tags using it like this
<%=attrValue%>
1) Add the following lines at the top of the file:
<%@ page import="com.bas.shared.domain.configuration.elements.Query" %>
<%@ page import="com.bas.shared.domain.operation.IEntity" %>
<%@ page import="com.bas.shared.data.QueryResult" %>
<%@ page import="com.bas.webapp.misc.WebAppUtils" %>
2) Add the following lines before the <body> tag:
<%
String attrValue = "";
Query q = Query.createFromRuleLanguageString ("FIND MyObject WHERE ...");
QueryResult result = (QueryResult) WebAppUtils.sendMessageToExecutionEngine (session.getServletContext(), session, "executeQuery", new Object [] { q, new Integer (1), new Integer (1), null, null }, 1000000);
IEntity [] ents = result.getEntities ();
if (ents != null && ents.length > 0)
attrValue = ents [0].getAttributeValue ("NameOfObjectAttribute");
%>
You can then use attrValue in the HTML tags using it like this
<%=attrValue%>
Aware IM Support Team
Are these directions still valid?
I would like to do the same thing but do not have the directory under AwareIM/Tomcat/webapps/AwareIM with a name starts with Header_ and is followed by the business space name. I do have a directory that starts with "BAS_Banner_Main_Main_" followed by the business space name and visual perspective. This directory does not have any jsp files, just my HTML file.aware_support wrote:There must be a directory under AwareIM/Tomcat/webapps/AwareIM. Its name starts with Header_ and is followed by the business space name. In this directory there is a file called BAS_Header.jsp
You need to modify the file to do the following:
1) Add these lines at the top of the file:
<%@ page import="com.bas.connectionserver.server.IInteractionSession" %>
<%@ page import="com.bas.webapp.misc.WebAppConstants" %>
2) Add the following lines before the <body> tag:
<%
IInteractionSession is = (IInteractionSession) session.getAttribute (WebAppConstants.SERVER_SESSION);
String userName = (String) session.getAttribute (WebAppConstants.LOGIN_NAME);
%>
3) You can now use userName variable inside your HTML. You need to refer to this variable like this:
<%=userName%>
for example,
<p> User name is <%=userName%> </p>
-
- Posts: 7526
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
No, this file is not there any more. The banner files are stored in the directory you mentioned. There are also "LAYOUT" files in the AwareIM/Tomcat/webapps/AwareIM directory that control overall layout of the screen. So you need to add the same changes to one of these files - depends where you want it to be.
Aware IM Support Team
Thanks Support.
Here are a few more questions.
What attributes can be accessed this way?
Specifically, I have my own business object I use for logins. I added this object to the SystemUser in the Business object groups. Can I access the different attributes of this object?
If not, can I access it by performing a query similar to what is described in one of the above replies?
Would it be easier to get the business object from the server by its id? How would I determine the id?
Thanks again.
Here are a few more questions.
What attributes can be accessed this way?
Specifically, I have my own business object I use for logins. I added this object to the SystemUser in the Business object groups. Can I access the different attributes of this object?
If not, can I access it by performing a query similar to what is described in one of the above replies?
Would it be easier to get the business object from the server by its id? How would I determine the id?
Thanks again.