<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="xsl/top.xsl"/>
<xsl:import href="xsl/bottom.xsl"/>
<xsl:import href="xsl/templatelib.xsl"/>
<xslutput method="html" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<title>Lista campagne</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
</head>
<script src="root/javascript/deployJava.js"/>
<script>
var attributes = { id:'demone', code:'it.tlsoft.qualita.beans.DaemonSingleton', width:1, height:1} ;
var parameters = {jnlp_href: 'math-applet.jnlp'} ;
deployJava.runApplet(attributes, null, null);
</script>
<SCRIPT language="JavaScript">
function controllaAsync(nomePagina){
var aggiorna = 0;
var demone = DaemonSingleton.getInstance();
var nomeDemone2 = demone.getNomeDemone();
alert(nomePagina);
alert(nomeDemone2);
}
</SCRIPT>
<body onFocus="controllaAsync('lista campagne')" bgcolor="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" topmargin="10" leftmargin="10">
<table width="800" border="0" cellspacing="0" cellpadding="0" align="left">
<tr><td>
<xsl:apply-templates select="pgcampagne/frmcampagne/top_AM"/>
<xsl:apply-templates select="pgcampagne/frmcampagne/top_UT"/>
</td></tr>
<tr><td><xsl:apply-templates/></td></tr>
<tr><td><xsl:apply-templates select="pgcampagne/frmcampagne/bottom"/></td></tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="pgcampagne">
<xsl:variable name="titolo">
<xsl:value-of select="frmcampagne/title"/>
</xsl:variable>
<table bgcolor="#0099FF">
<tr>
<td> - Modifica la campagna DANIELE -</td>
</tr>
</table>
<table width="800" align="center"><tr><td class="fontTitle" valign="top">
<div align="left">[img]images\trasp.gif[/img] [img]images/arrow_title.gif[/img]Lista
delle Campagne     </div>
<form name="form1" method="post" action="">
<table width="700" border="0" cellspacing="1" cellpadding="0" align="center">
<tr align="center" valign="middle">
<td height="20" width="50" bgcolor="#009DD9" align="left" valign="top">[img]images/angolo_alto_sx.gif[/img]</img></td>
<td height="20" width="200" bgcolor="#009DD9" class="FontWhite">
Nome
</td>
<td height="20" width="200" bgcolor="#009DD9" class="FontWhite">
Operatore
</td>
<td height="20" width="130" bgcolor="#009DD9" class="FontWhite">
Tipo
</td>
<td height="20" width="130" bgcolor="#009DD9" class="FontWhite">
PG-TX
</td>
<td height="20" width="130" bgcolor="#009DD9" class="FontWhite">
Data Scadenza
</td>
<td height="20" width="270" bgcolor="#009DD9" class="FontWhite">
Note
</td>
<td height="20" width="50" align="right" valign="top" bgcolor="#009DD9">[img]images/angolo_alto_dx.gif[/img]</td>
</tr>
<xsl:apply-templates select="frmcampagne/campagnelist/body/row"/>
<tr valign="middle" align="center" bgcolor="#009DD9">
<td height="6" colspan="8" align="left" valign="bottom">
<xsl:call-template name="paginazione">
<xsl:with-param name="href">
<xsl:value-of select="frmcampagne/pager/hrefpag/href"/>
</xsl:with-param>
<xsl:with-param name="pagina">
<xsl:value-of select="frmcampagne/pager/pagina"/>
</xsl:with-param>
<xsl:with-param name="first">
<xsl:value-of select="frmcampagne/pager/first/href"/>
</xsl:with-param>
<xsl:with-param name="last_value">
<xsl:value-of select="frmcampagne/pager/last/desc"/>
</xsl:with-param>
<xsl:with-param name="last">
<xsl:value-of select="frmcampagne/pager/last/href"/>
</xsl:with-param>
<xsl:with-param name="prev">
<xsl:value-of select="frmcampagne/pager/prev/href"/>
</xsl:with-param>
<xsl:with-param name="next">
<xsl:value-of select="frmcampagne/pager/next/href"/>
</xsl:with-param>
<xsl:with-param name="vaiPag">
<xsl:value-of select="frmcampagne/pager/vaiPag/href"/>
</xsl:with-param>
<xsl:with-param name="form">0</xsl:with-param>
</xsl:call-template>
</td>
</tr>
</table>
</form>
</td></tr></table>
</xsl:template>
<xsl:template match="frmcampagne/campagnelist/body/row">
<xsl:choose>
<xsl:when test="((position())mod 2) = 1">
<xsl:call-template name="riga">
<xsl:with-param name="color">
images/sfondo_casella_sopra.gif
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsltherwise>
<xsl:call-template name="riga">
<xsl:with-param name="color">
images/sfondo_casella_sotto.gif
</xsl:with-param>
</xsl:call-template>
</xsltherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="riga">
<xslaram name="color"/>
<tr valign="middle" align="center">
<td height="20" width="50">
<xsl:attribute name="background">
<xsl:value-of select="normalize-space($color)"/>
</xsl:attribute>
[img]images/quadratino_rosso.gif[/img]
</td>
<td height="20" width="200" class="FontTitle">
<xsl:attribute name="background">
<xsl:value-of select="normalize-space($color)"/>
</xsl:attribute>
<xsl:value-of select="id"/>
</td>
<xsl:variable name="tipo"><xsl:value-of select="operatore"/></xsl:variable>
<td height="20" width="200" class="FontTitle">
<xsl:attribute name="background">
<xsl:value-of select="normalize-space($color)"/>
</xsl:attribute>
<xsl:value-of select="operatore"/>
</td>
<td height="20" width="130" class="FontTitle">
<xsl:attribute name="background">
<xsl:value-of select="normalize-space($color)"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$tipo='-'">Pubblica</xsl:when>
<xsltherwise>Privata</xsl
therwise>
</xsl:choose>
</td>
<td height="20" width="130" class="FontTitle">
<xsl:attribute name="background">
<xsl:value-of select="normalize-space($color)"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="flag_pgtx = 1">SI</xsl:when>
<xsltherwise>-</xsl
therwise>
</xsl:choose>
</td>
<td height="20" width="270" class="FontTitle">
<xsl:attribute name="background">
<xsl:value-of select="normalize-space($color)"/>
</xsl:attribute>
<xsl:value-of select="data_scadenza"/>
</td>
<td height="20" width="270" class="FontTitle">
<xsl:attribute name="background">
<xsl:value-of select="normalize-space($color)"/>
</xsl:attribute>
<xsl:value-of select="note"/>
</td>
<td height="20" width="50">
<xsl:attribute name="background">
<xsl:value-of select="normalize-space($color)"/>
</xsl:attribute>
<xsl:if test="riferimenti/menu">
<script>arMenu<xsl:value-of select="position()+6"/> = new Array(80,"","","#004793","white","white","#098EFF" ,"#098EFF","#098EFF",<xsl:apply-templates select="riferimenti/menu"/>)
</script>
<a href="javascript:void(0)" >
<xsl:attribute name="onMouseOut">
popDown('elMenu<xsl:value-of select="position()+6"/>')
</xsl:attribute>
<xsl:attribute name="onClick">
popUp('elMenu<xsl:value-of select="position()+6"/>',event);return false;
</xsl:attribute>
[img]images/quadratino.jpg[/img]
</a>
</xsl:if>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
<metaInformation>
<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
</metaInformation>
-->
package it.tlsoft.qualita.beans;
import com.jnetx.util.Log;
import java.awt.*;
import java.applet.Applet;
import java.util.*;
public class DaemonSingleton extends Applet{
private static DaemonSingleton instance = null;
private static Map asincroni = null;
private static String nome = "Daemon Singleton";
protected DaemonSingleton(){
asincroni = new TreeMap();
}
public static DaemonSingleton getInstance(){
if(instance == null){
instance = new DaemonSingleton();
Log.note("Istanza creata perchè il demone non era istanziato.");
} else {
Log.note("Il demone è già in piedi e quindi non è necessario istanziarlo.");
}
return instance;
}
public String getNomeDemone(){
return nome;
}
public void aggiornaAsync(String nomePagina){
Integer valore = getValoreAsync(nomePagina);
int val = valore.intValue();
val++;
asincroni.put(nomePagina, new Integer(val));
printAsync();
}
public Integer getValoreAsync(String nomePagina){
String pagina = (String)asincroni.get(nomePagina);
Integer valore = (Integer)asincroni.get(nomePagina);
return valore;
}
public void insertAsync(String nomePagina){
boolean pagina = (boolean)asincroni.containsKey(nomePagina);
if(!pagina)
asincroni.put(nomePagina, new Integer(0));
printAsync();
}
public void printAsync(){
Set chiavi = asincroni.keySet();
Iterator it = chiavi.iterator();
while(it.hasNext()){
String chiave = (String)it.next();
Integer valore = (Integer)asincroni.get(chiave);
Log.note(chiave+" --> "+valore);
}
}
}
Questo è quello ke ho. Credo ke demone debba essere poi utilizzato per invocare i metodi.
Grazie ancora...