Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: Is there any way to send a real time message to Windchill users via the Windchill interface?

$
0
0

We have a message that is displayed in our header, that is controlled in the begin_custom.jspf file. By default it will only show a new message on restart of your system, which will not meet your needs.

 

What we did to address this is put some javascript into the begin_custom.jspf to read a file from the server each time the page was called. We can now change the contents of the text file that is read in and a new message will appear.

 

We included these two imports in the begin_custom.jspf file

<%@page import="java.io.FileReader"%>

<%@page import="java.io.BufferedReader"%>

 

We also added some style which i'm omitting

 

then where we want the message to appear we had the following code

 

<div class="boxStyle" >
<!-- Banner begins here -->
<%
BufferedReader reader2 = new BufferedReader(new FileReader(application.getRealPath("/") + "netmarkets/jsp/util/FILENAME.txt"));
StringBuilder sb2 = new StringBuilder();
String line2;

 

while((line2 = reader2.readLine())!= null){
sb2.append(line2+"\n");
}
out.println(sb2.toString());
%>
<!-- Banner ends here -->
</div>

 

 

In the text file put whatever text/html you want to display. Change as necessary and watch the message update the next time the page is reloaded. You could probably get fancier and add some AJAX if you wanted the message to update on the page without the user refreshing the page, but that wasn't what we needed.


Viewing all articles
Browse latest Browse all 8876

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>