Topic
  • 31 replies
  • Latest Post - ‏2014-01-24T13:55:54Z by VeljkoC
mpemma
mpemma
20 Posts

Pinned topic Automatic Start Center Refreshing for 2mins.

‏2011-04-15T10:12:02Z |
Hi All,
I have a requirement for refreshing the start center automatically for every 2 mins.
I have added java script code in Control.jsp in residing in Maximo folder.

<script type=text/javascript>
// The time out value is set to be 20,000 milli-seconds (or 20
seconds)
setTimeout(' document.location=document.location' ,20000);
</script>

This is not working for me. I am working in Maximo 7 Version. Any help would be aprreciated.

Thanks in Advance
Manasa.
Updated on 2012-12-18T06:30:44Z at 2012-12-18T06:30:44Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-04-15T10:26:09Z  
    Even we have the same requirement in our project.

    Instead of document.location=document.location try with window.location=window.location.

    This is working fine with our environemnt.
  • mpemma
    mpemma
    20 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-04-15T14:33:43Z  
    Even we have the same requirement in our project.

    Instead of document.location=document.location try with window.location=window.location.

    This is working fine with our environemnt.
    Hi Valavan,
    Client came up with new req, screen refresh for a particular group, Can we do it ?
    Please help me. I found some code in Maximokb forums. Will this code be helpful ?

    http://www.maximokb.com/kb/index.php?View=entry&EntryID=161

    By the way, have you worked with TCS earlier ? if yes? i have heard about you from VijayaBanu and Grace Raj. I was with them for last two projects.

    Thanks
    Manasa.
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-04-16T07:23:52Z  
    • mpemma
    • ‏2011-04-15T14:33:43Z
    Hi Valavan,
    Client came up with new req, screen refresh for a particular group, Can we do it ?
    Please help me. I found some code in Maximokb forums. Will this code be helpful ?

    http://www.maximokb.com/kb/index.php?View=entry&EntryID=161

    By the way, have you worked with TCS earlier ? if yes? i have heard about you from VijayaBanu and Grace Raj. I was with them for last two projects.

    Thanks
    Manasa.
    Hi Manasa,

    Yes, I was working with TCS earlier. I know them very well.

    Could you please send me your requirement. You can use the same code which you have found in the maximo KB if your requirement is related to particular group.

    Thanks
    Valavan.
  • mpemma
    mpemma
    20 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-04-16T17:17:03Z  
    Hi Manasa,

    Yes, I was working with TCS earlier. I know them very well.

    Could you please send me your requirement. You can use the same code which you have found in the maximo KB if your requirement is related to particular group.

    Thanks
    Valavan.
    Hi Valavan,
    The requirement is Maximo screen will be connected to a projector and the details have to be refreshed automatically for every two minutes.
    This will be used only by a particular group.
    I have got the code in Maximokb forum, but not sure where to write this code in Control.jsp because earlier code also didn't work for me when I changed the code to window.location in the java script.
    If you could let me know where to write the code whether in the beginning or at the end in Control.Jsp file that would be of great help. Was wondering because my control.jsp file is not residing in the same folder structure that is mentioned in the forum.(Maximo\applications\maximo\maximouiweb\webmodule\webclient\controls\startcenter\control.jsp)
    My control.jsp is in components folder. Does this effect the refresh part in any way?
    Any help would be appreciated !!

    Thanks and regards,
    Manasa.
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-04-18T07:00:19Z  
    • mpemma
    • ‏2011-04-16T17:17:03Z
    Hi Valavan,
    The requirement is Maximo screen will be connected to a projector and the details have to be refreshed automatically for every two minutes.
    This will be used only by a particular group.
    I have got the code in Maximokb forum, but not sure where to write this code in Control.jsp because earlier code also didn't work for me when I changed the code to window.location in the java script.
    If you could let me know where to write the code whether in the beginning or at the end in Control.Jsp file that would be of great help. Was wondering because my control.jsp file is not residing in the same folder structure that is mentioned in the forum.(Maximo\applications\maximo\maximouiweb\webmodule\webclient\controls\startcenter\control.jsp)
    My control.jsp is in components folder. Does this effect the refresh part in any way?
    Any help would be appreciated !!

    Thanks and regards,
    Manasa.
    What is maximo version 7 or 6. Id it is maximo 7 then you have to do this in startcenter-options.jsp
  • mpemma
    mpemma
    20 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-04-19T07:58:04Z  
    What is maximo version 7 or 6. Id it is maximo 7 then you have to do this in startcenter-options.jsp
    Hi Valavan,
    Thanks alot for your help.After adding code to the startcenter-options.jsp.Automatic screen refresh.But when I added the code for a particular group, this is not working.It throws error at
    this line.

    <mro:handleevent eventtype="pageinit">
    <mro:instantiatebean beanclass="psdi.webclient.system.beans.DataBean"/>

    When I checked the bean folder, there is no StartCenterAppBean class. It resides in classes\psdi\webclient\beans\startcntr in maximo7.
    This particular class is not being called. Is there any way to resolve this issue.

    Thanks
    Manasa.
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-04-19T10:34:32Z  
    • mpemma
    • ‏2011-04-19T07:58:04Z
    Hi Valavan,
    Thanks alot for your help.After adding code to the startcenter-options.jsp.Automatic screen refresh.But when I added the code for a particular group, this is not working.It throws error at
    this line.

    <mro:handleevent eventtype="pageinit">
    <mro:instantiatebean beanclass="psdi.webclient.system.beans.DataBean"/>

    When I checked the bean folder, there is no StartCenterAppBean class. It resides in classes\psdi\webclient\beans\startcntr in maximo7.
    This particular class is not being called. Is there any way to resolve this issue.

    Thanks
    Manasa.
    Could you please attach the log file for more details.
  • mpemma
    mpemma
    20 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-04-19T11:29:20Z  
    Could you please attach the log file for more details.
    Hi Valavan,
    This error comes on the Start center page. JSP processing error.

    HTTP Error Code: 500
    Error Message:
    com.ibm.ws.jsp.JspCoreException: JSPG0049E: /webclient/components/startcenter-options.jsp failed to compile :
    JSPG0091E: An error occurred at line: 21 in the file: /webclient/components/startcenter-options.jsp
    JSPG0093E: Generated servlet error from file: /webclient/components/startcenter-options.jsp
    -----**\maximouiweb.war\webclient\components\_startcenter_2D_options.java : 128 : StartCenterAppBean cannot be resolved to a type
    JSPG0091E: An error occurred at line: 21 in the file: /webclient/components/startcenter-options.jsp
    JSPG0093E: Generated servlet error from file: /webclient/components/startcenter-options.jsp
    -----**\maximouiweb.war\webclient\components\_startcenter_2D_options.java : 128 : StartCenterAppBean cannot be resolved to a type
    JSPG0091E: An error occurred at line: 21 in the file: /webclient/components/startcenter-options.jsp

    I hope this information is will be helpful to track the error.
    StartAppBean is residing in *\maximouiweb\webmodule\WEB-INF\classes\psdi\webclient\beans\startcntr, not in DataBean.This is the difference I could see in Maximo 6 and Maximo7.

    At the bottom of the start center all the result sets that I created are appearing fine.
    This error is coming on the same page. I changed the code to the security group I created and then added to the start center-options.jsp. Not sure where I am going wrong.

    Please let me know if you need some more information about the error.

    Thanks
    Manasa.
  • mpemma
    mpemma
    20 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-04-19T14:24:16Z  
    • mpemma
    • ‏2011-04-19T11:29:20Z
    Hi Valavan,
    This error comes on the Start center page. JSP processing error.

    HTTP Error Code: 500
    Error Message:
    com.ibm.ws.jsp.JspCoreException: JSPG0049E: /webclient/components/startcenter-options.jsp failed to compile :
    JSPG0091E: An error occurred at line: 21 in the file: /webclient/components/startcenter-options.jsp
    JSPG0093E: Generated servlet error from file: /webclient/components/startcenter-options.jsp
    -----**\maximouiweb.war\webclient\components\_startcenter_2D_options.java : 128 : StartCenterAppBean cannot be resolved to a type
    JSPG0091E: An error occurred at line: 21 in the file: /webclient/components/startcenter-options.jsp
    JSPG0093E: Generated servlet error from file: /webclient/components/startcenter-options.jsp
    -----**\maximouiweb.war\webclient\components\_startcenter_2D_options.java : 128 : StartCenterAppBean cannot be resolved to a type
    JSPG0091E: An error occurred at line: 21 in the file: /webclient/components/startcenter-options.jsp

    I hope this information is will be helpful to track the error.
    StartAppBean is residing in *\maximouiweb\webmodule\WEB-INF\classes\psdi\webclient\beans\startcntr, not in DataBean.This is the difference I could see in Maximo 6 and Maximo7.

    At the bottom of the start center all the result sets that I created are appearing fine.
    This error is coming on the same page. I changed the code to the security group I created and then added to the start center-options.jsp. Not sure where I am going wrong.

    Please let me know if you need some more information about the error.

    Thanks
    Manasa.
    Hi,

    I got the problem resolved. It was not pointing to the correct bean class folder in Maximo7.

    Thanks Valavan.

    Regards
    Manasa.
  • pmarie
    pmarie
    13 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-06-28T17:05:25Z  
    • mpemma
    • ‏2011-04-19T14:24:16Z
    Hi,

    I got the problem resolved. It was not pointing to the correct bean class folder in Maximo7.

    Thanks Valavan.

    Regards
    Manasa.
    Hello,
    I'm having the same issue. The code I included to startcenter-options.jsp is the following :

    
    <mro:handleevent eventtype=
    "pageinit"> <mro:instantiatebean beanclass=
    "*psdi.webclient.beans.startcntr.StartCenterAppBean*"/>   <% 
    
    try 
    { StartCenterAppBean startcenter = (StartCenterAppBean)sessionContext.getCurrentApp().getAppBean(); psdi.mbo.MboRemote mbo = startcenter.getMbo(); String where = 
    "groupname = 'MAXADMIN' and userid in (select userid from maxuser where personid = '" + mbo.getUserInfo().getPersonId() + 
    "')"; psdi.mbo.MboSetRemote groups = mbo.getMboSet(
    "$GROUPUSER", 
    "GROUPUSER", where); groups.moveFirst(); 
    
    if ( !groups.isEmpty() ) 
    { %> <script type=text/javascript> setTimeout(
    ' window.location=window.location' ,10000); </script> <% 
    } 
    } 
    
    catch (Exception e) 
    { e.printStackTrace(); 
    } %>
    


    Can you please let me know what bean class folder you are calling?

    Thanks in advance
    Philippe
  • mpemma
    mpemma
    20 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-06-29T08:45:14Z  
    • pmarie
    • ‏2011-06-28T17:05:25Z
    Hello,
    I'm having the same issue. The code I included to startcenter-options.jsp is the following :

    <pre class="jive-pre"> <mro:handleevent eventtype= "pageinit"> <mro:instantiatebean beanclass= "*psdi.webclient.beans.startcntr.StartCenterAppBean*"/> <% try { StartCenterAppBean startcenter = (StartCenterAppBean)sessionContext.getCurrentApp().getAppBean(); psdi.mbo.MboRemote mbo = startcenter.getMbo(); String where = "groupname = 'MAXADMIN' and userid in (select userid from maxuser where personid = '" + mbo.getUserInfo().getPersonId() + "')"; psdi.mbo.MboSetRemote groups = mbo.getMboSet( "$GROUPUSER", "GROUPUSER", where); groups.moveFirst(); if ( !groups.isEmpty() ) { %> <script type=text/javascript> setTimeout( ' window.location=window.location' ,10000); </script> <% } } catch (Exception e) { e.printStackTrace(); } %> </pre>

    Can you please let me know what bean class folder you are calling?

    Thanks in advance
    Philippe
    Hi,
    Actually in the code given for particular security group in maximokb does not work for maximo 7.
    this is because : mro instatiation is not being recognized in maximo 7. New code needs to be appended for maximo7. Remove the instantiation line code. We tried Getting the app bean associated with the current start centre by adding path to the existing code and it worked.

    Thanks
    Manasa.
  • pmarie
    pmarie
    13 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-07-01T13:39:07Z  
    • mpemma
    • ‏2011-06-29T08:45:14Z
    Hi,
    Actually in the code given for particular security group in maximokb does not work for maximo 7.
    this is because : mro instatiation is not being recognized in maximo 7. New code needs to be appended for maximo7. Remove the instantiation line code. We tried Getting the app bean associated with the current start centre by adding path to the existing code and it worked.

    Thanks
    Manasa.
    Hello,
    I've made some progress but I still get a last error.

    Code :
    
    <%@ page import=
    "psdi.webclient.beans.startcntr.*" %>   <% 
    
    try 
    { StartCenterAppBean startcenter = (StartCenterAppBean)sessionContext.getCurrentApp().getAppBean(); psdi.mbo.MboRemote mbo = startcenter.getMbo(); String where = 
    "groupname = 'MAXADMIN' and userid in (select userid from maxuser where personid = '" + mbo.getUserInfo().getPersonId() + 
    "')"; psdi.mbo.MboSetRemote groups = mbo.getMboSet(
    "$GROUPUSER", 
    "GROUPUSER", where); groups.moveFirst(); 
    
    if ( !groups.isEmpty() ) 
    { %> <script type=text/javascript> setTimeout(
    ' window.location=window.location' ,10000); </script> <% 
    } 
    } 
    
    catch (Exception e) 
    { e.printStackTrace(); 
    } %>
    


    Error :
    
    JSPG0049E: /webclient/components/startcenter-options.jsp n
    'a pas r?ussi ? compiler :  JSPG0091E: Une erreur est survenue ? la ligne : 56 du fichier : /webclient/components/startcenter-options.jsp JSPG0093E: Erreur de servlet g?n?r?e ? partir du fichier : /webclient/components/startcenter-options.jsp C:\Program Files\IBM\WebSphere\AppServer\profiles\ctgAppSrv01\temp\ctgNode01\MXServer\MAXIMO\maximouiweb.war\webclient\components\_startcenter_2D_options.java : 352 : sessionContext cannot be resolved
    


    Do you have any idea??
  • mpemma
    mpemma
    20 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-07-04T13:15:39Z  
    • pmarie
    • ‏2011-07-01T13:39:07Z
    Hello,
    I've made some progress but I still get a last error.

    Code :
    <pre class="jive-pre"> <%@ page import= "psdi.webclient.beans.startcntr.*" %> <% try { StartCenterAppBean startcenter = (StartCenterAppBean)sessionContext.getCurrentApp().getAppBean(); psdi.mbo.MboRemote mbo = startcenter.getMbo(); String where = "groupname = 'MAXADMIN' and userid in (select userid from maxuser where personid = '" + mbo.getUserInfo().getPersonId() + "')"; psdi.mbo.MboSetRemote groups = mbo.getMboSet( "$GROUPUSER", "GROUPUSER", where); groups.moveFirst(); if ( !groups.isEmpty() ) { %> <script type=text/javascript> setTimeout( ' window.location=window.location' ,10000); </script> <% } } catch (Exception e) { e.printStackTrace(); } %> </pre>

    Error :
    <pre class="jive-pre"> JSPG0049E: /webclient/components/startcenter-options.jsp n 'a pas r?ussi ? compiler : JSPG0091E: Une erreur est survenue ? la ligne : 56 du fichier : /webclient/components/startcenter-options.jsp JSPG0093E: Erreur de servlet g?n?r?e ? partir du fichier : /webclient/components/startcenter-options.jsp C:\Program Files\IBM\WebSphere\AppServer\profiles\ctgAppSrv01\temp\ctgNode01\MXServer\MAXIMO\maximouiweb.war\webclient\components\_startcenter_2D_options.java : 352 : sessionContext cannot be resolved </pre>

    Do you have any idea??
    Hi ,
    try adding this: <mro:handleevent eventtype="pageinit"> I didnt remove it.
    I have added the same line of code which you have written.
  • pmarie
    pmarie
    13 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-07-04T13:42:32Z  
    • mpemma
    • ‏2011-07-04T13:15:39Z
    Hi ,
    try adding this: <mro:handleevent eventtype="pageinit"> I didnt remove it.
    I have added the same line of code which you have written.
    Hello,
    Thank you for your answer, unfortunately, even with this statement, sessionContext still cannot be resolved :( I don't understand why...

    I don't see its initialisation in the code so I guess the code assume it already exists but that doesn't seem to be the case...
  • ec3
    ec3
    27 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-07-20T20:28:24Z  
    • mpemma
    • ‏2011-04-19T14:24:16Z
    Hi,

    I got the problem resolved. It was not pointing to the correct bean class folder in Maximo7.

    Thanks Valavan.

    Regards
    Manasa.
    could you provide me with the syntax of the path used to instantiate the bean. I am also using Maximo 7 and getting the same error. In addition, I noticed the use of the namespace MRO. What did you use in the tags or do you not need to use MRO?
  • pmarie
    pmarie
    13 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-09-12T08:18:18Z  
    Hello,
    I was wondering if anyone had made some progress to make this code works in Maximo 7.

    Thanks in advance
  • crozwise
    crozwise
    63 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-09-12T08:22:12Z  
    • pmarie
    • ‏2011-09-12T08:18:18Z
    Hello,
    I was wondering if anyone had made some progress to make this code works in Maximo 7.

    Thanks in advance
    it works well on TSRM 7.2
  • pmarie
    pmarie
    13 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-09-12T08:28:22Z  
    • crozwise
    • ‏2011-09-12T08:22:12Z
    it works well on TSRM 7.2
    Hello crozwise,
    I tested it in TSRM 7.2.1 also and I still get the same error (cf my previous posts). The Javascript part that make the page refresh works pretty well indeed but I can't make it work with the JSP part that would activate it only for specific security groups.

    Could you please copy/paste here the code or send me the JSP file by mail or Sametime (Philippe MARIE in France).

    Thanks in advance
  • crozwise
    crozwise
    63 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-09-12T08:34:18Z  
    • pmarie
    • ‏2011-09-12T08:28:22Z
    Hello crozwise,
    I tested it in TSRM 7.2.1 also and I still get the same error (cf my previous posts). The Javascript part that make the page refresh works pretty well indeed but I can't make it work with the JSP part that would activate it only for specific security groups.

    Could you please copy/paste here the code or send me the JSP file by mail or Sametime (Philippe MARIE in France).

    Thanks in advance
    Oh i am sorry i didnt try with specific security groups, just refreshes the start center fo everyone as you did.
    i hope somebody will help you with that,

    Regards
  • pmarie
    pmarie
    13 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-09-12T14:46:00Z  
    • crozwise
    • ‏2011-09-12T08:34:18Z
    Oh i am sorry i didnt try with specific security groups, just refreshes the start center fo everyone as you did.
    i hope somebody will help you with that,

    Regards
    With the help of a colleague, i finally found what was missing! Here is the working code :

    
    <%@ page import=
    "psdi.webclient.beans.startcntr.*" %> <% 
    
    try 
    { SessionContext sessionContext = 
    
    new SessionContext(wcs); StartCenterAppBean startcenter = (StartCenterAppBean)sessionContext.getCurrentApp().getAppBean(); psdi.mbo.MboRemote mbo = startcenter.getMbo(); String where = 
    "groupname = 'ZEQUIPETECHNIQUE' and userid in (select userid from maxuser where personid = '" + mbo.getUserInfo().getPersonId() + 
    "')"; psdi.mbo.MboSetRemote groups = mbo.getMboSet(
    "$GROUPUSER", 
    "GROUPUSER", where); groups.moveFirst(); 
    
    if ( !groups.isEmpty() ) 
    { %> <script type=text/javascript> setTimeout(
    'window.location=window.location' ,10000); </script> <% 
    } 
    } 
    
    catch (Exception e) 
    { e.printStackTrace(); 
    } %>
    
  • taslima.vora
    taslima.vora
    39 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-09-14T14:06:51Z  
    • pmarie
    • ‏2011-09-12T14:46:00Z
    With the help of a colleague, i finally found what was missing! Here is the working code :

    <pre class="jive-pre"> <%@ page import= "psdi.webclient.beans.startcntr.*" %> <% try { SessionContext sessionContext = new SessionContext(wcs); StartCenterAppBean startcenter = (StartCenterAppBean)sessionContext.getCurrentApp().getAppBean(); psdi.mbo.MboRemote mbo = startcenter.getMbo(); String where = "groupname = 'ZEQUIPETECHNIQUE' and userid in (select userid from maxuser where personid = '" + mbo.getUserInfo().getPersonId() + "')"; psdi.mbo.MboSetRemote groups = mbo.getMboSet( "$GROUPUSER", "GROUPUSER", where); groups.moveFirst(); if ( !groups.isEmpty() ) { %> <script type=text/javascript> setTimeout( 'window.location=window.location' ,10000); </script> <% } } catch (Exception e) { e.printStackTrace(); } %> </pre>
    Hello Philippe Marie,

    Is this problem resolved?

    Thanks
  • pmarie
    pmarie
    13 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-09-14T14:19:14Z  
    Hello Philippe Marie,

    Is this problem resolved?

    Thanks
    Hello,
    Yes i solved my problem with the code I posted earlier.
  • crozwise
    crozwise
    63 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-09-20T13:10:41Z  
    • pmarie
    • ‏2011-09-14T14:19:14Z
    Hello,
    Yes i solved my problem with the code I posted earlier.
    Hi pmarie,

    COuld you tell me how did you define wcs?

    I think it is a defined name for WebClientSession class but i wonder how you assigned class reference to wcs.

    Thanks
  • pmarie
    pmarie
    13 Posts

    Re: Automatic Start Center Refreshing for 2mins.

    ‏2011-09-20T14:37:04Z  
    • crozwise
    • ‏2011-09-20T13:10:41Z
    Hi pmarie,

    COuld you tell me how did you define wcs?

    I think it is a defined name for WebClientSession class but i wonder how you assigned class reference to wcs.

    Thanks
    wcs variable was already existent :)