As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<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')}
<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());