<table>
<tr>
<td><#list space.children as child>
<#if child.isDocument && (child.mimetype = "application/pdf")>
<a href="/alfresco${child.url}" target="new"><embed src="/alfresco${child.url}"width="500" height="700"></embed>
</#if>
</#list>
</td>
<td>
<#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"] as child>
<table>
<tr>
<td>Fecha de emision:</td><td> <input type="text" name="fecha" value=${child.properties["custom:fecha"]?datetime}></td>
</tr>
<tr>
<td>CIF de la empresa emisora:</td><td><input type="text" name="CIF" value=${child.properties["custom:CIF"]}> </td>
</tr>
<tr>
<td>Numero de factura: </td><td><input type="text" name="num_factura" value= ${child.properties["custom:numfactura"]}></td>
</tr>
<tr>
<td>Precio Base: </td><td><input type="text" name="Base" value=${child.properties["custom:base"]}></td>
</tr>
<tr>
<td>Iva: </td><td><input type="text" name="Iva" value= ${child.properties["custom:iva"]}></td>
</tr>
<tr>
<td>Precio Total:</td><td><input type="text" name="Total" value=${child.properties["custom:total"]}></td>
</tr>
<tr>
<td><input type=submit value="Rechazar"> </td><td><input type="submit" value="Aprobar" onclick=${aceptarFactura('child')}></td>
</tr>
</#if> </#list>
</table>
</td>
</tr>
</table>
onclick=${aceptarFactura('child')}
pero no llega a ejecutarse. Veis algo que pueda estar mal?<html>
<body>
<table>
<tr>
<td>
<#list space.children as child>
<#if child.isDocument && (child.mimetype = "application/pdf")>
<a href="/alfresco${child.url}" target="new"><embed src="/alfresco${child.url}"width="500" height="700"></embed>
</#if>
</#list>
</td>
<td>
<table>
<#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"] as child>
<form method="post" action=${aceptarFactura(child)}>
<tr>
<td>Fecha de emision:</td><td> <input type="text" name="fecha" value=${child.properties["custom:fecha"]?datetime}></td>
</tr>
<tr>
<td>CIF de la empresa emisora:</td><td><input type="text" name="CIF" value=${child.properties["custom:CIF"]}> </td>
</tr>
<tr>
<td>Numero de factura: </td><td><input type="text" name="num_factura" value= ${child.properties["custom:numfactura"]}></td>
</tr>
<tr>
<td>Precio Base: </td><td><input type="text" name="Base" value= ${child.properties["custom:base"]}></td>
</tr>
<tr>
<td>Iva: </td><td><input type="text" name="nombre" value= ${child.properties["custom:iva"]}></td>
</tr>
<tr>
<td>Precio Total:</td><td><input type="text" name="nombre" value=${child.properties["custom:total"]}></td>
</tr>
<tr>
<td><input type=submit name="revisar" value="guardar" ></td>
</tr>
</form> </#list> </table>
</td>
</tr>
</table>
</body>
</html>
public Object exec(List args) throws TemplateModelException
{
System.out.println("Entra en guardar metadatos");
int result = 0;
Boolean mover = true;
if (args.size() == 1)
{
System.out.println("Entra en el primer if");
Object arg0 = args.get(0);
if (arg0 instanceof TemplateNodeModel)
{
System.out.println("Entra en la instancia");
Node documento = (Node)arg0;
Map<QName, Serializable> properties = this.nodeService.getProperties(documento.getNodeRef());
//Guarda las propiedades del documento antes de moverlo
this.services.getNodeService().setProperties(documento.getNodeRef(), properties);
QName fecha_factura = QName.createQName("custom.model", "fecha");
QName numfactura = QName.createQName("custom.model", "numfactura");
QName cif = QName.createQName("custom.model", "CIF");
QName base = QName.createQName("custom.model", "base");
QName iva = QName.createQName("custom.model", "iva");
QName total = QName.createQName("custom.model", "total");
Map<String, Object> map = new HashMap<String, Object>();
map.put("fecha", documento.getProperties().get(fecha_factura));
map.put("numfactura", documento.getProperties().get(numfactura));
map.put("cif", documento.getProperties().get(cif));
map.put("base", documento.getProperties().get(base));
map.put("iva", documento.getProperties().get(iva));
map.put("total", documento.getProperties().get(total));
Iterator it = map.entrySet().iterator();
do{
System.out.println("Entra en la funcion node");
if((it.next() == null)||(it.next() == "")){
mover = false;
break;
}
} while(it.hasNext());
if (arg0 instanceof TemplateNodeModel)
System.out.println(arg0.getClass());
en la consola me dice lo siguiente: class freemarker.template.StringModelContent from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.