cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLUCIONADO]Ver cambios en el historial de versiones

rubenlor
Champ in-the-making
Champ in-the-making
Hola a todos,

Soy nuevo en Alfresco, y cualquier ayuda me vendrá bien, estoy en punto muerto y no se por donde avanzar.

He creado un nuevo modelo (content type) con sus propiedades, ahora lo que quiero es que cuando se guarde una nueva versión se pueda ver los cambios realizados en ciertas propiedades.

Por ejemplo, yo he creado un modelo que tiene estas propiedades
Numero de Registro
Fecha de registro
Tipo de Registro
Tramite a realizar

Lo que busco, es que en el historial de versiones se pueda ver el valor de Numero de Registro, Fecha de registro, Tipo de Registro

Yo habia pensado en crear una acción, que se disparé cuando se hace check in y añada estos campos en las notas, pero….
no sé como hacer que aparezca el valor de estas propiedades
2 REPLIES 2

rubenlor
Champ in-the-making
Champ in-the-making
Hola

he tirado por hacer una view (.ftl), encontre un código que emula el historial de versiones, es decir muestra lo mismo,

<html><head></head>
<body>
<#– Table of docs in a specific folder –>
<h3>${space.name} documents</h3>
<table cellpadding=2 border=0 style="BORDER: 1px;">
    <tr align=left><th>Version</th><th>Name</th><th>Description</th><th>Created Date</th><th>Creator</th><th>saaqashhas</th></tr>
      <#list document.versionHistory as record>
         <tr>
            <td><a href="/alfresco${record.url}" target="new">${record.versionLabel}</a></td>
            <td><a href="/alfresco${record.url}" target="new">${record.name}</a></td>
            <td><#if record.description?exists>${record.description}</#if></td>
            <td>${record.createdDate?datetime}</td>
            <td>${record.creator}</td>

<td>
aaa</td>


         </tr>
            </#list>     
</table>
</body>
</html>

Cómo soy muy nuevo no he encontrado el API para poder modificar esto, ¿alguna idea sobre el api?

y lo que quiero hacer, ahora que estoy recorriendo cada versión, sería acceder a los datos del modelo en cada versión, ¿alguna idea sobre esto otro?

rubenlor
Champ in-the-making
Champ in-the-making
Lo solucione, para quien lo quiera saber
custom model

<?xml version="1.0" encoding="UTF-8"?>

<model name="demo:demomodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Demo Model</description>
   <author>Rubenlor/author>
   <version>1.3</version>

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <namespaces>
      <namespace uri="http://www.alfresco.com/content/1.0" prefix="demo"/>
   </namespaces>
   <types>
   
      <type name="demo:demomodel">
         <title>demo model</title>
         <parent>cm:content</parent>
            <properties>

<property name="demo:tipodocumento">
<title>Tipo de Documento</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>


<property name="demo:fechadocumento">
<title>Fecha del documento</title>
<type>d:date</type>
</property>


<property name="demo:contenido">
<title>Contenido</title>
<type>d:text</type>
</property>
</properties>
            
         
            <mandatory-aspects>
               <aspect>cm:versionable</aspect>
            </mandatory-aspects>
   
      </type>

view template

<#list document.versionHistory as record>
<#if record.properties["demo:tipodocumento"]?exists>
${record.properties["demo:tipodocumento"]}
</#if>
<#if record.properties["demo:fechadocumento"]?exists>
${record.properties["demo:fechadocumento"]}
</#if>
<#if record.properties["demo:contenido"]?exists>
${record.properties["demo:contenido"]}
</#if>
</#list>