Hola, estoy teniendo una complicación la cual no puedo solucionar. Tengo este codigo que realizó para duplicar los archivos de una carpeta convirtiendolos en xml y agregando en el, las propiedades del archivo. Las 3 líneas principales funcionan correctamente, pero al agregar el xml.content + = me devuelve un error que me informa que el archivo al que le deseo agregar contenido no existe. Necesito crear el archivo y luego que lo busque para agregarle contenido. Alguien me puede ayudar? Gracias !!
var archivos = espacio; var propiedades = document.properties;
var xml = archivos.createFile (propiedades.name + ".metadata.properties.xml");
xml.content + = "<? xml version = '1.0' encoding = 'UTF-8'?>" + "\ n" +
"<! DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties .dtd '> "+" \ n "+
" <propiedades> "+" \ n "+
" <entrada clave =' tipo '> "+ propiedades.type +" </entry> "+" \ n "+
" <entrada clave = 'aspectos'> "+" cm: versionable, connexasAdministración: aspecto de administración "+" </entry> "+"
"<entry key = 'cm: description'>" + propiedades.description + "</entry>" + "\ n" +
"<entry key = 'cm: created'>" + propiedades.created + "</ entry > "+" \ n "+
" <entrada clave = 'connexasAdministration: sapstatus'> "+ propiedades.sapstatus +" </entry> "+" \ n "+
" </properties> ";
Esta prueba me ha funcionado sin problemas...
var propiedades = document.properties; var xml = document.createFile (propiedades.name + ".metadata.properties.xml"); xml.content = "Sample Text"; xml.save();
¿Qué versión de Alfresco estás utilizando?
Muchas gracias angel, por tu respuesta. Lo he intentado pero directamente no puedo ejecutar la regla. La version de alfresco es la 7.0.0 acs enterprise edition. Intento ver el log para ver que tipo de error me da, pero no muestra nada.
Me ha lanzado el siguiente error
2021-11-29 14:02:38,442 ERROR [node.integrity.IntegrityChecker] [http-nio-8080-exec-5] Found 2 integrity violations:The association source type is incorrect: Source Node: workspace://SpacesStore/a40f0c27-905d-4e89-985d-e15c657b879f Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/content/1.0}folder], name={http://www.alfresco.org/model/content/1.0}contains, target class={http://www.alfresco.org/model/system/1.0}base, source role=null, target role=null] Required Source Type: {http://www.alfresco.org/model/content/1.0}folder Actual Source Type: {http://www.alfresco.org/model/content/1.0}contentThe association source type is incorrect: Source Node: workspace://SpacesStore/268eb66d-4739-4bf8-8512-a5e910e2d2b1 Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/content/1.0}folder], name={http://www.alfresco.org/model/content/1.0}contains, target class={http://www.alfresco.org/model/system/1.0}base, source role=null, target role=null] Required Source Type: {http://www.alfresco.org/model/content/1.0}folder Actual Source Type: {http://www.alfresco.org/model/content/1.0}content
2021-11-29 14:02:38,474 ERROR [extensions.webscripts.AbstractRuntime] [http-nio-8080-exec-5] Exception from executeScript: 10290021 Found 2 integrity violations:The association source type is incorrect: Source Node: workspace://SpacesStore/a40f0c27-905d-4e89-985d-e15c657b879f Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/content/1.0}folder], name={http://www.alfresco.org/model/content/1.0}contains, target class={http://www.alfresco.org/model/system/1.0}base, source role=null, target role=null] Required Source Type: {http://www.alfresco.org/model/content/1.0}folder Actual Source Type: {http://www.alfresco.org/model/content/1.0}contentThe association source type is incorrect: Source Node: workspace://SpacesStore/268eb66d-4739-4bf8-8512-a5e910e2d2b1 Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/content/1.0}folder], name={http://www.alfresco.org/model/content/1.0}contains, target class={http://www.alfresco.org/model/system/1.0}base, source role=null, target role=null] Required Source Type: {http://www.alfresco.org/model/content/1.0}folder Actual Source Type: {http://www.alfresco.org/model/content/1.0}content
org.alfresco.repo.node.integrity.IntegrityException: 10290021 Found 2 integrity violations:
The association source type is incorrect:
Source Node: workspace://SpacesStore/a40f0c27-905d-4e89-985d-e15c657b879f
Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/content/1.0}folder], name={http://www.alfresco.org/model/content/1.0}contains, target class={http://www.alfresco.org/model/system/1.0}base, source role=null, target role=null]
Required Source Type: {http://www.alfresco.org/model/content/1.0}folder
Actual Source Type: {http://www.alfresco.org/model/content/1.0}content
The association source type is incorrect:
Source Node: workspace://SpacesStore/268eb66d-4739-4bf8-8512-a5e910e2d2b1
Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/content/1.0}folder], name={http://www.alfresco.org/model/content/1.0}contains, target class={http://www.alfresco.org/model/system/1.0}base, source role=null, target role=null]
Required Source Type: {http://www.alfresco.org/model/content/1.0}folder
Actual Source Type: {http://www.alfresco.org/model/content/1.0}content
En el ejemplo "document" debe ser una carpeta.
Solo pueden crearse documentos debajo de una carpeta.
Discussions about Alfresco Content Services and Alfresco Process Services in Spanish
Related:
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.