Hi all.I add to my webscript a new script config file "nodeAct.get.config.xml" to use that values in "nodeAct.get.js" and "nodeAct.get.html.ftl".but when I try to get show the value in the ftl i get the next error:
500 Description: An error inside the HTTP server which prevented it from fulfilling the request.
Message: Wrapped Exception (with status template): 'Error on line 26, column 31 in nodeAct.get.html.ftl Expecting a string, date or number here, Expression uname is instead a freemarker.template.SimpleHash'.
Exception: freemarker.core.NonStringException - Error on line 26, column 31 in nodeAct.get.html.ftl Expecting a string, date or number here, Expression uname is instead a freemarker.template.SimpleHash
This is my "nodeAct.get.html.ftl"
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery.support.cors = true;
var urlTicket = "${url.serviceContext}/api/login?u=${user}&pw=${pass}";
var ticket = "";
var request = $.get(urlTicket, function(data,status){
ticket = data.toString().substring(48,95);
//window.location.href = "${url.serviceContext}/doAct?nId=${nId}${arguments}&alf_ticket="+ticket;
},'html'
);
request.error(function(jqXHR, textStatus) {
if (textStatus == 'error'){
status.code = 403;
status.message = "User not found.";
status.redirect = true;
}
});
</script>
<title>Doing actions</title>
</head>
<body>
<div id="error-box" >
<br />
<br /><td>nombre= ${uname}</td>
</div>
</body>
</html>
this is the error line
<br /><td>nombre= ${uname}</td>
And this is the "nodeAct.get.js" where i define the uname variable:
var s = new XML(config.script);
model.uname =s.nodeAct.nombre;
I also try with : - model.uname =s.nombre; - model.uname =s.nodeAct.clave; - model.uname =s.clave;But i get the same error, and i finally try callin a non xml variable defined ( model.uname=s.notExist
and I get the same error.I try all defined in https://wiki.alfresco.com/wiki/Web_Scripts#Configuration.What am i doing wrong??I'm using alfresco 3.0 if it's relevant.Thanks a lot in advance