Focal Point
[CLOSED] BID name in banner?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/969106172

October 19, 2009, 05:46 PM
MacLonghorn
[CLOSED] BID name in banner?
I have a custom dashboard template I've created that I intend to use several times. Is there any way to grab the description of the specific dashboard view and dynamically put it in the banner?

This message has been edited. Last edited by: Kerry,


Thanks.

Mark
WF 7.6 Windows
October 20, 2009, 09:01 AM
dlogan
I don't see any easy way to do this.

If there was a way to get the value of WORP_MPV and dynamically use that to choose a banner it would meet your needs.

However, in looking through the folder structure and the files that make up the templates/views I can not see any direct reference to WebFOCUS Variables being substituted.

The closest thing I see is:
<!--Links-->
and
<!--Message-->


If I have time I'll play with this more and see what I can find out. However, those look like flags for a substitution of data.

If you can figure out what criteria can be substituted there it might be possible to load a value you can use some JavaScript to detect and load the appropriate banner.

Its a long shot, but its all I see with quickly looking at things.

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 20, 2009, 10:54 AM
MacLonghorn
I don't see anything out of the box either, so it's probably going to require modification of the JSPs in the WORP folder under WEBAPPS.


Thanks.

Mark
WF 7.6 Windows
October 20, 2009, 11:19 AM
MacLonghorn
Except I'm not looking to read it from WF. This would be done via the webapp and jsp, I'm thinking. That's the code that displays the dashboard view in the first place. I was thinking maybe the file:
WebFOCUS76\webapps\webfocus76\worp\jsp\banner\WORP_Banner.jsp


This file creates the links, etc that show in the banner, and I'm wondering if there's a method/function in the worp classes that would give me access to the dashboard description.


Thanks.

Mark
WF 7.6 Windows
October 20, 2009, 11:46 AM
dlogan
MacLongHorn,
Ah, that is the secret.

Add the following to the top of WORP_banner.jsp
  String WORP_MPV = worpBannerBlock.getUserPrefs().getMpv();


e.g.
<jsp:useBean id="worpBannerBlock" scope="request" type="ibi.worp.client.banner.WORP_BannerBlock"/>
<%
  final String JAVASCRIPT_PREFIX = "javascript:";
  int bannerLinksCount = 0;
  String WORP_MPV = worpBannerBlock.getUserPrefs().getMpv();


You can then output the Group View using the following code:
<%=WORP_MPV%>


That can be inserted anywhere within the HTML.

I'm using Firebug on the JavaScript now to see if I can see exactly what is loading/setting the image in the background.

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 20, 2009, 12:15 PM
dlogan
Ok, I got it :-).

So in addition to my modifications above, add something like the following to the HEAD block of WORP_banner.jsp

    <script language="JavaScript" type="text/JavaScript">
      function changeLogo(){
        var imgLogo = document.getElementById("Company Logo");
        var MPV = "<%=WORP_MPV%>";
        
        if (MPV == "public") {
          imgLogo.src = imgLogo.src.replace("logo", "4_3");
        } else {
          imgLogo.src = imgLogo.src.replace("logo", "4_1");
        }
        alert(MPV);
      }
    </script> 


Then change the following line:
<body LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" onload="javascript:decideToShowOrHideLanguageHref();" onunload="javascript:closeAllOpenedWindows();">
  


To the following:
<body LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" onload="javascript:decideToShowOrHideLanguageHref();changeLogo();" onunload="javascript:closeAllOpenedWindows();">


Wallah, the logo dynamically changes depending on the group view :-).

Based on the URL used for the WORP image:
/ibi_apps/Controller?WORP_REQUEST_TYPE=WORP_GET_FILE&FILE_NAME=worp_custom/aa_gbv/logo.gif


It also seems you might be able to create a folder under:
/ibi/WebFOCUS76/worp/

Called "logos" and do something like this:
    <script language="JavaScript" type="text/JavaScript">
      function changeLogo(){
        var imgLogo = document.getElementById("Company Logo");
        var MPV = "<%=WORP_MPV%>";
        imgLogo.src = "/ibi_apps/Controller?WORP_REQUEST_TYPE=WORP_GET_FILE&FILE_NAME=logos/<%=WORP_MPV%>.jpg";
      }
    </script>  


I have not tested this last bit though...

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 20, 2009, 12:23 PM
Francis Mariani
Why logos? The View Name is a piece of text.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 20, 2009, 12:26 PM
dlogan
Ok, that last bit of code I had did not work, but the following does:

    <script language="JavaScript" type="text/JavaScript">
        function changeLogo(){
          var imgLogo = document.getElementById("Company Logo");
          var MPV = "<%=WORP_MPV%>";
          imgLogo.src = "/ibi_apps/Controller?WORP_REQUEST_TYPE=WORP_GET_FILE&FILE_NAME=worp_custom/logos/" + MPV + ".jpg";
        }
    </script>  


It does appear it restricts the link to "work_custom" (which is actually good from a security standpoint).

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 20, 2009, 12:47 PM
MacLonghorn
ah yes, that's the type of thing I thought might do it. let me give that a try. thanks all.


Thanks.

Mark
WF 7.6 Windows
October 20, 2009, 01:23 PM
MacLonghorn
except
 getUserPrefs().getMpv() 
returns the folder name, not the "nice" description one would see in the BID View Builder, such as "Executive Information Portal"


Thanks.

Mark
WF 7.6 Windows
October 20, 2009, 02:03 PM
dlogan
Mac,
Sorry, but the "description" value does not appear to be easily attainable. Its not within any of the classes/info presently being used by WORP_banner.

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 20, 2009, 02:14 PM
Francis Mariani
Is this not because the only location the view name is stored is in C:\ibi\WebFOCUS76\worp\conf\mpv.xml and in some kind of encrypted manner?

        <BLOCK
            Description="1aa0e0ef7edc568364cef2dG2ca6cda7c42b11f0180Gfdf0"
            Folder="af_gbv" GroupName="salesgroup"
            GroupTitle="1aa0e0ef7edc56834d49b18d29d2e8f88f76e65b2b078f9a"
            Name="af_gbv" dualLogin="no" redirectId="af_gbv"/>



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 20, 2009, 02:33 PM
MacLonghorn
probably so. i found this in the WORP_Views.jsp:
        <jsp:useBean id="worpBlock" scope="page" type="ibi.worp.xml.WORP_Block"/>
        <tr>
          <td class="anchor1">
            <control:conditional condition="<%=isMPVRequest%>">
              <a class="anchor1" href="<%=MessageFormat.format(baseHref, new Object[] { worpBlock.getName() } )%>" target="_parent"><%=worpBlock.getDescriptionDecrypted()%></a>


So I'm currently trying to plug this code into WORP_Banner.jsp somehow, but I keep getting an error.


Thanks.

Mark
WF 7.6 Windows
October 20, 2009, 03:01 PM
dlogan
Mark,
The method for returning this value (getDescryptionDecrypted) does not appear to exist under a banner object, and does not seem to be easily accessible to the banner object as best as I can tell.
I'll probably play with this more later, but I was not able to find an easy way to do this.

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 20, 2009, 04:45 PM
MacLonghorn
How do you know? Where can I find the classes/methods available?


Thanks.

Mark
WF 7.6 Windows
October 21, 2009, 08:22 AM
dlogan
Mark,
If you take a look at the code within the JSP, you can see that the banner is of a different object type then what is used decrypt and get a copy of the description.
If you run searches throughout the JSP's you will see that the banner object type never carries a reference to something that describes the WORP view description.

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


October 21, 2009, 08:59 AM
Francis Mariani
Mark, it appears to me that nothing is documented, probably because we're not supposed to play around with any of this.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 21, 2009, 09:03 AM
Tony A
quote:
Wallah,
???? Did you mean "voila"?

T
October 21, 2009, 09:06 AM
Francis Mariani
OOH, I was so tempted to ask the same!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 21, 2009, 09:42 AM
dlogan
quote:
Wallah


:-P

I guess this is not what I meant:
http://dictionary.reference.com/browse/wallah

So... yes... voila...
http://dictionary.reference.com/browse/voila

I guess that is what happens when you only ever hear a word spoken.

quote:
Mark, it appears to me that nothing is documented, probably because we're not supposed to play around with any of this.


Francis,
Yes, I'd say that is exactly the case. This is not meant to be played with.

Thanks,
Doug Logan


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP