cancel
Showing results for 
Search instead for 
Did you mean: 

Finding out the document owners history.

evolmark
Champ in-the-making
Champ in-the-making
Hi, is there a way to retrieve what users have owned a document. We want to be able to reassign the document to any of those.

Thanks!!!
3 REPLIES 3

andy
Champ on-the-rise
Champ on-the-rise
Hi

ATM, only if you have the document versioned.
A muli-valued attribute could be added to the aspect in the model and set in the Service to track ownership.

Andy

evolmark
Champ in-the-making
Champ in-the-making
Thanks for your response, my code looks like this so far. I will be working from a workflow.

I dont know how to define the multivalued property and set its from the workflow. My partial solution



      <!– The following items allow to keep track of the different owners in the document –>
      <type name="sw:ownerhistoryitem">
         <title>Owner history Item</title>
         <properties>
            <property name="sw:ownerusername">
               <title>Username</title>
               <type>d:text</type>
            </property>
            <property name="sw:owningdate">
               <title>Date of Ownership</title>
               <type>d:date</type>
            </property>
         </properties>
      </type>
      
      
      <aspect name="sw:ownerhistory">
         <title>Playlist</title>
         <associations>
            <association name="sw:ownerhistoryitem">
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>sw:ownerhistoryitem</class>
                  <mandatory>true</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>
      </aspect>

and in the workflow

<event type="task-assign">
            <action
               class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                  //Adds versioning to the document to help in the   workflow
                  var actor =   search.luceneSearch("@cm\\:userName:\"" + taskInstance.actorId + "\"");
                  var props = new   Array(2);
                  props["sw:ownerusername"] =   actor.properties["cm:userName"];
                  props["sw:owningdate"] = new   Date().toGMTString() ;
                  for (var i = 0; i < bpm_package.children.length; i++) {
                     bpm_package.children[i].addAspect("sw:ownerhistory",props);
                     bpm_package.children[i].save();
                  }
               </script>
            </action>
         </event>



http://forums.alfresco.com/viewtopic.php?6753, but for us upgrading to 2.1 is not an option right now.

Any ideas

andy
Champ on-the-rise
Champ on-the-rise
Hi

You could also use auditing which may be easier.

Andy